/* ============================================================
   Verso site stylesheet
   Mobile-first. Editorial paper aesthetic, light and dark.
   ============================================================ */

:root {
  --paper: #f7f5ef;
  --paper-2: #f0ede4;
  --paper-3: #e8e4d8;
  --ink: #161510;
  --ink-2: #2b2922;
  --ink-3: #57534a;
  --ink-4: #8c887c;
  --rule: #ddd8ca;
  --rule-soft: #e9e5d8;
  --accent-h: 250;
  --accent: oklch(0.51 0.17 var(--accent-h));
  --accent-ink: oklch(0.44 0.17 var(--accent-h));
  --accent-soft: oklch(0.51 0.17 var(--accent-h) / 0.08);
  --accent-line: oklch(0.51 0.17 var(--accent-h) / 0.35);
  --font-sans: 'Geist', ui-sans-serif, system-ui, -apple-system, sans-serif;
  --font-serif: 'Newsreader', Georgia, 'Times New Roman', serif;
  --font-mono: 'JetBrains Mono', ui-monospace, 'SF Mono', Menlo, monospace;
  --radius: 8px;
  --radius-lg: 14px;
  --container: 1200px;
  --pad-x: 20px;
  --nav-h: 60px;
}

html[data-theme="dark"] {
  --paper: #121110;
  --paper-2: #191815;
  --paper-3: #21201c;
  --ink: #f0ede3;
  --ink-2: #d9d6cc;
  --ink-3: #a39f92;
  --ink-4: #6c6961;
  --rule: #2c2a25;
  --rule-soft: #211f1b;
  --accent: oklch(0.76 0.13 var(--accent-h));
  --accent-ink: oklch(0.80 0.12 var(--accent-h));
  --accent-soft: oklch(0.76 0.13 var(--accent-h) / 0.13);
  --accent-line: oklch(0.76 0.13 var(--accent-h) / 0.4);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
html, body { margin: 0; padding: 0; }
body {
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}
a { color: inherit; text-decoration: none; }
button { font-family: inherit; cursor: pointer; }
img { max-width: 100%; height: auto; }
section[id], div[id] { scroll-margin-top: calc(var(--nav-h) + 16px); }

.container {
  max-width: var(--container);
  margin: 0 auto;
  padding-left: var(--pad-x);
  padding-right: var(--pad-x);
}

::selection { background: var(--accent-soft); }

/* Display type: serif italic accent inside headings */
.dh em, h1 em, h2 em {
  font-family: var(--font-serif);
  font-style: italic;
  font-weight: 450;
  color: var(--accent-ink);
  letter-spacing: 0;
}

/* ===== Editorial chrome: folios, rules, section labels ===== */
.folio {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-4);
}

.section-label {
  display: flex;
  align-items: baseline;
  gap: 12px;
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink-3);
  padding-bottom: 16px;
  border-bottom: 1px solid var(--rule);
  margin-bottom: 36px;
}
.section-label .dot {
  width: 6px; height: 6px;
  background: var(--accent);
  border-radius: 50%;
  align-self: center;
  flex-shrink: 0;
}
.section-label .fol { margin-left: auto; color: var(--ink-4); }

section { padding: 72px 0; border-top: 1px solid var(--rule); }
section h2 {
  font-size: clamp(30px, 6.4vw, 52px);
  line-height: 1.06;
  letter-spacing: -0.025em;
  font-weight: 500;
  margin: 0 0 16px;
  max-width: 880px;
  text-wrap: balance;
}
section .lede {
  font-size: 17px;
  color: var(--ink-3);
  max-width: 660px;
  margin: 0 0 40px;
  line-height: 1.6;
}
section .lede strong { color: var(--ink); font-weight: 500; }

/* ===== Buttons ===== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 18px;
  border-radius: var(--radius);
  font-size: 14px;
  font-weight: 500;
  border: 1px solid transparent;
  transition: transform 120ms ease, box-shadow 120ms ease, border-color 120ms ease, background 120ms ease, color 120ms ease;
  white-space: nowrap;
  min-height: 44px;
}
.btn-primary {
  background: var(--ink);
  color: var(--paper);
  border-color: var(--ink);
}
.btn-primary:hover { transform: translateY(-1px); box-shadow: 0 6px 20px -8px var(--ink); }
.btn-secondary {
  background: transparent;
  color: var(--ink);
  border-color: var(--rule);
}
.btn-secondary:hover { border-color: var(--ink-3); background: var(--paper-2); }
.btn-ghost { background: transparent; color: var(--ink-2); border-color: transparent; }
.btn-ghost:hover { color: var(--ink); }
.btn-sm { padding: 8px 14px; min-height: 38px; font-size: 13px; }

/* ===== Nav ===== */
.nav {
  position: sticky;
  top: 0;
  z-index: 50;
  background: color-mix(in oklab, var(--paper) 86%, transparent);
  -webkit-backdrop-filter: saturate(1.2) blur(12px);
  backdrop-filter: saturate(1.2) blur(12px);
  border-bottom: 1px solid var(--rule);
}
.nav-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  height: var(--nav-h);
}
.brand {
  display: flex; align-items: center; gap: 10px;
  font-weight: 600;
  font-size: 16px;
  letter-spacing: -0.01em;
  flex-shrink: 0;
}
.brand-mark { width: 26px; height: 26px; object-fit: contain; flex-shrink: 0; }

.nav-links {
  display: none; /* mobile: hidden until burger opens the panel */
}
.nav-links > a {
  font-size: 15px;
  color: var(--ink-2);
  padding: 10px 0;
}
.nav-links > a:hover { color: var(--ink); }

.nav-cta { display: flex; gap: 6px; align-items: center; }
.nav-gh, .nav-get { display: none; }

