/* Palette: warm near-black ground, one volt accent. Values are the oklch set
   from the design canvas, converted once and pinned as hex. */
:root {
  --page: #0b0a08;
  --surface: #161511;
  --raised: #1f1e19;
  --bubble: #292822;
  --line: #35332c;
  --line-soft: #25241f;
  --text: #f4f3f0;
  --dim: #a6a59e;
  --faint: #76746e;
  --volt: #bbe845;
  --volt-deep: #8fb51f;
  --radius: 18px;
}

* { box-sizing: border-box; }

html, body {
  height: 100%;
  margin: 0;
}

body {
  background: var(--page);
  color: var(--text);
  font-family: "Hanken Grotesk", "Helvetica Neue", Arial, sans-serif;
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
  overflow: hidden;
}

.dsp {
  font-family: "Archivo Black", "Helvetica Neue", "Arial Black", Arial, sans-serif;
  font-weight: 400;
}

/* ---------- atmosphere ---------- */

.bg-grid,
.bg-glow {
  position: fixed;
  pointer-events: none;
  z-index: 0;
}

.bg-grid {
  inset: 0;
  background-image:
    linear-gradient(to right, rgba(255, 255, 255, 0.028) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(255, 255, 255, 0.028) 1px, transparent 1px);
  background-size: 72px 72px;
}

.bg-glow {
  left: 50%;
  top: -220px;
  width: min(1100px, 140vw);
  height: 700px;
  transform: translateX(-50%);
  background: radial-gradient(ellipse at center,
    rgba(187, 232, 69, 0.16), rgba(187, 232, 69, 0.04) 42%, transparent 70%);
  filter: blur(10px);
  transition: opacity 0.6s ease;
}

body.state-chat .bg-glow { opacity: 0.28; }

/* ---------- shell ---------- */

.shell {
  position: relative;
  z-index: 1;
  height: 100%;
  display: flex;
  flex-direction: column;
}

.topbar {
  flex-shrink: 0;
  height: 72px;
  padding: 0 40px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  border-bottom: 1px solid var(--line-soft);
  background: rgba(11, 10, 8, 0.86);
  backdrop-filter: blur(8px);
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
}

.mark {
  width: 30px;
  height: 30px;
  border-radius: 8px;
  background: var(--volt);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.mark svg { display: block; }

.wordmark {
  font-size: 17px;
  letter-spacing: 0.06em;
}

.tag {
  font-size: 10px;
  letter-spacing: 0.14em;
  color: var(--faint);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 4px 8px;
}

.ghost-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  height: 44px;
  padding: 0 18px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: transparent;
  color: var(--dim);
  font: inherit;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: border-color 0.16s ease, color 0.16s ease;
}

.ghost-btn:hover {
  border-color: var(--volt);
  color: var(--text);
}

.ghost-btn svg { display: block; }

/* ---------- stage ---------- */

.stage {
  flex-grow: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  overflow-y: auto;
  overflow-x: hidden;
  scrollbar-width: thin;
  scrollbar-color: var(--line) transparent;
}

.stage::-webkit-scrollbar { width: 10px; }
.stage::-webkit-scrollbar-thumb { background: var(--line); border-radius: 999px; }

body.state-empty .stage { justify-content: center; }

.column {
  width: 100%;
  max-width: 780px;
  padding: 0 40px;
}

body.state-empty .center-dock {
  display: flex;
  flex-direction: column;
  gap: 34px;
  padding-block: 48px;
}

/* ---------- hero ---------- */

.hero {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.eyebrow {
  display: flex;
  align-items: center;
  gap: 12px;
}

.eyebrow .rule {
  width: 26px;
  height: 2px;
  background: var(--volt);
}

.eyebrow .label {
  font-size: 11px;
  letter-spacing: 0.22em;
  color: var(--volt);
}

.hero h1 {
  margin: 0;
  font-size: clamp(38px, 5.2vw, 76px);
  line-height: 0.93;
  letter-spacing: -0.028em;
  text-wrap: balance;
}

.hero p {
  margin: 0;
  max-width: 540px;
  font-size: 17px;
  line-height: 1.55;
  color: var(--dim);
  text-wrap: pretty;
}

body.state-chat .hero { display: none; }

/* ---------- composer ---------- */

.composer {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 22px;
  padding: 18px 18px 14px 22px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.55), 0 0 0 1px rgba(187, 232, 69, 0.06);
  transition: border-color 0.16s ease;
}

