/* =========================================================================
   baseline · site.css
   Design system: variant-1 (Quiet authority — editorial calm).
   Type: Inter Tight 600 + Inter 400/500 + JetBrains Mono.
   Color: warm off-white bg, ink near-black, single muted indigo accent
   reserved for interactive state and small typographic moments.
   Density: low. Generous whitespace. Content-first.
   ========================================================================= */

:root {
  /* Palette extracted from DESIGN.md (phantomflow register).
     Cool neutrals on slate hue + bold orange accent (orange-700 primary, orange-500 light). */
  --ink:          oklch(15%   0     0);
  --text:         oklch(15%   0     0);
  --charcoal:     oklch(28%   0     0);
  --muted:        oklch(45%   0.026 257);
  --faint:        oklch(72%   0.012 257);
  --rule:         oklch(89%   0.013 257);
  --rule-soft:    oklch(94%   0     0);
  --bg:           oklch(96.5% 0     0);
  --paper:        oklch(99%   0     0);
  --cream:        oklch(94%   0     0);

  --accent:       oklch(55.8% 0.187 41.5);          /* orange-700 — primary state, type, links */
  --accent-light: oklch(70.3% 0.187 41.5);          /* orange-500 — dots, hover, syntax accents */
  --accent-soft:  oklch(70.3% 0.187 41.5 / .15);
  --accent-faint: oklch(70.3% 0.187 41.5 / .08);

  --warn:         oklch(58% 0.13 60);

  --code-bg:      oklch(15% 0.015 260);
  --code-fg:      oklch(92% 0.005 260);

  /* Code-window palette — the dark surfaces (.dev-console, .install-snippet,
     .cli-strip) and the syntax token classes that ride on top of them. */
  --code-bar-bg:        oklch(20% 0.015 260);   /* dev-console title bar */
  --code-bar-bg-alt:    oklch(25% 0.005 260);   /* install-snippet bar (slightly lighter) */
  --code-bar-border:    oklch(28% 0.015 260);   /* hairline below title bar */
  --code-bar-fg:        oklch(72% 0 0);         /* bar text */
  --code-fg-file:       oklch(78% 0 0);         /* filename label in the bar */
  --code-fg-bright:     oklch(95% 0 0);         /* .dc-cmd-buf, .cli-cmd */
  --code-fg-default:    oklch(88% 0 0);         /* .cli-strip default text */
  --code-fg-mid:        oklch(85% 0 0);         /* .dc-body default */
  --code-fg-prompt:     oklch(60% 0 0);         /* .dc-prompt, .cli-hint idle */
  --code-fg-dim:        oklch(64% 0 0);         /* .dc-dim */
  --hover-tint:         oklch(98% 0 0);         /* a.concept:hover bg, table row hover */
  --code-strip-shadow:  0 12px 36px -16px oklch(20% 0 0 / .18);

  /* Syntax highlighting — oklch equivalents of the prior hex values. */
  --tok-key: oklch(78% 0.10 280);
  --tok-str: oklch(89% 0.09 158);
  --tok-num: oklch(85% 0.13 90);
  --tok-com: oklch(54% 0.04 250);
  --tok-kw:  oklch(78% 0.13 0);

  /* Dev-console stream — semantic state colors used by site.js. */
  --dc-str:  oklch(78% 0.10 145);
  --dc-ok:   oklch(70% 0.13 145);
  --dc-wait: oklch(75% 0.13 80);

  /* CLI strip "is-copied" success accent. */
  --cli-success: oklch(70% 0.15 145);

  /* Mac traffic-light dots — kept as literal cultural references but
     normalized to oklch for theme consistency. */
  --mac-red:    oklch(70% 0.21 24);
  --mac-yellow: oklch(82% 0.18 80);
  --mac-green:  oklch(76% 0.21 145);

  --content:    856px;
  --sidebar:    260px;
  --toc:        220px;
  --header:     60px;

  --display: "Inter Tight", system-ui, -apple-system, Segoe UI, sans-serif;
  --body:    "Inter", system-ui, -apple-system, Segoe UI, sans-serif;
  --mono:    "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

/* ----- reset ------------------------------------------------------------ */

*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
img, svg { display: block; max-width: 100%; }
button { font: inherit; }

/* ----- base ------------------------------------------------------------- */

body {
  font-family: var(--body);
  font-size: 17px;
  line-height: 1.7;
  color: var(--text);
  background: var(--bg);
  font-feature-settings: "ss01", "cv11";
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

a {
  color: var(--ink);
  text-decoration: none;
  transition: color .15s ease;
}
a:hover { color: var(--accent); }

a:focus-visible,
button:focus-visible,
[tabindex]:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  border-radius: 3px;
}

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

/* ----- skip link -------------------------------------------------------- */

.skip {
  position: absolute;
  left: -9999px;
  background: var(--ink);
  color: var(--paper);
  padding: 8px 14px;
  border-radius: 6px;
  font-weight: 500;
  z-index: 99;
}
.skip:focus { left: 16px; top: 16px; }

/* Off-screen-but-readable. Used as an aria-live target for copy-success
   announcements on the install copy affordances (.cli-strip, .install-pill)
   so screen readers hear "Copied install command" without focus changes. */
.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;
}

/* ----- alpha banner (site-wide status) ---------------------------------- */
/* Subtle accent-tinted strip below the sticky topnav. Surfaces public-alpha
   state on every page without dominating the layout (DESIGN.md "quiet
   authority"). Mono font, accent body on accent-soft background, single
   hairline at the accent stop. Render order: topnav → banner → page content;
   the banner scrolls away with the page while the topnav stays pinned. The
   banner is semantic <aside role="status"> so screen readers can skip past it. */
.alpha-banner {
  background: var(--accent-soft);
  border-bottom: 1px solid var(--accent);
  border-top: 1px solid var(--accent);
  padding: 8px 24px;
  text-align: center;
  font: 500 12.5px/1.4 var(--mono);
  color: var(--accent);
  letter-spacing: 0.01em;
}
.alpha-banner code {
  background: transparent;
  color: inherit;
  font-size: inherit;
  padding: 0;
}
.alpha-banner strong {
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

/* ----- topnav (shared) -------------------------------------------------- */

header.top {
  position: sticky;
  top: 0;
  z-index: 20;
  height: var(--header);
  background: color-mix(in oklch, var(--bg) 88%, transparent);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--rule);
  display: flex;
  align-items: center;
  padding: 0 32px;
}

/* Hamburger toggle — only rendered on docs pages (subtitle == "/ docs"),
   only visible at the mobile breakpoint where the sidebar collapses to a drawer. */
.nav-toggle {
  display: none;
  background: transparent;
  border: 1px solid var(--rule);
  border-radius: 8px;
  width: 38px;
  height: 38px;
  margin-right: 12px;
  padding: 0;
  cursor: pointer;
  color: var(--ink);
  align-items: center;
  justify-content: center;
  transition: border-color .15s ease, background .15s ease;
}
.nav-toggle:hover { border-color: var(--ink); background: var(--paper); }
.nav-toggle .bars,
.nav-toggle .bars::before,
.nav-toggle .bars::after {
  content: "";
  display: block;
  width: 16px;
  height: 1.5px;
  background: currentColor;
  border-radius: 2px;
  position: relative;
  transition: transform .25s cubic-bezier(.22, 1, .36, 1), top .2s ease, opacity .15s ease;
}
.nav-toggle .bars::before { position: absolute; top: -5px; left: 0; }
.nav-toggle .bars::after  { position: absolute; top:  5px; left: 0; }
body.is-nav-open .nav-toggle .bars { background: transparent; }
body.is-nav-open .nav-toggle .bars::before { top: 0; transform: rotate(45deg); }
body.is-nav-open .nav-toggle .bars::after  { top: 0; transform: rotate(-45deg); }

/* Backdrop is inert outside the mobile drawer context. */
.nav-backdrop { display: none; }

.brand {
  display: flex;
  align-items: baseline;
  gap: 10px;
  font-family: var(--display);
  font-weight: 600;
  font-size: 17px;
  letter-spacing: -.015em;
  color: var(--ink);
}
.brand:hover { color: var(--ink); }
.brand .dot {
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--accent-light);
  display: inline-block;
  align-self: center;
  /* Slow, infinite pulse — quiet "live signal" gesture; ring fades out so the
     decoration never overlaps adjacent typography. Reduced-motion zeroed below. */
  animation: brand-dot-pulse 2.6s cubic-bezier(.4, 0, .2, 1) infinite;
  transform-origin: center;
}
@keyframes brand-dot-pulse {
  0%   { transform: scale(1);    box-shadow: 0 0 0 0 var(--accent-soft); }
  60%  { transform: scale(1);    box-shadow: 0 0 0 7px var(--accent-soft); }
  100% { transform: scale(1);    box-shadow: 0 0 0 0 transparent; }
}
@media (prefers-reduced-motion: reduce) {
  .brand .dot { animation: none; }
}
.brand .sub {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: .06em;
  font-weight: 500;
  min-width: 4rem;
}

/* Byline sits INSIDE the brand text span (not as a flex sibling), so the
   parent .brand's 10px gap doesn't apply between it and the wordmark.
   Italic differentiates it from the mono uppercase .sub crumb that follows;
   no decorative separator needed — the type does the work. */
.brand .byline {
  font-family: var(--display);
  font-style: italic;
  font-size: 13px;
  font-weight: 400;
  color: var(--muted);
  margin-left: 0.35em;
  letter-spacing: -.005em;
  white-space: nowrap;
}
@media (max-width: 720px) {
  .brand .byline { display: none; }
}

nav.primary {
  margin-left: 48px;
  display: flex;
  gap: 28px;
  font-size: 14px;
}
nav.primary a {
  color: var(--muted);
  font-weight: 500;
}
nav.primary a:hover,
nav.primary a.is-active { color: var(--ink); }

.head-spacer { flex: 1; }

.gh-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: 32px;
  padding: 0 12px;
  border-radius: 8px;
  color: var(--muted);
  font-family: var(--mono);
  font-size: 12.5px;
  font-weight: 500;
  letter-spacing: -.005em;
  transition: background .15s ease, color .15s ease;
}
.gh-link .gh-icon {
  flex-shrink: 0;
  display: block;
  color: var(--muted);
  transition: color .15s ease;
}
.gh-link .gh-repo {
  white-space: nowrap;
  font-size: 11px;
  text-decoration: underline var(--muted) dashed
}
.gh-link:hover {
  color: var(--accent);
  background: var(--accent-faint);
}
.gh-link:hover .gh-icon {
  color: var(--accent);
}
.gh-link:hover .gh-repo {
  text-decoration: underline var(--accent) dashed;
}
@media (max-width: 640px) {
  .gh-link .gh-repo { display: none; }
  .gh-link { padding: 0 8px; }
}

