:root {
  --bg: #05070b;
  --card-bg: rgba(7, 12, 19, 0.40);
  --panel-bg: rgba(5, 10, 16, 0.36);
  --bubble-bg: rgba(8, 13, 20, 0.62);
  --bubble-user: rgba(27, 39, 66, 0.62);
  --border: rgba(122, 162, 255, 0.24);
  --line: rgba(255, 255, 255, 0.10);
  --text: #f3f5f7;
  --muted: #cdd4dd;
  --soft: #a2abbb;
  --blue: #7aa2ff;
  --shadow: 0 24px 80px rgba(0, 0, 0, 0.24);
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
  background: var(--bg);
}

body {
  position: relative;
  overflow-x: hidden;
  font-family: Georgia, "Times New Roman", serif;
  color: var(--text);
}

.page-background {
  position: fixed;
  inset: 0;
  background-color: #05070b;
  background-image: url("/static/assets/nietzsche-bg.jpg");
  background-size: 80%;
  background-position: center center;
  background-repeat: no-repeat;
  z-index: 0;
  transform: scale(0.96);
  transform-origin: center center;
}

.background-tint {
  position: fixed;
  inset: 0;
  background:
    linear-gradient(
      to bottom,
      rgba(3, 6, 10, 0.10),
      rgba(3, 6, 10, 0.16),
      rgba(3, 6, 10, 0.22)
    );
  z-index: 1;
  pointer-events: none;
}

.background-glow {
  position: fixed;
  inset: 0;
  background:
    radial-gradient(circle at top left, rgba(122, 162, 255, 0.10), transparent 32%),
    radial-gradient(circle at bottom right, rgba(122, 162, 255, 0.05), transparent 24%);
  z-index: 2;
  pointer-events: none;
}

.app-shell {
  position: relative;
  z-index: 3;
  min-height: 100vh;
  display: flex;
  align-items: stretch;
  justify-content: center;
  padding: 28px 20px;
}

.chat-card {
  width: 100%;
  max-width: 1180px;
  min-height: calc(100vh - 56px);
  display: grid;
  grid-template-rows: auto 1fr auto auto;
  gap: 18px;
  padding: 28px;
  border-radius: 28px;
  background: var(--card-bg);
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
  backdrop-filter: blur(3px);
  -webkit-backdrop-filter: blur(3px);
}

.hero-header {
  padding: 8px 4px 0;
}

.eyebrow {
  margin: 0 0 10px;
  font-family: Arial, Helvetica, sans-serif;
  font-size: 0.82rem;
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--blue);
}

h1 {
  margin: 0;
  font-size: clamp(2.8rem, 6vw, 5rem);
  line-height: 0.96;
  letter-spacing: -0.04em;
}

.description {
  max-width: 820px;
  margin: 18px 0 0;
  font-size: 1.08rem;
  line-height: 1.75;
  color: var(--muted);
}

.chat-feed {
  display: flex;
  flex-direction: column;
  gap: 18px;
  min-height: 0;
  overflow-y: auto;
  padding: 6px 4px 6px;
}

.suggestions-panel {
  padding: 16px 18px;
  border: 1px solid rgba(122, 162, 255, 0.14);
  border-radius: 20px;
  background: rgba(9, 14, 22, 0.42);
  backdrop-filter: blur(3px);
  -webkit-backdrop-filter: blur(3px);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.03);
}

.suggestions-title {
  margin: 0 0 12px;
  font-family: Arial, Helvetica, sans-serif;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--soft);
}

