/* ═══════════════════════════════════════════════════════════════
   Turing Taste Test
   Dark, single-theme. Chart tokens follow the validated palette:
   surface #1a1a19 / plane #0d0d0d, series blue #3987e5, orange #d95926.
   ═══════════════════════════════════════════════════════════════ */

:root {
  color-scheme: dark;

  --plane:        #0d0d0d;
  --surface-1:    #1a1a19;
  --surface-2:    #201f1e;
  --surface-3:    #262624;

  --text-primary:   #ffffff;
  --text-secondary: #c3c2b7;
  --text-muted:     #898781;

  --line:      rgba(255, 255, 255, 0.10);
  --line-soft: rgba(255, 255, 255, 0.06);
  --grid:      #2c2c2a;

  --accent:      #3987e5;
  --accent-soft: rgba(57, 135, 229, 0.14);
  --accent-ring: rgba(57, 135, 229, 0.45);
  --community:   #d95926;

  --sans: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace;

  --r-sm: 8px;
  --r-md: 14px;
  --r-lg: 20px;

  --pad: clamp(20px, 4vw, 40px);
  --max: 1180px;
}

*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  min-height: 100dvh;
  background: var(--plane);
  color: var(--text-primary);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  /* clip, not hidden: `hidden` would make <body> a scroll container and
     break the sticky quiz header */
  overflow-x: clip;
}

/* soft light behind the page, kept very quiet */
body::before {
  content: "";
  position: fixed;
  inset: -30vh -20vw auto -20vw;
  height: 90vh;
  background: radial-gradient(60% 60% at 50% 0%, rgba(57,135,229,0.13), transparent 70%);
  pointer-events: none;
  z-index: 0;
}

button, input { font: inherit; color: inherit; }

.skip-link {
  position: absolute; left: -9999px; top: 0;
  background: var(--accent); color: #fff; padding: 10px 16px;
  border-radius: 0 0 var(--r-sm) 0; z-index: 99;
}
.skip-link:focus { left: 0; }

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
  border-radius: 4px;
}

/* ── view switching ───────────────────────────────────────────── */
.view { display: none; position: relative; z-index: 1; }
/* opacity only on the wrapper: a transform here would make it the containing
   block for the sticky quiz header and shift it off the top of the viewport */
.view.is-active { display: block; animation: fade-in .3s ease both; }

@keyframes fade-in { from { opacity: 0; } to { opacity: 1; } }

@keyframes rise {
  from { opacity: 0; transform: translateY(10px); }
  to   { opacity: 1; transform: none; }
}
.view.is-active .landing-inner,
.view.is-active .results { animation: rise .45s cubic-bezier(.2,.8,.3,1) both; }

/* ══════════════════ LANDING ══════════════════ */
.landing {
  min-height: 100dvh;
  display: grid;
  place-items: center;
  padding: clamp(48px, 9vh, 96px) var(--pad);
}
.landing-inner { width: 100%; max-width: 760px; text-align: center; }

.eyebrow {
  display: inline-flex; align-items: center; gap: 9px;
  margin: 0 0 26px;
  padding: 7px 15px 7px 12px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255,255,255,0.03);
  font-size: 13px;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--text-secondary);
}
.dot {
  width: 7px; height: 7px; border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 0 4px rgba(57,135,229,0.18);
}

