/* ==========================================================================
   grokpatrol — landing page
   Terminal-forensic identity. Colors are the CLI's own ANSI semantics:
   aqua = signal, red = act now, amber = exposure, green = clean,
   cyan = paths, dim = provenance. No third-party requests: fonts are local,
   there is no analytics and no CDN — the same promise the tool makes.
   ========================================================================== */

/* ---- Fonts (self-hosted latin subset, OFL) ------------------------------ */
@font-face {
  font-family: 'Schibsted Grotesk';
  font-style: normal;
  font-weight: 400 800;
  font-display: swap;
  src: url('./fonts/schibstedgrotesk.woff2') format('woff2');
}
@font-face {
  font-family: 'JetBrains Mono';
  font-style: normal;
  font-weight: 400 700;
  font-display: swap;
  src: url('./fonts/jetbrainsmono.woff2') format('woff2');
}

/* ---- Tokens ------------------------------------------------------------- */
:root {
  color-scheme: dark;

  /* Surfaces — deep, cool terminal near-black */
  --bg:        oklch(0.155 0.017 245);   /* ~#080d17 */
  --bg-raised: oklch(0.196 0.017 244);   /* terminal window / panels */
  --bg-hi:     oklch(0.245 0.018 244);   /* hover / higher */
  --line:      oklch(0.42 0.02 240 / 0.28);
  --line-soft: oklch(0.42 0.02 240 / 0.16);

  /* Ink */
  --ink:       oklch(0.945 0.008 230);   /* primary */
  --ink-dim:   oklch(0.76 0.012 232);    /* secondary */
  --ink-mute:  oklch(0.60 0.014 235);    /* provenance / dim */

  /* Semantic — from internal/report/human.go ANSI roles */
  --aqua:      oklch(0.86 0.12 197);     /* signal / brand accent */
  --aqua-hot:  oklch(0.92 0.15 196);     /* the scan beam (#00ffff family) */
  --red:       oklch(0.71 0.18 26);      /* act now / compromised */
  --amber:     oklch(0.82 0.135 79);     /* exposure */
  --green:     oklch(0.80 0.15 152);     /* clean */
  --cyan:      oklch(0.82 0.083 205);    /* file paths */

  /* Tinted callout grounds */
  --red-bg:    oklch(0.71 0.18 26 / 0.12);
  --amber-bg:  oklch(0.82 0.135 79 / 0.11);
  --aqua-bg:   oklch(0.86 0.12 197 / 0.10);
  --green-bg:  oklch(0.80 0.15 152 / 0.10);

  /* Wordmark gradient — xterm ramp 23→51 (deep teal → bright aqua) */
  --w0: #0d6b6b;  --w1: #0a8484;  --w2: #12b39e;
  --w3: #1fcfc9;  --w4: #33e6df;  --w5: #00ffff;

  /* Type */
  --sans: 'Schibsted Grotesk', ui-sans-serif, system-ui, -apple-system, 'Segoe UI', sans-serif;
  --mono: 'JetBrains Mono', ui-monospace, 'SF Mono', 'Menlo', 'Consolas', monospace;

  /* Rhythm */
  --measure: 66ch;
  --pad: clamp(1.15rem, 5vw, 2.5rem);
  --gap: clamp(4.5rem, 10vw, 8rem);
  --radius: 12px;
  --radius-sm: 8px;

  /* Motion */
  --e-out: cubic-bezier(0.16, 1, 0.3, 1);       /* ease-out-expo-ish */
  --e-in-out: cubic-bezier(0.65, 0, 0.35, 1);

  /* Z-scale */
  --z-sticky: 100;
  --z-toast: 400;
}

/* ---- Reset / base ------------------------------------------------------- */
*, *::before, *::after { box-sizing: border-box; }
* { margin: 0; }
html { -webkit-text-size-adjust: 100%; }

body {
  background-color: var(--bg);
  /* Scanline texture on the (non-fixed) body background: scrolls with content,
     so it costs nothing per scroll frame. */
  background-image: repeating-linear-gradient(to bottom, rgba(185,212,232,0.013) 0 1px, transparent 1px 3px);
  color: var(--ink);
  font-family: var(--sans);
  font-size: clamp(1rem, 0.96rem + 0.2vw, 1.075rem);
  line-height: 1.6;
  font-feature-settings: 'ss01', 'cv01';
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}