.theme-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px; height: 40px;
  border-radius: var(--radius);
  border: 1px solid var(--rule);
  background: transparent;
  color: var(--ink-2);
}
.theme-toggle:hover { border-color: var(--ink-3); color: var(--ink); }
html[data-theme="dark"] .theme-toggle .icon-moon { display: none; }
html[data-theme="dark"] .theme-toggle .icon-sun { display: block; }
.theme-toggle .icon-sun { display: none; }
.theme-toggle .icon-moon { display: block; }

.nav-burger {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 5px;
  width: 44px; height: 44px;
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  background: transparent;
}
.nav-burger span {
  display: block;
  width: 18px; height: 2px;
  background: var(--ink);
  border-radius: 2px;
  transition: transform 160ms ease, opacity 160ms ease;
}
.nav-burger[aria-expanded="true"] span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.nav-burger[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
.nav-burger[aria-expanded="true"] span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* Mobile nav panel */
.nav.open .nav-links {
  display: flex;
  flex-direction: column;
  position: absolute;
  top: var(--nav-h);
  left: 0; right: 0;
  background: var(--paper);
  border-bottom: 1px solid var(--rule);
  padding: 12px var(--pad-x) 20px;
  gap: 2px;
  box-shadow: 0 24px 40px -28px rgba(0,0,0,0.35);
}
.nav.open .nav-links > a {
  border-bottom: 1px solid var(--rule-soft);
  font-size: 16px;
  padding: 14px 4px;
}
.nav-panel-cta {
  display: flex;
  gap: 10px;
  padding-top: 16px;
}
.nav-panel-cta .btn { flex: 1; }

/* ===== Hero ===== */
.hero { padding: 48px 0 56px; }
.hero-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 44px;
  align-items: start;
}
.hero-grid > * { min-width: 0; }

/* Grid and flex children may not shrink below content size by default;
   every layout container here must allow inner horizontal scrolling instead. */
.why-grid > *, .ext-grid > *, .surface-grid > *, .gs-grid > *, .mig-grid > *,
.feat-grid > *, .lang-grid > *, .varstore-flow > *, .arch-layer > *,
.foot-grid > *, .role-cards > *, .ext-side > *, .comm-stats > * { min-width: 0; }
.hero-eyebrow {
  display: inline-flex;
  gap: 10px;
  align-items: center;
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--ink-3);
  padding: 6px 12px;
  border: 1px solid var(--rule);
  border-radius: 999px;
  margin-bottom: 26px;
  background: var(--paper-2);
}
.hero-eyebrow .status {
  width: 6px; height: 6px;
  background: var(--accent);
  border-radius: 50%;
  box-shadow: 0 0 0 3px var(--accent-soft);
}
.hero h1 {
  font-size: clamp(40px, 9.5vw, 84px);
  line-height: 1.0;
  letter-spacing: -0.032em;
  font-weight: 500;
  margin: 0 0 24px;
}
.hero-sub {
  font-size: 17px;
  line-height: 1.6;
  color: var(--ink-3);
  max-width: 540px;
  margin: 0 0 32px;
}
.hero-sub strong { color: var(--ink); font-weight: 500; }
.hero-cta { display: flex; gap: 12px; flex-wrap: wrap; align-items: center; }
.hero-cta .btn { flex: 1 1 auto; }

.hero-meta {
  margin-top: 36px;
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 20px 24px;
  padding-top: 24px;
  border-top: 1px solid var(--rule);
}
.hero-meta-item { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.hero-meta-item .k {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--ink-4);
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.hero-meta-item .v { font-size: 14px; color: var(--ink); font-weight: 500; }

/* ===== Notebook mock ===== */
.nb {
  --nb-bg: #1e1f21;
  --nb-chrome: #28292c;
  --nb-cell: #17181a;
  --nb-rule: #393b3e;
  --nb-edge: #0d0d0e;
  --nb-ink: #e4e5e7;
  --nb-ink-2: #c4c6c9;
  --nb-ink-3: #8c8e92;
  --nb-ink-4: #6a6c70;
  --nb-run: #3fb950;

  background: var(--nb-bg);
  color: var(--nb-ink);
  border: 1px solid var(--nb-edge);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: 0 28px 56px -26px rgba(12,12,14,0.45);
  min-width: 0;
}
html[data-theme="dark"] .nb { box-shadow: 0 28px 60px -22px #000; }

.nb-cmdbar {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 9px 14px;
  background: var(--nb-chrome);
  border-bottom: 1px solid var(--nb-edge);
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--nb-ink-3);
  overflow: hidden;
  white-space: nowrap;
}
.nb-cmd { display: inline-flex; align-items: center; gap: 6px; }
.nb-cmd .i { color: var(--nb-run); }
.nb-cmd-spacer { flex: 1; }
.nb-cmd-file { color: var(--nb-ink-4); }
.nb-cmd.opt { display: none; }

.nb-main { padding: 12px 12px 16px; min-width: 0; }

.nb-kerneltabs {
  display: flex;
  gap: 4px;
  margin-bottom: 10px;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}
.nb-kerneltabs::-webkit-scrollbar { display: none; }
.nb-kerneltabs .kt {
  padding: 6px 12px;
  border-radius: 5px;
  background: transparent;
  border: 1px solid transparent;
  color: var(--nb-ink-3);
  font-family: var(--font-mono);
  font-size: 11px;
  white-space: nowrap;
  flex-shrink: 0;
}
.nb-kerneltabs .kt:hover { color: var(--nb-ink); background: var(--nb-chrome); }
.nb-kerneltabs .kt.active { color: var(--nb-ink); background: var(--nb-chrome); border-color: var(--nb-rule); }

.nb-pane { display: none; }
.nb-pane.active { display: block; }

.nb-cell {
  border: 1px solid var(--nb-rule);
  border-radius: 6px;
  background: var(--nb-cell);
  overflow: hidden;
}
.nb-cell-head {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 7px 10px;
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--nb-ink-3);
  background: #232427;
  border-bottom: 1px solid var(--nb-edge);
  white-space: nowrap;
  overflow: hidden;
}
.nb-cell-head .run-tri { color: var(--nb-run); font-size: 11px; }
.nb-cell-head .kernel-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 2px 8px;
  border: 1px solid var(--nb-rule);
  border-radius: 4px;
  color: var(--nb-ink-2);
  font-size: 10px;
}
.nb-cell-head .kernel-pill .kdot { width: 5px; height: 5px; border-radius: 50%; background: var(--nb-run); }
.nb-cell-head .spacer { flex: 1; }
.nb-cell-head .exec { color: var(--nb-ink-4); }

