/* context-stats site — "terminal noir".
   Palette is lifted straight from the logo set (assets/logo): the #0A0A0A tile,
   #FAFAFA window frame, #A1A1A1 dashed threshold and the #00FF41 sparkline.
   Neon green is a highlight only (text, strokes, borders) — never a fill. */

@font-face {
  font-family: "Bricolage Grotesque";
  src: url("fonts/bricolage-grotesque-latin-wght-normal.woff2") format("woff2");
  font-weight: 200 800;
  font-display: swap;
}
@font-face {
  font-family: "JetBrains Mono";
  src: url("fonts/jetbrains-mono-latin-wght-normal.woff2") format("woff2");
  font-weight: 100 800;
  font-display: swap;
}

:root {
  --bg: #0a0a0a;
  --surface: #111111;
  --surface-2: #161616;
  --line: #262626;
  --line-strong: #3a3a3a;
  --text: #fafafa;
  --muted: #a1a1a1;
  --dim: #8a8a8a;
  --neon: #00ff41;
  --neon-soft: rgba(0, 255, 65, 0.14);
  --amber: #f59e0b;
  --yellow: #facc15;
  --orange: #fb923c;
  --red: #ef4444;
  --info: #60a5fa;

  /* Bricolage carries display + body; JetBrains Mono is reserved for anything
     the user would type or see in a terminal, so mono always means "real". */
  --sans: "Bricolage Grotesque", "Helvetica Neue", Helvetica, Arial, sans-serif;
  --mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;

  --radius: 14px;
  --radius-sm: 9px;
  --gutter: 20px;
  --wrap: 1160px;
  --ease: cubic-bezier(0.2, 0.7, 0.1, 1);
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; scroll-padding-top: 84px; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--sans);
  font-size: 1.0625rem;
  line-height: 1.65;
  font-variation-settings: "wdth" 100;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}
/* Faint 32px grid — the "graph paper" the sparkline is plotted on. */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background-image:
    linear-gradient(to right, rgba(255,255,255,0.025) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(255,255,255,0.025) 1px, transparent 1px);
  background-size: 32px 32px;
  mask-image: radial-gradient(ellipse 90% 60% at 50% 0%, #000 30%, transparent 85%);
  -webkit-mask-image: radial-gradient(ellipse 90% 60% at 50% 0%, #000 30%, transparent 85%);
}

img, svg { display: block; max-width: 100%; }
a { color: inherit; }
p { margin: 0 0 1em; }
h1, h2, h3 { margin: 0; font-weight: 700; letter-spacing: -0.03em; line-height: 1.06; text-wrap: balance; }
code, kbd, pre { font-family: var(--mono); font-size: 0.88em; }
:not(pre) > code {
  padding: 0.12em 0.4em;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--surface);
  color: var(--text);
  white-space: nowrap;
}

.wrap { width: 100%; max-width: var(--wrap); margin: 0 auto; padding: 0 var(--gutter); }
@media (min-width: 768px) { :root { --gutter: 32px; } }

.skip {
  position: absolute; left: 12px; top: -60px; z-index: 100;
  padding: 10px 14px; background: var(--text); color: var(--bg);
  border-radius: var(--radius-sm); font-weight: 600; text-decoration: none;
}
.skip:focus { top: 12px; }

:focus-visible { outline: 2px solid var(--neon); outline-offset: 3px; border-radius: 6px; }

/* ── Gap markers: amber text + dashed rule so a missing fact is impossible to miss ── */
.gap {
  color: var(--amber);
  font-family: var(--mono);
  font-size: 0.86em;
  font-style: normal;
  font-weight: 500;
  border-bottom: 1px dashed var(--amber);
  padding-bottom: 1px;
}