.hero-title {
  margin: 0 0 22px;
  font-size: clamp(46px, 10.5vw, 104px);
  line-height: .95;
  letter-spacing: -0.045em;
  font-weight: 700;
}
.hero-em {
  background: linear-gradient(96deg, #7fb2f2 0%, #ffffff 55%, #c3c2b7 100%);
  -webkit-background-clip: text; background-clip: text;
  color: transparent;
}

.hero-sub {
  margin: 0 auto 38px;
  max-width: 56ch;
  font-size: clamp(16px, 2.1vw, 19px);
  color: var(--text-secondary);
  text-wrap: pretty;
}

.btn-start {
  display: inline-flex; align-items: center; gap: 14px;
  padding: 19px 30px;
  border: 0; border-radius: 999px;
  background: #fff; color: #0b0b0b;
  font-size: clamp(17px, 2.4vw, 20px);
  font-weight: 650;
  letter-spacing: -0.01em;
  cursor: pointer;
  box-shadow: 0 14px 40px -12px rgba(57,135,229,.55), 0 0 0 1px rgba(255,255,255,.1);
  transition: transform .18s cubic-bezier(.2,.8,.3,1), box-shadow .18s ease;
}
.btn-start:hover { transform: translateY(-2px); box-shadow: 0 20px 52px -12px rgba(57,135,229,.7), 0 0 0 1px rgba(255,255,255,.16); }
.btn-start:active { transform: translateY(0) scale(.985); }
.btn-start-arrow { transition: transform .18s ease; }
.btn-start:hover .btn-start-arrow { transform: translateX(4px); }

.hero-meta {
  margin: 20px 0 0;
  font-size: 14px;
  color: var(--text-muted);
}

.hero-facts {
  display: flex; flex-wrap: wrap; justify-content: center;
  gap: clamp(18px, 5vw, 56px);
  margin: 52px 0 0; padding: 30px 0 0;
  list-style: none;
  border-top: 1px solid var(--line-soft);
}
.hero-facts li { display: grid; gap: 2px; }
.hero-facts strong { font-size: 30px; font-weight: 680; letter-spacing: -.03em; }
.hero-facts span { font-size: 13px; color: var(--text-muted); }

.landing-strip {
  display: flex; flex-wrap: wrap; justify-content: center; gap: 8px;
  margin-top: 44px;
}
.landing-strip span {
  padding: 5px 11px;
  border: 1px solid var(--line-soft);
  border-radius: 999px;
  font-size: 12px;
  color: var(--text-muted);
}

/* ══════════════════ QUIZ ══════════════════ */
.quiz-head {
  position: sticky; top: 0; z-index: 20;
  background: rgba(13,13,13,.82);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--line-soft);
}
.quiz-head-inner { max-width: var(--max); margin: 0 auto; padding: 14px var(--pad) 0; }
.quiz-head-row {
  display: flex; align-items: center; justify-content: space-between;
  gap: 16px; margin-bottom: 12px;
}
.quiz-count { margin: 0; font-size: 14px; color: var(--text-secondary); font-variant-numeric: tabular-nums; }
.quiz-count .of { color: var(--text-muted); }
.quiz-count span:first-child { color: var(--text-primary); font-weight: 620; }

.linkish {
  background: none; border: 0; padding: 4px 2px;
  color: var(--text-muted); font-size: 14px; cursor: pointer;
  transition: color .15s ease;
}
.linkish:hover { color: var(--text-primary); }
.linkish[disabled] { opacity: .35; cursor: default; }
.linkish[disabled]:hover { color: var(--text-muted); }

.progress { height: 2px; background: var(--grid); overflow: hidden; }
.progress-bar {
  height: 100%; width: 0%;
  background: var(--accent);
  transition: width .4s cubic-bezier(.2,.8,.3,1);
}

.quiz-body { max-width: var(--max); margin: 0 auto; padding: 0 var(--pad) 96px; }

.prompt-rail {
  max-width: var(--max);
  margin: 0 auto;
  padding: 16px var(--pad) 18px;
}

.prompt-card {
  padding: 20px 24px 22px;
  background: linear-gradient(var(--surface-2), var(--surface-1));
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  box-shadow: 0 18px 40px -26px rgba(0,0,0,.95);
}
.prompt-kicker {
  display: flex; align-items: center; gap: 10px;
  margin: 0 0 10px;
  font-size: 12px; letter-spacing: .08em; text-transform: uppercase;
  color: var(--text-muted);
}
.chip {
  padding: 4px 10px;
  border: 1px solid var(--accent-ring);
  border-radius: 999px;
  background: var(--accent-soft);
  color: #a9cbf5;
  letter-spacing: .04em;
}
.prompt-text {
  margin: 0;
  font-size: clamp(18px, 2.6vw, 24px);
  line-height: 1.35;
  letter-spacing: -.02em;
  font-weight: 600;
  text-wrap: pretty;
}

.answers-hint {
  margin: 22px 0 14px;
  font-size: 14px;
  color: var(--text-secondary);
}
.hint-dim { color: var(--text-muted); }

.answers {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(330px, 1fr));
  gap: 16px;
  align-items: stretch;
}

/* every answer wears exactly the same clothes */
.answer {
  display: flex; flex-direction: column; gap: 12px;
  padding: 18px 20px 20px;
  text-align: left;
  background: var(--surface-1);
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  cursor: pointer;
  transition: border-color .16s ease, background .16s ease, transform .16s cubic-bezier(.2,.8,.3,1);
}
.answer:hover { border-color: rgba(255,255,255,.24); background: var(--surface-2); transform: translateY(-2px); }
.answer:active { transform: translateY(0); }

