/* Tokens match the home page so the compare page reads as part of the site. */
:root {
  --bg: #f7f7f5; --surface: #ffffff; --surface-2: #f1f0ec; --text: #1b1b19; --muted: #5f5e59; --faint: #898781;
  --line: #e2e1db; --line-strong: #c3c2b7;
  --accent: #2f5d8a; --accent-soft: #e9f0f7;
  --shadow: 0 1px 2px rgba(0, 0, 0, .05);
  --shadow-lg: 0 8px 24px -12px rgba(0, 0, 0, .18);
  --sans: "Geist", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --display: "Instrument Serif", Georgia, "Times New Roman", serif;
  --mono: "Geist Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  /* One color per model */
  --openai: #3f4a45; --openai-soft: #eceeed;
  --claude: #c15f3c; --claude-soft: #f8ece6;
  --jev: #2f5d8a; --jev-soft: #e9f0f7;
  --good: #1f8a5b; --good-soft: #e5f3ec;
  --warn: #9a6a00; --warn-soft: #fbf3dc;
  --bad: #b5462f; --bad-soft: #f8e9e5;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --bg: #121211; --surface: #1a1a19; --surface-2: #232321; --text: #f0efec; --muted: #c3c2b7; --faint: #898781;
    --line: #2c2c2a; --line-strong: #4a4a46;
    --accent: #8fb6dd; --accent-soft: #1d2a38;
    --shadow: 0 1px 2px rgba(0, 0, 0, .4);
    --shadow-lg: 0 8px 24px -12px rgba(0, 0, 0, .6);
    --openai: #c9d1cd; --openai-soft: #262a28;
    --claude: #e58a66; --claude-soft: #2e221d;
    --jev: #8fb6dd; --jev-soft: #1d2a38;
    --good: #5cc490; --good-soft: #17271f;
    --warn: #e8c060; --warn-soft: #2b2512;
    --bad: #ec8a74; --bad-soft: #2e1c18;
  }
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #121211; --surface: #1a1a19; --surface-2: #232321; --text: #f0efec; --muted: #c3c2b7; --faint: #898781;
  --line: #2c2c2a; --line-strong: #4a4a46;
  --accent: #8fb6dd; --accent-soft: #1d2a38;
  --shadow: 0 1px 2px rgba(0, 0, 0, .4);
  --shadow-lg: 0 8px 24px -12px rgba(0, 0, 0, .6);
  --openai: #c9d1cd; --openai-soft: #262a28;
  --claude: #e58a66; --claude-soft: #2e221d;
  --jev: #8fb6dd; --jev-soft: #1d2a38;
  --good: #5cc490; --good-soft: #17271f;
  --warn: #e8c060; --warn-soft: #2b2512;
  --bad: #ec8a74; --bad-soft: #2e1c18;
}
:root[data-theme="light"] { color-scheme: light; }

