:root {
  --ink: #0b0d10;
  --panel: #12161b;
  --panel-2: #181e25;
  --line: #29323c;
  --paper: #f1eadc;
  --muted: #a9b2bc;
  --acid: #d8ff3e;
  --orange: #ff6b35;
  --cyan: #4de7ff;
  --red: #ff4f64;
  --max: 1180px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  color: var(--paper);
  background:
    radial-gradient(circle at 15% -10%, rgba(77,231,255,.1), transparent 28rem),
    radial-gradient(circle at 90% 10%, rgba(216,255,62,.08), transparent 25rem),
    var(--ink);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  line-height: 1.65;
}
body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  opacity: .18;
  z-index: 20;
  background: repeating-linear-gradient(0deg, transparent 0 3px, rgba(255,255,255,.025) 4px);
}
a { color: inherit; }
img { max-width: 100%; }
button, input { font: inherit; }

.grave-header {
  position: sticky;
  top: 0;
  z-index: 30;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 14px max(20px, calc((100vw - var(--max))/2));
  border-bottom: 1px solid var(--line);
  background: rgba(11,13,16,.9);
  backdrop-filter: blur(18px);
}
.grave-brand {
  display: flex;
  align-items: center;
  gap: 11px;
  text-decoration: none;
  font-weight: 900;
  letter-spacing: -.04em;
  font-size: 1.2rem;
}
.grave-brand-mark {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border: 1px solid var(--acid);
  color: var(--acid);
  border-radius: 5px 5px 16px 16px;
  box-shadow: inset 0 -8px 18px rgba(216,255,62,.08);
}
.grave-brand small {
  display: block;
  color: var(--muted);
  font-size: .54rem;
  letter-spacing: .14em;
  text-transform: uppercase;
}
.grave-nav { display: flex; align-items: center; gap: 22px; }
.grave-nav a {
  color: var(--muted);
  text-decoration: none;
  font-size: .88rem;
  font-weight: 750;
}
.grave-nav a:hover, .grave-nav a[aria-current="page"] { color: var(--acid); }
.nav-time {
  padding: 8px 12px;
  border: 1px solid var(--line);
  border-radius: 999px;
}

.grave-main, .dossier-main {
  width: min(var(--max), calc(100% - 40px));
  margin: 0 auto;
}
.grave-hero {
  min-height: min(760px, calc(100vh - 68px));
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(300px, .65fr);
  gap: clamp(28px, 6vw, 80px);
  align-items: center;
  padding: 72px 0 60px;
}
.kicker, .dossier-kicker {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0 0 18px;
  color: var(--acid);
  font: 800 .73rem/1.3 ui-monospace, SFMono-Regular, Consolas, monospace;
  letter-spacing: .13em;
  text-transform: uppercase;
}
.kicker::before, .dossier-kicker::before {
  content: "";
  width: 30px;
  height: 2px;
  background: currentColor;
}
.grave-hero h1, .dossier-hero h1 {
  max-width: 950px;
  margin: 0;
  font-size: clamp(3.3rem, 8.4vw, 7.6rem);
  line-height: .86;
  letter-spacing: -.075em;
  text-transform: uppercase;
}
.grave-hero h1 span {
  display: block;
  color: transparent;
  -webkit-text-stroke: 1.4px var(--paper);
}
.hero-deck {
  max-width: 720px;
  margin: 28px 0 0;
  color: #c4cbd2;
  font-size: clamp(1.02rem, 2vw, 1.28rem);
}
.hero-actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 30px; }
.btn-acid, .btn-ghost {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 46px;
  padding: 0 18px;
  border: 1px solid var(--acid);
  border-radius: 4px;
  text-decoration: none;
  font-weight: 850;
  cursor: pointer;
}
.btn-acid { color: var(--ink); background: var(--acid); }
.btn-acid:hover { transform: translateY(-2px); box-shadow: 0 8px 28px rgba(216,255,62,.18); }
.btn-ghost { color: var(--paper); background: transparent; border-color: var(--line); }
.btn-ghost:hover { border-color: var(--paper); }

