/* ============================================================================
   BvLogic v2 — Design System
   Single stylesheet. No framework, no external fonts, no network requests.
   Light + dark, both authored (not auto-inverted). WCAG AA contrast throughout.
   Edit here only — every generated page inherits this file.
   ========================================================================== */

/* ------------------------------------------------------------ 0. TYPEFACES
   Plus Jakarta Sans (display) + Inter (body) — the v1 brand fonts, now
   SELF-HOSTED rather than loaded from Google. Same typography, no third-party
   request, nothing to consent to, and no render-blocking external dependency.
   Both are SIL OFL licensed. Latin subset only.                             */
@font-face {
  font-family: 'Plus Jakarta Sans'; font-style: normal; font-weight: 600;
  font-display: swap; src: url('/assets/fonts/PlusJakartaSans-600.woff2') format('woff2');
}
@font-face {
  font-family: 'Plus Jakarta Sans'; font-style: normal; font-weight: 700;
  font-display: swap; src: url('/assets/fonts/PlusJakartaSans-700.woff2') format('woff2');
}
@font-face {
  font-family: 'Plus Jakarta Sans'; font-style: normal; font-weight: 800;
  font-display: swap; src: url('/assets/fonts/PlusJakartaSans-800.woff2') format('woff2');
}
@font-face {
  font-family: 'Inter'; font-style: normal; font-weight: 400;
  font-display: swap; src: url('/assets/fonts/Inter-400.woff2') format('woff2');
}
@font-face {
  font-family: 'Inter'; font-style: normal; font-weight: 500;
  font-display: swap; src: url('/assets/fonts/Inter-500.woff2') format('woff2');
}
@font-face {
  font-family: 'Inter'; font-style: normal; font-weight: 600;
  font-display: swap; src: url('/assets/fonts/Inter-600.woff2') format('woff2');
}