.nb-code {
  font-family: var(--font-mono);
  font-size: 12px;
  line-height: 1.6;
  padding: 10px 0;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}
.nb-code .nb-line { display: flex; min-width: max-content; padding-right: 16px; white-space: pre; }
.nb-code .ln {
  width: 34px;
  flex-shrink: 0;
  text-align: right;
  padding-right: 12px;
  color: var(--nb-ink-4);
  user-select: none;
  position: sticky;
  left: 0;
  background: var(--nb-cell);
}
.nb-code .ltx { color: var(--nb-ink-2); }
.nb-code .kw { color: #569cd6; }
.nb-code .ty { color: #4ec9b0; }
.nb-code .st { color: #ce9178; }
.nb-code .nm { color: #b5cea8; }
.nb-code .cm { color: #6a9955; font-style: italic; }
.nb-code .fn { color: #dcdcaa; }
.nb-code .mg { color: #c586c0; }

.nb-out {
  background: #fafaf8;
  color: #1b1a16;
  padding: 12px 14px;
  border-top: 1px solid var(--nb-edge);
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}
.nb-text-out { font-family: var(--font-mono); font-size: 12px; white-space: pre; }
.nb-table {
  width: 100%;
  border-collapse: collapse;
  font-family: var(--font-mono);
  font-size: 11.5px;
  color: #2a2824;
  min-width: 360px;
}
.nb-table th, .nb-table td { text-align: left; padding: 6px 12px; border-bottom: 1px solid #e6e2d5; white-space: nowrap; }
.nb-table th { color: #57534a; font-weight: 500; background: #f0eee7; }
.nb-foot {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 6px 12px;
  font-family: var(--font-mono);
  font-size: 10.5px;
  color: var(--nb-ink-4);
  border-top: 1px solid var(--nb-edge);
  background: #1b1c1e;
  white-space: nowrap;
  overflow: hidden;
}
.nb-foot .ok { color: #7cbf6e; }
.nb-foot .spacer { flex: 1; }

.nb-caption {
  margin-top: 14px;
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--ink-4);
  text-align: center;
  letter-spacing: 0.04em;
}

/* ===== Why Verso ===== */
.why-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 40px;
}
.why-quote {
  font-size: clamp(20px, 4.4vw, 26px);
  line-height: 1.4;
  letter-spacing: -0.012em;
  font-weight: 400;
  margin: 0;
}
.why-quote em {
  font-family: var(--font-serif);
  font-style: italic;
  color: var(--accent-ink);
}
.why-note { color: var(--ink-3); font-size: 15px; line-height: 1.65; margin: 18px 0 0; }

.role-cards {
  display: grid;
  grid-template-columns: 1fr;
  gap: 16px;
}
.role-card {
  border: 1px solid var(--rule);
  border-radius: var(--radius-lg);
  background: var(--paper-2);
  padding: 26px 24px;
  min-width: 0;
}
.role-card .tag {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--accent-ink);
  display: block;
  margin-bottom: 12px;
}
.role-card h3 { margin: 0 0 10px; font-size: 21px; font-weight: 500; letter-spacing: -0.015em; }
.role-card p { margin: 0; color: var(--ink-3); font-size: 14.5px; line-height: 1.65; }
.role-card .role-link {
  display: inline-block;
  margin-top: 16px;
  font-size: 14px;
  font-weight: 500;
  color: var(--ink);
  border-bottom: 1px solid var(--accent-line);
  padding-bottom: 1px;
}
.role-card .role-link:hover { color: var(--accent-ink); border-color: var(--accent-ink); }

/* ===== Languages ===== */
.lang-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0;
  border: 1px solid var(--rule);
  border-radius: var(--radius-lg);
  overflow: hidden;
  background: var(--paper-2);
}
.lang-cell {
  padding: 20px;
  border-bottom: 1px solid var(--rule);
  min-width: 0;
}
.lang-cell:last-child { border-bottom: 0; }
.lang-cell .lang-head {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 6px;
}
.lang-cell .lang-glyph {
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 600;
  color: var(--accent-ink);
  background: var(--accent-soft);
  border-radius: 5px;
  padding: 4px 7px;
  letter-spacing: 0.02em;
  flex-shrink: 0;
}
.lang-cell h3 { margin: 0; font-size: 15.5px; font-weight: 500; }
.lang-cell p { margin: 0; color: var(--ink-3); font-size: 13px; line-height: 1.55; }
.lang-cell.more {
  background: var(--paper-3);
}
.lang-cell.more .lang-glyph { background: var(--ink); color: var(--paper); }

.lang-note {
  margin-top: 18px;
  font-size: 13.5px;
  color: var(--ink-4);
}

/* Variable store band */
.varstore {
  margin-top: 48px;
  border: 1px solid var(--rule);
  border-radius: var(--radius-lg);
  overflow: hidden;
}
.varstore-head {
  padding: 24px;
  background: var(--paper-2);
  border-bottom: 1px solid var(--rule);
}
.varstore-head h3 { margin: 0 0 8px; font-size: 22px; font-weight: 500; letter-spacing: -0.015em; }
.varstore-head h3 em { font-family: var(--font-serif); font-style: italic; color: var(--accent-ink); font-weight: 450; }
.varstore-head p { margin: 0; color: var(--ink-3); font-size: 14.5px; max-width: 640px; line-height: 1.6; }
.varstore-flow {
  display: grid;
  grid-template-columns: 1fr;
}
.vf-step {
  padding: 18px 24px;
  border-bottom: 1px solid var(--rule-soft);
  min-width: 0;
}
.vf-step:last-child { border-bottom: 0; }
.vf-step .vf-lang {
  font-family: var(--font-mono);
  font-size: 10.5px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ink-4);
  display: block;
  margin-bottom: 8px;
}
.vf-step code {
  font-family: var(--font-mono);
  font-size: 12.5px;
  color: var(--ink-2);
  display: block;
  overflow-x: auto;
  white-space: pre;
}
.vf-step code .hl { color: var(--accent-ink); font-weight: 500; }

/* ===== Surfaces ===== */
.surface-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 16px;
}
.surface-card {
  border: 1px solid var(--rule);
  border-radius: var(--radius-lg);
  padding: 24px;
  background: var(--paper-2);
  display: flex;
  flex-direction: column;
  gap: 10px;
  min-width: 0;
  transition: border-color 140ms ease;
}
.surface-card:hover { border-color: var(--ink-4); }
.surface-card .s-num {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--ink-4);
  letter-spacing: 0.08em;
}
.surface-card h3 { margin: 0; font-size: 19px; font-weight: 500; letter-spacing: -0.01em; }
.surface-card p { margin: 0; color: var(--ink-3); font-size: 14px; line-height: 1.6; flex: 1; }
.surface-card .s-cmd {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--ink-2);
  background: var(--paper);
  border: 1px solid var(--rule);
  border-radius: 6px;
  padding: 9px 12px;
  overflow-x: auto;
  white-space: nowrap;
}
.surface-embed {
  border: 1px solid var(--rule);
  border-radius: var(--radius-lg);
  margin-top: 16px;
  overflow: hidden;
}
.surface-embed .se-copy { padding: 24px; }
.surface-embed .se-copy h3 { margin: 0 0 8px; font-size: 19px; font-weight: 500; }
.surface-embed .se-copy h3 em { font-family: var(--font-serif); font-style: italic; color: var(--accent-ink); font-weight: 450; }
.surface-embed .se-copy p { margin: 0; color: var(--ink-3); font-size: 14px; line-height: 1.6; max-width: 560px; }

/* ===== Code blocks (site-wide, light-aware) ===== */
.codeblock {
  background: #1e1f21;
  color: #c4c6c9;
  border: 1px solid #0d0d0e;
  border-radius: var(--radius);
  font-family: var(--font-mono);
  font-size: 12.5px;
  line-height: 1.65;
  padding: 16px 18px;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  margin: 0;
  white-space: pre;
}
.codeblock .kw { color: #569cd6; }
.codeblock .ty { color: #4ec9b0; }
.codeblock .st { color: #ce9178; }
.codeblock .cm { color: #6a9955; font-style: italic; }
.codeblock .fn { color: #dcdcaa; }
.codeblock .mg { color: #c586c0; }
.codeblock .pr { color: #7cbf6e; }

.cmdline {
  position: relative;
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--paper-2);
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  padding: 11px 14px;
  font-family: var(--font-mono);
  font-size: 12.5px;
  color: var(--ink-2);
  min-width: 0;
}
.cmdline .prompt { color: var(--accent-ink); user-select: none; flex-shrink: 0; }
.cmdline code { overflow-x: auto; white-space: nowrap; scrollbar-width: none; flex: 1; min-width: 0; }
.cmdline code::-webkit-scrollbar { display: none; }
.cmdline .copy-btn {
  flex-shrink: 0;
  border: 0;
  background: transparent;
  color: var(--ink-4);
  padding: 4px;
  border-radius: 4px;
  display: inline-flex;
}
.cmdline .copy-btn:hover { color: var(--ink); background: var(--paper-3); }
.cmdline .copy-btn.copied { color: var(--accent-ink); }

/* ===== Architecture ===== */
.arch {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.arch-layer {
  border: 1px solid var(--rule);
  border-radius: var(--radius-lg);
  background: var(--paper-2);
  padding: 20px;
  display: grid;
  grid-template-columns: 1fr;
  gap: 14px;
}
.arch-layer .al-label { min-width: 0; }
.arch-layer .al-label .k {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--accent-ink);
  display: block;
  margin-bottom: 6px;
}
.arch-layer .al-label h3 { margin: 0 0 6px; font-size: 17px; font-weight: 500; }
.arch-layer .al-label p { margin: 0; font-size: 13px; color: var(--ink-3); line-height: 1.55; }
.arch-tiles {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
  align-content: start;
}
.arch-tile {
  border: 1px solid var(--rule);
  border-radius: 6px;
  background: var(--paper);
  padding: 10px 12px;
  font-family: var(--font-mono);
  font-size: 11.5px;
  color: var(--ink-2);
  text-align: center;
}
.arch-connector {
  text-align: center;
  color: var(--ink-4);
  font-size: 14px;
  line-height: 1;
  user-select: none;
}
.arch-principle {
  margin-top: 36px;
  border-left: 3px solid var(--accent);
  padding: 6px 0 6px 22px;
}
.arch-principle p {
  margin: 0;
  font-size: clamp(17px, 3.4vw, 21px);
  line-height: 1.5;
  color: var(--ink-2);
}
.arch-principle p em { font-family: var(--font-serif); font-style: italic; color: var(--accent-ink); }
.arch-principle .folio { display: block; margin-top: 10px; }

/* ===== Extensibility ===== */
.ext-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 40px;
}
.ext-list { border-top: 1px solid var(--rule); }
.ext-item {
  display: grid;
  grid-template-columns: minmax(130px, 180px) 1fr;
  gap: 8px 18px;
  padding: 13px 0;
  border-bottom: 1px solid var(--rule-soft);
  align-items: baseline;
}
.ext-item .e-name {
  font-family: var(--font-mono);
  font-size: 12.5px;
  color: var(--ink);
  font-weight: 500;
  word-break: break-word;
}
.ext-item .e-desc { font-size: 13.5px; color: var(--ink-3); line-height: 1.55; }

.ext-side { display: flex; flex-direction: column; gap: 16px; }
.ext-panel {
  border: 1px solid var(--rule);
  border-radius: var(--radius-lg);
  background: var(--paper-2);
  padding: 22px;
}
.ext-panel h3 { margin: 0 0 8px; font-size: 17px; font-weight: 500; }
.ext-panel p { margin: 0 0 14px; font-size: 13.5px; color: var(--ink-3); line-height: 1.6; }
.ext-panel p:last-child { margin-bottom: 0; }

/* ===== Feature grid ===== */
.feat-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0;
  border: 1px solid var(--rule);
  border-radius: var(--radius-lg);
  overflow: hidden;
}
.feat {
  padding: 24px 22px;
  border-bottom: 1px solid var(--rule);
  background: var(--paper-2);
  min-width: 0;
}
.feat:last-child { border-bottom: 0; }
.feat h3 { margin: 0 0 8px; font-size: 16px; font-weight: 500; display: flex; align-items: baseline; gap: 10px; }
.feat h3 .f-num { font-family: var(--font-mono); font-size: 10.5px; color: var(--ink-4); flex-shrink: 0; }
.feat p { margin: 0; font-size: 13.5px; color: var(--ink-3); line-height: 1.6; }
.feat code {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--accent-ink);
  background: var(--accent-soft);
  border-radius: 4px;
  padding: 1px 5px;
  white-space: nowrap;
}

/* ===== Get started ===== */
.gs-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 16px;
}
.gs-panel {
  border: 1px solid var(--rule);
  border-radius: var(--radius-lg);
  background: var(--paper-2);
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  min-width: 0;
}
.gs-panel .tag {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--accent-ink);
}
.gs-panel h3 { margin: 0; font-size: 19px; font-weight: 500; }
.gs-panel p { margin: 0; font-size: 14px; color: var(--ink-3); line-height: 1.6; }
.gs-panel .gs-cmds { display: flex; flex-direction: column; gap: 8px; }
.gs-panel .gs-link {
  font-size: 14px;
  font-weight: 500;
  border-bottom: 1px solid var(--accent-line);
  align-self: flex-start;
  padding-bottom: 1px;
}
.gs-panel .gs-link:hover { color: var(--accent-ink); border-color: var(--accent-ink); }

/* ===== Migration ===== */
.mig-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 16px;
}
.mig-card {
  border: 1px solid var(--rule);
  border-radius: var(--radius-lg);
  padding: 24px;
  background: var(--paper-2);
  min-width: 0;
}
.mig-card .from {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ink-4);
  display: block;
  margin-bottom: 10px;
}
.mig-card h3 { margin: 0 0 10px; font-size: 18px; font-weight: 500; }
.mig-card p { margin: 0; font-size: 13.5px; color: var(--ink-3); line-height: 1.6; }
.mig-card .mig-fmt {
  display: inline-block;
  margin-top: 14px;
  font-family: var(--font-mono);
  font-size: 11.5px;
  color: var(--ink-2);
  background: var(--paper);
  border: 1px solid var(--rule);
  border-radius: 5px;
  padding: 4px 9px;
}

/* ===== Community ===== */
.community { text-align: center; }
.community h2 { margin-left: auto; margin-right: auto; }
.community .lede { margin-left: auto; margin-right: auto; }
.comm-cta { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; margin-bottom: 48px; }
.comm-stats {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0;
  border: 1px solid var(--rule);
  border-radius: var(--radius-lg);
  overflow: hidden;
  max-width: 760px;
  margin: 0 auto;
}
.comm-stat {
  padding: 24px 16px;
  background: var(--paper-2);
  border-right: 1px solid var(--rule);
  border-bottom: 1px solid var(--rule);
}
.comm-stat:nth-child(2n) { border-right: 0; }
.comm-stat:nth-child(n+3) { border-bottom: 0; }
.comm-stat .n {
  font-size: 32px;
  font-weight: 500;
  letter-spacing: -0.02em;
  display: block;
}
.comm-stat .l {
  font-family: var(--font-mono);
  font-size: 10.5px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-4);
  display: block;
  margin-top: 6px;
}