/* ── Navigation ── */
.nav {
  position: sticky; top: 0; z-index: 50;
  background: rgba(10, 10, 10, 0.78);
  backdrop-filter: blur(14px) saturate(140%);
  -webkit-backdrop-filter: blur(14px) saturate(140%);
  border-bottom: 1px solid transparent;
  transition: border-color 0.3s var(--ease);
}
.nav.is-scrolled { border-bottom-color: var(--line); }
.nav .wrap { display: flex; align-items: center; gap: 24px; height: 68px; }
.brand { display: inline-flex; align-items: center; gap: 11px; text-decoration: none; font-weight: 700; letter-spacing: -0.02em; font-size: 1.12rem; }
.brand img { width: 30px; height: 30px; }
.brand b { color: var(--neon); font-weight: 700; }
.nav-links { display: flex; align-items: center; gap: 4px; margin-left: auto; list-style: none; padding: 0; margin-top: 0; margin-bottom: 0; }
.nav-links a {
  display: block; padding: 8px 12px; border-radius: 8px;
  color: var(--muted); text-decoration: none; font-size: 0.95rem; font-weight: 500;
  transition: color 0.2s, background-color 0.2s;
}
.nav-links a:hover { color: var(--text); background: var(--surface-2); }
.nav-links a[aria-current="page"] { color: var(--text); }
.nav-links .gh { display: inline-flex; align-items: center; gap: 8px; color: var(--text); border: 1px solid var(--line); margin-left: 8px; }
.nav-links .gh:hover { border-color: var(--line-strong); }
.nav-links .gh svg { width: 17px; height: 17px; }
.nav-toggle {
  display: none; margin-left: auto; width: 44px; height: 44px;
  align-items: center; justify-content: center;
  background: transparent; border: 1px solid var(--line); border-radius: 10px; color: var(--text); cursor: pointer;
}
.nav-toggle svg { width: 20px; height: 20px; }
/* Main nav landmark wraps the toggle + links; it takes the slot the links used to. */
.nav-main { display: flex; align-items: center; margin-left: auto; }
/* The collapsible menu only exists when JS can open it; without JS the links wrap under the brand. */
@media (max-width: 860px) {
  .js .nav-toggle { display: inline-flex; }
  .js .nav-links {
    display: none; position: absolute; top: 68px; left: 0; right: 0;
    flex-direction: column; align-items: stretch; gap: 2px;
    padding: 12px var(--gutter) 20px; background: var(--bg); border-bottom: 1px solid var(--line);
  }
  .js .nav-links.is-open { display: flex; }
  .nav-links a { padding: 12px; font-size: 1rem; }
  .js .nav-links .gh { margin: 8px 0 0; justify-content: center; }
  html:not(.js) .nav .wrap { height: auto; min-height: 68px; flex-wrap: wrap; gap: 4px 24px; padding-top: 10px; padding-bottom: 10px; }
  html:not(.js) .nav-main, html:not(.js) .nav-links { margin-left: 0; flex-wrap: wrap; }
}

/* ── Buttons: 10px radius echoes the logo tile corners (no pills) ── */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  min-height: 50px; padding: 0 22px;
  border-radius: 10px; border: 1px solid transparent;
  font: 600 1rem/1 var(--sans); letter-spacing: -0.01em;
  text-decoration: none; cursor: pointer;
  transition: transform 0.18s var(--ease), box-shadow 0.25s var(--ease), border-color 0.2s, background-color 0.2s, color 0.2s;
}
.btn svg { width: 18px; height: 18px; flex: none; }
.btn-primary { background: var(--text); color: var(--bg); }
.btn-primary:hover { box-shadow: 0 0 0 1px var(--neon), 0 10px 40px -10px rgba(0, 255, 65, 0.55); transform: translateY(-1px); }
.btn-primary:active { transform: translateY(0); box-shadow: 0 0 0 1px var(--neon); }
.btn-ghost { background: transparent; color: var(--text); border-color: var(--line-strong); }
.btn-ghost:hover { border-color: var(--neon); color: var(--neon); }
.btn-ghost:active { background: var(--surface); }
.btn.is-done { border-color: var(--neon); }
.btn.is-error { border-color: var(--amber); box-shadow: 0 0 0 1px var(--amber); }
.btn[disabled] { opacity: 0.5; cursor: not-allowed; transform: none; box-shadow: none; }