/* The aqua glow is scoped to the hero (see .hero::before) rather than a fixed
   full-viewport layer: a fixed painted layer repaints on every scroll frame and
   can hang or black-frame the compositor. Confined + scrolls away = free. */

a { color: var(--aqua); text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: 3px; }
:focus-visible {
  outline: 2px solid var(--aqua-hot);
  outline-offset: 3px;
  border-radius: 3px;
}
::selection { background: oklch(0.86 0.12 197 / 0.28); color: #fff; }

svg { display: block; }

/* ---- Layout primitives -------------------------------------------------- */
.wrap { width: min(1160px, 100% - 2 * var(--pad)); margin-inline: auto; }
.rule { border: 0; border-top: 1px solid var(--line-soft); }

.eyebrow {
  font-family: var(--mono);
  font-size: 0.775rem;
  font-weight: 500;
  letter-spacing: 0.02em;
  color: var(--ink-mute);
  display: flex;
  align-items: center;
  gap: 0.6rem;
}
.eyebrow .idx { color: var(--aqua); }

h2.sec-title {
  font-size: clamp(1.7rem, 1.2rem + 2.2vw, 2.7rem);
  line-height: 1.08;
  font-weight: 700;
  letter-spacing: -0.02em;
  text-wrap: balance;
  margin-top: 0.7rem;
}
.sec-lede {
  color: var(--ink-dim);
  max-width: var(--measure);
  margin-top: 1rem;
  font-size: 1.06rem;
  text-wrap: pretty;
}
.sec-head { margin-bottom: clamp(2rem, 5vw, 3.25rem); }

section.band { padding-block: var(--gap); }

/* ---- Header / nav ------------------------------------------------------- */
.skip {
  position: absolute; left: 0.75rem; top: -3rem;
  background: var(--bg-raised); color: var(--ink);
  padding: 0.55rem 0.9rem; border-radius: var(--radius-sm);
  border: 1px solid var(--line); z-index: 500;
  transition: top 0.18s var(--e-out);
}
.skip:focus { top: 0.75rem; }

/* ---- Parent-site bar (keeps main-site navigation reachable) ------------- */
.sitebar {
  position: sticky; top: 0; z-index: calc(var(--z-sticky) + 1);
  background: oklch(0.12 0.015 245);
  border-bottom: 1px solid var(--line);
}
.sitebar .wrap {
  display: flex; align-items: center; justify-content: space-between;
  gap: 1rem; min-height: 46px; padding-block: 0.35rem;
}
.sitebar-home {
  display: inline-flex; align-items: center; gap: 0.45rem;
  color: var(--ink);
  font-size: 0.82rem; font-weight: 600; letter-spacing: 0.01em;
  border: 1px solid var(--line); border-radius: 999px;
  padding: 0.25rem 0.7rem 0.25rem 0.5rem;
  transition: border-color 0.2s var(--e-out), background 0.2s var(--e-out);
}
.sitebar-home:hover { color: var(--ink); text-decoration: none; border-color: var(--aqua); background: var(--aqua-bg); }
.sitebar-home .ico { width: 15px; height: 15px; flex: none; }
.sitebar-home img { display: none; }
.sitebar-home .home-label { white-space: nowrap; }
.sitebar-links { display: flex; align-items: center; gap: 1.2rem; }
.sitebar-links a {
  font-size: 0.82rem; font-weight: 500; color: var(--ink-dim); letter-spacing: 0.01em;
}
.sitebar-links a:hover { color: var(--ink); text-decoration: none; }
.sitebar-cta {
  color: var(--ink) !important;
  border: 1px solid var(--line);
  padding: 0.3rem 0.7rem; border-radius: 999px;
  transition: border-color 0.2s var(--e-out), background 0.2s var(--e-out);
}
.sitebar-cta:hover { border-color: var(--aqua); background: var(--aqua-bg); }
@media (max-width: 820px) {
  .sitebar-links .hide-sm { display: none; }
}

.masthead {

  position: sticky; top: 46px; z-index: var(--z-sticky);

  background: oklch(0.16 0.017 245 / 0.94);
  border-bottom: 1px solid transparent;
  transition: border-color 0.3s var(--e-out), background 0.3s var(--e-out);
}
.masthead[data-scrolled="true"] {
  border-bottom-color: var(--line);
  background: oklch(0.145 0.017 245 / 0.9);
}
.masthead .wrap {
  display: flex; align-items: center; justify-content: space-between;
  height: 60px; gap: 1rem;
}
.brand {
  display: inline-flex; align-items: baseline; gap: 0.55rem;
  font-family: var(--mono); font-weight: 700; letter-spacing: -0.01em;
  color: var(--ink); font-size: 1.02rem;
}
.brand:hover { text-decoration: none; }
.brand .mark { color: var(--aqua); }
.brand .prompt { color: var(--aqua); opacity: 0.9; }
.nav-links { display: flex; align-items: center; gap: 1.4rem; }
.nav-links a {
  font-size: 0.9rem; color: var(--ink-dim); font-weight: 500;
}
.nav-links a:hover { color: var(--ink); text-decoration: none; }
.nav-links a[aria-current="true"] { color: var(--aqua); }
.nav-gh {
  display: inline-flex; align-items: center; gap: 0.45rem;
  color: var(--ink) !important;
  border: 1px solid var(--line);
  padding: 0.4rem 0.8rem; border-radius: 999px;
  transition: border-color 0.2s var(--e-out), background 0.2s var(--e-out);
}
.nav-gh:hover { border-color: var(--aqua); background: var(--aqua-bg); }
@media (max-width: 820px) {
  .nav-links .hide-sm { display: none; }
}

/* ---- Buttons ------------------------------------------------------------ */
.btn {
  display: inline-flex; align-items: center; gap: 0.5rem;
  font-family: var(--sans); font-weight: 600; font-size: 0.95rem;
  padding: 0.72rem 1.15rem; border-radius: var(--radius-sm);
  border: 1px solid transparent; cursor: pointer;
  transition: transform 0.15s var(--e-out), background 0.2s var(--e-out),
              border-color 0.2s var(--e-out), box-shadow 0.2s var(--e-out);
  white-space: nowrap;
}
.btn:hover { text-decoration: none; }
.btn:active { transform: translateY(1px); }
.btn-primary {
  background: var(--aqua); color: #04121a;
  box-shadow: 0 0 0 1px oklch(0.86 0.12 197 / 0.4), 0 8px 30px -12px oklch(0.86 0.12 197 / 0.7);
}
.btn-primary:hover { background: var(--aqua-hot); box-shadow: 0 0 0 1px var(--aqua-hot), 0 10px 34px -10px oklch(0.86 0.12 197 / 0.85); }
.btn-ghost {
  background: transparent; color: var(--ink); border-color: var(--line);
}
.btn-ghost:hover { border-color: var(--aqua); background: var(--aqua-bg); }
.btn .ico { width: 1.05em; height: 1.05em; }

/* ---- Terminal component ------------------------------------------------- */
.term {
  background: var(--bg-raised);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: 0 40px 80px -40px oklch(0 0 0 / 0.7), 0 0 0 1px var(--line-soft) inset;
  overflow: hidden;
}
.term-bar {
  display: flex; align-items: center; gap: 0.75rem;
  padding: 0.62rem 0.9rem;
  border-bottom: 1px solid var(--line-soft);
  background: oklch(0.20 0.017 244);
}
.term-dots { display: inline-flex; gap: 0.42rem; }
.term-dots i { width: 11px; height: 11px; border-radius: 50%; display: block; opacity: 0.9; }
.term-dots i:nth-child(1) { background: oklch(0.68 0.16 26); }
.term-dots i:nth-child(2) { background: oklch(0.82 0.13 79); }
.term-dots i:nth-child(3) { background: oklch(0.78 0.15 152); }
.term-title {
  font-family: var(--mono); font-size: 0.78rem; color: var(--ink-mute);
  letter-spacing: 0.01em;
}
.term-cmd {
  margin-left: auto; font-family: var(--mono); font-size: 0.76rem;
  color: var(--ink-dim);
}
.term-body {
  font-family: var(--mono);
  font-size: clamp(0.72rem, 0.5rem + 0.55vw, 0.82rem);
  line-height: 1.62;
  padding: 1.1rem 1.15rem 1.3rem;
  overflow-x: auto;
  tab-size: 2;
}
.term-body pre { font: inherit; white-space: pre; color: var(--ink-dim); }

/* ANSI role classes — one source of truth for report color */
.c-ink   { color: var(--ink); }
.c-dim   { color: var(--ink-mute); }
.c-aqua  { color: var(--aqua); }
.c-red   { color: var(--red); }
.c-amber { color: var(--amber); }
.c-green { color: var(--green); }
.c-cyan  { color: var(--cyan); }
.c-b     { font-weight: 700; }
.term-body .verdict { font-weight: 700; }
.cursor {
  display: inline-block; width: 0.6em; height: 1.05em; translate: 0 0.16em;
  background: var(--aqua); animation: blink 1.05s steps(1) infinite;
}
@keyframes blink { 50% { opacity: 0; } }

/* ---- Hero --------------------------------------------------------------- */
.hero { position: relative; padding-top: clamp(2.5rem, 6vw, 4.5rem); padding-bottom: var(--gap); }
.hero::before {
  content: ""; position: absolute; inset: 0 0 auto 0; height: 760px; z-index: -1; pointer-events: none;
  background:
    radial-gradient(64% 58% at 10% 4%, oklch(0.86 0.12 197 / 0.10), transparent 66%),
    radial-gradient(52% 50% at 100% 0%, oklch(0.72 0.10 250 / 0.07), transparent 60%);
}
.hero-grid {
  display: grid; gap: clamp(2rem, 5vw, 4rem);
  grid-template-columns: minmax(0, 1.02fr) minmax(0, 1fr);
  align-items: center;
}
@media (max-width: 940px) { .hero-grid { grid-template-columns: 1fr; } }

.incident {
  display: inline-flex; align-items: center; gap: 0.6rem;
  font-family: var(--mono); font-size: 0.78rem; font-weight: 500;
  color: var(--amber); letter-spacing: 0.01em;
  padding: 0.35rem 0.7rem 0.35rem 0.55rem;
  border: 1px solid oklch(0.82 0.135 79 / 0.35);
  background: var(--amber-bg); border-radius: 999px;
}
.incident .dot {
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--amber); box-shadow: 0 0 0 0 oklch(0.82 0.135 79 / 0.6);
  animation: ping 2.4s var(--e-out) infinite;
}
@keyframes ping {
  0% { box-shadow: 0 0 0 0 oklch(0.82 0.135 79 / 0.55); }
  70%, 100% { box-shadow: 0 0 0 7px oklch(0.82 0.135 79 / 0); }
}