/* ---------------------------------------------------------------- 1. TOKENS */
:root {
  /* Brand — violet carried forward from v1 (BvLogic = Birdview Logic) */
  --brand-50:  #f5f3ff;
  --brand-100: #ede9fe;
  --brand-200: #ddd6fe;
  --brand-300: #c4b5fd;
  --brand-400: #a78bfa;
  --brand-500: #8b5cf6;
  --brand-600: #7c3aed;   /* primary */
  --brand-700: #6d28d9;
  --brand-800: #5b21b6;
  --brand-900: #4c1d95;

  /* Neutrals — cool grey, tuned for long-form reading */
  --n-0:   #ffffff;
  --n-25:  #fcfcfd;
  --n-50:  #f8fafc;
  --n-100: #f1f5f9;
  --n-200: #e2e8f0;
  --n-300: #cbd5e1;
  --n-400: #94a3b8;
  --n-500: #64748b;
  --n-600: #475569;
  --n-700: #334155;
  --n-800: #1e293b;
  --n-900: #0f172a;
  --n-950: #0b1220;

  /* Semantic */
  --ok-fg:   #047857;  --ok-bg:   #ecfdf5;  --ok-br:   #a7f3d0;
  --warn-fg: #b45309;  --warn-bg: #fffbeb;  --warn-br: #fde68a;
  --err-fg:  #b91c1c;  --err-bg:  #fef2f2;  --err-br:  #fecaca;
  --info-fg: #1d4ed8;  --info-bg: #eff6ff;  --info-br: #bfdbfe;

  /* Applied — light theme */
  --bg:          var(--n-0);
  --bg-subtle:   var(--n-50);
  --bg-sunken:   var(--n-100);
  --bg-elevated: var(--n-0);
  --fg:          var(--n-900);
  --fg-muted:    var(--n-600);
  --fg-subtle:   var(--n-500);
  --border:      var(--n-200);
  --border-strong: var(--n-300);
  --accent:      var(--brand-600);
  --accent-fg:   #ffffff;
  --accent-bg:   var(--brand-50);
  --accent-hover: var(--brand-700);
  --focus:       var(--brand-600);

  /* Type — v1 brand pairing, self-hosted, with a system fallback */
  --font-body: 'Inter', ui-sans-serif, system-ui, -apple-system, "Segoe UI",
               Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-display: 'Plus Jakarta Sans', 'Inter', ui-sans-serif, system-ui,
                  -apple-system, "Segoe UI", sans-serif;
  --font-sans: var(--font-body);          /* alias, kept for existing rules */
  --font-mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas,
               "Liberation Mono", monospace;

  /* Type scale — 1.200 minor third, 16px base */
  --t-xs:   0.75rem;    /* 12 */
  --t-sm:   0.875rem;   /* 14 */
  --t-base: 1rem;       /* 16 */
  --t-md:   1.125rem;   /* 18 */
  --t-lg:   1.25rem;    /* 20 */
  --t-xl:   1.5rem;     /* 24 */
  --t-2xl:  1.875rem;   /* 30 */
  --t-3xl:  2.25rem;    /* 36 */
  --t-4xl:  3rem;       /* 48 */

  --lh-tight: 1.2;
  --lh-snug:  1.4;
  --lh-body:  1.7;      /* long-form reading */

  /* Space — 4px base */
  --s-1: 0.25rem;  --s-2: 0.5rem;   --s-3: 0.75rem;  --s-4: 1rem;
  --s-5: 1.25rem;  --s-6: 1.5rem;   --s-8: 2rem;     --s-10: 2.5rem;
  --s-12: 3rem;    --s-16: 4rem;    --s-20: 5rem;    --s-24: 6rem;

  /* Radius / elevation / motion */
  --r-sm: 4px;  --r-md: 8px;  --r-lg: 12px;  --r-xl: 16px;  --r-full: 999px;
  --sh-sm: 0 1px 2px rgba(15,23,42,.06), 0 1px 3px rgba(15,23,42,.05);
  --sh-md: 0 2px 4px rgba(15,23,42,.05), 0 4px 12px rgba(15,23,42,.07);
  --sh-lg: 0 8px 24px rgba(15,23,42,.10), 0 2px 6px rgba(15,23,42,.06);
  --ease: cubic-bezier(.4,0,.2,1);
  --dur: 160ms;

  /* Layout */
  --w-prose: 44rem;     /* ~72ch — measured for readability */
  --w-content: 72rem;
  --w-wide: 84rem;
  --header-h: 60px;
}

/* Dark theme — authored, not inverted. Both signals honoured; the explicit
   data-theme attribute must win over the media query in both directions. */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg:          var(--n-950);
    --bg-subtle:   #0f1729;
    --bg-sunken:   #0a1020;
    --bg-elevated: var(--n-900);
    --fg:          var(--n-100);
    --fg-muted:    var(--n-400);
    --fg-subtle:   var(--n-500);
    --border:      #1e2b45;
    --border-strong: #2d3d5c;
    --accent:      var(--brand-400);
    --accent-fg:   var(--n-950);
    --accent-bg:   rgba(139,92,246,.12);
    --accent-hover: var(--brand-300);
    --focus:       var(--brand-400);
    --ok-fg:   #6ee7b7;  --ok-bg:   rgba(6,95,70,.18);   --ok-br:   #065f46;
    --warn-fg: #fcd34d;  --warn-bg: rgba(180,83,9,.18);  --warn-br: #92400e;
    --err-fg:  #fca5a5;  --err-bg:  rgba(185,28,28,.18); --err-br:  #7f1d1d;
    --info-fg: #93c5fd;  --info-bg: rgba(29,78,216,.18); --info-br: #1e3a8a;
    --sh-sm: 0 1px 2px rgba(0,0,0,.3);
    --sh-md: 0 2px 8px rgba(0,0,0,.35);
    --sh-lg: 0 8px 28px rgba(0,0,0,.45);
  }
}
:root[data-theme="dark"] {
  --bg: var(--n-950); --bg-subtle: #0f1729; --bg-sunken: #0a1020;
  --bg-elevated: var(--n-900);
  --fg: var(--n-100); --fg-muted: var(--n-400); --fg-subtle: var(--n-500);
  --border: #1e2b45; --border-strong: #2d3d5c;
  --accent: var(--brand-400); --accent-fg: var(--n-950);
  --accent-bg: rgba(139,92,246,.12); --accent-hover: var(--brand-300);
  --focus: var(--brand-400);
  --ok-fg: #6ee7b7;  --ok-bg: rgba(6,95,70,.18);   --ok-br: #065f46;
  --warn-fg: #fcd34d; --warn-bg: rgba(180,83,9,.18); --warn-br: #92400e;
  --err-fg: #fca5a5;  --err-bg: rgba(185,28,28,.18); --err-br: #7f1d1d;
  --info-fg: #93c5fd; --info-bg: rgba(29,78,216,.18); --info-br: #1e3a8a;
  --sh-sm: 0 1px 2px rgba(0,0,0,.3);
  --sh-md: 0 2px 8px rgba(0,0,0,.35);
  --sh-lg: 0 8px 28px rgba(0,0,0,.45);
}

