/* Tandem landing — design/DESIGN-SYSTEM.md (Transcript direction).
   Tokens mirror console/tailwind.config.ts; keep them in sync by hand. */
:root {
  --paper: #f6f7f9;
  --surface: #ffffff;
  --ink: #15181e;
  --graphite: #5b6472;
  --rule: #e3e6eb;
  --ticket: #1f4fe0;
  --ticket-deep: #173fb8;
  --ticket-tint: #eaf0ff;
  --desk: #166A40;
  --desk-tint: #e8f5ee;
  --handoff: #9A4607;
  --handoff-tint: #fdf1e3;
  --alarm: #B5341F;
  --alarm-tint: #fbeae8;
  --display: 'Bricolage Grotesque', system-ui, sans-serif;
  --body: 'Source Sans 3', system-ui, sans-serif;
  --mono: 'JetBrains Mono', ui-monospace, SFMono-Regular, monospace;
  --shadow-float: 0 8px 24px rgba(21, 24, 30, 0.1);
  --max: 1120px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font: 16px/1.5 var(--body);
  -webkit-font-smoothing: antialiased;
}
h1, h2, h3 { font-family: var(--display); font-weight: 700; letter-spacing: -0.02em; margin: 0; }
p { margin: 0; }
a { color: var(--ticket); text-decoration: none; text-underline-offset: 2px; }
a:hover { text-decoration: underline; }
:focus-visible { outline: 2px solid var(--ticket); outline-offset: 2px; }
::selection { background: var(--ticket-tint); }

.mono { font-family: var(--mono); font-size: 12px; color: var(--graphite); font-variant-numeric: tabular-nums; }
.chip { font-family: var(--mono); font-size: 11px; color: var(--graphite); background: var(--paper); border-radius: 4px; padding: 2px 6px; }
.badge { display: inline-flex; align-items: center; gap: 4px; border-radius: 6px; padding: 2px 8px; font-size: 12px; font-weight: 600; line-height: 16px; }
.badge-neutral { background: var(--paper); color: var(--graphite); }
.badge-ticket { background: var(--ticket-tint); color: var(--ticket-deep); }
.badge-desk { background: var(--desk-tint); color: var(--desk); }
.badge-handoff { background: var(--handoff-tint); color: var(--handoff); }
.badge-alarm { background: var(--alarm-tint); color: var(--alarm); }
.badge-solid { background: var(--ticket); color: #fff; font-family: var(--mono); }
.tag { display: inline-block; border-radius: 4px; padding: 0 6px; font-size: 11px; font-weight: 600; line-height: 16px; margin-left: 6px; }
.tag-ai { background: var(--ticket-tint); color: var(--ticket-deep); }
.tag-human { background: var(--desk-tint); color: var(--desk); }

/* Buttons: rectangles, 6px, never pills. */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: 40px; padding: 0 16px; border-radius: 6px; border: 1px solid transparent;
  font: 600 15px/1 var(--body); color: var(--ink); cursor: pointer; white-space: nowrap;
  transition: background-color 120ms, border-color 120ms, color 120ms;
}
.btn-lg { height: 48px; padding: 0 22px; font-size: 16px; }
.btn-accent { background: var(--ticket); color: #fff; }
.btn-accent:hover { background: var(--ticket-deep); text-decoration: none; }
.btn-plain { background: var(--surface); border-color: var(--rule); }
.btn-plain:hover { border-color: var(--graphite); text-decoration: none; }
.link-quiet { color: var(--graphite); font-weight: 600; font-size: 14px; }
.link-quiet:hover { color: var(--ink); }

/* Header */
.top {
  position: sticky; top: 0; z-index: 10;
  display: flex; align-items: center; gap: 32px;
  height: 60px; padding: 0 24px; background: var(--surface); border-bottom: 1px solid var(--rule);
}
.mark { font-family: var(--display); font-weight: 800; font-size: 22px; letter-spacing: -0.03em; color: var(--ink); }
.mark:hover { text-decoration: none; }
.mark-sm { font-size: 18px; }
.top-nav { display: flex; gap: 22px; }
.top-nav a { color: var(--graphite); font-weight: 600; font-size: 14px; }
.top-nav a:hover { color: var(--ink); text-decoration: none; }
.top-actions { margin-left: auto; display: flex; align-items: center; gap: 18px; }

main { max-width: var(--max); margin: 0 auto; padding: 0 24px; }

/* Hero: copy + the transcript (the thesis). */
.hero {
  display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr); gap: 56px; align-items: center;
  padding: 88px 0 96px;
}
.hero h1 { font-size: clamp(38px, 4.6vw, 58px); line-height: 1.02; font-weight: 800; font-variation-settings: 'opsz' 96; }
.lead { margin-top: 20px; font-size: 19px; line-height: 1.5; color: var(--graphite); max-width: 34em; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 28px; }
.hero-note { margin-top: 16px; font-size: 14px; color: var(--graphite); }