.answer-head {
  display: flex; align-items: center; gap: 10px;
  color: var(--text-muted);
  font-size: 12px; letter-spacing: .1em; text-transform: uppercase;
}
.answer-key {
  display: grid; place-items: center;
  width: 24px; height: 24px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--surface-3);
  font-family: var(--mono); font-size: 12px; letter-spacing: 0;
  color: var(--text-secondary);
}
.answer-pick { margin-left: auto; opacity: 0; transition: opacity .16s ease; }
.answer:hover .answer-pick { opacity: 1; }

.answer-body {
  font-size: 15px;
  line-height: 1.62;
  color: var(--text-secondary);
}
.answer-body > *:first-child { margin-top: 0; }
.answer-body > *:last-child { margin-bottom: 0; }
.answer-body p { margin: 0 0 .8em; }
.answer-body ul, .answer-body ol { margin: 0 0 .8em; padding-left: 1.25em; }
.answer-body li { margin-bottom: .35em; }
.answer-body pre {
  margin: 0 0 .8em;
  padding: 14px 16px;
  background: #121211;
  border: 1px solid var(--line-soft);
  border-radius: var(--r-sm);
  overflow-x: auto;
}
.answer-body code {
  font-family: var(--mono);
  font-size: 13px;
  line-height: 1.55;
  color: #d5d4cb;
}