/* ===== Footer ===== */
.footer {
  border-top: 1px solid var(--rule);
  padding: 56px 0 32px;
  background: var(--paper-2);
}
.foot-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 36px;
}
.foot-brand p {
  margin: 14px 0 0;
  font-size: 13.5px;
  color: var(--ink-3);
  line-height: 1.6;
  max-width: 320px;
}
.foot-col { display: flex; flex-direction: column; gap: 10px; }
.foot-col h4 {
  margin: 0 0 4px;
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ink-4);
  font-weight: 500;
}
.foot-col a { font-size: 14px; color: var(--ink-2); }
.foot-col a:hover { color: var(--ink); }
.foot-meta {
  margin-top: 44px;
  padding-top: 20px;
  border-top: 1px solid var(--rule);
  display: flex;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

/* ============================================================
   Breakpoints
   ============================================================ */

@media (min-width: 560px) {
  :root { --pad-x: 28px; }
  .lang-grid { grid-template-columns: repeat(2, 1fr); }
  .lang-cell { border-right: 1px solid var(--rule); }
  .lang-cell:nth-child(2n) { border-right: 0; }
  .lang-cell:nth-last-child(-n+1) { border-bottom: 0; }
  .feat-grid { grid-template-columns: repeat(2, 1fr); }
  .feat { border-right: 1px solid var(--rule); }
  .feat:nth-child(2n) { border-right: 0; }
  .feat:nth-last-child(-n+2) { border-bottom: 0; }
  .hero-meta { grid-template-columns: repeat(4, auto); justify-content: start; gap: 20px 36px; }
  .hero-cta .btn { flex: 0 0 auto; }
  .nb-cmd.opt { display: inline-flex; }
}

@media (min-width: 760px) {
  section { padding: 96px 0; }
  .hero { padding: 64px 0 72px; }
  .role-cards { grid-template-columns: 1fr 1fr; }
  .surface-grid { grid-template-columns: repeat(2, 1fr); }
  .mig-grid { grid-template-columns: repeat(3, 1fr); }
  .gs-grid { grid-template-columns: repeat(2, 1fr); }
  .varstore-flow { grid-template-columns: repeat(2, 1fr); }
  .vf-step { border-right: 1px solid var(--rule-soft); }
  .vf-step:nth-child(2n) { border-right: 0; }
  .arch-layer { grid-template-columns: 220px 1fr; gap: 20px; }
  .arch-tiles { grid-template-columns: repeat(3, 1fr); }
  .comm-stats { grid-template-columns: repeat(4, 1fr); }
  .comm-stat { border-bottom: 0; }
  .comm-stat:nth-child(2n) { border-right: 1px solid var(--rule); }
  .comm-stat:last-child { border-right: 0; }
  .surface-embed { display: grid; grid-template-columns: 1fr 1.1fr; align-items: center; }
  .surface-embed .codeblock { border-radius: 0; border: 0; border-left: 1px solid var(--rule); align-self: stretch; padding: 32px 28px; }
  .foot-grid { grid-template-columns: 1.4fr 1fr 1fr 1fr; }
}

@media (min-width: 920px) {
  .nav-links {
    display: flex;
    align-items: center;
    gap: 26px;
    position: static;
  }
  .nav-links > a { font-size: 14px; padding: 4px 0; }
  .nav-panel-cta { display: none; }
  .nav-burger { display: none; }
  .nav-gh { display: inline-flex; }
  .nav-get { display: inline-flex; }
}

@media (min-width: 1020px) {
  :root { --pad-x: 48px; }
  .hero-grid { grid-template-columns: 1.04fr 0.96fr; gap: 64px; align-items: center; }
  .hero-meta { grid-template-columns: repeat(4, auto); }
  .why-grid { grid-template-columns: 0.9fr 1.1fr; gap: 64px; align-items: start; }
  .lang-grid { grid-template-columns: repeat(4, 1fr); }
  .lang-cell { border-right: 1px solid var(--rule); }
  .lang-cell:nth-child(2n) { border-right: 1px solid var(--rule); }
  .lang-cell:nth-child(4n) { border-right: 0; }
  .lang-cell:nth-last-child(-n+4) { border-bottom: 0; }
  .varstore-flow { grid-template-columns: repeat(4, 1fr); }
  .vf-step { border-right: 1px solid var(--rule-soft); border-bottom: 0; }
  .vf-step:nth-child(2n) { border-right: 1px solid var(--rule-soft); }
  .vf-step:last-child { border-right: 0; }
  .surface-grid { grid-template-columns: repeat(4, 1fr); }
  .feat-grid { grid-template-columns: repeat(3, 1fr); }
  .feat { border-right: 1px solid var(--rule); }
  .feat:nth-child(2n) { border-right: 1px solid var(--rule); }
  .feat:nth-child(3n) { border-right: 0; }
  .feat:nth-last-child(-n+3) { border-bottom: 0; }
  .gs-grid { grid-template-columns: repeat(3, 1fr); }
  .ext-grid { grid-template-columns: 1.15fr 0.85fr; gap: 56px; }
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .btn, .nav-burger span { transition: none; }
}

/* =====================================================================
   Docs pages (generated by build-docs.py)
   ===================================================================== */

html { scroll-padding-top: calc(var(--nav-h) + 16px); }

.docs-main { padding: 28px 0 72px; }
.docs-grid { display: grid; grid-template-columns: minmax(0, 1fr); gap: 28px; }
.docs-grid > * { min-width: 0; }

/* --- Sidebar --- */
.docs-tree { display: none; }
.docs-tree-m {
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  background: var(--paper-2);
}
.docs-tree-m summary {
  cursor: pointer;
  padding: 12px 16px;
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-3);
  user-select: none;
}
.docs-tree-m[open] summary { border-bottom: 1px solid var(--rule); }
.docs-tree-m nav { padding: 8px 16px 16px; }