.composer:focus-within { border-color: var(--volt-deep); }

.composer textarea {
  width: 100%;
  border: 0;
  outline: none;
  resize: none;
  background: transparent;
  color: var(--text);
  font: inherit;
  font-size: 17px;
  line-height: 1.5;
  max-height: 180px;
}

.composer textarea::placeholder { color: var(--faint); }

/* flex-end plus margin-right:auto on the privacy line keeps the send button
   on the right whether or not that line is showing. */
.composer-foot {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 16px;
}

.privacy {
  margin-right: auto;
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  color: var(--faint);
}

.privacy svg { display: block; flex-shrink: 0; }

.send {
  width: 48px;
  height: 48px;
  flex-shrink: 0;
  border: 0;
  border-radius: 14px;
  background: var(--volt);
  color: var(--page);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background 0.16s ease, opacity 0.16s ease;
}

.send:hover:not(:disabled) { background: var(--volt-deep); }
.send:disabled { opacity: 0.35; cursor: not-allowed; }
.send svg { display: block; }

.bottom-dock {
  flex-shrink: 0;
  width: 100%;
  display: flex;
  justify-content: center;
  background: linear-gradient(to top, var(--page) 62%, rgba(11, 10, 8, 0));
  padding-block: 18px 20px;
}

body.state-empty .bottom-dock { display: none; }

.bottom-dock .composer {
  border-radius: 18px;
  padding: 14px 14px 12px 20px;
}

.bottom-dock .privacy { display: none; }

/* ---------- suggestion chips ---------- */

.chips-wrap {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.chips-title {
  font-size: 10px;
  letter-spacing: 0.22em;
  color: var(--faint);
}

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

.chip {
  display: flex;
  align-items: center;
  min-height: 44px;
  padding: 0 18px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface);
  color: var(--text);
  font: inherit;
  font-size: 14px;
  text-align: left;
  cursor: pointer;
  transition: border-color 0.16s ease, transform 0.16s ease;
}

.chip:hover {
  border-color: var(--volt);
  transform: translateY(-1px);
}

body.state-chat .chips-wrap { display: none; }

/* ---------- thread ---------- */

.thread {
  display: flex;
  flex-direction: column;
  gap: 30px;
  padding-block: 40px 8px;
}

body.state-empty .thread { display: none; }

.turn-user { display: flex; justify-content: flex-end; }

