/* Bug Whisperer: a case file, not a dashboard.
   Motion rules (Emil Kowalski): only transform/opacity/clip-path animate, ease-out for anything
   entering, UI motion under 300 ms, nothing animates on things seen constantly, hover only on
   real pointers, and reduced motion keeps fades but drops movement. */

:root {
  --paper: #f3eee5;
  --paper-2: #ebe4d8;
  --card: #fffdf9;
  --ink: #17181d;
  --ink-2: #3d3f47;
  --muted: #6f6a62;
  --line: #e2d9ca;
  --line-strong: #cfc3b0;
  --accent: #b4410f;
  --accent-ink: #fff;
  --accent-soft: #f8e9dc;
  --bug: #b3261e;
  --bug-soft: #fbe9e7;
  --ok: #0f7a52;
  --ok-soft: #e3f3ea;
  --warn: #946200;
  --warn-soft: #fbf1d6;
  --neutral-soft: #ece7de;

  --serif: "Fraunces", Georgia, "Times New Roman", serif;
  --sans: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --mono: "JetBrains Mono", ui-monospace, "Cascadia Code", Consolas, monospace;

  --radius: 16px;
  --radius-sm: 10px;
  --shadow: 0 1px 0 rgba(23, 24, 29, .04), 0 8px 24px -12px rgba(23, 24, 29, .18);
  --ease-out: cubic-bezier(0.23, 1, 0.32, 1);
  --ease-in-out: cubic-bezier(0.77, 0, 0.175, 1);
}

@media (prefers-color-scheme: dark) {
  :root {
    --paper: #101217; --paper-2: #151821; --card: #181b24; --ink: #ece7de; --ink-2: #c9c3b8;
    --muted: #9a958c; --line: #262a35; --line-strong: #343a48;
    --accent: #f08a4b; --accent-ink: #1a0f08; --accent-soft: #2a1d15;
    --bug: #f2867c; --bug-soft: #2b1a1b; --ok: #4fd39b; --ok-soft: #13271f;
    --warn: #f0c35a; --warn-soft: #2a2414; --neutral-soft: #1f232d;
    --shadow: 0 1px 0 rgba(0, 0, 0, .3), 0 10px 30px -14px rgba(0, 0, 0, .7);
  }
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; color: var(--ink); font: 16px/1.6 var(--sans);
  background-color: var(--paper);
  /* the faintest dot grid, like case-file paper */
  background-image: radial-gradient(var(--line) 1px, transparent 1px);
  background-size: 22px 22px;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--accent); text-underline-offset: 3px; }
::selection { background: var(--accent-soft); }
.wrap { max-width: 1100px; margin: 0 auto; padding: 28px 20px 56px; }
.muted { color: var(--muted); }
code { font-family: var(--mono); font-size: .9em; background: var(--neutral-soft); padding: 1px 6px; border-radius: 6px; }

/* ── Top bar ─────────────────────────────────────────────────────────────── */
.topbar {
  position: sticky; top: 0; z-index: 10;
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  padding: 12px 24px;
  background: color-mix(in srgb, var(--paper) 82%, transparent);
  backdrop-filter: saturate(1.4) blur(10px);
  border-bottom: 1px solid var(--line);
}
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--ink); }
.brand-mark {  /* Detective Kane's head, the same character as everywhere else */
  display: block; width: 38px; height: 38px; padding: 3px; border-radius: 10px;
  background: #2a2f4a; transform: rotate(-6deg);
}
.brand-name { font-family: var(--serif); font-weight: 700; font-size: 20px; letter-spacing: -.01em; }
.topbar nav { display: flex; gap: 4px; }
.topbar nav a {
  padding: 7px 12px; border-radius: 999px; color: var(--muted); text-decoration: none;
  font-weight: 600; font-size: 14.5px; transition: color 150ms ease, background-color 150ms ease;
}
.topbar nav a.on { color: var(--ink); background: var(--neutral-soft); }
@media (hover: hover) and (pointer: fine) { .topbar nav a:hover { color: var(--ink); } }