/* ------------------------------------------------------------ 2. FOUNDATION */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; scroll-padding-top: calc(var(--header-h) + var(--s-4)); }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}
body {
  margin: 0;
  font-family: var(--font-sans);
  font-size: var(--t-base);
  line-height: var(--lh-body);
  color: var(--fg);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
h1,h2,h3,h4,h5,h6 { margin: 0 0 var(--s-4); font-family: var(--font-display); line-height: var(--lh-tight); font-weight: 700; letter-spacing: -.02em; color: var(--fg); }
h1 { font-size: var(--t-3xl); letter-spacing: -.03em; }
h2 { font-size: var(--t-2xl); margin-top: var(--s-12); }
h3 { font-size: var(--t-xl); margin-top: var(--s-8); }
h4 { font-size: var(--t-lg); margin-top: var(--s-6); }
h5, h6 { font-size: var(--t-md); margin-top: var(--s-5); }
p { margin: 0 0 var(--s-4); }
a { color: var(--accent); text-decoration-color: color-mix(in srgb, var(--accent) 35%, transparent); text-underline-offset: 2px; transition: color var(--dur) var(--ease); }
a:hover { color: var(--accent-hover); text-decoration-color: currentColor; }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; border-radius: var(--r-sm); }
img, svg, video { max-width: 100%; height: auto; display: block; }
hr { border: 0; border-top: 1px solid var(--border); margin: var(--s-10) 0; }
small { font-size: var(--t-sm); }
strong { font-weight: 650; }
ul, ol { margin: 0 0 var(--s-4); padding-left: var(--s-6); }
li { margin-bottom: var(--s-2); }
li::marker { color: var(--fg-subtle); }
blockquote { margin: var(--s-6) 0; padding: var(--s-1) 0 var(--s-1) var(--s-5); border-left: 3px solid var(--accent); color: var(--fg-muted); font-style: italic; }
code { font-family: var(--font-mono); font-size: .9em; background: var(--bg-sunken); padding: .15em .4em; border-radius: var(--r-sm); border: 1px solid var(--border); }
pre { margin: var(--s-6) 0; padding: var(--s-4); background: var(--bg-sunken); border: 1px solid var(--border); border-radius: var(--r-md); overflow-x: auto; font-size: var(--t-sm); line-height: 1.6; }
pre code { background: none; padding: 0; border: 0; font-size: inherit; }

/* Tables scroll inside their own container — the page body never scrolls sideways */
.table-wrap { overflow-x: auto; margin: var(--s-6) 0; border: 1px solid var(--border); border-radius: var(--r-md); }
table { border-collapse: collapse; width: 100%; font-size: var(--t-sm); }
th, td { padding: var(--s-3) var(--s-4); text-align: left; border-bottom: 1px solid var(--border); vertical-align: top; }
th { font-weight: 650; background: var(--bg-subtle); white-space: nowrap; }
tbody tr:last-child td { border-bottom: 0; }

