/* One Detail bridge page. Same palette and type as the reels. */
@font-face {
  font-family: "Geist";
  src: url("/fonts/geist-latin-wght-normal.woff2") format("woff2");
  font-weight: 100 900;
  font-display: swap;
}
@font-face {
  font-family: "Geist Mono";
  src: url("/fonts/geist-mono-latin-wght-normal.woff2") format("woff2");
  font-weight: 100 900;
  font-display: swap;
}

:root {
  --bg: #131209;
  --surface: #1f1f1f;
  --surface-2: #272727;
  --line: #313131;
  --card: #ffffff;
  --ink: #131209;
  --ink-muted: #5e5d55;
  --text: #ffffff;
  --text-muted: #9b9b9b;
  --a: #2f6bff;
  --b: #ff6a2c;
  --hl: #ffe14a;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  color-scheme: dark;
}

* { box-sizing: border-box; }
html { background: var(--bg); }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 500 16px/24px "Geist", system-ui, sans-serif;
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
}
button { font: inherit; color: inherit; }
a { color: inherit; }
strong { font-weight: 700; }

.skip {
  position: absolute; left: 16px; top: -64px; z-index: 10;
  padding: 8px 12px; border-radius: 8px; background: var(--card); color: var(--ink);
}
.skip:focus { top: 16px; }