.turn-user .bubble {
  max-width: 520px;
  background: var(--bubble);
  border: 1px solid var(--line);
  border-radius: 20px 20px 6px 20px;
  padding: 14px 18px;
  font-size: 16px;
  line-height: 1.5;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.turn-bot {
  display: flex;
  gap: 16px;
  align-items: flex-start;
}

.turn-bot .mark { margin-top: 2px; }

.answer {
  min-width: 0;
  max-width: 620px;
  font-size: 16px;
  line-height: 1.62;
  overflow-wrap: anywhere;
}

.answer > *:first-child { margin-top: 0; }
.answer > *:last-child { margin-bottom: 0; }
.answer p { margin: 0 0 14px; text-wrap: pretty; }
.answer ul, .answer ol { margin: 0 0 14px; padding-left: 22px; }
.answer li { margin-bottom: 7px; }
.answer li::marker { color: var(--volt); }
.answer strong { color: var(--text); font-weight: 600; }
.answer h2, .answer h3 {
  font-family: "Archivo Black", "Helvetica Neue", "Arial Black", Arial, sans-serif;
  font-weight: 400;
  letter-spacing: -0.01em;
  margin: 22px 0 10px;
}
.answer h2 { font-size: 19px; }
.answer h3 { font-size: 16px; }
.answer code {
  font-family: ui-monospace, "SF Mono", Menlo, monospace;
  font-size: 0.9em;
  background: var(--raised);
  border: 1px solid var(--line-soft);
  border-radius: 6px;
  padding: 1px 5px;
}
.answer pre {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 14px 16px;
  overflow-x: auto;
  margin: 0 0 14px;
}
.answer pre code { background: none; border: 0; padding: 0; }
.answer a { color: var(--volt); }
.answer a:hover { color: var(--volt-deep); }

.answer .cursor {
  display: inline-block;
  width: 8px;
  height: 17px;
  vertical-align: -2px;
  margin-left: 2px;
  background: var(--volt);
  animation: blink 1s steps(2, start) infinite;
}

@keyframes blink { 50% { opacity: 0; } }

.dots {
  display: flex;
  align-items: center;
  gap: 7px;
  height: 40px;
  padding: 0 16px;
  background: var(--surface);
  border: 1px solid var(--line-soft);
  border-radius: 999px;
}

.dots span {
  width: 6px;
  height: 6px;
  border-radius: 999px;
  background: var(--volt);
  animation: dot 1.25s ease-in-out infinite;
}

.dots span:nth-child(2) { animation-delay: 0.16s; }
.dots span:nth-child(3) { animation-delay: 0.32s; }

@keyframes dot {
  0%, 60%, 100% { opacity: 0.25; transform: translateY(0); }
  30% { opacity: 1; transform: translateY(-3px); }
}

.notice {
  border: 1px solid #5c3a20;
  background: #221610;
  border-radius: 12px;
  padding: 12px 16px;
  font-size: 14px;
  color: #f0d3b8;
}

.disclaimer {
  text-align: center;
  font-size: 12px;
  line-height: 1.45;
  color: var(--faint);
  padding: 0 40px 24px;
  flex-shrink: 0;
}

body.state-chat .disclaimer {
  padding-bottom: 16px;
  margin-top: -8px;
}

/* ---------- phone ---------- */

@media (max-width: 640px) {
  .topbar { height: 60px; padding: 0 20px; }
  .wordmark { font-size: 15px; }
  .tag { display: none; }
  .ghost-btn { width: 44px; padding: 0; justify-content: center; }
  .ghost-btn .btn-label { display: none; }
  .column { padding: 0 20px; }
  body.state-empty .center-dock { gap: 26px; padding-block: 28px; }
  .hero p { font-size: 15px; }
  .composer { border-radius: 18px; padding: 14px 12px 12px 18px; }
  .composer textarea { font-size: 16px; }
  .privacy { display: none; }
  .send { width: 46px; height: 46px; border-radius: 13px; }
  .chips { flex-direction: column; flex-wrap: nowrap; }
  .chip { min-height: 48px; border-radius: 14px; padding: 12px 18px; font-size: 15px; }
  .thread { gap: 24px; padding-block: 24px 4px; }
  .turn-user .bubble, .answer { font-size: 15px; }
  .turn-bot { gap: 12px; }
  .disclaimer { padding: 0 20px 20px; font-size: 11px; }
}

body.state-chat .center-dock { display: none; }

.answer hr {
  border: 0;
  border-top: 1px solid var(--line);
  margin: 22px 0;
}

.table-wrap {
  overflow-x: auto;
  margin: 0 0 16px;
  border: 1px solid var(--line);
  border-radius: 14px;
  scrollbar-width: thin;
  scrollbar-color: var(--line) transparent;
}

.answer table {
  border-collapse: collapse;
  width: 100%;
  font-size: 14px;
}

.answer thead th {
  font-family: "Archivo Black", "Helvetica Neue", "Arial Black", Arial, sans-serif;
  font-weight: 400;
  font-size: 10px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--volt);
  background: var(--raised);
  padding: 11px 14px;
  white-space: nowrap;
}

.answer tbody td {
  padding: 11px 14px;
  background: var(--surface);
  border-top: 1px solid var(--line-soft);
  color: var(--text);
  vertical-align: top;
}

.answer tbody td:first-child { white-space: nowrap; }

.answer li > ul,
.answer li > ol {
  margin: 7px 0 0;
}
