/* Layout: a black cinematic stage of full-bleed bands (hero, broadcast, ledger, cascade, undercroft, gallery),
   each band's content held to a 1240px column with a 16px+ safe gutter. Single committed dark look. */
:root {
  --night: #0b0908;     /* stage black, warm */
  --soot: #141011;      /* panels */
  --char: #1f1819;      /* raised panels, hover */
  --seam: #352a2a;      /* hairlines */
  --bone: #efe6d6;      /* text, the mask's ivory */
  --ash: #a99b8f;       /* secondary text */
  --blood: #c8161d;     /* the V */
  --flare: #ff3b30;     /* alarms, overdue */
  --ember: #e8722a;     /* high */
  --brass: #cfa64e;     /* medium, gilt, gold sparks */
  --steel: #8b979f;     /* low */
  --dim: #74695f;       /* info */

  --display: "IM Fell English SC", "IM Fell English", Georgia, "Times New Roman", serif;
  --fell: "IM Fell English", Georgia, "Times New Roman", serif;
  --body: "Spectral", Georgia, "Times New Roman", serif;
  --type: "Courier Prime", "Courier New", Courier, monospace;
  --stencil: "Big Shoulders Stencil Display", Impact, "Arial Narrow", sans-serif;

  --col: 1240px;
  --bar: 62px;
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: calc(var(--bar) + 12px); -webkit-text-size-adjust: 100%; background: var(--night); }
body {
  margin: 0; background: var(--night); color: var(--bone);
  font-family: var(--body); font-size: 1.0625rem; line-height: 1.6;
  -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility;
}
body.lock { overflow: hidden; }
img { max-width: 100%; display: block; }
::selection { background: var(--blood); color: var(--bone); }
:focus-visible { outline: 2px solid var(--brass); outline-offset: 3px; }
a { color: inherit; }
[hidden] { display: none !important; }

/* film grain over everything */
body::after {
  content: ""; position: fixed; inset: -50%; z-index: 100; pointer-events: none; opacity: .07;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='180' height='180'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='2' stitchTiles='stitch'/></filter><rect width='100%' height='100%' filter='url(%23n)'/></svg>");
  animation: grain .9s steps(4) infinite;
}
@keyframes grain { 0% { transform: translate(0, 0) } 25% { transform: translate(-3%, 2%) } 50% { transform: translate(2%, -3%) } 75% { transform: translate(-2%, -1%) } 100% { transform: translate(0, 0) } }

.defs { position: absolute; width: 0; height: 0; overflow: hidden; }
.sr { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.wrap {
  max-width: var(--col); margin-inline: auto;
  padding-left: max(clamp(16px, 4vw, 40px), env(safe-area-inset-left, 0px));
  padding-right: max(clamp(16px, 4vw, 40px), env(safe-area-inset-right, 0px));
}
.micro { font-family: var(--type); font-size: .74rem; letter-spacing: .16em; text-transform: uppercase; color: var(--ash); margin: 0; }

/* severity tokens */
.sev-critical { --sev: var(--blood); }
.sev-high { --sev: var(--ember); }
.sev-medium { --sev: var(--brass); }
.sev-low { --sev: var(--steel); }
.sev-info { --sev: var(--dim); }

/* ---------- top bar ---------- */
body::before { content: ""; position: fixed; inset: 0 0 auto; height: env(safe-area-inset-top, 0px); z-index: 45; background: var(--night); }
.topbar {
  position: sticky; top: env(safe-area-inset-top, 0px); z-index: 40;
  background: color-mix(in srgb, var(--night) 84%, transparent);
  backdrop-filter: blur(10px) saturate(1.2); -webkit-backdrop-filter: blur(10px) saturate(1.2);
  border-bottom: 1px solid var(--seam);
}
.topbar-in { display: flex; align-items: center; gap: 22px; min-height: var(--bar); }
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--bone); flex-shrink: 0; }
.brand-mark { width: 30px; height: 30px; color: var(--blood); filter: drop-shadow(0 0 8px color-mix(in srgb, var(--blood) 60%, transparent)); }
.brand-word { font-family: var(--display); font-size: 1.28rem; white-space: nowrap; }
.topnav { display: flex; gap: 24px; margin-left: auto; }
.topnav a { font-family: var(--type); font-size: .76rem; letter-spacing: .15em; text-transform: uppercase; color: var(--ash); text-decoration: none; padding: 6px 0; border-bottom: 1px solid transparent; transition: color .15s, border-color .15s; }
.topnav a:hover { color: var(--bone); border-color: var(--blood); }
.topbar-tools { display: flex; align-items: center; gap: 14px; }
.clock { font-family: var(--type); font-size: .86rem; color: var(--brass); font-variant-numeric: tabular-nums; letter-spacing: .06em; }
.sound {
  font-family: var(--type); font-size: .74rem; letter-spacing: .13em; text-transform: uppercase;
  color: var(--bone); background: transparent; border: 1px solid var(--seam); padding: 8px 12px; cursor: pointer;
  display: inline-flex; align-items: center; gap: 8px; transition: border-color .15s, box-shadow .2s, color .15s;
}
.sound i { width: 8px; height: 8px; border-radius: 50%; background: var(--seam); }
.sound:hover { border-color: var(--ash); }
.sound[aria-pressed="true"] { border-color: var(--blood); color: var(--flare); box-shadow: inset 0 0 0 1px var(--blood), 0 0 22px -6px var(--blood); }
.sound[aria-pressed="true"] i { background: var(--flare); box-shadow: 0 0 8px var(--flare); }
@media (max-width: 900px) { .topnav { display: none; } .topbar-tools { margin-left: auto; } }
@media (max-width: 440px) { .clock { display: none; } .brand-word { font-size: 1.08rem; } }