.transcript { margin: 0; background: var(--surface); border: 1px solid var(--rule); border-radius: 10px; overflow: hidden; }
.transcript-head { display: flex; align-items: center; gap: 12px; padding: 10px 16px; border-bottom: 1px solid var(--rule); }
.transcript-state { margin-left: auto; color: var(--ticket-deep); }
.transcript-state[data-state='human'] { color: var(--desk); }
.transcript-body { padding: 10px 16px 6px; min-height: 300px; }
.transcript-foot { padding: 10px 16px; border-top: 1px solid var(--rule); }

/* Transcript row — the signature element (same anatomy as the console). */
.t-row { display: grid; grid-template-columns: 60px 3px minmax(0, 1fr); column-gap: 12px; align-items: start; padding: 6px 0; }
.t-time { padding-top: 2px; font-family: var(--mono); font-size: 11px; color: var(--graphite); font-variant-numeric: tabular-nums; }
.t-rail { width: 3px; min-height: 20px; height: 100%; border-radius: 999px; background: transparent; }
.t-rail-ai { background: var(--ticket); }
.t-rail-human { background: var(--desk); }
.t-who { display: block; margin-bottom: 2px; font-size: 12px; font-weight: 600; color: var(--graphite); }
.t-body { font-size: 15px; line-height: 1.5; }
.t-handoff { display: flex; align-items: center; gap: 12px; margin: 6px 0; font-size: 12px; font-weight: 600; color: var(--handoff); }
.t-handoff::before, .t-handoff::after { content: ''; flex: 1; height: 1px; background: color-mix(in srgb, var(--handoff) 40%, transparent); }

/* One orchestrated moment: rows reveal in sequence (hero.js); readable
   without JS and under reduced motion. */
.js .hero-row { opacity: 0; transform: translateY(4px); transition: opacity 260ms ease, transform 260ms ease; }
.js .hero-row.is-in { opacity: 1; transform: none; }
.hero-typing { display: none; }
.js .hero-typing.is-on { display: grid; }
.typing { display: inline-flex; gap: 4px; padding: 6px 0; }
.typing i { width: 6px; height: 6px; border-radius: 999px; background: var(--graphite); opacity: 0.35; animation: blink 900ms infinite; }
.typing i:nth-child(2) { animation-delay: 150ms; }
.typing i:nth-child(3) { animation-delay: 300ms; }
@keyframes blink { 0%, 100% { opacity: 0.25; } 50% { opacity: 0.9; } }
@media (prefers-reduced-motion: reduce) {
  .js .hero-row { opacity: 1; transform: none; transition: none; }
  .js .hero-typing.is-on { display: none; }
}

/* Sections */
.section { padding: 80px 0; border-top: 1px solid var(--rule); }
.section h2 { font-size: clamp(28px, 3vw, 34px); line-height: 1.1; }
.section-head { max-width: 40em; margin-bottom: 36px; }
.section-lead { margin-top: 12px; font-size: 17px; color: var(--graphite); }
.section-alt { position: relative; }
.section-alt::before { content: ''; position: absolute; inset: 0 -100vw; background: var(--surface); z-index: -1; }

/* How it works — a real sequence, so the numbers mean something. */
.steps { list-style: none; margin: 36px 0 0; padding: 0; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 32px; }
.steps li { border-top: 2px solid var(--ink); padding-top: 16px; }
.step-n { display: block; margin-bottom: 10px; }
.steps h3 { font-size: 19px; margin-bottom: 8px; }
.steps p { color: var(--graphite); font-size: 15px; }

/* Modes */
.modes { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 20px; }
.mode { background: var(--paper); border: 1px solid var(--rule); border-radius: 10px; padding: 22px; }
.mode h3 { font-size: 19px; margin: 14px 0 8px; }
.mode p { color: var(--graphite); font-size: 15px; }