* { box-sizing: border-box; }
[hidden] { display: none !important; }
/* Avoid a lone word on the last line of a paragraph or card. */
p, li, td, th { text-wrap: pretty; }
h1, h2, h3, .sys .q, .sys .a, .facts span, .example-card span, .verdict { text-wrap: balance; }
body {
  margin: 0; color: var(--text);
  /* A soft wash of the Jev accent behind the hero. */
  background: radial-gradient(1100px 520px at 50% -240px, var(--accent-soft), transparent 70%) no-repeat, var(--bg);
  font: 16px/1.6 var(--sans);
  -webkit-font-smoothing: antialiased;
}
a { color: var(--accent); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.wrap { max-width: 1120px; margin: 0 auto; padding: 0 16px; }
.skip { position: absolute; left: -999px; top: 8px; background: var(--surface); padding: 8px 12px; border-radius: 6px; z-index: 99; }
.skip:focus { left: 8px; }
.muted { color: var(--muted); }

/* Nav (same as home) */
.top { position: sticky; top: 0; z-index: 20; background: color-mix(in srgb, var(--bg) 92%, transparent); backdrop-filter: blur(8px); border-bottom: 1px solid var(--line); }
.top .wrap { display: flex; align-items: center; gap: 20px; height: 54px; }
.brand { font-family: var(--display); font-size: 1.45rem; font-weight: 400; letter-spacing: 0; color: var(--text); text-decoration: none; white-space: nowrap; }
.top nav { display: flex; gap: 18px; overflow-x: auto; scrollbar-width: none; font-size: .9rem; }
.top nav a { color: var(--muted); text-decoration: none; white-space: nowrap; }
.top nav a:hover, .top nav a[aria-current] { color: var(--text); }
.top nav a[aria-current] { font-weight: 600; }
.theme-toggle { margin-left: auto; flex: none; display: grid; place-items: center; width: 36px; height: 36px; padding: 0; border: 1px solid var(--line); border-radius: 999px; background: var(--surface); color: var(--text); cursor: pointer; }
.theme-toggle:hover { border-color: var(--line-strong); }
.theme-toggle svg { width: 18px; height: 18px; }
.theme-toggle .icon-sun { display: none; }
:root[data-theme="dark"] .theme-toggle .icon-sun { display: block; }
:root[data-theme="dark"] .theme-toggle .icon-moon { display: none; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .theme-toggle .icon-sun { display: block; }
  :root:not([data-theme="light"]) .theme-toggle .icon-moon { display: none; }
}

/* Hero */
.hero { padding: 64px 0 20px; }
.eyebrow { display: inline-flex; align-items: center; gap: 8px; font: 500 .74rem/1 var(--mono); text-transform: uppercase; letter-spacing: .04em; color: var(--accent); background: var(--accent-soft); border: 1px solid color-mix(in srgb, var(--accent) 25%, transparent); border-radius: 999px; padding: 6px 12px; margin: 0 0 18px; }
.eyebrow::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: var(--accent); }
h1 { font-family: var(--display); font-weight: 400; font-size: clamp(3rem, 8vw, 5.25rem); line-height: .98; letter-spacing: -.015em; margin: 0 0 18px; }
h1 em, h2 em { font-style: italic; color: var(--accent); }
/* Section headings share one display style. */
.voice h2, .live h2, .pilled h2 { font-family: var(--display); font-weight: 400; font-size: clamp(2.2rem, 5vw, 3.2rem); line-height: 1.02; letter-spacing: -.01em; margin: 0 0 12px; }
.lede { font-size: 1.13rem; line-height: 1.6; color: var(--muted); margin: 0; }
[data-side="openai"] { --side: var(--openai); --side-soft: var(--openai-soft); }
[data-side="claude"] { --side: var(--claude); --side-soft: var(--claude-soft); }
[data-side="jev"] { --side: var(--jev); --side-soft: var(--jev-soft); }
.banner { margin-top: 20px; padding: 10px 14px; border-radius: 10px; background: var(--warn-soft); color: var(--warn); font-size: .92rem; font-weight: 500; }

/* Cards */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: 16px; box-shadow: var(--shadow); padding: 20px; }