.docs-side .docs-home {
  display: block;
  font-weight: 600;
  font-size: 14px;
  color: var(--ink);
  text-decoration: none;
  margin: 10px 0 4px;
}
.docs-side .docs-home:hover { color: var(--accent-ink); }
.docs-side h5 {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--ink-4);
  margin: 20px 0 8px;
  font-weight: 500;
}
.docs-side ul { list-style: none; margin: 0; padding: 0; }
.docs-side li a {
  display: block;
  padding: 5px 10px;
  margin-left: -10px;
  font-size: 13.5px;
  line-height: 1.45;
  color: var(--ink-3);
  text-decoration: none;
  border-radius: 6px;
}
.docs-side li a:hover { color: var(--ink); background: var(--paper-2); }
.docs-side li a.active {
  color: var(--accent-ink);
  background: var(--accent-soft);
  font-weight: 500;
}

/* --- Article --- */
.docs-crumb { margin-bottom: 18px; }
.docs-article { max-width: 780px; }

/* break-word (not anywhere) so long unbreakable tokens, e.g. generic type names on API
   reference pages, wrap at the column edge instead of overlapping the rail, without
   changing table intrinsic sizing */
.prose { font-size: 15.5px; line-height: 1.75; color: var(--ink-2); overflow-wrap: break-word; }
.prose h1 {
  font-size: clamp(28px, 5.4vw, 40px);
  line-height: 1.1;
  letter-spacing: -0.02em;
  font-weight: 500;
  color: var(--ink);
  margin: 0 0 18px;
  text-wrap: balance;
}
.prose h2 {
  font-size: 24px;
  letter-spacing: -0.015em;
  font-weight: 500;
  color: var(--ink);
  margin: 44px 0 14px;
  padding-top: 28px;
  border-top: 1px solid var(--rule);
}
.prose h3 { font-size: 18px; font-weight: 600; color: var(--ink); margin: 32px 0 10px; }
.prose h4 { font-size: 15.5px; font-weight: 600; color: var(--ink); margin: 24px 0 8px; }
.prose p { margin: 0 0 16px; }
.prose a { color: var(--accent-ink); text-decoration: underline; text-decoration-color: var(--accent-line); text-underline-offset: 3px; }
.prose a:hover { text-decoration-color: currentColor; }
.prose ul, .prose ol { margin: 0 0 16px; padding-left: 26px; }
.prose li { margin: 5px 0; }
.prose li > ul, .prose li > ol { margin-bottom: 0; }
.prose hr { border: 0; border-top: 1px solid var(--rule); margin: 36px 0; }
.prose blockquote {
  margin: 20px 0;
  padding: 2px 0 2px 18px;
  border-left: 2px solid var(--accent-line);
  color: var(--ink-3);
}
.prose blockquote p:last-child { margin-bottom: 0; }
.prose img { max-width: 100%; height: auto; border: 1px solid var(--rule); border-radius: var(--radius); }