/* Wordmark */
.wordmark {
  font-family: var(--mono); font-weight: 700;
  font-size: clamp(2.5rem, 0.5rem + 5.4vw, 5.2rem);
  line-height: 0.98; letter-spacing: -0.055em;
  margin-top: 1.35rem;
  display: flex; flex-wrap: nowrap; white-space: nowrap;
}
/* Each glyph is a SOLID step of the teal→aqua ramp — a faithful port of the
   CLI's per-row logoRamp (internal/report/logo.go), not decorative gradient text.
   The ramp itself is the brand; emphasis is meaningful, not ornamental. */
.wordmark .ch { display: inline-block; color: var(--w2); will-change: transform, opacity; }
.wordmark .ch:nth-child(1) { color: #0e9a94; }
.wordmark .ch:nth-child(2) { color: #10a7a0; }
.wordmark .ch:nth-child(3) { color: #13b3ab; }
.wordmark .ch:nth-child(4) { color: #18c0b9; }
.wordmark .ch:nth-child(5) { color: #20ccc6; }
.wordmark .ch:nth-child(6) { color: #2dd8d4; }
.wordmark .ch:nth-child(7) { color: #40e4e1; }
.wordmark .ch:nth-child(8) { color: #59efec; }
.wordmark .ch:nth-child(9) { color: #74f7f5; }
.wordmark .ch:nth-child(10) { color: #00ffff; }

.hero-deck {
  margin-top: 1.4rem; font-size: clamp(1.12rem, 1rem + 0.7vw, 1.4rem);
  line-height: 1.42; color: var(--ink); max-width: 34ch; text-wrap: pretty;
  font-weight: 400;
}
.hero-deck strong { font-weight: 700; color: #fff; }
.hero-deck .em-red { color: var(--red); font-weight: 600; }

.hero-trust {
  margin-top: 1.3rem; font-family: var(--mono); font-size: 0.82rem;
  color: var(--ink-mute); display: flex; flex-wrap: wrap; gap: 0.15rem 0.55rem;
}
.hero-trust b { color: var(--aqua); font-weight: 500; }
.hero-trust .sep { color: var(--line); }

.hero-cta { margin-top: 2rem; display: flex; flex-wrap: wrap; gap: 0.8rem; align-items: center; }
.hero-meta {
  margin-top: 1.4rem; font-family: var(--mono); font-size: 0.76rem;
  color: var(--ink-mute); display: flex; flex-wrap: wrap; gap: 0.4rem 1rem;
}
.hero-meta .k { color: var(--ink-dim); }

/* ---- Copy code block ---------------------------------------------------- */
.copy {
  position: relative; display: flex; align-items: center;
  background: var(--bg-raised); border: 1px solid var(--line);
  border-radius: var(--radius-sm); font-family: var(--mono);
  font-size: 0.86rem; overflow: hidden; min-width: 0;
}
.copy code {
  padding: 0.72rem 0.9rem; white-space: nowrap; overflow-x: auto;
  color: var(--ink); flex: 1 1 0; min-width: 0; scrollbar-width: thin;
}
.copy code .tok-cmd { color: var(--aqua); }
.copy code .tok-pipe, .copy code .tok-dim { color: var(--ink-mute); }
.copy-btn {
  flex-shrink: 0; align-self: stretch; display: inline-flex; align-items: center; gap: 0.4rem;
  padding: 0 0.85rem; border: 0; border-left: 1px solid var(--line);
  background: transparent; color: var(--ink-dim); cursor: pointer;
  font-family: var(--mono); font-size: 0.78rem;
  transition: color 0.18s var(--e-out), background 0.18s var(--e-out);
}
.copy-btn:hover { color: var(--aqua); background: var(--aqua-bg); }
.copy-btn[data-done="true"] { color: var(--green); }
.copy-btn .ico { width: 0.95em; height: 0.95em; }

/* ---- "What left your disk" ---------------------------------------------- */
.leak-grid {
  display: grid; gap: clamp(1.4rem, 3vw, 2.2rem);
  grid-template-columns: minmax(0, 1fr) minmax(0, 0.92fr);
  align-items: start;
}
@media (max-width: 900px) { .leak-grid { grid-template-columns: 1fr; } }

.manifest { display: flex; flex-direction: column; }
.manifest-row {
  display: grid; grid-template-columns: auto 1fr; gap: 0.9rem 1rem;
  padding: 1.15rem 0; border-top: 1px solid var(--line-soft); align-items: start;
}
.manifest-row:first-child { border-top: 0; }
.manifest-row .mk {
  font-family: var(--mono); font-size: 1.05rem; color: var(--aqua);
  padding-top: 0.02rem; line-height: 1.5;
}
.manifest-row.flag .mk { color: var(--amber); }
.manifest-row h3 { font-size: 1.08rem; font-weight: 700; letter-spacing: -0.01em; }
.manifest-row p { color: var(--ink-dim); margin-top: 0.35rem; font-size: 0.97rem; text-wrap: pretty; }
.manifest-row.flag h3 { color: var(--amber); }
.manifest-row .tag {
  display: inline-block; margin-top: 0.6rem; font-family: var(--mono);
  font-size: 0.74rem; color: var(--amber); background: var(--amber-bg);
  border: 1px solid oklch(0.82 0.135 79 / 0.3); padding: 0.2rem 0.5rem; border-radius: 5px;
}

.leak-aside {
  background: var(--bg-raised); border: 1px solid var(--line);
  border-radius: var(--radius); padding: clamp(1.2rem, 3vw, 1.7rem);
}
.leak-aside .kicker { font-family: var(--mono); font-size: 0.76rem; color: var(--aqua); margin-bottom: 0.9rem; }
/* the set-subtraction insight, as an equation, not a chart */
.setmath { font-family: var(--mono); font-size: 0.82rem; line-height: 1.9; }
.setmath .op { color: var(--ink-mute); }
.setmath .a { color: var(--ink); }
.setmath .b { color: var(--ink-dim); }
.setmath .res { color: var(--amber); }
.setmath hr { border: 0; border-top: 1px solid var(--line); margin: 0.6rem 0; }
.leak-aside .note { margin-top: 1rem; color: var(--ink-dim); font-size: 0.92rem; text-wrap: pretty; }
.leak-aside code { color: var(--cyan); font-family: var(--mono); font-size: 0.9em; }

.callout {
  margin-top: 2.6rem; display: flex; gap: 0.9rem; align-items: flex-start;
  padding: 1.1rem 1.25rem; border-radius: var(--radius);
  border: 1px solid oklch(0.71 0.18 26 / 0.3); background: var(--red-bg);
}
.callout .ico { color: var(--red); flex-shrink: 0; width: 1.3rem; height: 1.3rem; margin-top: 0.15rem; }
.callout p { color: var(--ink); font-size: 0.99rem; text-wrap: pretty; }
.callout strong { color: var(--red); }

/* ---- Report walkthrough ------------------------------------------------- */
.report-grid {
  display: grid; gap: clamp(1.5rem, 3vw, 2.5rem);
  grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr);
  align-items: start;
}
@media (max-width: 960px) { .report-grid { grid-template-columns: 1fr; } }
.report-grid .term { position: sticky; top: 80px; }
@media (max-width: 960px) { .report-grid .term { position: static; } }

.annos { display: flex; flex-direction: column; gap: 1.5rem; }
.anno { padding-left: 1.1rem; border-left: 1px solid var(--line); }
.anno h3 {
  font-family: var(--mono); font-size: 0.9rem; font-weight: 700;
  display: flex; align-items: center; gap: 0.55rem; letter-spacing: 0.01em;
}
.anno h3 .swatch { width: 0.7rem; height: 0.7rem; border-radius: 2px; flex-shrink: 0; }
.anno p { color: var(--ink-dim); margin-top: 0.45rem; font-size: 0.95rem; text-wrap: pretty; }
.anno p code { font-family: var(--mono); font-size: 0.88em; color: var(--cyan); }

.modes { display: flex; flex-wrap: wrap; gap: 0.55rem; margin-top: 2.4rem; }
.mode-chip {
  font-family: var(--mono); font-size: 0.8rem; color: var(--ink-dim);
  border: 1px solid var(--line); border-radius: 999px; padding: 0.4rem 0.85rem;
}
.mode-chip b { color: var(--aqua); font-weight: 500; }
.modes-note {
  margin-top: 1rem; font-size: 0.9rem; color: var(--ink-dim);
  max-width: 54ch; text-wrap: pretty;
}
.modes-note b { color: var(--aqua); font-weight: 600; }
.modes-note code {
  font-family: var(--mono); font-size: 0.86em; color: var(--cyan);
  background: oklch(0.82 0.083 205 / 0.1); padding: 0.05em 0.35em; border-radius: 4px;
}

/* ---- Guarantees (spec sheet) -------------------------------------------- */
.spec { border-top: 1px solid var(--line); }
.spec-row {
  display: grid; grid-template-columns: minmax(0, 0.85fr) minmax(0, 1.15fr);
  gap: 0.6rem 2.5rem; padding: 1.4rem 0; border-bottom: 1px solid var(--line);
  align-items: start;
}
@media (max-width: 760px) { .spec-row { grid-template-columns: 1fr; gap: 0.5rem; } }
.spec-claim { display: flex; align-items: baseline; gap: 0.7rem; }
.spec-claim .chk { color: var(--green); flex-shrink: 0; font-family: var(--mono); }
.spec-claim h3 { font-size: 1.1rem; font-weight: 700; letter-spacing: -0.01em; }
.spec-how { color: var(--ink-dim); font-size: 0.96rem; text-wrap: pretty; }
.spec-how code {
  font-family: var(--mono); font-size: 0.86em; color: var(--cyan);
  background: oklch(0.82 0.083 205 / 0.1); padding: 0.05em 0.35em; border-radius: 4px;
}

/* ---- Install ------------------------------------------------------------ */
.install-grid {
  display: grid; gap: 1.15rem;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
}
.inst {
  background: var(--bg-raised); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 1.35rem 1.4rem 1.5rem;
  display: flex; flex-direction: column; gap: 0.85rem;
  min-width: 0; /* let the grid item shrink so its copy-blocks scroll, not overflow */
}
.inst[data-rank="1"] { border-color: oklch(0.86 0.12 197 / 0.45); box-shadow: 0 0 0 1px oklch(0.86 0.12 197 / 0.18); }
.inst-head { display: flex; align-items: center; justify-content: space-between; gap: 0.6rem; }
.inst-head h3 { font-size: 1.05rem; font-weight: 700; }
.inst-rank {
  font-family: var(--mono); font-size: 0.7rem; color: var(--aqua);
  border: 1px solid oklch(0.86 0.12 197 / 0.4); border-radius: 999px; padding: 0.15rem 0.55rem;
}
.inst p { color: var(--ink-dim); font-size: 0.92rem; text-wrap: pretty; }
.inst .copy { font-size: 0.8rem; }
.inst .foot { margin-top: auto; font-family: var(--mono); font-size: 0.76rem; color: var(--ink-mute); }

.verify {
  margin-top: 1.5rem; background: var(--bg-raised); border: 1px solid var(--line);
  border-radius: var(--radius); padding: clamp(1.2rem, 3vw, 1.7rem);
}
.verify .kicker { font-family: var(--mono); font-size: 0.76rem; color: var(--aqua); margin-bottom: 0.75rem; }
.verify h3 { font-size: 1.15rem; font-weight: 700; margin-bottom: 0.5rem; letter-spacing: -0.01em; }
.verify p { color: var(--ink-dim); max-width: var(--measure); font-size: 0.97rem; }
.verify .copy { margin-top: 1rem; font-size: 0.8rem; }
.platnote {
  margin-top: 1.3rem; font-family: var(--mono); font-size: 0.78rem; color: var(--ink-mute);
}
.platnote b { color: var(--ink-dim); font-weight: 500; }

.affected {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1px; background: var(--line); border: 1px solid var(--line);
  border-radius: var(--radius); overflow: hidden; margin-bottom: 2.4rem;
}
.affected div { background: var(--bg-raised); padding: 1.1rem 1.25rem; }
.affected .val { font-family: var(--mono); font-size: 1.35rem; font-weight: 700; color: var(--ink); }
.affected .val.hot { color: var(--red); }
.affected .lbl { color: var(--ink-dim); font-size: 0.9rem; margin-top: 0.25rem; }

/* ---- FAQ ---------------------------------------------------------------- */
.faq { max-width: 860px; }
.faq details {
  border-bottom: 1px solid var(--line);
}
.faq summary {
  list-style: none; cursor: pointer; padding: 1.25rem 2.5rem 1.25rem 0;
  position: relative; font-weight: 600; font-size: 1.08rem; color: var(--ink);
  text-wrap: pretty; transition: color 0.18s var(--e-out);
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary:hover { color: var(--aqua); }
.faq summary::after {
  content: "+"; position: absolute; right: 0.2rem; top: 1.05rem;
  font-family: var(--mono); font-size: 1.4rem; color: var(--ink-mute);
  transition: transform 0.25s var(--e-out), color 0.2s var(--e-out); line-height: 1;
}
.faq details[open] summary { color: var(--aqua); }
.faq details[open] summary::after { transform: rotate(45deg); color: var(--aqua); }
.faq .answer { padding: 0 0 1.4rem; color: var(--ink-dim); max-width: var(--measure); }
.faq .answer p { text-wrap: pretty; }
.faq .answer p + p { margin-top: 0.7rem; }
.faq .answer code {
  font-family: var(--mono); font-size: 0.88em; color: var(--cyan);
  background: oklch(0.82 0.083 205 / 0.1); padding: 0.05em 0.35em; border-radius: 4px;
}
.faq .answer strong { color: var(--ink); }
.faq .answer a {
  color: var(--aqua); text-decoration: underline; text-underline-offset: 0.15em;
  text-decoration-color: oklch(0.86 0.12 197 / 0.35);
  transition: color 0.2s var(--e-out), text-decoration-color 0.2s var(--e-out);
}
.faq .answer a:hover { color: var(--aqua-hot); text-decoration-color: var(--aqua); }

/* ---- Footer ------------------------------------------------------------- */
.foot { padding-block: clamp(3rem, 6vw, 4.5rem) 3rem; border-top: 1px solid var(--line); }
.foot-grid { display: flex; flex-wrap: wrap; gap: 2.5rem 3rem; justify-content: space-between; }
.foot-brand { max-width: 30ch; }
.foot-brand .wm { font-family: var(--mono); font-weight: 700; font-size: 1.05rem; color: var(--ink); }
.foot-brand .wm b { color: var(--aqua); }
.foot-brand p { color: var(--ink-mute); font-size: 0.9rem; margin-top: 0.6rem; }
.foot-cols { display: flex; flex-wrap: wrap; gap: 2.5rem; }
.foot-col h4 {
  font-family: var(--mono); font-size: 0.74rem; text-transform: uppercase;
  letter-spacing: 0.08em; color: var(--ink-mute); margin-bottom: 0.85rem; font-weight: 500;
}
.foot-col a { display: block; color: var(--ink-dim); font-size: 0.92rem; padding: 0.22rem 0; }
.foot-col a:hover { color: var(--aqua); text-decoration: none; }
.foot-col .back-link {
  display: inline-flex; align-items: center; gap: 0.35rem;
  color: var(--ink); font-weight: 600;
}
.foot-col .back-link .ico { width: 1em; height: 1em; flex: none; }
.foot-col .back-link:hover { color: var(--aqua); }
.foot-built-by {
  margin-top: 2.5rem; padding-top: 1.5rem; border-top: 1px solid var(--line-soft);
  display: flex; justify-content: center;
}
.built-by-link {
  display: inline-flex; align-items: center; gap: 0.7rem;
  color: var(--ink-mute); text-decoration: none;
  transition: color 0.2s var(--e-out);
}
.built-by-link:hover { color: var(--aqua); }
.built-by-label {
  font-family: var(--mono); font-size: 0.72rem; text-transform: uppercase;
  letter-spacing: 0.08em; color: var(--ink-mute);
}
.built-by-logo {
  height: 2.25rem; width: auto;
  filter: grayscale(1) brightness(1.45) contrast(0.95);
  transition: filter 0.2s var(--e-out), opacity 0.2s var(--e-out);
  opacity: 0.9;
}
.built-by-link:hover .built-by-logo {
  filter: none; opacity: 1;
}
.foot-bottom {
  margin-top: 1.5rem; padding-top: 1.5rem; border-top: 1px solid var(--line-soft);
  display: flex; flex-wrap: wrap; gap: 0.6rem 1.5rem; justify-content: space-between;
  align-items: center; font-family: var(--mono); font-size: 0.76rem; color: var(--ink-mute);
}
.foot-bottom a {
  color: var(--ink-mute);
  text-decoration: underline;
  text-decoration-color: oklch(0.6 0.014 235 / 0.35);
  text-underline-offset: 0.15em;
  transition: color 0.2s var(--e-out), text-decoration-color 0.2s var(--e-out);
}
.foot-bottom a:hover { color: var(--aqua); text-decoration-color: var(--aqua); }

/* ---- Reveal motion ------------------------------------------------------ */
/* Gated behind .js so content is never invisible when JS is off/failed. */
.js [data-reveal] { opacity: 0; transform: translateY(14px); }
.js [data-reveal].in { opacity: 1; transform: none; transition: opacity 0.7s var(--e-out), transform 0.7s var(--e-out); }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.001ms !important; animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
  }
  [data-reveal] { opacity: 1; transform: none; }
  .cursor { animation: none; }
}

/* ---- Background / why this exists --------------------------------------- */
.story-grid {
  display: grid; gap: clamp(1.4rem, 3vw, 2.2rem);
  grid-template-columns: minmax(0, 1fr) minmax(0, 0.72fr);
  align-items: start;
}
@media (max-width: 900px) { .story-grid { grid-template-columns: 1fr; } }
.sec-head .kicker {
  font-family: var(--mono); font-size: 0.76rem; letter-spacing: 0.08em;
  text-transform: uppercase; color: var(--aqua);
}
.story p {
  color: var(--ink-dim); font-size: 1.02rem; line-height: 1.7;
  max-width: var(--measure); text-wrap: pretty;
}
.story p + p { margin-top: 1.05rem; }
.story strong { color: var(--ink); font-weight: 600; }
.story code { color: var(--cyan); font-family: var(--mono); font-size: 0.9em; }
.story .story-close {
  margin-top: 1.5rem; padding-left: 1rem; color: var(--ink);
  border-left: 2px solid var(--aqua);
}
#background .leak-aside .setmath { margin-top: 1.1rem; }