/* ----- buttons ---------------------------------------------------------- */

.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: var(--display);
  font-weight: 500;
  font-size: 15px;
  letter-spacing: -.01em;
  padding: 10px 20px;
  border-radius: 8px;
  border: 1px solid transparent;
  cursor: pointer;
  transition:
    background .15s ease,
    color .15s ease,
    border-color .15s ease,
    transform .15s cubic-bezier(.25, 1, .5, 1);
  white-space: nowrap;
  will-change: transform;
}
.btn:hover { transform: translateY(-1px); }
.btn:active { transform: translateY(0); }
.btn-primary {
  background: var(--ink);
  color: var(--paper);
}
.btn-primary:hover {
  background: var(--accent);
  color: var(--paper);
}
.btn-secondary {
  color: var(--ink);
  border-color: var(--rule);
  background: var(--paper);
}
.btn-secondary:hover {
  border-color: var(--ink);
  color: var(--ink);
}
@media (prefers-reduced-motion: reduce) {
  .btn:hover, .btn:active { transform: none; }
}
.btn .arr {
  transform: translateY(-.5px);
  transition: transform .15s cubic-bezier(.25, 1, .5, 1);
}
.btn:hover .arr { transform: translate(3px, -.5px); }

/* ----- typography ------------------------------------------------------- */

h1, h2, h3, h4 {
  font-family: var(--display);
  color: var(--ink);
  margin: 0;
}

h1 {
  font-size: clamp(38px, 5vw, 56px);
  font-weight: 600;
  line-height: 1.05;
  letter-spacing: -.03em;
}
h2 {
  font-size: 26px;
  font-weight: 600;
  letter-spacing: -.015em;
  line-height: 1.25;
}
h3 {
  font-size: 18px;
  font-weight: 600;
  letter-spacing: -.01em;
  line-height: 1.4;
}
p { margin: 0 0 20px; max-width: var(--content); }

code {
  font-family: var(--mono);
  font-size: .875em;
  background: var(--accent-soft);
  color: var(--ink);
  padding: 2px 6px;
  border-radius: 4px;
  font-weight: 500;
}

pre {
  font-family: var(--mono);
  background: var(--code-bg);
  color: var(--code-fg);
  padding: 24px 28px;
  border-radius: 10px;
  font-size: 13.5px;
  line-height: 1.65;
  overflow-x: auto;
  margin: 24px 0 32px;
  max-width: var(--content);
}
pre code {
  background: none;
  color: inherit;
  padding: 0;
  font-size: inherit;
  font-weight: 400;
}
.tok-key { color: var(--tok-key); }
.tok-str { color: var(--tok-str); }
.tok-num { color: var(--tok-num); }
.tok-com { color: var(--tok-com); font-style: italic; }
.tok-kw  { color: var(--tok-kw); }

.eyebrow {
  font-family: var(--display);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--accent);
  margin: 0 0 14px;
}

/* ----- footer ----------------------------------------------------------- */

footer.site {
  border-top: 1px solid var(--rule);
  margin-top: 120px;
  padding: 64px 32px 28px;
}
.footer-inner {
  max-width: 1080px;
  margin: 0 auto;
}
.footer-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr) minmax(0, 1fr);
  gap: 64px;
  padding-bottom: 40px;
  border-bottom: 1px solid var(--rule);
}
.footer-brand-col {
  display: flex;
  flex-direction: column;
  gap: 18px;
}
.footer-tagline {
  font-family: var(--body);
  font-size: 14.5px;
  line-height: 1.55;
  color: var(--muted);
  margin: 0;
  max-width: 32ch;
}
.footer-attribution {
  font-family: var(--mono);
  font-size: 11.5px;
  color: var(--muted);
  margin: 0;
  letter-spacing: .01em;
}
.footer-attribution a {
  color: var(--text);
  border-bottom: 1px solid var(--rule);
}
.footer-attribution a:hover { color: var(--accent); border-bottom-color: var(--accent); }
.footer-col h5 {
  font-family: var(--mono);
  font-size: 10.5px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .10em;
  color: var(--muted);
  margin: 0 0 18px;
}
.footer-col ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.footer-col a {
  font-family: var(--body);
  font-size: 14px;
  color: var(--text);
  font-weight: 400;
}
.footer-col a:hover { color: var(--accent); }
.footer-meta-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  padding-top: 22px;
  font-family: var(--mono);
  font-size: 11.5px;
  color: var(--muted);
  letter-spacing: 0;
}

/* =========================================================================
   MARKETING (home page)
   ========================================================================= */

.marketing {
  max-width: 1080px;
  margin: 0 auto;
  padding: 0 32px;
}

.hero {
  padding: 96px 0 80px;
  border-bottom: 1px solid var(--rule);
}
.hero h1 {
  font-size: clamp(42px, 6vw, 68px);
  letter-spacing: -.035em;
  line-height: 1.0;
  max-width: 920px;
  margin-bottom: 28px;
}
.hero h1 .accent,
.article > h1 .accent { color: var(--accent); }
.hero .lead {
  font-size: 21px;
  line-height: 1.55;
  color: var(--text);
  max-width: 640px;
  margin-bottom: 40px;
}
/* Emphasis on the three constitutional claims — italic at default weight
   reads thin against the 21px lead; bump to 500 to keep the cadence even. */
.hero .lead em {
  font-style: italic;
  font-weight: 500;
  color: var(--ink);
}
.hero .ctas {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 56px;
}
/* Leading accent-arrow + concrete copy: "→ browse the 37 skills" links to
   the most concrete "what's in this baseline" page. Whole link slides
   right on hover (forward-motion metaphor); reduced-motion zeros the
   translate but keeps the colour change. */
.hero .hero-readmore {
  margin: 0 0 56px;
  font-family: var(--mono);
  font-size: 13px;
  color: var(--muted);
  letter-spacing: -.005em;
}
.hero .hero-readmore a {
  display: inline-flex;
  align-items: baseline;
  gap: 6px;
  color: var(--muted);
  text-decoration: none;
  transition: color .15s ease, transform .15s cubic-bezier(.25, 1, .5, 1);
}
.hero .hero-readmore a:hover {
  color: var(--ink);
  transform: translateX(3px);
}
.hero .hero-readmore .arr {
  color: var(--accent);
  font-weight: 600;
}
@media (prefers-reduced-motion: reduce) {
  .hero .hero-readmore a:hover { transform: none; }
}
.hero .meta-strip {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  margin-top: 56px;
  padding: 26px 0;
  border-block: 1px solid var(--rule);
  max-width: 660px;
}
.hero .meta-strip .stat {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding-inline: 22px;
  border-inline-start: 1px solid var(--rule);
}
.hero .meta-strip .stat:first-child {
  border-inline-start: 0;
  padding-inline-start: 0;
}
.hero .meta-strip .stat .num {
  font-family: var(--display);
  font-weight: 600;
  font-size: 32px;
  line-height: 1;
  letter-spacing: -.025em;
  color: var(--ink);
  font-variant-numeric: tabular-nums;
}
.hero .meta-strip .stat .label {
  font-family: var(--mono);
  font-size: 10.5px;
  color: var(--muted);
  letter-spacing: .10em;
  text-transform: uppercase;
  font-weight: 500;
  line-height: 1;
}

/* Hero 2-col layout: text content on the left, schematic on the right. */
.hero .hero-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr);
  gap: 80px;
  align-items: center;
}
.hero-content { min-width: 0; }
.hero-figure {
  margin: 0;
  min-width: 0;
}
/* Plate caption baseline — unified across all figure/plate contexts.
   Mono 11.5/1.6 muted, with a hairline rule above and a display-faced leader.
   .figure figcaption, .hero-figure figcaption, figcaption.strata-key, and
   figcaption.plate-caption all inherit this baseline. */
.hero-figure figcaption,
.figure figcaption,
figcaption.plate-caption,
figcaption.strata-key {
  font-family: var(--mono);
  font-size: 11.5px;
  font-weight: 500;
  line-height: 1.6;
  letter-spacing: 0;
  text-transform: none;
  color: var(--muted);
  margin-top: 24px;
  padding-top: 16px;
  border-top: 1px solid var(--rule);
}
.hero-figure figcaption strong,
.figure figcaption strong,
figcaption.plate-caption strong,
figcaption.strata-key strong {
  font-family: var(--display);
  font-size: 12.5px;
  font-weight: 600;
  color: var(--ink);
  letter-spacing: -.005em;
  margin-right: 8px;
}
figcaption.plate-caption code,
.figure figcaption code,
.hero-figure figcaption code {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--ink);
  background: var(--cream);
  padding: 0 4px;
  border-radius: 3px;
}

/* Strata illustration: a vertical SVG composition of four geometric forms.
   Filled square (Genesis), open frame (Constitution), dotted rectangle
   (Implementation), and a horizontal line with a single accent dot
   (Tool boundary). Roman numerals are inscribed in each form. */
