/* --- design tokens --------------------------------------------------- */
:root {
  --bg: #0a0a0b;
  --bg-elev: #131316;
  --bg-elev-2: #1c1c20;
  --line: #2a2a30;
  --ink: #f5f5f4;
  --ink-mute: #a8a8a8;
  --ink-dim: #6f6f73;
  --accent: #e0ff4f;          /* lime — single hero accent */
  --accent-ink: #0a0a0b;
  --danger: #ff6b5b;
  --good: #76ffb0;
  --bubble-user: #1c1c20;
  --bubble-bot: #131316;
  --radius: 14px;
  --radius-sm: 8px;
  --serif: "Instrument Serif", "Times New Roman", serif;
  --sans: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
  --mono: "JetBrains Mono", ui-monospace, "SF Mono", Menlo, monospace;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }

body {
  background:
    radial-gradient(1200px 600px at 80% -10%, rgba(224,255,79,0.06), transparent 70%),
    radial-gradient(900px 500px at -10% 110%, rgba(118,255,176,0.05), transparent 70%),
    var(--bg);
  color: var(--ink);
  font-family: var(--sans);
  font-feature-settings: "ss01", "cv11";
  -webkit-font-smoothing: antialiased;
  min-height: 100dvh;
}

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

/* --- shell ----------------------------------------------------------- */
.shell {
  max-width: 760px;
  margin: 0 auto;
  padding: 28px 20px 120px;
  display: flex;
  flex-direction: column;
  gap: 28px;
}

.masthead {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--line);
  flex-wrap: wrap;
}
.brand {
  display: inline-flex; align-items: center; gap: 10px;
  font-family: var(--mono);
  font-weight: 700;
  letter-spacing: -0.02em;
}
.brand-name { font-size: 18px; }
.brand-name em { color: var(--accent); font-style: normal; }
.dot {
  width: 9px; height: 9px; border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 12px rgba(224,255,79,0.6);
}
.meta {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--ink-dim);
  display: inline-flex; align-items: center; gap: 8px;
}
.kbd {
  font-family: var(--mono); font-size: 11px;
  padding: 2px 6px;
  border: 1px solid var(--line);
  border-radius: 4px;
  color: var(--ink-mute);
}
.sep { opacity: 0.5; }
.muted { color: var(--ink-dim); }

/* --- hero ------------------------------------------------------------ */
.hero h1 {
  font-family: var(--serif);
  font-weight: 400;
  font-size: clamp(34px, 6vw, 54px);
  line-height: 1.04;
  letter-spacing: -0.01em;
  margin: 0 0 14px 0;
}
.hero h1 em {
  color: var(--accent);
  font-style: italic;
}
.lede {
  color: var(--ink-mute);
  font-size: 15px;
  line-height: 1.55;
  max-width: 58ch;
  margin: 0;
}
.quoted {
  background: var(--bg-elev);
  border: 1px solid var(--line);
  border-radius: 4px;
  padding: 1px 6px;
  font-family: var(--mono);
  font-size: 13px;
  color: var(--ink);
}

/* --- thread ---------------------------------------------------------- */
.thread {
  display: flex;
  flex-direction: column;
  gap: 18px;
  min-height: 60px;
}

.bubble {
  max-width: 96%;
  padding: 14px 16px;
  border-radius: var(--radius);
  border: 1px solid var(--line);
  font-size: 14px;
  line-height: 1.55;
  animation: rise 0.32s cubic-bezier(.2,.7,.2,1);
}
@keyframes rise {
  from { transform: translateY(6px); opacity: 0; }
  to { transform: translateY(0); opacity: 1; }
}

.bubble.user {
  align-self: flex-end;
  background: var(--bubble-user);
  border-color: var(--line);
  color: var(--ink);
}
.bubble.user::before {
  content: "you";
  display: block;
  font-family: var(--mono);
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--ink-dim);
  margin-bottom: 4px;
}

.bubble.bot {
  align-self: flex-start;
  background: var(--bubble-bot);
  border-color: var(--line);
}
.bubble.bot::before {
  content: "the desk";
  display: block;
  font-family: var(--mono);
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--ink-dim);
  margin-bottom: 8px;
}

.bubble.error { border-color: rgba(255,107,91,0.4); }
.bubble.error::before { content: "error"; color: var(--danger); }

/* loading dots */
.bubble.loading { color: var(--ink-mute); font-family: var(--mono); font-size: 13px; }
.bubble.loading .step { display: block; padding: 2px 0; opacity: 0.4; }
.bubble.loading .step.active { opacity: 1; color: var(--ink); }
.bubble.loading .step.done { opacity: 0.55; color: var(--good); }
.bubble.loading .step.done::after { content: " ✓"; color: var(--good); }
.bubble.loading .step.active::after {
  content: " …"; color: var(--accent);
}