/* Heading permalinks */
.prose .hlink {
  margin-left: 8px;
  font-size: 0.8em;
  color: var(--ink-4);
  text-decoration: none;
  opacity: 0;
}
.prose h1:hover .hlink, .prose h2:hover .hlink,
.prose h3:hover .hlink, .prose h4:hover .hlink { opacity: 1; }
.prose .hlink:hover { color: var(--accent-ink); }

/* Inline code */
.prose :not(pre) > code {
  font-family: var(--font-mono);
  font-size: 0.86em;
  background: var(--paper-2);
  border: 1px solid var(--rule-soft);
  border-radius: 4px;
  padding: 1px 5px;
  color: var(--ink);
  overflow-wrap: break-word;
}
.prose a > code { color: inherit; }

/* Tables */
.prose table {
  display: block;
  max-width: 100%;
  overflow-x: auto;
  border-collapse: collapse;
  margin: 20px 0;
  font-size: 13.5px;
  line-height: 1.55;
}
.prose th {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  font-weight: 500;
  color: var(--ink-3);
  text-align: left;
  padding: 8px 14px 8px 0;
  border-bottom: 1px solid var(--rule);
  white-space: nowrap;
}
.prose td {
  padding: 9px 14px 9px 0;
  border-bottom: 1px solid var(--rule-soft);
  vertical-align: top;
}