/* ---------------------------------------------------------------- 3. LAYOUT */
.container { width: 100%; max-width: var(--w-content); margin-inline: auto; padding-inline: var(--s-5); }
.container--wide { max-width: var(--w-wide); }
.container--prose { max-width: var(--w-prose); }
.section { padding-block: var(--s-16); }
.section--tight { padding-block: var(--s-10); }
.section--subtle { background: var(--bg-subtle); }
.stack > * + * { margin-top: var(--s-4); }
.cluster { display: flex; flex-wrap: wrap; gap: var(--s-3); align-items: center; }
.grid { display: grid; gap: var(--s-5); grid-template-columns: repeat(auto-fill, minmax(min(100%, 17rem), 1fr)); }
.grid--2 { grid-template-columns: repeat(auto-fit, minmax(min(100%, 22rem), 1fr)); }
.skip-link { position: absolute; left: -9999px; top: 0; z-index: 100; padding: var(--s-3) var(--s-5); background: var(--accent); color: var(--accent-fg); border-radius: 0 0 var(--r-md) 0; }
.skip-link:focus { left: 0; }

/* Article layout: content + sticky table of contents */
.doc { display: grid; gap: var(--s-10); grid-template-columns: 1fr; align-items: start; }
@media (min-width: 60rem) {
  .doc { grid-template-columns: minmax(0,1fr) 16rem; }
  .doc__toc { position: sticky; top: calc(var(--header-h) + var(--s-6)); max-height: calc(100vh - var(--header-h) - var(--s-12)); overflow-y: auto; }
}

/* ---------------------------------------------------------------- 4. HEADER */
.site-header {
  position: sticky; top: 0; z-index: 50;
  height: var(--header-h);
  display: flex; align-items: center;
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: saturate(1.6) blur(10px);
  border-bottom: 1px solid var(--border);
}
.site-header__inner { display: flex; align-items: center; gap: var(--s-5); width: 100%; }
/* Brand lockup — matches v1 exactly (css/style.css:76-81).
   The <i> is NOT italic: it is upright and violet. Getting this wrong changes
   the wordmark. Mark is the real orb-with-swirled-B from the owner's artwork. */
.brand { display: inline-flex; align-items: center; gap: 9px; text-decoration: none; flex-shrink: 0; }
.brand:hover { color: inherit; }
.brand__mark { height: 32px; width: 32px; flex-shrink: 0; }
.brand__name {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 21px;
  letter-spacing: -.03em;
  color: var(--fg);
  line-height: 1;
}
.brand__name i { font-style: normal; color: var(--brand-600); }
:root[data-theme="dark"] .brand__name i { color: #b794f6; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .brand__name i { color: #b794f6; }
}

/* Signature animated rainbow bar — v1 css/style.css:108. Sits above the header
   on every page; the colours are the logo's colours. */
.brand-bar {
  height: 3px;
  background: linear-gradient(90deg,#ff4d6d,#ff9f3d,#7ed957,#22d3ee,#4f8cff,#b93bff,#ff4d6d);
  background-size: 220% 100%;
  animation: barflow 9s linear infinite;
}
@keyframes barflow { to { background-position: 220% 0; } }
@media (prefers-reduced-motion: reduce) { .brand-bar { animation: none; } }
.nav { display: none; margin-left: auto; }
@media (min-width: 64rem) { .nav { display: flex; align-items: center; gap: var(--s-1); } }
.nav__link { padding: var(--s-2) var(--s-3); border-radius: var(--r-md); font-size: var(--t-sm); font-weight: 550; color: var(--fg-muted); text-decoration: none; white-space: nowrap; }
.nav__link:hover { color: var(--fg); background: var(--bg-sunken); }
.nav__link[aria-current="page"] { color: var(--accent); background: var(--accent-bg); }
.header__actions { display: flex; align-items: center; gap: var(--s-2); margin-left: auto; }
@media (min-width: 64rem) { .header__actions { margin-left: var(--s-3); } }
.icon-btn { display: inline-grid; place-items: center; width: 36px; height: 36px; border: 1px solid var(--border); background: var(--bg-elevated); color: var(--fg-muted); border-radius: var(--r-md); cursor: pointer; transition: all var(--dur) var(--ease); padding: 0; }
.icon-btn:hover { color: var(--fg); border-color: var(--border-strong); }

/* Icons — SVG sprite, never unicode glyphs. Unicode renders differently on
   every platform, cannot be weight-matched to the type, and has no reliable
   optical size. `currentColor` makes them theme-correct for free. */
.icon { width: 20px; height: 20px; display: block; flex-shrink: 0; color: inherit; }
.icon--sm { width: 16px; height: 16px; }
.icon--lg { width: 24px; height: 24px; }
.btn .icon { width: 16px; height: 16px; }
[data-theme-toggle] .icon--sun { display: none; }
:root[data-theme="dark"] [data-theme-toggle] .icon--sun { display: block; }
:root[data-theme="dark"] [data-theme-toggle] .icon--moon { display: none; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) [data-theme-toggle] .icon--sun { display: block; }
  :root:not([data-theme="light"]) [data-theme-toggle] .icon--moon { display: none; }
}