/* ---------- buttons ---------- */
.btn {
  font-family: var(--type); font-size: .8rem; letter-spacing: .15em; text-transform: uppercase; text-decoration: none;
  padding: 14px 20px; border: 1px solid; cursor: pointer; background: none; color: var(--bone);
  display: inline-flex; align-items: center; gap: 10px; transition: transform .15s, box-shadow .2s, background .2s, border-color .2s;
}
.btn-blood { background: var(--blood); border-color: var(--blood); box-shadow: 0 12px 40px -14px var(--blood); }
.btn-blood:hover { background: var(--flare); border-color: var(--flare); transform: translateY(-1px); }
.btn-ghost { border-color: color-mix(in srgb, var(--bone) 35%, transparent); }
.btn-ghost:hover { border-color: var(--bone); background: color-mix(in srgb, var(--bone) 8%, transparent); }
.linkish { font: inherit; color: var(--bone); background: none; border: 0; padding: 0; text-decoration: underline; text-decoration-color: var(--blood); text-underline-offset: 3px; cursor: pointer; }

/* ---------- hero ---------- */
.hero {
  position: relative; isolation: isolate; overflow: clip;
  min-height: clamp(640px, 90vh, 920px);
  display: flex; flex-direction: column; justify-content: flex-end;
  padding-block: 110px 0; cursor: crosshair;
}
.hero a, .hero button { cursor: pointer; }
.hero-bg {
  position: absolute; inset: 0; z-index: -4;
  background: url("../img/hero.jpg") 68% center / cover no-repeat;
  animation: slowpush 38s ease-out both;
}
.hero-shade {
  position: absolute; inset: 0; z-index: -3; pointer-events: none;
  background:
    linear-gradient(90deg, var(--night) 0%, color-mix(in srgb, var(--night) 78%, transparent) 26%, color-mix(in srgb, var(--night) 18%, transparent) 58%, transparent 80%),
    linear-gradient(0deg, var(--night) 0%, color-mix(in srgb, var(--night) 70%, transparent) 18%, transparent 46%),
    linear-gradient(180deg, color-mix(in srgb, var(--night) 70%, transparent) 0%, transparent 18%);
}
@keyframes slowpush { from { transform: scale(1.14); } to { transform: scale(1.02); } }
.hero-fx { position: absolute; inset: 0; z-index: 2; width: 100%; height: 100%; display: block; pointer-events: none; }
.finale-fx { position: fixed; inset: 0; z-index: 90; width: 100vw; height: 100vh; display: block; pointer-events: none; }
.hero-v {
  position: absolute; z-index: -2; pointer-events: none;
  left: -3vw; top: 4%; width: min(780px, 92vw); aspect-ratio: 1;
  fill: none; stroke: var(--blood); opacity: .3;
  filter: drop-shadow(0 0 24px color-mix(in srgb, var(--blood) 80%, transparent));
}
.hero-v .hv-ring { stroke-width: 2.6; stroke-dasharray: 1; stroke-dashoffset: 1; animation: draw 1.7s .3s cubic-bezier(.65, 0, .25, 1) forwards; }
.hero-v .hv-l { stroke-width: 7.5; stroke-dasharray: 1; stroke-dashoffset: 1; animation: draw .32s 1.75s cubic-bezier(.7, 0, 1, 1) forwards; }
.hero-v .hv-r { stroke-width: 3.2; stroke-dasharray: 1; stroke-dashoffset: 1; animation: draw .26s 2.08s cubic-bezier(.7, 0, 1, 1) forwards; }
@keyframes draw { to { stroke-dashoffset: 0; } }
.hero-hint {
  position: absolute; top: 22px; right: max(clamp(16px, 4vw, 40px), env(safe-area-inset-right, 0px));
  font-family: var(--type); font-size: .7rem; letter-spacing: .14em; text-transform: uppercase;
  color: color-mix(in srgb, var(--bone) 55%, transparent); margin: 0; pointer-events: none; text-align: right;
}
.hero-in { display: grid; grid-template-columns: minmax(0, 1.55fr) minmax(0, 1fr); gap: 44px; align-items: end; }
.eyebrow { font-family: var(--fell); font-style: italic; color: var(--brass); font-size: clamp(1.08rem, 1.7vw, 1.4rem); margin: 0 0 12px; }
.hero-title {
  font-family: var(--display); font-weight: 400; margin: 0;
  font-size: clamp(2.8rem, 8.6vw, 8.2rem); line-height: .84; letter-spacing: -.012em; text-wrap: balance;
  text-shadow: 0 4px 40px rgba(0, 0, 0, .7);
}
.v-cap {
  color: var(--blood); font-size: 1.32em; display: inline-block; margin-right: .02em;
  text-shadow: 0 0 46px color-mix(in srgb, var(--blood) 70%, transparent);
  animation: vslash 1s .5s cubic-bezier(.2, .8, .2, 1) both;
}
@keyframes vslash {
  0% { clip-path: polygon(0 0, 0 0, 0 100%, 0 100%); filter: brightness(3); }
  60% { filter: brightness(1.7); }
  100% { clip-path: polygon(0 0, 100% 0, 100% 100%, 0 100%); filter: none; }
}
.hero-lede { max-width: 56ch; font-size: clamp(1.05rem, 1.35vw, 1.2rem); color: color-mix(in srgb, var(--bone) 90%, transparent); margin: 24px 0 30px; text-shadow: 0 1px 12px rgba(0, 0, 0, .8); }
.hero-actions { display: flex; flex-wrap: wrap; gap: 12px; }