/* Code blocks: same dark panel as the rest of the site */
.prose .highlight {
  position: relative;
  margin: 20px 0;
}
.prose .highlight pre {
  margin: 0;
  background: #1e1f21;
  color: #c4c6c9;
  border: 1px solid #0d0d0e;
  border-radius: var(--radius);
  font-family: var(--font-mono);
  font-size: 12.5px;
  line-height: 1.65;
  padding: 16px 18px;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}
.prose .highlight .code-copy {
  position: absolute;
  top: 8px;
  right: 8px;
  border: 0;
  background: rgba(255, 255, 255, 0.06);
  color: #8c8e92;
  padding: 6px;
  border-radius: 6px;
  display: inline-flex;
  cursor: pointer;
}
.prose .highlight .code-copy:hover { color: #e4e5e7; background: rgba(255, 255, 255, 0.12); }
.prose .highlight .code-copy.copied { color: #7cbf6e; }

/* Pygments tokens, matched to the site's code palette */
.highlight .k, .highlight .kc, .highlight .kd, .highlight .kn,
.highlight .kp, .highlight .kr, .highlight .ow, .highlight .nt { color: #569cd6; }
.highlight .kt, .highlight .nc, .highlight .nn { color: #4ec9b0; }
.highlight .s, .highlight .sa, .highlight .sb, .highlight .sc, .highlight .dl,
.highlight .sd, .highlight .s2, .highlight .se, .highlight .sh, .highlight .si,
.highlight .sx, .highlight .sr, .highlight .s1, .highlight .ss { color: #ce9178; }
.highlight .c, .highlight .ch, .highlight .cm, .highlight .cpf,
.highlight .c1, .highlight .cs { color: #6a9955; font-style: italic; }
.highlight .cp, .highlight .nd { color: #c586c0; }
.highlight .nf, .highlight .fm { color: #dcdcaa; }
.highlight .m, .highlight .mb, .highlight .mf, .highlight .mh,
.highlight .mi, .highlight .mo, .highlight .il { color: #b5cea8; }
.highlight .na, .highlight .nb, .highlight .bp, .highlight .no,
.highlight .nv, .highlight .vc, .highlight .vg, .highlight .vi { color: #9cdcfe; }
.highlight .gp { color: #7cbf6e; }
.highlight .err { color: inherit; background: transparent; border: 0; }

/* --- Prev / next --- */
.docs-pn {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-top: 48px;
  padding-top: 24px;
  border-top: 1px solid var(--rule);
}
.docs-pn .pn {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 14px 16px;
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  text-decoration: none;
  color: var(--ink);
  font-size: 14px;
  font-weight: 500;
  min-width: 0;
}
.docs-pn .pn:hover { border-color: var(--ink-3); }
.docs-pn .pn-next { text-align: right; align-items: flex-end; }

/* --- Landing page (single column, spans the whole docs grid) --- */
.docs-landing { max-width: 100%; grid-column: 1 / -1; }
.docs-hero { padding: 28px 0 40px; }
.docs-hero .folio { display: block; margin-bottom: 14px; }
.docs-hero h1 {
  font-size: clamp(34px, 7vw, 56px);
  line-height: 1.05;
  letter-spacing: -0.025em;
  font-weight: 500;
  margin: 0 0 14px;
}
.docs-hero .hero-sub { max-width: 640px; }
.docs-hero .hero-sub a { color: var(--accent-ink); }

.docs-cat { padding: 44px 0; }
.docs-cat-blurb {
  color: var(--ink-3);
  font-size: 15px;
  line-height: 1.6;
  max-width: 620px;
  margin: -14px 0 26px;
}
.docs-cards {
  display: grid;
  grid-template-columns: 1fr;
  gap: 14px;
}
.docs-cards > * { min-width: 0; }
.docs-card {
  position: relative;
  display: block;
  padding: 18px 20px 20px;
  border: 1px solid var(--rule);
  border-radius: var(--radius-lg);
  text-decoration: none;
  color: inherit;
  background: var(--paper);
  transition: border-color 0.15s ease, transform 0.15s ease;
}
.docs-card:hover { border-color: var(--ink-3); transform: translateY(-1px); }
.docs-card h3 { margin: 0 0 6px; font-size: 16px; font-weight: 600; color: var(--ink); padding-right: 22px; }
.docs-card p { margin: 0; font-size: 13.5px; line-height: 1.55; color: var(--ink-3); }
.docs-card .docs-card-go {
  position: absolute;
  top: 16px;
  right: 16px;
  color: var(--ink-4);
  transition: color 0.15s ease, transform 0.15s ease;
}
.docs-card:hover .docs-card-go { color: var(--accent-ink); transform: translateX(2px); }

/* --- Release notes page (generated by build-release-notes.py) --- */
.docs-crumb a { color: inherit; text-decoration: none; }
.docs-crumb a:hover { color: var(--accent-ink); }
.rel { border-top: 1px solid var(--rule); padding-top: 36px; margin-top: 40px; }
.rel:first-of-type { border-top: 0; padding-top: 4px; margin-top: 24px; }
.rel-head {
  display: flex;
  align-items: baseline;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 14px;
}
.rel-head h2 {
  margin: 0;
  font-size: 24px;
  font-weight: 600;
  letter-spacing: -0.01em;
  color: var(--ink);
}
.rel-head h2 a { color: inherit; text-decoration: none; }
.rel-head h2 a:hover { color: var(--accent-ink); }
.rel-badge {
  font-family: var(--font-mono);
  font-size: 10.5px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 3px 9px;
  border-radius: 999px;
  border: 1px solid var(--accent-line);
  color: var(--accent-ink);
  background: var(--accent-soft);
  align-self: center;
}
.rel-badge--pre {
  border-color: var(--rule);
  color: var(--ink-3);
  background: var(--paper-2);
}
.rel-gh {
  margin-left: auto;
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--ink-3);
  text-decoration: none;
  white-space: nowrap;
}
.rel-gh:hover { color: var(--accent-ink); }

/* --- API reference (generated by build-api-docs.py) --- */
.docs-side li ul {
  margin: 2px 0 8px 10px;
  padding-left: 10px;
  border-left: 1px solid var(--rule-soft);
}
.docs-side li li a {
  padding: 3px 10px;
  font-size: 12.5px;
  font-family: var(--font-mono);
}
.api-kind {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--ink-4);
  white-space: nowrap;
}

/* "On this page" rail for API type pages; hidden until the viewport can
   afford a third column. Browsers without :has() simply keep it hidden. */
.api-toc { display: none; }
.api-toc h5 {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--ink-4);
  margin: 10px 0 8px;
  font-weight: 500;
}
.api-toc ul { list-style: none; margin: 0 0 12px; padding: 0; }
.api-toc li a {
  display: block;
  padding: 3px 0;
  font-family: var(--font-mono);
  font-size: 12px;
  line-height: 1.5;
  color: var(--ink-3);
  text-decoration: none;
  word-break: break-word;
}
.api-toc li a:hover { color: var(--accent-ink); }
.api-toc .api-toc-g {
  display: block;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--ink);
  text-decoration: none;
  margin: 12px 0 4px;
}
.api-toc .api-toc-g:hover { color: var(--accent-ink); }

@media (min-width: 1360px) {
  .container.docs-grid:has(.api-toc) {
    max-width: 1440px;
    grid-template-columns: 232px minmax(0, 1fr) 224px;
  }
  .docs-grid:has(.api-toc) .api-toc {
    display: block;
    position: sticky;
    top: calc(var(--nav-h) + 28px);
    align-self: start;
    max-height: calc(100vh - var(--nav-h) - 56px);
    overflow-y: auto;
    padding-left: 8px;
  }
}

/* --- Docs responsive --- */
@media (min-width: 760px) {
  .docs-cards { grid-template-columns: repeat(2, 1fr); }
  .docs-main { padding-top: 36px; }
}

@media (min-width: 1020px) {
  .docs-grid { grid-template-columns: 232px minmax(0, 1fr); gap: 56px; }
  .docs-tree { display: block; }
  .docs-tree-m { display: none; }
  .docs-side {
    position: sticky;
    top: calc(var(--nav-h) + 28px);
    align-self: start;
    max-height: calc(100vh - var(--nav-h) - 56px);
    overflow-y: auto;
    padding-right: 8px;
  }
  .docs-cards { grid-template-columns: repeat(3, 1fr); }
}

/* ============================================================
   Analytics notice: bottom right, shown until the visitor decides
   ============================================================ */
.consent {
  position: fixed;
  right: 20px;
  bottom: 20px;
  z-index: 60;
  width: min(380px, calc(100vw - 40px));
  padding: 18px 20px;
  background: var(--paper);
  color: var(--ink);
  border: 1px solid var(--rule);
  border-radius: var(--radius-lg);
  box-shadow: 0 16px 40px -16px rgba(0, 0, 0, 0.35);
  font-size: 14px;
  line-height: 1.5;
}
.consent p { margin: 0 0 14px; color: var(--ink-2); }
.consent p a { color: inherit; text-decoration: underline; text-underline-offset: 2px; }
.consent-actions { display: flex; flex-wrap: wrap; gap: 8px; }
@media (max-width: 640px) {
  .consent { right: 16px; bottom: 16px; width: calc(100vw - 32px); }
}
@media (prefers-reduced-motion: no-preference) {
  .consent { animation: consent-in 220ms ease-out; }
}
@keyframes consent-in {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: none; }
}
