@font-face {
  font-family: "Anton";
  src: url(/fonts/anton.woff2) format("woff2");
  font-display: swap;
}
@font-face {
  font-family: "Special Elite";
  src: url(/fonts/special-elite.woff2) format("woff2");
  font-display: swap;
}

:root {
  --ink: #070405;
  --ink-2: #140a0b;
  --blood: #8e0b14;
  --red: #d3161e;
  --bone: #f6ead3;
  --dim: #a8998a;
  --manila: #dcc38e;
  --manila-dark: #b99a5e;
  --type: #2a1d12;
  --display: "Anton", Impact, "Arial Narrow Bold", sans-serif;
  --typewriter: "Special Elite", "Courier New", monospace;
  --glow: 0 0 1px #fff8e8, 0 0 8px #ff6a22, 0 0 22px rgba(255, 70, 20, 0.85), 0 0 46px rgba(211, 22, 30, 0.6);
}

* { box-sizing: border-box; margin: 0; }
html { -webkit-text-size-adjust: 100%; }
body {
  min-height: 100dvh;
  background: var(--ink);
  color: var(--bone);
  font-family: var(--typewriter);
  overflow-x: hidden;
  -webkit-tap-highlight-color: transparent;
}
img, video { display: block; max-width: 100%; }
[hidden] { display: none !important; }
a { color: inherit; }
.sr-only {
  position: absolute; width: 1px; height: 1px; overflow: hidden;
  clip: rect(0 0 0 0); white-space: nowrap;
}

/* Distressed glowing display type, as on the posters. */
.glow {
  font-family: var(--display);
  font-weight: 400;
  text-transform: uppercase;
  color: var(--bone);
  text-shadow: var(--glow);
  letter-spacing: 0.01em;
  line-height: 0.92;
}
/* Worn letters: bone-coloured fill with specks knocked out, so the glow shows through. */
.grit {
  color: transparent;
  background: url(/img/grit.svg) 0 0 / 220px;
  -webkit-background-clip: text;
  background-clip: text;
}
.kicker {
  font-family: var(--typewriter);
  text-transform: uppercase;
  letter-spacing: 0.28em;
  font-size: 12px;
  color: var(--dim);
}

/* Film overlays: grain, scanlines, lightning. */
.grain, .scan, .flash {
  position: fixed; inset: 0; pointer-events: none; z-index: 50;
}
.grain {
  inset: -60px;
  background: url(/img/noise.svg);
  opacity: 0.07;
  animation: grain 0.9s steps(4) infinite;
}
@keyframes grain {
  25% { transform: translate(-22px, 14px); }
  50% { transform: translate(18px, -26px); }
  75% { transform: translate(-10px, 30px); }
}
.scan {
  background: repeating-linear-gradient(to bottom, transparent 0 2px, rgba(0, 0, 0, 0.22) 2px 3px);
  opacity: 0.55;
}
.flash {
  z-index: 60;
  opacity: 0;
  background: radial-gradient(120% 90% at 50% 20%, #f4f8ff 0%, #b9d4ff 45%, rgba(120, 160, 255, 0.4) 100%);
  mix-blend-mode: screen;
}
body.flashing .flash { animation: flash 0.85s ease-out; }
body.flashing .glow {
  animation: split 0.85s steps(1);
}
@keyframes flash {
  0% { opacity: 0; }
  4% { opacity: 0.9; }
  12% { opacity: 0.05; }
  20% { opacity: 0.7; }
  34% { opacity: 0; }
  100% { opacity: 0; }
}
@keyframes split {
  0%, 30% { text-shadow: -4px 0 rgba(255, 0, 70, 0.9), 4px 0 rgba(0, 220, 255, 0.9), var(--glow); transform: translateX(1px); }
  31%, 100% { text-shadow: var(--glow); transform: none; }
}

/* Found-footage HUD. The fade keeps scrolled text from running into it; the extra bottom
   padding is the fade's tail, below the two-line phone layout. */
.hud {
  position: fixed; top: 0; left: 0; right: 0; z-index: 40;
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: max(10px, env(safe-area-inset-top)) 14px 26px;
  background: linear-gradient(var(--ink) 60%, transparent);
  font-size: 12px; letter-spacing: 0.12em; text-transform: uppercase; white-space: nowrap;
  pointer-events: none;
}
.hud > * { pointer-events: auto; }
.rec { display: flex; align-items: center; gap: 8px; text-shadow: 0 0 6px rgba(0, 0, 0, 0.9); }
.rec i {
  width: 10px; height: 10px; border-radius: 50%; background: #ff2a2a;
  box-shadow: 0 0 10px #ff2a2a; animation: blink 1.2s steps(2, jump-none) infinite;
}
@keyframes blink { 50% { opacity: 0.15; } }
.rec time { color: var(--dim); }
@media (max-width: 480px) {
  .hud .rec { display: grid; grid-template-columns: auto auto; column-gap: 8px; }
  .hud .rec time { grid-column: 2; }
}
.sound {
  min-width: 44px; min-height: 44px; padding: 0 12px;
  display: inline-flex; align-items: center; gap: 8px;
  background: rgba(7, 4, 5, 0.6); color: var(--bone);
  border: 1px solid rgba(246, 234, 211, 0.35); border-radius: 2px;
  font: inherit; letter-spacing: 0.14em; cursor: pointer;
  -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px);
}
.sound svg { width: 18px; height: 18px; }
.sound[aria-pressed="true"] { border-color: var(--red); box-shadow: 0 0 14px rgba(211, 22, 30, 0.5); }
.sound .on { display: none; }
.sound[aria-pressed="true"] .on { display: inline; }
.sound[aria-pressed="true"] .off { display: none; }