.deadline {
  background: color-mix(in srgb, var(--night) 72%, transparent); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px);
  border: 1px solid var(--seam); border-top: 3px solid var(--blood); padding: 20px 22px 18px; cursor: default; min-width: 0;
}
.deadline-clock {
  font-family: var(--stencil); font-weight: 900; font-size: clamp(2.7rem, 5.4vw, 4.3rem); line-height: 1;
  margin: 12px 0 10px; font-variant-numeric: tabular-nums; color: var(--bone); letter-spacing: .01em; white-space: nowrap;
}
.deadline-clock .u { font-size: .4em; color: var(--ash); margin: 0 .3em 0 .08em; letter-spacing: .08em; }
.deadline-target {
  font: inherit; text-align: left; color: var(--bone); background: none; border: 0; padding: 0 0 10px; width: 100%;
  border-bottom: 1px dashed var(--seam); display: block;
}
.deadline-target b { font-family: var(--type); font-weight: 700; color: var(--brass); margin-right: 8px; }
.deadline-target span { display: block; font-family: var(--type); font-size: .78rem; color: var(--ash); margin-top: 4px; }
.deadline-target:hover { border-bottom-color: var(--blood); }
.deadline-lit { margin: 12px 0 0; font-family: var(--type); font-size: .84rem; color: var(--flare); }
.deadline-lit a { text-decoration-color: color-mix(in srgb, var(--flare) 50%, transparent); text-underline-offset: 3px; }

.tally {
  display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); margin: 46px 0 0;
  border-top: 1px solid var(--seam); background: color-mix(in srgb, var(--night) 62%, transparent);
  backdrop-filter: blur(4px); -webkit-backdrop-filter: blur(4px); cursor: default;
}
.tally div { padding: 16px 18px 18px; border-left: 1px solid var(--seam); min-width: 0; }
.tally div:first-child { border-left: 0; }
.tally dt { font-family: var(--type); font-size: .7rem; letter-spacing: .16em; text-transform: uppercase; color: var(--ash); }
.tally dd { margin: 6px 0 0; font-family: var(--stencil); font-weight: 900; font-size: clamp(2.1rem, 4.2vw, 3.2rem); line-height: 1; font-variant-numeric: tabular-nums; }
.tally .is-red dd { color: var(--flare); text-shadow: 0 0 24px color-mix(in srgb, var(--flare) 50%, transparent); }
.sample-note { font-family: var(--type); font-size: .72rem; letter-spacing: .08em; color: var(--ash); margin: 10px 0 18px; }
.sample-note b { color: var(--brass); font-weight: 400; letter-spacing: .16em; text-transform: uppercase; margin-right: 8px; }
@media (max-width: 960px) { .hero-in { grid-template-columns: 1fr; } .hero-v { opacity: .22; } }
@media (max-width: 760px) {
  .tally { grid-template-columns: repeat(6, minmax(0, 1fr)); }
  .tally div { grid-column: span 2; border-left: 0; border-top: 1px solid var(--seam); }
  .tally div:nth-child(n+4) { grid-column: span 3; }
  .tally div:not(:nth-child(3n+1)) { border-left: 1px solid var(--seam); }
  .tally div:nth-child(4) { border-left: 0; }
  .hero-hint { display: none; }
}