.strata-svg {
  width: 100%;
  max-width: 360px;
  height: auto;
  display: block;
  margin: 0 auto;
}
.strata-svg .form-fill   { fill: var(--ink); }
.strata-svg .form-stroke { fill: none; stroke: var(--ink); stroke-width: 1.75; }
.strata-svg .form-dotted { fill: url(#strata-dots); }
.strata-svg .form-line   { stroke: var(--ink); stroke-width: 1.75; }
.strata-svg .form-accent { fill: var(--accent); }
.strata-svg .pattern-dot { fill: var(--charcoal); }
.strata-svg .numeral {
  font-family: var(--display);
  font-size: 22px;
  font-weight: 600;
  letter-spacing: -.02em;
  fill: var(--ink);
}
.strata-svg .numeral.on-fill { fill: var(--paper); }
.strata-svg .numeral-mono {
  font-family: var(--mono);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: .10em;
  fill: var(--ink);
  text-transform: uppercase;
}

/* Strata key — overrides only the layout (flex legend, not a sentence
   caption). Type tokens come from the unified .plate-caption baseline above. */
figcaption.strata-key {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 4px 18px;
  text-align: center;
}
figcaption.strata-key span { white-space: nowrap; }
figcaption.strata-key strong {
  font-size: 12px;
  margin-right: 6px;
  letter-spacing: .04em;
}

/* Strata relocated as a small key-visual inside §I What it is. */
.figure-strata {
  margin: 0 auto var(--spacing-xl, 48px);
  max-width: 360px;
  text-align: center;
}
.figure-strata .strata-svg {
  margin: 0 auto;
  max-width: 320px;
}

@media (max-width: 1000px) {
  .hero .hero-grid {
    grid-template-columns: 1fr;
    gap: 64px;
  }
  .hero-figure {
    max-width: 480px;
    margin-inline: auto;
    width: 100%;
  }
}

.columns {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 8px;
}
/* Below the figure-friendly width, stack the figure above the concept rail.
   At narrow viewports the right column otherwise compresses to a few px and
   forces the figure to stretch to the rail's wrapped height. */
@media (max-width: 720px) {
  .columns {
    grid-template-columns: 1fr;
    gap: 32px;
  }
  .columns > .figure-strata {
    margin-inline: auto;
  }
}

.section {
  padding: 80px 0;
  border-bottom: 1px solid var(--rule);
}
.section:last-of-type { border-bottom: 0; }
.section .lede {
  display: grid;
  grid-template-columns: 220px 1fr;
  gap: 80px;
  margin-bottom: 56px;
  align-items: baseline;
}
.section .lede h2 { max-width: 12ch; }
.section .lede .lede-head {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.section .lede .lede-head h2 { margin: 0; }
.section-num {
  font-family: var(--mono);
  font-size: 14px !important;
  font-weight: 600;
  letter-spacing: .14rem;
  text-transform: uppercase;
  color: var(--accent) !important;
  margin: 0 !important;
  line-height: 1 !important;
}
.section .lede p {
  font-size: 18px;
  line-height: 1.6;
  color: var(--text);
  margin: 0;
}

/* Concept grid (default 3-col; .is-2col modifier for two-up). Hairline-bracketed
   plate-and-paper, never card-shadowed. Anchor-as-concept enables full-cell
   click affordance on navigational uses (e.g. /skills/). */
.concepts {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  grid-auto-rows: max-content;
  gap: 1px;
  background: var(--rule);
  border: 1px solid var(--rule);
  border-radius: 12px;
  overflow: hidden;
  max-width: var(--content);
  align-self: start;
  margin: 0 auto;
}
.concepts.is-row { grid-template-columns: none; grid-template-rows: repeat(3, 1fr); }
.concepts.is-2col { grid-template-columns: 1fr 1fr; }
.concept {
  background: var(--paper);
  padding: 32px;
}
a.concept {
  color: inherit;
  text-decoration: none;
  transition:
    background .15s ease,
    transform .15s cubic-bezier(.25, 1, .5, 1);
  will-change: transform;
}
a.concept {
  position: relative;
  padding-right: 56px;
}
a.concept:hover {
  background: var(--hover-tint);
}
a.concept:hover h3 { color: var(--accent); }
@media (prefers-reduced-motion: reduce) {
  a.concept:hover, a.concept:active { transform: none; }
}
a.concept::after {
  content: "→";
  position: absolute;
  top: 32px;
  right: 28px;
  font-family: var(--display);
  font-size: 18px;
  font-weight: 500;
  color: var(--faint);
  opacity: 0;
  transform: translateX(-4px);
  transition: transform .2s cubic-bezier(.25, 1, .5, 1), opacity .2s ease, color .15s ease;
}
a.concept:hover::after,
a.concept:focus-visible::after {
  opacity: 1;
  transform: translateX(0);
  color: var(--accent);
}
.concept .num {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--accent);
  letter-spacing: .08em;
  text-transform: uppercase;
  margin-bottom: 12px;
}
.concept h3 {
  font-size: 17px;
  margin-bottom: 10px;
  transition: color .15s ease;
}
.concept p {
  font-size: 14.5px;
  line-height: 1.6;
  color: var(--muted);
  margin: 0;
  max-width: none;
}

/* =========================================================================
   DIAGRAMS
   Reusable figure + SVG/HTML diagram styles for the homepage.
   ========================================================================= */

.figure {
  background: var(--paper);
  border: 1px solid var(--rule);
  border-radius: 14px;
  padding: 40px 32px 32px !important;
  margin: 0 0 32px 0;
}
.figure svg { display: block; width: 100%; height: auto; }
/* .figure figcaption + strong: type baseline is set in the unified
   .plate-caption block above. No further declarations needed here. */

/* SVG diagram themed via CSS custom properties */
.diagram-svg .stage {
  fill: var(--paper);
  stroke: var(--ink);
  stroke-width: 1.5;
}
.diagram-svg .stage-label {
  font-family: var(--display);
  font-size: 13px;
  font-weight: 600;
  fill: var(--ink);
  letter-spacing: -.01em;
}
.diagram-svg .stage-sub {
  font-family: var(--body);
  font-size: 12px;
  fill: var(--muted);
}
.diagram-svg .conn {
  stroke: var(--ink);
  stroke-width: 1.5;
  fill: none;
}
.diagram-svg .conn-arrow {
  fill: var(--ink);
}
.diagram-svg .hook-line {
  stroke: var(--accent);
  stroke-width: 1.75;
  stroke-dasharray: 4 4;
  fill: none;
}
.diagram-svg .hook-event {
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 600;
  fill: var(--accent);
  letter-spacing: .04em;
  text-transform: uppercase;
}
.diagram-svg .hook-list {
  font-family: var(--mono);
  font-size: 11px;
  fill: var(--muted);
}
.diagram-svg .hook-sub {
  font-family: var(--mono);
  font-size: 11px;
  fill: var(--faint);
}
.diagram-svg .num {
  font-family: var(--mono);
  font-size: 10px;
  fill: var(--muted);
  font-weight: 500;
}
.diagram-svg .node-circle {
  fill: var(--paper);
  stroke: var(--ink);
  stroke-width: 1.5;
}
.diagram-svg .node-gate {
  fill: var(--accent);
  stroke: var(--accent);
  stroke-width: 1.5;
}
.diagram-svg .gate-anno .gate-rule {
  stroke: var(--accent);
  stroke-width: 1.25;
  stroke-dasharray: 3 3;
  fill: none;
}
.diagram-svg .gate-anno .gate-bracket {
  stroke: var(--accent);
  stroke-width: 1.25;
  fill: none;
  stroke-linecap: square;
}
.diagram-svg .gate-anno .gate-glyph {
  stroke: var(--paper);
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
  fill: none;
}
.diagram-svg .gate-anno .gate-cmd {
  font-family: var(--mono);
  font-size: 10.5px;
  font-weight: 500;
  fill: var(--accent);
  letter-spacing: -.005em;
}
.diagram-svg .node-label {
  font-family: var(--display);
  font-size: 12.5px;
  font-weight: 500;
  fill: var(--ink);
  letter-spacing: -.005em;
}
.diagram-svg .node-label-gate {
  font-family: var(--display);
  font-size: 12.5px;
  font-weight: 600;
  fill: var(--ink);
  letter-spacing: -.005em;
}
.diagram-svg .artifact {
  font-family: var(--mono);
  font-size: 10.5px;
  fill: var(--muted);
}
.diagram-svg .gate-tag {
  font-family: var(--mono);
  font-size: 10px;
  font-weight: 700;
  fill: var(--accent);
  letter-spacing: .12em;
  text-transform: uppercase;
}
.diagram-svg .axis {
  stroke: var(--rule);
  stroke-width: 1.5;
}

/* Architecture bento — the §III workflow diagram.
   Single inline SVG with two <g> subtrees (.bento-desktop, .bento-mobile).
   Desktop renders a 1000x540 bento composition; mobile (<=768px) collapses
   to a 360x1200 vertical stack of the same eleven phases plus three gates.
   viewBox is fixed at 0 0 1000 1200; preserveAspectRatio="xMinYMin slice"
   clips the unused regime. CSS aspect-ratio swaps the SVG container shape;
   display:none toggles which subtree is visible. */
.arch-bento {
  width: 100%;
  height: auto;
  aspect-ratio: 1000 / 565;
  max-width: 1000px;
  margin: 0 auto;
  display: block;
}
.arch-bento .bento-mobile { display: none; }
.arch-bento .bento-desktop { display: initial; }

@media (max-width: 768px) {
  .arch-bento {
    aspect-ratio: 360 / 1200;
    max-width: 400px;
  }
  .arch-bento .bento-desktop { display: none; }
  .arch-bento .bento-mobile { display: initial; }
}

/* Hero cell — spec. Filled paper, ink 1.5 stroke. Carries the bento's visual anchor. */
.arch-bento .stage-hero {
  fill: var(--paper);
  stroke: var(--ink);
  stroke-width: 1.5;
}

/* Tall cell — tdd. Open-frame dashed stroke signals "where work happens";
   matches the comptree conditional-edge vocabulary in the hero-symbols catalog. */
.arch-bento .stage-tall {
  fill: var(--paper);
  stroke: var(--ink);
  stroke-width: 1.5;
  stroke-dasharray: 6 3;
}

/* Ship pair cell — changelog + commit. Slightly louder ink stroke to mark the pair. */
.arch-bento .stage-ship {
  fill: var(--paper);
  stroke: var(--ink);
  stroke-width: 1.5;
}

/* Ship pair accent seam — vertical 1.5 accent rule between changelog and commit.
   Honors the reserved-accent contract: this is the user-pinned "ship pair" device. */
.arch-bento .ship-seam {
  stroke: var(--accent);
  stroke-width: 1.5;
  stroke-linecap: square;
}

/* Cell eyebrow — mono caps inside hero/tall cells (e.g., "PLAN ANCHOR", "EXECUTION"). */
.arch-bento .cell-eyebrow {
  font-family: var(--mono);
  font-size: 10px;
  font-weight: 600;
  fill: var(--accent);
  letter-spacing: 0.10em;
  text-transform: uppercase;
}

/* Cell ordinal — mono numeral aligned right inside hero/tall. */
.arch-bento .cell-ord {
  font-family: var(--mono);
  font-size: 12px;
  font-weight: 600;
  fill: var(--muted);
  letter-spacing: 0.04em;
}

/* Cell title — Inter Tight 22/600 inside hero, 20/600 inside tall.
   The xl variant carries the v2 two-hero side-by-side composition where
   spec and tdd are both substantial cells (580x230 and 330x440) that
   warrant a larger title. */
.arch-bento .cell-title {
  font-family: var(--display);
  font-size: 22px;
  font-weight: 600;
  fill: var(--ink);
  letter-spacing: -0.025em;
}
.arch-bento .cell-tall .cell-title {
  font-size: 20px;
}
.arch-bento .cell-title-xl {
  font-size: 38px;
  letter-spacing: -0.035em;
}

/* TDD inner chain — five sub-phase chips (scenario, implement, verify, design-ui, drift-check)
   arranged in a 2-column grid inside the tall TDD cell, separated by arrows.
   Chips are paper-faced with hairline borders; mono labels in muted ink. */
.arch-bento .chain-chip {
  fill: var(--cream);
  stroke: var(--rule);
  stroke-width: 1;
}
.arch-bento .chain-label {
  font-family: var(--mono);
  font-size: 11.5px;
  font-weight: 500;
  fill: var(--ink);
  letter-spacing: -0.005em;
}
.arch-bento .chain-arrow {
  font-family: var(--display);
  font-size: 14px;
  font-weight: 500;
  fill: var(--muted);
}
.arch-bento .chain-arrow-v {
  font-size: 13px;
}

/* Cell sub — body 13/400 muted inside hero/tall. */
.arch-bento .cell-sub {
  font-family: var(--body);
  font-size: 13px;
  fill: var(--muted);
  letter-spacing: normal;
}
.arch-bento .cell-tall .cell-sub {
  font-size: 11.5px;
}
.arch-bento .cell-sub-step {
  fill: var(--faint);
  font-size: 11px;
}

/* Cell foot — mono 10/500 muted at bottom of hero/tall (e.g., file path or transition annotation). */
.arch-bento .cell-foot {
  font-family: var(--mono);
  font-size: 10px;
  fill: var(--muted);
  letter-spacing: 0.02em;
}
.arch-bento .cell-foot-r {
  font-family: var(--mono);
  font-size: 10px;
  font-weight: 500;
  fill: var(--accent);
  letter-spacing: 0.02em;
}
/* Cell foot rule — hairline separator between chain zone and foot annotations inside TDD. */
.arch-bento .cell-foot-rule {
  stroke: var(--rule);
  stroke-width: 1;
}

/* Cell modifier — mono 8.5 caps inside standard cells for status labels (e.g., "OPTIONAL"). */
.arch-bento .cell-modifier {
  font-family: var(--mono);
  font-size: 8.5px;
  font-weight: 600;
  fill: var(--faint);
  letter-spacing: 0.10em;
  text-transform: uppercase;
}

/* Pair bracket — hairline rule + mono caps tag above a paired cell row. */
.arch-bento .pair-rule {
  stroke: var(--rule);
  stroke-width: 1;
}
.arch-bento .pair-rule-accent {
  stroke: var(--accent);
  stroke-width: 1.5;
}
.arch-bento .pair-tag {
  font-family: var(--mono);
  font-size: 9px;
  font-weight: 600;
  fill: var(--muted);
  letter-spacing: 0.12em;
  text-transform: uppercase;
}
.arch-bento .pair-tag-accent {
  fill: var(--accent);
}

/* Runtime gate beneath the grid — dashed accent rule + caps tag + footnote.
   Distinct from phase-gate annotations because /grant-push sits OUTSIDE the pipeline. */
.arch-bento .runtime-rule {
  stroke: var(--accent);
  stroke-width: 1;
  stroke-dasharray: 4 4;
  opacity: 0.75;
}
.arch-bento .runtime-tag {
  letter-spacing: 0.14em;
}
.arch-bento .runtime-foot {
  font-family: var(--mono);
  font-size: 9px;
  fill: var(--muted);
  letter-spacing: 0.02em;
}

/* Memory-flow plate — hand-drawn-ish hairline diagram for the lifecycle loop. */
.plate-flow { padding: 32px 24px 28px; }
.memflow-svg { max-width: 720px; margin: 0 auto; }
.memflow-svg .mf-node rect {
  fill: var(--paper);
  stroke: var(--ink);
  stroke-width: 1.25;
}
.memflow-svg .mf-node-canonical rect {
  stroke-width: 1.5;
  stroke: var(--ink);
}
.memflow-svg .mf-title {
  font-family: var(--display);
  font-size: 12.5px;
  font-weight: 600;
  letter-spacing: -.005em;
  fill: var(--ink);
}
.memflow-svg .mf-sub {
  font-family: var(--mono);
  font-size: 10.5px;
  fill: var(--muted);
  letter-spacing: 0;
}
.memflow-svg .mf-step {
  font-family: var(--mono);
  font-size: 10px;
  font-weight: 700;
  fill: var(--accent);
  letter-spacing: .12em;
  text-transform: uppercase;
}
.memflow-svg .mf-edge {
  font-family: var(--mono);
  font-size: 10.5px;
  fill: var(--muted);
  letter-spacing: 0;
}
.memflow-svg .mf-edge-fail { fill: var(--charcoal); }
.memflow-svg .mf-conn {
  stroke: var(--ink);
  stroke-width: 1.25;
  fill: none;
  stroke-linecap: round;
}
.memflow-svg .mf-conn-ok {
  stroke: var(--accent);
  stroke-width: 1.25;
  stroke-dasharray: 4 4;
  fill: none;
  stroke-linecap: round;
}
.memflow-svg .mf-conn-fail {
  stroke: var(--charcoal);
  stroke-width: 1.25;
  fill: none;
  stroke-linecap: round;
}
.memflow-svg .mf-arrow { fill: var(--ink); }
.memflow-svg .mf-arrow-acc { fill: var(--accent); }
@media (max-width: 720px) {
  .memflow-svg { max-width: 100%; }
}

/* Architecture diagram: HTML/CSS, two columns + connector spine */
.arch {
  display: grid;
  grid-template-columns: 1fr 160px 1fr;
  gap: 0;
  align-items: stretch;
  background: var(--paper);
  border: 1px solid var(--rule);
  border-radius: 14px;
  overflow: hidden;
  font-family: var(--body);
  position: relative;
  margin-top: 0;
}
.arch-col {
  padding: 32px 28px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.arch-col + .arch-col { border-left: 1px solid var(--rule); }
.arch-col .label {
  font-family: var(--display);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .10em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 4px;
}
.arch-col h3 {
  font-family: var(--display);
  font-size: 18px;
  font-weight: 600;
  letter-spacing: -.01em;
  color: var(--ink);
  margin: 0 0 8px;
}
.arch-col p {
  font-size: 14px;
  line-height: 1.55;
  color: var(--muted);
  margin: 0;
  max-width: none;
}
.arch-col ul {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.arch-col li {
  font-family: var(--mono);
  font-size: 12.5px;
  color: var(--ink);
  display: flex;
  align-items: baseline;
  gap: 8px;
}
.arch-col li::before {
  content: "›";
  color: var(--accent);
  font-weight: 700;
}
.arch-col li.dim { color: var(--muted); }
.arch-col li.dim::before { color: var(--faint); }

.arch-spine {
  border-left: 1px solid var(--rule);
  border-right: 1px solid var(--rule);
  background: var(--bg);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 20px 10px;
  gap: 18px;
  position: relative;
}
.arch-spine .arrow {
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 100%;
  font-family: var(--mono);
  font-size: 10.5px;
  color: var(--ink);
  letter-spacing: .10em;
  text-transform: uppercase;
  font-weight: 600;
  white-space: nowrap;
  line-height: 1;
}
.arch-spine .arrow svg {
  width: 100%;
  max-width: 124px;
  height: 10px;
  color: var(--ink);
}
.arch-spine .audit {
  border: 1.5px solid var(--accent);
  background: var(--paper);
  border-radius: 10px;
  padding: 10px 14px;
  text-align: center;
  font-family: var(--display);
  font-size: 11.5px;
  font-weight: 700;
  color: var(--accent);
  letter-spacing: -.005em;
  line-height: 1.4;
}
.arch-spine .audit-sub {
  font-family: var(--mono);
  font-size: 10px;
  font-weight: 500;
  color: var(--muted);
  margin-top: 4px;
  letter-spacing: 0;
  text-transform: none;
}

@media (max-width: 820px) {
  .arch {
    grid-template-columns: 1fr;
  }
  .arch-col + .arch-col { border-left: 0; border-top: 1px solid var(--rule); }
  .arch-spine {
    border: 0;
    border-top: 1px solid var(--rule);
    border-bottom: 1px solid var(--rule);
    flex-direction: row;
    flex-wrap: wrap;
    padding: 18px 24px;
  }
  .arch-spine .arrow svg { display: none; }
}

/* Install block */
.install {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 48px;
  align-items: start;
}
.install-copy h2 { margin-bottom: 16px; }
.install-copy p { font-size: 16.5px; max-width: 460px; }
.install-steps {
  list-style: none;
  padding: 0;
  margin: 32px 0 0;
  display: flex;
  flex-direction: column;
  gap: 12px;
  font-size: 14.5px;
  color: var(--text);
}
.install-steps li {
  display: flex;
  gap: 12px;
  align-items: baseline;
}
.install-steps .n {
  font-family: var(--mono);
  font-size: 12px;
  color: var(--accent);
  width: 18px;
  flex-shrink: 0;
}
.install-snippet {
  background: var(--code-bg);
  border-radius: 12px;
  overflow: hidden;
  font-family: var(--mono);
}
.install-snippet .bar {
  display: flex;
  align-items: center;
  background: var(--code-bar-bg-alt);
  color: var(--code-bar-fg);
  padding: 10px 14px;
  font-size: 11.5px;
  border-bottom: 1px solid var(--code-bar-border);
}
.install-snippet .bar .dots {
  display: flex; gap: 6px; margin-right: 14px;
}
.install-snippet .bar .dots span {
  width: 10px; height: 10px; border-radius: 50%; display: inline-block;
}
.install-snippet .bar .dots .r { background: var(--mac-red); }
.install-snippet .bar .dots .y { background: var(--mac-yellow); }
.install-snippet .bar .dots .g { background: var(--mac-green); }
.install-snippet .bar .file { color: var(--code-fg-file); }
.install-snippet pre {
  margin: 0;
  padding: 18px 22px;
  background: transparent;
  border-radius: 0;
  font-size: 13px;
  line-height: 1.7;
  overflow-x: auto;
}

/* =========================================================================
   DEV-CONSOLE — live-typing Claude Code session in the homepage hero.
   Replaces the strata illustration on the right column. Driven by site.js.
   ========================================================================= */

.dev-console {
  background: var(--code-bg);
  border-radius: 12px;
  overflow: hidden;
  font-family: var(--mono);
  display: flex;
  flex-direction: column;
  align-self: stretch;
  min-width: 0;
}
.dc-bar {
  display: flex;
  align-items: center;
  background: var(--code-bar-bg);
  color: var(--code-bar-fg);
  border-bottom: 1px solid var(--code-bar-border);
  padding: 11px 16px;
  font-size: 11.5px;
}
.dc-dots {
  display: flex;
  gap: 6px;
  margin-right: 14px;
}
.dc-dots span {
  width: 11px;
  height: 11px;
  border-radius: 50%;
  display: inline-block;
}
.dc-dots .r { background: var(--mac-red); }
.dc-dots .y { background: var(--mac-yellow); }
.dc-dots .g { background: var(--mac-green); }
.dc-file { color: var(--code-fg-file); }
.dev-console .dc-body {
  margin: 0;
  padding: 24px 26px;
  background: transparent;
  border-radius: 0;
  font-family: var(--mono);
  font-size: 13.5px;
  line-height: 1.85;
  color: var(--code-fg-mid);
  flex: 1;
  min-height: 380px;
  overflow: hidden;
  max-width: none;
}
.dev-console .dc-body code {
  background: none;
  color: inherit;
  font-size: inherit;
  font-weight: 400;
  padding: 0;
  display: block;
  white-space: pre-wrap;
  word-break: break-word;
}
.dc-line { display: inline; }
.dc-prompt { color: var(--code-fg-prompt); user-select: none; }
.dc-cmd-buf { color: var(--code-fg-bright); }
.dc-slash { color: var(--accent-light); font-weight: 500; }
.dc-str { color: var(--dc-str); }
.dc-pad { color: transparent; user-select: none; }
.dc-ok { color: var(--dc-ok); font-weight: 500; }
.dc-wait { color: var(--dc-wait); }
.dc-dim { color: var(--code-fg-dim); }
.dc-cursor {
  display: inline-block;
  width: 7px;
  height: 1em;
  background: var(--accent-light);
  vertical-align: -2px;
  margin-left: 2px;
  animation: dc-blink 1.05s steps(2, end) infinite;
}
@keyframes dc-blink { 50% { opacity: 0; } }

@media (prefers-reduced-motion: reduce) {
  .dc-cursor { animation: none; opacity: 1; }
}

/* =========================================================================
   CLI-STRIP — persistent click-to-copy install command above the footer.
   Driven by site.js (Clipboard API + execCommand fallback).
   ========================================================================= */

.cli-strip {
  display: flex;
  align-items: center;
  gap: 14px;
  margin: 96px auto 0;
  max-width: 760px;
  width: calc(100% - 64px);
  padding: 16px 22px;
  background: var(--code-bg);
  border-radius: 10px;
  border: 1px solid var(--rule);
  font-family: var(--mono);
  font-size: 14px;
  color: var(--code-fg-default);
  cursor: pointer;
  user-select: none;
  text-align: left;
  transition: background .15s ease, transform .15s ease, border-color .15s ease;
  box-shadow: var(--code-strip-shadow);
}
.cli-strip:hover {
  background: var(--code-bar-bg);
  border-color: var(--accent);
  transform: translateY(-1px);
}
.cli-strip:active { transform: translateY(0); }
.cli-strip:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}
.cli-prompt { color: var(--accent-light); font-weight: 700; flex: 0 0 auto; }
.cli-cmd {
  color: var(--code-fg-bright);
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.cli-caret {
  display: inline-block;
  width: 8px;
  height: 1em;
  background: var(--accent-light);
  vertical-align: -2px;
  animation: dc-blink 1.05s steps(2, end) infinite;
}
.cli-hint {
  margin-left: auto;
  font-size: 11px;
  color: var(--code-fg-prompt);
  text-transform: uppercase;
  letter-spacing: .10em;
  font-weight: 500;
  transition: color .15s ease;
  white-space: nowrap;
}
.cli-strip.is-copied .cli-hint { color: var(--cli-success); }
.cli-strip.is-copied .cli-caret { animation: none; opacity: 0; transform: scale(.7); }

/* Success ✓ glyph — replaces the caret on `.is-copied`. The stroke draws in
   via path-length animation; subtle pop on entrance. Reduced-motion users
   get the final state instantly. */
.cli-check {
  display: inline-block;
  width: 14px;
  height: 1em;
  margin-left: 2px;
  vertical-align: -2px;
  color: var(--cli-success);
  opacity: 0;
  transform: scale(.7);
  transition: opacity .15s ease, transform .25s cubic-bezier(.22, 1, .36, 1);
}
.cli-check path {
  stroke-dasharray: 20;
  stroke-dashoffset: 20;
}
.cli-strip.is-copied .cli-check {
  opacity: 1;
  transform: scale(1);
}
.cli-strip.is-copied .cli-check path {
  animation: cli-check-draw .35s cubic-bezier(.22, 1, .36, 1) .05s forwards;
}
@keyframes cli-check-draw {
  to { stroke-dashoffset: 0; }
}
@media (prefers-reduced-motion: reduce) {
  .cli-check, .cli-strip.is-copied .cli-check { transition: none; }
  .cli-strip.is-copied .cli-check path { animation: none; stroke-dashoffset: 0; }
}

@media (max-width: 720px) {
  .cli-strip {
    font-size: 12.5px;
    padding: 12px 16px;
    gap: 10px;
    width: calc(100% - 48px);
  }
  .cli-hint { display: none; }
}
@media (max-width: 480px) {
  .cli-strip {
    font-size: 11.5px;
    gap: 8px;
  }
}

/* =========================================================================
   INSTALL-PILL — quieter cousin of .cli-strip for header-adjacent contexts.
   Reuses the [data-copy] handler in site.js (.is-copied class flips icons).
   ========================================================================= */

.install-pill {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  border-radius: 10px;
  border: 1px solid transparent;
  background: var(--code-bg);
  color: var(--code-fg-default);
  font-family: var(--mono);
  font-size: 13px;
  line-height: 1.4;
  cursor: pointer;
  width: max-content;
  max-width: 100%;
  user-select: none;
  text-align: left;
  transition: background-color .2s cubic-bezier(.22, 1, .36, 1),
              border-color   .2s cubic-bezier(.22, 1, .36, 1);
}
.install-pill:hover {
  background: var(--code-bar-bg);
}
.install-pill:active { transform: translateY(1px); }
.install-pill:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}
.install-pill .ip-prompt {
  color: var(--code-fg-prompt);
  font-weight: 600;
  flex: 0 0 auto;
}
.install-pill .ip-cmd {
  color: var(--code-fg-bright);
  min-width: 0;
  white-space: nowrap;
}
.install-pill .ip-icon {
  flex: 0 0 auto;
  color: currentColor;
  opacity: .55;
  transition: opacity .2s cubic-bezier(.22, 1, .36, 1);
}
.install-pill:hover .ip-icon { opacity: .85; }

/* Blinking caret — signals "live shell, ready to receive". Reuses the
   dc-blink keyframes at line 1597 so pill and .cli-strip share the same
   cadence. Hidden on .is-copied so the check has the success-state to itself. */
.install-pill .ip-caret {
  display: inline-block;
  width: 7px;
  height: 1em;
  background: var(--accent-light);
  vertical-align: -2px;
  animation: dc-blink 1.05s steps(2, end) infinite;
  flex: 0 0 auto;
}
.install-pill.is-copied .ip-caret { animation: none; opacity: 0; transform: scale(.7); }
@media (prefers-reduced-motion: reduce) {
  .install-pill .ip-caret { animation: none; }
}

.install-pill .ip-check { display: none; color: var(--cli-success); opacity: 1; }
.install-pill.is-copied { border-color: color-mix(in oklch, var(--accent-light) 60%, transparent); }
.install-pill.is-copied .ip-copy { display: none; }
.install-pill.is-copied .ip-check { display: inline-block; }

/* Copy-failed recovery — when both clipboard paths refuse, the JS pre-
   selects the command text so Ctrl+C works. Cursor + user-select hint that
   the text is now grabable; no border-colour change (would conflict with
   hover/copied states on .cli-strip). The ::selection highlight (line 115)
   IS the visible failure signal. */
.install-pill.is-copy-failed,
.cli-strip.is-copy-failed {
  cursor: text;
}
.install-pill.is-copy-failed .ip-cmd,
.cli-strip.is-copy-failed .cli-cmd { user-select: text; }

@media (max-width: 640px) {
  /* Padding bumps the touch target from ~34px to ~42px tall on phones —
     well clear of the 24×24 AA floor and within reach of the 44×44 AAA. */
  .install-pill { width: 100%; font-size: 12.5px; padding: 12px 14px; }
  .install-pill .ip-cmd {
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
  }
}

@media (prefers-reduced-motion: reduce) {
  .install-pill,
  .install-pill .ip-icon { transition: none; }
  .install-pill:active { transform: none; }
}

.hero-install { margin: 8px 0 24px; }
.page-install { margin: 12px 0 32px; }

/* Pill-meta — version + license + open-source label, sits directly under
   the pill in both .hero-install and .page-install contexts. Answers the
   30-second-scan question "what version and license am I getting". */
.pill-meta {
  margin: 8px 0 0;
  font-family: var(--mono);
  font-size: 11.5px;
  color: var(--muted);
  letter-spacing: .02em;
}
@media (prefers-reduced-motion: reduce) {
  .cli-caret { animation: none; }
  .cli-strip:hover { transform: none; }
}

/* =========================================================================
   FAQ — accordion of common questions at the bottom of the landing.
   Native <details>/<summary>; the +/× glyph is the only iconography. Items
   are hairline-separated, no card chrome, no shadows. Reveal animation is
   opt-in via `interpolate-size: allow-keywords` — browsers without support
   simply snap open/closed.
   ========================================================================= */

.faq-list {
  max-width: var(--content);
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  border-top: 1px solid var(--rule);
  /* `interpolate-size` permits transitioning to/from `auto`. Browsers without
     this rule ignore the property and snap the panels open/closed cleanly. */
  interpolate-size: allow-keywords;
}

.faq-item {
  border-bottom: 1px solid var(--rule);
}

/* Strip the default disclosure triangle in every engine. */
.faq-item > summary {
  list-style: none;
}
.faq-item > summary::-webkit-details-marker { display: none; }

.faq-q {
  font-family: var(--display);
  font-size: 17px;
  font-weight: 500;
  letter-spacing: -.005em;
  color: var(--text);
  padding: 24px 56px 24px 0;
  cursor: pointer;
  position: relative;
  transition: color .15s ease;
}
.faq-q:hover { color: var(--accent); }
.faq-item[open] > .faq-q { color: var(--ink); }

/* The plus glyph — rotates to × on open. Built from two pseudo strokes so
   the rotation is a single transform on the parent, not two coordinated ones. */
.faq-q::after {
  content: "";
  position: absolute;
  top: 50%;
  right: 4px;
  width: 14px;
  height: 14px;
  margin-top: -7px;
  background:
    linear-gradient(var(--accent), var(--accent)) center / 14px 1.5px no-repeat,
    linear-gradient(var(--accent), var(--accent)) center / 1.5px 14px no-repeat;
  transition: transform .2s cubic-bezier(.4, 0, .2, 1);
}
.faq-item[open] > .faq-q::after {
  transform: rotate(45deg);
}

/* The answer panel — Inter body, ash color, 65ch reading rail. */
.faq-a {
  font-family: var(--body);
  font-size: 16px;
  line-height: 1.65;
  color: var(--muted);
  max-width: 65ch;
  padding: 0 0 28px;
}
.faq-a code {
  font-family: var(--mono);
  font-size: .85em;
  background: var(--accent-soft);
  color: var(--ink);
  padding: 1px 5px;
  border-radius: 3px;
}

/* Focus ring on the summary lives on the inner row (matches button focus
     elsewhere in the site). */
.faq-item > summary:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 4px;
  border-radius: 3px;
}

/* Animated open/close in browsers that support `::details-content` */
@supports selector(::details-content) {
  .faq-item::details-content {
    block-size: 0;
    overflow: hidden;
    opacity: 0;
    transition: block-size .26s cubic-bezier(.4, 0, .2, 1), opacity .18s ease, content-visibility .26s allow-discrete;
  }
  .faq-item[open]::details-content {
    block-size: auto;
    opacity: 1;
  }
}

@media (prefers-reduced-motion: reduce) {
  .faq-q::after { transition: none; }
  .faq-item::details-content { transition: none; }
}

/* =========================================================================
   DOCS shell
   ========================================================================= */

.docs-shell {
  display: grid;
  grid-template-columns: var(--sidebar) 1fr var(--toc);
  max-width: 1400px;
  margin: 0 auto;
  padding: 0 32px;
}

aside.sidebar {
  position: sticky;
  top: var(--header);
  align-self: start;
  height: calc(100vh - var(--header));
  overflow-y: auto;
  padding: 40px 32px 80px 0;
  border-right: 1px solid var(--rule);
  margin-right: 48px;
  font-size: 14px;
}

.nav-group + .nav-group { margin-top: 36px; }
.nav-group h4 {
  margin: 0 0 12px;
  font-family: var(--display);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--muted);
}
.nav-group ul {
  list-style: none;
  padding: 0;
  margin: 0;
}
.nav-group li { position: relative; }
.nav-group a {
  display: block;
  padding: 5px 0 5px 12px;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.55;
  font-weight: 400;
}
.nav-group a:hover { color: var(--ink); }
.nav-group a.is-active {
  color: var(--ink);
  font-weight: 500;
}
/* Per DESIGN.md reserved-accent contract: active rails belong to ink, not accent.
   Rail sits at the link's left edge (inside the sidebar's clipping context). */
.nav-group a.is-active::before {
  content: "";
  position: absolute;
  left: 0;
  top: 6px;
  bottom: 6px;
  width: 2px;
  border-radius: 1px;
  background: var(--ink);
}

main.article {
  padding: 64px 0 120px;
  min-width: 0;
}
.article > .eyebrow { margin-bottom: 16px; }
.article > h1 {
  font-size: 48px;
  font-weight: 600;
  line-height: 1.1;
  letter-spacing: -.025em;
  margin-bottom: 20px;
}
.article > .lead {
  font-size: 21px;
  line-height: 1.55;
  color: var(--text);
  max-width: 620px;
  margin-bottom: 0;
}

/* Docs hero — opt-in via frontmatter `heroSymbol: <name>`. Mirrors the
   landing hero's shape (text on the left, symbolic SVG on the right) but
   keeps the docs register: lighter type, narrower symbol column, no CTA bar. */
.docs-hero {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr);
  gap: 56px;
  align-items: center;
  margin-bottom: 40px;
}
.docs-hero-text > .eyebrow { margin-bottom: 16px; }
.docs-hero-text > h1 {
  font-size: 48px;
  font-weight: 600;
  line-height: 1.1;
  letter-spacing: -.025em;
  margin-bottom: 20px;
  color: var(--ink);
  font-family: var(--display);
}
.docs-hero-text > h1 .accent { color: var(--accent); }
.docs-hero-text > .lead {
  font-size: 19px;
  line-height: 1.55;
  color: var(--text);
  max-width: 560px;
  margin-bottom: 0;
}
.docs-hero-symbol {
  position: relative;
  min-width: 0;
}
.hero-symbol-svg {
  display: block;
  width: 100%;
  max-width: 320px;
  height: auto;
  margin: 0 auto;
}

