/* ==========================================================================
   CORNER EVIDENCE — surveillance print, receipt, prints card, envelope,
   cassette, suspects list, ticket stub. Plus small board-wide touches.
   ========================================================================== */
.surv-body { position: absolute; inset: 0; border-radius: 2px; background-color: #f1ede3;
  background-image: linear-gradient(176deg, rgba(255, 255, 255, .5), rgba(255, 255, 255, 0) 30%, rgba(90, 70, 40, 0) 75%, rgba(90, 70, 40, .1)), var(--tex);
  background-size: 100% 100%, 260px; background-blend-mode: normal, multiply; }
.surv-photo { position: absolute; left: 10px; top: 10px; width: 200px; height: 190px; overflow: hidden; filter: grayscale(1) contrast(1.15) sepia(.12) blur(.25px); }
.surv-photo svg { width: 100%; height: 100%; display: block; }
.surv-photo svg ellipse { filter: url(#rough); }
.surv-photo::after { content: ""; position: absolute; inset: 0; background: url("../assets/textures/grain.webp"); opacity: .7; mix-blend-mode: overlay; box-shadow: inset 0 0 24px rgba(0, 0, 0, .55); }
.surv-time { position: absolute; left: 16px; top: 184px; font-size: 8px; letter-spacing: .12em; color: #f6efd9; opacity: .8; }
.surv-cap { position: absolute; left: 10px; right: 10px; top: 210px; text-align: center; font-size: 19px; line-height: 1; }

.receipt { --paper: #f4f1ea; padding: 14px 12px 0; font: 700 9.5px/1.45 "Courier Prime", monospace; color: #3b3732; }
.receipt::after { content: ""; position: absolute; inset: 0; pointer-events: none; background: linear-gradient(180deg, transparent 45%, rgba(244, 241, 234, .5) 78%, rgba(244, 241, 234, .75)); } /* thermal ink fading */
.rc-head { margin: 0; text-align: center; font-size: 13px; letter-spacing: .14em; opacity: .9; }
.rc-sub { margin: 0 0 6px; text-align: center; font-size: 7.5px; letter-spacing: .1em; opacity: .7; }
.rc-rule { display: block; border-top: 1.3px dashed rgba(59, 55, 50, .55); margin: 6px 0; }
.rc-line { display: flex; justify-content: space-between; margin: 0; mix-blend-mode: multiply; opacity: .88; }
.rc-foot { margin: 4px 0 0; text-align: center; font-size: 8px; letter-spacing: .1em; opacity: .65; }
.rc-ann { position: absolute; left: 30px; top: 196px; font-size: 21px; line-height: .95; transform: rotate(-9deg); z-index: 1; }

.fp-card { padding: 12px 14px; }
.fp-head { margin: 0 0 8px; font-size: 9.5px; letter-spacing: .12em; color: #7a2a22; }
.fp-row { display: flex; gap: 6px; }
.fp-box { position: relative; flex: 1; height: 98px; border: 1px solid rgba(42, 35, 28, .5); mix-blend-mode: multiply; }
.fp-box svg { position: absolute; left: 4px; top: 6px; width: calc(100% - 8px); height: 74px; fill: none; stroke: #1f1a17; stroke-width: 1.15; stroke-linecap: round; opacity: .78; filter: url(#rough); }
.fp-box:nth-child(2) svg { transform: rotate(-8deg); opacity: .7; }
.fp-box:nth-child(4) svg { transform: rotate(6deg); opacity: .85; }
.fp-n { position: absolute; left: 0; right: 0; bottom: 3px; text-align: center; font-size: 6.5px; letter-spacing: .12em; color: var(--ink-soft); }
.fp-note { margin: 10px 0 0; font-size: 21px; }

.envelope { --paper: #c9a56e;
  background-image: linear-gradient(170deg, rgba(255, 240, 210, .3), rgba(255, 255, 255, 0) 35%, rgba(80, 50, 15, 0) 70%, rgba(80, 50, 15, .18)), var(--crumple), var(--crinkle);
  background-size: 100% 100%, 620px, 380px; background-blend-mode: normal, overlay, multiply; }
.env-flap { position: absolute; left: 0; top: 0; width: 100%; height: 96px; clip-path: polygon(0 0, 100% 0, 50% 100%);
  background: linear-gradient(180deg, rgba(255, 236, 200, .3), rgba(70, 40, 10, .26)); }
.env-flap::after { content: ""; position: absolute; inset: 0; background: linear-gradient(162deg, transparent 49.2%, rgba(60, 35, 10, .4) 50%, transparent 51%), linear-gradient(18deg, transparent 49.2%, rgba(255, 240, 210, .45) 50%, transparent 51%); }
.env-post { position: absolute; right: 16px; top: 14px; width: 42px; height: 50px; background: #b8463a; outline: 3px dotted #efe6d2; outline-offset: -1px; box-shadow: 0 0 0 3px #efe6d2, 1px 2px 3px 3px rgba(0, 0, 0, .15); }
.env-post b { position: absolute; left: 6px; bottom: 4px; font: 700 15px "Old Standard TT", serif; color: #f1e3c6; }
.env-to { position: absolute; left: 64px; top: 110px; margin: 0; font-size: 12px; line-height: 1.5; }
.env-stamp { position: absolute; left: 18px; top: 50px; transform: rotate(-10deg); }
.env-ann { position: absolute; right: 18px; bottom: 6px; font-size: 19px; line-height: .95; transform: rotate(-4deg); text-align: right; }

.cassette { position: absolute; inset: 0; border-radius: 9px; background: linear-gradient(170deg, #3a3531, #1e1b18 60%, #141210);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .12), inset 0 -2px 4px rgba(0, 0, 0, .6), 0 1px 1px rgba(0, 0, 0, .6); }
.cassette::after { content: ""; position: absolute; inset: 0; border-radius: inherit; pointer-events: none; background: linear-gradient(115deg, transparent 30%, rgba(255, 255, 255, .07) 42%, transparent 52%); }
.cs-screw { position: absolute; width: 8px; height: 8px; border-radius: 50%; background: radial-gradient(circle at 35% 30%, #d8d4cc, #6d6861 60%, #2c2925); }
.cs-screw::after { content: ""; position: absolute; left: 1px; right: 1px; top: 3.5px; height: 1px; background: rgba(0, 0, 0, .6); transform: rotate(35deg); }
.cs-label { position: absolute; left: 18px; right: 18px; top: 16px; height: 100px; border-radius: 4px; background-color: #ede4cd;
  background-image: linear-gradient(transparent 30px, #c6503e 30px 33px, transparent 33px 36px, #d99a3e 36px 38px, transparent 38px), var(--tex);
  background-size: 100% 100%, 240px; background-blend-mode: normal, multiply; }
.cs-title { position: absolute; left: 10px; top: 1px; font-size: 21px; white-space: nowrap; }
.cs-sub { position: absolute; right: 8px; top: 41px; font-size: 6.5px; letter-spacing: .12em; color: var(--ink-soft); }
.cs-window { position: absolute; left: 26px; right: 26px; top: 54px; height: 38px; border-radius: 19px; background: rgba(30, 24, 20, .88); box-shadow: inset 0 2px 4px rgba(0, 0, 0, .7);
  display: flex; align-items: center; padding: 0 12px; }
.cs-reel { position: relative; flex: none; width: 24px; height: 24px; border-radius: 50%; opacity: .9;
  background: radial-gradient(circle, transparent 0 4px, #f1ece2 4.5px 6px, transparent 6.5px), repeating-conic-gradient(#f1ece2 0 16deg, transparent 16deg 60deg);
  -webkit-mask: radial-gradient(circle, #000 11px, transparent 11.5px); mask: radial-gradient(circle, #000 11px, transparent 11.5px); }
.cs-tape { flex: 1; height: 16px; margin: 0 4px; background: linear-gradient(180deg, #6a4529, #3a2416); border-radius: 3px; }
.cs-foot { position: absolute; left: 48px; right: 48px; bottom: 0; height: 22px; background: linear-gradient(180deg, #2a2622, #181513); clip-path: polygon(8% 0, 92% 0, 100% 100%, 0 100%); box-shadow: inset 0 1px 0 rgba(255, 255, 255, .06); }

.notebook { --paper: #f4f1e8; padding: 24px 16px 0 52px;
  background-image: linear-gradient(90deg, transparent 40px, rgba(197, 83, 77, .7) 40px 41.5px, transparent 41.5px), repeating-linear-gradient(180deg, transparent 0 25px, rgba(127, 163, 184, .45) 25px 26px), var(--tex);
  background-size: 100% 100%, 100% 26px, 300px; background-position: 0 0, 0 14px, 0 0; background-blend-mode: normal, normal, multiply; }
.nb-holes { position: absolute; left: 13px; top: 36px; width: 14px; height: 240px; background: radial-gradient(circle, #6e4f32 4.5px, rgba(0, 0, 0, .28) 5.5px, transparent 6.5px) 0 0 / 14px 80px repeat-y; }
.nb-title { margin: 0; font-size: 28px; line-height: 26px; text-decoration: underline; text-decoration-thickness: 2px; text-underline-offset: 4px; }
.nb-list { margin: 4px 0 0; padding-left: 20px; }
.nb-list li { font-size: 21px; line-height: 26px; }
.nb-list s { text-decoration-color: rgba(179, 38, 30, .85); text-decoration-thickness: 2.5px; }
.nb-verdict { margin: 8px 0 0; font-size: 23px; line-height: 25px; transform: rotate(-3deg); }

.ticket { --paper: #dcb59b; padding: 10px 16px 0 36px; }
.ticket::after { content: ""; position: absolute; left: 24px; top: 0; bottom: 0; border-left: 2px dotted rgba(80, 30, 20, .45); }
.tk-admit { font-size: 9px; letter-spacing: .3em; color: #6e2318; }
.tk-title { margin: 4px 0 0; font-size: 10px; line-height: 1.3; letter-spacing: .08em; }
.tk-title b { white-space: nowrap; font: 700 14px "Old Standard TT", serif; letter-spacing: .04em; }
.tk-seat { position: absolute; left: 36px; bottom: 9px; font-size: 7.5px; letter-spacing: .14em; color: #6e2318; opacity: .8; }

/* ---------------- a breath of air when the camera arrives ---------------- */
.sticky-item.is-flutter .sticky-body { animation: flutter 1.1s cubic-bezier(.3, .6, .3, 1); }
@keyframes flutter { 0% { --lk: 0deg; --ls: 1; } 18% { --lk: -2.4deg; --ls: .985; } 40% { --lk: 1.4deg; --ls: 1; } 62% { --lk: -.7deg; } 100% { --lk: 0deg; --ls: 1; } }

@media (prefers-reduced-motion: reduce) {
  .sticky-item.is-flutter .sticky-body { animation: none; }
}

/* ---------------- paint cost: dark ink on paper reads the same without multiply,
   and every blended text node is an extra offscreen pass when a tile rasters ---------------- */
.type, .mono, .hand, .marker, .scrawl, .rule, .news-kick, .news-head, .news-body, .map-title, .map-n,
.wanted-big, .wanted-for, .wanted-name, .wanted-alias, .wanted-reward, .wanted-brief, .hc-line, .hc-num, .hc-case,
.rc-line, .mm-cell, .sb-panel, .pencil { mix-blend-mode: normal; }

/* ==========================================================================
   NOIR GRADE — one harsh bulb, deep falloff, cool shadows, warm highlights.
   Everything outside the cone sinks; the red string is the brightest colour.
   ========================================================================== */
:root { --thread: #b3171b; }
#wall { background: radial-gradient(ellipse 70% 60% at 50% 30%, #1a110a 0%, #0b0705 58%, #040302 100%); }
.thread-core.is-hot { stroke: #dc2f27; }
.threads-core.has-hot .thread-core:not(.is-hot) { stroke: #5e1517; }
.thread-twist { stroke: #ec5a50; }
.thread-shadow { stroke: rgba(8, 4, 2, .55); }

/* harder light = darker, tighter contact shadows */
.paper-item, .tag-item, .folder-item, .film-item, .label-item {
  filter: drop-shadow(0 1px 1.5px rgba(10, 5, 2, .62)) drop-shadow(3px 12px 13px rgba(10, 5, 2, .44)); }
.pin-shadow { background: rgba(8, 4, 1, .7); }

/* one torch-like lamp over the board: a hot centre, the reflector's rings, a crisp rim and a
   little spill (assets/textures/torch.webp). It is fixed to the room — it never follows the
   pointer or the camera; the only life in it is the old filament catching now and then.
   The blend sits on #lamp itself so it lights the board (a blend inside a stacking context
   only mixes with that context), and the dark falls off in #shade, a plain layer above it. */
#lamp { mix-blend-mode: overlay; }
#lamp::before { inset: 0; transform: none; will-change: opacity; mix-blend-mode: normal;
  background: url("../assets/textures/torch.webp") 50% 40% / min(150vmin, 1560px) no-repeat;
  animation: bulb 11s steps(1, end) infinite; }
#lamp::after { content: none; }
#shade { position: fixed; inset: 0; z-index: 5; pointer-events: none;
  background:
    radial-gradient(ellipse 60% 64% at 50% 40%, rgba(5, 5, 9, 0) 18%, rgba(14, 12, 18, .42) 54%, rgba(5, 5, 9, .93) 100%),
    linear-gradient(180deg, rgba(14, 12, 20, .3), rgba(14, 12, 20, 0) 24%, rgba(14, 12, 20, 0) 66%, rgba(8, 7, 12, .45)),
    radial-gradient(ellipse 60% 64% at 50% 40%, rgba(8, 7, 12, 0) 16%, rgba(8, 7, 12, .22) 58%); }
@keyframes bulb { 0%, 61.9%, 62.6%, 63.1%, 88.2%, 88.6%, 100% { opacity: 1; } 62% { opacity: .62; } 62.9% { opacity: .82; } 88.4% { opacity: .74; } }
@media (prefers-reduced-motion: reduce) { #lamp::before { animation: none; } }
#grain { inset: -6%; opacity: .09; }

/* ==========================================================================
   THE ROOM — a lazy ceiling fan between the bulb and the board, cigarette smoke
   and dust hanging in the light, and a storm outside. All of it is fixed to the
   room and animated on the compositor; none of it follows the pointer.
   ========================================================================== */
#room { position: fixed; inset: 0; z-index: 4; pointer-events: none; overflow: hidden; }
#room > * { position: absolute; pointer-events: none; }

/* lightning outside: the whole room catches a cold flicker, twice, then the dark again */
#room::after { content: ""; position: absolute; inset: 0; background: rgba(170, 190, 240, .1); mix-blend-mode: screen; opacity: 0; }
#room.is-flash::after { animation: bolt 1.5s linear; }
@keyframes bolt { 0% { opacity: 0; } 3% { opacity: .9; } 7% { opacity: .1; } 11% { opacity: .65; } 15% { opacity: .15; } 26%, 100% { opacity: 0; } }

/* the ceiling fan's shadow: hub just above the top edge, blades sweeping the board */
#room .fan { left: 50%; top: -64vmax; width: 112vmax; height: 112vmax; margin-left: -56vmax; opacity: .3; will-change: transform;
  background: url("../assets/textures/fan.webp") center / contain no-repeat; animation: fan 12s linear infinite; }
@keyframes fan { to { transform: rotate(360deg); } }

/* smoke drifting through the lamp light (two layers, two speeds) */
#room .smoke { inset: 0; -webkit-mask-image: radial-gradient(ellipse 62% 56% at 50% 40%, #000 12%, transparent 76%); mask-image: radial-gradient(ellipse 62% 56% at 50% 40%, #000 12%, transparent 76%); }
#room .smoke i { position: absolute; top: 0; bottom: 0; left: -620px; right: 0; will-change: transform;
  background: url("../assets/textures/smoke.webp") 0 0 / 620px repeat; opacity: .085; animation: smoke 150s linear infinite; }
#room .smoke i + i { left: 0; right: -860px; top: -8%; bottom: -8%; background-size: 860px; opacity: .06; animation: smoke-back 230s linear infinite; }
@keyframes smoke { to { transform: translate3d(620px, 0, 0); } }
@keyframes smoke-back { to { transform: translate3d(-860px, 0, 0); } }

/* dust motes catching the bulb */
#room .motes { inset: 0; -webkit-mask-image: radial-gradient(ellipse 48% 46% at 50% 38%, #000 30%, transparent 78%); mask-image: radial-gradient(ellipse 48% 46% at 50% 38%, #000 30%, transparent 78%); }
#room .motes i { position: absolute; border-radius: 50%; background: rgba(255, 240, 214, .95); box-shadow: 0 0 5px rgba(255, 222, 170, .8);
  opacity: 0; will-change: transform, opacity; animation: mote 20s ease-in-out infinite alternate; }
@keyframes mote { 0% { transform: translate3d(0, 0, 0); opacity: 0; } 22%, 78% { opacity: var(--o); } 100% { transform: translate3d(var(--dx), var(--dy), 0); opacity: 0; } }

/* lights on: the room starts dark and the bulb stutters into life (no JS needed) */
#blackout { position: fixed; inset: 0; z-index: 95; pointer-events: none; background: #040302; animation: lights-on 1.15s both; }
.is-loading #blackout { animation: none; } /* dark until the first view is ready, then the bulb catches */
@keyframes lights-on {
  0%, 8% { opacity: 1; animation-timing-function: steps(1, end); }
  14% { opacity: .5; animation-timing-function: steps(1, end); }
  19% { opacity: 1; animation-timing-function: steps(1, end); }
  40% { opacity: .35; animation-timing-function: steps(1, end); }
  43% { opacity: .9; animation-timing-function: steps(1, end); }
  48% { opacity: .2; animation-timing-function: steps(1, end); }
  51% { opacity: .55; animation-timing-function: cubic-bezier(.2, .7, .3, 1); }
  76%, 100% { opacity: 0; } }

/* light tier (html.lite — phones, Safari, low-memory machines): the same lamp and dark, minus the
   layers that cost the most memory or repaint time: drifting smoke, motes, the jittering grain
   sheet, the thread blur and the SVG marker wobble */
.lite #room .smoke, .lite #room .motes { display: none; }
.lite #grain { inset: 0; animation: none; }
.lite .threads-shadow { filter: none; opacity: .55; }
.lite .play-mark, .lite .marker-circle, .lite .mm-cell, .lite .arrow svg, .lite .sb-panel svg, .lite .pencil,
.lite .map-svg .marks, .lite .surv-photo svg ellipse, .lite .fp-box svg, .lite .is-paused .ex-media::before { filter: none; }

@media (prefers-reduced-motion: reduce) {
  #room::after, #room .motes, #blackout { display: none; }
  #room .fan, #room .smoke i { animation: none; }
}

/* ==========================================================================
   SMALL TOUCHES — torn scraps, evidence markers, newspaper pages tucked under,
   little night photos. The things that make a board look worked on for weeks.
   ========================================================================== */
.scrap { padding: 16px 16px 12px; }
.scrap-text { font-size: 23px; line-height: .98; text-align: center; }

.ev-card { position: absolute; inset: 0; border-radius: 3px; background: #e6b52e;
  background-image: linear-gradient(170deg, rgba(255, 246, 200, .35), rgba(255, 255, 255, 0) 40%, rgba(80, 50, 0, .18)), var(--tex);
  background-size: 100% 100%, 220px; background-blend-mode: normal, multiply;
  box-shadow: inset 0 0 0 1px rgba(60, 40, 0, .25), inset 0 -10px 0 rgba(20, 14, 0, .08); }
.ev-top { position: absolute; left: 0; right: 0; top: 16px; text-align: center; font-size: 7.5px; letter-spacing: .14em; color: #2a2008; }
.ev-n { position: absolute; left: 0; right: 0; top: 24px; text-align: center; font: 700 40px/1 "Old Standard TT", Georgia, serif; color: #15110a; mix-blend-mode: multiply; }

.np { padding: 14px 18px; }
.np::after { content: ""; position: absolute; inset: 0; pointer-events: none; background: linear-gradient(160deg, rgba(120, 80, 30, 0) 40%, rgba(120, 80, 30, .2)); mix-blend-mode: multiply; }
.np-mast { margin: 0; text-align: center; font: 700 30px/1 "Old Standard TT", Georgia, serif; color: #1e1913; mix-blend-mode: multiply; }
.np-date { margin: 4px 0 0; text-align: center; font-size: 7.5px; letter-spacing: .1em; color: #3a3128; }
.np-head { margin: 2px 0 10px; font: 700 30px/1.02 "Old Standard TT", Georgia, serif; color: #1e1913; mix-blend-mode: multiply; text-transform: uppercase; }
.np-cols { display: flex; gap: 10px; height: 100%; }
.np-col { flex: 1; mix-blend-mode: multiply; opacity: .55;
  background: repeating-linear-gradient(180deg, #3a3128 0 2px, transparent 2px 9px); }
.np-img { flex: 1.4; height: 110px; mix-blend-mode: multiply; filter: grayscale(1);
  background: radial-gradient(circle at 40% 40%, #8a8378, #3c3832 70%), #3c3832; box-shadow: inset 0 0 18px rgba(0, 0, 0, .5); opacity: .8; }
.np-item { filter: drop-shadow(0 1px 1px rgba(10, 5, 2, .5)) drop-shadow(2px 6px 8px rgba(10, 5, 2, .3)) brightness(.86); }

.snap-body { position: absolute; inset: 0; border-radius: 2px; background-color: #f1ede3;
  background-image: linear-gradient(176deg, rgba(255, 255, 255, .5), rgba(255, 255, 255, 0) 30%, rgba(90, 70, 40, 0) 75%, rgba(90, 70, 40, .1)), var(--tex);
  background-size: 100% 100%, 260px; background-blend-mode: normal, multiply; }
.snap-photo { position: absolute; left: 9px; top: 9px; width: 152px; height: 140px; overflow: hidden; filter: grayscale(1) contrast(1.2) sepia(.1); }
.snap-photo svg { width: 100%; height: 100%; display: block; }
.snap-photo::after { content: ""; position: absolute; inset: 0; background: url("../assets/textures/grain.webp"); opacity: .7; mix-blend-mode: overlay; box-shadow: inset 0 0 22px rgba(0, 0, 0, .6); }
.snap-cap { position: absolute; left: 8px; right: 8px; top: 156px; text-align: center; font-size: 19px; line-height: 1; white-space: nowrap; }