/* ---------- broadcast ---------- */
.broadcast { position: relative; overflow: clip; background: var(--soot); border-block: 1px solid var(--seam); }
.broadcast-in { display: grid; grid-template-columns: minmax(0, 360px) minmax(0, 1fr); gap: 40px; align-items: center; padding-block: 48px; }
.crt {
  position: relative; margin: 0; aspect-ratio: 4 / 3; overflow: hidden; background: var(--night);
  border-radius: 26px / 20px; border: 12px solid var(--char);
  box-shadow: 0 0 0 1px var(--seam), 0 40px 60px -30px #000, 0 0 70px -20px color-mix(in srgb, var(--blood) 45%, transparent);
}
.crt img { width: 100%; height: 100%; object-fit: cover; object-position: center 38%; filter: contrast(1.15) saturate(.85) sepia(.15); animation: crtflicker 5s infinite steps(1); }
.crt::before { content: ""; position: absolute; inset: 0; z-index: 2; pointer-events: none; background: repeating-linear-gradient(0deg, rgba(0, 0, 0, .38) 0 1px, transparent 1px 3px); }
.crt::after { content: ""; position: absolute; inset: 0; z-index: 3; pointer-events: none; background: radial-gradient(ellipse at center, transparent 50%, rgba(0, 0, 0, .8) 100%); }
.crt-roll { position: absolute; left: 0; right: 0; height: 28%; z-index: 2; background: linear-gradient(to bottom, transparent, color-mix(in srgb, var(--bone) 9%, transparent), transparent); animation: roll 6s linear infinite; }
.crt-live { position: absolute; z-index: 4; top: 12px; left: 14px; font-family: var(--type); font-size: .66rem; letter-spacing: .2em; color: var(--bone); display: flex; align-items: center; gap: 7px; }
.crt-live i, .dot-live { width: 8px; height: 8px; border-radius: 50%; background: var(--flare); box-shadow: 0 0 10px var(--flare); animation: blink 1.1s steps(1) infinite; display: inline-block; }
@keyframes roll { from { top: -28%; } to { top: 100%; } }
@keyframes crtflicker { 0%, 100% { opacity: 1; transform: none; } 46% { opacity: 1; } 47% { opacity: .78; transform: translateX(3px); } 48% { opacity: 1; transform: none; } 81% { opacity: .9; } 82% { opacity: 1; } }
@keyframes blink { 50% { opacity: 0; } }
.bc-flag { display: inline-flex; align-items: center; gap: 10px; font-family: var(--type); font-size: .76rem; letter-spacing: .2em; text-transform: uppercase; background: var(--blood); color: var(--bone); padding: 7px 12px; margin: 0 0 14px; }
.bc-flag .dot-live { background: var(--bone); box-shadow: none; }
.bc-h { font-family: var(--display); font-weight: 400; font-size: clamp(1.9rem, 3.6vw, 2.9rem); line-height: 1.02; margin: 0 0 18px; text-wrap: balance; }
.bc-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; }
.bc-item {
  font: inherit; color: var(--bone); text-align: left; cursor: pointer; width: 100%;
  display: grid; grid-template-columns: 150px minmax(0, 1fr) auto; gap: 16px; align-items: baseline;
  padding: 11px 14px; background: color-mix(in srgb, var(--night) 65%, transparent); border: 0; border-left: 3px solid var(--sev);
  transition: background .15s, transform .15s;
}
.bc-item:hover { background: var(--char); transform: translateX(3px); }
.bc-when { font-family: var(--type); font-size: .78rem; letter-spacing: .1em; text-transform: uppercase; color: var(--brass); }
.bc-when.is-over { color: var(--flare); }
.bc-what { min-width: 0; }
.bc-what b { font-family: var(--type); font-weight: 700; margin-right: 10px; }
.bc-what em { display: block; font-style: normal; font-size: .82rem; color: var(--ash); overflow-wrap: anywhere; }
.bc-quiet a { color: var(--bone); text-decoration-color: var(--blood); text-underline-offset: 3px; }
.bc-owner { font-family: var(--type); font-size: .74rem; color: var(--ash); }
.bc-quiet { font-family: var(--type); color: var(--ash); padding: 10px 0; }
.crawl { border-top: 1px solid var(--seam); background: var(--night); overflow: hidden; white-space: nowrap; }
.crawl-track { display: inline-flex; align-items: center; padding-block: 11px; font-family: var(--type); font-size: .82rem; letter-spacing: .09em; text-transform: uppercase; color: var(--ash); animation: crawl 70s linear infinite; }
.crawl-track > span { padding-right: 1.6em; }
.crawl-track b { font-weight: 700; color: var(--bone); }
.crawl-track b.hot { color: var(--flare); }
.crawl-track b.cool { color: var(--brass); }
.crawl-track .sep { color: var(--blood); font-family: var(--display); font-size: 1.1rem; padding-right: 1.6em; }
.crawl:hover .crawl-track { animation-play-state: paused; }
@keyframes crawl { from { transform: translateX(0); } to { transform: translateX(-50%); } }
@media (max-width: 760px) {
  .broadcast-in { grid-template-columns: 1fr; gap: 26px; }
  .crt { max-width: 340px; }
  .bc-item { grid-template-columns: 1fr; gap: 2px; }
}

/* ---------- section heads ---------- */
.sec-head { max-width: 780px; margin-bottom: 30px; position: relative; }
.sec-head .micro { color: var(--flare); display: flex; align-items: center; gap: 12px; }
.sec-head .micro::before { content: ""; width: 26px; height: 1px; background: var(--blood); }
.sec-head h2 { font-family: var(--display); font-weight: 400; font-size: clamp(2.4rem, 5.6vw, 4.6rem); line-height: .94; margin: 10px 0 16px; text-wrap: balance; text-shadow: 0 2px 30px rgba(0, 0, 0, .7); }
.sec-lede { color: color-mix(in srgb, var(--bone) 72%, transparent); max-width: 62ch; margin: 0; }