/* Composer */
.composer .tabs { margin-bottom: 16px; }
.tabs { display: flex; gap: 6px; flex-wrap: wrap; }
.tabs button {
  font: inherit; font-size: .88rem; border: 1px solid var(--line); background: var(--surface); color: var(--text);
  border-radius: 999px; padding: 7px 14px; cursor: pointer; transition: background .15s, border-color .15s;
}
.tabs button:hover { border-color: var(--line-strong); }
.tabs button[aria-selected="true"] { background: var(--accent-soft); color: var(--accent); border-color: var(--accent); font-weight: 600; }
.field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.field-label { font: 500 .72rem/1.2 var(--mono); text-transform: uppercase; letter-spacing: .04em; color: var(--muted); }
.hint { color: var(--muted); font-size: .88rem; margin: 8px 0; }
textarea, select, input {
  width: 100%; padding: 10px 12px; font: inherit; font-size: 1rem; color: var(--text);
  background: var(--surface-2); border: 1px solid var(--line); border-radius: 10px;
  transition: border-color .15s, background .15s;
}
textarea:focus, select:focus, input:focus { outline: none; border-color: var(--accent); background: var(--surface); }
textarea { resize: vertical; }
textarea.mono { font: 13px/1.5 var(--mono); }
.questions-field { margin-top: 12px; }
details.more { margin-top: 16px; border-top: 1px solid var(--line); padding-top: 12px; }
details.more > summary { cursor: pointer; font-size: .9rem; font-weight: 600; color: var(--muted); list-style: none; display: inline-flex; align-items: center; gap: 6px; }
details.more > summary::-webkit-details-marker { display: none; }
details.more > summary::before { content: "\25B8"; transition: transform .15s; }
details.more[open] > summary::before { transform: rotate(90deg); }
details.more > summary:hover { color: var(--text); }
.controls { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin-top: 10px; }
.go { display: flex; gap: 12px; align-items: stretch; margin-top: 12px; }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 11px 20px; border-radius: 10px; border: 1px solid var(--line-strong); background: var(--surface); color: var(--text); font: inherit; font-weight: 600; cursor: pointer; }
.btn.primary { background: var(--accent); color: var(--bg); border-color: var(--accent); box-shadow: 0 6px 18px -8px color-mix(in srgb, var(--accent) 70%, transparent); transition: transform .15s, box-shadow .15s; }
.btn.primary:hover { transform: translateY(-1px); box-shadow: 0 10px 22px -10px color-mix(in srgb, var(--accent) 80%, transparent); }
.btn:disabled { opacity: .7; cursor: progress; }
.run { flex: 1 1 auto; height: 50px; font-size: 1.02rem; border-radius: 12px; }
.spinner { display: none; width: 14px; height: 14px; border-radius: 50%; border: 2px solid currentColor; border-right-color: transparent; animation: spin .7s linear infinite; }
.run.loading .spinner { display: inline-block; }
@keyframes spin { to { transform: rotate(360deg); } }
.error { color: var(--bad); font-size: .9rem; margin: 10px 0 0; }
.error:empty { display: none; }

/* Results */
.results { margin-top: 28px; scroll-margin-top: 72px; }
.tldr { background: var(--surface); border: 1px solid var(--line); border-left: 4px solid var(--accent); border-radius: 12px; padding: 16px 20px; margin-bottom: 16px; }
.tldr h2 { margin: 0 0 8px; font: 500 .74rem/1.2 var(--mono); letter-spacing: .04em; color: var(--accent); }
.tldr ul { margin: 0; padding-left: 1.1em; display: grid; gap: 4px; font-size: 1rem; }

.timing { margin: 0 0 16px; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 14px 18px; }
.timing figcaption { font: 500 .74rem/1.2 var(--mono); letter-spacing: .04em; text-transform: uppercase; color: var(--muted); margin-bottom: 10px; }
.timing figcaption span { font-family: var(--sans); font-size: .82rem; letter-spacing: 0; text-transform: none; margin-left: 6px; }
.timing-row { display: grid; grid-template-columns: 64px 1fr; align-items: center; gap: 12px; padding: 5px 0; }
.timing-label { font-weight: 600; font-size: .92rem; }
.timing-track { display: flex; align-items: center; gap: 8px; min-width: 0; }
.timing-bar { display: block; height: 14px; flex: none; background: var(--side); border-radius: 0 4px 4px 0; transition: width .6s cubic-bezier(.2, .7, .2, 1); }
.timing-value { white-space: nowrap; font-family: var(--mono); font-size: .85rem; color: var(--muted); font-variant-numeric: tabular-nums; }
.results.loading .timing { opacity: .35; }