/* parlay ticket */
.ticket {
  display: flex; flex-direction: column; gap: 14px;
}
.ticket-head {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  padding-bottom: 10px;
  border-bottom: 1px dashed var(--line);
}
.team-chip {
  display: inline-flex; align-items: center; gap: 6px;
  font-family: var(--mono);
  font-size: 11px;
  background: var(--bg-elev-2);
  border: 1px solid var(--line);
  border-radius: 100px;
  padding: 4px 10px;
}
.team-chip img {
  width: 14px; height: 14px; border-radius: 50%; background: var(--bg);
}
.ticket-title {
  font-family: var(--serif);
  font-size: 22px;
  line-height: 1.1;
  margin: 0;
}
.ticket-sub {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--ink-dim);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.legs { display: flex; flex-direction: column; gap: 0; }
.leg {
  display: grid;
  grid-template-columns: 24px 1fr auto;
  align-items: start;
  gap: 12px;
  padding: 12px 0;
  border-bottom: 1px dashed var(--line);
}
.leg:last-child { border-bottom: 0; }
.leg-num {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--ink-dim);
  padding-top: 2px;
}
.leg-body { display: flex; flex-direction: column; gap: 4px; }
.leg-match {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--ink-dim);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}
.leg-pick {
  font-family: var(--sans);
  font-weight: 600;
  font-size: 15px;
  color: var(--ink);
}
.leg-why {
  font-family: var(--sans);
  font-size: 12.5px;
  color: var(--ink-mute);
  line-height: 1.45;
}
.leg-price {
  font-family: var(--mono);
  font-weight: 700;
  font-size: 16px;
  color: var(--accent);
  white-space: nowrap;
  padding-top: 2px;
}

.combined {
  display: flex; align-items: baseline; justify-content: space-between;
  padding: 12px 14px;
  background: var(--bg-elev-2);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  margin-top: 4px;
}
.combined-label {
  font-family: var(--mono);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--ink-mute);
}
.combined-price {
  font-family: var(--mono);
  font-size: 22px;
  font-weight: 700;
  color: var(--accent);
}
.combined.miss .combined-price { color: var(--ink); }
.combined-note {
  flex-basis: 100%;
  margin-top: 6px;
  font-family: var(--mono);
  font-size: 10.5px;
  color: var(--ink-dim);
}

.skipped {
  font-family: var(--mono);
  font-size: 11.5px;
  color: var(--ink-dim);
  background: rgba(255,255,255,0.02);
  border-left: 2px solid var(--line);
  padding: 8px 10px;
  margin-top: 8px;
  border-radius: 0 4px 4px 0;
}
.skipped strong { color: var(--ink-mute); font-weight: 600; }

/* --- composer -------------------------------------------------------- */
.composer {
  position: sticky;
  bottom: 12px;
  display: flex;
  gap: 8px;
  padding: 10px;
  background: var(--bg-elev);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: 0 10px 40px rgba(0,0,0,0.45);
  backdrop-filter: blur(6px);
}
.composer textarea {
  flex: 1;
  resize: none;
  background: transparent;
  border: 0;
  outline: none;
  color: var(--ink);
  font-family: var(--sans);
  font-size: 15px;
  line-height: 1.5;
  padding: 10px;
  max-height: 160px;
  min-height: 24px;
}
.composer textarea::placeholder { color: var(--ink-dim); }

.send {
  display: inline-flex; align-items: center; gap: 8px;
  background: var(--accent);
  color: var(--accent-ink);
  border: 0;
  border-radius: var(--radius-sm);
  font-family: var(--mono);
  font-weight: 700;
  font-size: 13px;
  letter-spacing: 0.04em;
  padding: 10px 14px;
  cursor: pointer;
  transition: transform 0.12s ease, opacity 0.12s ease;
  align-self: flex-end;
}
.send:hover:not(:disabled) { transform: translateY(-1px); }
.send:active:not(:disabled) { transform: translateY(0); }
.send:disabled { opacity: 0.4; cursor: not-allowed; }
.send-arrow { font-size: 16px; }

.foot {
  font-size: 11.5px;
  line-height: 1.5;
  text-align: center;
  padding-top: 10px;
  border-top: 1px solid var(--line);
}

@media (max-width: 540px) {
  .shell { padding: 18px 14px 120px; gap: 22px; }
  .hero h1 { font-size: 32px; }
  .lede { font-size: 14px; }
  .leg { grid-template-columns: 18px 1fr auto; gap: 8px; }
  .leg-pick { font-size: 14px; }
  .leg-price { font-size: 15px; }
  .combined-price { font-size: 20px; }

  /* Composer: tighten paddings, shrink the textarea text, and collapse
     Send to an icon-only square so the long placeholder fits without
     being clipped on a 393px viewport. */
  .composer { padding: 6px; gap: 6px; }
  .composer textarea {
    font-size: 14px;
    padding: 8px 6px;
    line-height: 1.4;
  }
  .send { padding: 0; width: 40px; height: 40px; justify-content: center; }
  .send-label { display: none; }
  .send-arrow { font-size: 18px; }
}
