/* ══════════════════════════════════════════════════════════════
   THE 221B CASE ROOM — stylesheet
   Themes: gaslight (default, dark) · daylight
   ══════════════════════════════════════════════════════════════ */

:root {
  --f-display: "Cormorant Garamond", "Playfair Display", Georgia, serif;
  --f-body: "Crimson Pro", "IM Fell English", Georgia, serif;
  --f-type: "Special Elite", "Courier New", monospace;
  --f-hand: "Caveat", "Segoe Script", cursive;

  --paper: #efe4ca;
  --paper-2: #e3d3ae;
  --paper-3: #d6c296;
  --paper-ink: #2a2016;
  --paper-muted: #6f5f47;
  --rule: rgba(60, 90, 160, .22);
  --rule-red: rgba(170, 40, 40, .55);

  --wax: #9b2226;
  --string: #c0272d;
  --string-doubt: #d9a441;
  --brass: #c9a24e;
  --brass-2: #8c6a22;
  --sapphire: #2f6fd6;
  --sapphire-2: #9cc1ff;
  --ink-blue: #2a4b8d;
  --ochre: #b57a1b;
  --green: #4f7a3a;

  --cameo-paper: #e8dcc0;
  --cameo-paper-hi: #f6efdc;
  --cameo-rim: #8c6a22;
  --cameo-accent: #c9a24e;

  --radius: 6px;
  --shadow-card: 0 1px 0 rgba(255,255,255,.4) inset, 0 8px 18px -6px rgba(0,0,0,.55), 0 2px 4px rgba(0,0,0,.3);
  --shadow-lift: 0 1px 0 rgba(255,255,255,.4) inset, 0 26px 40px -14px rgba(0,0,0,.7), 0 6px 10px rgba(0,0,0,.3);
  --masthead-h: 64px;
}

:root[data-theme="gaslight"] {
  --bg: #15100c;
  --bg-2: #1f1711;
  --panel: #241b14;
  --panel-2: #2d2219;
  --text: #ece2cf;
  --muted: #a99a82;
  --line: rgba(201,162,78,.28);
  --cork: #a3763f;
  --cork-2: #7d5628;
  --glow: rgba(255, 196, 110, .18);
  --cameo-ink: #2a1d12;
  color-scheme: dark;
}
:root[data-theme="daylight"] {
  --bg: #e9dfcc;
  --bg-2: #e0d4bc;
  --panel: #f3ebd9;
  --panel-2: #e8dcc3;
  --text: #2a2016;
  --muted: #6f5f47;
  --line: rgba(90,70,40,.22);
  --cork: #c1935a;
  --cork-2: #a37640;
  --glow: rgba(255, 220, 160, .35);
  --cameo-ink: #2a1d12;
  --shadow-card: 0 1px 0 rgba(255,255,255,.6) inset, 0 8px 16px -8px rgba(60,40,10,.45), 0 2px 3px rgba(60,40,10,.2);
  color-scheme: light;
}

* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--f-body);
  font-size: 18px;
  line-height: 1.5;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}
button, input, textarea, select { font: inherit; color: inherit; }
button { cursor: pointer; }
a { color: inherit; }
h1, h2, h3 { font-family: var(--f-display); font-weight: 700; margin: 0; line-height: 1.1; letter-spacing: -.005em; }
::selection { background: var(--sapphire); color: #fff; }
:focus-visible { outline: 2px solid var(--sapphire-2); outline-offset: 2px; }

/* Grain + vignette overlays */
.grain {
  position: fixed; inset: 0; z-index: 90; pointer-events: none; opacity: .35; mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='220' height='220'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='3' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 0.5 0 0 0 0 0.45 0 0 0 0 0.4 0 0 0 .5 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}
.vignette {
  position: fixed; inset: 0; z-index: 89; pointer-events: none;
  background: radial-gradient(ellipse at 50% 30%, transparent 55%, rgba(0,0,0,.45) 100%);
}
:root[data-theme="daylight"] .vignette { opacity: .35; }
:root[data-theme="daylight"] .grain { opacity: .22; }

/* ── Masthead ───────────────────────────────────────────────── */
.masthead {
  position: sticky; top: 0; z-index: 50;
  height: var(--masthead-h);
  display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 18px;
  padding: 0 18px;
  background: linear-gradient(180deg, var(--panel-2), var(--panel));
  border-bottom: 1px solid var(--line);
  box-shadow: 0 1px 0 rgba(255,255,255,.04) inset, 0 10px 30px -14px rgba(0,0,0,.8);
}
.masthead::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: -3px; height: 3px;
  background: linear-gradient(90deg, transparent, var(--brass), transparent);
  opacity: .7;
}
.brand { display: flex; align-items: baseline; gap: 10px; text-decoration: none; }
.brand__num {
  font-family: var(--f-display); font-weight: 700; font-size: 32px; letter-spacing: -.02em;
  color: var(--brass);
  text-shadow: 0 1px 0 rgba(0,0,0,.6), 0 0 18px var(--glow);
}
.brand__num small { font-size: .6em; vertical-align: super; margin-left: 1px; }
.brand__name { font-family: var(--f-type); font-size: 13px; letter-spacing: .18em; text-transform: uppercase; color: var(--muted); }

.tabs { display: flex; justify-content: center; gap: 4px; }
.tab {
  position: relative; display: inline-flex; align-items: center; gap: 8px;
  padding: 8px 16px; border-radius: 4px; text-decoration: none;
  font-family: var(--f-type); font-size: 13px; letter-spacing: .12em; text-transform: uppercase;
  color: var(--muted); transition: color .2s, background .2s;
}
.tab:hover { color: var(--text); background: rgba(255,255,255,.04); }
.tab.is-active { color: var(--brass); }
.tab.is-active::after {
  content: ""; position: absolute; left: 14px; right: 14px; bottom: 2px; height: 2px;
  background: var(--brass); box-shadow: 0 0 10px var(--glow);
}
.tab__key {
  display: inline-grid; place-items: center; width: 18px; height: 18px; border-radius: 3px;
  border: 1px solid var(--line); font-size: 10px; color: var(--muted);
}

.masthead__right { display: flex; align-items: center; gap: 14px; }

.icon-btn {
  display: inline-grid; place-items: center; width: 38px; height: 38px; border-radius: 50%;
  border: 1px solid var(--line); background: transparent; color: var(--text);
  transition: background .2s, transform .15s;
}
.icon-btn:hover { background: rgba(255,255,255,.06); }
.icon-btn:active { transform: scale(.95); }

.menu { position: relative; }
.menu__panel {
  position: absolute; right: 0; top: calc(100% + 8px); min-width: 260px;
  background: var(--paper); color: var(--paper-ink);
  border-radius: 4px; padding: 6px;
  box-shadow: 0 30px 50px -20px rgba(0,0,0,.8), 0 0 0 1px rgba(0,0,0,.2);
  transform-origin: top right;
  animation: pop .18s ease-out;
}
.menu__panel button {
  display: block; width: 100%; text-align: left; padding: 10px 12px;
  border: 0; background: transparent; border-radius: 3px; font-family: var(--f-body); font-size: 16px;
}
.menu__panel button:hover { background: rgba(0,0,0,.06); }
.menu__panel button.danger { color: var(--wax); }
.menu__panel hr { border: 0; border-top: 1px dashed rgba(0,0,0,.18); margin: 6px 4px; }
@keyframes pop { from { opacity: 0; transform: scale(.94) translateY(-4px); } to { opacity: 1; transform: none; } }