/* ---------- ledger ---------- */
.ledger { position: relative; overflow: clip; padding-bottom: 90px; }
.banner { height: clamp(210px, 30vw, 400px); background: url("../img/wall.jpg") center 55% / cover no-repeat; position: relative; }
.banner::after { content: ""; position: absolute; inset: 0; background: linear-gradient(to bottom, color-mix(in srgb, var(--night) 35%, transparent) 0%, transparent 30%, color-mix(in srgb, var(--night) 60%, transparent) 70%, var(--night) 100%); }
.ledger .sec-head { margin-top: -88px; }
.controls { display: flex; flex-wrap: wrap; gap: 12px 16px; align-items: center; padding: 14px; background: var(--soot); border: 1px solid var(--seam); }
@media (min-width: 1000px) { .controls { position: sticky; top: calc(env(safe-area-inset-top, 0px) + var(--bar) - 1px); z-index: 20; } }
.search { flex: 1 1 230px; min-width: 0; }
.search input {
  width: 100%; font-family: var(--type); font-size: .9rem; color: var(--bone); background: var(--night);
  border: 1px solid var(--seam); padding: 11px 12px; border-radius: 0; outline: none;
}
.search input:focus { border-color: var(--blood); }
.search input::placeholder { color: color-mix(in srgb, var(--ash) 70%, transparent); }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip {
  font-family: var(--type); font-size: .72rem; letter-spacing: .1em; text-transform: uppercase; color: var(--ash);
  padding: 8px 10px; background: transparent; border: 1px solid var(--seam); cursor: pointer; display: inline-flex; gap: 8px; align-items: center;
}
.chip i { width: 7px; height: 7px; background: var(--sev); transform: rotate(45deg); }
.chip .n { color: color-mix(in srgb, var(--ash) 75%, transparent); }
.chip:hover { color: var(--bone); }
.chip[aria-pressed="true"] { color: var(--bone); border-color: var(--sev, var(--bone)); background: color-mix(in srgb, var(--sev, var(--bone)) 15%, transparent); }
.seg { display: inline-flex; flex-wrap: wrap; border: 1px solid var(--seam); }
.seg button { font-family: var(--type); font-size: .72rem; letter-spacing: .1em; text-transform: uppercase; color: var(--ash); background: transparent; border: 0; padding: 9px 11px; cursor: pointer; }
.seg button + button { border-left: 1px solid var(--seam); }
.seg button:hover { color: var(--bone); }
.seg button[aria-pressed="true"] { background: var(--bone); color: var(--night); }
.sort { display: inline-flex; align-items: center; gap: 8px; }
.sort select { font-family: var(--type); font-size: .8rem; background: var(--night); color: var(--bone); border: 1px solid var(--seam); padding: 9px 10px; border-radius: 0; }
.count { font-family: var(--type); font-size: .78rem; letter-spacing: .06em; color: var(--ash); margin: 18px 0 10px; }

.entries { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.entry {
  font: inherit; color: inherit; text-align: left; cursor: pointer; width: 100%;
  display: grid; grid-template-columns: 6px minmax(0, 2.5fr) 92px 132px 150px minmax(0, 1fr); gap: 0 20px; align-items: center;
  background: var(--soot); border: 1px solid var(--seam); padding: 15px 18px 15px 0; position: relative;
  transition: background .15s, transform .18s, border-color .15s;
}
.entry:hover { background: var(--char); border-color: color-mix(in srgb, var(--sev) 55%, var(--seam)); transform: translateX(5px); }
.entry.is-over { border-color: color-mix(in srgb, var(--blood) 45%, var(--seam)); }
.e-stripe { align-self: stretch; margin-block: -15px; background: var(--sev); }
.entry.is-over .e-stripe { box-shadow: 0 0 16px 1px color-mix(in srgb, var(--flare) 70%, transparent); animation: pulse 1.8s ease-in-out infinite; }
@keyframes pulse { 50% { box-shadow: 0 0 4px 0 color-mix(in srgb, var(--flare) 40%, transparent); } }
.e-main { display: block; min-width: 0; }
.e-id { display: flex; flex-wrap: wrap; gap: 6px 10px; align-items: center; font-family: var(--type); font-size: .8rem; color: var(--ash); letter-spacing: .04em; }
.e-sev { font-family: var(--type); font-size: .66rem; font-weight: 700; letter-spacing: .16em; text-transform: uppercase; color: var(--sev); margin: 0; }
.e-name { display: block; font-family: var(--display); font-size: 1.5rem; line-height: 1.1; margin: 3px 0 2px; color: var(--bone); }
.entry.is-done .e-name { text-decoration: line-through; text-decoration-color: var(--blood); text-decoration-thickness: 2px; color: color-mix(in srgb, var(--bone) 70%, transparent); }
.e-prod { display: block; font-size: .92rem; color: var(--ash); }
.kev { font-family: var(--type); font-size: .62rem; font-weight: 700; letter-spacing: .14em; padding: 2px 6px; border: 1px solid var(--flare); color: var(--flare); }
.e-meta { display: contents; }
.cv { display: block; }
.cv-n { display: block; font-family: var(--stencil); font-weight: 900; font-size: 1.95rem; line-height: 1; font-variant-numeric: tabular-nums; }
.cv-n.is-na { font-size: 1.3rem; color: var(--ash); }
.cv-bar { display: block; height: 4px; background: var(--seam); margin-top: 6px; }
.cv-bar i { display: block; height: 100%; width: calc(var(--v) * 10%); background: var(--sev); }
.cv small { display: block; font-family: var(--type); font-size: .6rem; letter-spacing: .16em; color: var(--ash); margin-top: 5px; text-transform: uppercase; }
.status { font-family: var(--type); font-size: .7rem; letter-spacing: .12em; text-transform: uppercase; padding: 6px 9px; border: 1px solid; display: inline-flex; gap: 8px; align-items: center; justify-self: start; white-space: nowrap; }
.status i { width: 4px; height: 12px; background: currentColor; display: inline-block; transform-origin: bottom center; }
.status.s-open { color: var(--flare); border-color: var(--blood); }
.status.s-in-progress { color: var(--brass); border-color: color-mix(in srgb, var(--brass) 55%, transparent); }
.status.s-in-progress i { transform: rotate(32deg); }
.status.s-remediated { color: var(--night); background: var(--bone); border-color: var(--bone); }
.status.s-remediated i { transform: rotate(90deg) translateX(3px); }
.due { display: block; font-family: var(--type); font-size: .78rem; line-height: 1.4; color: var(--ash); }
.due b { display: block; font-size: .84rem; letter-spacing: .07em; text-transform: uppercase; color: var(--bone); }
.due.is-over b { color: var(--flare); }
.due.is-soon b { color: var(--brass); }
.owner { display: block; font-size: .8rem; color: var(--ash); min-width: 0; line-height: 1.35; overflow-wrap: anywhere; }
.tag-secret, .tag-place { font-family: var(--type); font-size: .6rem; font-weight: 700; letter-spacing: .14em; text-transform: uppercase; padding: 2px 6px; }
.tag-secret { border: 1px solid var(--brass); color: var(--brass); }
.tag-place { border: 1px solid var(--seam); color: var(--bone); }
.more { display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; padding: 22px 0 6px; }
.policy { font-family: var(--type); font-size: .82rem; margin-top: 10px; color: var(--ash); }
.controls select { font-family: var(--type); font-size: .8rem; background: var(--night); color: var(--bone); border: 1px solid var(--seam); padding: 9px 10px; border-radius: 0; max-width: 100%; }
.owner b { display: block; font-family: var(--type); font-weight: 400; font-size: .78rem; color: var(--bone); }
.empty { padding: 34px 20px; border: 1px dashed var(--seam); color: var(--ash); text-align: center; font-family: var(--type); }
@media (max-width: 900px) {
  .entry { grid-template-columns: 6px minmax(0, 1fr); gap: 0 16px; padding-right: 16px; }
  .e-stripe { grid-row: 1 / span 2; }
  .e-meta { display: flex; flex-wrap: wrap; gap: 12px 20px; align-items: center; grid-column: 2; margin-top: 12px; }
  .cv { min-width: 70px; }
}

/* ---------- cascade ---------- */
.cascade {
  position: relative; overflow: clip; padding-block: 96px;
  border-top: 1px solid var(--seam);
  background:
    radial-gradient(ellipse 55% 65% at 72% 50%, color-mix(in srgb, var(--blood) 11%, transparent), transparent 70%),
    var(--night);
}
.cascade-in { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.15fr); gap: 52px; align-items: center; }
.cascade-stat { margin: 26px 0 0; }
.cascade-stat .big { display: block; font-family: var(--stencil); font-weight: 900; font-size: clamp(4.4rem, 10vw, 7.6rem); line-height: .86; color: var(--flare); text-shadow: 0 0 40px color-mix(in srgb, var(--blood) 60%, transparent); }
.cascade-stat span:last-child { display: block; font-family: var(--type); font-size: .9rem; color: var(--bone); margin-top: 10px; }
.legend { display: flex; flex-wrap: wrap; gap: 10px 22px; font-family: var(--type); font-size: .74rem; color: var(--ash); margin: 18px 0 24px; letter-spacing: .06em; }
.legend span { display: inline-flex; align-items: center; gap: 9px; }
.legend i { display: inline-block; }
.lg-up i { width: 4px; height: 13px; background: var(--bone); }
.lg-down i { width: 16px; height: 5px; background: var(--blood); }
.lg-next i { width: 4px; height: 13px; background: var(--flare); box-shadow: 0 0 8px var(--flare); }
.cascade-stage { position: relative; width: 100%; max-width: 680px; aspect-ratio: 1; justify-self: center; }
.cascade-stage::before { content: ""; position: absolute; inset: 6%; border-radius: 50%; background: radial-gradient(circle, color-mix(in srgb, var(--char) 90%, transparent), transparent 70%); }
.cascade-stage canvas { position: relative; width: 100%; height: 100%; display: block; }
@media (max-width: 960px) { .cascade-in { grid-template-columns: 1fr; } }