/* Design-system reference page */
.swatch { border: 1px solid var(--border); border-radius: var(--r-md); overflow: hidden; }
.swatch__chip { height: 56px; }
.swatch__meta { padding: var(--s-2) var(--s-3); font-size: var(--t-xs); }
.swatch__meta code { background: none; border: 0; padding: 0; color: var(--fg-subtle); }
.icon-grid { display: grid; gap: var(--s-3); grid-template-columns: repeat(auto-fill, minmax(6.5rem, 1fr)); }
.icon-cell { display: flex; flex-direction: column; align-items: center; gap: var(--s-2); padding: var(--s-4) var(--s-2); border: 1px solid var(--border); border-radius: var(--r-md); font-size: var(--t-xs); color: var(--fg-subtle); text-align: center; }
.spec { display: grid; grid-template-columns: auto 1fr; gap: var(--s-2) var(--s-5); font-size: var(--t-sm); align-items: baseline; }
.spec dt { color: var(--fg-subtle); font-family: var(--font-mono); font-size: var(--t-xs); }
.spec dd { margin: 0; }

/* Mega-menu: 16 sections need structure, not a flat list */
.menu-panel { position: fixed; inset: var(--header-h) 0 auto 0; background: var(--bg-elevated); border-bottom: 1px solid var(--border); box-shadow: var(--sh-lg); padding: var(--s-8) 0; max-height: calc(100vh - var(--header-h)); overflow-y: auto; }
.menu-panel[hidden] { display: none; }
.menu-grid { display: grid; gap: var(--s-6); grid-template-columns: repeat(auto-fill, minmax(min(100%, 15rem), 1fr)); }
.menu-group__title { font-size: var(--t-xs); text-transform: uppercase; letter-spacing: .07em; color: var(--fg-subtle); font-weight: 650; margin-bottom: var(--s-3); }
.menu-group ul { list-style: none; margin: 0; padding: 0; }
.menu-group li { margin-bottom: var(--s-1); }
.menu-group a { display: block; padding: var(--s-2) var(--s-3); margin-left: calc(var(--s-3) * -1); border-radius: var(--r-md); font-size: var(--t-sm); color: var(--fg-muted); text-decoration: none; }
.menu-group a:hover { color: var(--fg); background: var(--bg-sunken); }

/* ----------------------------------------------------------------- 5. CARDS */
.card {
  display: flex; flex-direction: column;
  padding: var(--s-5);
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  transition: border-color var(--dur) var(--ease), box-shadow var(--dur) var(--ease), transform var(--dur) var(--ease);
}
a.card, .card--link { text-decoration: none; color: inherit; }
a.card:hover, .card--link:hover { border-color: var(--accent); box-shadow: var(--sh-md); transform: translateY(-2px); }
.card__eyebrow { font-size: var(--t-xs); text-transform: uppercase; letter-spacing: .07em; font-weight: 650; color: var(--accent); margin-bottom: var(--s-2); }
.card__title { font-size: var(--t-md); font-weight: 650; margin: 0 0 var(--s-2); line-height: var(--lh-snug); }
.card__body { font-size: var(--t-sm); color: var(--fg-muted); margin: 0; line-height: var(--lh-snug); flex: 1; }
.card__meta { margin-top: var(--s-4); padding-top: var(--s-3); border-top: 1px solid var(--border); font-size: var(--t-xs); color: var(--fg-subtle); display: flex; gap: var(--s-3); flex-wrap: wrap; }