/* ── Rubber stamps ──────────────────────────────────────────── */
.stamp, .status-stamp {
  --stamp: var(--ink-blue);
  display: inline-block; padding: 4px 12px;
  font-family: var(--f-type); font-size: 13px; letter-spacing: .22em; text-transform: uppercase;
  color: var(--stamp); border: 2.5px solid var(--stamp); border-radius: 4px;
  transform: rotate(-6deg);
  -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='120' height='120'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2'/%3E%3CfeColorMatrix values='0 0 0 0 1 0 0 0 0 1 0 0 0 0 1 0 0 0 1.7 -.35'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='120' height='120'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2'/%3E%3CfeColorMatrix values='0 0 0 0 1 0 0 0 0 1 0 0 0 0 1 0 0 0 1.7 -.35'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  box-shadow: 0 0 0 1px rgba(255,255,255,.08) inset;
  user-select: none;
}
.status-stamp { position: relative; padding: 5px 14px; transition: color .3s, border-color .3s; }
.status-stamp[data-status="open"] { --stamp: #5d8ad8; }
.status-stamp[data-status="progress"] { --stamp: var(--ochre); }
.status-stamp[data-status="solved"] { --stamp: #d8343b; }
:root[data-theme="daylight"] .status-stamp[data-status="open"] { --stamp: var(--ink-blue); }
.status-stamp.is-bump { animation: stampIn .5s cubic-bezier(.2,1.4,.4,1); }
@keyframes stampIn {
  0% { transform: rotate(-6deg) scale(2.2); opacity: 0; }
  60% { transform: rotate(-6deg) scale(.92); opacity: 1; }
  100% { transform: rotate(-6deg) scale(1); }
}
.stamp--cleared { --stamp: var(--ink-blue); }
.stamp--guilty, .stamp--closed { --stamp: #b4161c; }
.stamp--big { font-size: 28px; padding: 10px 26px; border-width: 5px; border-radius: 8px; letter-spacing: .3em; }

/* ── View container ─────────────────────────────────────────── */
.view { min-height: calc(100vh - var(--masthead-h)); outline: none; }
.view > section { animation: fadeUp .35s ease-out both; }
@keyframes fadeUp { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

/* ══ CASE BOARD ═════════════════════════════════════════════ */
.board-wrap {
  display: grid; grid-template-columns: 312px 1fr;
  height: calc(100vh - var(--masthead-h));
}

/* The case folder */
.dock {
  position: relative; overflow-y: auto; padding: 18px 16px 24px;
  background: var(--panel);
  border-right: 1px solid var(--line);
}
.folder {
  position: relative; background: var(--paper-2); color: var(--paper-ink);
  border-radius: 4px 10px 4px 4px; padding: 18px 16px 16px;
  box-shadow: var(--shadow-card);
  background-image:
    linear-gradient(135deg, rgba(255,255,255,.35), transparent 40%),
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.7' numOctaves='3'/%3E%3CfeColorMatrix values='0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 .08 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}
.folder::before {
  content: ""; position: absolute; top: -12px; left: 18px; width: 110px; height: 14px;
  background: var(--paper-2); border-radius: 6px 6px 0 0;
  box-shadow: 0 -1px 0 rgba(0,0,0,.08);
}
.folder__num { font-family: var(--f-type); font-size: 11px; letter-spacing: .2em; color: var(--paper-muted); }
.folder__title { font-size: 27px; margin-top: 4px; }
.folder__sub { font-style: italic; color: var(--paper-muted); font-size: 15px; margin-top: 2px; }
.folder__date { font-family: var(--f-type); font-size: 12px; margin-top: 8px; color: var(--paper-muted); }
.folder__brief { font-size: 15px; margin: 12px 0 0; }

.fieldlabel {
  display: block; font-family: var(--f-type); font-size: 11px; letter-spacing: .22em; text-transform: uppercase;
  color: var(--paper-muted); margin: 18px 0 8px;
}
.segmented { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0; border: 1.5px solid var(--paper-ink); border-radius: 4px; overflow: hidden; }
.segmented button {
  border: 0; background: transparent; padding: 8px 4px;
  font-family: var(--f-type); font-size: 11px; letter-spacing: .08em; text-transform: uppercase;
  color: var(--paper-ink); transition: background .2s, color .2s;
}
.segmented button + button { border-left: 1.5px solid var(--paper-ink); }
.segmented button.is-on { background: var(--paper-ink); color: var(--paper); }
.segmented button[data-status="solved"].is-on { background: var(--wax); }
.segmented button[data-status="progress"].is-on { background: var(--ochre); }

.progress { margin-top: 14px; }
.progress__bar { height: 8px; border-radius: 4px; background: rgba(0,0,0,.12); overflow: hidden; }
.progress__fill { height: 100%; width: 0; background: linear-gradient(90deg, var(--string), #e0514f); transition: width .5s cubic-bezier(.2,.8,.2,1); box-shadow: 0 0 10px rgba(200,40,45,.5); }
.progress__text { display: flex; justify-content: space-between; font-family: var(--f-type); font-size: 12px; color: var(--paper-muted); margin-top: 6px; }

.howto { margin: 0; padding: 0 0 0 18px; font-size: 14.5px; color: var(--paper-ink); }
.howto li { margin: 5px 0; }
.howto b { font-family: var(--f-hand); font-size: 18px; color: var(--wax); font-weight: 700; }
.kbd { display: inline-block; padding: 0 5px; border: 1px solid rgba(0,0,0,.35); border-bottom-width: 2px; border-radius: 3px; font-family: var(--f-type); font-size: 11px; line-height: 16px; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 10px 18px; border-radius: 4px; border: 1.5px solid var(--paper-ink);
  background: var(--paper-ink); color: var(--paper);
  font-family: var(--f-type); font-size: 13px; letter-spacing: .12em; text-transform: uppercase;
  transition: transform .15s, box-shadow .2s, background .2s; text-decoration: none;
}
.btn:hover { transform: translateY(-1px); box-shadow: 0 8px 18px -8px rgba(0,0,0,.6); }
.btn:active { transform: translateY(0); }
.btn--ghost { background: transparent; color: var(--paper-ink); }
.btn--wax { background: var(--wax); border-color: var(--wax); color: #fff; }
.btn--brass { background: var(--brass); border-color: var(--brass-2); color: #241b14; }
.btn--light { background: var(--paper); border-color: var(--paper); color: var(--paper-ink); }
.btn--outline-light { background: transparent; border-color: var(--line); color: var(--text); }
.btn--outline-light:hover { background: rgba(255,255,255,.06); }
.btn--block { width: 100%; }
.btn:disabled { opacity: .5; cursor: not-allowed; transform: none; box-shadow: none; }

/* Cork board */
.board-scroll {
  position: relative; overflow: auto;
  background:
    radial-gradient(ellipse at 30% 20%, rgba(255,230,180,.16), transparent 50%),
    radial-gradient(ellipse at 80% 90%, rgba(0,0,0,.25), transparent 55%),
    linear-gradient(160deg, var(--cork), var(--cork-2));
  box-shadow: inset 0 0 120px rgba(0,0,0,.45);
}
.board-scroll::before {
  content: ""; position: absolute; inset: 0; pointer-events: none; z-index: 0;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='200' height='200'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='1.1' numOctaves='4' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 .2 0 0 0 0 .12 0 0 0 0 .05 0 0 0 .55 -.1'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  opacity: .55; mix-blend-mode: multiply;
  width: max(100%, var(--board-w)); height: max(100%, var(--board-h));
}
.board-frame {
  position: absolute; inset: 0; pointer-events: none; z-index: 5;
  box-shadow: inset 0 0 0 14px #3b2614, inset 0 0 0 16px rgba(201,162,78,.35), inset 0 0 0 18px #2a1a0d, inset 0 0 40px 18px rgba(0,0,0,.5);
}
.board-scroll.is-stringing { cursor: crosshair; }
.board {
  position: relative; width: var(--board-w); height: var(--board-h);
  transform-origin: 0 0; transform: scale(var(--scale, 1));
}
.board-sizer { width: calc(var(--board-w) * var(--scale, 1)); height: calc(var(--board-h) * var(--scale, 1)); position: relative; }

.strings { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; pointer-events: none; z-index: 4; }
.pinhead { pointer-events: none; }
.string { fill: none; stroke: var(--string); stroke-width: 2.6; stroke-linecap: round; pointer-events: visibleStroke; cursor: pointer;
  filter: drop-shadow(0 3px 2px rgba(0,0,0,.45)); transition: stroke .3s; }
.string--shadow { stroke: rgba(0,0,0,.35); stroke-width: 4; filter: blur(2px); transform: translateY(4px); pointer-events: none; }
.string--doubt { stroke: var(--string-doubt); stroke-dasharray: 7 6; }
.string--gold { stroke: var(--brass); stroke-width: 3; }
.string--temp { stroke: var(--string); stroke-dasharray: 4 6; opacity: .9; animation: march .6s linear infinite; pointer-events: none; }
@keyframes march { to { stroke-dashoffset: -20; } }
.string-g:hover .string { stroke: #ff4d55; }
.string-g:hover .string--gold { stroke: #ffd36b; }
.cut { pointer-events: all; cursor: pointer; opacity: 0; transition: opacity .2s; }
.string-g:hover .cut { opacity: 1; }
.cut circle { fill: var(--paper); stroke: var(--paper-ink); stroke-width: 1.5; }
.cut text { font-size: 13px; text-anchor: middle; dominant-baseline: central; }
.string-draw { stroke-dasharray: 2000; stroke-dashoffset: 2000; animation: draw .7s cubic-bezier(.4,0,.2,1) forwards; }
@keyframes draw { to { stroke-dashoffset: 0; } }

/* Cards */
.card {
  position: absolute; left: 0; top: 0; z-index: 3;
  transform: translate(var(--x), var(--y)) rotate(var(--rot, 0deg));
  box-shadow: var(--shadow-card);
  will-change: transform;
  transition: box-shadow .25s, filter .25s;
  user-select: none; touch-action: none;
}
.card.is-dragging { z-index: 20; opacity: .96; box-shadow: var(--shadow-lift); transition: none; }
.card.is-target { filter: drop-shadow(0 0 14px var(--sapphire-2)); }
.card.is-target::after { content: ""; position: absolute; inset: -6px; border: 2px dashed var(--sapphire-2); border-radius: 8px; animation: march2 1s linear infinite; pointer-events: none; }
@keyframes march2 { to { outline-offset: 2px; } }
.card.is-shake { animation: shake .4s; }
@keyframes shake { 20%,60% { transform: translate(var(--x), var(--y)) rotate(calc(var(--rot) - 2deg)); } 40%,80% { transform: translate(var(--x), var(--y)) rotate(calc(var(--rot) + 2deg)); } }

.pin {
  position: absolute; left: 50%; top: -10px; width: 22px; height: 22px; margin-left: -11px; z-index: 4;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, #ff8a8a 0, var(--wax) 40%, #5a0d10 100%);
  box-shadow: 0 2px 0 rgba(0,0,0,.4), 0 6px 10px -2px rgba(0,0,0,.6), inset 0 -2px 3px rgba(0,0,0,.35);
  transition: transform .15s;
}
.pin::after { content: ""; position: absolute; left: 50%; top: 100%; width: 2px; height: 6px; margin-left: -1px; background: linear-gradient(#999, #333); }
.pin--brass { background: radial-gradient(circle at 35% 30%, #ffe9a8 0, var(--brass) 45%, #5e4612 100%); }
.pin--handle { cursor: crosshair; }
.pin--handle:hover { transform: scale(1.25); }
.pin--handle::before {
  content: "pull string"; position: absolute; left: 50%; bottom: calc(100% + 6px); transform: translateX(-50%);
  padding: 2px 7px; border-radius: 3px; background: var(--paper-ink); color: var(--paper);
  font-family: var(--f-type); font-size: 10px; letter-spacing: .1em; white-space: nowrap; opacity: 0; transition: opacity .2s; pointer-events: none;
}
.pin--handle:hover::before { opacity: 1; }

/* Suspect polaroid */
.card--suspect { width: 176px; padding: 10px 10px 12px; background: #f6f1e6; color: var(--paper-ink); cursor: grab; border-radius: 2px; }
.card--suspect:active { cursor: grabbing; }
.card--suspect .photo {
  position: relative; aspect-ratio: 4/5; overflow: hidden; background: #cbb891; color: var(--cameo-ink);
  box-shadow: inset 0 0 0 1px rgba(0,0,0,.2), inset 0 0 30px rgba(60,30,0,.4);
}
.card--suspect .photo svg { width: 100%; height: 100%; display: block; filter: sepia(.25) contrast(1.05); }
.card--suspect .name { font-family: var(--f-hand); font-size: 22px; font-weight: 700; margin-top: 8px; line-height: 1; color: #1b1510; }
.card--suspect .role { font-family: var(--f-type); font-size: 10px; letter-spacing: .06em; color: var(--paper-muted); margin-top: 3px; line-height: 1.3; }
.card--suspect .tally {
  position: absolute; right: 8px; top: 8px; min-width: 24px; height: 24px; padding: 0 6px; border-radius: 12px;
  background: var(--wax); color: #fff; font-family: var(--f-type); font-size: 12px; display: grid; place-items: center;
  box-shadow: 0 2px 4px rgba(0,0,0,.4); transform: scale(0); transition: transform .25s cubic-bezier(.2,1.6,.4,1);
}
.card--suspect .tally.is-on { transform: scale(1); }
.card--suspect .stamp { position: absolute; left: 50%; top: 44%; transform: translate(-50%,-50%) rotate(-14deg); font-size: 12px; pointer-events: none; animation: stampIn .5s cubic-bezier(.2,1.4,.4,1); }
.card--suspect .open {
  position: absolute; left: 10px; right: 10px; bottom: 10px; opacity: 0; transform: translateY(4px);
  transition: opacity .2s, transform .2s; font-size: 11px; padding: 6px;
}
.card--suspect:hover .open, .card--suspect:focus-within .open { opacity: 1; transform: none; }
.card--suspect.is-culprit { outline: 3px solid var(--brass); outline-offset: 2px; }

/* Clue index card */
.card--clue {
  width: 224px; padding: 14px 14px 12px; color: var(--paper-ink); cursor: grab; border-radius: 3px;
  background:
    linear-gradient(transparent 27px, var(--rule-red) 27px, var(--rule-red) 28.5px, transparent 28.5px),
    repeating-linear-gradient(transparent 0 23px, var(--rule) 23px 24px),
    var(--paper);
  background-position: 0 0, 0 29px, 0 0;
}
.card--clue:active { cursor: grabbing; }
.exhibit {
  display: inline-block; padding: 2px 8px; margin-left: -2px;
  background: #1b1510; color: #f3e7c6; font-family: var(--f-type); font-size: 10px; letter-spacing: .2em; text-transform: uppercase;
  clip-path: polygon(0 0, 100% 0, 92% 50%, 100% 100%, 0 100%);
}
.card--clue .title { font-size: 20px; margin-top: 8px; font-weight: 700; }
.card--clue .summary { font-size: 13.5px; line-height: 24px; margin-top: 2px; color: #3b2f22; }
.card--clue .tied {
  display: flex; align-items: center; justify-content: space-between; gap: 6px; margin-top: 8px; padding-top: 6px;
  border-top: 1px dashed rgba(0,0,0,.25); font-family: var(--f-type); font-size: 11px; color: var(--paper-muted);
}
.card--clue .tied b { font-family: var(--f-hand); font-size: 17px; color: var(--wax); font-weight: 700; }
.card--clue .tied .mini { padding: 3px 7px; border: 1px solid rgba(0,0,0,.3); border-radius: 3px; background: rgba(255,255,255,.4); font-family: var(--f-type); font-size: 10px; letter-spacing: .08em; text-transform: uppercase; }
.card--clue .tied .mini:hover { background: var(--paper-ink); color: var(--paper); }
.card--clue.is-doubt .tied b { color: var(--ochre); }
.card--clue.is-tied .pin { background: radial-gradient(circle at 35% 30%, #ffb3b3 0, #d12a30 40%, #5a0d10 100%); }

/* Board overlays */
.board-hint {
  position: absolute; left: 50%; bottom: 18px; transform: translateX(-50%); z-index: 6;
  padding: 8px 16px; border-radius: 20px; background: rgba(20,14,10,.78); color: var(--paper);
  font-family: var(--f-type); font-size: 12px; letter-spacing: .08em; backdrop-filter: blur(4px);
  pointer-events: none; opacity: 0; transition: opacity .25s;
}
.board-hint.is-on { opacity: 1; }
.closed-banner {
  position: absolute; inset: 0; z-index: 7; display: grid; place-items: center; pointer-events: none;
}
.closed-banner .stamp { font-size: 54px; padding: 14px 40px; border-width: 7px; border-radius: 12px; transform: rotate(-12deg); opacity: .9; }

/* ══ LIST MODE (narrow screens) ═════════════════════════════ */
.list-mode .board-scroll { overflow: visible; padding: 18px 14px 40px; box-shadow: none; }
.list-mode .board-frame, .list-mode .strings, .list-mode .pin--handle::before { display: none; }
.list-mode .board { width: auto; height: auto; transform: none; display: flex; flex-direction: column; gap: 22px; }
.list-mode .board-sizer { width: auto; height: auto; }
.list-mode .card { position: relative; transform: rotate(var(--rot, 0deg)) !important; width: 100%; max-width: 420px; margin: 0 auto; }
.list-mode .row { display: flex; gap: 14px; overflow-x: auto; padding: 14px 4px 10px; scroll-snap-type: x mandatory; }
.list-mode .row .card--suspect { width: 150px; flex: 0 0 auto; margin: 0; scroll-snap-align: start; }
.list-mode .row-label { font-family: var(--f-type); font-size: 11px; letter-spacing: .2em; text-transform: uppercase; color: #fff; opacity: .8; margin: 4px 0 0; }
.list-mode .card--suspect .open { opacity: 1; transform: none; position: static; margin-top: 8px; }

/* ══ SUSPECT PROFILE ════════════════════════════════════════ */
.dossier { max-width: 1180px; margin: 0 auto; padding: 28px 22px 60px; display: grid; grid-template-columns: 340px 1fr; gap: 28px; }
.dossier__nav { grid-column: 1 / -1; display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.dossier__nav .steps { display: flex; gap: 6px; }
.dossier__nav .steps a { width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; border: 1px solid var(--line); text-decoration: none; font-family: var(--f-type); font-size: 12px; color: var(--muted); transition: all .2s; }
.dossier__nav .steps a.is-on { background: var(--brass); border-color: var(--brass); color: #241b14; }
.dossier__nav .steps a:hover { border-color: var(--brass); color: var(--text); }

.mugshot {
  position: sticky; top: calc(var(--masthead-h) + 20px); align-self: start;
  background: #f6f1e6; color: var(--paper-ink); padding: 16px 16px 20px; border-radius: 2px; box-shadow: var(--shadow-card);
  transform: rotate(-1.2deg);
}
.mugshot .photo { position: relative; aspect-ratio: 4/5; background: #cbb891; color: var(--cameo-ink); overflow: hidden; box-shadow: inset 0 0 0 1px rgba(0,0,0,.2), inset 0 0 40px rgba(60,30,0,.45); }
.mugshot .photo svg { width: 100%; height: 100%; filter: sepia(.25) contrast(1.05); }
.mugshot .photo .stamp { position: absolute; left: 50%; top: 50%; transform: translate(-50%,-50%) rotate(-14deg); font-size: 18px; border-width: 4px; }
.mugshot .name { font-family: var(--f-hand); font-size: 32px; font-weight: 700; margin-top: 12px; line-height: 1; }
.mugshot .role { font-family: var(--f-type); font-size: 11px; letter-spacing: .08em; color: var(--paper-muted); margin-top: 6px; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 12px; }
.chip { padding: 3px 9px; border: 1px solid rgba(0,0,0,.3); border-radius: 20px; font-family: var(--f-type); font-size: 10.5px; letter-spacing: .06em; }
.gauge { margin-top: 18px; }
.gauge input[type=range] { width: 100%; accent-color: var(--wax); cursor: pointer; }
.gauge__scale { display: flex; justify-content: space-between; font-family: var(--f-type); font-size: 10px; color: var(--paper-muted); letter-spacing: .06em; }
.gauge__read { font-family: var(--f-hand); font-size: 22px; color: var(--wax); font-weight: 700; text-align: center; margin-top: 4px; min-height: 28px; }
.mugshot .actions { display: grid; gap: 8px; margin-top: 16px; }

.sheet {
  position: relative; background: var(--paper); color: var(--paper-ink); padding: 34px 38px 40px; border-radius: 3px; box-shadow: var(--shadow-card);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.7' numOctaves='3'/%3E%3CfeColorMatrix values='0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 .07 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}
.sheet__head { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; padding-bottom: 14px; border-bottom: 2px solid var(--paper-ink); }
.sheet__head h1 { font-size: 42px; }
.sheet__head .meta { font-family: var(--f-type); font-size: 11px; letter-spacing: .18em; text-transform: uppercase; color: var(--paper-muted); }
.sheet section { margin-top: 26px; }
.sheet h3 { font-family: var(--f-type); font-size: 12px; letter-spacing: .24em; text-transform: uppercase; color: var(--paper-muted); font-weight: 400; margin-bottom: 10px; display: flex; align-items: center; gap: 10px; }
.sheet h3::after { content: ""; flex: 1; border-top: 1px dashed rgba(0,0,0,.25); }
.quote { font-size: 25px; font-family: var(--f-display); font-weight: 500; font-style: italic; line-height: 1.35; margin: 0; padding-left: 18px; border-left: 3px solid var(--wax); }
.quote + p { color: var(--paper-muted); font-size: 15px; margin: 10px 0 0; }
.witnesses { display: flex; flex-wrap: wrap; gap: 8px; list-style: none; padding: 0; margin: 0; }
.witnesses li { padding: 6px 12px; background: rgba(0,0,0,.05); border: 1px solid rgba(0,0,0,.15); border-radius: 3px; font-size: 15px; }
.witnesses li::before { content: "✓ "; color: var(--green); }
.evidence-list { display: grid; gap: 10px; }
.evidence { display: grid; grid-template-columns: auto 1fr; gap: 12px; align-items: start; padding: 12px 14px; border-radius: 3px; background: rgba(255,255,255,.45); border: 1px solid rgba(0,0,0,.15); }
.evidence .exhibit { margin-top: 3px; }
.evidence .t { font-weight: 700; font-family: var(--f-display); }
.evidence .d { font-size: 14.5px; color: #3b2f22; margin-top: 2px; }
.evidence .tag { font-family: var(--f-hand); font-size: 16px; color: var(--wax); }
.evidence.is-doubt .tag { color: var(--ochre); }
.empty { color: var(--paper-muted); font-style: italic; }
.movements { list-style: none; padding: 0; margin: 0; position: relative; }
.movements::before { content: ""; position: absolute; left: 76px; top: 6px; bottom: 6px; border-left: 1.5px dashed rgba(0,0,0,.3); }
.movements li { display: grid; grid-template-columns: 64px 1fr; gap: 24px; padding: 6px 0; position: relative; }
.movements li::before { content: ""; position: absolute; left: 72px; top: 14px; width: 9px; height: 9px; border-radius: 50%; background: var(--wax); box-shadow: 0 0 0 3px var(--paper); }
.movements li.is-key::before { background: var(--brass); }
.movements .t { font-family: var(--f-type); font-size: 12px; text-align: right; padding-top: 3px; }
.notes {
  width: 100%; min-height: 150px; resize: vertical; border: 0; outline: none; padding: 0 4px; color: #1f3a7a;
  font-family: var(--f-hand); font-size: 22px; line-height: 32px;
  background: repeating-linear-gradient(transparent 0 31px, rgba(60,90,160,.28) 31px 32px);
  background-color: transparent;
}
.notes:focus { background-color: rgba(255,255,255,.3); }
.notes::placeholder { color: rgba(31,58,122,.45); }

/* ══ DEDUCTION ══════════════════════════════════════════════ */
.deduce { max-width: 1180px; margin: 0 auto; padding: 32px 22px 80px; }
.deduce__head { text-align: center; max-width: 720px; margin: 0 auto 30px; }
.eyebrow { font-family: var(--f-type); font-size: 12px; letter-spacing: .3em; text-transform: uppercase; color: var(--brass); }
.deduce__head h1 { font-size: clamp(40px, 5.6vw, 66px); margin-top: 8px; font-weight: 700; font-style: italic; }
.deduce__head p { color: var(--muted); font-style: italic; font-size: 18px; margin: 10px 0 0; }
.warn { display: inline-flex; gap: 8px; align-items: center; margin-top: 14px; padding: 8px 14px; border: 1px dashed var(--ochre); color: var(--ochre); border-radius: 4px; font-family: var(--f-type); font-size: 12px; letter-spacing: .08em; }

.lineup { display: grid; grid-template-columns: repeat(5, 1fr); gap: 14px; position: relative; padding: 24px 10px 0; }
.lineup::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: -14px; height: 14px; border-radius: 3px;
  background: linear-gradient(#5a3b1e, #2d1a0b); box-shadow: 0 10px 20px rgba(0,0,0,.6);
}
.figure {
  position: relative; border: 0; padding: 12px 12px 14px; border-radius: 4px; text-align: center;
  background: var(--panel-2); color: var(--text); border: 1px solid var(--line);
  transition: transform .25s cubic-bezier(.2,.9,.3,1.3), box-shadow .3s, border-color .3s;
}
.figure .photo { aspect-ratio: 4/5; background: #cbb891; color: var(--cameo-ink); overflow: hidden; border-radius: 2px; box-shadow: inset 0 0 40px rgba(60,30,0,.5); filter: grayscale(.4) brightness(.75); transition: filter .3s; }
.figure .photo svg { width: 100%; height: 100%; }
.figure .n { font-family: var(--f-display); font-size: 19px; margin-top: 10px; font-weight: 700; }
.figure .r { font-family: var(--f-type); font-size: 10px; color: var(--muted); margin-top: 3px; letter-spacing: .04em; }
.figure .tie { font-family: var(--f-hand); font-size: 16px; color: var(--string); margin-top: 4px; min-height: 20px; }
.figure:hover { transform: translateY(-4px); border-color: var(--brass); }
.figure:hover .photo { filter: grayscale(.1) brightness(.95); }
.figure.is-on { transform: translateY(-10px) scale(1.04); border-color: var(--brass); box-shadow: 0 0 0 1px var(--brass), 0 30px 60px -20px rgba(0,0,0,.8), 0 0 60px var(--glow); }
.figure.is-on .photo { filter: none; }
.figure.is-cleared { opacity: .55; }
.figure .stamp { position: absolute; left: 50%; top: 36%; transform: translate(-50%,-50%) rotate(-14deg); font-size: 11px; }
.figure.is-on .stamp { font-size: 12px; }

.reasoning { margin-top: 44px; display: grid; grid-template-columns: 1fr 360px; gap: 24px; align-items: start; }
.reasoning .sheet { padding: 28px 32px; }
.reasoning .sheet h2 { font-size: 30px; }
.chain { list-style: none; padding: 0; margin: 14px 0 0; display: grid; gap: 8px; }
.chain li { display: flex; gap: 10px; align-items: baseline; font-size: 16px; }
.chain li .exhibit { flex: 0 0 auto; }
.chain .note { font-family: var(--f-hand); font-size: 20px; color: #1f3a7a; }

.accuse-box { background: var(--panel-2); border: 1px solid var(--line); border-radius: 6px; padding: 22px; text-align: center; position: sticky; top: calc(var(--masthead-h) + 20px); }
.accuse-box h3 { font-family: var(--f-type); font-size: 12px; letter-spacing: .24em; text-transform: uppercase; color: var(--muted); font-weight: 400; }
.accuse-box .who { font-family: var(--f-display); font-size: 28px; margin: 8px 0 4px; min-height: 30px; }
.accuse-box .sus { font-family: var(--f-hand); font-size: 18px; color: var(--brass); min-height: 22px; }
.hold {
  --p: 0; position: relative; width: 150px; height: 150px; margin: 18px auto 10px; border-radius: 50%; border: 0;
  background: conic-gradient(var(--wax) calc(var(--p) * 1%), rgba(255,255,255,.08) 0);
  display: grid; place-items: center; color: var(--text); transition: transform .15s;
  box-shadow: 0 0 0 1px var(--line), 0 20px 40px -16px rgba(0,0,0,.8);
  touch-action: none; user-select: none; -webkit-user-select: none;
}
.hold::before { content: ""; position: absolute; inset: 9px; border-radius: 50%; background: radial-gradient(circle at 40% 35%, #3a2a1f, #1b130e); box-shadow: inset 0 2px 6px rgba(255,255,255,.08), inset 0 -8px 16px rgba(0,0,0,.6); }
.hold span { position: relative; font-family: var(--f-type); font-size: 12px; letter-spacing: .18em; text-transform: uppercase; line-height: 1.5; }
.hold:disabled { opacity: .45; cursor: not-allowed; }
.hold.is-holding { transform: scale(.97); }
.hold.is-holding::before { background: radial-gradient(circle at 40% 35%, #5a2a26, #2a1211); }
.hint-line { font-family: var(--f-type); font-size: 11px; color: var(--muted); letter-spacing: .08em; }
.attempts { margin-top: 14px; font-size: 14px; color: var(--muted); font-style: italic; }

/* Reveal overlay */
.reveal { position: fixed; inset: 0; z-index: 80; display: grid; place-items: center; padding: 20px; background: rgba(8,5,3,.86); backdrop-filter: blur(6px); animation: fadeIn .4s; }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
.reveal__card { position: relative; width: min(760px, 100%); background: var(--paper); color: var(--paper-ink); padding: 48px 46px 40px; border-radius: 3px; box-shadow: 0 60px 100px -30px rgba(0,0,0,.9); transform: rotate(-.6deg); animation: pop .4s cubic-bezier(.2,1.2,.4,1); }
.reveal__card .exhibit { font-size: 11px; }
.reveal__card h2 { font-size: clamp(34px, 5.4vw, 54px); margin-top: 12px; font-weight: 700; }
.reveal__card .stamp--big { position: absolute; right: 30px; top: 26px; animation: stampIn .6s .25s cubic-bezier(.2,1.4,.4,1) both; }
.reveal__text { font-size: 19px; line-height: 1.55; margin: 20px 0 0; min-height: 120px; }
.reveal__text .caret { display: inline-block; width: 2px; height: 1em; background: var(--paper-ink); vertical-align: -2px; animation: blink .8s steps(1) infinite; margin-left: 2px; }
@keyframes blink { 50% { opacity: 0; } }
.reveal__actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 26px; }
.reveal--win .reveal__card { outline: 6px double var(--brass); outline-offset: -14px; }

/* ══ DRAWER / MODAL / TOAST ═════════════════════════════════ */
.scrim { position: fixed; inset: 0; z-index: 60; background: rgba(0,0,0,.5); animation: fadeIn .25s; }
.drawer { position: fixed; top: 0; right: 0; bottom: 0; width: min(440px, 100%); z-index: 70; transform: translateX(104%); transition: transform .4s cubic-bezier(.2,.9,.2,1); }
.drawer[aria-hidden="false"] { transform: none; }
.drawer__inner { height: 100%; display: flex; flex-direction: column; background: var(--paper); color: var(--paper-ink); box-shadow: -30px 0 60px -20px rgba(0,0,0,.8); }
.drawer__head { display: flex; justify-content: space-between; align-items: center; padding: 18px 20px; border-bottom: 2px solid var(--paper-ink); }
.drawer__head h2 { font-size: 30px; }
.drawer__head .icon-btn { border-color: rgba(0,0,0,.3); color: var(--paper-ink); }
.drawer__body { overflow-y: auto; padding: 20px 22px 40px; background: repeating-linear-gradient(transparent 0 31px, rgba(60,90,160,.18) 31px 32px); background-attachment: local; }
.drawer__body h3 { font-family: var(--f-type); font-size: 11px; letter-spacing: .24em; text-transform: uppercase; color: var(--paper-muted); font-weight: 400; margin: 18px 0 8px; }
.facts { padding-left: 18px; margin: 0; font-size: 16px; }
.facts li { margin: 2px 0; line-height: 32px; }
.timeline { list-style: none; padding: 0; margin: 0; }
.timeline li { display: grid; grid-template-columns: 66px 1fr; gap: 12px; line-height: 32px; font-size: 16px; }
.timeline .t { font-family: var(--f-type); font-size: 12px; color: var(--wax); }
.timeline .t.is-key { color: var(--ochre); }

.modal { position: fixed; inset: 0; z-index: 75; display: grid; place-items: center; padding: 18px; background: rgba(8,5,3,.72); backdrop-filter: blur(3px); animation: fadeIn .25s; }
.modal__card { position: relative; width: min(620px, 100%); max-height: 92vh; overflow: auto; background: var(--paper); color: var(--paper-ink); border-radius: 3px; box-shadow: 0 50px 90px -30px rgba(0,0,0,.9); animation: pop .3s cubic-bezier(.2,1.1,.4,1); }
.modal__close { position: absolute; right: 12px; top: 12px; border-color: rgba(0,0,0,.3); color: var(--paper-ink); z-index: 2; }

/* Telegram */
.telegram { padding: 34px 38px 32px; background-image: repeating-linear-gradient(transparent 0 31px, rgba(0,0,0,.06) 31px 32px); }
.telegram__head { display: flex; justify-content: space-between; align-items: center; font-family: var(--f-type); font-size: 11px; letter-spacing: .2em; text-transform: uppercase; padding-bottom: 10px; border-bottom: 2px solid var(--paper-ink); }
.telegram__head b { font-size: 15px; }
.telegram h2 { font-size: 36px; margin-top: 18px; }
.telegram p { font-family: var(--f-type); font-size: 14px; line-height: 32px; margin: 8px 0 0; text-transform: uppercase; }
.telegram p em { font-style: normal; color: var(--wax); }
.telegram .sig { font-family: var(--f-hand); font-size: 24px; margin-top: 10px; text-align: right; color: #1f3a7a; }
.telegram .actions { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 22px; }

/* Clue examine modal */
.examine { padding: 34px 38px 30px; }
.examine .title { font-size: 36px; margin-top: 10px; }
.examine .detail { font-size: 18px; line-height: 1.55; margin-top: 14px; }
.examine .suggests { margin-top: 16px; padding: 12px 16px; border-left: 3px solid var(--ochre); background: rgba(181,122,27,.08); font-style: italic; }
.examine h3 { font-family: var(--f-type); font-size: 11px; letter-spacing: .24em; text-transform: uppercase; color: var(--paper-muted); font-weight: 400; margin: 24px 0 10px; }
.chooser { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 8px; }
.chooser button { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border: 1px solid rgba(0,0,0,.25); border-radius: 4px; background: rgba(255,255,255,.4); text-align: left; transition: all .2s; }
.chooser button:hover { background: var(--paper-ink); color: var(--paper); transform: translateY(-1px); }
.chooser button.is-on { background: var(--wax); border-color: var(--wax); color: #fff; }
.chooser .mini-photo { width: 34px; height: 42px; flex: 0 0 auto; background: #cbb891; color: var(--cameo-ink); overflow: hidden; border-radius: 2px; }
.chooser .mini-photo svg { width: 100%; height: 100%; }
.chooser .nm { font-family: var(--f-hand); font-size: 18px; font-weight: 700; line-height: 1; }
.chooser .rl { font-family: var(--f-type); font-size: 9px; letter-spacing: .04em; opacity: .75; }

.confirm { padding: 34px 38px 30px; }
.confirm h2 { font-size: 34px; }
.confirm p { margin: 12px 0 0; font-size: 17px; }
.confirm .actions { display: flex; gap: 10px; margin-top: 22px; justify-content: flex-end; }

.toast {
  position: fixed; left: 50%; bottom: 26px; z-index: 95; transform: translate(-50%, 20px);
  padding: 10px 18px; border-radius: 4px; background: var(--paper); color: var(--paper-ink);
  font-family: var(--f-type); font-size: 13px; letter-spacing: .06em;
  box-shadow: 0 20px 40px -14px rgba(0,0,0,.8); opacity: 0; pointer-events: none; transition: opacity .25s, transform .25s;
  max-width: calc(100% - 32px); text-align: center;
}
.toast.is-on { opacity: 1; transform: translate(-50%, 0); }

/* ══ RESPONSIVE ═════════════════════════════════════════════ */
@media (max-width: 1040px) {
  .board-wrap { grid-template-columns: 1fr; height: auto; }
  .dock { border-right: 0; border-bottom: 1px solid var(--line); max-height: none; }
  .dock .folder__brief, .dock .howto { display: none; }
  .dock .folder { display: grid; grid-template-columns: 1fr 1fr; gap: 0 20px; align-items: end; }
  .dock .folder > .fieldlabel { margin-top: 10px; }
  .board-scroll { height: calc(100vh - var(--masthead-h) - 150px); min-height: 520px; }
  .dossier { grid-template-columns: 1fr; }
  .mugshot { position: static; max-width: 380px; margin: 0 auto; transform: none; }
  .reasoning { grid-template-columns: 1fr; }
  .accuse-box { position: static; }
}
@media (max-width: 760px) {
  body { font-size: 16px; }
  .masthead { grid-template-columns: auto 1fr auto; gap: 8px; padding: 0 12px; }
  .brand__name { display: none; }
  .tab { padding: 8px 10px; font-size: 11px; }
  .tab__key { display: none; }
  .status-stamp { font-size: 10px; padding: 4px 8px; }
  .lineup { grid-template-columns: repeat(2, 1fr); }
  .lineup .figure:last-child { grid-column: span 2; max-width: 50%; margin: 0 auto; }
  .sheet { padding: 24px 20px 30px; }
  .telegram, .examine, .confirm { padding: 26px 20px 24px; }
  .reveal__card { padding: 36px 22px 30px; }
  .reveal__card .stamp--big { position: static; display: inline-block; margin-top: 10px; font-size: 18px; }
  .movements::before { left: 62px; } .movements li { grid-template-columns: 50px 1fr; } .movements li::before { left: 58px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}

/* hidden attribute must win over display rules */
[hidden] { display: none !important; }
.list-mode .board-scroll { height: auto !important; min-height: 0; }
.list-mode .dock .folder { grid-template-columns: 1fr; }


/* ══ LANDING ═══════════════════════════════════════════════ */
.landing { position: relative; min-height: calc(100vh - var(--masthead-h)); display: grid; align-items: center; overflow: hidden; isolation: isolate; }
.landing__bg { position: absolute; inset: 0; z-index: -2; background: #0e0906 radial-gradient(ellipse at 70% 60%, #2a1b10, #0e0906 65%);
  filter: sepia(.7) contrast(1.05) brightness(.55) saturate(.8); transform: scale(1.04); animation: kenburns 30s ease-in-out infinite alternate; }
@keyframes kenburns { to { transform: scale(1.12) translate(-1%, -1.5%); } }
.landing__bg::after { content: ""; position: absolute; inset: 0; background:
  radial-gradient(ellipse at 28% 45%, rgba(255,190,100,.22), transparent 45%),
  linear-gradient(180deg, rgba(14,9,6,.55), rgba(14,9,6,.25) 40%, rgba(14,9,6,.92) 100%); }
:root[data-theme="daylight"] .landing__bg { filter: sepia(.45) contrast(1) brightness(.85); }
:root[data-theme="daylight"] .landing__bg::after { background: linear-gradient(180deg, rgba(233,223,204,.3), rgba(233,223,204,.6) 60%, var(--bg) 100%); }
.landing__inner { position: relative; max-width: 1180px; width: 100%; margin: 0 auto; padding: 70px 22px 60px; display: grid; grid-template-columns: 1.15fr .85fr; gap: 40px; align-items: center; }
.landing .eyebrow { font-size: 13px; }
.landing h1 { font-size: clamp(54px, 8vw, 112px); font-weight: 600; line-height: .95; margin-top: 14px; letter-spacing: -.01em; text-shadow: 0 2px 30px rgba(0,0,0,.5); }
.landing h1 em { font-style: italic; color: var(--brass); font-weight: 500; }
.landing .lede { font-size: 21px; max-width: 560px; margin: 22px 0 0; color: var(--text); opacity: .92; }
.landing .cta { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 30px; align-items: center; }
.landing .cta .btn { padding: 14px 24px; font-size: 14px; }
.landing .cta .resume { font-family: var(--f-hand); font-size: 20px; color: var(--brass); }
.landing__facts { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; margin-top: 46px; }
.fact { padding: 14px 16px; border: 1px solid rgba(201,162,78,.3); border-radius: 4px; background: rgba(20,14,10,.55); backdrop-filter: blur(6px); }
:root[data-theme="daylight"] .fact { background: rgba(243,235,217,.75); }
.fact b { display: block; font-family: var(--f-display); font-size: 30px; font-weight: 600; color: var(--brass); line-height: 1; }
.fact span { font-family: var(--f-type); font-size: 11px; letter-spacing: .14em; text-transform: uppercase; color: var(--muted); }
.evidence-bag { position: relative; justify-self: center; width: min(100%, 420px); aspect-ratio: 4/5; }
.evidence-bag .tag { position: absolute; z-index: 2; left: -10px; top: 26px; padding: 10px 14px; background: var(--paper); color: var(--paper-ink); border-radius: 3px;
  box-shadow: var(--shadow-lift); transform: rotate(-6deg); font-family: var(--f-type); font-size: 11px; letter-spacing: .14em; line-height: 1.6; }
.evidence-bag .tag b { display: block; font-size: 14px; }
.evidence-bag .frame { position: absolute; inset: 0; border-radius: 6px; overflow: hidden; background: #0b0d17;
  box-shadow: 0 50px 80px -30px rgba(0,0,0,.9), 0 0 0 10px #f6f1e6, 0 0 0 11px rgba(0,0,0,.3); transform: rotate(2deg); }
.evidence-bag .frame img { width: 100%; height: 100%; object-fit: cover; display: block; filter: saturate(1.2) contrast(1.08); }
.evidence-bag .frame::after { content: ""; position: absolute; inset: 0; background: radial-gradient(ellipse at 50% 40%, transparent 50%, rgba(0,0,0,.55) 100%); }
.evidence-bag .gem { position: absolute; inset: 0; display: grid; place-items: center; }
.evidence-bag .gem svg { width: 70%; filter: drop-shadow(0 0 40px rgba(60,120,255,.55)); animation: float 6s ease-in-out infinite; }
@keyframes float { 50% { transform: translateY(-10px) rotate(1.5deg); } }
.evidence-bag .stamp { position: absolute; right: -8px; bottom: 30px; z-index: 2; transform: rotate(8deg); font-size: 14px; }
.landing__screens { max-width: 1180px; margin: 0 auto; padding: 10px 22px 80px; display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; }
.screen-card { display: block; text-decoration: none; padding: 22px 22px 20px; border: 1px solid var(--line); border-radius: 6px; background: var(--panel); transition: transform .25s, border-color .25s, box-shadow .25s; }
.screen-card:hover { transform: translateY(-4px); border-color: var(--brass); box-shadow: 0 30px 50px -30px rgba(0,0,0,.8); }
.screen-card .k { font-family: var(--f-type); font-size: 11px; letter-spacing: .22em; color: var(--brass); }
.screen-card h3 { font-size: 28px; margin-top: 8px; font-weight: 600; }
.screen-card p { margin: 8px 0 0; color: var(--muted); font-size: 16.5px; }
.credits-line { text-align: center; font-family: var(--f-type); font-size: 11px; letter-spacing: .1em; color: var(--muted); padding: 0 22px 40px; }
.credits-line a { color: var(--muted); }

/* ══ INTERROGATION ═════════════════════════════════════════ */
.qa { display: grid; gap: 8px; }
.qa details { border: 1px solid rgba(0,0,0,.18); border-radius: 4px; background: rgba(255,255,255,.4); overflow: hidden; }
.qa summary { cursor: pointer; list-style: none; padding: 12px 16px; display: flex; gap: 12px; align-items: baseline; font-family: var(--f-display); font-weight: 600; font-size: 20px; }
.qa summary::-webkit-details-marker { display: none; }
.qa summary::before { content: "Q."; font-family: var(--f-type); font-size: 12px; letter-spacing: .1em; color: var(--wax); }
.qa summary:hover { background: rgba(0,0,0,.04); }
.qa details[open] summary { border-bottom: 1px dashed rgba(0,0,0,.2); }
.qa .a { padding: 12px 16px 14px 44px; font-size: 18px; font-style: italic; position: relative; animation: fadeUp .3s ease-out; }
.qa .a::before { content: "A."; position: absolute; left: 16px; top: 14px; font-family: var(--f-type); font-size: 12px; letter-spacing: .1em; color: var(--ink-blue); font-style: normal; }

/* ══ COACH MARK + SOLVE STATS ══════════════════════════════ */
.pin.is-coach::after { content: ""; position: absolute; left: 50%; top: 50%; width: 22px; height: 22px; margin: -11px 0 0 -11px; border-radius: 50%; border: 2px solid #fff; background: none;
  animation: pulse 1.6s ease-out infinite; }
@keyframes pulse { 0% { transform: scale(1); opacity: .9; } 100% { transform: scale(3.2); opacity: 0; } }
.stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-top: 18px; }
.stats div { padding: 10px 12px; border: 1px solid rgba(0,0,0,.2); border-radius: 4px; background: rgba(255,255,255,.4); text-align: center; }
.stats b { display: block; font-family: var(--f-display); font-size: 28px; font-weight: 600; line-height: 1; }
.stats span { font-family: var(--f-type); font-size: 10px; letter-spacing: .14em; text-transform: uppercase; color: var(--paper-muted); }

@media (max-width: 900px) {
  .landing__inner { grid-template-columns: 1fr; padding-top: 50px; }
  .evidence-bag { width: min(100%, 320px); }
  .landing__screens { grid-template-columns: 1fr; }
  .landing__facts { grid-template-columns: repeat(3, 1fr); gap: 8px; }
  .fact b { font-size: 24px; }
}
@media (max-width: 760px) { .stats { grid-template-columns: repeat(3, 1fr); } .stats b { font-size: 22px; } .qa summary { font-size: 18px; } }

/* tighter masthead on phones */
.tab { white-space: nowrap; }
@media (max-width: 760px) {
  .masthead { gap: 6px; }
  .tabs { gap: 0; }
  .tab { padding: 8px 7px; font-size: 10px; letter-spacing: .06em; }
  .status-stamp { font-size: 9px; padding: 3px 6px; letter-spacing: .14em; }
  .icon-btn { width: 34px; height: 34px; }
}


/* ══ PRINT: the dossier comes out as paper ══════════════════ */
@media print {
  .masthead, .grain, .vignette, .toast, .dossier__nav, .mugshot .actions, .gauge input, .drawer, .scrim, .modal, .board-hint { display: none !important; }
  body { background: #fff; color: #000; }
  .dossier { display: block; padding: 0; }
  .mugshot, .sheet { box-shadow: none; transform: none; background: #fff; color: #000; }
  .mugshot { max-width: 260px; margin-bottom: 20px; }
  .notes { background: none; border-bottom: 1px solid #999; }
  .qa details { break-inside: avoid; }
}
.confirm p b { font-family: var(--f-display); font-size: 1.1em; }
.list-mode .board-scroll::before { width: 100%; height: 100%; }
html, body { max-width: 100%; }
.list-mode .board-wrap { overflow-x: hidden; }
.board-wrap { grid-template-columns: 312px minmax(0, 1fr); }
@media (max-width: 1040px) { .board-wrap { grid-template-columns: minmax(0, 1fr); } }
.list-mode .board-scroll { min-width: 0; overflow: hidden; }
.list-mode .row { max-width: 100%; }