/* ── Sections ── */
.section { padding: 104px 0; border-top: 1px solid var(--line); position: relative; }
.section-head { max-width: 760px; margin-bottom: 56px; }
.section-head h2 { font-size: clamp(2rem, 4.4vw, 3.25rem); }
.section-head p { color: var(--muted); font-size: 1.15rem; margin-top: 18px; margin-bottom: 0; }
@media (max-width: 640px) { .section { padding: 72px 0; } .section-head { margin-bottom: 36px; } }

/* ── Hero ── */
.hero { padding: 88px 0 96px; position: relative; }
.hero h1 { font-size: clamp(2.7rem, 7vw, 5.6rem); font-weight: 700; letter-spacing: -0.045em; line-height: 0.98; max-width: 13ch; }
.hero h1 .hl { color: var(--neon); }
.hero-sub { max-width: 620px; margin: 28px 0 0; color: var(--muted); font-size: clamp(1.1rem, 1.6vw, 1.28rem); line-height: 1.55; }
.hero-cta { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 36px; }
.trust { display: flex; flex-wrap: wrap; gap: 8px 22px; margin: 30px 0 0; padding: 0; list-style: none; color: var(--muted); font-size: 0.95rem; }
.trust li { display: inline-flex; align-items: center; gap: 8px; }
.trust li::before { content: ""; width: 6px; height: 6px; border-radius: 2px; border: 1.5px solid var(--neon); }

.hero-grid { display: grid; gap: 56px; }
@media (min-width: 1040px) {
  .hero-grid { grid-template-columns: minmax(0, 1fr) 380px; align-items: end; }
}
/* The logo mark, scaled up as a sculptural object beside the headline. */
.hero-mark { display: none; position: relative; }
@media (min-width: 1040px) { .hero-mark { display: block; } }
.hero-mark svg { width: 100%; height: auto; filter: drop-shadow(0 30px 80px rgba(0, 255, 65, 0.12)); }