/* ---------- undercroft ---------- */
.undercroft {
  position: relative; overflow: clip; padding-block: 110px;
  background:
    linear-gradient(to bottom, var(--night) 0%, color-mix(in srgb, var(--night) 45%, transparent) 22%, color-mix(in srgb, var(--night) 62%, transparent) 70%, var(--night) 100%),
    url("../img/undercroft.jpg") center / cover no-repeat;
}
.uc-sum { font-family: var(--type); font-size: .92rem; margin: 20px 0 0; color: var(--bone); }
.uc-sum .lit { color: var(--flare); }
.barrels { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(124px, 1fr)); gap: 30px 18px; }
.barrel {
  font: inherit; color: inherit; background: none; border: 0; cursor: pointer; width: 100%;
  display: flex; flex-direction: column; align-items: center; text-align: center; gap: 5px; position: relative; padding: 20px 4px 0;
}
.barrel svg { width: 78px; height: 92px; color: var(--sev); filter: drop-shadow(0 14px 14px rgba(0, 0, 0, .75)); transform-origin: bottom center; }
.barrel:hover svg, .barrel:focus-visible svg { animation: rattle .32s linear 2; }
@keyframes rattle { 0%, 100% { transform: rotate(0); } 25% { transform: rotate(-4deg); } 75% { transform: rotate(4deg); } }
.b-id { font-family: var(--type); font-size: .74rem; color: var(--bone); letter-spacing: .03em; overflow-wrap: anywhere; }
.b-name { font-size: .82rem; color: var(--ash); line-height: 1.25; }
.b-due { font-family: var(--type); font-size: .66rem; letter-spacing: .12em; text-transform: uppercase; color: var(--ash); }
.b-due.is-over { color: var(--flare); }
.fuse { position: absolute; top: 0; left: calc(50% + 4px); width: 2px; height: 26px; background: linear-gradient(var(--ember), color-mix(in srgb, var(--ash) 60%, var(--night))); transform: rotate(16deg); transform-origin: bottom center; }
.fuse::after {
  content: ""; position: absolute; top: -7px; left: -6px; width: 14px; height: 14px; border-radius: 50%;
  background: radial-gradient(circle, var(--bone) 0 18%, var(--brass) 34%, var(--ember) 52%, transparent 70%);
  box-shadow: 0 0 16px 5px color-mix(in srgb, var(--ember) 65%, transparent);
  animation: spark .14s infinite alternate;
}
@keyframes spark { from { transform: scale(.7) rotate(0); opacity: .85; } to { transform: scale(1.3) rotate(45deg); opacity: 1; } }
.barrels.compact { grid-template-columns: repeat(auto-fill, minmax(78px, 1fr)); gap: 20px 10px; }
.barrels.compact .barrel { padding-top: 14px; gap: 3px; }
.barrels.compact svg { width: 46px; height: 55px; }
.barrels.compact .b-name, .barrels.compact .b-due { display: none; }
.barrels.compact .b-id { font-size: .6rem; }
.barrels.compact .fuse { height: 18px; left: calc(50% + 2px); }