.answer.is-chosen {
  border-color: var(--accent);
  background: linear-gradient(var(--accent-soft), var(--accent-soft)), var(--surface-1);
  transform: translateY(-2px);
  box-shadow: 0 0 0 3px rgba(57,135,229,.16);
}
.answer.is-chosen .answer-key { border-color: var(--accent); background: var(--accent); color: #fff; }
.answer.is-chosen .answer-pick { opacity: 1; color: #a9cbf5; }
.answers.is-locked .answer { pointer-events: none; }
.answers.is-locked .answer:not(.is-chosen) { opacity: .38; }

/* ══════════════════ RESULTS ══════════════════ */
.results { max-width: var(--max); margin: 0 auto; padding: clamp(40px, 8vh, 80px) var(--pad) 80px; }

.winner { text-align: center; margin-bottom: clamp(48px, 8vh, 80px); }
.winner-lead { margin: 0 0 8px; color: var(--text-secondary); font-size: 16px; }
.winner-name {
  margin: 0;
  font-size: clamp(52px, 12vw, 116px);
  line-height: .95;
  letter-spacing: -.05em;
  font-weight: 700;
  background: linear-gradient(96deg, #7fb2f2 0%, #ffffff 52%, #c3c2b7 100%);
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.winner-maker { margin: 10px 0 0; font-size: 14px; letter-spacing: .12em; text-transform: uppercase; color: var(--text-muted); }
.winner-line { margin: 22px auto 0; max-width: 52ch; color: var(--text-secondary); text-wrap: pretty; }

.winner-strip {
  display: flex; gap: 4px;
  max-width: 560px; margin: 30px auto 0;
  padding: 0;
}
.winner-tick {
  flex: 1; height: 32px;
  border-radius: 3px;
  background: var(--surface-3);
  position: relative;
}
.winner-tick.is-win { background: var(--accent); }

.panel {
  margin-bottom: clamp(36px, 6vh, 64px);
  padding: clamp(22px, 3.4vw, 34px);
  background: var(--surface-1);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
}
.panel-head { margin-bottom: 26px; }
.panel-title { margin: 0 0 6px; font-size: clamp(20px, 2.8vw, 26px); letter-spacing: -.025em; font-weight: 660; }
.panel-sub { margin: 0; font-size: 14px; color: var(--text-muted); text-wrap: pretty; }

/* ── charts: horizontal ranked bars, direct-labelled ─────────── */
.chart { display: grid; gap: 4px; }
.chart-row {
  display: grid;
  grid-template-columns: minmax(96px, 132px) 1fr minmax(74px, auto);
  align-items: center;
  gap: 14px;
  padding: 7px 0;
}
.chart-row + .chart-row { border-top: 1px solid var(--line-soft); }

.chart-label {
  display: flex; align-items: baseline; gap: 8px;
  font-size: 14px;
  color: var(--text-primary);
  min-width: 0;
}
.chart-rank {
  font-family: var(--mono); font-size: 11px;
  color: var(--text-muted);
  font-variant-numeric: tabular-nums;
}
.chart-name { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.chart-track {
  position: relative;
  height: 22px;
  background: var(--grid);
  border-radius: 3px;
}
.chart-fill {
  height: 100%;
  min-width: 3px;
  border-radius: 0 4px 4px 0;
  background: var(--accent);
  transform-origin: left center;
  animation: grow .7s cubic-bezier(.2,.8,.3,1) both;
}
.chart-all .chart-fill { background: var(--community); }
.chart-row.is-zero .chart-fill { background: var(--text-muted); opacity: .45; }
.chart-row.is-you .chart-name { font-weight: 650; }

@keyframes grow { from { transform: scaleX(0); } to { transform: scaleX(1); } }
@media (prefers-reduced-motion: reduce) {
  .chart-fill,
  .view.is-active,
  .view.is-active .landing-inner,
  .view.is-active .results { animation: none; }
}

.chart-value {
  text-align: right;
  font-size: 14px;
  font-variant-numeric: tabular-nums;
  color: var(--text-primary);
}
.chart-value small { display: block; font-size: 12px; color: var(--text-muted); }

.chart-note { margin: 18px 0 0; font-size: 13px; color: var(--text-muted); }
.chart-compact { max-width: 520px; margin: 34px auto; text-align: left; }

.chart-empty {
  padding: 26px;
  border: 1px dashed var(--line);
  border-radius: var(--r-md);
  color: var(--text-muted);
  font-size: 14px;
  text-align: center;
}

/* ── share ───────────────────────────────────────────────────── */
.panel-share { background: linear-gradient(var(--surface-2), var(--surface-1)); }
.share-box { display: grid; gap: 16px; }
.share-link { display: flex; gap: 10px; flex-wrap: wrap; }
.share-link input {
  flex: 1 1 260px;
  min-width: 0;
  padding: 13px 16px;
  background: var(--plane);
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
  color: var(--text-secondary);
  font-size: 14px;
  font-family: var(--mono);
}
.btn-copy {
  padding: 13px 22px;
  border: 0; border-radius: var(--r-sm);
  background: #fff; color: #0b0b0b;
  font-weight: 620; cursor: pointer;
  transition: opacity .15s ease;
}
.btn-copy:hover { opacity: .88; }
.btn-copy.is-done { background: var(--accent); color: #fff; }

.share-preview {
  margin: 0;
  padding: 14px 16px;
  border-left: 2px solid var(--accent);
  background: rgba(255,255,255,.03);
  border-radius: 0 var(--r-sm) var(--r-sm) 0;
  font-size: 14px;
  color: var(--text-secondary);
}

.share-actions { display: flex; flex-wrap: wrap; gap: 10px; }
.btn-share {
  padding: 11px 18px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: transparent;
  color: var(--text-secondary);
  font-size: 14px;
  text-decoration: none;
  cursor: pointer;
  transition: border-color .15s ease, color .15s ease, background .15s ease;
}
.btn-share:hover { border-color: rgba(255,255,255,.28); color: var(--text-primary); background: rgba(255,255,255,.04); }

/* ── breakdown table ─────────────────────────────────────────── */
.table-tools {
  display: flex; align-items: center; justify-content: space-between;
  flex-wrap: wrap; gap: 14px;
  margin-bottom: 18px;
}
.seg {
  display: inline-flex;
  padding: 3px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--plane);
}
.seg-btn {
  padding: 8px 16px;
  border: 0; border-radius: 999px;
  background: transparent; color: var(--text-muted);
  font-size: 13px; cursor: pointer;
  transition: background .15s ease, color .15s ease;
}
.seg-btn.is-on { background: var(--surface-3); color: var(--text-primary); }

.table-legend { margin: 0; display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--text-muted); }
.legend-swatch {
  width: 22px; height: 10px; border-radius: 3px;
  background: var(--accent-soft);
  box-shadow: inset 0 0 0 1px var(--accent-ring);
}

.table-scroll {
  max-height: min(72vh, 780px);
  overflow-y: auto;
  overscroll-behavior: contain;
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  background: var(--plane);
}
.table-scroll::-webkit-scrollbar { width: 10px; }
.table-scroll::-webkit-scrollbar-track { background: transparent; }
.table-scroll::-webkit-scrollbar-thumb { background: var(--surface-3); border-radius: 99px; border: 3px solid var(--plane); }

.bd-q { border-bottom: 1px solid var(--line-soft); }
.bd-q:last-child { border-bottom: 0; }

.bd-head {
  position: sticky; top: 0; z-index: 2;
  padding: 16px 20px;
  background: rgba(13,13,13,.94);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--line-soft);
}
.bd-num {
  display: inline-block;
  margin-right: 10px;
  font-family: var(--mono); font-size: 12px;
  color: var(--text-muted);
}
.bd-cat {
  font-size: 11px; letter-spacing: .08em; text-transform: uppercase;
  color: #a9cbf5;
}
.bd-prompt { margin: 8px 0 0; font-size: 15px; font-weight: 600; line-height: 1.4; text-wrap: pretty; }
.bd-picked-tag { margin: 8px 0 0; font-size: 13px; color: var(--text-muted); }
.bd-picked-tag strong { color: var(--text-primary); font-weight: 620; }

.bd-rows { display: grid; }
.bd-row {
  display: grid;
  grid-template-columns: 132px 1fr;
  gap: 18px;
  padding: 14px 20px;
  border-top: 1px solid var(--line-soft);
}
.bd-model {
  display: flex; align-items: flex-start; gap: 8px;
  font-size: 14px;
  color: var(--text-secondary);
}
.bd-model-name { font-weight: 600; color: var(--text-primary); }
.bd-check { color: var(--accent); font-size: 13px; }
.bd-answer { font-size: 14px; line-height: 1.6; color: var(--text-secondary); min-width: 0; }
.bd-answer > *:first-child { margin-top: 0; }
.bd-answer > *:last-child { margin-bottom: 0; }
.bd-answer p { margin: 0 0 .7em; }
.bd-answer ul, .bd-answer ol { margin: 0 0 .7em; padding-left: 1.2em; }
.bd-answer pre {
  margin: 0 0 .7em; padding: 12px 14px;
  background: var(--surface-1); border: 1px solid var(--line-soft);
  border-radius: var(--r-sm); overflow-x: auto;
}
.bd-answer code { font-family: var(--mono); font-size: 12.5px; color: #d5d4cb; }

.bd-row.is-picked {
  background: var(--accent-soft);
  box-shadow: inset 3px 0 0 var(--accent);
}
.bd-row.is-picked .bd-answer { color: var(--text-primary); }

.results-foot { text-align: center; padding-top: 8px; }
.btn-restart {
  padding: 15px 28px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: transparent;
  color: var(--text-primary);
  font-size: 16px; cursor: pointer;
  transition: background .15s ease, border-color .15s ease;
}
.btn-restart:hover { background: rgba(255,255,255,.05); border-color: rgba(255,255,255,.28); }
.foot-note { margin: 22px auto 0; max-width: 62ch; font-size: 12.5px; color: var(--text-muted); text-wrap: pretty; }

/* ══════════════════ chrome ══════════════════ */
.site-foot {
  position: relative; z-index: 1;
  display: flex; justify-content: center; gap: 8px;
  padding: 28px var(--pad) 34px;
  border-top: 1px solid var(--line-soft);
  font-size: 13px;
  color: var(--text-muted);
}
.foot-sep { opacity: .5; }

/* hidden outright until it has something to say — a percentage translate on an
   empty pill doesn't reliably clear the viewport edge */
.toast {
  position: fixed; left: 50%; bottom: 28px;
  transform: translate(-50%, 16px);
  padding: 13px 22px;
  background: #fff; color: #0b0b0b;
  border-radius: 999px;
  font-size: 14px; font-weight: 600;
  box-shadow: 0 12px 34px -10px rgba(0,0,0,.7);
  z-index: 60;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: transform .3s cubic-bezier(.2,.8,.3,1), opacity .22s ease, visibility 0s linear .3s;
}
.toast.is-up {
  transform: translate(-50%, 0);
  opacity: 1;
  visibility: visible;
  transition-delay: 0s, 0s, 0s;
}

.shared-lead { margin-bottom: 6px; }
.shared-name { font-size: clamp(44px, 11vw, 92px); }

/* ══════════════════ narrow ══════════════════ */
@media (max-width: 720px) {
  .answers { grid-template-columns: 1fr; }

  /* the header is pinned, so keep it lean — it is spending the reader's screen */
  .quiz-head-inner { padding-top: 10px; }
  .quiz-head-row { margin-bottom: 9px; }
  .prompt-rail { padding: 10px var(--pad) 12px; }
  .prompt-card { padding: 14px 15px 15px; }
  .prompt-kicker { margin-bottom: 8px; font-size: 11px; }
  .prompt-label { display: none; }          /* the category chip already says it */
  .prompt-text { font-size: 16.5px; line-height: 1.3; }
  .bd-row { grid-template-columns: 1fr; gap: 8px; }
  .bd-model { align-items: center; }
  .chart-row { grid-template-columns: minmax(78px, 104px) 1fr auto; gap: 10px; }
  .hero-facts { gap: 24px; }
}
