:root {
  --bg: #0b0d0c;
  --bg-2: #111412;
  --panel: #141816;
  --panel-2: #1a1f1c;
  --line: #2a312d;
  --bone: #e9e3cd;
  --bone-dim: #a9a593;
  --muted: #6f7469;
  --phosphor: #8fe0a0;
  --phosphor-dim: #3f6b4a;
  --amber: #e6b65c;
  --red: #e2382c;
  --red-deep: #7a1410;
  --mono: 'IBM Plex Mono', ui-monospace, SFMono-Regular, Menlo, monospace;
  --serif: 'IM Fell English', 'Iowan Old Style', Georgia, serif;
  --serif-sc: 'IM Fell English SC', 'IM Fell English', Georgia, serif;
  --radius: 6px;
  --grain: none;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; background: var(--bg); }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }
body {
  margin: 0;
  color: var(--bone);
  background:
    radial-gradient(1200px 600px at 70% -10%, rgba(143, 224, 160, 0.06), transparent 60%),
    radial-gradient(900px 500px at 0% 110%, rgba(226, 56, 44, 0.05), transparent 60%),
    var(--bg);
  font-family: var(--mono);
  font-size: 15px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
a { color: var(--phosphor); text-decoration: none; border-bottom: 1px dotted rgba(143, 224, 160, 0.45); }
a:hover { color: var(--bone); border-bottom-color: var(--bone); }
code { font-family: var(--mono); font-size: 0.92em; color: var(--bone); background: rgba(233, 227, 205, 0.06); padding: 0.05em 0.35em; border-radius: 3px; }
::selection { background: var(--red); color: #fff; }

#fog { position: fixed; inset: 0; width: 100vw; height: 100vh; z-index: 0; pointer-events: none; opacity: 0.85; filter: blur(14px); }
.grain { position: fixed; inset: -50%; z-index: 50; pointer-events: none; background-image: var(--grain); opacity: 0.5; animation: grain 0.9s steps(6) infinite; mix-blend-mode: overlay; }
@keyframes grain { 0% { transform: translate(0, 0); } 20% { transform: translate(-3%, 2%); } 40% { transform: translate(2%, -4%); } 60% { transform: translate(-1%, 3%); } 80% { transform: translate(3%, 1%); } 100% { transform: translate(0, 0); } }
.flash { position: fixed; inset: 0; z-index: 60; pointer-events: none; background: radial-gradient(circle at 50% 45%, rgba(226, 56, 44, 0.55), rgba(122, 20, 16, 0.75) 60%, rgba(0, 0, 0, 0.9)); opacity: 0; }
body.wailing .flash { animation: flash 2.2s ease-out; }
@keyframes flash { 0% { opacity: 0; } 6% { opacity: 0.95; } 12% { opacity: 0.25; } 18% { opacity: 0.8; } 40% { opacity: 0.35; } 100% { opacity: 0; } }
body.shake main, body.shake .topbar { animation: shake 1.4s cubic-bezier(0.36, 0.07, 0.19, 0.97); }
@keyframes shake {
  0%, 100% { transform: translate(0, 0); }
  8% { transform: translate(-7px, 2px) rotate(-0.3deg); }
  16% { transform: translate(6px, -3px) rotate(0.25deg); }
  24% { transform: translate(-5px, 1px); }
  32% { transform: translate(5px, 2px) rotate(-0.2deg); }
  44% { transform: translate(-3px, -1px); }
  58% { transform: translate(2px, 1px); }
  72% { transform: translate(-1px, 0); }
}

/* ---------- top bar ---------- */
.topbar {
  position: sticky; top: 0; z-index: 40;
  display: flex; align-items: center; gap: 28px;
  padding: 12px 28px;
  background: linear-gradient(to bottom, rgba(11, 13, 12, 0.96), rgba(11, 13, 12, 0.82));
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(3px);
}
.brand { display: flex; align-items: center; gap: 10px; border: 0; color: var(--bone); font-family: var(--serif-sc); font-size: 22px; letter-spacing: 0.06em; }
.brand-mark { width: 22px; height: 22px; fill: var(--bone); }
.brand-mark circle { fill: var(--bg); }
.nav { display: flex; gap: 22px; margin-left: 12px; }
.nav a { border: 0; color: var(--bone-dim); font-size: 13px; letter-spacing: 0.08em; text-transform: uppercase; padding: 4px 0; }
.nav a:hover, .nav a.active { color: var(--bone); box-shadow: inset 0 -1px 0 var(--phosphor); }
.sound-toggle { margin-left: auto; display: inline-flex; align-items: center; gap: 8px; font: 500 12px var(--mono); letter-spacing: 0.08em; text-transform: uppercase; color: var(--bone-dim); background: transparent; border: 1px solid var(--line); padding: 6px 12px; border-radius: 999px; cursor: pointer; }
.sound-toggle:hover { color: var(--bone); border-color: var(--muted); }
.sound-toggle .lamp, .lamp { width: 8px; height: 8px; border-radius: 50%; background: #333; box-shadow: inset 0 0 2px #000; display: inline-block; }
.sound-toggle[aria-pressed='true'] { color: var(--bone); border-color: var(--red-deep); }
.sound-toggle[aria-pressed='true'] .lamp { background: var(--red); box-shadow: 0 0 8px var(--red); }

main { position: relative; z-index: 2; }
.scene { max-width: 1240px; margin: 0 auto; padding: 72px 28px 56px; scroll-margin-top: 58px; }
.scene-head { max-width: 860px; margin-bottom: 28px; }
.kicker { font-size: 12px; letter-spacing: 0.22em; text-transform: uppercase; color: var(--phosphor); margin: 0 0 6px; }
h1, h2, h3 { font-family: var(--serif); font-weight: 400; margin: 0; }
h2 { font-size: 40px; line-height: 1.1; letter-spacing: 0.005em; }
h3 { font-size: 21px; margin-bottom: 8px; }
.sub { color: var(--bone-dim); max-width: 760px; margin: 12px 0 0; }

/* ---------- instruments ---------- */
.instrument {
  position: relative;
  background: linear-gradient(180deg, var(--panel-2), var(--panel));
  border: 1px solid #2f3632;
  border-radius: var(--radius);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04), inset 0 -18px 40px rgba(0, 0, 0, 0.35), 0 18px 40px rgba(0, 0, 0, 0.45);
}
.instrument::before, .instrument::after {
  content: ''; position: absolute; width: 7px; height: 7px; border-radius: 50%;
  background: radial-gradient(circle at 35% 35%, #5d635e, #1d211f 70%);
  box-shadow: 0 0 0 1px #0b0d0c; top: 8px; left: 8px;
}
.instrument::after { left: auto; right: 8px; }
.plate { font-size: 10.5px; letter-spacing: 0.24em; text-transform: uppercase; color: var(--muted); text-align: center; padding: 10px 24px 0; }
.plate.small { padding: 0 24px 12px; letter-spacing: 0.12em; color: var(--bone-dim); font-size: 11px; }

/* ---------- meter ---------- */
.meter { padding: 6px 18px; }
.meter-svg { width: 100%; height: auto; display: block; }
.meter-bezel { fill: #0a0c0b; stroke: #3a413c; stroke-width: 1; }
.meter-face { fill: #e7dfc4; }
.meter-zone { fill: none; stroke-width: 9; }
.zone-calm { stroke: #5d8a63; }
.zone-restless { stroke: #c8963a; }
.zone-possessed { stroke: #b52a20; }
.tick { stroke: #2b2a24; stroke-width: 1; }
.tick.major { stroke-width: 2; }
.tick-label { fill: #2b2a24; font: 600 10px var(--mono); }
.zone-label { fill: #4a463b; font: 600 7.5px var(--mono); letter-spacing: 0.16em; }
.meter-title { fill: #2b2a24; font: 400 20px var(--serif-sc); letter-spacing: 0.18em; }
.meter-sub { fill: #6b6656; font: 500 7.5px var(--mono); letter-spacing: 0.22em; }
.meter-readout { fill: #2b2a24; font: 600 10px var(--mono); letter-spacing: 0.12em; }
.needle-line { stroke: #9e1c14; stroke-width: 2.4; stroke-linecap: round; filter: drop-shadow(1px 2px 1px rgba(0, 0, 0, 0.35)); }
.needle-hub { fill: #1b1d1b; stroke: #6a6e69; stroke-width: 1.5; }
.meter-lamp { fill: #4a2522; stroke: #2a1513; }
.meter-lamp.blink { animation: lampblink 0.5s steps(2) infinite; }
@keyframes lampblink { 0% { fill: #ff4a3a; } 50% { fill: #4a2522; } }
.meter-svg[data-state='wail'] .meter-lamp { fill: #ff3b2e; filter: drop-shadow(0 0 6px #ff3b2e); }
.meter-svg[data-state='calm'] .meter-lamp { fill: #6ccf7f; filter: drop-shadow(0 0 5px #6ccf7f); }
.meter-svg[data-state='restless'] .meter-lamp { fill: #e6b65c; filter: drop-shadow(0 0 5px #e6b65c); }

/* ---------- hero ---------- */
.hero { display: grid; grid-template-columns: 1.25fr 1fr; gap: 48px; align-items: center; min-height: calc(100vh - 58px); padding-top: 40px; }
.case-no { font-size: 12px; letter-spacing: 0.2em; color: var(--muted); text-transform: uppercase; margin: 0 0 16px; }
.hero h1 { font-size: 48px; line-height: 1.08; letter-spacing: -0.005em; }
.hero h1 em { font-style: italic; color: var(--red); text-shadow: 0 0 24px rgba(226, 56, 44, 0.35); }
.hero .lede .red-ink { font-family: var(--serif, "IM Fell English", Georgia, serif); font-style: italic; color: #ff6a5c; font-size: 1.12em; }
.lede { color: var(--bone-dim); font-size: 15.5px; max-width: 640px; margin: 22px 0 26px; }
.hero-actions { display: flex; gap: 14px; flex-wrap: wrap; align-items: center; }
.btn { font: 600 13px var(--mono); letter-spacing: 0.08em; text-transform: uppercase; padding: 12px 18px; border-radius: 4px; cursor: pointer; border: 1px solid transparent; display: inline-flex; align-items: center; gap: 8px; }
.btn-red { background: var(--red); color: #fff; border-color: #ff6a5d33; box-shadow: 0 0 0 1px #3a0805, 0 8px 24px rgba(226, 56, 44, 0.28); }
.btn-red:hover { background: #f0463a; }
.btn-red:active { transform: translateY(1px); }
.btn-ghost { background: transparent; color: var(--bone); border: 1px solid #3a423d; }
.btn-ghost:hover { border-color: var(--bone-dim); color: var(--bone); }
a.btn { border-bottom: 1px solid #3a423d; }
.counters { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0; margin: 40px 0 0; border-top: 1px solid var(--line); }
.counters > div { padding: 16px 18px 0 0; border-right: 1px solid var(--line); margin-right: 18px; }
.counters > div:last-child { border-right: 0; }
.counters dt { color: var(--muted); font-size: 11.5px; letter-spacing: 0.06em; text-transform: uppercase; order: 2; }
.counters dd { margin: 0 0 6px; display: flex; flex-direction: column; }
.counters .num { font-family: var(--mono); font-weight: 500; font-size: 36px; line-height: 1; color: var(--bone); letter-spacing: -0.02em; }
.counters .num.red { color: var(--red); }
.cite { font-size: 11px; color: var(--muted); border-bottom: 0; margin-top: 6px; }
.live-dot::before { content: ''; display: inline-block; width: 6px; height: 6px; border-radius: 50%; background: var(--red); margin-right: 6px; vertical-align: 1px; animation: pulse 1.6s ease-in-out infinite; }
@keyframes pulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.25; } }
.hero-meter { padding-bottom: 6px; }

/* ---------- seance ---------- */
.seance-grid { display: grid; grid-template-columns: 1.4fr 1fr; gap: 24px; align-items: stretch; }
.console { display: flex; flex-direction: column; padding: 0; overflow: hidden; }
.console::before, .console::after { display: none; }
.console-bar { display: flex; align-items: center; gap: 12px; padding: 9px 14px; font-size: 11.5px; color: var(--muted); border-bottom: 1px solid var(--line); background: #0f1210; }
.console-bar .dots { display: inline-flex; gap: 6px; }
.console-bar .dots i { width: 9px; height: 9px; border-radius: 50%; background: #2a302c; display: block; }
.console-bar .hint { margin-left: auto; }
.console-body { display: flex; gap: 10px; padding: 16px 16px 8px; flex: 1; background: #0c0f0d; }
.prompt { color: var(--phosphor); font-weight: 600; padding-top: 2px; text-shadow: 0 0 8px rgba(143, 224, 160, 0.5); }
#seanceInput { flex: 1; min-height: 104px; resize: vertical; background: transparent; border: 0; outline: none; color: var(--phosphor); font: 15px/1.6 var(--mono); text-shadow: 0 0 6px rgba(143, 224, 160, 0.35); caret-color: var(--phosphor); }
#seanceInput::placeholder { color: var(--phosphor-dim); }
.chips { display: flex; flex-wrap: wrap; gap: 8px; padding: 10px 16px 4px; background: #0c0f0d; }
.chip { font: 12px var(--mono); color: var(--bone-dim); background: #151a17; border: 1px solid #28302b; padding: 5px 10px; border-radius: 3px; cursor: pointer; }
.chip:hover { color: var(--bone); border-color: var(--muted); }
.chip .tag { color: var(--muted); margin-right: 6px; }
.console-actions { display: flex; align-items: center; gap: 16px; padding: 14px 16px; border-top: 1px solid var(--line); }
.engine-status { font-size: 11.5px; color: var(--muted); }
.engine-status.ok::before { content: '● '; color: var(--phosphor); }
.engine-status.bad::before { content: '● '; color: var(--red); }

.verdicts { list-style: none; margin: 26px 0 0; padding: 0; display: grid; gap: 10px; }
.vrow { display: grid; grid-template-columns: 128px 64px minmax(180px, 1.1fr) 2fr; gap: 16px; align-items: center; padding: 14px 18px; border: 1px solid var(--line); border-left: 3px solid var(--muted); background: rgba(20, 24, 22, 0.86); border-radius: 4px; transition: border-color 0.4s, background 0.4s; }
.vrow .stamp, .vrow .pkg { justify-self: start; }
.vrow .eco { color: var(--muted); font-size: 12px; text-transform: uppercase; letter-spacing: 0.1em; }
.vrow .pkg { font-size: 16px; color: var(--bone); word-break: break-all; }
.vrow .why { color: var(--bone-dim); font-size: 13px; }
.vrow .why .sig { display: inline-block; margin: 2px 8px 2px 0; padding: 1px 7px; border: 1px solid #2c332e; border-radius: 2px; font-size: 11.5px; }
.vrow .fix { margin-top: 6px; color: var(--phosphor); font-size: 13px; }
.vrow .fix code { color: var(--phosphor); background: rgba(143, 224, 160, 0.08); }
.vrow.pending { border-left-color: var(--phosphor-dim); }
.vrow.pending .stamp { color: var(--phosphor); border-color: var(--phosphor-dim); animation: pulse 1s ease-in-out infinite; }
.vrow.v-ALIVE { border-left-color: #5d8a63; }
.vrow.v-RESTLESS, .vrow.v-UNKNOWN { border-left-color: var(--amber); }
.vrow.v-POSSESSED, .vrow.v-PHANTOM { border-left-color: var(--red); background: linear-gradient(90deg, rgba(122, 20, 16, 0.35), rgba(20, 24, 22, 0.86) 55%); }
.stamp { display: inline-block; font: 700 12px var(--mono); letter-spacing: 0.16em; padding: 4px 8px; border: 2px solid currentColor; border-radius: 3px; text-transform: uppercase; transform: rotate(-2deg); }
.stamp-alive, .v-ALIVE .stamp { color: #7fc48c; }
.stamp-restless, .v-RESTLESS .stamp { color: var(--amber); }
.stamp-unknown, .v-UNKNOWN .stamp { color: #c9b48a; }
.stamp-possessed, .v-POSSESSED .stamp { color: #ff6b5e; }
.stamp-phantom, .v-PHANTOM .stamp { color: #ff4b3e; text-shadow: 0 0 10px rgba(255, 75, 62, 0.6); }
.vrow.landed .stamp { animation: stampin 0.35s cubic-bezier(0.2, 1.6, 0.4, 1); }
@keyframes stampin { 0% { transform: scale(2.2) rotate(-8deg); opacity: 0; } 100% { transform: scale(1) rotate(-2deg); opacity: 1; } }
.exorcism { margin-top: 18px; padding: 16px 20px; border: 1px dashed #5a2420; border-radius: 4px; background: rgba(122, 20, 16, 0.12); font-size: 14px; }
.exorcism b { color: var(--red); letter-spacing: 0.1em; font-weight: 600; }
.exorcism code { color: var(--phosphor); }
.exorcism.clean { border-color: #2f5236; background: rgba(93, 138, 99, 0.08); }
.exorcism.clean b { color: var(--phosphor); }

/* ghost */
.ghost-rise { position: absolute; z-index: 70; width: 92px; pointer-events: none; animation: rise 2.5s ease-out forwards; }
.ghost-rise svg { width: 92px; height: auto; display: block; filter: drop-shadow(0 0 18px rgba(233, 227, 205, 0.55)); }
.ghost-body { fill: rgba(236, 232, 214, 0.92); }
.ghost-eye, .ghost-mouth { fill: #120807; }
.ghost-tag { display: block; text-align: center; font: 600 11px var(--mono); color: #ffd7d2; letter-spacing: 0.1em; margin-top: 4px; }
.ghost-rise.still { animation: fadeonly 2.4s ease-out forwards; }
@keyframes rise { 0% { transform: translateY(30px) scale(0.6); opacity: 0; } 15% { opacity: 1; } 60% { transform: translateY(-90px) scale(1) rotate(-4deg); opacity: 0.95; } 100% { transform: translateY(-190px) scale(1.15) rotate(5deg); opacity: 0; } }
@keyframes fadeonly { 0% { opacity: 0; } 20% { opacity: 1; } 100% { opacity: 0; } }

/* ---------- graveyard ---------- */
.census-bar { display: grid; grid-template-columns: repeat(5, auto) 1fr; gap: 0; padding: 16px 22px; align-items: end; }
.census-bar > div:not(.filters) { padding-right: 22px; margin-right: 22px; border-right: 1px solid var(--line); }
.census-bar .k { display: block; font-size: 10.5px; color: var(--muted); letter-spacing: 0.16em; text-transform: uppercase; }
.census-bar .v { font-family: var(--mono); font-weight: 500; font-size: 28px; line-height: 1.15; }
.census-bar .v.red { color: var(--red); }
.filters { display: flex; gap: 14px; justify-content: flex-end; font-size: 12px; color: var(--muted); }
.filters select, .mono-input { font: 12px var(--mono); color: var(--bone); background: #0e110f; border: 1px solid var(--line); border-radius: 3px; padding: 5px 8px; }
.census-note { color: var(--muted); font-size: 12.5px; margin: 14px 0 0; min-height: 1em; }
.stones { display: grid; grid-template-columns: repeat(auto-fill, minmax(176px, 1fr)); gap: 26px 20px; margin-top: 26px; padding-bottom: 40px; background: linear-gradient(to bottom, transparent 0, transparent calc(100% - 40px), rgba(30, 36, 32, 0.5) 100%); }
.stone { position: relative; padding: 34px 14px 16px; text-align: center; min-height: 208px; display: flex; flex-direction: column; background: linear-gradient(170deg, #4a4f4b 0%, #33372f 55%, #25291f 100%); border-radius: 88px 88px 6px 6px; box-shadow: inset 0 2px 0 rgba(255, 255, 255, 0.08), inset 0 -24px 30px rgba(0, 0, 0, 0.35), 0 16px 0 -10px rgba(0, 0, 0, 0.6), 0 22px 30px rgba(0, 0, 0, 0.5); color: #d8d3bf; transform-origin: bottom center; animation: emerge 0.8s ease-out both; }
.stone::after { content: ''; position: absolute; left: -10px; right: -10px; bottom: -8px; height: 14px; border-radius: 50%; background: radial-gradient(ellipse at center, rgba(20, 26, 20, 0.95), transparent 70%); z-index: -1; }
@keyframes emerge { from { transform: translateY(22px); opacity: 0; } to { transform: translateY(0); opacity: 1; } }
.stone .rip { font-family: var(--serif-sc); font-size: 15px; letter-spacing: 0.3em; color: #b9b39d; text-shadow: 0 1px 0 rgba(0, 0, 0, 0.6); }
.stone .nm { font: 600 14.5px var(--mono); margin: 12px 0 6px; word-break: break-all; color: #ede8d3; text-shadow: 0 -1px 0 rgba(0, 0, 0, 0.5); }
.stone .eco { font-size: 10.5px; letter-spacing: 0.18em; text-transform: uppercase; color: #a39e88; }
.stone .by { font-size: 11px; color: #bdb7a1; margin-top: 10px; line-height: 1.35; }
.stone .state { margin-top: auto; padding-top: 12px; font: 700 10.5px var(--mono); letter-spacing: 0.14em; }
.stone .state.unclaimed { color: #ff6656; animation: pulse 1.4s ease-in-out infinite; }
.stone .state.claimed { color: #d8b56d; }
.stone .state.checking { color: #8c8a7b; }
.stone.known { background: linear-gradient(170deg, #5a3a36 0%, #3c2724 60%, #261917 100%); }

/* ---------- watch ---------- */
.watch-bar { display: flex; align-items: center; gap: 12px; padding: 14px 22px; flex-wrap: wrap; font-size: 13px; }
.watch-bar .mono-input { flex: 1; min-width: 240px; }
#watchLamp.on { background: var(--phosphor); box-shadow: 0 0 8px var(--phosphor); }
#watchLamp.replay { background: var(--amber); box-shadow: 0 0 8px var(--amber); }
.corrected { margin-top: 16px; padding: 14px 18px; border: 1px solid #2f5236; border-radius: 4px; background: rgba(93, 138, 99, 0.1); color: var(--phosphor); font-size: 14px; }
.corrected b { letter-spacing: 0.12em; }
.timeline { list-style: none; margin: 20px 0 0; padding: 0 0 0 22px; border-left: 1px solid var(--line); display: grid; gap: 14px; }
.timeline .empty { color: var(--muted); font-size: 13px; }
.tl { position: relative; padding: 12px 16px; background: rgba(20, 24, 22, 0.88); border: 1px solid var(--line); border-radius: 4px; animation: emerge 0.5s ease-out both; }
.tl::before { content: ''; position: absolute; left: -28px; top: 18px; width: 11px; height: 11px; border-radius: 50%; background: var(--panel); border: 2px solid var(--muted); }
.tl.blocked { border-color: #5a2420; background: linear-gradient(90deg, rgba(122, 20, 16, 0.32), rgba(20, 24, 22, 0.88) 60%); }
.tl.blocked::before { border-color: var(--red); background: var(--red); box-shadow: 0 0 10px var(--red); }
.tl.allowed::before { border-color: #5d8a63; }
.tl .meta { display: flex; gap: 14px; font-size: 11.5px; color: var(--muted); letter-spacing: 0.06em; }
.tl .meta .tool { color: var(--bone-dim); }
.tl .act { margin: 6px 0; font-size: 14px; color: var(--phosphor); word-break: break-all; }
.tl .act::before { content: '$ '; color: var(--phosphor-dim); }
.tl .res { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; font-size: 13px; }
.tl .res .stamp { font-size: 10.5px; padding: 2px 6px; }
.tl .res .s-ALIVE { color: #7fc48c; } .tl .res .s-RESTLESS, .tl .res .s-UNKNOWN { color: var(--amber); } .tl .res .s-POSSESSED, .tl .res .s-PHANTOM { color: #ff5a4c; }
.tl .verdict-line { font-size: 12.5px; color: var(--bone-dim); margin-top: 6px; }
.tl .verdict-line b { color: var(--red); letter-spacing: 0.08em; }
.tl.allowed .verdict-line b { color: var(--phosphor); }
.replay-label { font-size: 11px; letter-spacing: 0.14em; text-transform: uppercase; color: var(--amber); }

/* takeover */
#takeover { position: fixed; inset: 0; z-index: 80; display: grid; place-items: center; background: radial-gradient(circle at 50% 40%, rgba(110, 10, 6, 0.92), rgba(8, 2, 2, 0.97) 70%); opacity: 0; pointer-events: none; transition: opacity 0.25s; }
#takeover.show { opacity: 1; pointer-events: auto; }
.to-inner { text-align: center; max-width: 900px; padding: 24px; }
.to-ghost svg { width: 120px; filter: drop-shadow(0 0 30px rgba(255, 220, 210, 0.6)); animation: hover 2.2s ease-in-out infinite; }
@keyframes hover { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-12px); } }
.to-kicker { font-size: 12px; letter-spacing: 0.26em; text-transform: uppercase; color: #ff9a8f; margin: 14px 0 6px; }
.to-head { font-family: var(--serif-sc); font-size: 72px; letter-spacing: 0.06em; color: #fff1ec; margin: 0; text-shadow: 0 0 30px rgba(255, 60, 40, 0.8); }
.to-pkg { font-size: 22px; margin: 18px 0 6px; }
.to-pkg code { font-size: 22px; color: #fff; background: rgba(0, 0, 0, 0.4); }
.to-action, .to-detail { color: #f0c9c2; font-size: 14px; margin: 6px auto; max-width: 760px; }
.to-action code { color: #ffd4cc; background: rgba(0, 0, 0, 0.35); }
.to-fix { margin-top: 16px; font-size: 18px; color: var(--phosphor); }
.to-fix code { color: var(--phosphor); background: rgba(0, 0, 0, 0.4); font-size: 18px; }
.to-dismiss { font-size: 11px; color: #a7746d; letter-spacing: 0.14em; text-transform: uppercase; margin-top: 22px; }
.glitch { position: relative; }
#takeover.show .glitch::before, #takeover.show .glitch::after { content: attr(data-text); position: absolute; inset: 0; overflow: hidden; }
#takeover.show .glitch::before { color: #00e5ff; mix-blend-mode: screen; opacity: 0.5; animation: gl1 0.9s steps(2) infinite; }
#takeover.show .glitch::after { color: #ff2a00; mix-blend-mode: screen; opacity: 0.6; animation: gl2 0.7s steps(2) infinite; }
@keyframes gl1 { 0% { clip-path: inset(0 0 70% 0); transform: translate(-3px, 0); } 50% { clip-path: inset(40% 0 20% 0); transform: translate(3px, 1px); } 100% { clip-path: inset(80% 0 0 0); transform: translate(-2px, -1px); } }
@keyframes gl2 { 0% { clip-path: inset(60% 0 10% 0); transform: translate(3px, 0); } 50% { clip-path: inset(10% 0 60% 0); transform: translate(-3px, 1px); } 100% { clip-path: inset(30% 0 40% 0); transform: translate(2px, 0); } }

/* ---------- install ---------- */
.install-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; align-items: start; }
.card { padding: 26px 24px 18px; }
.card p { color: var(--bone-dim); font-size: 13.5px; }
.code { position: relative; margin: 10px 0; padding: 14px 16px; background: #0b0e0c; border: 1px solid var(--line); border-radius: 4px; overflow-x: auto; font-size: 12.5px; line-height: 1.55; color: var(--phosphor); }
.code code { background: none; padding: 0; color: inherit; }
.copy { position: absolute; top: 8px; right: 8px; font: 600 10.5px var(--mono); letter-spacing: 0.1em; text-transform: uppercase; color: var(--muted); background: #151a17; border: 1px solid var(--line); border-radius: 3px; padding: 3px 8px; cursor: pointer; }
.copy:hover { color: var(--bone); }
.how { margin-top: 44px; max-width: 980px; }
.how h3 { margin-top: 26px; }
.how-note { color: var(--bone-dim); }
.verdict-key { display: grid; gap: 10px; margin: 14px 0 0; }
.verdict-key > div { display: grid; grid-template-columns: 150px 1fr; gap: 16px; align-items: center; padding: 10px 0; border-bottom: 1px solid var(--line); }
.verdict-key dd { margin: 0; color: var(--bone-dim); font-size: 13.5px; }
.evidence { padding-left: 18px; color: var(--bone-dim); font-size: 13.5px; }
.evidence li { margin: 8px 0; }
.evidence b { color: var(--bone); }

.footer { position: relative; z-index: 2; border-top: 1px solid var(--line); padding: 26px 28px 40px; text-align: center; font-size: 12.5px; color: var(--muted); }
.footer .fine { font-size: 11px; }

/* ---------- responsive ---------- */
@media (max-width: 1100px) {
  .hero h1 { font-size: 40px; }
}
@media (max-width: 900px) {
  .hero, .seance-grid, .install-grid { grid-template-columns: 1fr; }
  .hero { min-height: auto; }
  .nav { display: none; }
  .vrow { grid-template-columns: 110px 1fr; }
  .vrow .why { grid-column: 1 / -1; }
  .census-bar { grid-template-columns: repeat(2, 1fr); gap: 12px; }
  .census-bar > div:not(.filters) { border: 0; margin: 0; }
  .filters { grid-column: 1 / -1; justify-content: flex-start; }
  .counters { grid-template-columns: 1fr; }
  .counters > div { border-right: 0; }
  h2 { font-size: 30px; }
  .to-head { font-size: 44px; }
}

/* scene-focus mode for recording: ?scene=x shows one scene full height */
body.focus .scene { display: none; }
body.focus .scene.focused { display: block; min-height: calc(100vh - 58px); }
body.focus .scene.hero.focused { display: grid; }
body.focus .footer { display: none; }
body.focus .scene.focused:not(.hero) { padding-top: 36px; }
body.focus .seance .sub { display: none; }

@media (prefers-reduced-motion: reduce) {
  .grain, .stone, .tl, .live-dot::before, .stone .state.unclaimed { animation: none !important; }
}