/* Buttons. */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  min-height: 54px; padding: 0 26px;
  font-family: var(--display); font-size: 21px; letter-spacing: 0.08em; text-transform: uppercase;
  color: var(--bone); background: var(--red);
  border: 1px solid #ff4a3a; border-radius: 2px;
  box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.6) inset, 0 0 26px rgba(211, 22, 30, 0.45);
  text-decoration: none; cursor: pointer;
  transition: transform 0.12s, box-shadow 0.2s, background 0.2s;
}
.btn:hover { background: #e3222a; box-shadow: 0 0 34px rgba(255, 60, 30, 0.6); }
.btn:active { transform: translateY(1px) scale(0.99); }
.btn.ghost {
  background: rgba(7, 4, 5, 0.55); border-color: rgba(246, 234, 211, 0.45); box-shadow: none;
}
.btn.ghost:hover { border-color: var(--bone); }
.btn[aria-disabled="true"], .btn:disabled {
  background: rgba(40, 24, 24, 0.8); border-color: rgba(246, 234, 211, 0.2);
  color: var(--dim); box-shadow: none; cursor: not-allowed;
}
.link-btn {
  min-height: 44px; padding: 0 10px; background: none; border: 0;
  color: var(--dim); font: inherit; letter-spacing: 0.12em; text-transform: uppercase;
  text-decoration: underline; text-underline-offset: 4px; cursor: pointer;
}
.err { color: #ff6b5e; min-height: 1.4em; font-size: 15px; }

/* Polaroid and stamp, shared by the case file and the wall. */
.polaroid {
  background: #f3efe6; padding: 10px 10px 0; box-shadow: 0 10px 30px rgba(0, 0, 0, 0.55);
}
.polaroid img, .polaroid video {
  width: 100%; aspect-ratio: 1; object-fit: cover; background: #1a1414;
  filter: grayscale(0.35) sepia(0.18) contrast(1.08);
}
.polaroid figcaption {
  color: #1d1612; font-family: var(--typewriter); text-align: center;
  padding: 8px 4px 10px; font-size: 15px; line-height: 1.2;
}
.stamp {
  font-family: var(--display); color: var(--red); text-transform: uppercase;
  border: 5px solid currentColor; padding: 2px 14px 0; letter-spacing: 0.06em;
  transform: rotate(-12deg); opacity: 0.88; mix-blend-mode: multiply;
  -webkit-mask-image: url(/img/grit.svg); mask-image: url(/img/grit.svg);
  -webkit-mask-size: 160px; mask-size: 160px;
}

/* A team's glow-stick color, set as --team on the element. */
.team-band {
  display: flex; justify-content: space-between; align-items: center; gap: 10px;
  padding: 8px 12px 6px; background: var(--team); color: #fff;
  font-family: var(--display); font-size: 22px; letter-spacing: 0.08em; text-transform: uppercase;
  box-shadow: 0 0 22px color-mix(in srgb, var(--team) 70%, transparent);
}
.team-band small { font-family: var(--typewriter); font-size: 12px; letter-spacing: 0.16em; opacity: 0.9; }

/* A typed note on paper: evidence, memories, broadcasts. */
.paper {
  background: linear-gradient(180deg, #efe2c2, #e2cf9f); color: var(--type);
  padding: 18px 18px 20px; box-shadow: 0 14px 40px rgba(0, 0, 0, 0.55);
}
.paper h3 { font-family: var(--display); font-weight: 400; font-size: 30px; letter-spacing: 0.03em; line-height: 1; color: #8e0b14; }
.paper .typed { font-size: 18px; line-height: 1.5; white-space: pre-wrap; overflow-wrap: anywhere; }

@media (prefers-reduced-motion: reduce) {
  .grain, .rec i { animation: none; }
  body.flashing .flash, body.flashing .glow { animation: none; }
  * { scroll-behavior: auto !important; }
}