.suggestions-list {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.suggestion-chip {
  border: 1px solid rgba(122, 162, 255, 0.22);
  background:
    linear-gradient(
      180deg,
      rgba(122, 162, 255, 0.14),
      rgba(122, 162, 255, 0.08)
    );
  color: var(--text);
  border-radius: 999px;
  padding: 10px 16px;
  font-family: Arial, Helvetica, sans-serif;
  font-size: 0.92rem;
  font-weight: 600;
  line-height: 1.2;
  cursor: pointer;
  box-shadow:
    0 10px 24px rgba(0, 0, 0, 0.16),
    inset 0 1px 0 rgba(255, 255, 255, 0.05);
  transition:
    transform 0.15s ease,
    background 0.15s ease,
    border-color 0.15s ease,
    box-shadow 0.15s ease;
}

.suggestion-chip:hover {
  transform: translateY(-1px);
  border-color: rgba(122, 162, 255, 0.34);
  background:
    linear-gradient(
      180deg,
      rgba(122, 162, 255, 0.18),
      rgba(122, 162, 255, 0.11)
    );
  box-shadow:
    0 14px 30px rgba(0, 0, 0, 0.22),
    inset 0 1px 0 rgba(255, 255, 255, 0.07);
}

.suggestion-chip:disabled {
  opacity: 0.6;
  cursor: wait;
  transform: none;
}

.message {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.message.user {
  align-items: flex-end;
}

.message-role {
  font-family: Arial, Helvetica, sans-serif;
  font-size: 0.76rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--soft);
}

.message-bubble {
  width: min(860px, 100%);
  padding: 18px 20px;
  border-radius: 22px;
  border: 1px solid var(--line);
  background: var(--bubble-bg);
  backdrop-filter: blur(2px);
  -webkit-backdrop-filter: blur(2px);
}

.message.user .message-bubble {
  background: var(--bubble-user);
}

.message-bubble p {
  margin: 0 0 14px;
  line-height: 1.75;
  font-size: 1.02rem;
}

.message-bubble p:last-child {
  margin-bottom: 0;
}

.meta-block {
  margin-top: 16px;
  padding-top: 14px;
  border-top: 1px solid var(--line);
}

.meta-title {
  margin: 0 0 10px;
  font-family: Arial, Helvetica, sans-serif;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--soft);
}

.chip-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.chip {
  display: inline-flex;
  align-items: center;
  padding: 7px 10px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: rgba(122, 162, 255, 0.10);
  font-family: Arial, Helvetica, sans-serif;
  font-size: 0.84rem;
  color: var(--text);
}

.citation-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.citation-item {
  padding: 12px 14px;
  border-radius: 14px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.03);
}

.citation-source {
  margin: 0 0 6px;
  font-family: Arial, Helvetica, sans-serif;
  font-size: 0.84rem;
  font-weight: 700;
  color: var(--text);
}

.citation-excerpt {
  margin: 0;
  font-size: 0.95rem;
  line-height: 1.65;
  color: var(--muted);
}

.chat-form {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding-top: 4px;
}

.chat-form textarea {
  width: 100%;
  min-height: 110px;
  resize: vertical;
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 16px 18px;
  background: var(--panel-bg);
  color: var(--text);
  font: inherit;
  line-height: 1.6;
  outline: none;
  backdrop-filter: blur(2px);
  -webkit-backdrop-filter: blur(2px);
}

.chat-form textarea::placeholder {
  color: var(--soft);
}

.chat-form textarea:focus {
  border-color: rgba(122, 162, 255, 0.45);
  box-shadow: 0 0 0 3px rgba(122, 162, 255, 0.10);
}

.form-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.form-status {
  margin: 0;
  font-family: Arial, Helvetica, sans-serif;
  font-size: 0.92rem;
  color: var(--muted);
}

.chat-form button#send-button {
  border: 1px solid rgba(122, 162, 255, 0.38);
  background: rgba(122, 162, 255, 0.16);
  color: var(--text);
  border-radius: 14px;
  padding: 12px 18px;
  font-family: Arial, Helvetica, sans-serif;
  font-size: 0.96rem;
  font-weight: 700;
  cursor: pointer;
}

.chat-form button#send-button:disabled {
  opacity: 0.65;
  cursor: wait;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

@media (max-width: 900px) {
  .chat-card {
    padding: 22px;
  }

  h1 {
    font-size: clamp(2.4rem, 9vw, 4.2rem);
  }

  .description {
    font-size: 1rem;
  }

  .page-background {
    background-size: cover;
    background-position: center center;
    transform: scale(1);
  }
}

@media (max-width: 640px) {
  .app-shell {
    padding: 12px;
  }

  .chat-card {
    min-height: calc(100vh - 24px);
    padding: 16px;
    border-radius: 20px;
  }

  .suggestions-panel {
    padding: 14px 14px;
    border-radius: 16px;
  }

  .suggestion-chip {
    padding: 9px 14px;
    font-size: 0.88rem;
  }

  .message-bubble {
    width: 100%;
    padding: 16px;
    border-radius: 18px;
  }

  .chat-form textarea {
    min-height: 96px;
  }

  .form-row {
    align-items: stretch;
    flex-direction: column;
  }

  .chat-form button#send-button {
    width: 100%;
  }
}