/* ── Context window (the logo frame, at page scale) ── */
.window {
  margin-top: 72px;
  border: 1px solid var(--line-strong);
  border-radius: 22px;
  background: linear-gradient(180deg, var(--surface) 0%, var(--bg) 100%);
  box-shadow: 0 40px 120px -40px rgba(0, 0, 0, 0.9), inset 0 1px 0 rgba(255, 255, 255, 0.04);
  overflow: hidden;
  position: relative;
}
.window-plot { position: relative; height: 210px; border-bottom: 1px solid var(--line); }
.window-plot svg { position: absolute; inset: 0; width: 100%; height: 100%; }
.plot-threshold { stroke: var(--muted); stroke-width: 1.5; stroke-dasharray: 5 7; opacity: 0.45; }
.plot-line { fill: none; stroke: var(--neon); stroke-width: 3; stroke-linecap: round; stroke-linejoin: round; vector-effect: non-scaling-stroke; }
.plot-area { fill: url(#plotFade); }
.plot-dot { fill: var(--neon); }
.plot-dot-ring { fill: none; stroke: var(--neon); stroke-width: 1.5; opacity: 0.5; }

.statusline {
  display: block;
  padding: 22px 26px;
  font-family: var(--mono);
  font-size: 0.92rem;
  line-height: 1.5;
  white-space: nowrap;
  overflow-x: auto;
  color: var(--muted);
  scrollbar-width: thin;
  scrollbar-color: var(--line-strong) transparent;
}
.statusline .s-sep { color: var(--dim); }
.statusline .s-proj { color: var(--text); font-weight: 600; }
.statusline .s-branch { color: #c4b5fd; }
.statusline .s-ctx { color: var(--neon); }
.statusline .s-zone { color: var(--yellow); }
.statusline .s-mi { color: var(--neon); }
.statusline .s-delta { color: var(--muted); }
.statusline .s-cost { color: var(--text); }
.statusline .s-model { color: var(--muted); }
.statusline .s-sess { color: var(--dim); }
.caret { display: inline-block; width: 0.6em; height: 1.1em; margin-left: 4px; vertical-align: -0.18em; background: var(--neon); opacity: 0.85; animation: blink 1.1s steps(1) infinite; }
@keyframes blink { 50% { opacity: 0; } }

/* Zone meter: the six zones as one scale; colors are text/lines only. */
.meter { display: grid; grid-template-columns: 30fr 8fr 22fr 18fr 14fr 8fr; border-top: 1px solid var(--line); }
.meter > span {
  position: relative; padding: 14px 12px 14px; font-size: 0.82rem; font-weight: 600;
  border-top: 2px solid currentColor; border-right: 1px solid var(--line);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.meter > span:last-child { border-right: 0; }
.z-plan { color: var(--neon); }
.z-price { color: var(--amber); }
.z-code { color: var(--yellow); }
.z-dump { color: var(--orange); }
.z-ex { color: var(--red); }
.z-dead { color: var(--muted); }
.meter .is-here { background: linear-gradient(180deg, rgba(250, 204, 21, 0.09), transparent); }
@media (max-width: 640px) {
  .meter { grid-template-columns: repeat(3, 1fr); }
  .meter > span:nth-child(3) { border-right: 0; }
  .meter > span:nth-child(n+4) { border-top-width: 2px; }
  .window-plot { height: 150px; }
  .statusline { padding: 18px; font-size: 0.82rem; }
}

/* ── Problem ── */
.lead { font-size: clamp(1.6rem, 3.3vw, 2.5rem); font-weight: 600; letter-spacing: -0.03em; line-height: 1.15; max-width: 22ch; margin: 0; }
.scenarios { display: grid; gap: 16px; margin-top: 52px; }
@media (min-width: 860px) { .scenarios { grid-template-columns: repeat(3, 1fr); } }
.card {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  padding: 28px;
  position: relative;
  transition: border-color 0.25s var(--ease), transform 0.25s var(--ease);
}
.card:hover { border-color: var(--line-strong); }
.scenario .icon { width: 40px; height: 40px; margin-bottom: 22px; color: var(--muted); }
.scenario p { margin: 0; font-size: 1.05rem; }

/* ── Agitate: editorial two-column ── */
.agitate { display: grid; gap: 40px; }
@media (min-width: 960px) { .agitate { grid-template-columns: 1fr 1.15fr; gap: 72px; align-items: start; } }
.agitate .lead { max-width: 16ch; }
.consequences { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--line); }
.consequences li { display: grid; grid-template-columns: 28px 1fr; gap: 16px; padding: 24px 0; border-bottom: 1px solid var(--line); font-size: 1.08rem; }
.consequences svg { width: 22px; height: 22px; margin-top: 4px; color: var(--amber); }

/* ── Solution: three levels ── */
.levels { display: grid; gap: 16px; }
@media (min-width: 960px) { .levels { grid-template-columns: repeat(3, 1fr); } }
.level { display: flex; flex-direction: column; gap: 14px; padding: 30px; }
.level h3 { font-size: 1.6rem; display: flex; align-items: center; gap: 12px; }
.level h3 svg { width: 26px; height: 26px; color: var(--neon); }
.level p { margin: 0; color: var(--muted); }
.level p strong { color: var(--text); font-weight: 600; }
.level::after {
  content: ""; position: absolute; left: 30px; right: 30px; top: -1px; height: 1px;
  background: linear-gradient(90deg, transparent, var(--neon), transparent); opacity: 0; transition: opacity 0.3s;
}
.level:hover::after { opacity: 0.8; }

.zones { margin-top: 72px; display: grid; gap: 40px; }
@media (min-width: 960px) { .zones { grid-template-columns: 0.9fr 1.1fr; gap: 64px; } }
.zones h3, .mi h3 { font-size: 1.5rem; margin-bottom: 18px; }
.zone-list { list-style: none; margin: 0; padding: 0; }
.zone-list li { display: grid; grid-template-columns: 120px 1fr; gap: 16px; padding: 14px 0; border-bottom: 1px solid var(--line); align-items: baseline; }
.zone-list li:first-child { border-top: 1px solid var(--line); }
.zone-list b { font-weight: 700; display: inline-flex; align-items: center; gap: 10px; }
.zone-list b::before { content: ""; width: 10px; height: 10px; border-radius: 3px; border: 2px solid currentColor; }
.zone-list span { color: var(--muted); }
@media (max-width: 480px) { .zone-list li { grid-template-columns: 1fr; gap: 2px; } }

.mi { display: flex; flex-direction: column; gap: 18px; }
.formula {
  padding: 26px 28px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface);
  font-family: var(--mono); font-size: clamp(1.15rem, 2.4vw, 1.5rem); color: var(--text); overflow-x: auto;
}
.formula .k { color: var(--neon); }
.mi p { color: var(--muted); margin: 0; }
.mi-scale { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; }
.mi-scale div { border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 18px 20px; }
.mi-scale b { display: block; font-family: var(--mono); font-size: 1.9rem; font-weight: 600; letter-spacing: -0.02em; }
.mi-scale span { color: var(--muted); font-size: 0.92rem; }
.diff {
  margin-top: 64px; padding: 30px 32px; border-radius: var(--radius);
  border: 1px solid var(--line); border-left: 2px solid var(--neon);
  display: grid; gap: 18px; align-items: center;
}
.diff p { margin: 0; font-size: 1.15rem; }
.diff svg { width: 34px; height: 34px; color: var(--neon); }
@media (min-width: 720px) { .diff { grid-template-columns: 34px 1fr; gap: 24px; } }

/* ── How it works ── */
.steps { display: grid; gap: 16px; counter-reset: none; }
@media (min-width: 960px) { .steps { grid-template-columns: repeat(3, 1fr); } }
.step { display: flex; flex-direction: column; gap: 18px; padding: 28px; }
.step .icon {
  width: 52px; height: 52px; border-radius: 12px; border: 1px solid var(--line-strong);
  display: grid; place-items: center; color: var(--neon);
}
.step .icon svg { width: 24px; height: 24px; }
.step p { margin: 0; font-size: 1.05rem; }
/* Connector line between steps on desktop — the plot line, flattened. */
@media (min-width: 960px) {
  .step:not(:last-child)::after {
    content: ""; position: absolute; top: 54px; right: -17px; width: 18px; height: 1px; background: var(--neon); opacity: 0.6;
  }
}
.cmd {
  display: flex; align-items: center; gap: 10px; margin-top: auto;
  border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--bg);
  padding: 2px 2px 2px 14px; min-height: 48px;
}
.cmd code { flex: 1; min-width: 0; overflow-x: auto; white-space: nowrap; font-size: 0.88rem; color: var(--text); padding: 6px 0; border: 0; background: none; }
.cmd code::before { content: "$ "; color: var(--dim); }
.copy {
  flex: none; display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-width: 44px; height: 44px; padding: 0 10px;
  border-radius: 7px; border: 1px solid var(--line); background: var(--surface);
  color: var(--muted); font: 500 0.82rem var(--sans); cursor: pointer;
  transition: color 0.2s, border-color 0.2s;
}
.copy svg { width: 15px; height: 15px; }
.copy:hover { color: var(--text); border-color: var(--line-strong); }
.copy.is-done { color: var(--neon); border-color: var(--neon); }
.copy.is-error { color: var(--amber); border-color: var(--amber); }
.steps-cta { margin-top: 40px; display: flex; flex-wrap: wrap; align-items: center; gap: 16px; }
.steps-cta .note { color: var(--muted); font-size: 0.95rem; margin: 0; }

/* ── Social proof ── */
.proof { display: grid; gap: 16px; }
@media (min-width: 960px) { .proof { grid-template-columns: 1fr 1.25fr; } }
.quote { padding: 34px; display: flex; flex-direction: column; justify-content: space-between; gap: 28px; }
.quote blockquote { margin: 0; font-size: 1.35rem; line-height: 1.4; letter-spacing: -0.015em; }
.quote blockquote svg { width: 30px; height: 30px; color: var(--line-strong); margin-bottom: 18px; }
.quote figcaption { color: var(--muted); }
.report { padding: 34px; }
.report h3 { font-size: 1.1rem; font-weight: 600; color: var(--muted); letter-spacing: -0.01em; margin-bottom: 24px; }
.stats { display: grid; grid-template-columns: repeat(2, 1fr); gap: 0; margin: 0; }
.stats div { padding: 18px 0; border-top: 1px solid var(--line); }
.stats div:nth-child(odd) { padding-right: 16px; }
.stats dt { color: var(--muted); font-size: 0.92rem; order: 2; }
.stats dd { margin: 0 0 4px; font-family: var(--mono); font-weight: 600; font-size: clamp(1.4rem, 3vw, 2rem); letter-spacing: -0.03em; }
.stats .wide { grid-column: 1 / -1; }
.stats div { display: flex; flex-direction: column; }
.stats dd { order: 1; }

/* ── FAQ ── */
.faq { max-width: 860px; }
.faq details { border-bottom: 1px solid var(--line); }
.faq details:first-of-type { border-top: 1px solid var(--line); }
.faq summary {
  list-style: none; cursor: pointer; padding: 24px 44px 24px 0; position: relative;
  font-size: 1.2rem; font-weight: 600; letter-spacing: -0.015em;
  transition: color 0.2s;
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary:hover { color: var(--neon); }
.faq summary::after {
  content: ""; position: absolute; right: 6px; top: 50%; width: 12px; height: 12px; margin-top: -8px;
  border-right: 2px solid var(--muted); border-bottom: 2px solid var(--muted);
  transform: rotate(45deg); transition: transform 0.25s var(--ease);
}
.faq details[open] summary::after { transform: rotate(-135deg); margin-top: -2px; border-color: var(--neon); }
.faq details p { margin: 0 0 26px; color: var(--muted); max-width: 70ch; }

/* ── Final CTA ── */
.final { text-align: center; padding: 120px 0; }
.final h2 { font-size: clamp(2.3rem, 5.6vw, 4.4rem); max-width: 16ch; margin: 0 auto; letter-spacing: -0.04em; }
.final p { color: var(--muted); font-size: 1.2rem; margin: 22px auto 0; }
.final .hero-cta { justify-content: center; }
.final-mark { width: 72px; height: 72px; margin: 0 auto 36px; }

/* ── Footer ── */
.footer { border-top: 1px solid var(--line); padding: 40px 0 48px; }
.footer .wrap { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 20px; }
.footer nav ul { display: flex; flex-wrap: wrap; gap: 6px 26px; list-style: none; margin: 0; padding: 0; }
.footer nav a { color: var(--muted); text-decoration: none; font-size: 0.95rem; }
.footer nav a:hover { color: var(--text); text-decoration: underline; text-underline-offset: 4px; }

/* ── Companion pages (privacy / changelog / docs) ── */
.page-head { padding: 80px 0 48px; border-bottom: 1px solid var(--line); }
.page-head h1 { font-size: clamp(2.4rem, 5.6vw, 4rem); letter-spacing: -0.04em; }
.page-head .meta { color: var(--muted); margin: 18px 0 0; }
.back { display: inline-flex; align-items: center; gap: 8px; color: var(--muted); text-decoration: none; font-size: 0.95rem; margin-bottom: 28px; }
.back:hover { color: var(--neon); }
.back svg { width: 16px; height: 16px; }

.doc-layout { display: grid; gap: 48px; padding-top: 56px; padding-bottom: 96px; }
@media (min-width: 1000px) { .doc-layout { grid-template-columns: 220px minmax(0, 1fr); gap: 72px; } }
.toc { position: relative; }
@media (min-width: 1000px) { .toc nav { position: sticky; top: 100px; } }
.toc h2 { font-size: 0.85rem; font-weight: 600; color: var(--dim); letter-spacing: 0; margin-bottom: 12px; }
.toc ul { list-style: none; margin: 0; padding: 0; border-left: 1px solid var(--line); }
.toc a { display: block; padding: 6px 0 6px 16px; margin-left: -1px; border-left: 1px solid transparent; color: var(--muted); text-decoration: none; font-size: 0.95rem; }
.toc a:hover { color: var(--text); border-left-color: var(--neon); }
@media (max-width: 999px) {
  .toc ul { display: flex; flex-wrap: wrap; gap: 8px; border: 0; }
  .toc a { border: 1px solid var(--line); border-radius: 8px; padding: 6px 12px; margin: 0; }
}

.prose { max-width: 760px; }
.prose > section { padding: 0 0 44px; margin-bottom: 44px; border-bottom: 1px solid var(--line); }
.prose > section:last-child { border-bottom: 0; margin-bottom: 0; }
.prose h2 { font-size: 1.65rem; margin-bottom: 16px; }
.prose p, .prose li { color: #d4d4d4; }
.prose ul { padding-left: 1.2em; margin: 0 0 1em; }
.prose li { margin-bottom: 8px; }
.prose li::marker { color: var(--neon); }
.prose a { color: var(--text); text-decoration-color: var(--neon); text-underline-offset: 4px; }
.prose a:hover { color: var(--neon); }
.summary-box { padding: 26px 28px; border: 1px solid var(--line); border-left: 2px solid var(--neon); border-radius: var(--radius); background: var(--surface); margin-bottom: 52px; }
.summary-box p { margin: 0; color: var(--text); font-size: 1.12rem; }
.summary-box b { color: var(--neon); font-weight: 600; }

pre.block {
  margin: 0 0 14px; padding: 18px 20px; border: 1px solid var(--line); border-radius: var(--radius-sm);
  background: var(--surface); overflow-x: auto; line-height: 1.6; color: var(--text);
}
.block-wrap { position: relative; }
.block-wrap .copy { position: absolute; top: 50%; right: 8px; transform: translateY(-50%); }
.block-wrap pre.block { padding-right: 92px; }

.kv { list-style: none; padding: 0 !important; margin: 0; border-top: 1px solid var(--line); }
.kv li { display: grid; grid-template-columns: minmax(170px, 0.8fr) 1.6fr; gap: 6px 22px; padding: 14px 0; margin: 0; border-bottom: 1px solid var(--line); }
.kv li > :first-child { color: var(--text); }
@media (max-width: 600px) { .kv li { grid-template-columns: 1fr; } }

/* Changelog */
.release { display: grid; gap: 22px; padding: 0 0 48px; margin-bottom: 48px; border-bottom: 1px solid var(--line); }
@media (min-width: 860px) { .release { grid-template-columns: 200px 1fr; gap: 48px; } }
.release:last-of-type { border-bottom: 0; }
.release-id h2 { font-family: var(--mono); font-size: 1.9rem; letter-spacing: -0.03em; }
.release-id time { color: var(--muted); font-size: 0.95rem; }
@media (min-width: 860px) { .release-id { position: sticky; top: 100px; align-self: start; } }
.group h3 { font-size: 1rem; font-weight: 600; letter-spacing: -0.005em; display: inline-flex; align-items: center; gap: 8px; margin-bottom: 10px; }
.group h3::before { content: ""; width: 8px; height: 8px; border-radius: 2px; border: 2px solid currentColor; }
.group + .group { margin-top: 24px; }
.g-new { color: var(--neon); }
.g-improved { color: var(--info); }
.g-fixed { color: var(--muted); }
.g-action { color: var(--amber); }
.group ul { margin: 0; padding-left: 1.1em; }
.group li { color: #d4d4d4; margin-bottom: 8px; }
.group li::marker { color: var(--line-strong); }
.older { padding: 28px; border: 1px dashed var(--line-strong); border-radius: var(--radius); }
.older p { margin: 0; color: var(--muted); }

/* ── Reveal on scroll (only when JS runs; content is visible without it) ── */
.js .reveal { opacity: 0; transform: translateY(18px); transition: opacity 0.7s var(--ease), transform 0.7s var(--ease); }
.js .reveal.is-in { opacity: 1; transform: none; }
.js .reveal[data-d="1"] { transition-delay: 0.08s; }
.js .reveal[data-d="2"] { transition-delay: 0.16s; }
.js .reveal[data-d="3"] { transition-delay: 0.24s; }

/* Hero load sequence: staggered rise, then the sparkline draws itself. */
.rise { animation: rise 0.9s var(--ease) both; }
.rise[data-d="1"] { animation-delay: 0.08s; }
.rise[data-d="2"] { animation-delay: 0.18s; }
.rise[data-d="3"] { animation-delay: 0.28s; }
.rise[data-d="4"] { animation-delay: 0.38s; }
.rise[data-d="5"] { animation-delay: 0.5s; }
@keyframes rise { from { opacity: 0; transform: translateY(16px); } to { opacity: 1; transform: none; } }
.draw { stroke-dasharray: 1; stroke-dashoffset: 1; animation: draw 2.2s 0.5s var(--ease) forwards; }
@keyframes draw { to { stroke-dashoffset: 0; } }
.pop { opacity: 0; animation: pop 0.5s 2.4s var(--ease) forwards; transform-box: fill-box; transform-origin: center; }
@keyframes pop { from { opacity: 0; transform: scale(0.4); } to { opacity: 1; transform: none; } }
.pulse { transform-box: fill-box; transform-origin: center; animation: pulse 2.4s 2.9s ease-out infinite; opacity: 0; }
@keyframes pulse { 0% { opacity: 0.7; transform: scale(1); } 100% { opacity: 0; transform: scale(3.2); } }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: 0.001ms !important; animation-delay: 0s !important; animation-iteration-count: 1 !important; transition-duration: 0.001ms !important; }
  .draw { stroke-dashoffset: 0; }
  .pop { opacity: 1; }
  .pulse, .caret { display: none; }
  .js .reveal { opacity: 1; transform: none; }
}

/* Utilities and hero details */
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }
.window { margin-left: 0; margin-right: 0; margin-bottom: 0; }
.quote { margin: 0; }
.plot-marker {
  position: absolute; left: 68%; top: 37%; width: 12px; height: 12px; margin: -6px 0 0 -6px;
  border-radius: 50%; box-shadow: 0 0 0 2px var(--neon), 0 0 24px 2px rgba(0, 255, 65, 0.45);
}
.releases { padding-top: 56px; padding-bottom: 96px; }
/* Grid children must be allowed to shrink below their content (long commands scroll inside). */
.kv li > *, .hero-grid > *, .scenarios > *, .agitate > *, .levels > *, .zones > *, .steps > *, .proof > *, .doc-layout > *, .release > * { min-width: 0; }
/* Step commands: icon-only copy button so the full command stays visible in a 1/3-width card. */
.cmd .copy { width: 44px; padding: 0; justify-content: center; }
.cmd .copy [data-label] { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; }
.cmd code { font-size: 0.85rem; }
/* In the 3-column steps a card is too narrow for "context-stats doctor --fix": wrap instead of clipping. */
@media (min-width: 960px) {
  .cmd { gap: 6px; }
  .cmd code { white-space: normal; overflow-wrap: anywhere; }
}
@media (max-width: 480px) {
  .step { padding: 22px; }
  .cmd { padding-left: 12px; gap: 6px; }
  .cmd code { font-size: 0.8rem; }
}
.block-wrap { margin-bottom: 14px; }
.block-wrap pre.block { margin: 0; }
.kv code { white-space: normal; overflow-wrap: anywhere; }
