:root, html[data-theme="vantablack"] {
  --bg:#000; --bg2:#070707; --panel:#0c0c0c; --ink:#f6f4ef; --muted:#b1aea6;
  --line:#2c2c2c; --accent:#fff; --button:#f4f1ea; --button-ink:#111;
  --ok:#9dface; --warn:#ffd27a; --bad:#ffb0a8; --chip:#141414;
  --glow:transparent; --grid:rgba(255,255,255,.045);
  color-scheme: dark;
}
html[data-theme="light"] {
  --bg:#f4f1ea; --bg2:#fffdf8; --panel:#fff; --ink:#14120f; --muted:#5e584f;
  --line:#ddd4c6; --accent:#111; --button:#16140f; --button-ink:#f7f3ea;
  --ok:#0c6b38; --warn:#8a5a00; --bad:#9d1c1c; --chip:#f7f3ea;
  --glow:transparent; --grid:rgba(20,18,15,.06);
  color-scheme: light;
}
html[data-theme="quantum"] {
  --bg:#07040f; --bg2:#120818; --panel:#140a22; --ink:#fbf7ff; --muted:#c4b6d4;
  --line:#3a2750; --accent:#e2b6ff; --button:#d08cff; --button-ink:#1a0824;
  --ok:#b6f3c8; --warn:#ffd27a; --bad:#ffb4c0; --chip:#1c1030;
  --glow:#6a2a9a55; --grid:rgba(226,182,255,.07);
  color-scheme: dark;
}
* { box-sizing: border-box; }
html { scroll-padding-top: 84px; -webkit-font-smoothing: antialiased; text-rendering: geometricPrecision; }
body {
  margin: 0; color: var(--ink);
  font: 400 17px/1.5 Sora, sans-serif;
  background:
    radial-gradient(900px 420px at 100% -10%, var(--glow), transparent 70%),
    linear-gradient(var(--grid) 1px, transparent 1px),
    linear-gradient(90deg, var(--grid) 1px, transparent 1px),
    var(--bg);
  background-size: auto, 72px 72px, 72px 72px, auto;
  padding-bottom: env(safe-area-inset-bottom);
}
a { color: inherit; }
img { max-width: 100%; }
.top {
  position: sticky; top: 0; z-index: 30;
  display: flex; align-items: center; gap: 18px;
  min-height: 72px;
  padding: 10px max(18px, env(safe-area-inset-right)) 10px max(18px, env(safe-area-inset-left));
  border-bottom: 1px solid var(--line);
  background: color-mix(in srgb, var(--bg) 86%, transparent);
  backdrop-filter: blur(16px);
}
.brand {
  font-family: "Big Shoulders Display", sans-serif;
  font-weight: 800; font-size: 34px; letter-spacing: .02em;
  text-decoration: none; line-height: .8;
}
.brand span { color: var(--accent); }
.nav-toggle {
  display: none; margin-left: auto;
  border: 1px solid var(--line); background: var(--panel); color: var(--ink);
  border-radius: 999px; padding: 10px 14px; min-height: 44px;
  font: 600 13px/1 Sora, sans-serif; letter-spacing: .08em; text-transform: uppercase;
}
.top-panel { display: flex; align-items: center; gap: 22px; margin-left: auto; }
nav { display: flex; gap: 4px; }
nav a {
  text-decoration: none; color: var(--muted);
  padding: 10px 12px; border-radius: 999px; font-size: 14px; font-weight: 500;
}
nav a[aria-current="page"], nav a:hover { color: var(--ink); background: var(--panel); }
.themes { display: flex; gap: 4px; padding: 4px; border: 1px solid var(--line); border-radius: 999px; background: var(--panel); }
.themes button {
  border: 0; background: transparent; color: var(--muted); cursor: pointer;
  font: 600 12px/1 Sora, sans-serif; letter-spacing: .04em;
  padding: 10px 12px; border-radius: 999px; min-height: 36px;
}
.themes button[aria-pressed="true"] { background: var(--button); color: var(--button-ink); }
.hero, .band, .foot-inner { width: min(1680px, calc(100% - clamp(20px, 4vw, 72px))); margin: 0 auto; }
.hero {
  min-height: calc(100svh - 72px);
  display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(280px, .85fr);
  gap: clamp(24px, 4vw, 64px); align-items: end;
  padding: clamp(28px, 5vh, 72px) 0 clamp(36px, 6vh, 72px);
}
.kicker {
  margin: 0 0 14px; color: var(--accent);
  font-family: "Big Shoulders Display", sans-serif;
  font-weight: 700; font-size: 22px; letter-spacing: .16em; text-transform: uppercase;
}
h1, h2, h3, .stat b, .tile b, .verdict strong, .shelf b {
  font-family: "Big Shoulders Display", sans-serif; font-weight: 800;
  letter-spacing: .01em; line-height: .88; margin: 0;
}
h1 { font-size: clamp(64px, 9vw, 128px); max-width: 11ch; }
h2 { font-size: clamp(42px, 5vw, 72px); }
h3 { font-size: clamp(28px, 2vw, 36px); line-height: .95; }
.lede { font-size: clamp(18px, 1.5vw, 22px); color: var(--muted); max-width: 38rem; margin: 18px 0 0; }
.row { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 26px; }
.btn {
  display: inline-flex; align-items: center; justify-content: center; text-decoration: none;
  background: var(--button); color: var(--button-ink); border-radius: 999px;
  padding: 14px 20px; min-height: 48px; font-weight: 600; border: 0;
}
.btn.ghost { background: transparent; color: var(--ink); border: 1px solid var(--line); }
.board {
  display: grid; gap: 12px; align-self: center;
  padding: 16px; border: 1px solid var(--line); border-radius: 28px;
  background: color-mix(in srgb, var(--panel) 88%, transparent);
  box-shadow: 0 30px 80px #0004;
}
.verdict { border-radius: 18px; padding: 18px 18px 16px; background: var(--chip); border: 1px solid var(--line); }
.verdict strong { display: block; font-size: 54px; }
.verdict.allow strong { color: var(--ok); }
.verdict.deny strong { color: var(--bad); }
.verdict code { color: var(--muted); }
.meter { height: 10px; border-radius: 999px; background: var(--line); overflow: hidden; }
.meter span { display: block; height: 100%; width: 86.8%; background: var(--accent); }
.meter-label { display: flex; justify-content: space-between; color: var(--muted); font-size: 13px; margin-bottom: 8px; }
.band { padding: clamp(28px, 5vw, 72px) 0; }
.band-head { display: flex; justify-content: space-between; gap: 24px; align-items: end; margin-bottom: 22px; }
.band-head p { margin: 0; color: var(--muted); max-width: 36rem; }
.stats, .grid, .shelf, .capgrid, .flow { display: grid; gap: 12px; }
.stats { grid-template-columns: repeat(3, 1fr); }
.stat, .tile, .card, .cap, .flow article, .shelf a {
  background: color-mix(in srgb, var(--panel) 92%, transparent);
  border: 1px solid var(--line); border-radius: 22px; padding: 22px;
}
.stat b { font-size: clamp(72px, 8vw, 112px); display: block; }
.stat span, .card p, .tile p, .cap p, .flow p { color: var(--muted); }
.grid.three { grid-template-columns: repeat(3, 1fr); }
.grid.two { grid-template-columns: 1fr 1fr; }
.flow { grid-template-columns: repeat(3, 1fr); counter-reset: step; }
.flow article { position: relative; min-height: 180px; }
.flow article::before {
  counter-increment: step; content: counter(step, decimal-leading-zero);
  font-family: "Big Shoulders Display", sans-serif; font-weight: 800;
  font-size: 28px; color: var(--accent);
}
.shelf { grid-template-columns: repeat(4, 1fr); }
.shelf a { text-decoration: none; display: flex; flex-direction: column; gap: 8px; min-height: 220px; transition: transform .2s ease, border-color .2s ease; }
.shelf a:hover { transform: translateY(-3px); border-color: var(--accent); }
.shelf b { font-size: clamp(56px, 5vw, 84px); }
.shelf .meta { color: var(--muted); font-size: 14px; }
.agents { display: grid; grid-template-columns: 1.4fr .8fr; gap: 12px; }
.agent-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.outside { background: var(--chip); border: 1px dashed var(--line); border-radius: 22px; padding: 22px; }
.outside li { margin: 8px 0; color: var(--muted); }
.capgrid { grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); }
.cap { min-height: 168px; display: flex; flex-direction: column; gap: 8px; }
.cap h3 { font-size: 30px; }
.cap p { margin: 0; font-size: 14.5px; }
.cap[hidden] { display: none; }
.filters { display: flex; flex-wrap: wrap; gap: 8px; margin: 8px 0 18px; }
.filters button[aria-pressed="true"] { background: var(--button); color: var(--button-ink); }
.pill { display: inline-flex; align-items: center; width: fit-content; border-radius: 999px; padding: 4px 9px; font-size: 12px; letter-spacing: .04em; text-transform: uppercase; border: 1px solid var(--line); }
.pill.ok { color: var(--ok); }
.pill.warn { color: var(--warn); }
.pill.bad { color: var(--bad); }
pre, code { font-family: "DM Mono", ui-monospace, monospace; }
pre {
  background: var(--chip); border: 1px solid var(--line); border-radius: 18px;
  padding: 16px 18px; overflow: auto; font-size: 14px; line-height: 1.45;
}
.jump { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 22px; }
.jump a { text-decoration: none; border: 1px solid var(--line); border-radius: 999px; padding: 8px 12px; color: var(--muted); font-size: 14px; }
.jump a:hover { color: var(--ink); }
.foot { border-top: 1px solid var(--line); padding: 28px 0 48px; color: var(--muted); }
.foot-inner { display: flex; justify-content: space-between; gap: 18px; flex-wrap: wrap; }
.reveal { animation: rise .7s ease both; }
.reveal-2 { animation-delay: .08s; }
.reveal-3 { animation-delay: .16s; }
@keyframes rise { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) {
  .reveal, .shelf a { animation: none; transition: none; }
}
@media (max-width: 1100px) {
  .shelf { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 900px) {
  .hero { grid-template-columns: 1fr; min-height: auto; padding-top: 28px; }
  .board { max-width: 720px; }
  h1 { max-width: none; }
}
@media (max-width: 640px) {
  .shelf { grid-template-columns: 1fr; }
  h1 { font-size: clamp(52px, 16vw, 76px); }
}
@media (max-width: 860px) {
  .nav-toggle { display: inline-flex; }
  .top-panel {
    display: none; position: absolute; left: 0; right: 0; top: 72px;
    margin: 0; padding: 12px 16px 18px;
    flex-direction: column; align-items: stretch;
    background: var(--bg); border-bottom: 1px solid var(--line);
  }
  .top.is-open .top-panel { display: flex; }
  nav { flex-direction: column; }
  nav a { padding: 14px 12px; }
  .themes { justify-content: space-between; }
  .themes button { flex: 1; }
  .stats, .grid.three, .grid.two, .flow, .agents, .agent-grid { grid-template-columns: 1fr; }
  .band-head { flex-direction: column; align-items: start; }
  .stat b { font-size: 84px; }
}
@media (min-width: 861px) and (max-width: 1100px) {
  .stats, .flow, .grid.three { grid-template-columns: 1fr 1fr; }
  .stats .stat:last-child, .flow article:last-child { grid-column: 1 / -1; }
}
