/* cruft.sh — ZOOM-brutalist design language.
   90s ZOOM voltage on neo-brutalist bones: six loud accents, thick ink borders,
   hard offset shadows, a bubbly rounded display face. Light ground by default;
   dark is a full second theme, not an inversion.
   See apparatus/arcs/2026-07-29-zoom-brutalist-design-language/arc.md */

:root {
  /* ZOOM palette */
  --teal:    #10BEC6;
  --lime:    #A6E220;
  --orange:  #FF6A1F;
  --grape:   #7A2CF0;
  --magenta: #FF2E93;
  --sun:     #FFC61E;
  --ink:     #141210;
  --paper:   #FBF7EA;

  /* sticky-nav height (nav-inner 62px + 2px border) plus breathing room. The
     alpha-banner scrolls away; only the nav stays sticky, so anchor/heading
     jumps offset by this clear the nav instead of hiding under it. */
  --nav-offset: 82px;

  /* semantic tokens (light) */
  --bg: var(--paper);
  --bg-soft: #FFFFFF;
  --panel: #FFFFFF;
  --border: var(--ink);
  --text: var(--ink);
  --muted: #5c584f;
  --accent: var(--orange);
  --accent-dim: #c8500f;
  --danger: var(--magenta);
  --code-bg: #FFFFFF;

  /* code token colors */
  --tk-typ: var(--grape);
  --tk-fn:  var(--orange);
  --tk-str: #0f8f6f;

  /* structure */
  --bw: 3px;
  --r: 6px;
  --r-pill: 999px;
  --sh-col: var(--ink);
  --sh: 6px 6px 0 var(--sh-col);
  --sh-sm: 3px 3px 0 var(--sh-col);
  --sh-lg: 10px 10px 0 var(--sh-col);

  --mono: ui-monospace, "SF Mono", "JetBrains Mono", Menlo, monospace;
  --sans: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --display: "Varela Round", system-ui, sans-serif;

  /* chart neutrals: two distinct dark greys for the non-hero series (the hero
     uses the --sun yellow). Both dark enough to carry a white in-bar label, and
     theme-invariant so that holds in dark mode too. */
  --chart-n1: #46413a;
  --chart-n2: #7c7263;
}

/* Dark is a designed second theme built on tonal layering, not a hard inversion:
   panels lift off the ground by fill rather than by a bright outline, borders are
   a muted warm grey instead of near-white, shadows sit close to the ground for a
   soft brutalist edge, and the accents are lifted so they read as colour on dark
   without glare. Keep the media-query and [data-theme="dark"] blocks identical. */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #1a1712;
    --bg-soft: #221e18;
    --panel: #26221a;
    --border: #423b2e;
    --text: #ece7db;
    --muted: #a79d88;
    --accent: var(--orange);
    --accent-dim: var(--sun);
    --code-bg: #201c15;
    --sh-col: #100c07;
    --grape: #9d6bff;
    --tk-typ: #9d6bff;
    --tk-str: #4fe0a6;
  }
}
:root[data-theme="dark"] {
  --bg: #1a1712;
  --bg-soft: #221e18;
  --panel: #26221a;
  --border: #423b2e;
  --text: #ece7db;
  --muted: #a79d88;
  --accent: var(--orange);
  --accent-dim: var(--sun);
  --code-bg: #201c15;
  --sh-col: #100c07;
  --grape: #9d6bff;
  --tk-typ: #9d6bff;
  --tk-str: #4fe0a6;
}
:root[data-theme="light"] {
  --bg: var(--paper);
  --bg-soft: #FFFFFF;
  --panel: #FFFFFF;
  --border: var(--ink);
  --text: var(--ink);
  --muted: #5c584f;
  --accent-dim: #c8500f;
  --code-bg: #FFFFFF;
  --sh-col: var(--ink);
  --tk-str: #0f8f6f;
}

* { box-sizing: border-box; }
/* Offset anchor/heading jumps so the sticky nav doesn't occlude the target.
   scroll-padding-top on the scroll container covers both fragment navigation
   (#heading links, incl. htmx-boosted) and programmatic scrollIntoView. Do not
   also set scroll-margin-top on the targets: the two stack and double the gap. */
html { -webkit-text-size-adjust: 100%; scroll-padding-top: var(--nav-offset); }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--sans);
  line-height: 1.6;
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
  /* Sticky footer: fill at least the viewport so short pages still push the
     footer to the bottom. main grows to take up any slack. */
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
}
main { flex: 1 0 auto; }
/* dotted paper texture */
body::before {
  content: "";
  position: fixed; inset: 0; z-index: -1; pointer-events: none;
  background-image: radial-gradient(var(--border) 1.2px, transparent 1.2px);
  background-size: 26px 26px; opacity: 0.05;
}

h1, h2, h3, h4, .brand { font-family: var(--display); font-weight: 800; letter-spacing: -0.01em; text-wrap: balance; }

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

.wrap { max-width: 1000px; margin: 0 auto; padding: 0 1.5rem; }

/* ── the sticker primitive ── */
.sticker,
.ui-card, .codebox, .codebox-solo, pre.code, .pipe-chip {
  border: var(--bw) solid var(--border);
  border-radius: var(--r);
  background: var(--panel);
  box-shadow: var(--sh);
}

/* ── nav ── */
/* The alpha-banner scrolls out of view; the nav alone stays sticky. */
.nav {
  position: sticky; top: 0; z-index: 10;
  background: var(--bg);
  border-bottom: var(--bw) solid var(--border);
}
.nav-inner {
  display: flex; align-items: center; justify-content: space-between;
  height: 62px; max-width: 1000px; margin: 0 auto; padding: 0 1.5rem;
}
.brand { display: flex; align-items: center; gap: 0.55rem; font-size: 1.35rem; color: var(--text); }
.brand:hover { text-decoration: none; }
.brand-mark {
  color: var(--ink); flex: 0 0 auto;
  background: var(--sun); border: var(--bw) solid var(--ink); border-radius: 9px;
  padding: 3px; box-shadow: var(--sh-sm); transform: rotate(-6deg); transition: transform .2s ease;
}
.brand:hover .brand-mark { transform: rotate(6deg); }

/* Cruft wordmark: the SVG used as a mask filled with the current text color, so
   it follows the theme (dark ink in light mode, paper in the footer) with no
   invert filter. */
.brand-wordmark, .footer-wordmark {
  display: inline-block; background: currentColor; aspect-ratio: 1663 / 646;
  -webkit-mask: url(/img/wordmark.svg) no-repeat center / contain;
  mask: url(/img/wordmark.svg) no-repeat center / contain;
}
.brand-wordmark { height: 1.3rem; }
.footer-wordmark { height: 1.25rem; }
/* right cluster: the text links plus the always-in-bar github + theme + burger. */
.nav-right { display: flex; align-items: center; gap: 0.4rem; }
.nav-links { display: flex; gap: 0.4rem; font-size: 0.92rem; align-items: center; }
.nav-links a {
  color: var(--text); font-weight: 700; padding: 0.3rem 0.7rem;
  border-radius: var(--r-pill); border: 2px solid transparent;
}
.nav-links a:hover { text-decoration: none; background: var(--sun); color: var(--ink); border-color: var(--ink); }

/* icon nav links (GitHub, etc.) — same footprint and hover as the toggle. Sits in
   .nav-right (bar), not inside .nav-links, so it stays visible on mobile. */
.nav-icon {
  display: inline-flex; align-items: center; justify-content: center;
  width: 34px; height: 34px; padding: 0; color: var(--text);
  border: 2px solid transparent; border-radius: var(--r-pill);
}
.nav-icon:hover { background: var(--sun); color: var(--ink); border-color: var(--ink); text-decoration: none; }
.nav-icon svg { display: block; }

/* theme toggle — a single icon button; the icon shown reflects the current
   effective theme (sun while dark, moon while light) across all four states. */