/* Security rules */
.rules { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px 40px; }
.rules li { padding: 14px 0; border-top: 1px solid var(--rule); font-size: 15px; color: var(--graphite); }
.rules strong { display: block; color: var(--ink); font-weight: 600; margin-bottom: 2px; }

/* For teams — a quiet sketch of the console in the same vocabulary. */
.teams { display: grid; grid-template-columns: minmax(0, 0.8fr) minmax(0, 1.2fr); gap: 48px; align-items: center; }
.console-peek { background: var(--surface); border: 1px solid var(--rule); border-radius: 10px; overflow: hidden; font-size: 12px; box-shadow: var(--shadow-float); }
.peek-head { display: flex; align-items: center; gap: 20px; height: 38px; padding: 0 14px; border-bottom: 1px solid var(--rule); }
.peek-mark { font-family: var(--display); font-weight: 800; font-size: 14px; }
.peek-nav { display: flex; gap: 14px; color: var(--graphite); font-weight: 600; }
.peek-nav b { color: var(--ink); box-shadow: inset 0 -2px 0 var(--ticket); padding-bottom: 9px; }
.peek-body { display: grid; grid-template-columns: 1.1fr 1.6fr 1fr; min-height: 220px; }
.peek-col { padding: 8px 0; border-right: 1px solid var(--rule); }
.peek-col:last-child { border-right: 0; }
.peek-title { display: flex; align-items: center; gap: 8px; padding: 6px 12px; font-size: 10px; font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase; color: var(--graphite); }
.peek-thread .peek-title { text-transform: none; letter-spacing: 0; font-size: 12px; color: var(--ink); border-bottom: 1px solid var(--rule); margin-bottom: 6px; }
.peek-row { display: flex; align-items: center; gap: 8px; padding: 7px 12px; border-top: 1px solid var(--rule); }
.peek-row .mono, .peek-row .badge { margin-left: auto; }
.peek-row.is-selected { background: var(--ticket-tint); }
.peek-line { display: grid; grid-template-columns: 52px 3px 1fr; gap: 10px; align-items: center; padding: 5px 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.peek-line i { width: 3px; height: 14px; border-radius: 999px; background: transparent; }
.peek-line i.ai { background: var(--ticket); }
.peek-line i.human { background: var(--desk); }
.peek-handoff { margin: 4px 12px; font-size: 10px; font-weight: 600; color: var(--handoff); display: flex; align-items: center; gap: 8px; }
.peek-handoff::before, .peek-handoff::after { content: ''; flex: 1; height: 1px; background: color-mix(in srgb, var(--handoff) 40%, transparent); }
.peek-kv { display: flex; justify-content: space-between; align-items: center; gap: 8px; padding: 7px 12px; border-top: 1px solid var(--rule); color: var(--graphite); }

/* Try it */
.try { text-align: center; padding: 88px 0; }
.try .section-lead { margin: 12px auto 24px; max-width: 40em; }
.try em { font-style: normal; font-weight: 600; color: var(--ink); }

/* Footer */
.foot { display: flex; align-items: center; gap: 20px; max-width: var(--max); margin: 0 auto; padding: 28px 24px 120px; border-top: 1px solid var(--rule); }
.foot .link-quiet { margin-left: auto; }

/* Responsive */
@media (max-width: 960px) {
  .hero { grid-template-columns: 1fr; gap: 40px; padding: 56px 0 64px; }
  .steps { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .modes { grid-template-columns: 1fr; }
  .rules { grid-template-columns: 1fr; }
  .teams { grid-template-columns: 1fr; }
  .top-nav { display: none; }
}
@media (max-width: 600px) {
  main, .foot { padding-left: 16px; padding-right: 16px; }
  .top { padding: 0 16px; gap: 16px; }
  .top-actions .link-quiet { display: none; }
  .section { padding: 56px 0; }
  .steps { grid-template-columns: 1fr; gap: 24px; }
  .hero-actions .btn { width: 100%; }
  .t-row { grid-template-columns: 52px 3px minmax(0, 1fr); column-gap: 10px; }
  .peek-body { grid-template-columns: 1fr; }
  .peek-col { border-right: 0; border-bottom: 1px solid var(--rule); }
  .peek-card { display: none; }
}
