:root {
  --bg: #07080a;
  --bg-2: #0d0f12;
  --line: #1c2026;
  --text: #d8dcd3;
  --muted: #6c736c;
  --acid: #c6ff3d;
  --amber: #ffb547;
  --red: #ff4d4d;
  --mono: "IBM Plex Mono", ui-monospace, monospace;
  --serif: "Instrument Serif", Georgia, serif;
  --mx: 50vw;
  --my: 40vh;
}

*,
*::before,
*::after { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--mono);
  font-weight: 300;
  font-size: 15px;
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

::selection { background: var(--acid); color: var(--bg); }

a { color: inherit; }

em { font-family: var(--serif); font-style: italic; font-weight: 400; color: var(--acid); }

.hidden { display: none; }

/* ---------- atmosphere ---------- */
.grain {
  position: fixed; inset: -50%;
  pointer-events: none; z-index: 100;
  opacity: .07;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  animation: grain 1.2s steps(6) infinite;
}
@keyframes grain {
  0%, 100% { transform: translate(0, 0); }
  20% { transform: translate(-3%, 2%); }
  40% { transform: translate(2%, -4%); }
  60% { transform: translate(-4%, -1%); }
  80% { transform: translate(3%, 3%); }
}

.flashlight {
  position: fixed; inset: 0;
  pointer-events: none; z-index: 50;
  background: radial-gradient(circle 320px at var(--mx) var(--my),
    transparent 0%, rgba(7, 8, 10, .35) 55%, rgba(7, 8, 10, .82) 100%);
  transition: opacity .6s;
}

/* ---------- top bar ---------- */
.topbar {
  position: fixed; top: 0; left: 0; right: 0; z-index: 60;
  display: flex; align-items: center; justify-content: space-between; gap: 2rem;
  padding: 1rem clamp(1rem, 4vw, 3rem);
  background: linear-gradient(to bottom, rgba(7, 8, 10, .92), rgba(7, 8, 10, 0));
  font-size: 12px; letter-spacing: .08em; text-transform: uppercase;
}
.logo { display: flex; align-items: center; gap: .6rem; text-decoration: none; font-size: 15px; letter-spacing: .02em; text-transform: none; font-weight: 600; }
.logo svg { width: 22px; height: 22px; fill: none; stroke: var(--acid); stroke-width: 2; animation: spin 14s linear infinite; }
.logo em { font-size: 19px; margin-left: 1px; }
@keyframes spin { to { transform: rotate(360deg); } }
.topbar nav { display: flex; gap: 1.8rem; }
.topbar nav a { text-decoration: none; color: var(--muted); transition: color .2s; }
.topbar nav a:hover { color: var(--text); }
.topbar nav .nav-cta { color: var(--acid); }
.status { display: flex; align-items: center; gap: .5rem; color: var(--muted); }
.dot { width: 7px; height: 7px; border-radius: 50%; background: var(--acid); box-shadow: 0 0 10px var(--acid); animation: blink 1.6s infinite; }
@keyframes blink { 50% { opacity: .2; } }