/* --------------------------------------------------------------- 6. BUTTONS */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: var(--s-2);
  padding: var(--s-3) var(--s-5);
  font: inherit; font-size: var(--t-sm); font-weight: 600; line-height: 1;
  border: 1px solid transparent; border-radius: var(--r-md);
  cursor: pointer; text-decoration: none; white-space: nowrap;
  transition: all var(--dur) var(--ease);
}
.btn--primary { background: var(--accent); color: var(--accent-fg); }
.btn--primary:hover { background: var(--accent-hover); color: var(--accent-fg); }
.btn--secondary { background: var(--bg-elevated); color: var(--fg); border-color: var(--border-strong); }
.btn--secondary:hover { border-color: var(--accent); color: var(--accent); }
.btn--ghost { background: transparent; color: var(--fg-muted); }
.btn--ghost:hover { background: var(--bg-sunken); color: var(--fg); }
.btn--lg { padding: var(--s-4) var(--s-6); font-size: var(--t-base); }
.btn[disabled] { opacity: .5; cursor: not-allowed; }

/* ------------------------------------------------ 7. BADGES · TAGS · STATUS */
.badge { display: inline-flex; align-items: center; gap: var(--s-1); padding: .2em .6em; font-size: var(--t-xs); font-weight: 600; border-radius: var(--r-full); border: 1px solid var(--border); background: var(--bg-subtle); color: var(--fg-muted); white-space: nowrap; }
.badge--accent { background: var(--accent-bg); color: var(--accent); border-color: color-mix(in srgb, var(--accent) 30%, transparent); }
.badge--ok   { background: var(--ok-bg);   color: var(--ok-fg);   border-color: var(--ok-br); }
.badge--warn { background: var(--warn-bg); color: var(--warn-fg); border-color: var(--warn-br); }
.badge--err  { background: var(--err-bg);  color: var(--err-fg);  border-color: var(--err-br); }
.badge--info { background: var(--info-bg); color: var(--info-fg); border-color: var(--info-br); }
/* Honest state labels — an empty section must say so rather than look broken */
.badge--planned      { background: var(--bg-sunken); color: var(--fg-subtle); }
.badge--experimental { background: var(--warn-bg); color: var(--warn-fg); border-color: var(--warn-br); }
.status-dot { width: 8px; height: 8px; border-radius: var(--r-full); background: var(--ok-fg); flex-shrink: 0; }

/* -------------------------------------------------------------- 8. CALLOUTS */
.callout { display: flex; gap: var(--s-3); padding: var(--s-4) var(--s-5); margin: var(--s-6) 0; border: 1px solid var(--border); border-left-width: 3px; border-radius: var(--r-md); background: var(--bg-subtle); font-size: var(--t-sm); }
.callout > :last-child { margin-bottom: 0; }
.callout__title { font-weight: 650; margin-bottom: var(--s-1); }
.callout--note { border-left-color: var(--info-fg); background: var(--info-bg); }
.callout--tip  { border-left-color: var(--ok-fg);   background: var(--ok-bg); }
.callout--warn { border-left-color: var(--warn-fg); background: var(--warn-bg); }
.callout--risk { border-left-color: var(--err-fg);  background: var(--err-bg); }