.app {
  min-height: 100svh;
  max-width: 480px;
  margin: 0 auto;
  padding: 12px 16px 24px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

/* Story progress bars */
.bars { display: flex; gap: 4px; }
.bars i { flex: 1; height: 4px; border-radius: 2px; background: rgb(255 255 255 / 0.18); overflow: hidden; }
.bars i::after {
  content: ""; display: block; height: 100%; background: var(--text);
  transform: scaleX(0); transform-origin: left; transition: transform 0.5s var(--ease);
}
.bars i.done::after { transform: scaleX(1); }

.top {
  display: flex; justify-content: space-between; align-items: center;
  font: 600 12px/16px "Geist Mono", ui-monospace, monospace;
  letter-spacing: 0.08em; text-transform: uppercase; color: var(--text-muted);
}
.brand { display: inline-flex; align-items: center; gap: 8px; color: var(--text); }
.brand svg { width: 16px; height: 16px; }

main { flex: 1; outline: none; }

/* Screens */
.screen { display: flex; flex-direction: column; gap: 16px; }
.screen.enter { opacity: 0; transform: translateY(24px); }
.screen.enter.in { opacity: 1; transform: none; transition: opacity 0.5s var(--ease), transform 0.5s var(--ease); }

h1 {
  margin: 0;
  font-size: 24px; line-height: 32px; font-weight: 700;
  letter-spacing: -0.01em;
  text-wrap: balance;
}
.sub { margin: 0; color: var(--text-muted); text-wrap: pretty; }

/* Case card */
.card {
  background: var(--card); color: var(--ink);
  border-radius: 24px; padding: 24px;
}
.kicker {
  margin: 0 0 12px;
  font: 600 12px/16px "Geist Mono", ui-monospace, monospace;
  letter-spacing: 0.08em; text-transform: uppercase; color: var(--ink-muted);
}
.line { margin: 0; font-size: 18px; line-height: 28px; text-wrap: pretty; }
.line + .line { margin-top: 8px; }
.q { margin: 16px 0 0; font-weight: 700; }

/* The new detail: highlighter sweep */
.detail { position: relative; isolation: isolate; margin-top: 16px; padding: 12px 16px; }
.detail::before {
  content: ""; position: absolute; inset: 0; z-index: -1;
  border-radius: 12px; background: var(--hl);
  transform: scaleX(0); transform-origin: left center;
  transition: transform 0.7s var(--ease);
}
.detail.on::before { transform: scaleX(1); }
.detail .tag {
  display: block; margin-bottom: 4px;
  font: 700 12px/16px "Geist Mono", ui-monospace, monospace;
  letter-spacing: 0.08em; text-transform: uppercase;
}
.detail .line { opacity: 0; transform: translateY(8px); transition: opacity 0.5s var(--ease) 0.25s, transform 0.5s var(--ease) 0.25s; }
.detail.on .line { opacity: 1; transform: none; }

/* Your earlier pick */
.mine {
  display: inline-flex; align-items: center; gap: 8px; align-self: flex-start;
  padding: 4px 12px 4px 4px; border-radius: 9999px; background: var(--surface-2);
  font-size: 14px; line-height: 20px; color: var(--text);
}
.mine .ltr { width: 24px; height: 24px; font-size: 12px; }

/* Answer buttons */
.opts { display: grid; gap: 12px; }
.opt {
  display: flex; align-items: center; gap: 12px;
  width: 100%; min-height: 64px; padding: 12px 16px;
  border: 0; border-radius: 16px;
  background: var(--surface); color: var(--text);
  font-weight: 600; text-align: left; cursor: pointer;
  transition: transform 0.3s var(--ease), background-color 0.3s var(--ease), opacity 0.3s var(--ease);
}
.opt:hover { background: var(--surface-2); }
.opt:active { transform: scale(0.98); }
.opt:focus-visible, .btn:focus-visible, .chip:focus-visible, .link:focus-visible {
  outline: 2px solid var(--hl); outline-offset: 2px;
}
.ltr {
  flex: none; display: grid; place-items: center;
  width: 40px; height: 40px; border-radius: 9999px;
  font: 700 16px/1 "Geist Mono", ui-monospace, monospace;
}
.ltr.A { background: var(--a); color: #fff; }
.ltr.B { background: var(--b); color: var(--ink); }
.opt.sel.A { background: var(--a); color: #fff; }
.opt.sel.A .ltr { background: #fff; color: var(--a); }
.opt.sel.B { background: var(--b); color: var(--ink); }
.opt.sel.B .ltr { background: var(--ink); color: var(--b); }
.opts.locked .opt:not(.sel) { opacity: 0.35; }
.opts.locked .opt { pointer-events: none; }

/* Confidence chips */
.chips { display: grid; gap: 12px; }
.chip {
  display: flex; justify-content: space-between; align-items: center;
  width: 100%; min-height: 56px; padding: 12px 16px;
  border: 0; border-radius: 16px; background: var(--surface); color: var(--text);
  font-weight: 600; text-align: left; cursor: pointer;
  transition: transform 0.3s var(--ease), background-color 0.3s var(--ease);
}
.chip:hover { background: var(--surface-2); }
.chip:active { transform: scale(0.98); }
.chip .meter { display: inline-flex; gap: 4px; }
.chip .meter i { width: 8px; height: 16px; border-radius: 2px; background: var(--line); }
.chip .meter i.on { background: var(--hl); }

.link {
  align-self: center; padding: 8px 12px; border: 0; border-radius: 8px;
  background: none; color: var(--text-muted); font-size: 14px; line-height: 20px; cursor: pointer;
}
.link:hover { color: var(--text); }

/* Breakdown */
.verdict { margin: 0; font-size: 18px; line-height: 28px; font-weight: 600; text-wrap: pretty; }
.compare { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.ver {
  display: flex; flex-direction: column; gap: 8px;
  padding: 16px; border-radius: 16px; background: var(--surface);
}
.ver .vl {
  font: 600 12px/16px "Geist Mono", ui-monospace, monospace;
  letter-spacing: 0.08em; text-transform: uppercase; color: var(--text-muted);
}
.ver .pick { display: flex; align-items: center; gap: 8px; font-weight: 700; }
.ver p { margin: 0; font-size: 14px; line-height: 20px; color: #d8d8d2; text-wrap: pretty; }
.key {
  margin: 0; padding: 16px; border-radius: 16px;
  background: var(--hl); color: var(--ink); font-weight: 600; text-wrap: pretty;
}
.key .tag {
  display: block; margin-bottom: 4px;
  font: 700 12px/16px "Geist Mono", ui-monospace, monospace;
  letter-spacing: 0.08em; text-transform: uppercase;
}

/* Result note after the twin case */
.note { margin: 0; padding: 16px; border-radius: 16px; background: var(--surface); text-wrap: pretty; }
.note .tag {
  display: flex; align-items: center; gap: 8px; margin-bottom: 8px;
  font: 700 12px/16px "Geist Mono", ui-monospace, monospace;
  letter-spacing: 0.08em; text-transform: uppercase; color: var(--hl);
}
.note .tag svg { width: 16px; height: 16px; }

/* Buttons */
.btns { display: grid; gap: 12px; }
.btn {
  display: flex; justify-content: center; align-items: center; gap: 8px;
  width: 100%; min-height: 56px; padding: 8px 12px;
  border: 0; border-radius: 16px; cursor: pointer; text-decoration: none;
  font-weight: 600; font-size: 16px; line-height: 24px;
  transition: transform 0.3s var(--ease), background-color 0.3s var(--ease), color 0.3s var(--ease);
}
.btn svg { width: 20px; height: 20px; }
.btn:active { transform: scale(0.98); }
.btn.primary { background: var(--card); color: var(--ink); }
.btn.primary:hover { background: var(--hl); }
.btn.ghost { background: var(--surface); color: var(--text); }
.btn.ghost:hover { background: var(--surface-2); }
.sharebox {
  width: 100%; min-height: 48px; padding: 12px 16px; border: 0; border-radius: 12px;
  background: var(--surface-2); color: var(--text); font: 500 14px/20px "Geist Mono", ui-monospace, monospace;
}
.sharebox:focus-visible { outline: 2px solid var(--hl); outline-offset: 2px; }
.fine { margin: 0; text-align: center; font-size: 12px; line-height: 16px; color: var(--text-muted); text-wrap: pretty; }

.endcard { display: flex; flex-direction: column; gap: 8px; padding: 24px; border-radius: 24px; background: var(--card); color: var(--ink); }
.endcard .kicker { margin: 0; }
.endcard h2 { margin: 0; font-size: 24px; line-height: 32px; font-weight: 700; text-wrap: balance; }
.endcard p { margin: 0; color: var(--ink-muted); text-wrap: pretty; }
.score { display: flex; gap: 8px; flex-wrap: wrap; margin: 8px 0 0; padding: 0; list-style: none; }
.score li {
  display: inline-flex; align-items: center; gap: 8px; padding: 4px 12px 4px 4px;
  border-radius: 9999px; background: #f1f0ea; font-size: 14px; line-height: 20px;
}
.score .dot { width: 24px; height: 24px; border-radius: 9999px; display: grid; place-items: center; background: var(--ink); color: var(--hl); }
.score .dot svg { width: 14px; height: 14px; }
.score .dot.miss { background: #d9d8d0; color: var(--ink); }

.toast {
  position: fixed; left: 50%; bottom: 24px; z-index: 20;
  padding: 12px 16px; border-radius: 12px; background: var(--card); color: var(--ink);
  font-size: 14px; line-height: 20px; font-weight: 600;
  transform: translate(-50%, 16px); opacity: 0; pointer-events: none;
  transition: transform 0.5s var(--ease), opacity 0.3s var(--ease);
}
.toast.on { transform: translate(-50%, 0); opacity: 1; }

.src { font-size: 12px; line-height: 16px; color: var(--text-muted); }
.src summary { cursor: pointer; padding: 8px 0; }
.src summary:focus-visible { outline: 2px solid var(--hl); outline-offset: 2px; border-radius: 4px; }
.src ul { margin: 0; padding-left: 16px; display: grid; gap: 8px; }
.src a { color: var(--text-muted); }

.foot { font-size: 12px; line-height: 16px; color: var(--text-muted); text-wrap: pretty; }
.foot a { color: var(--text-muted); }

/* Static pages */
.page h1 { margin-bottom: 8px; }
.page p, .page li { color: #d8d8d2; text-wrap: pretty; }
.page .btn { margin-top: 24px; }

@media (max-width: 359px) {
  .compare { grid-template-columns: 1fr; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition-duration: 0.01ms !important; }
  .screen.enter { transform: none; }
  .detail .line { transform: none; }
}