.answers { width: 100%; border-collapse: separate; border-spacing: 0; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; overflow: hidden; table-layout: fixed; }
.answers th, .answers td { padding: 12px 14px; text-align: left; vertical-align: top; border-bottom: 1px solid var(--line); }
.answers tbody tr:last-child > * { border-bottom: 0; }
.answers thead td { width: 22%; }
.side-head { border-top: 3px solid var(--side); }
.side-head .name { font-size: 1.05rem; font-weight: 700; color: var(--side); }
.model-name { display: block; font-size: .85rem; font-weight: 600; color: var(--text); }
.model-line { margin: 8px 0 0; font-size: .85rem; color: var(--muted); text-align: center; }
.stat-line { display: block; font-family: var(--mono); font-size: .8rem; font-weight: 500; color: var(--muted); font-variant-numeric: tabular-nums; min-height: 1.3em; }
.side-head .error { margin: 4px 0 0; display: block; }
.listen {
  margin-top: 6px; font: inherit; font-size: .78rem; font-weight: 600; padding: 3px 10px; border-radius: 999px; cursor: pointer;
  background: var(--side-soft); color: var(--side); border: 1px solid transparent;
}
.listen:hover { border-color: var(--side); }
.listen.playing { background: var(--side); color: var(--surface); }
tbody th { font-weight: 600; text-transform: capitalize; }
.verdict { font-weight: 700; margin-right: 6px; }
.conf { font-family: var(--mono); font-size: .8rem; color: var(--muted); font-variant-numeric: tabular-nums; }
tr.split > th::after { content: " \2260"; color: var(--warn); }
td.odd { background: var(--warn-soft); }
.na { color: var(--muted); }

.results.loading .stat-line { color: transparent; background: linear-gradient(90deg, var(--line) 0%, var(--surface-2) 50%, var(--line) 100%); background-size: 200% 100%; border-radius: 6px; animation: shimmer 1.2s ease-in-out infinite; }
.results.loading .tldr, .results.loading tbody, .results.loading #reasoningBox { opacity: .35; }
@keyframes shimmer { from { background-position: 100% 0; } to { background-position: -100% 0; } }