/* --------------------------------------------------- 9. BREADCRUMB · TOC */
.breadcrumb { font-size: var(--t-sm); color: var(--fg-subtle); margin-bottom: var(--s-5); }
.breadcrumb ol { display: flex; flex-wrap: wrap; gap: var(--s-2); list-style: none; margin: 0; padding: 0; }
.breadcrumb li { margin: 0; display: flex; align-items: center; gap: var(--s-2); }
.breadcrumb li + li::before { content: "/"; color: var(--border-strong); }
.breadcrumb a { color: var(--fg-muted); text-decoration: none; }
.breadcrumb a:hover { color: var(--accent); text-decoration: underline; }
.toc { font-size: var(--t-sm); }
.toc__title { font-size: var(--t-xs); text-transform: uppercase; letter-spacing: .07em; color: var(--fg-subtle); font-weight: 650; margin-bottom: var(--s-3); }
.toc ol { list-style: none; margin: 0; padding: 0; border-left: 2px solid var(--border); }
.toc li { margin: 0; }
.toc a { display: block; padding: var(--s-2) var(--s-4); margin-left: -2px; border-left: 2px solid transparent; color: var(--fg-muted); text-decoration: none; line-height: var(--lh-snug); }
.toc a:hover { color: var(--fg); }
.toc a[aria-current="true"] { color: var(--accent); border-left-color: var(--accent); font-weight: 600; }
.toc .toc--sub a { padding-left: var(--s-8); font-size: var(--t-xs); }

/* ------------------------------------------------------------- 10. ARTICLE */
.prose { max-width: var(--w-prose); }
.prose > h2:first-child, .prose > h3:first-child { margin-top: 0; }
.article-header { margin-bottom: var(--s-8); padding-bottom: var(--s-6); border-bottom: 1px solid var(--border); }
.article-header__meta { display: flex; flex-wrap: wrap; gap: var(--s-3); font-size: var(--t-sm); color: var(--fg-subtle); margin-top: var(--s-4); }
.article-lede { font-size: var(--t-md); color: var(--fg-muted); line-height: var(--lh-snug); margin-top: var(--s-4); }
/* The 11-block article structure — each block gets an anchorable heading */
.block { scroll-margin-top: calc(var(--header-h) + var(--s-4)); }
.anchor { opacity: 0; margin-left: var(--s-2); color: var(--fg-subtle); text-decoration: none; font-weight: 400; }
h2:hover .anchor, h3:hover .anchor, .anchor:focus { opacity: 1; }

/* ---------------------------------------------------------- 11. HERO · HOME */
.hero { padding-block: var(--s-20) var(--s-16); border-bottom: 1px solid var(--border); background:
  radial-gradient(60rem 26rem at 15% -20%, var(--accent-bg), transparent 65%),
  radial-gradient(48rem 22rem at 92% 0%, color-mix(in srgb, var(--brand-400) 10%, transparent), transparent 60%); }
.hero__title { font-size: clamp(2rem, 5vw, var(--t-4xl)); max-width: 20ch; }
.hero__lede { font-size: var(--t-md); color: var(--fg-muted); max-width: 56ch; margin-bottom: var(--s-8); }
.hero__actions { display: flex; flex-wrap: wrap; gap: var(--s-3); }
.proof-strip { display: flex; flex-wrap: wrap; gap: var(--s-8); padding-block: var(--s-6); }
.proof__num { font-size: var(--t-2xl); font-weight: 750; letter-spacing: -.03em; line-height: 1; }
.proof__label { font-size: var(--t-sm); color: var(--fg-muted); margin-top: var(--s-1); }
.section-head { margin-bottom: var(--s-8); }
.section-head__eyebrow { font-size: var(--t-xs); text-transform: uppercase; letter-spacing: .08em; font-weight: 650; color: var(--accent); margin-bottom: var(--s-2); }
.section-head__title { font-size: var(--t-2xl); margin: 0 0 var(--s-3); }
.section-head__lede { color: var(--fg-muted); max-width: 60ch; margin: 0; }