.demo-bar {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 6px 8px;
  padding: 9px 20px; font-size: 13.5px; text-align: center;
  background: var(--ink); color: var(--paper);
}
.demo-bar a { color: var(--accent-soft); font-weight: 700; }
.demo-dot { width: 7px; height: 7px; border-radius: 50%; background: #ff5a4f; box-shadow: 0 0 0 3px rgba(255, 90, 79, .25); }

/* ── Type ────────────────────────────────────────────────────────────────── */
h1, h2, .page-title, .case-title { font-family: var(--serif); letter-spacing: -.015em; }
.hero { padding: 28px 0 8px; }
.eyebrow { margin: 0 0 10px; font: 600 13px/1 var(--sans); letter-spacing: .08em; text-transform: uppercase; color: var(--accent); }
.hero h1 { font-size: clamp(34px, 5.4vw, 60px); line-height: 1.04; margin: 0 0 16px; font-weight: 700; }
.hero h1 em { font-style: italic; font-weight: 500; color: var(--accent); }
.lede { color: var(--ink-2); max-width: 720px; font-size: 17.5px; margin: 0; }
.page-title { font-size: clamp(30px, 4vw, 42px); margin: 8px 0 18px; }

/* ── Cards & forms ───────────────────────────────────────────────────────── */
.card {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 22px; margin: 18px 0; box-shadow: var(--shadow);
}
.card h2 { font-size: 21px; margin: 0 0 12px; font-weight: 700; }
.card h2 .muted { font-family: var(--sans); font-size: 13.5px; font-weight: 500; letter-spacing: 0; }
.card h3 { font: 600 12px/1.2 var(--sans); margin: 18px 0 8px; color: var(--muted); text-transform: uppercase; letter-spacing: .08em; }

.form { display: grid; gap: 16px; }
.intake-head { display: flex; justify-content: space-between; align-items: baseline; flex-wrap: wrap; gap: 6px 16px; }
.intake-head h2 { margin: 0; }
.intake-head .muted { font-size: 14px; }
.field { display: grid; gap: 7px; font-weight: 600; font-size: 14.5px; }
.field em { font-weight: 400; color: var(--muted); font-style: normal; }
input:not([type=checkbox]):not([type=file]):not([type=range]), select, textarea, input[type=file] {
  font: inherit; font-weight: 400; color: var(--ink); background: var(--paper);
  border: 1px solid var(--line-strong); border-radius: var(--radius-sm); padding: 11px 13px; width: 100%;
  transition: border-color 150ms ease, box-shadow 150ms ease;
}
input:focus-visible, select:focus-visible, textarea:focus-visible {
  outline: none; border-color: var(--accent); box-shadow: 0 0 0 4px var(--accent-soft);
}
textarea { resize: vertical; min-height: 110px; }
.examples { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; color: var(--muted); font-size: 13.5px; }
.chip {
  font: inherit; font-size: 13px; border: 1px dashed var(--line-strong); background: transparent; color: var(--ink-2);
  border-radius: 999px; padding: 5px 12px; cursor: pointer;
  transition: transform 160ms var(--ease-out), border-color 150ms ease, color 150ms ease;
}
.chip:active { transform: scale(0.97); }
@media (hover: hover) and (pointer: fine) { .chip:hover { border-color: var(--accent); color: var(--ink); } }

.btn {
  font: inherit; font-weight: 700; font-size: 15px; border-radius: 12px; padding: 10px 18px; cursor: pointer;
  border: 1px solid var(--line-strong); background: var(--card); color: var(--ink);
  transition: transform 160ms var(--ease-out), background-color 150ms ease, box-shadow 150ms ease;
}
.btn:active { transform: scale(0.97); }
.btn.primary {
  background: var(--accent); border-color: var(--accent); color: var(--accent-ink);
  box-shadow: 0 1px 0 rgba(255, 255, 255, .25) inset, 0 6px 16px -8px var(--accent);
}
.btn.big { padding: 15px 22px; font-size: 17px; }
@media (hover: hover) and (pointer: fine) { .btn.primary:hover { filter: brightness(1.06); } }
.hint { color: var(--muted); font-size: 13px; margin: -4px 0 0; }
.check { display: flex; gap: 10px; align-items: flex-start; font-size: 15px; }
.check input { margin-top: 5px; accent-color: var(--accent); }
.form details { border-top: 1px solid var(--line); padding-top: 12px; display: grid; gap: 12px; }
.form details summary { cursor: pointer; margin-bottom: 4px; }
.grid3 { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 12px; }

/* ── Home: featured case (proof first) ───────────────────────────────────── */
.featured { display: block; text-decoration: none; color: inherit; padding: 20px 22px 18px; position: relative; overflow: hidden; }
.featured::before { /* a folder tab */
  content: ""; position: absolute; inset: 0 auto auto 0; width: 140px; height: 5px; background: var(--ok); border-radius: 0 0 6px 0;
}
.featured-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 14px; }
.featured-label { font: 600 12.5px/1 var(--sans); letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.featured-grid { display: grid; grid-template-columns: 1fr 1.25fr 1.25fr; gap: 14px; }
.featured-step { margin: 0; display: grid; gap: 8px; align-content: start; }
.featured-step figcaption { font-size: 13.5px; font-weight: 600; color: var(--ink-2); display: flex; align-items: center; gap: 8px; }
.featured-step .shot { margin-top: 0; }
/* tighter zoom on the front page: the interesting part of the app, not the empty margins */
.featured .shot.kane { aspect-ratio: 2 / 1; object-view-box: inset(0% 20% 45% 20%); }
.featured .complaint { font-size: 15px; }
.featured-cta { display: inline-block; margin-top: 14px; font-weight: 700; color: var(--accent); }
.num {
  display: inline-grid; place-items: center; width: 22px; height: 22px; border-radius: 50%; flex: none;
  background: var(--ink); color: var(--paper); font: 700 12px/1 var(--sans);
}
.featured { transition: transform 200ms var(--ease-out), box-shadow 200ms ease, border-color 200ms ease; }
@media (hover: hover) and (pointer: fine) {
  .featured:hover { border-color: var(--line-strong); transform: translateY(-2px); }
}
@media (max-width: 760px) { .featured-grid { grid-template-columns: 1fr; } }

.how { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 12px; margin-top: 8px; }
.how div { background: color-mix(in srgb, var(--card) 70%, transparent); border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 14px; }
.how b { display: block; margin: 8px 0 4px; font-family: var(--serif); font-size: 17px; }
.how p { margin: 0; color: var(--muted); font-size: 14px; line-height: 1.5; }

/* ── Home: the opening. Seen once per visit, so it can tell the story:
   the headline rises, then the featured case plays in order (statement → bug → fix → stamp). ──
   fill-mode "backwards" (not "both") so hover transforms still work once the entrance ends. */
.hero h1 .line { display: block; }
.hero .eyebrow, .hero h1 .line, .hero .lede { animation: rise 520ms var(--ease-out) backwards; }
.hero h1 .line:nth-child(1) { animation-delay: 70ms; }
.hero h1 .line:nth-child(2) { animation-delay: 160ms; }
.hero .lede { animation-delay: 250ms; }
.featured { animation: rise 520ms var(--ease-out) 340ms backwards; }
.featured::before { transform-origin: left; animation: draw 600ms var(--ease-out) 600ms backwards; }
.featured-step { animation: rise 420ms var(--ease-out) backwards; }
.featured-step:nth-child(1) { animation-delay: 520ms; }
.featured-step:nth-child(2) { animation-delay: 760ms; }
.featured-step:nth-child(3) { animation-delay: 1000ms; }
.featured-step .bad { display: inline-block; animation: pop 240ms var(--ease-out) 1000ms backwards; }
.featured-step .good { display: inline-block; animation: pop 240ms var(--ease-out) 1240ms backwards; }
.featured .stamp { animation: slam 320ms var(--ease-out) 1420ms backwards; }
@keyframes rise { from { opacity: 0; transform: translateY(14px); } }
@keyframes draw { from { transform: scaleX(0.05); } }
@keyframes pop { from { opacity: 0; transform: scale(0.6); } }
@keyframes slam { from { opacity: 0; transform: rotate(-12deg) scale(1.6); } }

/* Below the fold: rise when scrolled into view. Hidden only once app.js says it's watching. */
.reveal-ready [data-reveal]:not(.seen), .reveal-ready .how:not(.seen) > div { opacity: 0; transform: translateY(14px); }
[data-reveal], .how > div { transition: opacity 480ms var(--ease-out), transform 480ms var(--ease-out); }
.how > div:nth-child(2) { transition-delay: 60ms; } .how > div:nth-child(3) { transition-delay: 120ms; }
.how > div:nth-child(4) { transition-delay: 180ms; } .how > div:nth-child(5) { transition-delay: 240ms; }

/* ── Case page ───────────────────────────────────────────────────────────── */
.crumbs { color: var(--muted); font-size: 14px; }
.crumbs a { text-decoration: none; font-weight: 600; }
.case-title { font-size: clamp(28px, 4vw, 40px); margin: 6px 0 0; line-height: 1.1; }
.case-title span { display: block; margin-top: 6px; font: 500 17px/1.4 var(--sans); color: var(--muted); letter-spacing: 0; }

.track { display: flex; flex-wrap: wrap; gap: 6px; list-style: none; padding: 0; margin: 18px 0; counter-reset: s; }
.track li {
  counter-increment: s; font-size: 12.5px; font-weight: 600; color: var(--muted);
  padding: 6px 12px; border-radius: 999px; background: var(--neutral-soft); border: 1px solid transparent;
  transition: background-color 200ms ease, color 200ms ease;
}
.track li::before { content: counter(s) "  "; opacity: .55; }
.track li.done { background: var(--ok-soft); color: var(--ok); }
.track li.now { background: var(--accent); color: var(--accent-ink); }

.banner { display: flex; align-items: center; gap: 12px; border-radius: var(--radius); padding: 14px 18px; font-weight: 600; }
.banner.working { background: var(--accent-soft); color: var(--accent); border: 1px solid color-mix(in srgb, var(--accent) 25%, transparent); }
.pulse { width: 10px; height: 10px; border-radius: 50%; background: var(--accent); flex: none; animation: pulse 1.4s ease-in-out infinite; }
@keyframes pulse { 0%, 100% { opacity: 1; transform: scale(1); } 50% { opacity: .35; transform: scale(.7); } }

.verdict {
  border-radius: var(--radius); padding: 16px 20px; margin: 16px 0; font-size: 16.5px; line-height: 1.7;
  border: 1px solid transparent;
}
.verdict .stamp { margin-right: 12px; vertical-align: 1px; }
.verdict.bug { background: var(--bug-soft); color: var(--bug); border-color: color-mix(in srgb, var(--bug) 22%, transparent); }
.verdict.ok { background: var(--ok-soft); color: var(--ok); border-color: color-mix(in srgb, var(--ok) 22%, transparent); }
.verdict.warn { background: var(--warn-soft); color: var(--warn); }
.verdict.neutral { background: var(--neutral-soft); }
.verdict b { margin-right: 2px; }

/* The rubber stamp. It lands once: a rare, meaningful moment, so a little delight is allowed. */
.stamp {
  display: inline-block; flex: none; padding: 2px 12px; transform: rotate(-4deg);
  border: 3px solid currentColor; border-radius: 7px;
  font: 800 14px/1.5 var(--sans); text-transform: uppercase; letter-spacing: .1em;
  mask-image: radial-gradient(circle at 30% 40%, #000 60%, rgba(0, 0, 0, .82) 100%);
}
.stamp-ok { color: var(--ok); }
.verdict .stamp { animation: stamp-land 280ms var(--ease-out) both; }
.polled .verdict .stamp { animation: none; }  /* polling re-renders: only a changed stamp lands again */
@keyframes stamp-land {
  from { opacity: 0; transform: rotate(-4deg) scale(1.12); }
  to   { opacity: 1; transform: rotate(-4deg) scale(1); }
}

.claim { border: 1px solid var(--line); background: var(--card); border-radius: var(--radius); padding: 13px 18px; margin: 12px 0; }
.claim.confirmed { border-color: color-mix(in srgb, var(--ok) 45%, var(--line)); }
.claim.not_true { border-color: color-mix(in srgb, var(--bug) 45%, var(--line)); }
.claim .muted { display: block; font-size: 12.5px; margin-top: 6px; font-family: var(--mono); }

.fixbar {
  display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap;
  border: 2px dashed color-mix(in srgb, var(--accent) 55%, transparent); background: var(--accent-soft);
  border-radius: var(--radius); padding: 16px 20px; margin: 16px 0;
}

.fixbar-actions { display: flex; gap: 10px; flex-wrap: wrap; }

/* Claude's repair plan: the ways to repair it, side by side, each with its own Repair button. */
.plan-card h2 .muted { font-weight: 400; }
.plan-cause { margin: 4px 0 14px; }
.plan-retry { margin: 4px 0 10px; color: var(--warn); }
.plan-options { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 12px; }
.plan-option {
  display: flex; flex-direction: column; gap: 6px; margin: 0;
  border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 14px 16px; background: var(--paper);
}
.plan-option.picked { border: 2px solid color-mix(in srgb, var(--accent) 60%, transparent); background: var(--accent-soft); }
.plan-option p { margin: 0; overflow-wrap: anywhere; }
.plan-option .btn { margin-top: auto; align-self: flex-start; }
.plan-option-head { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.plan-letter {
  display: inline-grid; place-items: center; width: 24px; height: 24px; border-radius: 50%;
  background: var(--ink-2); color: var(--paper); font: 700 12.5px/1 var(--sans);
}
.tag.pick { background: var(--accent); color: var(--accent-ink); margin-left: 0; }
.plan-tradeoff { color: var(--muted); font-size: 14px; }
.plan-files { font-size: 13px; color: var(--muted); }
.plan-files code { font-family: var(--mono); font-size: 12.5px; }
.plan-checks { margin-top: 16px; padding-top: 12px; border-top: 1px dashed var(--line); }
.plan-checks ol { margin: 8px 0 0; padding-left: 0; list-style: none; display: grid; gap: 6px; }
.plan-checks details { margin-top: 4px; }
.plan-checks summary { cursor: pointer; color: var(--accent); font-size: 14px; }
.plan-sealed { font-family: var(--mono); font-size: 12.5px; margin: 6px 0 0; overflow-wrap: anywhere; }
.promise { font-size: 14.5px; }
.promise.kept b { color: var(--ok); }
.promise.strayed b { color: var(--warn); }

.grid2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: 18px; margin: 18px 0; }
.grid2 .card { margin: 0; }
.grid2.tight { margin: 0; gap: 12px; }
.complaint {
  margin: 0; padding: 14px 16px 14px 18px; background: var(--paper); border-radius: var(--radius-sm);
  font-family: var(--serif); font-size: 18px; font-style: italic; line-height: 1.45; color: var(--ink-2);
  border-left: 4px solid var(--line-strong); overflow-wrap: anywhere;
}
.shot { width: 100%; border-radius: var(--radius-sm); border: 1px solid var(--line); margin-top: 12px; display: block; background: var(--paper-2); }
/* Kane browses at 1920px, so apps sit in the middle: zoom into it. Clicking opens the full shot. */
.shot.kane, .compare-img.kane { aspect-ratio: 16 / 10; object-fit: cover; object-view-box: inset(0% 16% 22% 16%); }
.caption { color: var(--muted); font-size: 13px; margin: 8px 0 0; }
.notes { margin-top: 16px; background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 12px 16px; }
.notes b { font-size: 13px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); }
.notes p { margin: 6px 0 0; font-family: var(--serif); font-style: italic; font-size: 16.5px; line-height: 1.5; }
.tag { font: 700 11.5px/1.6 var(--sans); border-radius: 6px; padding: 2px 8px; margin-left: 8px; vertical-align: middle; letter-spacing: .02em; }
.tag.bug { background: var(--bug-soft); color: var(--bug); }

/* Kane's live steps: only steps that just arrived slide in (app.js marks them .new). */
.steps { font-family: var(--mono); font-size: 13px; padding-left: 24px; margin: 0; }
.steps li { padding: 4px 0; overflow-wrap: anywhere; }
.steps li.failed { color: var(--bug); font-weight: 600; }
.steps li.running { color: var(--accent); }
.steps li.running::after { content: " …"; }
.steps li.new { animation: step-in 220ms var(--ease-out) both; }
@keyframes step-in { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

/* Before/after: two screenshots stacked; the top one is clipped. Dragging moves the clip only. */
.compare {
  --pos: 50%;
  position: relative; border-radius: var(--radius-sm); overflow: hidden; border: 1px solid var(--line);
  background: var(--paper-2); user-select: none; touch-action: pan-y;
}
.compare-img { display: block; width: 100%; }
.compare-after { position: absolute; inset: 0; height: 100%; clip-path: inset(0 0 0 var(--pos)); }
.compare-handle {
  position: absolute; top: 0; bottom: 0; left: var(--pos); width: 2px; margin-left: -1px;
  background: var(--card); box-shadow: 0 0 0 1px rgba(0, 0, 0, .15); pointer-events: none;
}
.compare-handle::after {
  content: "⟷"; position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%);
  display: grid; place-items: center; width: 34px; height: 34px; border-radius: 50%;
  background: var(--card); color: var(--ink); font-size: 16px; box-shadow: var(--shadow);
}
.compare-label {
  position: absolute; top: 10px; padding: 3px 10px; border-radius: 999px; font: 700 12px/1.6 var(--sans);
  background: rgba(23, 24, 29, .78); color: #fff; pointer-events: none;
}
.compare-label.left { left: 10px; }
.compare-label.right { right: 10px; }
.compare-range { position: absolute; inset: 0; width: 100%; height: 100%; margin: 0; opacity: 0; cursor: ew-resize; }
.ba-captions { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.ba-captions .bad, .bad { color: var(--bug); }
.ba-captions .good, .good { color: var(--ok); }
@media (max-width: 640px) { .ba-captions { grid-template-columns: 1fr; } }

pre { font-family: var(--mono); font-size: 12.5px; background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 12px 14px; overflow-x: auto; white-space: pre-wrap; }
.diff span { display: block; padding: 0 4px; border-radius: 3px; }
.diff .add { color: var(--ok); background: var(--ok-soft); }
.diff .del { color: var(--bug); background: var(--bug-soft); }
.reply { font-size: 16px; }
.objective { font-family: var(--mono); font-size: 13px; }
details.card summary { cursor: pointer; font-weight: 700; }

.film { display: flex; gap: 12px; overflow-x: auto; padding-bottom: 8px; scroll-snap-type: x proximity; }
.film a { flex: none; width: 190px; text-decoration: none; color: var(--muted); font-size: 12px; scroll-snap-align: start; }
.film img { width: 190px; border-radius: 8px; border: 2px solid var(--line); display: block; margin-bottom: 4px; }
.film a.failed img { border-color: var(--bug); }
.film a.failed { color: var(--bug); font-weight: 700; }

/* ── Watch Kane solve this case ──────────────────────────────────────────── */
.replay { padding: 20px 22px; outline: none; }
.replay:focus-visible { box-shadow: var(--shadow), 0 0 0 3px var(--accent-soft); }
.replay-head { display: flex; justify-content: space-between; align-items: baseline; flex-wrap: wrap; gap: 4px 16px; margin-bottom: 12px; }
.replay-head h2 { margin: 0; }
.replay-head .muted { font-size: 13px; }
.replay-stage {
  position: relative; aspect-ratio: 16 / 9; border-radius: var(--radius-sm); overflow: hidden;
  background: var(--ink); border: 1px solid var(--line); cursor: pointer;
}
.replay-img {
  position: absolute; inset: 0; width: 100%; height: 100%;
  object-fit: cover; object-view-box: inset(0% 14% 18% 14%);
  opacity: 0; filter: blur(2px); transition: opacity 220ms ease, filter 220ms ease;
}
.replay-img.on { opacity: 1; filter: none; }
.replay-chapter {
  position: absolute; top: 12px; left: 12px; padding: 4px 11px; border-radius: 999px;
  background: rgba(23, 24, 29, .8); color: #fff; font: 700 12px/1.6 var(--sans); letter-spacing: .02em;
}
.replay-play {
  position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%);
  display: flex; align-items: center; gap: 10px; padding: 14px 22px; border-radius: 999px; border: 0;
  background: var(--accent); color: var(--accent-ink); font: 700 17px/1 var(--sans); cursor: pointer;
  box-shadow: 0 10px 30px -10px rgba(0, 0, 0, .6); transition: transform 160ms var(--ease-out);
}
.replay-play span { font-size: 14px; }
.replay-play:active { transform: translate(-50%, -50%) scale(0.97); }
.replay-play[hidden] { display: none; }
.replay.ended .replay-play { top: auto; bottom: 14%; transform: translateX(-50%); z-index: 2; }
.replay.ended .replay-play:active { transform: translateX(-50%) scale(0.97); }
.replay-end {
  position: absolute; inset: 0; display: grid; place-content: center; justify-items: center; gap: 14px;
  padding-bottom: 12%;
  background: color-mix(in srgb, var(--card) 86%, transparent); backdrop-filter: blur(3px); text-align: center; padding: 20px;
}
.replay-end[hidden] { display: none; }
.replay-stamp { font-size: 26px; padding: 4px 18px; border-width: 4px; animation: stamp-land 300ms var(--ease-out) both; }
.replay-stamp.tone-ok { color: var(--ok); }
.replay-stamp.tone-bug { color: var(--bug); }
.replay-stamp.tone-warn { color: var(--warn); }
.replay-stamp.tone-neutral { color: var(--ink-2); }
.replay-end-line { margin: 0; font-family: var(--serif); font-style: italic; font-size: 19px; color: var(--ink); max-width: 520px; }
.replay-end .replay-play { position: static; transform: none; }
.replay-line {
  margin: 14px 0 10px; min-height: 2.9em; font-family: var(--serif); font-size: 19px; line-height: 1.45; color: var(--ink);
}
.replay-line .who { font-family: var(--sans); font-size: 13px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--accent); margin-right: 4px; }
.replay-line.failed .text { color: var(--bug); font-weight: 700; }
.replay-line.fresh .text { animation: line-in 220ms var(--ease-out) both; }
@keyframes line-in { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }
.replay-bar { display: flex; align-items: center; gap: 10px; }
.replay-bar .btn { width: 40px; height: 36px; padding: 0; font-size: 20px; line-height: 1; }
.replay-progress { flex: 1; height: 6px; border-radius: 999px; background: var(--neutral-soft); overflow: hidden; }
.replay-progress span {
  display: block; height: 100%; background: var(--accent); border-radius: inherit;
  transform: scaleX(0); transform-origin: left; transition: transform 300ms var(--ease-out);
}
.live-view { position: relative; margin: 0 0 14px; border-radius: var(--radius-sm); overflow: hidden; border: 1px solid var(--line); background: var(--ink); }
.live-shot { display: block; width: 100%; aspect-ratio: 16 / 10; object-fit: cover; object-view-box: inset(0% 10% 12% 10%); }
.live-badge {
  position: absolute; top: 10px; left: 10px; display: flex; align-items: center; gap: 7px;
  padding: 4px 11px; border-radius: 999px; background: rgba(23, 24, 29, .82); color: #fff;
  font: 700 12px/1.5 var(--sans); letter-spacing: .04em;
}
.rec { width: 8px; height: 8px; border-radius: 50%; background: #ff4d4d; animation: pulse 1.2s ease-in-out infinite; }
/* The live tracker: Kane at work, from Kane's own events. */
.tracker { border: 1px solid var(--line); border-radius: var(--radius-sm); background: color-mix(in srgb, var(--card) 85%, transparent); overflow: hidden; }
.tracker-head {
  display: flex; align-items: center; gap: 10px; padding: 10px 14px; border-bottom: 1px solid var(--line);
  font-size: 14px; background: var(--accent-soft); color: var(--accent);
}
.tracker-meta { margin-left: auto; font: 600 12.5px/1 var(--mono); color: var(--muted); font-variant-numeric: tabular-nums; }
.tracker-more, .tracker-wait { margin: 0; padding: 8px 14px 0; font-size: 12.5px; color: var(--muted); }
.tracker-wait { padding-bottom: 12px; }
.track-list { list-style: none; padding: 6px 0; font-family: var(--sans); font-size: 14px; }
.track-list li {
  display: grid; grid-template-columns: 24px 1fr auto; align-items: start; gap: 8px;
  padding: 6px 14px; border-left: 3px solid transparent;
}
.track-list .ico { text-align: center; line-height: 1.4; }
.track-list .txt { line-height: 1.4; }
.track-list .mark { font-weight: 800; color: var(--ok); line-height: 1.4; }
.track-list li.failed .mark { color: var(--bug); }
.track-list li.running { background: var(--accent-soft); border-left-color: var(--accent); color: var(--ink); }
.track-list li.running::after { content: none; }
.track-list .now {
  font: 700 11px/1 var(--sans); text-transform: uppercase; letter-spacing: .08em; color: var(--accent);
  padding: 4px 7px; border-radius: 999px; border: 1px solid currentColor; animation: pulse 1.4s ease-in-out infinite;
}

.steps-who { margin: 0 0 8px; font-size: 13px; font-weight: 700; color: var(--accent); letter-spacing: .02em; }
@media (max-width: 600px) { .replay-line { font-size: 16.5px; } .replay-stamp { font-size: 20px; } }

/* ── Case files list ─────────────────────────────────────────────────────── */
.list { display: grid; gap: 10px; }
.row {
  display: flex; align-items: center; gap: 16px; margin: 0; text-decoration: none; color: var(--ink);
  transition: transform 180ms var(--ease-out), border-color 150ms ease;
  animation: row-in 260ms var(--ease-out) both;
}
.row:nth-child(2) { animation-delay: 40ms; } .row:nth-child(3) { animation-delay: 80ms; }
.row:nth-child(4) { animation-delay: 120ms; } .row:nth-child(5) { animation-delay: 160ms; }
.row:nth-child(n+6) { animation-delay: 200ms; }
@keyframes row-in { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
@media (hover: hover) and (pointer: fine) { .row:hover { border-color: var(--line-strong); transform: translateY(-1px); } }
.row:active { transform: scale(0.99); }
.row-text { display: grid; gap: 2px; min-width: 0; }
.row-text b { font-size: 16px; }
.row-text small { color: var(--muted); overflow-wrap: anywhere; }
.row-text .note { color: var(--warn); font-weight: 600; }
.case-no { flex: none; font-family: var(--mono); font-weight: 600; color: var(--muted); min-width: 34px; }
.badge { flex: none; font-size: 12.5px; font-weight: 700; border-radius: 999px; padding: 4px 12px; white-space: nowrap; }
.row .badge { min-width: 168px; text-align: center; }  /* titles line up down the list */
@media (max-width: 640px) { .row .badge { min-width: 0; } }
.badge.ok { background: var(--ok-soft); color: var(--ok); }
.badge.bug { background: var(--bug-soft); color: var(--bug); }
.badge.warn { background: var(--warn-soft); color: var(--warn); }
.badge.work { background: var(--accent-soft); color: var(--accent); }
.badge.neutral { background: var(--neutral-soft); color: var(--ink); }
@media (max-width: 640px) { .row { flex-wrap: wrap; gap: 8px 12px; } }

/* ── Footer ──────────────────────────────────────────────────────────────── */
.foot {
  display: grid; gap: 2px; justify-items: center; text-align: center;
  color: var(--muted); font-size: 13px; padding: 8px 20px 40px; max-width: 760px; margin: 0 auto;
}

/* ── Phones ──────────────────────────────────────────────────────────────── */
.topbar nav a, .brand-name { white-space: nowrap; }
@media (max-width: 600px) {
  .topbar { padding: 10px 14px; }
  .brand-name { font-size: 17px; }
  .topbar nav a { padding: 6px 9px; font-size: 13.5px; }
  .how { grid-template-columns: 1fr 1fr; }
  .how div:last-child { grid-column: 1 / -1; }
  .card { padding: 18px; border-radius: 14px; }
  .wrap { padding: 20px 14px 40px; }
}

@media (max-width: 460px) {
  .brand-name { display: none; }  /* the icon is enough; the nav needs the room */
}

/* ── Reduced motion: keep fades, drop movement ───────────────────────────── */
@media (prefers-reduced-motion: reduce) {
  .verdict .stamp, .row, .steps li.new, .replay-stamp, .replay-line.fresh .text { animation: fade-only 200ms ease both; }
  .replay-img { filter: none; }
  .replay-progress span { transition: none; }
  .pulse, .track-list .now { animation: none; }
  .featured, .row, .btn, .chip { transition: none; }
  .hero .eyebrow, .hero h1 .line, .hero .lede, .featured, .featured::before, .featured-step,
  .featured-step .bad, .featured-step .good, .featured .stamp { animation-name: fade-only; animation-duration: 200ms; }
  .reveal-ready [data-reveal]:not(.seen), .reveal-ready .how:not(.seen) > div { transform: none; }
  [data-reveal], .how > div { transition: opacity 200ms ease; transition-delay: 0ms; }
  @keyframes fade-only { from { opacity: 0; } to { opacity: 1; } }
}

/* ── The boards: a detective's corkboard of cases, and each case's evidence wall ──────────────
   Everything pinned is real evidence. Pins drop in once (rare, meaningful: delight allowed), the
   red string draws after them; hover straightens a note on real pointers; reduced motion fades. */
:root {
  --cork: #b8875a; --cork-dot: rgba(70, 40, 15, .16); --cork-hi: rgba(255, 240, 215, .12);
  --frame: #6e4a2c; --note: #fffcf2; --note-ink: #23201b; --string: #c62828; --hand: "Caveat", "Segoe Print", cursive;
}
@media (prefers-color-scheme: dark) {
  :root { --cork: #6b4f33; --cork-dot: rgba(0, 0, 0, .28); --cork-hi: rgba(255, 220, 180, .06); --frame: #3b2a1b; --note: #f4eedf; --string: #e2483d; }
}
.board-lede { color: var(--muted); margin: -6px 0 16px; }
.cork, .board-wall {
  position: relative; border-radius: 14px; border: 10px solid var(--frame);
  background-color: var(--cork);
  background-image: radial-gradient(var(--cork-dot) 1.2px, transparent 1.6px), radial-gradient(var(--cork-hi) 1px, transparent 1.5px);
  background-size: 7px 7px, 11px 11px; background-position: 0 0, 3px 5px;
  box-shadow: inset 0 2px 14px rgba(0, 0, 0, .35), var(--shadow);
}
.cork { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); align-items: start; gap: 34px 28px; padding: 34px 28px 30px; }
.strings { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; z-index: 0; overflow: visible; }  /* behind the notes, like real string */
.strings path { fill: none; stroke: var(--string); stroke-width: 2.2; stroke-linecap: round; filter: drop-shadow(0 2px 1.5px rgba(0, 0, 0, .35)); }
.strings.drawing path { transition: stroke-dashoffset 700ms var(--ease-out); }

.pinned {
  position: relative; z-index: 1; display: block; margin: 0; background: var(--note); color: var(--note-ink);
  padding: 22px 16px 14px; border-radius: 3px; text-decoration: none;
  box-shadow: 0 1px 1px rgba(0, 0, 0, .15), 0 10px 18px -8px rgba(0, 0, 0, .55);
  transform: rotate(var(--tilt, 0deg)); transition: transform 200ms var(--ease-out);
  animation: pin-drop 380ms var(--ease-out) backwards; animation-delay: calc(var(--i, 0) * 70ms);
}
.pin {
  position: absolute; top: -7px; left: 50%; width: 16px; height: 16px; margin-left: -8px; border-radius: 50%; z-index: 3;
  background: radial-gradient(circle at 35% 30%, #ff8a80, #c62828 55%, #7f1010);
  box-shadow: 0 3px 4px rgba(0, 0, 0, .45);
}
@keyframes pin-drop { from { opacity: 0; transform: translateY(-14px) rotate(var(--tilt, 0deg)) scale(1.03); } }
@media (hover: hover) and (pointer: fine) {
  a.pinned:hover, .pin-photo:hover { transform: rotate(0deg) translateY(-3px); z-index: 4; }
}
.pinned .stamp { font-size: 12.5px; }
.tone-ok { color: var(--ok); } .tone-bug { color: var(--bug); } .tone-warn { color: var(--warn); }
.tone-neutral { color: #6f6a62; } .tone-work { color: var(--accent); }
.pinned .tone-ok { color: #0f7a52; } .pinned .tone-bug { color: #b3261e; } .pinned .tone-warn { color: #946200; }
.pinned .tone-work { color: #b4410f; }

/* a case on the corkboard */
.pin-case { display: grid; gap: 8px; align-content: start; }
.case-label { font: 700 11.5px/1.2 var(--mono); letter-spacing: .04em; text-transform: uppercase; color: #6f6a62; }
.pin-case img { width: 100%; aspect-ratio: 16 / 9; object-fit: cover; object-position: top; border: 6px solid #fff; border-bottom-width: 14px; box-shadow: 0 2px 6px rgba(0, 0, 0, .25); }
.hand { font: 600 21px/1.15 var(--hand); color: #1f3a8a; overflow-wrap: anywhere; }
.case-line { font-size: 13px; font-weight: 600; line-height: 1.35; }
.case-foot { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-top: 4px; }
.case-foot small { color: #8a847a; font-size: 11.5px; }

/* the evidence wall inside a case */
.board { margin: 18px 0; }
.board-title { margin: 0 0 10px; }
.board-wall {
  display: grid; gap: 40px 34px; padding: 36px 30px 30px;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  grid-template-areas: "statement reading claim" "scene scene verdict" "repair recheck closed";
}
.at-statement { grid-area: statement; } .at-reading { grid-area: reading; } .at-claim { grid-area: claim; }
.at-scene { grid-area: scene; } .at-verdict { grid-area: verdict; }
.at-repair { grid-area: repair; } .at-recheck { grid-area: recheck; } .at-closed { grid-area: closed; }
.board-wall .pinned { align-self: start; }
.pinned-title { display: block; font: 700 11.5px/1.3 var(--mono); letter-spacing: .04em; text-transform: uppercase; color: #6f6a62; margin-bottom: 6px; }
.pinned p { margin: 0; font-size: 14px; line-height: 1.45; }
.pin-hand p { font: 600 22px/1.15 var(--hand); color: #1f3a8a; }
.pin-typed p { font-family: var(--mono); font-size: 12.5px; }
.pin-photo { background: #fff; padding: 10px 10px 12px; }
.pin-photo img { display: block; width: 100%; aspect-ratio: 16 / 9; object-fit: cover; object-position: top; }
.pin-photo figcaption { margin-top: 8px; font: 600 19px/1.15 var(--hand); color: #23201b; }
.pin-photo figcaption span { display: block; font: 500 12.5px/1.4 var(--sans); color: #6f6a62; margin-top: 2px; }
.pin-stamp { display: grid; gap: 10px; justify-items: start; }
.pin-stamp .stamp { font-size: 18px; padding: 3px 14px; }
.pin-stamp p { font-size: 13px; color: #3d3f47; }
.pin-diff pre { margin: 0; padding: 0; border: 0; background: none; box-shadow: none; color: inherit; font: 11.5px/1.45 var(--mono); white-space: pre-wrap; overflow-wrap: anywhere; }
.pin-diff .add { color: #0f7a52; display: block; } .pin-diff .del { color: #b3261e; display: block; }

@media (max-width: 760px) {
  .board-wall { grid-template-columns: 1fr; grid-template-areas: none; gap: 28px; padding: 30px 18px 22px; }
  .board-wall .pinned { grid-area: auto; }
  .board-wall .strings { display: none; }  /* one column: the order already tells the story */
  .cork { gap: 28px; padding: 28px 18px; }
}
@media (prefers-reduced-motion: reduce) {
  .pinned { animation: fade-only 200ms ease both; animation-delay: 0ms; transition: none; }
  .strings.drawing path { transition: none; }
}
.at-scene { justify-self: start; width: min(100%, 560px); }
.at-scene img { aspect-ratio: 2 / 1; }

/* ── Detective Kane, the main character (RPG style). What he says is always real; how he moves
   follows the real state: reading (Claude at work), walking (Kane at the scene), idle. ───────── */
.scene { display: grid; gap: 14px; margin: 16px 0; }
.scene-case { grid-template-columns: 92px 1fr; align-items: end; }
.scene-actor { width: 92px; }
.kane-sprite { display: block; width: 100%; height: auto; overflow: visible; }
.kane-body { transform-origin: 60px 160px; }
.kane-idle .kane-body { animation: kane-breathe 3.2s ease-in-out infinite; }
.kane-walking .kane-body { animation: kane-walk 520ms ease-in-out infinite; }
.kane-reading .kane-lens { transform-origin: 86px 102px; animation: kane-scan 1.6s ease-in-out infinite; }
@keyframes kane-breathe { 50% { transform: translateY(-1.5px) scaleY(1.01); } }
@keyframes kane-walk { 25% { transform: translateY(-3px) rotate(-2deg); } 75% { transform: translateY(-3px) rotate(2deg); } }
@keyframes kane-scan { 0%, 100% { transform: rotate(-14deg); } 50% { transform: rotate(10deg); } }

/* the RPG dialogue box */
.rpg-box {
  position: relative; display: grid; grid-template-columns: 58px 1fr; gap: 12px; align-items: start;
  background: #15182a; color: #f3eee5; border: 3px solid #f3eee5; border-radius: 12px;
  box-shadow: 0 0 0 3px #15182a, 0 14px 30px -14px rgba(0, 0, 0, .6); padding: 12px 16px 14px 12px;
}
.rpg-portrait { width: 58px; height: 58px; border-radius: 10px; background: #2a2f4a; border: 2px solid #f3eee5; overflow: hidden; display: grid; place-items: center; }
.rpg-portrait .kane-head { width: 54px; height: auto; margin-top: 2px; }
.rpg-name { display: inline-block; font: 800 12px/1 var(--mono); letter-spacing: .14em; color: #ffd166; margin-bottom: 6px; }
.rpg-text { margin: 0; font: 600 16px/1.5 var(--sans); min-height: 1.5em; overflow-wrap: anywhere; }
.rpg-next { position: absolute; right: 14px; bottom: 8px; font-size: 11px; color: #ffd166; animation: rpg-blink 1s steps(2) infinite; }
@keyframes rpg-blink { 50% { opacity: 0; } }

/* the reading scene: the magnifying glass sweeps over the real text of the uploaded files */
.scene-stage { display: grid; grid-template-columns: 120px 1fr; gap: 18px; align-items: end; }
.scene-stage .scene-actor { width: 120px; }
.evidence-paper {
  position: relative; overflow: hidden; background: #fffcf2; color: #23201b; border-radius: 4px; padding: 16px 18px;
  box-shadow: 0 1px 1px rgba(0, 0, 0, .12), 0 12px 24px -12px rgba(0, 0, 0, .45); transform: rotate(-.6deg); max-height: 260px;
}
.paper-label { display: block; font: 700 11.5px/1.3 var(--mono); letter-spacing: .04em; text-transform: uppercase; color: #6f6a62; margin-bottom: 8px; }
.evidence-paper pre { margin: 0; padding: 0; border: 0; background: none; box-shadow: none; color: inherit; font: 12px/1.5 var(--mono); white-space: pre-wrap; overflow-wrap: anywhere; }
.scan-lens {
  position: absolute; top: 34px; left: 0; width: 86px; height: 86px; border-radius: 50%; pointer-events: none;
  border: 5px solid #2b1b12; background: rgba(170, 215, 255, .18); backdrop-filter: none;
  box-shadow: 0 6px 14px rgba(0, 0, 0, .3); animation: lens-sweep 4.2s ease-in-out infinite;
}
@keyframes lens-sweep {
  0% { transform: translate(10px, 0); } 25% { transform: translate(min(60vw, 520px), 30px); }
  50% { transform: translate(120px, 90px); } 75% { transform: translate(min(50vw, 420px), 140px); } 100% { transform: translate(10px, 0); }
}

/* Detective Kane's rank card on the case files */
.hud { display: grid; grid-template-columns: 84px 1fr; gap: 16px; align-items: center; margin: 4px 0 22px; padding: 14px 18px; border-radius: var(--radius); background: #15182a; color: #f3eee5; border: 3px solid #f3eee5; box-shadow: 0 0 0 3px #15182a; }
.hud-actor { width: 84px; }
.hud-body { display: grid; gap: 4px; }
.hud-name { font: 800 12px/1 var(--mono); letter-spacing: .14em; color: #ffd166; text-transform: uppercase; }
.hud-rank { font: 700 26px/1.1 var(--serif); }
.hud-stats { font-size: 14px; color: #c9c3b8; }
.hud-bar { height: 10px; border-radius: 999px; background: #2a2f4a; overflow: hidden; margin: 4px 0 2px; max-width: 420px; }
.hud-bar span { display: block; height: 100%; width: 100%; background: linear-gradient(90deg, #ffd166, #f08a4b); transform-origin: left; transform: scaleX(var(--p)); animation: bar-fill 900ms var(--ease-out) 300ms backwards; }
@keyframes bar-fill { from { transform: scaleX(0); } }
.hud .muted { color: #9a958c; }

@media (max-width: 760px) {
  .scene-stage { grid-template-columns: 1fr; }
  .scene-stage .scene-actor { width: 90px; }
  .scan-lens { width: 64px; height: 64px; }
}
@media (prefers-reduced-motion: reduce) {
  .kane-body, .kane-lens, .scan-lens, .rpg-next, .hud-bar span { animation: none !important; }
}

/* ── The scene map: the app as the dungeon (rooms = pages Kane really visited) ─────────────── */
.scenemap h2 { margin-top: 0; }
.trail { position: relative; margin-top: 14px; }
.trail + .trail { margin-top: 26px; padding-top: 18px; border-top: 1px dashed var(--line-strong); }
.trail-label { margin: 0 0 10px; font: 700 12px/1 var(--mono); letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.rooms { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 26px 34px; align-items: flex-start; }
.room {
  position: relative; width: 230px; padding: 12px 14px 12px; border-radius: 12px;
  background: var(--card); border: 2px solid var(--line-strong);
  box-shadow: 0 0 0 4px var(--paper-2) inset;
  transition: border-color 200ms ease, transform 200ms var(--ease-out), opacity 200ms ease;
}
.room:not(:last-child)::after {  /* the corridor to the next room */
  content: "→"; position: absolute; right: -27px; top: 22px; font: 700 18px/1 var(--mono); color: var(--line-strong);
}
.room-name { display: block; font: 700 15px/1.25 var(--serif); padding-right: 30px; }
.room-path { display: block; margin: 2px 0 8px; font: 11.5px/1.3 var(--mono); color: var(--muted); overflow-wrap: anywhere; background: none; padding: 0; }
.room-acts { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; font-size: 12.5px; line-height: 1.35; }
.room-acts li { display: grid; grid-template-columns: 18px 1fr; gap: 4px; }
.room-acts li.failed { color: var(--bug); font-weight: 600; }
.room-acts .more { color: var(--muted); display: block; }
.room-badge { display: inline-block; margin-top: 8px; font: 700 11.5px/1 var(--sans); padding: 5px 8px; border-radius: 999px; }
.room-badge.bug { background: var(--bug-soft); color: var(--bug); }
.room-badge.ok { background: var(--ok-soft); color: var(--ok); }
.room.clue { border-color: var(--bug); }
.room.solved { border-color: var(--ok); }
/* rooms light up as Kane's token reaches them (only once the walk has started) */
.trail.walking .room { opacity: .45; }
.trail.walking .room.visited { opacity: 1; }
.room.found { animation: room-found 420ms var(--ease-out); }
@keyframes room-found { 40% { transform: scale(1.04); } }
.trail-token {
  position: absolute; left: 0; top: 0; width: 34px; height: 30px; z-index: 2; pointer-events: none;
  border-radius: 50%; background: #2a2f4a; border: 2px solid #f3eee5; display: grid; place-items: center;
  box-shadow: 0 4px 10px rgba(0, 0, 0, .35); transition: transform 520ms var(--ease-in-out); opacity: 0;
}
.trail-token .kane-head { width: 28px; height: auto; margin-top: 3px; }
.trail.walking .trail-token, .trail.walked .trail-token { opacity: 1; }

/* ── The chapter card: a new case opens ────────────────────────────────────────────────────── */
.chapter { position: fixed; inset: 0; z-index: 50; display: grid; place-items: center; background: rgba(10, 12, 20, .72); padding: 16px; }
.chapter[hidden] { display: none; }
.chapter-card {
  max-width: 560px; text-align: center; background: #15182a; color: #f3eee5; border: 3px solid #f3eee5;
  box-shadow: 0 0 0 4px #15182a, 0 30px 60px -20px rgba(0, 0, 0, .7); border-radius: 14px; padding: 26px 30px;
  animation: chapter-in 360ms var(--ease-out) both;
}
.chapter.out { opacity: 0; transition: opacity 260ms ease; }
.chapter.out .chapter-card { transform: translateY(-10px); transition: transform 260ms var(--ease-out); }
@keyframes chapter-in { from { opacity: 0; transform: scale(.96) translateY(6px); } }
.chapter-no { display: block; font: 800 13px/1 var(--mono); letter-spacing: .3em; color: #ffd166; text-transform: uppercase; }
.chapter-no::before, .chapter-no::after { content: " ═══ "; letter-spacing: 0; opacity: .7; }
.chapter-quote { margin: 14px 0 12px; font: 600 26px/1.2 var(--hand); color: #f3eee5; }
.chapter-sub { font-size: 14px; color: #c9c3b8; }

/* ── Juice on the real verdict: the stamp lands, the panel jolts, one flash ─────────────────── */
.verdict { position: relative; }
.verdict.impact::after {
  content: ""; position: absolute; inset: 0; border-radius: inherit; pointer-events: none;
  background: currentColor; animation: impact-flash 320ms ease-out forwards;
}
@keyframes impact-flash { from { opacity: .28; } to { opacity: 0; } }

@media (max-width: 760px) {
  .room { width: 100%; }
  .room:not(:last-child)::after { content: "↓"; right: auto; left: 18px; top: auto; bottom: -24px; }
}
@media (prefers-reduced-motion: reduce) {
  .trail-token, .room { transition: none; }
  .room.found, .chapter-card { animation: none; }
  .verdict.impact::after { animation: none; opacity: 0; }
}
.room-no {
  display: inline-grid; place-items: center; width: 20px; height: 20px; margin-right: 7px; border-radius: 50%;
  background: var(--ink); color: var(--paper); font: 700 11px/1 var(--sans); vertical-align: 2px;
}

/* ── The case, reconstructed in 3D (plays by itself) ───────────────────────────────────────── */
.recon-head { display: flex; justify-content: space-between; align-items: baseline; flex-wrap: wrap; gap: 4px 16px; }
.recon-head h2 { margin: 0; }
.recon-head .muted { font-size: 13.5px; }
.recon-stage {
  position: relative; margin-top: 12px; aspect-ratio: 16 / 9; border-radius: 12px; overflow: hidden;
  background: radial-gradient(ellipse at 50% 40%, #2a2f42, #0f1118 70%);
}
.recon-canvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
.recon-play {
  position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%);
  font: 700 17px/1 var(--sans); color: #15182a; background: #ffd166; border: 3px solid #f3eee5; border-radius: 999px;
  padding: 16px 26px; box-shadow: 0 0 0 4px #15182a, 0 16px 30px -12px rgba(0, 0, 0, .7); cursor: pointer;
  transition: transform 160ms var(--ease-out);
}
.recon-play:active { transform: translate(-50%, -50%) scale(.97); }
.recon-play[disabled] { cursor: progress; opacity: .85; }
.recon-say { position: absolute; left: 14px; right: 14px; bottom: 14px; }
.recon-say .rpg-box { box-shadow: 0 0 0 3px #15182a, 0 10px 24px -10px rgba(0, 0, 0, .8); }
.recon-say .rpg-text { font-size: 15px; }
@media (max-width: 760px) {
  .recon-stage { aspect-ratio: 4 / 5; }
  .recon-say .rpg-box { grid-template-columns: 1fr; }
  .recon-say .rpg-portrait { display: none; }
}

/* ── Detective Kane in 3D, acting out each real step on a live case ─────────────────────────── */
.scene-live { display: grid; gap: 12px; }
.kane3d {
  position: relative; aspect-ratio: 16 / 7; border-radius: 14px; overflow: hidden;
  background: radial-gradient(ellipse at 40% 45%, #2a2f42, #0f1118 72%);
  border: 3px solid #f3eee5; box-shadow: 0 0 0 3px #15182a, 0 18px 36px -18px rgba(0, 0, 0, .7);
}
.kane3d-canvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
.kane3d-fallback { position: absolute; inset: 0; display: grid; place-items: center; }
.kane3d-fallback .kane-sprite { width: 120px; }
.kane3d.ready .kane3d-fallback { display: none; }
@media (max-width: 760px) { .kane3d { aspect-ratio: 4 / 3; } }
.kane3d::after {  /* a soft vignette: the light falls off toward the edges, like a film still */
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background: radial-gradient(ellipse at 45% 50%, transparent 58%, rgba(0, 0, 0, .5));
}
.room-acts .act { min-width: 0; overflow-wrap: anywhere; }  /* long text wraps inside its room */
.kane3d-screen {  /* "Kane's screen": what his 3D monitor shows, readable while he sits in front of it */
  position: absolute; top: 12px; left: 12px; width: min(30%, 280px); z-index: 2;
  border: 3px solid #f3eee5; border-radius: 8px; overflow: hidden; background: #15182a;
  box-shadow: 0 0 0 3px #15182a, 0 10px 24px -10px rgba(0, 0, 0, .7);
}
.kane3d-screen span { display: block; padding: 4px 8px; font: 800 10.5px/1.2 var(--mono); letter-spacing: .12em; text-transform: uppercase; color: #ffd166; }
.kane3d-screen canvas { display: block; width: 100%; height: auto; }
.kane3d-time {  /* the time on this computer, and the weather outside Kane's window */
  position: absolute; right: 12px; bottom: 12px; z-index: 2; padding: 6px 10px; border-radius: 8px;
  background: rgba(21, 24, 42, .82); color: #f3eee5; font: 700 12.5px/1.2 var(--mono); letter-spacing: .04em;
  border: 2px solid #f3eee5; text-transform: capitalize;
}

/* ── Not found ─────────────────────────────────────────────────────────────────────────────── */
.lost { max-width: 760px; margin: 24px auto 0; }
.lost-code { display: block; font: 800 15px/1 var(--mono); letter-spacing: .3em; color: var(--accent); }
.lost .page-title { margin: 8px 0 18px; }
.lost-actions { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 18px; }
a.btn { text-decoration: none; }

/* ── Verified: the proof page ──────────────────────────────────────────────────────────────── */
.proof { display: grid; gap: 18px; }
.proof .page-title { margin: 6px 0 4px; }
.proof-stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 12px; }
.proof-stats div { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 14px 16px; display: grid; gap: 4px; }
.proof-stats b { font: 700 32px/1 var(--serif); color: var(--accent); }
.proof-stats span { color: var(--muted); font-size: 14px; line-height: 1.4; }
.table-wrap { overflow-x: auto; }
.proof-table { width: 100%; border-collapse: collapse; font-size: 14.5px; }
.proof-table th { text-align: left; font: 700 12px/1.2 var(--mono); letter-spacing: .06em; text-transform: uppercase; color: var(--muted); padding: 8px 10px; border-bottom: 1px solid var(--line); }
.proof-table td { padding: 12px 10px; border-bottom: 1px solid var(--line); vertical-align: top; }
.proof-table small { display: block; color: var(--muted); font-size: 13px; margin-top: 4px; line-height: 1.45; }
.proof-table .mark { font-size: 20px; text-align: center; }
.proof-list { margin: 0; padding-left: 18px; display: grid; gap: 6px; }

/* ── Export: the case report, on screen and on paper ───────────────────────────────────────── */
.exportbar { display: flex; align-items: center; justify-content: space-between; gap: 14px; flex-wrap: wrap;
  margin: 16px 0; padding: 14px 18px; border-radius: var(--radius); background: var(--card); border: 1px solid var(--line); }
.exportbar-actions, .report-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.paper-report { max-width: 860px; margin: 0 auto; background: var(--card); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 28px 32px; display: grid; gap: 18px; }
.paper-report h2 { margin: 0 0 8px; font-size: 19px; }
.paper-report section p { margin: 6px 0; }
.report-head { display: grid; grid-template-columns: 56px 1fr auto; gap: 14px; align-items: center; border-bottom: 2px solid var(--line); padding-bottom: 14px; }
.report-head h1 { margin: 2px 0; font-size: clamp(22px, 3vw, 30px); line-height: 1.15; }
.report-logo { width: 56px; height: 56px; }
.report-kicker { font: 700 12px/1 var(--mono); letter-spacing: .08em; text-transform: uppercase; color: var(--accent); }
.report-steps { margin: 0; padding-left: 22px; display: grid; gap: 3px; }
.report-shots { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 14px; }
.report-shots figure { margin: 0; }
.report-shots img { width: 100%; border: 1px solid var(--line); border-radius: 8px; }
.report-shots figcaption { font-size: 13px; color: var(--muted); margin-top: 4px; }
.report-diff { white-space: pre-wrap; overflow-wrap: anywhere; font: 12px/1.5 var(--mono); background: var(--paper-2); padding: 12px; border-radius: 8px; }
.report-foot { border-top: 1px solid var(--line); padding-top: 12px; font-size: 13px; color: var(--muted); }
@media (max-width: 600px) { .report-head { grid-template-columns: 44px 1fr; } .report-head .stamp { grid-column: 1 / -1; justify-self: start; } .paper-report { padding: 20px 16px; } }
@media print {
  :root { --paper: #fff; --paper-2: #f4f1ea; --card: #fff; --ink: #17181d; --ink-2: #3d3f47; --muted: #5f5a52; --line: #d8d0c2; }
  body { background: #fff !important; }
  .topbar, .demo-bar, .site-foot, footer.foot, .no-print, nav { display: none !important; }
  .paper-report { border: 0; padding: 0; max-width: none; }
  .paper-report section, .report-shots figure { break-inside: avoid; }
}
.paper-report code { background: var(--paper-2); color: var(--ink); padding: 1px 6px; border-radius: 4px; }
.caught { margin: 12px 0 0; padding: 10px 12px; border-radius: 8px; background: var(--bug-soft); font-size: 14px; }

/* ── 2026 home: a focused investigator's desk ───────────────────────────────────────────────
   The landing page borrows the hierarchy of an evidence file without turning into a prop.
   Real controls stay familiar; the detective theme carries meaning through the workflow. */
.wrap { max-width: 1200px; }
.topbar { padding: 0 24px; background: color-mix(in srgb, var(--paper) 92%, transparent); }
.topbar-shell {
  width: min(100%, 1240px); min-height: 64px; margin: 0 auto;
  display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 28px;
}
.topbar .brand { padding-right: 26px; border-right: 1px solid var(--line-strong); }
.topbar .brand-mark { width: 42px; height: 42px; background: transparent; padding: 0; border-radius: 0; }
.topbar .brand-name { font-size: 22px; }
.topbar nav { justify-content: flex-start; gap: 8px; }
.topbar nav a { display: inline-flex; align-items: center; gap: 6px; color: var(--ink-2); }
.topbar nav a span { font-size: 17px; line-height: 1; }
.topbar nav a.new-case { color: var(--accent-ink); background: var(--accent); box-shadow: 0 5px 14px -9px var(--accent); }
.topbar nav a.new-case.on { color: var(--accent-ink); background: var(--accent); }
.proof-pill {
  display: inline-flex; align-items: center; gap: 7px; color: var(--ok); background: var(--ok-soft);
  border: 1px solid color-mix(in srgb, var(--ok) 24%, transparent); border-radius: 999px;
  padding: 6px 11px; font: 700 12.5px/1 var(--sans); white-space: nowrap;
}
.proof-pill i, .console-head i { width: 8px; height: 8px; border-radius: 50%; background: var(--ok); box-shadow: 0 0 0 3px color-mix(in srgb, var(--ok) 15%, transparent); }

.detective-hero {
  display: grid; grid-template-columns: minmax(0, .92fr) minmax(480px, 1.08fr); gap: 48px;
  align-items: center; padding: 46px 0 32px;
}
.hero-copy .eyebrow {
  display: inline-flex; align-items: center; gap: 7px; padding: 7px 10px; margin-bottom: 16px;
  color: #71451b; background: #ead8b5; border: 1px solid #dbc49a; border-radius: 4px;
  box-shadow: 0 2px 5px rgba(23, 24, 29, .08); transform: rotate(-1deg); font-family: var(--mono);
}
.hero-copy h1 { max-width: 680px; margin: 0 0 18px; font-size: clamp(42px, 5.4vw, 68px); line-height: .98; }
.hero-copy h1 em { display: inline; color: var(--ink); font-weight: 700; text-decoration: underline; text-decoration-color: #c54333; text-decoration-thickness: 4px; text-underline-offset: 7px; }
.hero-copy .lede { max-width: 640px; font-size: 17px; line-height: 1.65; }
.trust-row { display: flex; flex-wrap: wrap; gap: 8px 20px; padding: 0; margin: 24px 0 0; list-style: none; }
.trust-row li { display: inline-flex; align-items: center; gap: 7px; font-weight: 700; font-size: 14px; }
.trust-row li + li::before { content: "·"; margin-right: 12px; color: var(--line-strong); }
.trust-row li span { font-size: 18px; }

.kane-console {
  overflow: hidden; min-height: 340px; color: #f3eee5; background: #15182a; border: 1px solid #2e334c;
  border-radius: 20px; box-shadow: 0 22px 50px -28px rgba(4, 6, 14, .9), inset 0 1px rgba(255, 255, 255, .06);
}
.console-head {
  display: flex; align-items: center; justify-content: space-between; gap: 18px; padding: 14px 18px;
  border-bottom: 1px solid #34394f; color: #f3eee5; font: 700 11.5px/1 var(--mono); letter-spacing: .1em; text-transform: uppercase;
}
.console-head > span { display: flex; align-items: center; gap: 10px; }
.console-head b { color: #8bd8b6; font-size: 10.5px; }
.console-body { display: grid; grid-template-columns: 42% 58%; align-items: end; min-height: 286px; }
.console-kane { align-self: end; display: grid; place-items: end center; height: 270px; overflow: hidden; background: radial-gradient(circle at 50% 55%, #313852 0, transparent 66%); }
.console-kane .kane-sprite { width: 190px; transform: translateY(12px); filter: drop-shadow(0 18px 18px rgba(0, 0, 0, .42)); }
.console-steps { align-self: stretch; display: grid; align-content: center; gap: 0; padding: 18px 22px 18px 4px; margin: 0; list-style: none; }
.console-steps li { position: relative; display: grid; grid-template-columns: 34px 1fr; gap: 12px; min-height: 76px; color: #8f95aa; }
.console-steps li:not(:last-child)::after { content: ""; position: absolute; left: 16px; top: 32px; bottom: 0; width: 2px; background: #444a60; }
.console-steps li > span { position: relative; z-index: 1; display: grid; place-items: center; width: 33px; height: 33px; border: 2px solid #777e93; border-radius: 50%; background: #15182a; font: 700 12px/1 var(--mono); }
.console-steps li div { padding: 5px 8px 12px 0; }
.console-steps li b { display: block; color: #dadbe2; font-size: 14px; }
.console-steps li small { display: block; margin-top: 3px; font: 11.5px/1.4 var(--mono); }
.console-steps li.done > span { color: #10271e; background: #4fd39b; border-color: #4fd39b; }
.console-steps li.done::after { background: #4fd39b; }
.console-steps li.active { color: #c9c3b8; }
.console-steps li.active div { margin: -3px 0 8px; padding: 8px 10px; border-radius: 10px; background: rgba(240, 138, 75, .13); }
.console-steps li.active > span { color: #fff; border-color: #f08a4b; box-shadow: 0 0 0 4px rgba(240, 138, 75, .13); }
.console-steps li.active b { color: #fff; }

.case-workspace {
  display: grid; grid-template-columns: minmax(0, 1.62fr) minmax(310px, .9fr); margin: 22px 0 36px;
  border: 1px solid var(--line-strong); border-radius: 18px; background: var(--card); box-shadow: 0 18px 44px -34px rgba(23, 24, 29, .6);
}
.case-intake { gap: 15px; padding: 28px 30px 30px; border-right: 1px solid var(--line); }
.workspace-head, .recent-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; }
.workspace-head h2, .next-panel h2, .recent-head h2 { margin: 3px 0 0; font-size: 30px; line-height: 1.1; }
.section-kicker { color: var(--accent); font: 700 11px/1 var(--mono); letter-spacing: .11em; text-transform: uppercase; }
.case-intake input:not([type=checkbox]):not([type=file]):not([type=range]),
.case-intake select, .case-intake textarea { background: color-mix(in srgb, var(--paper) 56%, var(--card)); }
.case-intake textarea { min-height: 116px; }
.evidence-drop {
  position: relative; display: grid; grid-template-columns: 44px 1fr; gap: 13px; align-items: center;
  min-height: 84px; padding: 14px 16px; cursor: pointer; border: 1.5px dashed var(--line-strong);
  border-radius: 12px; background: color-mix(in srgb, var(--paper) 35%, transparent);
  transition: border-color 150ms ease, background-color 150ms ease;
}
.evidence-drop:hover, .evidence-drop.dragging { border-color: var(--accent); background: var(--accent-soft); }
.evidence-drop.has-files { border-style: solid; border-color: #0f7a52; background: color-mix(in srgb, #0f7a52 8%, transparent); }
.evidence-drop.has-files .drop-icon { color: #0f7a52; background: color-mix(in srgb, #0f7a52 14%, transparent); }
.evidence-drop.has-files b { color: #0f7a52; }
.evidence-drop.has-files small { overflow-wrap: anywhere; }
/* the files that will be sent, each with a button to take it out */
.drop-files { display: flex; flex-wrap: wrap; gap: 8px; margin: -4px 0 0; padding: 0; list-style: none; }
.drop-files[hidden] { display: none; }
.drop-files li {
  display: inline-flex; align-items: center; gap: 8px; max-width: 100%; min-height: 34px; padding: 4px 4px 4px 12px;
  border: 1px solid var(--line-strong); border-radius: 999px; background: var(--card); font-size: 13px;
}
.drop-file-name { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 600; }
.drop-files small { flex: none; color: var(--muted); font-size: 12px; }
.drop-remove {
  flex: none; display: grid; place-items: center; width: 26px; height: 26px; padding: 0; border: 0; border-radius: 50%;
  color: var(--muted); background: transparent; font: 600 17px/1 var(--sans); cursor: pointer;
  transition: background-color 150ms ease, color 150ms ease, transform 160ms var(--ease-out);
}
.drop-remove:hover { color: #b3261e; background: color-mix(in srgb, #b3261e 12%, transparent); }
.drop-remove:active { transform: scale(.92); }
.drop-note { margin: -4px 0 0; color: #b3261e; font-size: 13px; }
.evidence-drop input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.drop-icon { display: grid; place-items: center; width: 42px; height: 42px; color: var(--accent); border-radius: 10px; background: var(--accent-soft); font-size: 24px; }
.evidence-drop b, .evidence-drop small { display: block; }
.evidence-drop b { font-size: 14px; }
.evidence-drop small { margin-top: 3px; color: var(--muted); font-size: 12px; line-height: 1.45; }
.investigate-btn { justify-self: start; display: inline-flex; align-items: center; gap: 10px; padding-inline: 24px; }
.investigate-btn span:last-child { margin-left: 8px; }

.next-panel { position: relative; overflow: hidden; padding: 28px 28px 24px; background: linear-gradient(150deg, color-mix(in srgb, var(--paper) 64%, var(--card)), var(--card)); border-radius: 0 18px 18px 0; }
.next-panel::before { content: ""; position: absolute; right: 22px; top: -7px; width: 14px; height: 14px; border-radius: 50%; background: #bd4638; box-shadow: 2px 3px 4px rgba(0, 0, 0, .22); }
.next-panel > p { margin: 8px 0 20px; color: var(--muted); font-size: 13.5px; }
.next-steps { padding: 0; margin: 0; list-style: none; }
.next-steps > li { position: relative; display: grid; grid-template-columns: 30px 1fr; gap: 14px; padding-bottom: 22px; }
.next-steps > li:not(:last-child)::after { content: ""; position: absolute; left: 14px; top: 28px; bottom: 0; width: 2px; background: #b53d32; }
.next-steps > li > span { position: relative; z-index: 1; display: grid; place-items: center; width: 29px; height: 29px; border-radius: 50%; color: #fff; background: #b53d32; font: 700 12px/1 var(--mono); }
.next-steps b { font-family: var(--serif); font-size: 16px; }
.next-steps p { margin: 2px 0 8px; color: var(--ink-2); font-size: 12.5px; line-height: 1.45; }
.proof-mini { display: flex; align-items: center; gap: 5px; width: 152px; min-height: 42px; padding: 8px 10px; border: 1px solid var(--line); border-radius: 7px; background: var(--card); box-shadow: 0 5px 12px -10px rgba(23, 24, 29, .7); font-size: 10.5px; }
.proof-mini i { display: block; width: 7px; height: 7px; border-radius: 50%; background: var(--line-strong); }
.proof-mini strong { margin-left: auto; color: var(--bug); }
.proof-code { display: grid; gap: 2px; background: #202436; }
.proof-code code { padding: 1px 5px; background: rgba(179, 38, 30, .25); color: #ffb0aa; font-size: 9px; }
.proof-code code + code { color: #9ae8c6; background: rgba(15, 122, 82, .28); }
.proof-ok strong { color: var(--ok); }
.proof-ok i { width: 28px; border-radius: 3px; background: var(--ok); }

.recent-proof { margin: 52px 0 10px; }
.recent-head { margin-bottom: 14px; }
.recent-head h2 { font-size: 28px; }
.recent-head a { font-weight: 700; text-decoration: none; }
.featured-case {
  display: grid; grid-template-columns: .9fr 1fr 1fr; gap: 16px; padding: 18px; color: inherit; text-decoration: none;
  border: 1px solid var(--line); border-radius: 16px; background: var(--card); box-shadow: var(--shadow);
  transition: transform 180ms var(--ease-out), border-color 180ms ease;
}
.featured-case:hover { transform: translateY(-2px); border-color: var(--line-strong); }
.featured-summary { display: flex; flex-direction: column; align-items: flex-start; padding: 4px 8px 4px 2px; }
.featured-summary blockquote { flex: 1; margin: 16px 0; font: italic 17px/1.5 var(--serif); color: var(--ink-2); }
.featured-case figure { margin: 0; }
.featured-case figcaption { margin-bottom: 7px; color: var(--muted); font-size: 12px; font-weight: 700; }
.featured-case .shot { margin: 0; }

@media (max-width: 1050px) {
  .proof-pill { display: none; }
  .topbar-shell { grid-template-columns: auto 1fr; }
  .detective-hero { grid-template-columns: 1fr; gap: 26px; }
  .hero-copy { max-width: 760px; }
  .kane-console { min-height: 310px; }
  .console-body { min-height: 255px; }
  .case-workspace { grid-template-columns: minmax(0, 1.35fr) minmax(280px, .8fr); }
}
@media (max-width: 800px) {
  .topbar { padding: 0 14px; }
  .topbar-shell { display: flex; min-height: 60px; gap: 12px; }
  .topbar .brand { padding-right: 0; border-right: 0; }
  .topbar .brand-name { display: none; }
  .topbar nav { flex: 1; justify-content: flex-end; gap: 2px; }
  .topbar nav a { padding: 7px 9px; font-size: 12.5px; }
  .topbar nav a span { display: none; }
  .detective-hero { padding-top: 30px; }
  .hero-copy h1 { font-size: clamp(40px, 11vw, 58px); }
  .case-workspace { grid-template-columns: 1fr; }
  .case-intake { border-right: 0; border-bottom: 1px solid var(--line); }
  .next-panel { border-radius: 0 0 18px 18px; }
  .featured-case { grid-template-columns: 1fr 1fr; }
  .featured-summary { grid-column: 1 / -1; }
}
@media (max-width: 560px) {
  .wrap { padding-inline: 14px; }
  .topbar nav a { padding: 7px 8px; }
  .topbar nav a.new-case { font-size: 0; width: 36px; justify-content: center; }
  .topbar nav a.new-case span { display: inline; font-size: 20px; }
  .hero-copy h1 { font-size: 42px; }
  .trust-row { gap: 8px 14px; }
  .trust-row li + li::before { display: none; }
  .kane-console { min-height: 0; }
  .console-body { grid-template-columns: 1fr; }
  .console-kane { display: none; }
  .console-steps { padding: 20px; }
  .case-intake, .next-panel { padding: 22px 18px; }
  .workspace-head { align-items: flex-start; }
  .workspace-head .muted { font-size: 12px; }
  .investigate-btn { width: 100%; justify-content: center; }
  .featured-case { grid-template-columns: 1fr; }
  .featured-summary { grid-column: auto; }
}
@media (prefers-reduced-motion: reduce) {
  .featured-case { transition: none; }
}

/* The approved direction is a warm paper interface in every system theme. */
:root {
  color-scheme: light;
  --paper: #f3eee5; --paper-2: #ebe4d8; --card: #fffdf9; --ink: #17181d; --ink-2: #3d3f47;
  --muted: #6f6a62; --line: #e2d9ca; --line-strong: #cfc3b0; --accent: #b4410f;
  --accent-ink: #fff; --accent-soft: #f8e9dc; --bug: #b3261e; --bug-soft: #fbe9e7;
  --ok: #0f7a52; --ok-soft: #e3f3ea; --warn: #946200; --warn-soft: #fbf1d6;
  --neutral-soft: #ece7de; --shadow: 0 1px 0 rgba(23, 24, 29, .04), 0 8px 24px -12px rgba(23, 24, 29, .18);
}
.wrap { max-width: 1536px; padding: 10px 34px 40px; }
.topbar-shell { width: min(100%, 1440px); }
.detective-hero {
  grid-template-columns: minmax(0, .94fr) minmax(570px, 1.06fr); gap: 40px; padding: 10px 0 16px;
}
.hero-copy h1 { max-width: 690px; margin-bottom: 14px; font-size: clamp(46px, 3.85vw, 59px); line-height: .96; }
.hero-copy .lede { max-width: 670px; font-size: 16.5px; line-height: 1.5; }
.hero-copy .eyebrow { margin-bottom: 13px; }
.trust-row { margin-top: 15px; }
.kane-console { min-height: 260px; border-radius: 18px; }
.console-body { min-height: 214px; }
.console-kane { height: 210px; }
.console-kane .kane-sprite { width: 150px; transform: translateY(9px); }
.console-steps { padding-block: 12px; }
.console-steps li { min-height: 61px; }
.console-steps li b { font-size: 13px; }
.console-steps li small { font-size: 10.5px; }
.console-steps li div { padding-top: 3px; }
.case-workspace { grid-template-columns: minmax(0, 1.65fr) minmax(350px, .95fr); margin: 10px 0 24px; }
.case-intake { gap: 11px; padding: 21px 28px 22px; }
.workspace-head h2, .next-panel h2 { font-size: 27px; }
.case-intake textarea { height: 84px; min-height: 84px; }
.case-intake .examples { gap: 6px; }
.case-intake .chip { padding: 3px 10px; font-size: 11.5px; }
.evidence-drop { min-height: 67px; padding-block: 9px; }
.investigate-btn { padding-block: 11px; font-size: 15px; }
.next-panel { padding: 21px 26px 18px; }
.next-panel > p { margin: 6px 0 12px; }
.next-steps > li { padding-bottom: 11px; }
.next-steps p { margin-bottom: 5px; }
.proof-mini { min-height: 32px; padding-block: 5px; }
.recent-proof { margin: 18px 0 0; }
.recent-head { align-items: center; margin-bottom: 10px; }
.recent-head h2 { display: flex; align-items: center; gap: 9px; margin: 0; font-size: 24px; }
.recent-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.recent-card {
  position: relative; overflow: hidden; display: grid; gap: 8px; min-height: 105px; padding: 12px 16px 11px 20px;
  color: inherit; text-decoration: none; background: var(--card); border: 1px solid var(--line); border-radius: 10px; box-shadow: var(--shadow);
}
.recent-card::before { content: ""; position: absolute; inset: 0 auto 0 0; width: 5px; background: var(--line-strong); }
.recent-card.tone-ok::before { background: var(--ok); }
.recent-card.tone-bug::before { background: var(--bug); }
.recent-card.tone-warn::before { background: #d99a16; }
.recent-card > div, .recent-card footer { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.case-ref, .recent-card time { color: var(--muted); font: 600 10.5px/1 var(--mono); }
.recent-card > b { overflow: hidden; font-family: var(--serif); font-size: 16px; line-height: 1.2; white-space: nowrap; text-overflow: ellipsis; }
.recent-card footer { color: var(--ink-2); font-size: 11.5px; }
.recent-card footer strong { flex: none; padding: 3px 8px; color: var(--accent); border: 2px solid currentColor; border-radius: 4px; font: 800 10px/1 var(--sans); letter-spacing: .05em; text-transform: uppercase; transform: rotate(-2deg); }
.recent-card.tone-ok footer strong { color: var(--ok); }
.recent-card.tone-bug footer strong { color: var(--bug); }
.recent-card.tone-warn footer strong { color: var(--warn); }

@media (max-width: 1050px) {
  .wrap { padding-inline: 20px; }
  .detective-hero { grid-template-columns: 1fr; }
  .case-workspace { grid-template-columns: minmax(0, 1.35fr) minmax(280px, .8fr); }
}
@media (max-width: 800px) {
  .case-workspace { grid-template-columns: 1fr; }
  .recent-grid { grid-template-columns: 1fr; }
}
@media (max-width: 560px) {
  .wrap { padding-inline: 14px; }
  .hero-copy h1 { font-size: 42px; }
}

/* ── Live 3D investigation game ─────────────────────────────────────────────────────────────
   The office stays the real, persistent WebGL scene. The HUD around it is replaced by polling,
   so progress changes without restarting Kane's animation. */
.live-root:has(.scene-live) > .case-track { display: none; }
.scene-live { gap: 10px; margin-top: 14px; }
.kane-game {
  position: relative; isolation: isolate; overflow: hidden; aspect-ratio: 16 / 7;
  border: 3px solid #f3eee5; border-radius: 16px; background: #10131e;
  box-shadow: 0 0 0 3px #15182a, 0 22px 42px -22px rgba(0, 0, 0, .72);
}
.kane-game .kane3d {
  position: absolute; inset: 0; width: 100%; height: 100%; aspect-ratio: auto;
  border: 0; border-radius: 12px; box-shadow: none;
}
.kane-game .kane3d::after { background: radial-gradient(ellipse at 45% 50%, transparent 62%, rgba(0, 0, 0, .46)); }
.game-chapter {
  position: absolute; z-index: 4; left: 50%; top: 14px; transform: translateX(-50%);
  min-width: 210px; padding: 7px 16px; text-align: center; color: #f3eee5;
  border: 2px solid #d6a84b; border-radius: 999px; background: rgba(21, 24, 42, .9);
  box-shadow: 0 7px 20px -10px rgba(0, 0, 0, .8); font: 800 11px/1 var(--mono);
  letter-spacing: .1em; text-transform: uppercase; backdrop-filter: blur(7px);
}
.game-chapter span { color: #ffd166; }
.game-trail {
  position: absolute; z-index: 4; top: 20px; right: 16px; width: 205px; overflow: hidden;
  color: #f3eee5; border: 2px solid #d6c18d; border-radius: 12px; background: rgba(21, 24, 42, .92);
  box-shadow: 0 14px 28px -16px rgba(0, 0, 0, .9); backdrop-filter: blur(8px);
}
.game-trail h3 {
  display: flex; align-items: center; gap: 8px; margin: 0; padding: 12px 14px;
  color: #ffd166; border-bottom: 1px solid rgba(243, 238, 229, .18);
  font: 800 11px/1 var(--mono); letter-spacing: .1em;
}
.game-trail h3 span { font-size: 17px; }
.game-trail ol { display: grid; gap: 4px; margin: 0; padding: 9px; list-style: none; }
.game-trail li {
  position: relative; display: grid; grid-template-columns: 22px 1fr; gap: 7px; align-items: center;
  min-height: 31px; padding: 5px 8px; color: #a9adba; border: 1px solid transparent; border-radius: 8px;
  font-size: 11.5px; font-weight: 650;
}
.game-trail li:not(:last-child)::after {
  content: ""; position: absolute; left: 18px; top: 29px; width: 1px; height: 10px;
  background: rgba(214, 168, 75, .55);
}
.game-trail li i {
  position: relative; z-index: 1; display: grid; place-items: center; width: 17px; height: 17px;
  border: 2px solid #8c91a2; border-radius: 50%; background: #15182a; color: #10271e;
  font: 900 10px/1 var(--sans); font-style: normal;
}
.game-trail li.done { color: #d9dbe3; }
.game-trail li.done i { border-color: #4fd39b; background: #4fd39b; }
.game-trail li.active { color: #fff; border-color: #f08a4b; background: rgba(180, 65, 15, .9); box-shadow: 0 0 18px -8px #f08a4b; }
.game-trail li.active i { border-color: #ffd166; }
.game-controls { position: absolute; z-index: 4; left: 14px; bottom: 13px; display: flex; gap: 8px; }
.game-controls button {
  display: inline-flex; align-items: center; gap: 6px; min-height: 34px; padding: 7px 11px;
  color: #f3eee5; border: 2px solid rgba(243, 238, 229, .8); border-radius: 9px;
  background: rgba(21, 24, 42, .86); font: 700 11.5px/1 var(--sans); cursor: pointer;
  box-shadow: 0 8px 20px -12px rgba(0, 0, 0, .9); backdrop-filter: blur(7px);
}
.game-controls button:hover { background: rgba(42, 47, 74, .96); }
.game-controls button:active { transform: scale(.97); }
.game-controls button > span { font-size: 15px; }
.game-controls button small { color: #ffd166; }
/* 3D office or simple view (chosen with the view button, read in base.html) */
html[data-kane-view="simple"] .scene-live,
html:not([data-kane-view="simple"]) .scene-simple { display: none; }
.kane3d:not(.ready) .kane3d-screen { display: none; }
.scene-simple-body { display: grid; gap: 10px; }
.view-switch {
  justify-self: end; display: inline-flex; align-items: center; gap: 6px; min-height: 34px; padding: 7px 12px;
  color: #f3eee5; border: 2px solid #f3eee5; border-radius: 9px; background: #15182a;
  box-shadow: 0 0 0 2px #15182a; font: 700 12px/1 var(--sans); cursor: pointer;
  transition: transform 160ms var(--ease-out), background-color 160ms ease;
}
.view-switch:hover { background: #2a2f4a; }
.view-switch:active { transform: scale(.97); }
.view-switch > span { font-size: 15px; }
.game-intro {
  position: absolute; z-index: 6; left: 50%; top: 50%; transform: translate(-50%, -50%);
  display: grid; justify-items: center; width: min(520px, calc(100% - 440px)); padding: 20px 28px;
  color: #f3eee5; text-align: center; border: 3px solid #f3eee5; border-radius: 16px;
  background: rgba(28, 25, 29, .88); box-shadow: 0 0 0 3px rgba(21, 24, 42, .85), 0 22px 45px -18px #000;
  backdrop-filter: blur(8px); animation: game-intro-in 360ms var(--ease-out) both;
}
.game-intro[hidden] { display: none; }
.game-intro.out { opacity: 0; transform: translate(-50%, calc(-50% - 8px)); transition: opacity 260ms ease, transform 260ms var(--ease-out); }
.game-intro-kicker { color: #ffd166; font: 800 12px/1 var(--mono); letter-spacing: .28em; text-transform: uppercase; }
.game-intro-kicker::before, .game-intro-kicker::after { content: " ━ "; letter-spacing: 0; }
.game-intro p { margin: 12px 0 8px; font: italic 700 25px/1.2 var(--serif); }
.game-intro > span:not(.game-intro-kicker) { color: #d6c18d; font-size: 14px; }
.game-intro small { margin-top: 8px; color: #a9adba; }
@keyframes game-intro-in { from { opacity: 0; transform: translate(-50%, -47%) scale(.97); } }

.game-dialogue {
  display: grid; grid-template-columns: 58px minmax(0, 1fr) auto auto; gap: 12px; align-items: center;
  min-height: 84px; padding: 11px 16px 12px 12px; color: #f3eee5;
  border: 3px solid #f3eee5; border-radius: 13px; background: #15182a;
  box-shadow: 0 0 0 3px #15182a, 0 16px 30px -18px rgba(0, 0, 0, .65);
}
.game-dialogue .rpg-portrait { width: 58px; height: 58px; }
.game-dialogue-body { min-width: 0; }
.game-dialogue .rpg-name { display: block; }
.game-dialogue .rpg-text { min-height: 0; font-size: 15px; }
.game-thinking { display: inline-flex; gap: 4px; padding: 8px 10px; border-radius: 999px; background: #292d42; }
.game-thinking i { width: 6px; height: 6px; border-radius: 50%; background: #f3eee5; animation: game-think 1.2s ease-in-out infinite; }
.game-thinking i:nth-child(2) { animation-delay: 160ms; }
.game-thinking i:nth-child(3) { animation-delay: 320ms; }
@keyframes game-think { 50% { opacity: .28; transform: translateY(-2px); } }
.game-live {
  display: inline-flex; align-items: center; gap: 7px; padding: 7px 10px; color: #72ddb0;
  border: 1px solid #32bd81; border-radius: 999px; font: 800 10.5px/1 var(--mono);
  letter-spacing: .08em; text-transform: uppercase; white-space: nowrap;
}
.game-live i { width: 8px; height: 8px; border-radius: 50%; background: #4fd39b; box-shadow: 0 0 0 3px rgba(79, 211, 155, .14); }
.kane-game:fullscreen { width: 100vw; height: 100vh; aspect-ratio: auto; border: 0; border-radius: 0; background: #10131e; }
.kane-game:fullscreen .kane3d { border-radius: 0; }

@media (max-width: 900px) {
  .game-trail { width: 178px; }
  .game-trail li { min-height: 27px; padding-block: 3px; font-size: 10.5px; }
  .game-intro { width: min(460px, calc(100% - 380px)); padding: 16px 20px; }
  .game-intro p { font-size: 20px; }
}
@media (max-width: 760px) {
  .live-root:has(.scene-live) > .case-track { display: flex; }
  .kane-game { aspect-ratio: 4 / 3; }
  .game-trail { display: none; }
  .game-chapter { left: auto; right: 10px; top: 10px; transform: none; min-width: 0; }
  .game-intro { width: min(480px, calc(100% - 28px)); }
  .game-controls { left: 10px; bottom: 10px; }
  .game-dialogue { grid-template-columns: 48px 1fr auto; }
  .game-dialogue .rpg-portrait { width: 48px; height: 48px; }
  .game-thinking { display: none; }
  .game-live { grid-column: 2 / -1; justify-self: start; }
}
@media (max-width: 480px) {
  .game-chapter { font-size: 9px; }
  .game-intro p { font-size: 17px; }
  .game-controls button:first-child { font-size: 0; }
  .game-controls button:first-child b { font-size: 11px; }
  .game-dialogue { grid-template-columns: 1fr; }
  .game-dialogue .rpg-portrait { display: none; }
  .game-live { grid-column: 1; }
}
@media (prefers-reduced-motion: reduce) {
  .game-intro, .game-thinking i { animation: none; }
}

/* ── The Lineup: Kane names the commit that broke a closed case ───────────── */
.lineup-lede { margin: 4px 0 18px; }
.lineup-wall {
  --wall: #1d2029; --wall-line: rgba(236, 231, 222, .09); --plate: #f6f1e7; --plate-ink: #17181d;
  border-radius: var(--radius); padding: 18px; color: #ece7de; background-color: var(--wall);
  /* the height chart behind a police lineup */
  background-image: repeating-linear-gradient(to bottom, transparent 0 27px, var(--wall-line) 27px 28px);
}
.lineup-ends { display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 12px; font-size: 13.5px; }
.lineup-end { font-weight: 700; }
.lineup-end.ok { color: #4fd39b; }
.lineup-end.bad { color: #f2867c; }
.lineup-end code, .suspect code { font-family: var(--mono); }
.suspects { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); }
.suspect {
  display: grid; gap: 4px; align-content: start; padding: 10px; border-radius: var(--radius-sm);
  border: 1px solid rgba(236, 231, 222, .14); background: rgba(255, 255, 255, .03);
  transition: opacity 200ms ease, border-color 200ms ease;
}
.placard {
  display: flex; justify-content: space-between; align-items: center; gap: 6px;
  background: var(--plate); color: var(--plate-ink); border-radius: 6px; padding: 2px 8px; font-weight: 600; font-size: 13.5px;
}
.placard i { font: 700 12px/1.6 var(--mono); font-style: normal; color: var(--accent); }
.suspect-line { font-size: 13px; line-height: 1.35; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.suspect-meta { font-size: 11.5px; color: rgba(236, 231, 222, .62); }
.suspect.s-cleared, .suspect.s-present { opacity: .5; }
.suspect.s-cleared.asked, .suspect.s-present.asked { opacity: .85; }
.suspect.s-cleared .suspect-meta { color: #4fd39b; }
.suspect.s-present .suspect-meta { color: #f2867c; }
.suspect.asked { border-color: rgba(236, 231, 222, .38); }
.suspect.s-questioning { border-color: var(--accent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 30%, transparent); animation: questioned 1.6s ease-in-out infinite; }
@keyframes questioned { 50% { box-shadow: 0 0 0 6px color-mix(in srgb, var(--accent) 12%, transparent); } }
.suspect.s-guilty { opacity: 1; border: 2px solid #f2867c; background: rgba(242, 134, 124, .14); }
.suspect.s-guilty .placard { background: #f2867c; color: #1a0f08; }
.suspect.s-guilty .suspect-meta { color: #f2867c; font-weight: 700; }
.suspect.s-cannot_tell, .suspect.s-unresolved { border-style: dashed; border-color: #f0c35a; }
.lineup-key { margin: 12px 0 0; font-size: 12.5px; color: rgba(236, 231, 222, .62); }
.lineup-key b { color: #ece7de; }

.culprit-card { border-color: color-mix(in srgb, var(--bug) 45%, var(--line)); }
.culprit-label { display: inline-block; font: 800 12px/1 var(--mono); letter-spacing: .2em; text-transform: uppercase; color: var(--bug); }
.culprit-card h2 { margin: 8px 0 4px; overflow-wrap: anywhere; }
.culprit-card h2 code { font-family: var(--mono); font-size: .8em; color: var(--bug); }
.culprit-said { background: var(--bug-soft); color: var(--bug); border-radius: var(--radius-sm); padding: 10px 14px; }
.diffstat, .diff { font: 12.5px/1.55 var(--mono); background: var(--paper-2); border-radius: var(--radius-sm); padding: 12px 14px; overflow-x: auto; margin: 10px 0 0; }
.diff span { display: block; white-space: pre; }
.diff .add { color: var(--ok); }
.diff .del { color: var(--bug); }
.diff .hunk { color: var(--muted); }

.questionings { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.questionings li { display: grid; grid-template-columns: 40px 1fr; gap: 10px; align-items: start; }
.questionings li > div { display: grid; gap: 2px; min-width: 0; }
.questionings b { overflow-wrap: anywhere; font-weight: 600; }
.questionings code { font-family: var(--mono); }
.q-no { font: 700 14px/1.7 var(--mono); color: var(--muted); }
.q-role { font-size: 12px; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .06em; }
.q-verdict { font-size: 14px; font-weight: 600; }
.q-passed .q-verdict { color: var(--ok); }
.q-failed .q-verdict { color: var(--bug); }
.q-error .q-verdict { color: var(--warn); }
.questionings small { color: var(--muted); }
@media (max-width: 460px) {
  .lineup-wall { padding: 12px; }
  .suspects { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (prefers-reduced-motion: reduce) {
  .suspect.s-questioning { animation: none; }
}
.questionings li.muted { display: block; }
.lineup-end.s-questioning { animation: questioned-text 1.6s ease-in-out infinite; }
@keyframes questioned-text { 50% { opacity: .45; } }
@media (prefers-reduced-motion: reduce) { .lineup-end.s-questioning { animation: none; } }

/* the 3D lineup: once it ends, "Play again" waits in a corner instead of covering the culprit */
.lineup3d.ended .recon-play { left: auto; top: 14px; right: 14px; transform: none; padding: 10px 16px; font-size: 14px; }
.lineup3d.ended .recon-play:active { transform: scale(.97); }