/* Memory ring symbol — re-verified anchor + canonical inner ring +
   candidate stream on the outer dotted band. Uses the same filled / stroke /
   dotted / accent vocabulary as the strata SVG. */
.memring-svg .memring-outer-fill { fill: url(#memring-dots); }
.memring-svg .pattern-dot { fill: var(--charcoal); }
.memring-svg .memring-outer {
  fill: none;
  stroke: var(--ink);
  stroke-width: 1;
  stroke-opacity: .35;
}
.memring-svg .memring-inner {
  fill: none;
  stroke: var(--ink);
  stroke-width: 1.75;
}
.memring-svg .memring-tick { fill: var(--ink); }
.memring-svg .memring-cand {
  fill: var(--ink);
  stroke: var(--bg);
  stroke-width: 2;
  paint-order: stroke fill;
}
.memring-svg .memring-cand-active {
  fill: var(--accent);
  stroke: var(--bg);
  stroke-width: 2.5;
  paint-order: stroke fill;
}
.memring-svg .memring-promote {
  fill: none;
  stroke: var(--accent);
  stroke-width: 1.25;
  stroke-dasharray: 3 3;
  stroke-linecap: round;
}
.memring-svg .memring-arrow { fill: var(--accent); }
.memring-svg .memring-cite { fill: var(--accent); }
.memring-svg .memring-radial {
  stroke: var(--accent);
  stroke-width: 1;
  stroke-linecap: round;
  opacity: .7;
}
.memring-svg .memring-anchor { fill: var(--ink); }
.memring-svg .memring-key {
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: .12em;
  text-transform: uppercase;
  fill: var(--accent);
}

/* ----- Shared hero-symbol caption + numeral baselines ------------------- */
.hero-symbol-svg .on-fill { fill: var(--paper); }

/* Swarm hero symbol — fan and merge. */
.fanmerge-svg .fm-recipe { fill: var(--ink); }
.fanmerge-svg .fm-numeral {
  font-family: var(--display);
  font-size: 14px;
  font-weight: 700;
  fill: var(--ink);
  letter-spacing: -.005em;
}
.fanmerge-svg .fm-worker {
  fill: var(--paper);
  stroke: var(--ink);
  stroke-width: 1.5;
}
.fanmerge-svg .fm-tag {
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: .04em;
  fill: var(--ink);
}
.fanmerge-svg .fm-conn {
  stroke: var(--ink);
  stroke-width: 1.25;
  fill: none;
  stroke-linecap: round;
}
.fanmerge-svg .fm-arrow { fill: var(--ink); }
.fanmerge-svg .fm-arrow-acc { fill: var(--accent); }
.fanmerge-svg .fm-audit {
  fill: var(--accent);
  stroke: var(--accent);
  stroke-width: 1.5;
}
.fanmerge-svg .fm-audit-glyph {
  stroke: var(--paper);
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.fanmerge-svg .fm-result { fill: var(--ink); }
.fanmerge-svg .fm-caption {
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: .12em;
  text-transform: uppercase;
  fill: var(--accent);
}

/* Hooks hero symbol — the boundary. */
.boundary-svg .bnd-claude { fill: var(--ink); }
.boundary-svg .bnd-tool {
  fill: var(--paper);
  stroke: var(--ink);
  stroke-width: 1.5;
}
.boundary-svg .bnd-numeral {
  font-family: var(--display);
  font-size: 22px;
  font-weight: 700;
  letter-spacing: .08em;
  fill: var(--ink);
}
.boundary-svg .bnd-numeral.on-fill { fill: var(--paper); }
.boundary-svg .bnd-rule {
  stroke: var(--accent);
  stroke-width: 2;
  stroke-dasharray: 6 5;
  stroke-linecap: round;
}
.boundary-svg .bnd-tick {
  stroke: var(--accent);
  stroke-width: 1.75;
  stroke-linecap: round;
}
.boundary-svg .bnd-consent {
  fill: var(--accent);
  stroke: var(--bg);
  stroke-width: 2;
  paint-order: stroke fill;
}
.boundary-svg .bnd-zone {
  font-family: var(--mono);
  font-size: 9.5px;
  font-weight: 600;
  letter-spacing: .12em;
  text-transform: uppercase;
  fill: var(--muted);
}
.boundary-svg .bnd-caption {
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: .12em;
  text-transform: uppercase;
  fill: var(--accent);
}

/* Skills hero symbol — composition tree. */
.comptree-svg .ct-anchor { fill: var(--ink); }
.comptree-svg .ct-skill {
  fill: var(--paper);
  stroke: var(--ink);
  stroke-width: 1.5;
}
.comptree-svg .ct-tag {
  font-family: var(--mono);
  font-size: 11.5px;
  font-weight: 600;
  fill: var(--ink);
  letter-spacing: -.005em;
}
.comptree-svg .ct-conn {
  stroke: var(--ink);
  stroke-width: 1;
  fill: none;
  stroke-linecap: round;
}
.comptree-svg .ct-arrow { fill: var(--ink); }
.comptree-svg .ct-arrow-acc { fill: var(--accent); }
.comptree-svg .ct-edge-must {
  stroke: var(--accent);
  stroke-width: 1.75;
  fill: none;
}
.comptree-svg .ct-edge-cond {
  stroke: var(--accent);
  stroke-width: 1.5;
  stroke-dasharray: 4 4;
  fill: none;
}
.comptree-svg .ct-edge-none {
  stroke: var(--muted);
  stroke-width: 1.5;
  stroke-linecap: square;
}
.comptree-svg .ct-sub {
  fill: var(--ink);
  stroke: var(--bg);
  stroke-width: 2;
  paint-order: stroke fill;
}
.comptree-svg .ct-sub-tag {
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 600;
  fill: var(--ink);
  letter-spacing: -.005em;
}
.comptree-svg .ct-sub-rule {
  font-family: var(--mono);
  font-size: 9.5px;
  font-weight: 500;
  fill: var(--muted);
  letter-spacing: .04em;
}
.comptree-svg .ct-caption {
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: .12em;
  text-transform: uppercase;
  fill: var(--accent);
}

/* Install hero symbol — the drop. Open frame project root, filled sentinels
   landing inside, accent dot marking the install action. */
.dropbox-svg .db-action      { fill: var(--accent); }
.dropbox-svg .db-drop {
  stroke: var(--accent);
  stroke-width: 2;
  stroke-dasharray: 3 4;
  stroke-linecap: round;
}
.dropbox-svg .db-target {
  fill: none;
  stroke: var(--ink);
  stroke-width: 1.5;
}
.dropbox-svg .db-target-tag {
  font-family: var(--mono);
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: .04em;
  fill: var(--muted);
  text-transform: lowercase;
}
.dropbox-svg .db-sentinel rect { fill: var(--ink); }
.dropbox-svg .db-label {
  font-family: var(--mono);
  font-size: 13px;
  font-weight: 600;
  letter-spacing: -.005em;
  fill: var(--paper);
}
.dropbox-svg .db-label-mini {
  font-family: var(--mono);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0;
  fill: var(--paper);
}
.dropbox-svg .db-caption {
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: .12em;
  text-transform: uppercase;
  fill: var(--accent);
}

/* CLI hero symbol — the command fork. Filled command axis at top, accent
   fork dot, three branches to mode nodes (one highlighted in accent),
   converging to a single target dot. */
.cmdfork-svg .cf-cmd { fill: var(--ink); }
.cmdfork-svg .cf-cmd-label {
  font-family: var(--mono);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: -.005em;
  fill: var(--paper);
}
.cmdfork-svg .cf-spine {
  stroke: var(--ink);
  stroke-width: 1.5;
  fill: none;
}
.cmdfork-svg .cf-fork {
  fill: var(--accent);
  stroke: var(--bg);
  stroke-width: 2;
  paint-order: stroke fill;
}
.cmdfork-svg .cf-branch {
  stroke: var(--ink);
  stroke-width: 1.25;
  fill: none;
  stroke-linecap: round;
  opacity: .55;
}
.cmdfork-svg .cf-branch-act {
  stroke: var(--accent);
  stroke-width: 1.75;
  fill: none;
  stroke-linecap: round;
  stroke-dasharray: 4 4;
}
.cmdfork-svg .cf-mode-frame {
  fill: var(--paper);
  stroke: var(--ink);
  stroke-width: 1.25;
}
.cmdfork-svg .cf-mode-frame-act {
  fill: var(--accent);
  stroke: var(--accent);
  stroke-width: 1.5;
}
.cmdfork-svg .cf-mode-tag {
  font-family: var(--display);
  font-size: 13px;
  font-weight: 600;
  letter-spacing: -.005em;
  fill: var(--ink);
}
.cmdfork-svg .cf-mode-sub {
  font-family: var(--mono);
  font-size: 9.5px;
  font-weight: 500;
  letter-spacing: .06em;
  text-transform: uppercase;
  fill: var(--muted);
}
.cmdfork-svg .cf-mode-sub-act {
  font-family: var(--mono);
  font-size: 9.5px;
  font-weight: 500;
  letter-spacing: .06em;
  text-transform: uppercase;
  fill: var(--paper);
  opacity: .82;
}
.cmdfork-svg .cf-converge {
  stroke: var(--ink);
  stroke-width: 1.25;
  fill: none;
  stroke-linecap: round;
  opacity: .55;
}
.cmdfork-svg .cf-converge-act {
  stroke: var(--accent);
  stroke-width: 1.75;
  fill: none;
  stroke-linecap: round;
  stroke-dasharray: 4 4;
}
.cmdfork-svg .cf-target {
  fill: var(--ink);
  stroke: var(--bg);
  stroke-width: 2.5;
  paint-order: stroke fill;
}
.cmdfork-svg .cf-caption {
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: .12em;
  text-transform: uppercase;
  fill: var(--accent);
}

@media (max-width: 1000px) {
  .docs-hero {
    grid-template-columns: 1fr;
    gap: 32px;
  }
  .docs-hero-symbol {
    max-width: 280px;
    margin: 0 auto;
  }
}

/* Article sections share the landing's .section + .lede rhythm.
   First section sits flush under the lead paragraph (no double-padding);
   last section drops its bottom border and tightens its trailing pad
   so the .docfoot lands at a sensible distance. */
.article > .section { padding: 64px 0; }
.article > .section:first-of-type { padding-top: 56px; }
.article > .section:last-of-type { padding-bottom: 32px; border-bottom: 0; }
.article > .section h2 { scroll-margin-top: 84px; }
/* Docs H2s are often longer than landing H2s (e.g. "Worktree isolation
   vs shared mode"). Relax the 12ch cap so titles wrap on word boundaries
   rather than stranding trailing tokens. */
.article > .section .lede h2 { max-width: none; }

/* H3 (used inside section bodies, e.g. /swarm/ pipeline subsections). */
.article h3 {
  margin-top: 40px;
  margin-bottom: 12px;
  font-size: 18px;
}
.article p,
.article ul,
.article ol { max-width: var(--content); }
.article ul, .article ol {
  padding-left: 22px;
  margin: 0 0 20px;
}
.article li + li { margin-top: 6px; }
.article li { color: var(--text); }
.article li code { font-size: .85em; }

/* tables — wrapped at narrow viewports for horizontal scroll.
   The wrapper is auto-generated below at the mobile breakpoint via overflow-x
   on the table itself, which permits scrolling without an extra DOM wrapper.
   We pair display:block with white-space:nowrap on cells at narrow widths
   so tables scroll rather than silently clip. */
.article table {
  border-collapse: collapse;
  width: 100%;
  max-width: var(--content);
  font-size: 14.5px;
  margin: 24px 0 32px;
}
.article table th,
.article table td {
  padding: 12px 16px 12px 0;
  text-align: left;
  border-bottom: 1px solid var(--rule);
  vertical-align: top;
}
.article table th {
  font-family: var(--display);
  font-weight: 600;
  font-size: 12px;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--muted);
  padding-bottom: 10px;
  padding-top: 0;
  border-bottom-color: var(--ink);
}
.article table td:first-child {
  font-family: var(--mono);
  font-size: 13px;
  color: var(--muted);
  width: 36px;
}
.article table td.phase {
  font-weight: 500;
  color: var(--ink);
}
.article table tbody tr {
  transition: background .12s ease;
}
.article table tbody tr:hover {
  background: var(--hover-tint);
}
.article table tbody tr:hover td.phase {
  color: var(--accent);
}

/* callout */
.callout {
  background: var(--paper);
  border: 1px solid var(--rule);
  border-radius: 10px;
  padding: 20px 24px;
  margin: 24px 0 32px;
  max-width: var(--content);
  display: flex;
  gap: 14px;
  align-items: flex-start;
}
.callout .icon {
  flex: 0 0 22px;
  width: 22px; height: 22px;
  border-radius: 50%;
  background: var(--warn);
  color: var(--paper);
  display: grid;
  place-items: center;
  font-family: var(--display);
  font-weight: 700;
  font-size: 13px;
  margin-top: 2px;
}
.callout .body {
  flex: 1;
  font-size: 15px;
  line-height: 1.6;
  color: var(--text);
}
.callout strong {
  color: var(--ink);
  display: block;
  margin-bottom: 4px;
  font-family: var(--display);
  font-weight: 600;
}
.callout p { margin: 0; }

/* TOC (right rail) */
aside.toc {
  position: sticky;
  top: var(--header);
  align-self: start;
  height: calc(100vh - var(--header));
  overflow-y: auto;
  padding: 64px 0 80px 48px;
  font-size: 13px;
}
.toc h5 {
  margin: 0 0 16px;
  font-family: var(--display);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--muted);
}
.toc ul {
  list-style: none;
  padding: 0;
  margin: 0;
}
.toc li { margin: 0 0 7px; position: relative; }
.toc a {
  display: block;
  color: var(--muted);
  font-size: 13.5px;
  line-height: 1.5;
}
.toc a:hover { color: var(--ink); }
/* Active TOC item: ink rail (per DESIGN.md reserved-accent contract —
   active rails belong to ink, not accent). Mirrors the sidebar treatment. */
.toc a.is-active { color: var(--ink); font-weight: 500; }
.toc a.is-active::before {
  content: "";
  position: absolute;
  left: -14px;
  top: 4px;
  bottom: 4px;
  width: 2px;
  border-radius: 1px;
  background: var(--ink);
}
.toc a.lvl-3 { padding-left: 14px; font-size: 13px; }

/* footer inside article: slim "last updated" + single edit link.
   License and other Project links live in the rich site footer below. */
.article footer.docfoot {
  border-top: 1px solid var(--rule);
  margin-top: 80px;
  padding-top: 24px;
  font-family: var(--mono);
  font-size: 12px;
  color: var(--muted);
  display: flex;
  justify-content: space-between;
  align-items: center;
  max-width: var(--content);
  letter-spacing: 0;
}
.article footer.docfoot a { color: var(--muted); }
.article footer.docfoot a:hover { color: var(--accent); }
.article footer.docfoot .docfoot-edit { font-weight: 500; }
.article footer.docfoot .docfoot-edit .arr {
  display: inline-block;
  transition: transform .15s cubic-bezier(.25, 1, .5, 1);
}
.article footer.docfoot .docfoot-edit:hover .arr { transform: translateX(3px); }

/* =========================================================================
   responsive
   ========================================================================= */

@media (max-width: 1100px) {
  aside.toc { display: none; }
  .docs-shell { grid-template-columns: var(--sidebar) 1fr; }
}
@media (max-width: 900px) {
  .section .lede { grid-template-columns: 1fr; gap: 24px; }
  .install { grid-template-columns: 1fr; }
  .concepts,
  .concepts.is-2col { grid-template-columns: 1fr; }
}
@media (max-width: 720px) {
  header.top { padding: 0 20px; }
  nav.primary { display: none; }
  .nav-toggle { display: inline-flex; }
  .marketing { padding: 0 24px; }
  .hero { padding: 56px 0 56px; }
  .section { padding: 56px 0; }
  .docs-shell { grid-template-columns: 1fr; padding: 0 24px; }

  /* Sidebar becomes a slide-in drawer at mobile, controlled by the topnav
     hamburger. Hidden by default; revealed when body has .is-nav-open. */
  aside.sidebar {
    position: fixed;
    top: var(--header);
    bottom: 0;
    left: 0;
    width: min(320px, 84vw);
    height: auto;
    margin: 0;
    padding: 28px 24px 80px;
    background: var(--paper);
    border-right: 1px solid var(--rule);
    border-bottom: 0;
    z-index: 30;
    transform: translateX(-100%);
    transition: transform .28s cubic-bezier(.22, 1, .36, 1);
    overflow-y: auto;
    overscroll-behavior: contain;
  }
  body.is-nav-open aside.sidebar {
    transform: translateX(0);
    box-shadow: 8px 0 32px rgba(0, 0, 0, 0.10);
  }

  /* Backdrop — fades in only while the drawer is open; tap-to-close target. */
  .nav-backdrop {
    display: block;
    position: fixed;
    inset: var(--header) 0 0 0;
    background: rgba(0, 0, 0, .42);
    opacity: 0;
    pointer-events: none;
    transition: opacity .2s ease;
    z-index: 25;
  }
  body.is-nav-open .nav-backdrop {
    opacity: 1;
    pointer-events: auto;
  }
  body.is-nav-open { overflow: hidden; }

  main.article { padding: 32px 0 80px; }
  .article > h1 { font-size: 36px; }

  /* Mobile drawer is a tap surface — bump nav-group link targets toward
     the 44px target-size recommendation (WCAG 2.5.5). At desktop the rail
     is operated by pointer and 24px is fine; here the user is tapping. */
  aside.sidebar .nav-group a {
    padding: 10px 0 10px 12px;
    font-size: 15px;
  }

  /* Article tables — long mode/action tables on /cli/ would otherwise
     silently clip at narrow widths. Allow horizontal scroll with a subtle
     edge cue so users know more content is available. */
  .article table {
    display: block;
    width: 100%;
    overflow-x: auto;
    overscroll-behavior-x: contain;
    -webkit-overflow-scrolling: touch;
    border: 0;
  }
  .article table thead,
  .article table tbody { display: table; width: 100%; min-width: 480px; }
  .article table th,
  .article table td { white-space: normal; }
  .article table th:first-child,
  .article table td:first-child { padding-left: 0; }

  /* 5 stats laid out as 3 + 2 — top row carries the structural counts
     (hooks, skills, subagent), bottom row the workflow counts (phases, gates). */
  .hero .meta-strip {
    grid-template-columns: repeat(3, 1fr);
    row-gap: 22px;
    padding: 22px 0;
  }
  .hero .meta-strip .stat {
    border-inline-start: 1px solid var(--rule);
    padding-inline: 14px;
  }
  .hero .meta-strip .stat:nth-child(3n + 1) {
    border-inline-start: 0;
    padding-inline-start: 0;
  }
  .hero .meta-strip .stat .num { font-size: 24px; }

  footer.site { margin-top: 80px; padding: 48px 24px 24px; }
  /* Mobile footer: brand row full-width, link columns share a 2-col row. */
  .footer-grid {
    grid-template-columns: 1fr 1fr;
    gap: 28px 24px;
    padding-bottom: 32px;
  }
  .footer-brand-col { grid-column: 1 / -1; }
  .footer-meta-row {
    flex-direction: column;
    gap: 6px;
    align-items: flex-start;
  }
}

/* =========================================================================
   WOBBLE-FRAME — hand-drawn-ish 2px ink outline drawn just outside an inner
   pixel-sharp surface (dev-console, install-snippet, plates). Uses an SVG
   turbulence filter (defined inline in base.njk) to perturb only the border
   of the ::after pseudo-element. Content stays sharp. Per DESIGN.md the
   inner window may carry a slight rotation (≤2°) to read as a sticker.
   ========================================================================= */

.svg-defs {
  position: absolute;
  width: 0;
  height: 0;
  pointer-events: none;
  overflow: hidden;
}

.wobble-frame {
  position: relative;
  display: block;
  align-self: stretch;
  min-width: 0;
  isolation: isolate;
  transform: rotate(-0.45deg);
  transition: transform .3s cubic-bezier(.4,0,.2,1);
}
.wobble-frame.is-tilt-rev { transform: rotate(0.5deg); }

/* Outline: inset slightly outside the inner surface, ink stroke, filter
   warps the rectangle into a hand-drawn-feeling outline. The pseudo
   contains nothing but a border, so only the border edges distort. */
.wobble-frame::after {
  content: "";
  position: absolute;
  inset: -6px;
  border: 2px solid var(--ink);
  border-radius: 16px;
  pointer-events: none;
  z-index: -1;
  filter: url(#wobble);
}

/* Inner surface keeps its own clipping + radius. Wobble-frame children
   stretch to fill so dev-console + install-snippet still match heights. */
.wobble-frame > * {
  position: relative;
  z-index: 0;
  height: 100%;
}

/* dev-console frame: hero-grid item — the wobble-frame replaces .dev-console
   as the grid item. Stretch to align with the .hero-content baseline column. */
.dc-frame { display: flex; }
.dc-frame > .dev-console { width: 100%; }

/* Hover: gently un-tilt; respects the wobble-frame::after rotation. */
@media (hover: hover) {
  .wobble-frame:hover { transform: rotate(0deg); }
}

@media (prefers-reduced-motion: reduce) {
  .wobble-frame { transform: none; transition: none; }
  .wobble-frame.is-tilt-rev { transform: none; }
  .wobble-frame::after { filter: none; }
}

@media (max-width: 1000px) {
  /* on stacked layout, drop rotation so frames align to flow */
  .wobble-frame, .wobble-frame.is-tilt-rev { transform: none; }
}

/* =========================================================================
   ENTRANCE & SCROLL ANIMATIONS
   Hero entrance is CSS-only with animation-delay stagger — plays on first
   paint, no JS, no flash. Figure reveals use animation-timeline: view() so
   browsers without scroll-driven-animation support simply show the final
   state. No degradation, no fallback shim.
   ========================================================================= */

@keyframes fb-rise {
  from { opacity: 0; transform: translateY(14px); }
  to   { opacity: 1; transform: translateY(0);    }
}
@keyframes fb-rise-lg {
  from { opacity: 0; transform: translateY(22px); }
  to   { opacity: 1; transform: translateY(0);    }
}

/* Marketing hero — staggered entrance, one signature page-load moment. */
.hero .eyebrow,
.hero h1,
.hero .lead,
.hero .ctas,
.hero .meta-strip,
.hero .hero-figure,
.hero .dc-frame {
  animation: fb-rise 0.6s cubic-bezier(.22, 1, .36, 1) both;
}
.hero h1           { animation-delay:  60ms; }
.hero .lead        { animation-delay: 160ms; }
.hero .ctas        { animation-delay: 260ms; }
.hero .meta-strip  { animation-delay: 360ms; }
.hero .hero-figure,
.hero .dc-frame {
  animation-name: fb-rise-lg;
  animation-duration: 0.8s;
  animation-delay: 200ms;
}

/* Docs hero — same shape, slightly tighter pacing for reference pages. */
.docs-hero .eyebrow,
.docs-hero h1,
.docs-hero .lead,
.docs-hero-symbol {
  animation: fb-rise 0.55s cubic-bezier(.22, 1, .36, 1) both;
}
.docs-hero h1     { animation-delay:  60ms; }
.docs-hero .lead  { animation-delay: 160ms; }
.docs-hero-symbol {
  animation-duration: 0.7s;
  animation-delay: 200ms;
}

/* Scroll-driven reveals — modern browsers get a quiet fade-up as figures
   enter the viewport. Browsers without animation-timeline ignore the rules
   and the figures render in their final state. */
@supports (animation-timeline: view()) {
  @media (prefers-reduced-motion: no-preference) {
    .figure,
    .figure-strata,
    .callout,
    .install {
      animation: fb-rise-lg linear both;
      animation-timeline: view();
      animation-range: entry 0% cover 22%;
    }

    /* Strata stagger — the four forms reveal in narrative order
       (Genesis → Constitution → Implementation → Tool boundary) as the
       figure scrolls into view. Each form gets a slightly later activation
       window via animation-range, so the cascade feels deliberate. */
    .strata-svg .strata-form {
      animation: fb-rise linear both;
      animation-timeline: view(--strata-figure);
      transform-box: fill-box;
      transform-origin: center;
    }
    .figure-strata { view-timeline: --strata-figure block; }
    .strata-svg .strata-i   { animation-range: entry 0%  entry 35%; }
    .strata-svg .strata-ii  { animation-range: entry 10% entry 55%; }
    .strata-svg .strata-iii { animation-range: entry 20% entry 75%; }
    .strata-svg .strata-iv  { animation-range: entry 30% cover 10%; }
  }
}

/* Hero-symbol accent-dot breath on hover. Soft scale + accent halo on the
   accent dots inside each docs hero symbol. Single signal that the
   ideogram is alive; respects reduced motion via the global override at
   end of file. */
.docs-hero-symbol .hero-symbol-svg .bnd-consent,
.docs-hero-symbol .hero-symbol-svg .ct-sub,
.docs-hero-symbol .hero-symbol-svg .fm-result,
.docs-hero-symbol .hero-symbol-svg .memring-cand-active {
  transform-box: fill-box;
  transform-origin: center;
  transition: transform .35s cubic-bezier(.22, 1, .36, 1);
}
.docs-hero-symbol:hover .hero-symbol-svg .bnd-consent,
.docs-hero-symbol:hover .hero-symbol-svg .ct-sub,
.docs-hero-symbol:hover .hero-symbol-svg .fm-result,
.docs-hero-symbol:hover .hero-symbol-svg .memring-cand-active {
  transform: scale(1.35);
}

/* 404 page — share the .marketing shell + .concepts grid, just slimmer
   between hero and §I (no meta-strip, no dev console). */
.not-found .hero { padding: 96px 0 48px; border-bottom: 0; }
.not-found .hero h1 { max-width: 720px; }
.not-found .hero .lead { max-width: 580px; }
.not-found .section { padding-top: 24px; border-bottom: 0; }
.not-found .concepts.is-2col {
  grid-template-columns: repeat(2, 1fr);
  grid-auto-rows: minmax(0, auto);
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    transition-duration: .01ms !important;
    animation-duration: .01ms !important;
  }
}