.theme-toggle {
  display: inline-flex; align-items: center; justify-content: center;
  width: 34px; height: 34px; margin-left: 0.35rem; padding: 0;
  color: var(--text); background: transparent; cursor: pointer;
  border: 2px solid transparent; border-radius: var(--r-pill);
  transition: background .15s ease, color .15s ease, border-color .15s ease;
}
.theme-toggle:hover { background: var(--sun); color: var(--ink); border-color: var(--ink); }
.theme-toggle svg { width: 18px; height: 18px; display: block; }
.theme-toggle .icon-sun { display: none; }
.theme-toggle .icon-moon { display: block; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .theme-toggle .icon-sun { display: block; }
  :root:not([data-theme="light"]) .theme-toggle .icon-moon { display: none; }
}
:root[data-theme="dark"] .theme-toggle .icon-sun { display: block; }
:root[data-theme="dark"] .theme-toggle .icon-moon { display: none; }
:root[data-theme="light"] .theme-toggle .icon-sun { display: none; }
:root[data-theme="light"] .theme-toggle .icon-moon { display: block; }

/* ── hero ── */
.hero { padding: 4.5rem 0 3rem; text-align: center; }
.hero h1 {
  font-size: clamp(2.3rem, 6vw, 4rem);
  line-height: 0.98; font-weight: 800; margin: 0 0 1.25rem; color: var(--text);
}
.hero p.tagline {
  font-size: 1.15rem; color: var(--text); max-width: 640px; margin: 0 auto 2.5rem; font-weight: 500;
}
.hero .accent { color: var(--grape); }