/* What's Jev facts and the live example heading */
.facts { list-style: none; padding: 0; margin: 24px 0 0; display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; }
.facts li { background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 18px; box-shadow: var(--shadow); display: flex; flex-direction: column; gap: 4px; }
.facts b { font-family: var(--display); font-weight: 400; font-size: 1.6rem; line-height: 1.1; }
.facts span { color: var(--muted); font-size: .92rem; }
.live { margin: 96px 0 20px; scroll-margin-top: 72px; }
#what { scroll-margin-top: 72px; }
.voice { margin-top: 96px; scroll-margin-top: 72px; }
.turns { margin-top: 20px; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 14px 18px; display: grid; gap: 10px; }
.turn { display: grid; grid-template-columns: 120px 1fr; align-items: center; gap: 12px; }
.turn-who { font-weight: 600; font-size: .92rem; }
.turn-track { display: flex; align-items: center; gap: 10px; min-width: 0; }
.turn-gap { height: 14px; border-radius: 0 4px 4px 0; flex: none; }
.turn-gap.slow { width: 70%; background: repeating-linear-gradient(135deg, var(--line-strong) 0 6px, transparent 6px 10px); }
.turn-gap.fast { width: 6%; background: var(--side); }
.turn-note { font-size: .88rem; color: var(--muted); white-space: nowrap; }
/* Voice agent call flow: a left-to-right row on wide screens, a column on phones. */
.flow { margin: 20px 0 0; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 18px; }
.flow-row { display: flex; align-items: center; }
.flow figcaption { margin-top: 14px; color: var(--muted); font-size: .9rem; }
.node { flex: 1 1 0; min-width: 0; display: flex; flex-direction: column; gap: 2px; padding: 10px 12px; border: 1px solid var(--line-strong); border-radius: 10px; background: var(--bg); font-size: .85rem; line-height: 1.35; }
.node b { font-size: .95rem; }
.node-tag { font: 500 .66rem/1.3 var(--mono); letter-spacing: .04em; text-transform: uppercase; color: var(--muted); }
.node-sub { color: var(--muted); display: flex; flex-direction: column; gap: 2px; }
.node-sub code { font-family: var(--mono); font-size: .78rem; color: var(--text); }
.node-jev { border-color: var(--side); background: var(--side-soft); box-shadow: inset 4px 0 0 var(--side); }
.node-jev .node-tag, .node-jev b { color: var(--side); }
.node-time { font-family: var(--mono); margin-top: 4px; align-self: flex-start; font-size: .75rem; font-weight: 700; color: var(--surface); background: var(--side); border-radius: 999px; padding: 1px 8px; }
.node-good { border-color: var(--good); background: var(--good-soft); }
.node-good b { color: var(--good); }
.flow-branch { flex: 1.25 1 0; min-width: 0; display: grid; gap: 10px; }
.flow-out { display: flex; align-items: center; }
/* An arrow with its label above the line. */
.edge { flex: 0 0 64px; position: relative; height: 34px; color: var(--line-strong); }
.edge::before { content: ""; position: absolute; left: 4px; right: 8px; top: 50%; border-top: 2px solid currentColor; }
.edge::after { content: ""; position: absolute; right: 2px; top: 50%; transform: translateY(-50%); border: 6px solid transparent; border-left: 8px solid currentColor; border-right: 0; }
.edge span { position: absolute; left: 0; right: 0; bottom: 50%; margin-bottom: 3px; text-align: center; font-size: .72rem; color: var(--muted); white-space: nowrap; }
.edge-muted::before { border-top-style: dashed; }
.systems { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-top: 22px; }
.sys { background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 20px; box-shadow: var(--shadow); }
.sys:first-child { border-color: var(--jev); box-shadow: inset 4px 0 0 var(--jev); }
.sys-tag { font: 500 .72rem/1.3 var(--mono); letter-spacing: .04em; text-transform: uppercase; color: var(--muted); }
.sys:first-child .sys-tag { color: var(--jev); }
.sys .q { margin: 6px 0 2px; font-size: 1.1rem; font-weight: 700; }
.sys .a { margin: 0; color: var(--muted); font-size: .95rem; }
.sys-note { margin: 12px 0 0; font-size: .95rem; }

/* AI-pilled: links to the 100-example pages */
.pilled { margin-top: 96px; scroll-margin-top: 72px; }
.examples { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; margin-top: 20px; }
.example-card { display: flex; flex-direction: column; gap: 6px; padding: 22px; background: var(--surface); border: 1px solid var(--line); border-radius: 16px; color: var(--text); text-decoration: none; box-shadow: var(--shadow); transition: border-color .15s, transform .15s, box-shadow .15s; }
.example-card:hover { border-color: var(--accent); transform: translateY(-2px); box-shadow: var(--shadow-lg); }
.example-card b { font-family: var(--display); font-weight: 400; font-size: 1.75rem; line-height: 1.1; }
.example-card span { color: var(--muted); font-size: .95rem; flex: 1; }
.example-card em { font-style: normal; font-weight: 600; }
.more-links { margin: 18px 0 0; color: var(--muted); }

/* Scroll reveal (classes added by app.js) */
.reveal { opacity: 0; transform: translateY(18px); transition: opacity .6s ease, transform .6s cubic-bezier(.2, .7, .2, 1); }
.reveal.in { opacity: 1; transform: none; }

/* Reasoning */
.reasoning { margin-top: 24px; }
.reasoning-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 16px; }
.reason { background: var(--surface); border: 1px solid var(--line); border-left: 4px solid var(--side); border-radius: 12px; padding: 14px 16px; }
.reason h3 { margin: 0 0 6px; font-size: .8rem; text-transform: uppercase; letter-spacing: .06em; color: var(--side); }
.reason p { margin: 0; white-space: pre-wrap; font-size: .95rem; }
.reason .raw { margin: 0; max-height: 320px; overflow: auto; font: .78rem/1.5 var(--mono); white-space: pre; }