.terminal-card {
  position: relative;
  overflow: hidden;
  min-height: 370px;
  padding: 22px;
  border: 1px solid #34404a;
  border-radius: 8px;
  background: #080b0e;
  box-shadow: 20px 20px 0 rgba(255,107,53,.08);
  font-family: ui-monospace, SFMono-Regular, Consolas, monospace;
}
.terminal-card::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: linear-gradient(transparent 50%, rgba(0,0,0,.2) 50%);
  background-size: 100% 4px;
}
.terminal-top { display: flex; align-items: center; gap: 7px; color: #77818a; font-size: .72rem; }
.terminal-dot { width: 9px; height: 9px; border-radius: 50%; background: var(--red); }
.terminal-dot:nth-child(2) { background: #ffbd3e; }
.terminal-dot:nth-child(3) { background: var(--acid); }
.terminal-log { margin-top: 28px; color: #a9ffb3; font-size: .83rem; }
.terminal-log p { margin: 0 0 11px; }
.terminal-log span { color: #6d7b86; }
.terminal-verdict {
  position: absolute;
  right: 20px;
  bottom: 20px;
  z-index: 2;
  transform: rotate(-5deg);
  padding: 7px 12px;
  color: var(--red);
  border: 3px solid var(--red);
  font-weight: 900;
  font-size: 1.15rem;
  text-transform: uppercase;
}

.section-head {
  display: grid;
  grid-template-columns: 1fr minmax(240px, 440px);
  gap: 30px;
  align-items: end;
  margin: 80px 0 26px;
}
.section-head h2 { margin: 0; font-size: clamp(2.1rem, 5vw, 4.7rem); line-height: .95; letter-spacing: -.055em; }
.section-head p { margin: 0; color: var(--muted); }
.case-grid { display: grid; grid-template-columns: repeat(12, 1fr); gap: 16px; }
.case-card {
  grid-column: span 6;
  position: relative;
  min-height: 330px;
  display: flex;
  flex-direction: column;
  padding: 26px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: linear-gradient(145deg, var(--panel), #0d1014);
  text-decoration: none;
  transition: .25s ease;
}
.case-card:first-child { grid-column: span 8; }
.case-card:nth-child(2) { grid-column: span 4; }
.case-card:hover { transform: translateY(-5px); border-color: #53616e; }
.case-number {
  position: absolute;
  right: 14px;
  top: -25px;
  color: rgba(255,255,255,.035);
  font-size: 9rem;
  font-weight: 950;
  line-height: 1;
}
.case-meta { display: flex; flex-wrap: wrap; gap: 8px; position: relative; }
.tag {
  display: inline-flex;
  padding: 5px 8px;
  color: var(--cyan);
  background: rgba(77,231,255,.08);
  border: 1px solid rgba(77,231,255,.24);
  border-radius: 3px;
  font: 800 .68rem/1.2 ui-monospace, SFMono-Regular, Consolas, monospace;
  text-transform: uppercase;
}
.tag.dead { color: var(--red); border-color: rgba(255,79,100,.3); background: rgba(255,79,100,.08); }
.tag.alive { color: var(--acid); border-color: rgba(216,255,62,.28); background: rgba(216,255,62,.07); }
.case-card h3 { position: relative; max-width: 660px; margin: 42px 0 10px; font-size: clamp(1.65rem, 3.2vw, 2.8rem); line-height: .98; letter-spacing: -.045em; }
.case-card p { max-width: 650px; margin: 0; color: var(--muted); }
.case-link { margin-top: auto; padding-top: 30px; color: var(--acid); font-weight: 850; }

.method-strip {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1px;
  margin: 80px 0 0;
  border: 1px solid var(--line);
  background: var(--line);
}
.method-strip article { padding: 24px; background: var(--panel); }
.method-strip b { color: var(--acid); font: 800 .7rem ui-monospace, SFMono-Regular, Consolas, monospace; }
.method-strip h3 { margin: 12px 0 7px; font-size: 1.05rem; }
.method-strip p { margin: 0; color: var(--muted); font-size: .88rem; }
.community-radar {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 34px;
  align-items: center;
  margin: 80px 0;
  padding: 40px;
  color: var(--ink);
  border-radius: 8px;
  background: var(--acid);
}
.community-radar h2 { margin: 0 0 12px; font-size: clamp(2rem, 4vw, 4rem); line-height: .95; letter-spacing: -.055em; }
.community-radar p { margin: 0; max-width: 580px; }
.memory-form { display: flex; gap: 8px; }
.memory-form input {
  min-width: 0;
  flex: 1;
  padding: 13px 15px;
  color: var(--paper);
  background: var(--ink);
  border: 0;
  border-radius: 4px;
}
.memory-form button {
  padding: 13px 17px;
  color: var(--paper);
  background: var(--orange);
  border: 0;
  border-radius: 4px;
  font-weight: 850;
  cursor: pointer;
}
.memory-note { display: block; margin-top: 8px; font-size: .78rem; }

.grave-footer {
  width: min(var(--max), calc(100% - 40px));
  margin: 0 auto;
  padding: 30px 0 90px;
  border-top: 1px solid var(--line);
}
.grave-footer-main { display: grid; grid-template-columns: 1fr 2fr; gap: 40px; }
.grave-footer p { max-width: 360px; color: var(--muted); }
.grave-footer nav { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
.grave-footer nav div { display: flex; flex-direction: column; gap: 8px; }
.grave-footer nav strong { color: var(--acid); font-size: .75rem; text-transform: uppercase; }
.grave-footer nav a { color: var(--muted); text-decoration: none; font-size: .87rem; }
.grave-footer nav a:hover { color: var(--paper); }

/* Dossier pages */
.breadcrumbs { display: flex; flex-wrap: wrap; gap: 8px; padding-top: 28px; color: var(--muted); font-size: .82rem; }
.breadcrumbs a { text-decoration: none; }
.dossier-hero { padding: 66px 0 34px; }
.dossier-hero h1 { max-width: 1060px; font-size: clamp(2.8rem, 7vw, 6.5rem); }
.dossier-deck { max-width: 830px; color: #c4cbd2; font-size: clamp(1.08rem, 2vw, 1.35rem); }
.dossier-byline { display: flex; flex-wrap: wrap; gap: 10px 24px; color: var(--muted); font-size: .82rem; }
.obituary {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  margin: 24px 0 58px;
  border: 1px solid var(--line);
  background: var(--line);
  gap: 1px;
}
.obituary article { min-width: 0; padding: 19px; background: var(--panel); }
.obituary small { display: block; color: var(--muted); font: 750 .65rem ui-monospace, SFMono-Regular, Consolas, monospace; text-transform: uppercase; }
.obituary strong { display: block; margin-top: 8px; font-size: 1.05rem; line-height: 1.25; }
.dossier-layout { display: grid; grid-template-columns: minmax(0, 760px) minmax(220px, 1fr); gap: 60px; align-items: start; }
.article-body { min-width: 0; }
.article-body h2 { margin: 64px 0 18px; font-size: clamp(1.85rem, 4vw, 3.3rem); line-height: 1; letter-spacing: -.045em; }
.article-body h2:first-child { margin-top: 0; }
.article-body h3 { margin: 36px 0 10px; color: var(--acid); font-size: 1.2rem; }
.article-body p, .article-body li { color: #ccd2d7; }
.article-body strong { color: var(--paper); }
.article-body a { color: var(--cyan); }
.article-body blockquote {
  margin: 30px 0;
  padding: 6px 0 6px 24px;
  color: var(--paper);
  border-left: 4px solid var(--orange);
  font-size: 1.18rem;
}
.evidence-box, .inference-box, .code-evidence {
  margin: 28px 0;
  padding: 20px;
  border: 1px solid var(--line);
  border-left: 4px solid var(--cyan);
  border-radius: 4px;
  background: var(--panel);
}
.inference-box { border-left-color: var(--orange); }
.evidence-box > strong, .inference-box > strong { display: block; margin-bottom: 7px; font: 850 .72rem ui-monospace, SFMono-Regular, Consolas, monospace; letter-spacing: .08em; text-transform: uppercase; }
.code-evidence { overflow: auto; border-left-color: var(--acid); background: #070a0d; }
.code-evidence code { color: #a9ffb3; font: .78rem/1.7 ui-monospace, SFMono-Regular, Consolas, monospace; white-space: pre; }
.postmortem-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; margin: 24px 0; }
.postmortem-grid article { padding: 18px; border: 1px solid var(--line); background: var(--panel); }
.postmortem-grid b { color: var(--orange); font-family: ui-monospace, SFMono-Regular, Consolas, monospace; }
.postmortem-grid h3 { margin: 9px 0 5px; color: var(--paper); }
.postmortem-grid p { margin: 0; font-size: .9rem; }
.source-list { padding-left: 20px; }
.source-list li { margin-bottom: 9px; }
.community-hook {
  margin: 60px 0;
  padding: 28px;
  color: var(--ink);
  background: var(--acid);
  border-radius: 6px;
}
.community-hook h2 { margin: 0 0 8px; color: var(--ink); }
.community-hook p { color: var(--ink); }
.vote-row { display: flex; flex-wrap: wrap; gap: 8px; }
.vote-button {
  padding: 10px 12px;
  color: var(--paper);
  background: var(--ink);
  border: 1px solid var(--ink);
  border-radius: 3px;
  cursor: pointer;
  font-weight: 800;
}
.vote-button:hover, .vote-button.is-selected { color: var(--ink); background: var(--paper); }
.vote-result { min-height: 1.5em; margin: 12px 0 0; font-size: .85rem; font-weight: 800; }
.article-aside { position: sticky; top: 92px; }
.toc-card, .archive-card {
  margin-bottom: 14px;
  padding: 18px;
  border: 1px solid var(--line);
  background: var(--panel);
}
.toc-card strong, .archive-card strong { display: block; margin-bottom: 10px; color: var(--acid); font: 850 .7rem ui-monospace, SFMono-Regular, Consolas, monospace; text-transform: uppercase; }
.toc-card a { display: block; padding: 7px 0; color: var(--muted); text-decoration: none; font-size: .84rem; border-bottom: 1px solid rgba(255,255,255,.05); }
.toc-card a:hover { color: var(--paper); }
.archive-card p { margin: 0 0 12px; color: var(--muted); font-size: .84rem; }
.archive-card a { color: var(--cyan); font-size: .84rem; }
.case-index-hero { padding: 70px 0 30px; }
.case-index-hero h1 { margin: 0; font-size: clamp(3.1rem, 8vw, 7rem); line-height: .9; letter-spacing: -.07em; text-transform: uppercase; }
.case-index-hero p { max-width: 720px; color: var(--muted); font-size: 1.15rem; }
.filter-row { display: flex; flex-wrap: wrap; gap: 8px; margin: 24px 0; }
.filter-button { padding: 8px 11px; color: var(--muted); border: 1px solid var(--line); background: transparent; border-radius: 999px; cursor: pointer; }
.filter-button.is-active { color: var(--ink); background: var(--acid); border-color: var(--acid); }
.case-card[hidden] { display: none; }
.method-page { max-width: 820px; padding: 60px 0 100px; }
.method-page h1 { font-size: clamp(2.7rem, 6vw, 5rem); line-height: .95; letter-spacing: -.055em; }
.method-page h2 { margin-top: 50px; font-size: 2rem; }
.method-page p, .method-page li { color: #c9d0d6; }

@media (max-width: 900px) {
  .grave-nav a:not(.nav-time) { display: none; }
  .grave-hero { min-height: auto; grid-template-columns: 1fr; padding-top: 54px; }
  .terminal-card { min-height: 290px; }
  .case-card, .case-card:first-child, .case-card:nth-child(2) { grid-column: span 12; }
  .method-strip { grid-template-columns: repeat(2, 1fr); }
  .community-radar { grid-template-columns: 1fr; }
  .dossier-layout { grid-template-columns: 1fr; gap: 20px; }
  .article-aside { position: static; order: -1; display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
  .toc-card, .archive-card { margin: 0; }
  .obituary { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 600px) {
  .grave-header { padding: 10px 14px; }
  .grave-main, .dossier-main, .grave-footer { width: min(100% - 28px, var(--max)); }
  .grave-brand small { display: none; }
  .grave-hero { padding: 46px 0 35px; }
  .grave-hero h1 { font-size: clamp(3rem, 16vw, 4.7rem); }
  .hero-deck { margin-top: 21px; }
  .hero-actions a { flex: 1 1 100%; }
  .section-head { grid-template-columns: 1fr; margin-top: 58px; }
  .case-card { min-height: 300px; padding: 21px; }
  .case-card h3 { margin-top: 34px; }
  .method-strip { grid-template-columns: 1fr; }
  .community-radar { margin: 58px -14px; padding: 28px 20px; border-radius: 0; }
  .memory-form { flex-direction: column; }
  .grave-footer-main { grid-template-columns: 1fr; }
  .grave-footer nav { grid-template-columns: 1fr 1fr; }
  .dossier-hero { padding-top: 46px; }
  .dossier-hero h1 { font-size: clamp(2.7rem, 13vw, 4.5rem); }
  .obituary { grid-template-columns: 1fr 1fr; margin-bottom: 40px; }
  .obituary article { padding: 14px; }
  .obituary strong { font-size: .9rem; }
  .postmortem-grid { grid-template-columns: 1fr; }
  .article-aside { grid-template-columns: 1fr; }
  .toc-card { display: none; }
  .article-body h2 { margin-top: 48px; }
  .community-hook { margin-left: -14px; margin-right: -14px; border-radius: 0; }
}

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