/* ---------- hero ---------- */
.hero {
  position: relative;
  min-height: 100vh;
  padding: 9rem clamp(1rem, 6vw, 6rem) 5rem;
  display: flex; flex-direction: column; justify-content: center;
  background:
    linear-gradient(var(--line) 1px, transparent 1px) 0 0 / 64px 64px,
    linear-gradient(90deg, var(--line) 1px, transparent 1px) 0 0 / 64px 64px;
  background-color: var(--bg);
  mask-image: linear-gradient(to bottom, #000 75%, transparent);
}
.coords {
  position: absolute; top: 6rem; right: clamp(1rem, 6vw, 6rem);
  display: flex; flex-direction: column; align-items: flex-end;
  font-size: 11px; color: var(--muted); letter-spacing: .12em;
}
.coords b { color: var(--amber); font-weight: 400; }
.kicker { font-size: 12px; letter-spacing: .14em; color: var(--muted); margin: 0 0 1.5rem; text-transform: uppercase; }
.hero-title {
  margin: 0;
  font-family: var(--serif); font-weight: 400;
  font-size: clamp(3rem, 10vw, 9.5rem);
  line-height: .92; letter-spacing: -.02em;
  color: #f1f3ec;
}
.hero-title .line { display: block; }
.hero-title em { color: var(--acid); }
.hero-sub { max-width: 34rem; margin: 2.5rem 0 0; color: #a9afa6; }
.scramble { color: var(--text); border-bottom: 1px dashed var(--acid); }
.hero-actions { display: flex; flex-wrap: wrap; gap: 1rem; margin-top: 2.5rem; }
.hint { position: absolute; bottom: 2.5rem; left: clamp(1rem, 6vw, 6rem); font-size: 11px; color: var(--muted); letter-spacing: .12em; text-transform: uppercase; animation: blink 3s infinite; }

/* glitch */
.glitch { position: relative; }
.glitch::before,
.glitch::after {
  content: attr(data-text);
  position: absolute; inset: 0;
  opacity: 0; pointer-events: none;
}
.glitch::before { color: var(--acid); animation: glitch-a 6s infinite steps(1); }
.glitch::after { color: var(--red); animation: glitch-b 6s infinite steps(1); }
@keyframes glitch-a {
  0%, 91%, 100% { opacity: 0; transform: none; clip-path: none; }
  92% { opacity: .8; transform: translate(-4px, 1px); clip-path: inset(10% 0 60% 0); }
  94% { opacity: .8; transform: translate(3px, -2px); clip-path: inset(55% 0 15% 0); }
  96% { opacity: 0; }
}
@keyframes glitch-b {
  0%, 92%, 100% { opacity: 0; transform: none; clip-path: none; }
  93% { opacity: .7; transform: translate(4px, 0); clip-path: inset(30% 0 40% 0); }
  95% { opacity: .7; transform: translate(-3px, 2px); clip-path: inset(70% 0 5% 0); }
  97% { opacity: 0; }
}

/* radar */
.radar {
  position: absolute; right: clamp(1rem, 8vw, 8rem); bottom: 14%;
  width: clamp(160px, 22vw, 300px); aspect-ratio: 1;
  border-radius: 50%;
  border: 1px solid #2a3a1a;
  background:
    radial-gradient(circle, transparent 32%, #2a3a1a 32.4%, transparent 33%),
    radial-gradient(circle, transparent 65%, #2a3a1a 65.4%, transparent 66%),
    linear-gradient(transparent 49.8%, #2a3a1a 50%, transparent 50.2%),
    linear-gradient(90deg, transparent 49.8%, #2a3a1a 50%, transparent 50.2%);
  overflow: hidden;
  opacity: .9;
}
.sweep {
  position: absolute; inset: 0; border-radius: 50%;
  background: conic-gradient(from 0deg, rgba(198, 255, 61, .35), transparent 22%);
  animation: spin 4s linear infinite;
}
.blip { position: absolute; width: 6px; height: 6px; border-radius: 50%; background: var(--acid); box-shadow: 0 0 12px var(--acid); animation: blink 2s infinite; }
.b1 { top: 28%; left: 62%; }
.b2 { top: 66%; left: 30%; animation-delay: .7s; }
.b3 { top: 44%; left: 78%; background: var(--red); box-shadow: 0 0 12px var(--red); animation-delay: 1.3s; }

/* ---------- buttons ---------- */
.btn {
  display: inline-flex; align-items: center; gap: .6rem;
  padding: .95rem 1.5rem;
  font: 500 12px/1 var(--mono); letter-spacing: .14em; text-transform: uppercase;
  text-decoration: none; cursor: pointer;
  border: 1px solid var(--line); border-radius: 0;
  background: transparent; color: var(--text);
  transition: background .2s, color .2s, border-color .2s, transform .2s;
}
.btn:hover { transform: translateY(-2px); }
.btn-primary { background: var(--acid); color: var(--bg); border-color: var(--acid); }
.btn-primary:hover { background: #dcff86; }
.btn-ghost:hover { border-color: var(--acid); color: var(--acid); }

/* ---------- redaction ---------- */
.redact {
  position: relative;
  color: transparent;
  background: #000;
  box-shadow: inset 0 0 0 1px #1a1a1a;
  padding: 0 .2em;
  cursor: help;
  transition: color .3s, background .3s;
  outline: none;
}
.redact:hover,
.redact:focus,
.redact.revealed { color: var(--amber); background: rgba(255, 181, 71, .08); }

/* ---------- ticker ---------- */
.ticker { border-block: 1px solid var(--line); overflow: hidden; background: var(--bg-2); }
.ticker-track { display: flex; gap: 2rem; width: max-content; padding: .9rem 0; font-size: 12px; letter-spacing: .14em; color: var(--muted); animation: ticker 45s linear infinite; }
.ticker-track span:nth-child(4n+1) { color: var(--text); }
.ticker i { color: var(--red); font-style: normal; }
@keyframes ticker { to { transform: translateX(-50%); } }

/* ---------- sections ---------- */
.section { position: relative; padding: 8rem clamp(1rem, 6vw, 6rem); }
.section-head { margin-bottom: 4rem; }
.label { display: inline-block; font-size: 11px; letter-spacing: .18em; text-transform: uppercase; color: var(--acid); margin-bottom: 1.2rem; }
.label::before { content: "▸ "; }
.section h2 {
  margin: 0;
  font-family: var(--serif); font-weight: 400;
  font-size: clamp(2.4rem, 6vw, 5rem); line-height: .98; letter-spacing: -.01em;
  color: #f1f3ec;
}
.lede { max-width: 34rem; color: #a9afa6; margin-top: 1.5rem; }

/* dossier */
.dossier-grid { display: grid; grid-template-columns: 1.4fr 1fr; gap: clamp(2rem, 6vw, 6rem); align-items: start; }
.dossier-text p { margin: 0 0 1.4rem; font-size: 17px; max-width: 38rem; }
.dossier-text .aside { font-size: 12px; color: var(--muted); letter-spacing: .06em; }
.stats { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: 1fr 1fr; border-top: 1px solid var(--line); border-left: 1px solid var(--line); }
.stats li { padding: 1.6rem; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.stats b { display: block; font-family: var(--serif); font-weight: 400; font-size: 3rem; line-height: 1; color: #f1f3ec; }
.stats li:nth-child(3) b { color: var(--red); }
.stats span { font-size: 11px; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); }

/* case files */
.case-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); gap: 1px; background: var(--line); border: 1px solid var(--line); }
.case {
  position: relative;
  display: flex; flex-direction: column;
  min-height: 360px; padding: 1.6rem;
  background: var(--bg);
  transition: background .3s;
  outline: none;
}
.case::after {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  border: 1px solid transparent; transition: border-color .3s;
}
.case:hover,
.case:focus { background: var(--bg-2); }
.case:hover::after,
.case:focus::after { border-color: var(--acid); }
.case header, .case footer { display: flex; justify-content: space-between; align-items: center; font-size: 11px; letter-spacing: .12em; color: var(--muted); text-transform: uppercase; }
.case footer { margin-top: auto; padding-top: 1.2rem; border-top: 1px dashed var(--line); }
.case footer b { color: var(--text); font-weight: 400; }
.stamp { border: 1px solid var(--acid); color: var(--acid); padding: .1rem .5rem; transform: rotate(-3deg); }
.stamp.warn { border-color: var(--amber); color: var(--amber); }
.stamp.danger { border-color: var(--red); color: var(--red); }
.case h3 { font-family: var(--serif); font-weight: 400; font-size: 2.2rem; line-height: 1.05; margin: 3rem 0 1rem; color: #f1f3ec; }
.case p { margin: 0; color: #a9afa6; font-size: 14px; }
.case-locked { background: repeating-linear-gradient(-45deg, var(--bg), var(--bg) 12px, #0b0c0e 12px, #0b0c0e 24px); }
.locked-title { letter-spacing: -.05em; color: #222 !important; }
.small { display: block; margin-top: .8rem; font-size: 12px; color: var(--muted); }

/* method */
.steps { list-style: none; margin: 0; padding: 0; counter-reset: s; }
.steps li { display: grid; grid-template-columns: 8rem 1fr; gap: 2rem; padding: 2.2rem 0; border-top: 1px solid var(--line); transition: padding-left .3s; }
.steps li:last-child { border-bottom: 1px solid var(--line); }
.steps li:hover { padding-left: 1rem; }
.steps li:hover .step-n { color: var(--acid); }
.step-n { font-family: var(--serif); font-size: 3.4rem; line-height: 1; color: #2a2f36; transition: color .3s; }
.steps h3 { margin: 0 0 .4rem; font-size: 15px; font-weight: 600; letter-spacing: .04em; text-transform: uppercase; }
.steps p { margin: 0; color: #a9afa6; max-width: 36rem; }

/* terminal */
.terminal-wrap { padding-block: 2rem 8rem; }
.terminal { max-width: 860px; margin: 0 auto; border: 1px solid var(--line); background: #050607; box-shadow: 0 0 0 1px #000, 0 40px 120px -40px rgba(198, 255, 61, .15); }
.term-bar { display: flex; align-items: center; gap: .45rem; padding: .7rem 1rem; border-bottom: 1px solid var(--line); font-size: 11px; color: var(--muted); }
.term-bar span { width: 10px; height: 10px; border-radius: 50%; background: #22262c; }
.term-bar b { margin-left: auto; font-weight: 400; }
.term-body { min-height: 280px; padding: 1.4rem 1.4rem 2rem; font-size: 13px; line-height: 1.9; color: var(--acid); white-space: pre-wrap; }
.term-body .dim { color: var(--muted); }
.term-body .warn { color: var(--amber); }
.term-body .cursor { display: inline-block; width: .6em; height: 1.1em; vertical-align: -.2em; background: var(--acid); animation: blink 1s steps(1) infinite; }

/* intake form */
.intake-form { display: grid; grid-template-columns: 1fr 1fr; gap: 1.6rem 2rem; max-width: 960px; }
.field { display: flex; flex-direction: column; gap: .5rem; }
.field.full { grid-column: 1 / -1; }
.field label { font-size: 11px; letter-spacing: .14em; text-transform: uppercase; color: var(--muted); }
.field label small { text-transform: none; letter-spacing: 0; }
.field input[type="text"],
.field input[type="email"],
.field select,
.field textarea {
  width: 100%;
  padding: .9rem 0;
  font: 400 16px/1.5 var(--mono); color: var(--text);
  background: transparent;
  border: 0; border-bottom: 1px solid #2a2f36; border-radius: 0;
  outline: none;
  transition: border-color .2s;
}
.field select { appearance: none; cursor: pointer; background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8'%3E%3Cpath d='M1 1l5 5 5-5' fill='none' stroke='%236c736c' stroke-width='1.5'/%3E%3C/svg%3E") no-repeat right center; }
.field select option { background: var(--bg-2); }
.field textarea { resize: vertical; }
.field input::placeholder,
.field textarea::placeholder { color: #3a4048; }
.field input:focus,
.field select:focus,
.field textarea:focus { border-color: var(--acid); }
.field.check { flex-direction: row; align-items: flex-start; gap: .8rem; }
.field.check input { accent-color: var(--acid); width: 16px; height: 16px; margin-top: .2rem; }
.field.check label { text-transform: none; letter-spacing: 0; font-size: 13px; color: #a9afa6; }
.btn-submit { align-self: flex-start; padding: 1.1rem 2rem; }
.btn-submit[disabled] { opacity: .6; cursor: wait; }
.form-status { min-height: 1.5em; margin: .6rem 0 0; font-size: 13px; color: var(--acid); }
.form-status.error { color: var(--red); }

/* footer */
.footer { padding: 4rem clamp(1rem, 6vw, 6rem) 2rem; border-top: 1px solid var(--line); overflow: hidden; }
.footer-big { font-family: var(--serif); font-style: italic; font-size: clamp(5rem, 22vw, 20rem); line-height: .8; color: transparent; -webkit-text-stroke: 1px #20252b; letter-spacing: -.03em; user-select: none; }
.footer-row { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 1rem; margin-top: 2rem; font-size: 11px; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); }
.footer-cipher { color: #2e343b; cursor: help; transition: color .3s; }
.footer-cipher:hover { color: var(--acid); }

/* sealed overlay */
.sealed-overlay { position: fixed; inset: 0; z-index: 200; display: grid; place-items: center; padding: 1.5rem; background: rgba(0, 0, 0, .88); backdrop-filter: blur(6px); animation: fade .5s; }
.sealed-overlay[hidden] { display: none; }
.sealed-card { max-width: 520px; padding: 2.5rem; border: 1px solid var(--acid); background: var(--bg); box-shadow: 0 0 80px -10px rgba(198, 255, 61, .3); }
.sealed-card h3 { font-family: var(--serif); font-weight: 400; font-size: 3rem; margin: 0 0 1rem; line-height: 1; }
.sealed-card p { color: #a9afa6; margin: 0 0 2rem; }
@keyframes fade { from { opacity: 0; } }

/* reveal on scroll */
.reveal { opacity: 0; transform: translateY(24px); transition: opacity .9s ease, transform .9s ease; }
.reveal.in { opacity: 1; transform: none; }

/* solo pages (404 / received) */
body.solo { min-height: 100vh; display: grid; place-items: center; }
.solo-main { max-width: 640px; padding: 2rem; }
.solo-main h1 { font-family: var(--serif); font-weight: 400; font-size: clamp(3rem, 9vw, 6rem); line-height: .95; margin: 0 0 1.5rem; color: #f1f3ec; }
.solo-main p:not(.kicker) { color: #a9afa6; margin: 0 0 2.5rem; }

/* ---------- responsive ---------- */
@media (max-width: 860px) {
  .topbar nav a:not(.nav-cta) { display: none; }
  .status { display: none; }
  .dossier-grid { grid-template-columns: 1fr; }
  .intake-form { grid-template-columns: 1fr; }
  .steps li { grid-template-columns: 4rem 1fr; gap: 1rem; }
  .step-n { font-size: 2.2rem; }
  .radar { opacity: .35; right: -40px; }
  .coords { display: none; }
}

@media (hover: none) {
  .flashlight { display: none; }
  .hint { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
  html { scroll-behavior: auto; }
  .reveal { opacity: 1; transform: none; }
}