/* buttons (sticker) */
.btn {
  font-family: var(--display); font-weight: 800; font-size: 1rem; cursor: pointer;
  display: inline-flex; align-items: center; gap: 0.5rem; text-decoration: none;
  padding: 0.6rem 1.2rem; border-radius: var(--r-pill);
  border: var(--bw) solid var(--border); box-shadow: var(--sh);
  background: var(--panel); color: var(--text);
  transition: transform .1s ease, box-shadow .1s ease;
}
.btn:hover { transform: translate(-2px,-2px); box-shadow: var(--sh-lg); text-decoration: none; }
.btn:active { transform: translate(3px,3px); box-shadow: var(--sh-sm); }
.btn:focus-visible { outline: 3px dashed var(--grape); outline-offset: 3px; }
.btn-primary { background: var(--orange); color: #fff; }
.btn-teal { background: var(--teal); color: var(--ink); }
.btn-ghost { background: var(--panel); color: var(--text); }

/* A centered, wrapping row of related buttons — the "further reading" links at
   the foot of feature sections, promoted from a middot-separated link list. */
.btn-row { display: flex; flex-wrap: wrap; justify-content: center; gap: 0.75rem; margin-top: 1.75rem; }

/* ── releases ── */
/* A stacked, newest-first release log. Each entry is a sticker card; the status
   pill encodes state (lime = current, magenta = deprecated). Deprecated cards
   read back visually via a muted ground so a dead release can't be mistaken for
   the live one. */
.rel-list { display: flex; flex-direction: column; gap: 1.4rem; margin: 1.8rem 0; }
.rel { padding: 1.4rem 1.5rem; }
.rel-head { display: flex; align-items: baseline; flex-wrap: wrap; gap: 0.6rem 0.85rem; }
.rel-ver { margin: 0; font-size: 1.5rem; }
.rel-date { margin-left: auto; color: var(--muted); font-size: 0.9rem; font-variant-numeric: tabular-nums; }
.rel-badge {
  display: inline-block; font-family: var(--display); font-weight: 800; font-size: 0.7rem;
  letter-spacing: 0.03em; text-transform: uppercase;
  padding: 0.2rem 0.6rem; border-radius: var(--r-pill); border: 2px solid var(--border);
}
.rel-live { background: var(--lime); color: var(--ink); }
.rel-dead { background: var(--magenta); color: #fff; }
.rel-notes { margin: 1rem 0 0; padding-left: 1.15rem; }
.rel-notes li { margin: 0.3rem 0; }
.rel .install { margin-top: 1.1rem; }
.rel-warn { margin: 1rem 0 0; font-weight: 600; }
.rel.is-deprecated { background: color-mix(in srgb, var(--muted) 8%, var(--panel)); }
.rel.is-deprecated .rel-ver { color: var(--muted); text-decoration: line-through; text-decoration-thickness: 2px; }
.rel-links { margin-top: 2rem; color: var(--muted); font-size: 0.92rem; }

/* ── blog ── */
/* Index: a stacked list of post cards (sticker primitive). Post: a single prose
   column with a dated header. Both reuse the shared .prose body styling. */
.post-list { display: flex; flex-direction: column; gap: 1.4rem; margin: 1.8rem 0; }
.post-card { padding: 1.3rem 1.5rem; }
.post-card:hover { transform: translate(-2px,-2px); box-shadow: var(--sh-lg); transition: transform .1s ease, box-shadow .1s ease; }
.post-card-meta { margin: 0; color: var(--muted); font-size: 0.85rem; font-variant-numeric: tabular-nums; text-transform: uppercase; letter-spacing: 0.04em; }
.post-card-title { margin: 0.35rem 0 0.5rem; font-size: 1.4rem; }
.post-card-title a { color: var(--text); }
.post-card-title a:hover { color: var(--accent); text-decoration: none; }
.post-card-excerpt { margin: 0; color: var(--muted); }
.post-card-more { margin: 0.85rem 0 0; font-family: var(--display); font-weight: 800; }

.post-back { margin: 0 0 1.5rem; font-size: 0.9rem; }
.post-head { margin-bottom: 2rem; }
.post-byline { display: flex; align-items: center; gap: 0.7rem; margin-bottom: 0.9rem; }
.post-avatar {
  flex: 0 0 auto; display: inline-flex; align-items: center; justify-content: center;
  width: 40px; height: 40px; border-radius: var(--r-pill); overflow: hidden;
  border: 2px solid var(--border); background: var(--grape); color: #fff;
  font-family: var(--display); font-weight: 800; font-size: 0.9rem; letter-spacing: 0.01em;
  text-decoration: none; box-shadow: 2px 2px 0 var(--sh-col);
  transition: transform .1s ease, box-shadow .1s ease;
}
a.post-avatar:hover { transform: translate(-1px,-1px); box-shadow: 4px 4px 0 var(--sh-col); text-decoration: none; }
.post-avatar img { width: 100%; height: 100%; object-fit: cover; display: block; }
.post-meta { display: flex; flex-direction: column; margin: 0; }
.post-author { font-weight: 600; color: var(--text); line-height: 1.25; }
.post-date { color: var(--muted); font-size: 0.8rem; font-variant-numeric: tabular-nums; line-height: 1.25; }
.post-head h1 { margin: 0 0 0.6rem; }
.post-lede { margin: 0; font-size: 1.15rem; color: var(--muted); text-wrap: pretty; }
.post-foot { margin-top: 3rem; padding-top: 1.5rem; border-top: var(--bw) solid var(--border); font-family: var(--display); font-weight: 800; }

/* ── install box ── */
.install { max-width: 560px; margin: 0 auto; text-align: left; }
.install-cmd { position: relative; }
.install pre {
  background: var(--code-bg); border: var(--bw) solid var(--border);
  border-radius: var(--r); box-shadow: var(--sh); padding: 1rem 3.2rem 1rem 1.15rem; margin: 0 0 0.7rem;
  font-family: var(--mono); font-size: 0.9rem; overflow-x: auto;
}
.install-copy {
  position: absolute; top: 0.6rem; right: 0.65rem;
  display: inline-flex; align-items: center; justify-content: center;
  width: 34px; height: 34px; padding: 0; cursor: pointer;
  color: var(--muted); background: var(--bg); border: 2px solid var(--border);
  border-radius: var(--r); transition: background .12s ease, color .12s ease, border-color .12s ease;
}
.install-copy:hover { background: var(--sun); color: var(--ink); border-color: var(--ink); }
.install-copy:focus-visible { outline: 3px dashed var(--grape); outline-offset: 2px; }
.install-copy svg { display: block; }
.install-copy .icon-check { display: none; color: var(--lime); }
.install-copy.copied { color: var(--lime); border-color: var(--lime); background: var(--bg); }
.install-copy.copied .icon-copy { display: none; }
.install-copy.copied .icon-check { display: block; }
.install .prompt { color: var(--magenta); user-select: none; font-weight: 700; }
.install .alt { color: var(--muted); font-size: 0.82rem; text-align: center; }
.install .alt code { font-family: var(--mono); color: var(--text); }

/* Install-method tabs: styled like .btn (bordered, hard shadow, panel fill) but
   square-cornered, no hover lift, left-aligned to the command box beneath. */
.install .codetabs {
  justify-content: flex-start; flex-wrap: nowrap; gap: 0.4rem;
  background: transparent; border-bottom: 0; overflow: visible; margin-bottom: 0.7rem;
}
.install .codetab {
  font-family: var(--display); font-weight: 800; font-size: 0.9rem;
  padding: 0.5rem 1rem; border: var(--bw) solid var(--border); border-radius: var(--r);
  background: var(--panel); color: var(--text);
}
.install .codetab:hover { background: var(--panel); color: var(--text); }
.install .codetab.active { background: var(--sun); color: var(--ink); border-color: var(--ink); }
/* Restore the install command-box look inside a .codepanel (the generic
   .codepanel pre would otherwise strip the border/shadow). */
.install .codepanel pre {
  background: var(--code-bg); border: var(--bw) solid var(--border);
  border-radius: var(--r); box-shadow: var(--sh);
  padding: 1rem 3.2rem 1rem 1.15rem; margin: 0;
  font-family: var(--mono); font-size: 0.9rem; line-height: 1.5; overflow-x: auto;
}
.install-view {
  display: inline-flex; align-items: center; gap: 0.35rem; margin-top: 0.6rem;
  color: var(--muted); font-size: 0.82rem; text-decoration: none;
}
.install-view:hover { color: var(--magenta); }
.install-view:hover .icon-ext { color: var(--magenta); }
.install-view .icon-ext { color: var(--muted); transition: color .12s ease; }

/* ── bar charts (```chart blocks) ── */
.chart { margin: 1.8rem 0; }
.chart-title {
  font-family: var(--display); font-weight: 700; font-size: 0.95rem;
  color: var(--text); margin-bottom: 0.6rem;
}
.chart-svg { width: 100%; height: auto; display: block; overflow: visible; }
.chart-group { font-family: var(--mono); font-size: 12px; font-weight: 600; fill: var(--muted); transform: translateX(8px); }
.chart-value { font-family: var(--mono); font-size: 13px; font-weight: 700; fill: var(--text); }
.chart-inlabel { font-family: var(--display); font-size: 13px; font-weight: 800; fill: #fff; }
.chart-axis { stroke: var(--magenta); stroke-width: 2.5; }
.chart-note { margin-top: 0.5rem; font-size: 0.78rem; color: var(--muted); }
.chart-bar { transition: opacity .12s ease; }
.chart-bar:hover { opacity: 0.82; }
/* series colors: s0 is the hero (cruft) in the logo/alpha-banner yellow; s1/s2
   are the neutral field, dark enough to carry a white in-bar label in both
   themes. */
.chart-bar--s0 { fill: var(--sun); }
.chart-bar--s1 { fill: var(--chart-n1); }
.chart-bar--s2 { fill: var(--chart-n2); }

/* ── sections ── */
.section { padding: 3.5rem 0; border-top: var(--bw) solid var(--border); }
.section h2 { font-size: clamp(1.6rem, 3.5vw, 2.3rem); margin: 0 0 0.4rem; line-height: 1; }
.section .lead { color: var(--text); margin: 0 0 1.75rem; font-weight: 500; }
/* color-block section variants */
.block-teal { background: var(--teal); color: var(--ink); }
.block-lime { background: var(--lime); color: var(--ink); }
.block-grape { background: var(--grape); color: #fff; }
.block-teal h2, .block-lime h2, .block-grape h2,
.block-teal .lead, .block-lime .lead, .block-grape .lead { color: inherit; }

.grid { display: grid; gap: 1.5rem; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); }

.ui-card { padding: 1.3rem; transition: transform .12s ease, box-shadow .12s ease; }
.ui-card:hover { transform: translate(-3px,-3px); box-shadow: var(--sh-lg); }
.ui-card-title { margin: 0 0 0.4rem; font-size: 1.15rem; }
.ui-card-description { color: var(--muted); font-size: 0.9rem; margin: 0; }
.ui-card-content { color: var(--muted); font-size: 0.94rem; }
.ui-card-content p { margin: 0.5rem 0 0; }

.ui-badge {
  display: inline-block; font-family: var(--display); font-weight: 800; font-size: 0.74rem;
  padding: 0.22rem 0.65rem; border-radius: var(--r-pill); border: 2px solid var(--border);
  color: var(--ink); background: var(--sun);
}
.ui-badge-secondary { background: var(--lime); color: var(--ink); border-color: var(--ink); }
/* A badge used as a link (the card "View" action): button-like, no underline. */
a.ui-badge {
  text-decoration: none; cursor: pointer; box-shadow: 2px 2px 0 var(--sh-col);
  transition: transform .1s ease, box-shadow .1s ease;
}
a.ui-badge:hover { text-decoration: none; transform: translate(-1px,-1px); box-shadow: 3px 3px 0 var(--sh-col); }
a.ui-badge:active { transform: translate(1px,1px); box-shadow: 1px 1px 0 var(--sh-col); }

/* ── code blocks ── */
pre.code {
  padding: 1.15rem 1.25rem; overflow-x: auto;
  font-family: var(--mono); font-size: 0.86rem; line-height: 1.6; margin: 0;
  background: var(--code-bg);
}
pre.code .c, .tok-c { color: var(--muted); font-style: italic; }
pre.code .k, .tok-k { color: var(--magenta); font-weight: 600; }
pre.code .s, .tok-s { color: var(--tk-str); }
.tok-t { color: var(--tk-typ); font-weight: 600; }
.tok-f { color: var(--tk-fn); font-weight: 600; }

.two-col { display: grid; gap: 1.5rem; grid-template-columns: 1fr; align-items: center; }
/* Grid items default to min-width:auto, so a wide code block would force its
   column past 1fr and overflow the section. Let them shrink and hand scrolling
   back to the pre's own overflow-x. */
.two-col > * { min-width: 0; }
@media (min-width: 760px) { .two-col { grid-template-columns: 1fr 1fr; } }

/* ── code showcase (tabbed) ── */
.codebox { max-width: 820px; margin: 0 auto; overflow: hidden; border-radius: var(--r); }
.codetabs {
  display: flex; gap: 0; overflow-x: auto;
  background: var(--bg-soft); border-bottom: var(--bw) solid var(--border); scrollbar-width: none;
}
.codetabs::-webkit-scrollbar { display: none; }
.codetab {
  appearance: none; background: transparent; border: 0; cursor: pointer;
  color: var(--muted); font-family: var(--display); font-weight: 700; font-size: 0.88rem;
  padding: 0.85rem 1.15rem; white-space: nowrap;
  border-bottom: 4px solid transparent; transition: color .12s, border-color .12s, background .12s;
}
.codetab:hover { color: var(--text); background: color-mix(in srgb, var(--sun) 35%, transparent); }
.codetab.active { color: var(--text); border-bottom-color: var(--magenta); }
.codetab .dot { color: var(--magenta); margin-right: 0.4rem; font-size: 0.7rem; }

.codepanel { display: none; }
.codepanel.active { display: block; }
.codepanel pre {
  margin: 0; padding: 1.35rem 1.5rem; overflow-x: auto;
  font-family: var(--mono); font-size: 0.86rem; line-height: 1.65; background: var(--code-bg);
}
.codecap {
  padding: 0.8rem 1.5rem 1rem; margin: 0; color: var(--muted); font-size: 0.82rem;
  border-top: var(--bw) solid var(--border); background: var(--bg-soft);
}
.codecap code { font-family: var(--mono); color: var(--text); }
.codecap strong { color: var(--grape); }

/* ── no-build-step pipeline diagram ── */
.pipeline { max-width: 820px; margin: 0 auto; display: flex; flex-direction: column; gap: 1rem; }
.pipe-row { display: grid; grid-template-columns: 1fr; gap: 0.5rem; }
@media (min-width: 720px) { .pipe-row { grid-template-columns: 130px 1fr; align-items: center; gap: 1rem; } }
/* the chip+arrow flow: a wrapping flex row so chips reflow onto new lines with real
   vertical spacing on narrow screens instead of overlapping as inline-blocks. */
.pipe-lane { display: flex; flex-wrap: wrap; align-items: center; gap: 0.45rem 0.5rem; }
.pipe-label { font-size: 0.85rem; color: var(--muted); font-weight: 700; }
.pipe-chip {
  font-family: var(--mono); font-size: 0.82rem; padding: 0.5rem 0.85rem;
  box-shadow: var(--sh-sm); white-space: nowrap;
}
.pipe-arrow { color: var(--muted); font-size: 1rem; }
.pipe-row.usual .pipe-chip { opacity: 0.7; }
.pipe-row.usual .pipe-chip.build { border-style: dashed; border-color: var(--magenta); color: var(--magenta); }
.pipe-row.cruft .pipe-label { color: var(--grape); font-family: var(--display); font-weight: 800; }
.pipe-row.cruft .pipe-chip { border-color: var(--ink); background: color-mix(in srgb, var(--teal) 22%, var(--panel)); }
.pipe-note { font-size: 0.78rem; color: var(--muted); margin-left: 0.25rem; }
.pipe-note.good { color: var(--grape); font-weight: 700; }

/* ── comparison table ── */
.cmp { max-width: 900px; margin: 0 auto; overflow-x: auto; }
.cmp table {
  width: 100%; border-collapse: separate; border-spacing: 0; font-size: 0.88rem; min-width: 640px;
  border: var(--bw) solid var(--border); border-radius: var(--r); box-shadow: var(--sh); overflow: hidden; background: var(--panel);
}
.cmp th, .cmp td { padding: 0.7rem 0.9rem; text-align: left; border-bottom: 2px solid var(--border); vertical-align: top; }
.cmp thead th { color: var(--ink); background: var(--sun); font-family: var(--display); font-weight: 800; font-size: 0.82rem; }
.cmp tbody th { color: var(--text); font-weight: 700; white-space: nowrap; }
.cmp td { color: var(--muted); }
.cmp tbody tr:last-child th, .cmp tbody tr:last-child td { border-bottom: 0; }
.cmp .col-cruft { background: color-mix(in srgb, var(--teal) 16%, transparent); }
.cmp thead .col-cruft { color: var(--ink); background: var(--teal); font-family: var(--display); font-weight: 800; }
.cmp td code { font-family: var(--mono); font-size: 0.85em; color: var(--text); }
.cmp-note { max-width: 900px; margin: 1rem auto 0; color: var(--muted); font-size: 0.8rem; text-align: center; }

/* ── chip grid ── a grouped, wrapping grid of sticker chips for "category ->
   long list of items" data (module inventories, feature lists) that otherwise
   crams a paragraph with inline code. Rendered from a ```chips block. */
.chip-groups { display: flex; flex-direction: column; gap: 1.4rem; margin: 1.6rem 0; }
.chip-group-label {
  font-family: var(--display); font-weight: 800; text-transform: uppercase;
  letter-spacing: 0.05em; font-size: 0.74rem; color: var(--grape); margin-bottom: 0.6rem;
}
.chip-grid { display: flex; flex-wrap: wrap; gap: 0.55rem; }
.chip {
  font-family: var(--mono); font-size: 0.82rem; line-height: 1.2;
  padding: 0.35rem 0.65rem; border: 2px solid var(--border); border-radius: 7px;
  background: var(--panel); color: var(--text); box-shadow: 2px 2px 0 var(--sh-col);
  max-width: 100%; overflow-wrap: anywhere;
}
.chip-partial { background: var(--sun); color: var(--ink); }

/* ── keep-reading footer ── the "what to read next" block that closes a doc,
   rendered from a ```next fence. A labeled set of link cards. */
/* ── security / warning callout (```warn) ── loud brutalist danger sticker ── */
.docs-callout {
  margin: 2rem 0; padding: 1.25rem 1.4rem;
  border: var(--bw) solid var(--border); border-radius: var(--r);
  box-shadow: var(--sh); background: var(--panel);
}
.docs-callout-danger {
  background: color-mix(in srgb, var(--magenta) 12%, var(--panel));
  border-color: var(--magenta);
  box-shadow: 6px 6px 0 var(--magenta);
}
.docs-callout-head { display: flex; align-items: center; gap: 0.6rem; margin-bottom: 0.5rem; }
.docs-callout-icon { flex: 0 0 auto; color: var(--magenta); }
.docs-callout-title {
  font-family: var(--display); font-weight: 800; font-size: 1.2rem;
  letter-spacing: -0.01em; color: var(--text);
}
.docs-callout-body > p { margin: 0.5rem 0 0; }
.docs-callout-body > p:first-child { margin-top: 0; }
.docs-callout-body code { background: color-mix(in srgb, var(--magenta) 16%, transparent); }

.docs-next { margin: 2.5rem 0 0.5rem; border-top: var(--bw) solid var(--border); padding-top: 1.5rem; }
.docs-next-label {
  font-family: var(--display); font-weight: 800; text-transform: uppercase;
  letter-spacing: 0.05em; font-size: 0.74rem; color: var(--grape); margin-bottom: 0.9rem;
}
.docs-next-grid { display: flex; flex-direction: column; gap: 0.7rem; }
.docs-article a.docs-next-card {
  display: flex; flex-direction: column; gap: 0.2rem;
  padding: 0.8rem 1rem; border: var(--bw) solid var(--border); border-radius: var(--r);
  background: var(--panel); box-shadow: var(--sh-sm);
  text-decoration: none; color: var(--text); font-weight: 400;
  transition: transform 0.08s ease, box-shadow 0.08s ease;
}
.docs-article a.docs-next-card:hover {
  transform: translate(-2px, -2px); box-shadow: 5px 5px 0 var(--sh-col); text-decoration: none;
}
.docs-next-title { font-family: var(--display); font-weight: 800; font-size: 0.98rem; color: var(--grape); }
.docs-article a.docs-next-card:hover .docs-next-title { text-decoration: underline; text-underline-offset: 2px; }
.docs-next-why { color: var(--muted); font-size: 0.85rem; line-height: 1.45; max-width: 74ch; }
@media (prefers-reduced-motion: reduce) { .docs-next-card { transition: none; } }

/* ── flow diagram ── an ordered set of numbered step cards, rendered from a
   ```flow fence. The styled replacement for ASCII box-drawings: accessible,
   theme-aware, and reflows on narrow screens. */
.docs-flow {
  margin: 1.8rem 0; border: var(--bw) solid var(--border); border-radius: var(--r);
  background: var(--panel); box-shadow: var(--sh-sm); overflow: hidden;
}
.docs-flow-title {
  font-family: var(--display); font-weight: 800; text-transform: uppercase;
  letter-spacing: 0.05em; font-size: 0.74rem; color: var(--grape);
  padding: 0.6rem 1rem; border-bottom: 2px solid var(--border);
}
.docs-flow-steps { counter-reset: flowstep; list-style: none; margin: 0; padding: 0; }
.docs-flow-step {
  display: grid; grid-template-columns: auto 1fr; column-gap: 0.9rem; row-gap: 0.15rem;
  align-items: start; padding: 0.85rem 1rem;
}
.docs-flow-step + .docs-flow-step { border-top: 2px solid var(--border); }
.docs-flow-step::before {
  counter-increment: flowstep; content: counter(flowstep);
  grid-row: 1 / span 2; grid-column: 1;
  width: 1.75rem; height: 1.75rem; display: grid; place-items: center;
  font-family: var(--display); font-weight: 800; font-size: 0.88rem;
  background: var(--sun); color: var(--ink);
  border: 2px solid var(--border); border-radius: 6px; box-shadow: 2px 2px 0 var(--sh-col);
}
.docs-flow-head {
  grid-column: 2; font-family: var(--display); font-weight: 800;
  font-size: 0.95rem; color: var(--grape); align-self: center;
}
.docs-flow-text {
  grid-column: 2; color: var(--text); font-size: 0.9rem; line-height: 1.5;
}
.docs-flow-text code, .docs-flow-head code { font-size: 0.85em; }

/* ── stack diagram ── labeled, unnumbered layers for architecture and
   dependency stacks (top layer first), rendered from a ```stack fence. */
.docs-stack {
  margin: 1.8rem 0; border: var(--bw) solid var(--border); border-radius: var(--r);
  background: var(--panel); box-shadow: var(--sh-sm); overflow: hidden;
}
.docs-stack-title {
  font-family: var(--display); font-weight: 800; text-transform: uppercase;
  letter-spacing: 0.05em; font-size: 0.74rem; color: var(--grape);
  padding: 0.6rem 1rem; border-bottom: 2px solid var(--border);
}
.docs-stack-layer {
  display: grid; grid-template-columns: minmax(7rem, 13rem) 1fr;
  column-gap: 1rem; align-items: baseline; padding: 0.8rem 1rem;
}
.docs-stack-layer + .docs-stack-layer { border-top: 2px solid var(--border); }
.docs-stack-name {
  font-family: var(--display); font-weight: 800; font-size: 0.92rem; color: var(--grape);
}
.docs-stack-body { color: var(--text); font-size: 0.9rem; line-height: 1.5; }
.docs-stack-body code, .docs-stack-name code { font-size: 0.85em; }
@media (max-width: 620px) {
  .docs-stack-layer { grid-template-columns: 1fr; row-gap: 0.15rem; }
}

/* ── security page ── */
.sec-badge {
  display: inline-block; font-family: var(--display); font-weight: 800; font-size: 0.78rem;
  letter-spacing: 0.04em; text-transform: uppercase; color: var(--ink);
  border: var(--bw) solid var(--ink); border-radius: var(--r-pill); background: var(--magenta);
  box-shadow: var(--sh-sm); padding: 0.28rem 0.85rem; margin-bottom: 1.5rem; color: #fff;
}
/* Keep a proper-name badge (e.g. CruftScript™) in its own casing, not uppercased. */
.sec-badge-cased { text-transform: none; letter-spacing: 0; }

/* "A situation where it shines" step accordion. */
.scenario-lead { max-width: 60ch; margin-bottom: 1.6rem; }
.cs-accordion { display: flex; flex-direction: column; gap: 0.8rem; max-width: 840px; }
.cs-step {
  border: var(--bw) solid var(--ink); border-radius: var(--r);
  background: var(--bg-soft); box-shadow: var(--sh-sm); overflow: hidden;
}
.cs-step > summary {
  list-style: none; cursor: pointer; display: flex; align-items: center; gap: 0.85rem;
  padding: 0.9rem 1.1rem; font-family: var(--display); font-weight: 800; font-size: 1.02rem;
  color: var(--text);
}
.cs-step > summary::-webkit-details-marker { display: none; }
.cs-num {
  flex: none; width: 1.7rem; height: 1.7rem; border-radius: 999px;
  display: grid; place-items: center; font-size: 0.9rem;
  background: var(--sun); color: var(--ink); border: 2px solid var(--ink);
}
.cs-step[open] .cs-num { background: var(--magenta); color: #fff; }
.cs-title { flex: 1; }
.cs-step > summary::after { content: "+"; font-weight: 800; color: var(--muted); font-size: 1.25rem; line-height: 1; }
.cs-step[open] > summary::after { content: "\2212"; }
.cs-panel { padding: 0 1.1rem 1.1rem; }
.cs-panel p { color: var(--text); margin: 0 0 0.85rem; max-width: 62ch; }
.cs-panel .code { margin: 0; }

.sec-hero { padding-bottom: 2rem; }
.sec-hero .codebox-solo { margin-top: 2.5rem; }
.codebox-solo { max-width: 640px; margin: 0 auto; text-align: left; overflow: hidden; border-radius: var(--r); }
.codebox-solo .codebar {
  display: flex; align-items: center; gap: 0.4rem;
  padding: 0.7rem 1rem; border-bottom: var(--bw) solid var(--border); background: var(--bg-soft);
}
.codebox-solo .codebar .dot { width: 12px; height: 12px; border-radius: 50%; border: 2px solid var(--ink); }
.codebox-solo .codebar .dot:nth-child(1) { background: var(--magenta); }
.codebox-solo .codebar .dot:nth-child(2) { background: var(--sun); }
.codebox-solo .codebar .dot:nth-child(3) { background: var(--lime); }
.codebox-solo .codebar .name { margin-left: 0.5rem; font-family: var(--mono); font-size: 0.75rem; color: var(--muted); }
.codebox-solo pre { margin: 0; padding: 1.25rem 1.4rem; overflow-x: auto; font-family: var(--mono); font-size: 0.82rem; line-height: 1.65; background: var(--code-bg); }

.sec-feature { border-top: var(--bw) solid var(--border); }
.sec-feature .kicker {
  font-family: var(--display); font-size: 0.8rem; letter-spacing: 0.04em;
  text-transform: uppercase; color: var(--grape); font-weight: 800; margin: 0 0 0.5rem;
}
.sec-out { display: block; margin-top: 0.4rem; padding-top: 0.6rem; border-top: 2px dashed var(--border); color: var(--muted); }
.sec-out .ok { color: #0f8f6f; font-weight: 700; }
.sec-out .stop { color: var(--magenta); font-weight: 700; }

/* ── footer ── */
.footer {
  border-top: var(--bw) solid var(--border); padding: 3rem 0 2.5rem;
  color: var(--paper); font-size: 0.9rem; background: var(--ink);
}
.footer-grid {
  display: grid; grid-template-columns: 1fr; gap: 2.25rem;
}
@media (min-width: 720px) {
  .footer-grid { grid-template-columns: 1.6fr 1fr 1fr 1fr; gap: 2rem; }
}
.footer-brand { display: flex; flex-direction: column; gap: 0.9rem; max-width: 30ch; }
.footer-logo { display: inline-flex; align-items: center; gap: 0.5rem; color: var(--paper); font-family: var(--display); font-weight: 800; font-size: 1.3rem; }
.footer-logo:hover { text-decoration: none; }
.footer-logo .brand-mark { color: var(--ink); background: var(--sun); border: 2px solid var(--paper); border-radius: 8px; padding: 3px; }
.footer-tag { margin: 0; color: #c9c1ad; font-size: 0.85rem; line-height: 1.55; }
.footer-gh {
  display: inline-flex; align-items: center; justify-content: center;
  width: 38px; height: 38px; color: var(--paper);
  border: 2px solid #4a4436; border-radius: var(--r-pill);
}
.footer-gh:hover { background: var(--sun); color: var(--ink); border-color: var(--sun); }
.footer-social { display: flex; gap: 0.6rem; }
.footer-col { display: flex; flex-direction: column; gap: 0.6rem; }
.footer-col h4 {
  margin: 0 0 0.3rem; font-family: var(--display); font-weight: 800;
  font-size: 0.72rem; letter-spacing: 0.07em; text-transform: uppercase; color: var(--sun);
}
.footer-col a { color: #d8d1bf; font-weight: 500; }
.footer-col a:hover { color: var(--paper); text-decoration: underline; text-underline-offset: 2px; }
.footer-base {
  display: flex; flex-wrap: wrap; justify-content: space-between; align-items: flex-start; gap: 0.5rem 1.5rem;
  margin-top: 2.75rem; padding-top: 1.5rem; border-top: 1px solid #3a352b;
  color: #9c957f; font-family: var(--mono); font-size: 0.78rem;
}
.footer-base-left { display: flex; flex-direction: column; gap: 0.35rem; }
.footer-base-fine { font-size: 0.68rem; opacity: 0.8; }

/* ── forms (careers, licensing) ── */
.form-page { max-width: 680px; }
.form { display: flex; flex-direction: column; gap: 1.1rem; margin: 2.25rem 0 0; }
.form[hidden] { display: none; }
.form-row { display: flex; flex-direction: column; gap: 0.4rem; }
.form-row label { font-family: var(--display); font-weight: 700; font-size: 0.92rem; }
.form-hint { font-weight: 400; color: var(--muted); font-size: 0.82rem; }
.form input, .form select, .form textarea {
  font: inherit; font-size: 0.95rem; color: var(--text); background: var(--bg-soft);
  border: var(--bw) solid var(--border); border-radius: var(--r);
  padding: 0.6rem 0.75rem; box-shadow: var(--sh-sm); width: 100%;
}
.form textarea { resize: vertical; }
.form input:focus, .form select:focus, .form textarea:focus {
  outline: none; border-color: var(--grape); box-shadow: 4px 4px 0 var(--grape);
}
.form-hp { position: absolute; left: -9999px; width: 1px; height: 1px; opacity: 0; }
.form .btn { align-self: flex-start; margin-top: 0.4rem; cursor: pointer; }
.form-fineprint { color: var(--muted); font-size: 0.8rem; margin: 0.2rem 0 0; }
.form-success {
  border: var(--bw) solid var(--lime); border-radius: var(--r);
  background: var(--panel); box-shadow: var(--sh-sm); padding: 1rem 1.25rem; margin: 1.5rem 0;
}
.form-error {
  border: var(--bw) solid var(--magenta); border-radius: var(--r);
  background: var(--panel); box-shadow: var(--sh-sm); padding: 1rem 1.25rem; margin: 1.5rem 0;
}
.notice {
  border: var(--bw) solid var(--border); border-radius: var(--r);
  background: var(--panel); box-shadow: var(--sh-sm);
  padding: 1.1rem 1.35rem; margin: 2rem 0; color: var(--text);
}

/* ── docs layout ── */
.docs-wrap {
  max-width: 1120px; margin: 0 auto; padding: 2rem 1.5rem 4rem;
  display: grid; grid-template-columns: 1fr; gap: 2.5rem;
}
@media (min-width: 860px) { .docs-wrap { grid-template-columns: 240px 1fr; } }

.docs-sidebar { align-self: start; }
@media (min-width: 860px) { .docs-sidebar { position: sticky; top: calc(var(--nav-offset) + 4px); max-height: calc(100vh - var(--nav-offset) - 16px); overflow-y: auto; padding-right: 4px; } }

/* ── brutalist scrollbars ── chunky magenta pill with an ink border ── */
.docs-sidebar,
pre.code, .codepanel pre, .codebox-solo pre, .cmp, .table-wrap, .prose table, .codetabs {
  scrollbar-width: thin;
  scrollbar-color: var(--magenta) transparent;
}
.docs-sidebar::-webkit-scrollbar,
pre.code::-webkit-scrollbar, .codepanel pre::-webkit-scrollbar, .codebox-solo pre::-webkit-scrollbar,
.cmp::-webkit-scrollbar, .table-wrap::-webkit-scrollbar, .prose table::-webkit-scrollbar, .codetabs::-webkit-scrollbar {
  width: 14px; height: 14px;
}
.docs-sidebar::-webkit-scrollbar-track,
pre.code::-webkit-scrollbar-track, .codepanel pre::-webkit-scrollbar-track, .codebox-solo pre::-webkit-scrollbar-track,
.cmp::-webkit-scrollbar-track, .table-wrap::-webkit-scrollbar-track, .prose table::-webkit-scrollbar-track, .codetabs::-webkit-scrollbar-track {
  background: transparent;
}
.docs-sidebar::-webkit-scrollbar-thumb,
pre.code::-webkit-scrollbar-thumb, .codepanel pre::-webkit-scrollbar-thumb, .codebox-solo pre::-webkit-scrollbar-thumb,
.cmp::-webkit-scrollbar-thumb, .table-wrap::-webkit-scrollbar-thumb, .prose table::-webkit-scrollbar-thumb, .codetabs::-webkit-scrollbar-thumb {
  background: var(--magenta);
  border: 2px solid var(--border);
  border-radius: var(--r-pill);
  background-clip: padding-box;
}
.docs-sidebar::-webkit-scrollbar-thumb:hover,
pre.code::-webkit-scrollbar-thumb:hover, .codepanel pre::-webkit-scrollbar-thumb:hover, .codebox-solo pre::-webkit-scrollbar-thumb:hover,
.cmp::-webkit-scrollbar-thumb:hover, .table-wrap::-webkit-scrollbar-thumb:hover, .prose table::-webkit-scrollbar-thumb:hover, .codetabs::-webkit-scrollbar-thumb:hover {
  background: var(--grape);
}
.docs-sidebar::-webkit-scrollbar-corner,
pre.code::-webkit-scrollbar-corner, .codebox-solo pre::-webkit-scrollbar-corner { background: transparent; }

.docs-nav {
  border: var(--bw) solid var(--border); border-radius: var(--r);
  box-shadow: var(--sh); background: var(--panel); padding: 1rem 0.75rem;
}
.docs-nav-section { margin-bottom: 1.25rem; }
.docs-nav-title {
  font-family: var(--display); font-size: 0.74rem; text-transform: uppercase; letter-spacing: 0.05em;
  color: var(--grape); font-weight: 800; margin-bottom: 0.4rem; padding-left: 0.6rem;
}
.docs-nav a {
  display: block; padding: 0.28rem 0.7rem; margin: 0.12rem 0;
  color: var(--text); font-size: 0.9rem; font-weight: 500; border: 2px solid transparent; border-radius: var(--r-pill);
}
.docs-nav a:hover { background: var(--sun); color: var(--ink); text-decoration: none; }
.docs-nav a.active { background: var(--magenta); color: #fff; border-color: var(--ink); font-weight: 700; }

.docs-article { min-width: 0; line-height: 1.75; }
/* Cap the reading measure so prose lines don't run the full column width.
   Code blocks, tables, chip grids, and the pipeline map stay full width. */
.docs-article p, .docs-article li { max-width: 74ch; }
.docs-article p { margin: 0 0 1.1rem; }
.docs-article h1:first-child { margin-top: 0; }
/* ── page summary lede ── the plain-English frontmatter `summary:`, rendered
   directly under the title as a scannable intro before the body proper. */
.docs-article .docs-lede {
  font-size: 1.18rem; line-height: 1.55; font-weight: 600; color: var(--text);
  max-width: 74ch; margin: 0.4rem 0 2rem; padding: 1.1rem 1.3rem 1.15rem;
  background: var(--bg-soft); border: var(--bw) solid var(--border);
  border-left: 6px solid var(--grape); border-radius: var(--r);
  box-shadow: var(--sh-sm);
}
.docs-article .docs-lede::before {
  content: "In brief"; display: block;
  font-family: var(--display); font-weight: 800; text-transform: uppercase;
  letter-spacing: 0.06em; font-size: 0.7rem; color: var(--grape);
  margin-bottom: 0.55rem;
}
.docs-article pre.code { margin: 1.5rem 0; position: relative; }
.docs-article pre.code[data-lang] { padding-top: 2rem; }
.docs-article pre.code[data-lang]::before {
  content: attr(data-lang);
  position: absolute; top: 0; left: 0; z-index: 1;
  font-family: var(--display); font-size: 0.68rem; font-weight: 800;
  letter-spacing: 0.06em; text-transform: uppercase; color: #fff; background: var(--grape);
  border-right: var(--bw) solid var(--border); border-bottom: var(--bw) solid var(--border);
  border-bottom-right-radius: var(--r);
  padding: 0.25rem 0.7rem; pointer-events: none; user-select: none;
}
.docs-article pre.code code { display: block; }
.docs-article pre.code .c, .docs-article pre.code .tok-c { color: var(--muted); }
.docs-article pre.code .k, .docs-article pre.code .tok-k { color: var(--magenta); }
.docs-article pre.code .s, .docs-article pre.code .tok-s { color: var(--tk-str); }
.docs-article pre.code .tok-t { color: var(--grape); }
.docs-article pre.code .tok-f { color: var(--orange); }
.docs-article pre.code .prompt { color: var(--magenta); }
.docs-article pre.code code, .prose pre.code code {
  background: none; padding: 0; border: 0; border-radius: 0; font-size: inherit;
}
.docs-article :not(pre) > code {
  background: var(--bg-soft); border: 1px solid var(--border);
  border-radius: 5px; padding: 0.08rem 0.4rem; font-size: 0.85em; color: var(--text);
  /* keep the box + padding intact when an inline chip wraps across a line */
  -webkit-box-decoration-break: clone; box-decoration-break: clone;
}
.docs-article ul, .docs-article ol { color: var(--text); padding-left: 1.25rem; }
.docs-article li { margin: 0.3rem 0; }
.docs-article blockquote {
  margin: 1.5rem 0; padding: 0.85rem 1.1rem; border: var(--bw) solid var(--border);
  border-left-width: 8px; border-left-color: var(--sun);
  background: var(--panel); color: var(--text); border-radius: var(--r); box-shadow: var(--sh-sm);
}
.docs-article blockquote strong { color: var(--grape); }
.docs-article hr { border: 0; border-top: var(--bw) dashed var(--border); margin: 2.5rem 0; }
.docs-article a { color: var(--grape); text-decoration: underline; text-underline-offset: 2px; font-weight: 600; }

/* ── prose (docs pages) ── keep long-form readable: ink on paper ── */
.prose h1 { font-size: clamp(1.9rem, 4vw, 2.6rem); margin: 2.5rem 0 1rem; line-height: 1; color: var(--text); }
.prose h1:first-child { border-bottom: var(--bw) solid var(--border); padding-bottom: 0.6rem; }
.prose h2 { font-size: 1.5rem; margin: 2.2rem 0 0.6rem; color: var(--text); }
.prose h2::before { content: "\25A0"; color: var(--magenta); margin-right: 0.5rem; font-size: 0.7em; vertical-align: 0.12em; }
.prose h3 { font-size: 1.2rem; margin: 1.6rem 0 0.5rem; }
.prose p { color: var(--text); }
.prose code { font-family: var(--mono); background: var(--bg-soft); padding: 0.05rem 0.35rem; border-radius: 5px; font-size: 0.88em; color: var(--text); border: 2px solid var(--border); }
/* Tables scroll inside this wrapper rather than overflowing (and being clipped
   by the page's overflow-x: hidden). */
.table-wrap { overflow-x: auto; max-width: 100%; margin: 1.5rem 0; }
.prose table {
  width: 100%; border-collapse: separate; border-spacing: 0; margin: 0; font-size: 0.9rem;
  border: var(--bw) solid var(--border); border-radius: var(--r); box-shadow: var(--sh-sm); overflow: hidden;
}
/* Long unbroken tokens (identifiers, URLs) wrap instead of forcing overflow. */
.docs-article, .docs-article p, .docs-article li,
.prose table td, .prose table th { overflow-wrap: break-word; }
.prose th, .prose td { text-align: left; padding: 0.55rem 0.8rem; border-bottom: 2px solid var(--border); }
.prose thead th { color: var(--ink); background: var(--sun); font-family: var(--display); font-weight: 800; }
.prose tbody tr:last-child td { border-bottom: 0; }
.prose td { color: var(--text); }

/* Collapsible drill-downs (e.g. the enumerated conformance receipts). */
.prose details { margin: 1.5rem 0; }
.prose summary { cursor: pointer; font-weight: 600; padding: 0.25rem 0; }
.prose details > *:not(summary) { margin-top: 0.9rem; }

/* Security-page disclaimer: full-width warning strip below the nav. */
.sec-disclaimer {
  background: var(--magenta); color: #fff;
  border-bottom: var(--bw) solid var(--ink);
}
.sec-disclaimer .wrap {
  padding: 0.7rem 1.5rem;
  font-family: var(--display); font-weight: 800; font-size: 0.92rem;
  line-height: 1.4; text-align: center;
}

/* Alpha release notice: sun sticker banner above the nav. */
.alpha-banner {
  background: var(--sun); color: var(--ink); text-align: center;
  font-family: var(--display); font-size: 0.84rem; font-weight: 800; letter-spacing: 0;
  padding: 0.5rem 1rem; border-bottom: var(--bw) solid var(--ink);
}

/* ── licensing: call-out cards + full license documents ── */
.license-callouts { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; margin: 1.6rem 0 2rem; }
@media (max-width: 620px) { .license-callouts { grid-template-columns: 1fr; } }
a.license-callout {
  display: flex; flex-direction: column; gap: 0.35rem;
  padding: 1.1rem 1.2rem; border: var(--bw) solid var(--border); border-radius: var(--r);
  background: var(--panel); box-shadow: var(--sh-sm);
  text-decoration: none; color: var(--text);
  transition: transform 0.08s ease, box-shadow 0.08s ease;
}
a.license-callout:hover { transform: translate(-2px, -2px); box-shadow: 5px 5px 0 var(--sh-col); text-decoration: none; }
.license-callout-name { font-family: var(--display); font-weight: 800; font-size: 1.05rem; color: var(--grape); }
.license-callout-desc { color: var(--muted); font-size: 0.9rem; line-height: 1.45; }
.license-callout-more {
  font-family: var(--display); font-weight: 700; font-size: 0.76rem;
  text-transform: uppercase; letter-spacing: 0.05em; margin-top: 0.15rem;
}
.license-doc { margin-top: 2.5rem; padding-top: 1.5rem; border-top: var(--bw) solid var(--border); scroll-margin-top: 90px; }
.license-verbatim {
  font-family: var(--mono); font-size: 0.78rem; line-height: 1.55; white-space: pre-wrap;
  overflow-x: auto; background: var(--panel); border: 2px solid var(--border);
  border-radius: var(--r); padding: 1rem 1.1rem; margin: 1rem 0;
}

/* License rendered as flowing text (replaces the verbatim <pre>) */
.license-body { margin: 1.2rem 0 0; }
.license-body h3 { font-size: 1.08rem; margin: 1.9rem 0 0.7rem; }
.license-informative { color: var(--muted); font-weight: 500; font-size: 0.82em; }
.license-body .license-copyright { font-weight: 600; }
.license-rule { border: 0; border-top: 1.5px solid var(--border); margin: 2rem 0; }
.license-params { margin: 1.2rem 0; }
.license-params dt {
  font-family: var(--display); font-weight: 800; color: var(--grape);
  font-size: 0.78rem; letter-spacing: 0.08em; text-transform: uppercase;
  margin: 1.8rem 0 0.5rem;
}
.license-params dt:first-child { margin-top: 0; }
.license-params dd { margin: 0; }
.license-params dd p { margin: 0 0 0.8rem; }
.license-params dd p:last-child { margin-bottom: 0; }
.license-contact { margin-top: 1.4rem; color: var(--muted); font-size: 0.92rem; }
.license-terms, .license-notes { margin: 1.1rem 0; padding-left: 1.5rem; }
.license-terms li { margin-bottom: 0.85rem; }
.license-notes li { margin-bottom: 0.75rem; }

/* Constraint ledger */
.ledger { width: 100%; border-collapse: collapse; font-size: 0.9rem; }
.ledger th, .ledger td { text-align: left; vertical-align: top; padding: 0.55rem 0.7rem; border-bottom: 1px solid var(--border); }
.ledger thead th { font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.06em; color: var(--muted); white-space: nowrap; }
.ledger td:first-child { font-family: var(--mono); font-size: 0.8rem; color: var(--muted); white-space: nowrap; }
.ledger td:nth-child(2) { font-weight: 600; }
.ledger td:last-child { white-space: nowrap; }
.disp {
  display: inline-block; font-family: var(--mono); font-size: 0.68rem; font-weight: 700;
  letter-spacing: 0.03em; padding: 0.15rem 0.5rem; border-radius: var(--r-pill);
  border: 1.5px solid currentColor;
}
.disp-keep   { color: #2f7d3a; }
.disp-change { color: #b9760a; }
.disp-shed   { color: #c0392b; }
@media (prefers-color-scheme: dark) {
  .disp-keep   { color: #6fd67f; }
  .disp-change { color: #e0a94a; }
  .disp-shed   { color: #f08476; }
}
:root[data-theme="dark"] .disp-keep   { color: #6fd67f; }
:root[data-theme="dark"] .disp-change { color: #e0a94a; }
:root[data-theme="dark"] .disp-shed   { color: #f08476; }
:root[data-theme="light"] .disp-keep   { color: #2f7d3a; }
:root[data-theme="light"] .disp-change { color: #b9760a; }
:root[data-theme="light"] .disp-shed   { color: #c0392b; }
.ledger-summary { margin-top: 1.2rem; padding: 0.9rem 1.1rem; background: var(--panel); border-left: var(--bw) solid var(--accent); border-radius: 0 var(--r) var(--r) 0; font-size: 0.92rem; }
p .disp { vertical-align: baseline; }

/* DEV workshop appendix (hidden in prod) */
.workshop-doc { border-top: var(--bw) dashed var(--accent); }
.workshop-flag {
  font-family: var(--mono); font-size: 0.78rem; line-height: 1.5;
  background: var(--panel); border: 1.5px dashed var(--accent);
  border-radius: var(--r); padding: 0.6rem 0.85rem; color: var(--muted);
}

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; scroll-behavior: auto !important; }
}

/* ── mobile nav (hamburger) ───────────────────────────────────────────────── */
/* The burger is desktop-hidden; the links row is the default flex bar. Below
   720px the burger appears and the links collapse into a dropdown panel. */
.nav-burger {
  display: none; align-items: center; justify-content: center;
  width: 38px; height: 38px; padding: 0; margin-left: 0.35rem;
  color: var(--text); background: transparent; cursor: pointer;
  border: 2px solid transparent; border-radius: var(--r-pill);
}
.nav-burger:hover { background: var(--sun); color: var(--ink); border-color: var(--ink); }
.nav-burger .burger-close { display: none; }
.nav-burger[aria-expanded="true"] .burger-open { display: none; }
.nav-burger[aria-expanded="true"] .burger-close { display: block; }

@media (max-width: 719px) {
  .nav-inner { position: relative; padding: 0 1.15rem; }
  .nav-burger { display: inline-flex; }
  .nav-links {
    position: absolute; top: 100%; left: 0; right: 0;
    flex-direction: column; align-items: stretch; gap: 0.15rem;
    background: var(--bg); border-bottom: var(--bw) solid var(--border);
    box-shadow: var(--sh); padding: 0.6rem 1.15rem 0.9rem; display: none;
  }
  .nav-links.open { display: flex; }
  .nav-links a { padding: 0.6rem 0.7rem; border-radius: var(--r); }
}

/* ── mobile spacing polish ────────────────────────────────────────────────── */
@media (max-width: 620px) {
  .wrap { padding: 0 1.15rem; }
  .hero { padding: 3rem 0 2.25rem; }
  .section { padding: 2.5rem 0; }
  .hero p.tagline { font-size: 1.05rem; }
  .btn { font-size: 0.95rem; padding: 0.55rem 1rem; }
  /* hard offset shadows shrink so wide stickers don't push past the viewport */
  :root { --sh: 4px 4px 0 var(--sh-col); --sh-lg: 6px 6px 0 var(--sh-col); }
}

/* ── docs sidebar: collapsed on mobile ────────────────────────────────────── */
/* The sidebar stacks above the article below 860px and its full nav is long, so
   it is collapsed behind a toggle (injected by docs-nav.js), open only on demand
   and re-collapsed after a link is chosen. Desktop keeps the always-open sidebar. */
.docs-nav-toggle {
  display: none;
  width: 100%; align-items: center; justify-content: space-between; gap: 0.5rem;
  font-family: var(--display); font-weight: 800; font-size: 0.98rem; cursor: pointer;
  padding: 0.65rem 1rem; color: var(--text);
  background: var(--panel); border: var(--bw) solid var(--border);
  border-radius: var(--r); box-shadow: var(--sh-sm);
}
.docs-nav-toggle .chev { transition: transform .15s ease; font-size: 1.6em; line-height: 1; }
.docs-nav-toggle[aria-expanded="true"] .chev { transform: rotate(180deg); }

@media (max-width: 859px) {
  .docs-nav-toggle { display: flex; }
  .docs-sidebar .docs-nav { display: none; margin-top: 0.6rem; }
  .docs-sidebar.nav-open .docs-nav { display: block; }
}

/* ── top scrollbar for overflowing tables (synced by table-scroll.js) ──────── */
/* Matches the brutalist sidebar/code scrollbar: chunky magenta pill, ink border. */
.table-topscroll {
  overflow-x: auto; overflow-y: hidden; margin-bottom: 0.4rem;
  /* the container must be at least as tall as the scrollbar, or the horizontal
     bar collapses to a thin sliver instead of the chunky 14px pill. */
  height: 16px;
  scrollbar-width: thin; scrollbar-color: var(--magenta) transparent;
}
.table-topscroll-inner { height: 1px; }
.table-topscroll::-webkit-scrollbar { height: 14px; }
.table-topscroll::-webkit-scrollbar-track { background: transparent; }
.table-topscroll::-webkit-scrollbar-thumb {
  background: var(--magenta); border: 2px solid var(--border);
  border-radius: var(--r-pill); background-clip: padding-box;
}
.table-topscroll::-webkit-scrollbar-thumb:hover { background: var(--grape); }

/* Mobile footer: more air below the divider line and beneath the last line. */
@media (max-width: 620px) {
  .footer { padding-bottom: 3.5rem; }
  .footer-base { margin-top: 2rem; padding-top: 1.75rem; gap: 0.9rem 1.5rem; }
}

/* 404 page: branded not-found with recovery links. */
.err-hero { padding: 4rem 0 4rem; }
.err-mark { color: var(--sun); margin-bottom: 0.5rem; }
.err-code {
  font-family: "Varela Round", system-ui, sans-serif;
  font-size: clamp(3.5rem, 12vw, 6rem);
  font-weight: 700; line-height: 1; letter-spacing: -0.02em;
  color: var(--ink); margin: 0 0 0.25rem;
}
.err-links { padding-top: 2rem; }
.err-links h2 { text-align: center; margin-bottom: 1.5rem; }
.err-list {
  list-style: none; padding: 0; margin: 0 auto; max-width: 640px;
  display: flex; flex-direction: column; gap: 0.6rem;
}
.err-list li {
  padding: 0.75rem 1rem; background: var(--panel);
  border: var(--bw) solid var(--border); border-radius: 9px; color: var(--muted);
}
.err-list li a { font-weight: 700; color: var(--text); }
.err-fine { text-align: center; color: var(--muted); margin-top: 1.5rem; font-size: 0.9rem; }

/* Inline X/Twitter glyph after an author name (about page). */
.inline-x {
  display: inline-flex; align-items: center; vertical-align: baseline;
  margin-left: 0.28em; color: var(--muted); position: relative; top: 1px;
}
.inline-x:hover { color: var(--magenta); }