/* ---------- shadow gallery ---------- */
.gallery {
  position: relative; overflow: clip; padding-block: 110px;
  background:
    linear-gradient(to bottom, var(--night) 0%, color-mix(in srgb, var(--night) 55%, transparent) 25%, color-mix(in srgb, var(--night) 75%, transparent) 72%, var(--night) 100%),
    url("../img/gallery.jpg") center / cover no-repeat, var(--night);
}
.gal-sum { font-family: var(--type); font-size: .92rem; margin: 20px 0 0; }
.gal-sum b { color: var(--brass); font-weight: 400; }
.frames { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 30px; }
.frame {
  font: inherit; color: inherit; cursor: pointer; width: 100%; display: block; text-align: center; border: 0;
  padding: 13px;
  background: linear-gradient(135deg,
    color-mix(in srgb, var(--brass) 45%, var(--night)) 0%, var(--brass) 22%,
    color-mix(in srgb, var(--brass) 40%, var(--night)) 48%, var(--brass) 74%,
    color-mix(in srgb, var(--brass) 35%, var(--night)) 100%);
  box-shadow: 0 28px 40px -22px #000, inset 0 0 0 2px color-mix(in srgb, var(--night) 40%, transparent);
  transition: transform .25s;
}
.frame:hover { transform: translateY(-5px) rotate(-.5deg); }
.frame-inner { display: block; background: var(--night); padding: 10px; box-shadow: inset 0 0 0 1px #000, inset 0 0 30px #000; }
.frame-art { display: block; aspect-ratio: 4 / 5; background: var(--night) url("../img/rose.jpg") center / cover no-repeat; }
.plaque {
  display: block; margin-top: 11px; padding: 8px 10px 9px; color: var(--night);
  background: linear-gradient(var(--brass), color-mix(in srgb, var(--brass) 72%, var(--night)));
  font-family: var(--type); font-size: .7rem; letter-spacing: .06em;
}
.plaque b { display: block; font-family: var(--display); font-weight: 400; font-size: 1.06rem; letter-spacing: 0; line-height: 1.15; margin-bottom: 2px; }
.plaque span { display: block; margin-top: 2px; }

/* ---------- footer ---------- */
.foot {
  padding-block: 100px 70px; border-top: 1px solid var(--seam); text-align: center;
  background: radial-gradient(ellipse 50% 70% at 50% 0%, color-mix(in srgb, var(--blood) 16%, transparent), transparent 70%), var(--night);
}
.rhyme { margin: 0 auto; max-width: 760px; }
.rhyme p { font-family: var(--fell); font-style: italic; font-size: clamp(1.45rem, 3.3vw, 2.4rem); line-height: 1.32; margin: 0; }
.rhyme footer { font-family: var(--type); font-size: .72rem; letter-spacing: .16em; text-transform: uppercase; color: var(--ash); margin-top: 18px; }
.bulletproof { font-family: var(--display); color: var(--blood); font-size: clamp(1.7rem, 3.2vw, 2.5rem); margin: 46px 0 8px; text-shadow: 0 0 30px color-mix(in srgb, var(--blood) 50%, transparent); }
.foot-note { font-family: var(--type); font-size: .76rem; color: var(--ash); margin: 0 auto; max-width: 64ch; }
.foot-note kbd { font-family: var(--type); border: 1px solid var(--seam); padding: 1px 6px; color: var(--bone); }
.finale-btn {
  position: fixed; z-index: 45; left: 50%;
  bottom: calc(12px + env(safe-area-inset-bottom, 0px));
  transform: translateX(-50%);
  width: 72px; height: 72px; border-radius: 50%;
  border: 2px solid var(--blood);
  background: color-mix(in srgb, var(--night) 88%, transparent);
  color: var(--bone); font-family: var(--display); font-size: 2.2rem; line-height: 1;
  box-shadow: 0 0 0 6px color-mix(in srgb, var(--night) 65%, transparent), 0 12px 30px rgba(0, 0, 0, .55);
  cursor: pointer; touch-action: manipulation; -webkit-tap-highlight-color: transparent;
}
.finale-btn:active { color: var(--flare); border-color: var(--flare); }

/* ---------- dossier ---------- */
.scrim { position: fixed; inset: 0; z-index: 60; background: color-mix(in srgb, var(--night) 72%, transparent); backdrop-filter: blur(3px); -webkit-backdrop-filter: blur(3px); animation: fade .25s ease both; }
.dossier {
  position: fixed; z-index: 61; top: 0; right: 0; bottom: 0; width: min(660px, 100vw); overflow-y: auto; overscroll-behavior: contain;
  background:
    radial-gradient(ellipse at 20% 0%, color-mix(in srgb, var(--char) 80%, transparent), transparent 60%),
    var(--soot);
  border-left: 1px solid var(--seam); box-shadow: -40px 0 90px -20px #000;
  padding: calc(22px + env(safe-area-inset-top, 0px)) max(clamp(18px, 4vw, 40px), env(safe-area-inset-right, 0px)) calc(60px + env(safe-area-inset-bottom, 0px)) clamp(18px, 4vw, 40px);
  animation: slidein .38s cubic-bezier(.2, .8, .2, 1) both;
}
.dossier::before {
  content: ""; position: absolute; top: 70px; right: -40px; width: 300px; height: 375px; pointer-events: none;
  background: url("../img/mask.jpg") center / cover no-repeat; opacity: .07; mix-blend-mode: screen;
}
@keyframes slidein { from { transform: translateX(40px); opacity: 0; } to { transform: none; opacity: 1; } }
@keyframes fade { from { opacity: 0; } }
.dz-top { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 22px; position: relative; }
.dz-file { font-family: var(--type); font-size: .78rem; letter-spacing: .16em; text-transform: uppercase; color: var(--ash); margin: 0; }
.dz-btns { display: flex; gap: 6px; }
.dz-btn { font-family: var(--type); font-size: .72rem; letter-spacing: .12em; text-transform: uppercase; color: var(--bone); background: transparent; border: 1px solid var(--seam); padding: 8px 11px; cursor: pointer; }
.dz-btn:hover { border-color: var(--bone); }
.dz-close { border-color: var(--blood); }
.dz-head { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 18px; align-items: start; position: relative; }
.dz-name { font-family: var(--display); font-weight: 400; font-size: clamp(2.1rem, 5vw, 3.1rem); line-height: 1; margin: 8px 0 8px; text-wrap: balance; }
.dz-sub { color: var(--bone); margin: 0; }
.dz-type { color: var(--ash); margin: 2px 0 0; font-style: italic; }
.stamp {
  font-family: var(--stencil); font-weight: 900; font-size: 1.7rem; letter-spacing: .08em; text-transform: uppercase; line-height: 1;
  color: var(--flare); border: 4px double currentColor; padding: 8px 12px 6px; white-space: nowrap; margin-top: 10px;
  transform: rotate(-8deg); opacity: .9;
  -webkit-mask-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='120' height='120'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='.7' numOctaves='2'/><feColorMatrix values='0 0 0 0 0  0 0 0 0 0  0 0 0 0 0  0 0 0 -2.4 2.1'/></filter><rect width='100%' height='100%' filter='url(%23n)'/></svg>");
  mask-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='120' height='120'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='.7' numOctaves='2'/><feColorMatrix values='0 0 0 0 0  0 0 0 0 0  0 0 0 0 0  0 0 0 -2.4 2.1'/></filter><rect width='100%' height='100%' filter='url(%23n)'/></svg>");
  animation: stampin .4s .12s cubic-bezier(.3, 1.6, .5, 1) both;
}
.stamp.s-in-progress { color: var(--brass); }
.stamp.s-remediated { color: var(--bone); }
@keyframes stampin { from { transform: rotate(-8deg) scale(2.4); opacity: 0; } to { transform: rotate(-8deg) scale(1); opacity: .9; } }
.facts { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 22px; margin: 26px 0 8px; border-top: 1px solid var(--seam); position: relative; }
.facts div { padding: 11px 0; border-bottom: 1px solid var(--seam); min-width: 0; }
.facts dt { font-family: var(--type); font-size: .66rem; letter-spacing: .16em; text-transform: uppercase; color: var(--ash); }
.facts dd { margin: 3px 0 0; font-family: var(--type); font-size: .9rem; overflow-wrap: anywhere; }
.facts dd.is-over { color: var(--flare); }
.dz-sec { position: relative; }
.dz-sec h3 { font-family: var(--display); font-weight: 400; font-size: 1.6rem; margin: 28px 0 10px; }
.dz-sec p { margin: 0; max-width: 64ch; }
.orders { list-style: none; counter-reset: o; margin: 0; padding: 0; display: grid; gap: 12px; }
.orders li { counter-increment: o; display: grid; grid-template-columns: 40px minmax(0, 1fr); gap: 8px; }
.orders li::before { content: counter(o, upper-roman) "."; font-family: var(--display); color: var(--blood); font-size: 1.25rem; line-height: 1.35; }
code { font-family: var(--type); font-size: .86em; color: var(--brass); background: var(--night); border: 1px solid var(--seam); padding: 1px 6px; overflow-wrap: anywhere; }
.dz-mark pre { font-family: var(--type); font-size: .82rem; color: var(--brass); background: var(--night); border: 1px solid var(--seam); padding: 10px 12px; margin: 10px 0; white-space: pre-wrap; overflow-wrap: anywhere; }
.refs { margin: 0; padding-left: 18px; }
.refs a { text-decoration-color: var(--blood); text-underline-offset: 3px; }
.refs a:hover { color: var(--flare); }
@media (max-width: 520px) { .dz-head { grid-template-columns: 1fr; } .stamp { justify-self: start; } .facts { grid-template-columns: 1fr; } }

/* ---------- reduced motion ---------- */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: .001ms !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important; }
  body::after, .crawl-track, .crt img, .crt-roll { animation: none !important; }
  .crawl { white-space: normal; }
  .crawl-track { display: block; padding-inline: 16px; }
  .crawl-track > span:nth-child(n+1) { display: inline; }
}