/* ------------------------------------------------------- 12. FORMS · SEARCH */
label { display: block; font-size: var(--t-sm); font-weight: 600; margin-bottom: var(--s-2); }
input, select, textarea {
  width: 100%; padding: var(--s-3) var(--s-4);
  font: inherit; font-size: var(--t-sm);
  color: var(--fg); background: var(--bg-elevated);
  border: 1px solid var(--border-strong); border-radius: var(--r-md);
  transition: border-color var(--dur) var(--ease), box-shadow var(--dur) var(--ease);
}
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-bg); }
input::placeholder, textarea::placeholder { color: var(--fg-subtle); }
.field { margin-bottom: var(--s-4); }
.field__hint { font-size: var(--t-xs); color: var(--fg-subtle); margin-top: var(--s-1); font-weight: 400; }
.hp { position: absolute; left: -9999px; }        /* honeypot */
.search-results { list-style: none; margin: var(--s-5) 0 0; padding: 0; }
.search-results li { margin-bottom: var(--s-3); }
.search-hit { display: block; padding: var(--s-4); border: 1px solid var(--border); border-radius: var(--r-md); text-decoration: none; color: inherit; }
.search-hit:hover { border-color: var(--accent); background: var(--bg-subtle); }
.search-hit__title { font-weight: 650; margin-bottom: var(--s-1); }
.search-hit__path { font-size: var(--t-xs); color: var(--fg-subtle); font-family: var(--font-mono); }
.search-hit mark { background: var(--accent-bg); color: var(--accent); padding: 0 .15em; border-radius: 2px; }

/* ------------------------------------------------------------ 13. TOOL UI */
.tool { border: 1px solid var(--border); border-radius: var(--r-lg); background: var(--bg-elevated); overflow: hidden; }
.tool__head { padding: var(--s-5); border-bottom: 1px solid var(--border); background: var(--bg-subtle); }
.tool__body { padding: var(--s-5); }
.tool__out { padding: var(--s-5); border-top: 1px solid var(--border); background: var(--bg-sunken); }
.tool__out:empty { display: none; }
.kv { display: grid; grid-template-columns: auto 1fr; gap: var(--s-2) var(--s-4); font-size: var(--t-sm); }
.kv dt { color: var(--fg-muted); }
.kv dd { margin: 0; font-weight: 600; }

/* ---------------------------------------------------------------- 14. FOOTER */
.site-footer { margin-top: var(--s-20); padding-block: var(--s-16) var(--s-8); border-top: 1px solid var(--border); background: var(--bg-subtle); font-size: var(--t-sm); }
.footer-grid { display: grid; gap: var(--s-8); grid-template-columns: repeat(auto-fill, minmax(min(100%, 12rem), 1fr)); margin-bottom: var(--s-12); }
.footer-group__title { font-size: var(--t-xs); text-transform: uppercase; letter-spacing: .07em; color: var(--fg-subtle); font-weight: 650; margin-bottom: var(--s-3); }
.footer-group ul { list-style: none; margin: 0; padding: 0; }
.footer-group li { margin-bottom: var(--s-2); }
.footer-group a { color: var(--fg-muted); text-decoration: none; }
.footer-group a:hover { color: var(--accent); }
.footer-bottom { display: flex; flex-wrap: wrap; gap: var(--s-4); justify-content: space-between; align-items: center; padding-top: var(--s-6); border-top: 1px solid var(--border); color: var(--fg-subtle); font-size: var(--t-xs); }
.disclaimer { color: var(--fg-subtle); font-size: var(--t-xs); line-height: var(--lh-snug); max-width: 70ch; margin-top: var(--s-4); }

/* --------------------------------------------------------------- 15. UTILITY */
.u-muted { color: var(--fg-muted); }
.u-subtle { color: var(--fg-subtle); }
.u-sm { font-size: var(--t-sm); }
.u-xs { font-size: var(--t-xs); }
.u-center { text-align: center; }
.u-mt-0 { margin-top: 0; }
.u-mb-0 { margin-bottom: 0; }
.u-mono { font-family: var(--font-mono); }
.u-nowrap { white-space: nowrap; }
.visually-hidden { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }

@media print {
  .site-header, .site-footer, .doc__toc, .btn, .menu-panel { display: none !important; }
  body { background: #fff; color: #000; }
  a[href^="http"]::after { content: " (" attr(href) ")"; font-size: 90%; }
}