/* Floating "compare Jev" balloon, shown while the live example is off screen. */
.balloon { position: fixed; right: 20px; bottom: 20px; z-index: 30; display: inline-flex; align-items: center; gap: 8px; padding: 12px 18px; border-radius: 999px; background: var(--accent); color: var(--bg); font-weight: 600; font-size: .95rem; text-decoration: none; box-shadow: 0 12px 28px -10px color-mix(in srgb, var(--accent) 80%, transparent); transition: transform .2s, opacity .2s; animation: balloon-in .35s cubic-bezier(.2, .7, .2, 1); }
.balloon::after { content: ""; position: absolute; right: 26px; bottom: -6px; width: 12px; height: 12px; background: inherit; transform: rotate(45deg); border-radius: 2px; }
.balloon:hover { transform: translateY(-2px); }
@keyframes balloon-in { from { opacity: 0; transform: translateY(12px); } }
@media (prefers-reduced-motion: reduce) { .balloon { animation: none; } }
footer { border-top: 1px solid var(--line); margin-top: 56px; padding: 28px 0 48px; color: var(--muted); font-size: .88rem; }
footer p { margin: 0; max-width: 72ch; }

@media (max-width: 900px) {
  .reasoning-grid { grid-template-columns: 1fr; }
}
@media (max-width: 720px) {
  .examples { grid-template-columns: 1fr; }
  .facts, .systems { grid-template-columns: 1fr; }
  .balloon { right: 16px; bottom: 16px; padding: 10px 16px; font-size: .9rem; }
  .voice, .pilled { margin-top: 64px; }
  .live { margin-top: 64px; }
  .hero { padding-top: 40px; }
  .turn { grid-template-columns: 1fr; gap: 4px; }
  .flow { padding: 14px; }
  .flow-row, .flow-out { flex-direction: column; align-items: stretch; }
  .node, .flow-branch { flex: none; }
  .edge { flex: none; height: 34px; width: 100%; }
  .edge::before { left: 50%; right: auto; top: 3px; bottom: 9px; border-top: 0; border-left: 2px solid currentColor; transform: translateX(-1px); }
  .edge-muted::before { border-left-style: dashed; }
  .edge::after { left: 50%; right: auto; top: auto; bottom: 1px; transform: translateX(-50%); border: 6px solid transparent; border-top: 8px solid currentColor; border-bottom: 0; }
  .edge span { left: 50%; right: auto; bottom: auto; top: 50%; transform: translateY(-50%); margin: 0 0 0 10px; }
  .flow-branch { grid-template-columns: 1fr 1fr; gap: 10px; }
  .node-tag-empty { display: none; }
  .turn-gap.slow { width: 45%; }
  .turn-note { white-space: normal; }
  .controls { grid-template-columns: 1fr; }
  .go { flex-direction: column; align-items: stretch; }
  .answers, .answers tbody, .answers tr, .answers th, .answers td { display: block; width: auto; }
  .answers thead { display: block; }
  .answers thead tr { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .answers thead td { display: none; }
  .side-head { padding: 10px; }
  .answers tbody tr { border-bottom: 1px solid var(--line); padding: 10px 14px; }
  .answers tbody tr:last-child { border-bottom: 0; }
  .answers tbody th, .answers tbody td { border: 0; padding: 3px 0; }
  .answers tbody td::before { content: attr(data-label); display: inline-block; width: 64px; font-size: .78rem; font-weight: 700; color: var(--side); }
  td.odd { background: none; }
  td.odd .verdict { color: var(--warn); }
  .hero { padding-top: 32px; }
  .run { width: 100%; }
}
@media (prefers-reduced-motion: reduce) {
  .spinner, .results.loading .stat-line { animation: none; }
}
