/* jascon.net - one stylesheet for every page.

   Order: fonts, tokens (light, then dark twice - CSS cannot share a block
   between a selector and a media query, so change both), base, layout,
   components, page sections, small screens, print.

   No request leaves the site: the three typefaces are served from
   assets/fonts (SIL OFL 1.1, licences beside them). The violet is the accent
   of the JASCON app, so the site and the tool read as one thing. */

@font-face { font-family: "Inter"; src: url("../fonts/inter-latin-wght-normal.woff2") format("woff2"); font-weight: 100 900; font-style: normal; font-display: swap; }
@font-face { font-family: "Source Serif 4"; src: url("../fonts/source-serif-4-latin-wght-normal.woff2") format("woff2"); font-weight: 200 900; font-style: normal; font-display: swap; }
@font-face { font-family: "Source Serif 4"; src: url("../fonts/source-serif-4-latin-wght-italic.woff2") format("woff2"); font-weight: 200 900; font-style: italic; font-display: swap; }
@font-face { font-family: "JetBrains Mono"; src: url("../fonts/jetbrains-mono-latin-wght-normal.woff2") format("woff2"); font-weight: 100 800; font-style: normal; font-display: swap; }

:root {
  --paper:      oklch(0.985 0.004 85);
  --paper-2:    oklch(0.962 0.006 85);
  --card:       oklch(1 0 0);
  --ink:        oklch(0.21 0.025 285);
  --ink-2:      oklch(0.38 0.022 285);
  --ink-3:      oklch(0.52 0.02 285);
  --rule:       oklch(0.9 0.008 85);
  --rule-2:     oklch(0.83 0.01 85);
  --accent:     oklch(0.47 0.2 295);
  --accent-2:   oklch(0.4 0.2 295);
  --accent-wash: oklch(0.47 0.2 295 / 0.08);
  --accent-line: oklch(0.47 0.2 295 / 0.28);
  --on-accent:  oklch(0.99 0.003 295);
  --green:      oklch(0.48 0.13 155);
  --green-wash: oklch(0.48 0.13 155 / 0.1);
  --amber:      oklch(0.55 0.13 70);
  --amber-wash: oklch(0.7 0.14 75 / 0.14);
  --blue:       oklch(0.5 0.13 245);
  --blue-wash:  oklch(0.5 0.13 245 / 0.1);
  --red:        oklch(0.53 0.19 25);
  --red-wash:   oklch(0.53 0.19 25 / 0.1);
  /* code windows are dark in both schemes: they are the tool, set into the page */
  --code-bg:    oklch(0.17 0.022 285);
  --code-bar:   oklch(0.21 0.024 285);
  --code-rule:  oklch(0.95 0.005 285 / 0.1);
  --code-ink:   oklch(0.9 0.01 285);
  --code-dim:   oklch(0.66 0.02 285);
  --code-key:   oklch(0.78 0.13 300);
  --code-str:   oklch(0.82 0.11 150);
  --code-num:   oklch(0.82 0.12 75);
  --code-kw:    oklch(0.76 0.12 235);
  --shadow:     0 1px 2px oklch(0.2 0.03 285 / 0.05), 0 8px 28px oklch(0.2 0.03 285 / 0.07);
  --shadow-lg:  0 2px 4px oklch(0.2 0.03 285 / 0.06), 0 24px 64px oklch(0.2 0.03 285 / 0.14);
  /* --script-sans and --script-serif: the faces for Devanagari, Japanese
     and Chinese, set per language at the end of styles.css; each ends in a
     comma, and is empty for English */
  --sans:  "Inter", var(--script-sans,) system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --serif: "Source Serif 4", var(--script-serif,) "Iowan Old Style", Georgia, serif;
  --mono:  "JetBrains Mono", ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  --wrap: 1180px;
  --gutter: clamp(20px, 4vw, 40px);
  --radius: 14px;
  color-scheme: light;
}
:root[data-theme="dark"] {
  --paper:      oklch(0.155 0.02 285);
  --paper-2:    oklch(0.185 0.022 285);
  --card:       oklch(0.205 0.023 285);
  --ink:        oklch(0.95 0.006 285);
  --ink-2:      oklch(0.79 0.016 285);
  --ink-3:      oklch(0.66 0.018 285);
  --rule:       oklch(0.95 0.005 285 / 0.1);
  --rule-2:     oklch(0.95 0.005 285 / 0.18);
  --accent:     oklch(0.74 0.16 298);
  --accent-2:   oklch(0.8 0.14 298);
  --accent-wash: oklch(0.74 0.16 298 / 0.12);
  --accent-line: oklch(0.74 0.16 298 / 0.38);
  --on-accent:  oklch(0.16 0.03 295);
  --green:      oklch(0.78 0.15 155);
  --green-wash: oklch(0.78 0.15 155 / 0.13);
  --amber:      oklch(0.82 0.13 80);
  --amber-wash: oklch(0.82 0.13 80 / 0.13);
  --blue:       oklch(0.76 0.12 240);
  --blue-wash:  oklch(0.76 0.12 240 / 0.14);
  --red:        oklch(0.72 0.17 25);
  --red-wash:   oklch(0.72 0.17 25 / 0.14);
  --code-bg:    oklch(0.125 0.018 285);
  --code-bar:   oklch(0.165 0.02 285);
  --shadow:     0 1px 2px oklch(0 0 0 / 0.3), 0 8px 28px oklch(0 0 0 / 0.3);
  --shadow-lg:  0 2px 4px oklch(0 0 0 / 0.3), 0 24px 64px oklch(0 0 0 / 0.45);
  color-scheme: dark;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]):not([data-theme="dark"]) {
    --paper:      oklch(0.155 0.02 285);
    --paper-2:    oklch(0.185 0.022 285);
    --card:       oklch(0.205 0.023 285);
    --ink:        oklch(0.95 0.006 285);
    --ink-2:      oklch(0.79 0.016 285);
    --ink-3:      oklch(0.66 0.018 285);
    --rule:       oklch(0.95 0.005 285 / 0.1);
    --rule-2:     oklch(0.95 0.005 285 / 0.18);
    --accent:     oklch(0.74 0.16 298);
    --accent-2:   oklch(0.8 0.14 298);
    --accent-wash: oklch(0.74 0.16 298 / 0.12);
    --accent-line: oklch(0.74 0.16 298 / 0.38);
    --on-accent:  oklch(0.16 0.03 295);
    --green:      oklch(0.78 0.15 155);
    --green-wash: oklch(0.78 0.15 155 / 0.13);
    --amber:      oklch(0.82 0.13 80);
    --amber-wash: oklch(0.82 0.13 80 / 0.13);
    --blue:       oklch(0.76 0.12 240);
    --blue-wash:  oklch(0.76 0.12 240 / 0.14);
    --red:        oklch(0.72 0.17 25);
    --red-wash:   oklch(0.72 0.17 25 / 0.14);
    --code-bg:    oklch(0.125 0.018 285);
    --code-bar:   oklch(0.165 0.02 285);
    --shadow:     0 1px 2px oklch(0 0 0 / 0.3), 0 8px 28px oklch(0 0 0 / 0.3);
    --shadow-lg:  0 2px 4px oklch(0 0 0 / 0.3), 0 24px 64px oklch(0 0 0 / 0.45);
    color-scheme: dark;
  }
}

/* ---------- base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; scroll-padding-top: 88px; }
body {
  margin: 0; background: var(--paper); color: var(--ink);
  font-family: var(--sans); font-size: 17px; line-height: 1.6;
  font-feature-settings: "cv05", "cv11", "ss03";
  -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility;
  overflow-x: hidden;
}
h1, h2, h3, h4, p, ul, ol, dl, dd, figure, blockquote, pre { margin: 0; }
ul, ol { padding: 0; list-style: none; }
img, svg { display: block; max-width: 100%; }
a { color: inherit; text-decoration-color: var(--rule-2); text-underline-offset: 0.2em; text-decoration-thickness: 1px; }
a:hover { text-decoration-color: currentColor; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 4px; }
button { font: inherit; color: inherit; }
code, kbd, pre { font-family: var(--mono); font-size: 0.875em; }
p code, li code, td code, dd code, small code {
  background: var(--accent-wash); color: var(--accent-2);
  padding: 0.1em 0.38em; border-radius: 5px; font-size: 0.84em; white-space: nowrap;
}
:root[data-theme="dark"] p code, :root[data-theme="dark"] li code, :root[data-theme="dark"] td code, :root[data-theme="dark"] dd code { color: var(--accent-2); }
strong { font-weight: 620; }
::selection { background: var(--accent); color: var(--on-accent); }

.skip { position: absolute; left: -999px; top: 8px; background: var(--ink); color: var(--paper); padding: 10px 16px; border-radius: 8px; z-index: 100; }
.skip:focus { left: 12px; }
.wrap { width: 100%; max-width: calc(var(--wrap) + 2 * var(--gutter)); margin: 0 auto; padding: 0 var(--gutter); }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }

/* ---------- type ---------- */
h1, h2, .display { font-family: var(--serif); font-weight: 560; letter-spacing: -0.018em; line-height: 1.07; text-wrap: balance; }
h1 { font-size: clamp(2.5rem, 1.3rem + 4.6vw, 4.6rem); }
h2 { font-size: clamp(1.9rem, 1.25rem + 2.3vw, 3rem); }
h3 { font-size: 1.16rem; line-height: 1.3; font-weight: 640; letter-spacing: -0.008em; }
h4 { font-size: 0.98rem; font-weight: 640; }
.lede { font-size: clamp(1.1rem, 1rem + 0.5vw, 1.32rem); line-height: 1.55; color: var(--ink-2); max-width: 62ch; text-wrap: pretty; }
.eyebrow {
  font-family: var(--mono); font-size: 0.74rem; font-weight: 500; letter-spacing: 0.1em; text-transform: uppercase;
  color: var(--accent); display: flex; align-items: center; gap: 10px;
}
.eyebrow::before { content: ""; width: 22px; height: 1px; background: currentColor; }
.eyebrow .no { color: var(--ink-3); }
em.hl { font-style: italic; color: var(--accent); }
small, .small { font-size: 0.86rem; color: var(--ink-3); }
.muted { color: var(--ink-2); }

/* ---------- header ---------- */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: color-mix(in oklch, var(--paper) 86%, transparent);
  backdrop-filter: saturate(1.4) blur(14px); -webkit-backdrop-filter: saturate(1.4) blur(14px);
  border-bottom: 1px solid var(--rule);
}
.bar { display: flex; align-items: center; gap: 20px; height: 66px; }
.brand { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; flex: none; }
.brand .mark { border-radius: 7px; flex: none; }
.mark .mark-bg { fill: var(--accent); }
.mark .mark-fg { stroke: var(--on-accent); }
.mark .mark-dot { fill: var(--on-accent); }
.wordmark { font-family: var(--sans); font-weight: 720; letter-spacing: 0.085em; font-size: 1.02rem; }
.nav { display: flex; align-items: center; gap: 4px; margin-left: 8px; flex: 1; }
.nav a {
  text-decoration: none; font-size: 0.93rem; font-weight: 500; color: var(--ink-2);
  padding: 8px 9px; border-radius: 8px; white-space: nowrap;
}
.nav a:hover { color: var(--ink); background: var(--accent-wash); }
.nav a[aria-current="page"] { color: var(--ink); box-shadow: inset 0 -2px 0 var(--accent); border-radius: 8px 8px 0 0; }
.nav-ext::after { content: ""; display: inline-block; width: 0.5em; height: 0.5em; margin-left: 0.4em; border-top: 1.5px solid currentColor; border-right: 1.5px solid currentColor; transform: translateY(-0.18em); opacity: 0.6; }
.bar-end { display: flex; align-items: center; gap: 10px; margin-left: auto; }
.icon-btn {
  width: 38px; height: 38px; display: grid; place-items: center; cursor: pointer;
  background: transparent; border: 1px solid var(--rule); border-radius: 10px; color: var(--ink-2);
}
.icon-btn:hover { color: var(--ink); border-color: var(--rule-2); }
.icon-btn .i-moon { display: none; }
:root[data-theme="dark"] .icon-btn .i-sun { display: none; }
:root[data-theme="dark"] .icon-btn .i-moon { display: block; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .icon-btn .i-sun { display: none; }
  :root:not([data-theme="light"]) .icon-btn .i-moon { display: block; }
}
.menu { display: none; }

/* language: a menu of links in a <details>, so it works without scripts */
.lang-pick { position: relative; flex: none; }
.lang-pick svg { flex: none; }
.lang-pick summary {
  list-style: none; height: 38px; display: inline-flex; align-items: center; gap: 6px; padding: 0 10px; cursor: pointer;
  border: 1px solid var(--rule); border-radius: 10px; color: var(--ink-2); font-size: 0.78rem; font-weight: 600; letter-spacing: 0.06em;
}
.lang-pick summary::-webkit-details-marker { display: none; }
.lang-pick summary:hover, .lang-pick[open] summary { color: var(--ink); border-color: var(--rule-2); }
.lang-pick ul {
  position: absolute; right: 0; top: calc(100% + 8px); z-index: 60; min-width: 210px; padding: 6px;
  background: var(--card); border: 1px solid var(--rule); border-radius: 12px; box-shadow: var(--shadow-lg);
}
.lang-pick a { display: flex; justify-content: space-between; align-items: baseline; gap: 18px; padding: 9px 12px; border-radius: 8px; text-decoration: none; color: var(--ink-2); font-size: 0.95rem; }
.lang-pick a:hover { background: var(--accent-wash); color: var(--ink); }
.lang-pick a[aria-current] { color: var(--ink); font-weight: 600; box-shadow: inset 3px 0 0 var(--accent); }
.lang-pick a small { font-family: var(--mono); font-size: 0.68rem; letter-spacing: 0.06em; }

/* a translation older than its English page says so above the content */
.i18n-note { background: var(--amber-wash); border-bottom: 1px solid var(--rule); color: var(--ink-2); font-size: 0.9rem; }
.i18n-note p { padding: 11px 0; }
.i18n-note a { color: var(--ink); font-weight: 600; }

/* ---------- buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 0.55em;
  font-weight: 600; font-size: 0.98rem; line-height: 1; text-decoration: none; white-space: nowrap;
  padding: 0.92em 1.3em; border-radius: 11px; border: 1px solid transparent; cursor: pointer;
  transition: transform 0.15s ease, background 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease;
}
.btn:hover { transform: translateY(-1px); }
.btn:active { transform: none; }
.btn-primary { background: var(--accent); color: var(--on-accent); box-shadow: 0 1px 0 oklch(1 0 0 / 0.18) inset, 0 6px 18px var(--accent-line); }
.btn-primary:hover { background: var(--accent-2); }
.btn-ghost { border-color: var(--rule-2); color: var(--ink); background: var(--card); }
.btn-ghost:hover { border-color: var(--ink-3); }
.btn-sm { padding: 0.72em 1em; font-size: 0.88rem; border-radius: 9px; box-shadow: none; }
.btn .arrow { width: 1em; height: 1em; flex: none; }
.link-arrow { font-weight: 600; text-decoration: none; color: var(--accent); display: inline-flex; align-items: center; gap: 0.4em; }
.link-arrow::after { content: ""; width: 0.46em; height: 0.46em; border-top: 2px solid currentColor; border-right: 2px solid currentColor; transform: rotate(45deg); transition: transform 0.15s ease; }
.link-arrow:hover::after { transform: translateX(3px) rotate(45deg); }

/* ---------- evidence tiers ---------- */
.tier {
  display: inline-flex; align-items: center; gap: 0.45em; vertical-align: 0.08em;
  font-family: var(--mono); font-size: 0.66rem; font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase;
  padding: 0.32em 0.62em 0.3em; border-radius: 999px; white-space: nowrap; line-height: 1.1;
}
.tier::before { content: ""; width: 0.5em; height: 0.5em; border-radius: 50%; background: currentColor; }
.tier-measured { color: var(--green); background: var(--green-wash); }
.tier-designed { color: var(--amber); background: var(--amber-wash); }
.tier-proposed { color: var(--blue); background: var(--blue-wash); }
.tier-open     { color: var(--red); background: var(--red-wash); }

/* ---------- sections ---------- */
.section { padding: clamp(72px, 9vw, 128px) 0; }
.section.tight { padding: clamp(48px, 6vw, 80px) 0; }
.section.flush { padding-top: 0; }
.band { background: var(--paper-2); border-block: 1px solid var(--rule); }
.section-head { display: grid; gap: 20px; max-width: 800px; margin-bottom: clamp(36px, 5vw, 64px); }
.section-head.wide { max-width: 940px; }
.section-head .lede { max-width: 66ch; }
.split { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 6fr); gap: clamp(32px, 5vw, 80px); align-items: start; }
.split.even { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.split.flip { grid-template-columns: minmax(0, 6fr) minmax(0, 5fr); }
.stack { display: grid; gap: 18px; align-content: start; }
.stack-lg { display: grid; gap: 28px; align-content: start; }

/* ---------- hero ---------- */
.hero { position: relative; padding: clamp(56px, 7vw, 104px) 0 clamp(48px, 6vw, 80px); overflow: hidden; }
.hero::before {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background:
    radial-gradient(58% 52% at 84% 6%, var(--accent-wash), transparent 70%),
    linear-gradient(var(--rule) 1px, transparent 1px) 0 0 / 100% 56px,
    linear-gradient(90deg, var(--rule) 1px, transparent 1px) 0 0 / 56px 100%;
  -webkit-mask-image: radial-gradient(90% 80% at 70% 0%, #000 0%, transparent 78%);
          mask-image: radial-gradient(90% 80% at 70% 0%, #000 0%, transparent 78%);
  opacity: 0.75;
}
.hero-grid { position: relative; display: grid; grid-template-columns: minmax(0, 10fr) minmax(0, 11fr); gap: clamp(36px, 5vw, 72px); align-items: center; }
.hero-copy { display: grid; gap: 26px; }
.hero h1 { font-size: clamp(2.5rem, 1.3rem + 3.6vw, 3.8rem); }
.hero h1 em { font-style: italic; font-weight: 500; color: var(--accent); display: block; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 6px; }
.hero-status { display: flex; flex-wrap: wrap; gap: 8px 18px; font-size: 0.86rem; color: var(--ink-3); padding-top: 22px; border-top: 1px solid var(--rule); }
.hero-status span { display: inline-flex; align-items: center; gap: 8px; }
.hero-status .dot { width: 7px; height: 7px; border-radius: 50%; background: var(--green); box-shadow: 0 0 0 3px var(--green-wash); }
.hero-status .dot.rc { background: var(--amber); box-shadow: 0 0 0 3px var(--amber-wash); }
.page-hero { padding: clamp(56px, 7vw, 96px) 0 clamp(40px, 5vw, 64px); border-bottom: 1px solid var(--rule); position: relative; overflow: hidden; }
.page-hero::before { content: ""; position: absolute; inset: 0; pointer-events: none; background: radial-gradient(50% 90% at 88% 0%, var(--accent-wash), transparent 70%); }
.page-hero .wrap { position: relative; display: grid; gap: 22px; }
.page-hero h1 { font-size: clamp(2.3rem, 1.4rem + 3.4vw, 3.9rem); max-width: 18ch; }
.page-hero .lede { max-width: 68ch; }

/* ---------- code window ---------- */
.window { background: var(--code-bg); color: var(--code-ink); border-radius: var(--radius); box-shadow: var(--shadow-lg); border: 1px solid var(--code-rule); overflow: hidden; min-width: 0; }
.window-bar { display: flex; align-items: center; gap: 4px; background: var(--code-bar); border-bottom: 1px solid var(--code-rule); padding: 0 10px 0 14px; min-height: 44px; overflow-x: auto; scrollbar-width: none; }
.window-bar::-webkit-scrollbar { display: none; }
.window-dots { display: flex; gap: 6px; margin-right: 10px; flex: none; }
.window-dots i { width: 10px; height: 10px; border-radius: 50%; background: oklch(0.95 0.005 285 / 0.16); }
.tab {
  font-family: var(--mono); font-size: 0.76rem; color: var(--code-dim); background: none; border: 0; cursor: pointer;
  padding: 13px 12px 12px; border-bottom: 2px solid transparent; white-space: nowrap; flex: none;
}
.tab:hover { color: var(--code-ink); }
.tab[aria-selected="true"] { color: var(--code-ink); border-bottom-color: var(--code-key); }
.window-title { font-family: var(--mono); font-size: 0.76rem; color: var(--code-dim); padding: 13px 4px; white-space: nowrap; }
.window-note { margin-left: auto; font-family: var(--mono); font-size: 0.68rem; color: var(--code-dim); white-space: nowrap; padding-left: 16px; }
.window pre { padding: 18px 20px 20px; overflow-x: auto; font-size: 0.8rem; line-height: 1.62; tab-size: 2; scrollbar-width: thin; scrollbar-color: oklch(0.95 0.005 285 / 0.2) transparent; }
.window pre[hidden], .window .panel[hidden] { display: none; }
.window code { font-size: inherit; background: none; color: inherit; padding: 0; white-space: pre-wrap; overflow-wrap: anywhere; }
.k { color: var(--code-key); } .s { color: var(--code-str); } .n { color: var(--code-num); } .b { color: var(--code-kw); } .c { color: var(--code-dim); font-style: italic; }
.mk { background: oklch(0.78 0.13 300 / 0.16); border-radius: 4px; padding: 1px 0; box-shadow: 0 0 0 2px oklch(0.78 0.13 300 / 0.16); }
.window-foot { display: flex; flex-wrap: wrap; gap: 8px 20px; align-items: center; border-top: 1px solid var(--code-rule); padding: 12px 20px; font-family: var(--mono); font-size: 0.7rem; color: var(--code-dim); }
.window-foot b { color: var(--code-ink); font-weight: 500; }
.window-foot .ok { color: var(--code-str); }
.copy { margin-left: auto; font-family: var(--mono); font-size: 0.68rem; color: var(--code-dim); background: oklch(0.95 0.005 285 / 0.06); border: 1px solid var(--code-rule); border-radius: 7px; padding: 5px 9px; cursor: pointer; flex: none; }
.copy:hover { color: var(--code-ink); }
.cmd { position: relative; }
.cmd pre { padding-right: 84px; }
.cmd .copy { position: absolute; top: 12px; right: 12px; }
.cmd .p { color: var(--code-dim); user-select: none; }

/* ---------- stats ---------- */
.stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); border: 1px solid var(--rule); border-radius: var(--radius); background: var(--card); box-shadow: var(--shadow); }
.stat { padding: 26px 26px 24px; display: grid; gap: 8px; align-content: start; border-left: 1px solid var(--rule); }
.stat:first-child { border-left: 0; }
.stat-n { font-family: var(--serif); font-weight: 560; font-size: clamp(2rem, 1.4rem + 1.9vw, 2.9rem); line-height: 1; letter-spacing: -0.02em; font-variant-numeric: lining-nums tabular-nums; }
.stat-n small { font-size: 0.5em; color: var(--ink-3); font-weight: 500; letter-spacing: 0; margin-left: 0.15em; }
.stat p { font-size: 0.9rem; color: var(--ink-2); line-height: 1.45; }
.stat .tier { justify-self: start; margin-top: 4px; }
.stats-note { margin-top: 14px; font-size: 0.82rem; color: var(--ink-3); max-width: 96ch; }

/* ---------- cards ---------- */
.grid { display: grid; gap: 18px; }
.g2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.g3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.g4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.card { background: var(--card); border: 1px solid var(--rule); border-radius: var(--radius); padding: 26px; display: grid; gap: 12px; align-content: start; min-width: 0; }
.card p { color: var(--ink-2); font-size: 0.95rem; line-height: 1.55; }
.card .how { font-size: 0.86rem; color: var(--ink-3); padding-top: 12px; border-top: 1px dashed var(--rule-2); }
.card .how b { color: var(--ink-2); font-weight: 600; }
.card-top { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.card-no { font-family: var(--mono); font-size: 0.74rem; color: var(--ink-3); letter-spacing: 0.06em; }
.card.lift { transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease; }
.card.lift:hover { transform: translateY(-3px); box-shadow: var(--shadow); border-color: var(--rule-2); }
a.card { text-decoration: none; }
.card.feature { grid-column: span 2; background: linear-gradient(140deg, var(--accent-wash), transparent 60%), var(--card); border-color: var(--accent-line); }
.card.feature h3 { font-family: var(--serif); font-size: 1.6rem; font-weight: 560; letter-spacing: -0.012em; line-height: 1.18; }
.card.feature p { font-size: 1.02rem; }
.icon { width: 40px; height: 40px; border-radius: 11px; display: grid; place-items: center; background: var(--accent-wash); color: var(--accent); flex: none; }
.icon svg { width: 21px; height: 21px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }

/* findings: the measured problem */
.finding { display: grid; gap: 10px; padding: 28px 0; border-top: 1px solid var(--rule-2); }
.finding:last-child { border-bottom: 1px solid var(--rule-2); }
.finding-n { font-family: var(--serif); font-size: clamp(2.2rem, 1.6rem + 2vw, 3.2rem); font-weight: 560; line-height: 1; letter-spacing: -0.02em; font-variant-numeric: lining-nums; color: var(--accent); }
.finding h3 { font-size: 1.08rem; }
.finding p { color: var(--ink-2); font-size: 0.95rem; }
.findings { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); column-gap: clamp(32px, 5vw, 72px); }
.source { font-size: 0.82rem; color: var(--ink-3); margin-top: 22px; max-width: 88ch; }

/* layers table */
.layers { display: grid; border: 1px solid var(--rule); border-radius: var(--radius); overflow: hidden; background: var(--card); }
.layer { display: grid; grid-template-columns: 150px minmax(0, 1fr) minmax(0, 1fr); gap: 20px; padding: 20px 24px; border-top: 1px solid var(--rule); align-items: baseline; }
.layer:first-child { border-top: 0; }
.layer h3 { display: flex; align-items: center; gap: 10px; font-size: 1rem; }
.layer h3 i { width: 12px; height: 12px; border-radius: 3px; flex: none; }
.layer p { font-size: 0.92rem; color: var(--ink-2); }
.layer .contract { color: var(--ink-3); }
.layers.compact .layer { grid-template-columns: 132px minmax(0, 1fr); gap: 6px 20px; }
.layers.compact .contract { grid-column: 2; font-size: 0.86rem; }
.l-kernel i { background: var(--ink); }
.l-facet i { background: var(--accent); }
.l-anno i { border: 1.5px dashed var(--ink-3); }

/* ---------- object graph ---------- */
.graph { width: 100%; height: auto; }
.graph .node rect { fill: var(--card); stroke: var(--rule-2); stroke-width: 1.2; }
.graph .node text { font-family: var(--mono); font-size: 13px; font-weight: 500; fill: var(--ink); }
.graph .node .sub { font-family: var(--sans); font-size: 10.5px; font-weight: 400; fill: var(--ink-3); }
.graph .node.content rect { stroke: var(--ink-3); }
.graph .node.org rect { fill: var(--accent); stroke: var(--accent); }
.graph .node.org text { fill: var(--on-accent); }
.graph .node.org .sub { fill: var(--on-accent); opacity: 0.8; }
.graph .node.attest rect { fill: var(--ink); stroke: var(--ink); }
.graph .node.attest text { fill: var(--paper); }
.graph .node.attest .sub { fill: var(--paper); opacity: 0.72; }
.graph .node.proposed rect { stroke-dasharray: 5 4; stroke: var(--blue); fill: var(--blue-wash); }
.graph .edge { fill: none; stroke: var(--ink-3); stroke-width: 1.3; }
.graph .edge.accent { stroke: var(--accent); stroke-width: 1.6; }
.graph .edge.bind { stroke: var(--ink-3); stroke-dasharray: 2 5; stroke-linecap: round; }
.graph .edge.prop { stroke: var(--blue); stroke-dasharray: 5 4; }
.graph .head { fill: var(--ink-3); }
.graph .head.accent { fill: var(--accent); }
.graph .head.prop { fill: var(--blue); }
.graph .elabel { font-family: var(--sans); font-size: 10.5px; fill: var(--ink-3); }
.graph .elabel.accent { fill: var(--accent); font-weight: 600; }
.graph .zone { font-family: var(--mono); font-size: 10px; letter-spacing: 0.12em; fill: var(--ink-3); text-transform: uppercase; }
.graph-legend { display: flex; flex-wrap: wrap; gap: 8px 20px; font-size: 0.82rem; color: var(--ink-3); margin-top: 18px; }
.graph-legend span { display: inline-flex; align-items: center; gap: 8px; }
.graph-legend i { width: 14px; height: 10px; border-radius: 3px; border: 1.2px solid var(--ink-3); }
.graph-legend .lg-org i { background: var(--accent); border-color: var(--accent); }
.graph-legend .lg-att i { background: var(--ink); border-color: var(--ink); }
.graph-legend .lg-prop i { border: 1.2px dashed var(--blue); background: var(--blue-wash); }

/* ---------- type list (model page) ---------- */
.types { display: grid; gap: 0; border-top: 1px solid var(--rule-2); }
.type { display: grid; grid-template-columns: 220px minmax(0, 1fr) minmax(0, 0.8fr); gap: 28px; padding: 26px 0; border-bottom: 1px solid var(--rule-2); align-items: start; }
.type h3 { font-family: var(--mono); font-size: 1rem; font-weight: 600; letter-spacing: -0.01em; display: grid; gap: 8px; justify-items: start; }
.type h3 small { font-family: var(--sans); font-weight: 400; }
.type p { color: var(--ink-2); font-size: 0.96rem; }
.type .replaces { font-size: 0.88rem; color: var(--ink-3); }
.type .replaces b { display: block; font-family: var(--mono); font-size: 0.68rem; letter-spacing: 0.1em; text-transform: uppercase; font-weight: 500; color: var(--ink-3); margin-bottom: 6px; }
.group-label { font-family: var(--mono); font-size: 0.72rem; letter-spacing: 0.1em; text-transform: uppercase; color: var(--accent); padding: 34px 0 12px; }

/* lattice */
.lattice { display: grid; gap: 12px; padding: 24px; border: 1px solid var(--rule); border-radius: var(--radius); background: var(--card); }
.chain { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; font-family: var(--mono); font-size: 0.84rem; }
.chain span { padding: 6px 11px; border-radius: 8px; border: 1px solid var(--rule-2); background: var(--paper); }
.chain i { width: 18px; height: 1.5px; background: var(--ink-3); position: relative; flex: none; }
.chain i::after { content: ""; position: absolute; right: 0; top: -3px; width: 6px; height: 6px; border-top: 1.5px solid var(--ink-3); border-right: 1.5px solid var(--ink-3); transform: rotate(45deg); }
.chain-label { font-size: 0.8rem; color: var(--ink-3); }

/* ---------- digest demo ---------- */
.demo { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 0.82fr); gap: 0; border-radius: var(--radius); overflow: hidden; border: 1px solid var(--code-rule); box-shadow: var(--shadow-lg); background: var(--code-bg); color: var(--code-ink); }
.demo-edit { display: grid; grid-template-rows: auto 1fr; min-width: 0; border-right: 1px solid var(--code-rule); }
.demo textarea {
  width: 100%; min-height: 420px; resize: vertical; border: 0; outline: 0; background: transparent; color: var(--code-ink);
  font-family: var(--mono); font-size: 0.78rem; line-height: 1.62; padding: 18px 20px; tab-size: 2; white-space: pre-wrap; overflow-wrap: anywhere; overflow: auto;
}
.demo textarea:focus-visible { outline: 2px solid var(--code-key); outline-offset: -2px; border-radius: 0; }
.demo-side { display: grid; align-content: start; gap: 0; min-width: 0; }
.demo-actions { display: grid; gap: 8px; padding: 18px 20px; border-bottom: 1px solid var(--code-rule); }
.demo-actions p { font-family: var(--mono); font-size: 0.68rem; letter-spacing: 0.1em; text-transform: uppercase; color: var(--code-dim); margin-bottom: 2px; }
.demo-btn { text-align: left; font-family: var(--sans); font-size: 0.86rem; color: var(--code-ink); background: oklch(0.95 0.005 285 / 0.05); border: 1px solid var(--code-rule); border-radius: 9px; padding: 10px 12px; cursor: pointer; display: flex; justify-content: space-between; gap: 12px; align-items: center; }
.demo-btn:hover { background: oklch(0.95 0.005 285 / 0.1); }
.demo-btn small { font-family: var(--mono); font-size: 0.66rem; color: var(--code-dim); white-space: nowrap; }
.demo-btn.reset { justify-content: center; color: var(--code-dim); background: none; }
.digests { display: grid; gap: 14px; padding: 18px 20px; border-bottom: 1px solid var(--code-rule); }
.digest { display: grid; gap: 5px; min-width: 0; }
.digest-h { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; font-size: 0.8rem; }
.digest-h b { font-weight: 600; }
.digest-h span { font-family: var(--mono); font-size: 0.64rem; letter-spacing: 0.08em; text-transform: uppercase; padding: 2px 7px; border-radius: 999px; }
.digest-h .same { color: var(--code-str); background: oklch(0.82 0.11 150 / 0.12); }
.digest-h .diff { color: var(--code-num); background: oklch(0.82 0.12 75 / 0.14); }
.digest code { font-size: 0.68rem; color: var(--code-dim); overflow-wrap: anywhere; line-height: 1.5; background: none; padding: 0; white-space: normal; }
.digest small { font-size: 0.74rem; color: var(--code-dim); }
.verdict { padding: 18px 20px 20px; display: grid; gap: 6px; }
.verdict-k { font-family: var(--mono); font-size: 0.68rem; letter-spacing: 0.1em; text-transform: uppercase; color: var(--code-dim); }
.verdict-v { font-family: var(--serif); font-size: 1.7rem; font-weight: 560; line-height: 1.1; letter-spacing: -0.01em; }
.verdict[data-v="full"] .verdict-v { color: var(--code-str); }
.verdict[data-v="semantic"] .verdict-v { color: var(--code-kw); }
.verdict[data-v="tamper"] .verdict-v { color: oklch(0.76 0.16 25); }
.verdict[data-v="invalid"] .verdict-v { color: var(--code-num); }
.verdict p { font-size: 0.84rem; color: var(--code-dim); line-height: 1.5; }

/* ---------- check demo ---------- */
.cd-body { display: grid; gap: 0; align-content: start; }
.cd-body > * { padding: 16px 20px; border-top: 1px solid var(--code-rule); }
.cd-body > *:first-child { border-top: 0; }
.cd-k { display: block; font-family: var(--mono); font-size: 0.66rem; letter-spacing: 0.1em; text-transform: uppercase; color: var(--code-dim); margin-bottom: 6px; }
.cd-req p { font-size: 0.9rem; line-height: 1.5; color: var(--code-ink); }
.cd-req p + p { margin-top: 6px; }
.cd-req b { font-family: var(--mono); font-size: 0.74rem; font-weight: 500; color: var(--code-key); margin-right: 8px; }
.cd-req mark { background: oklch(0.78 0.13 300 / 0.2); color: var(--code-ink); font-family: var(--mono); font-size: 0.86em; padding: 1px 7px; border-radius: 5px; }
.cd-field { display: flex; align-items: center; justify-content: space-between; gap: 16px; border-left: 0; border-right: 0; border-bottom: 0; margin: 0; min-width: 0; }
.cd-field label, .cd-field legend { padding: 0; min-width: 0; }
.cd-field code { font-size: 0.84rem; color: var(--code-ink); background: none; padding: 0; }
.cd-field input[type=number] {
  width: 84px; flex: none; font-family: var(--mono); font-size: 1.05rem; text-align: center; color: var(--code-ink);
  background: oklch(0.95 0.005 285 / 0.06); border: 1px solid var(--code-rule); border-radius: 9px; padding: 8px 6px;
}
.cd-field input:focus-visible { outline: 2px solid var(--code-key); outline-offset: 1px; }
.cd-list { display: block; }
.cd-list legend { float: left; width: 100%; margin-bottom: 4px; }
.cd-list > div { clear: both; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px 14px; }
.cd-check { display: flex; align-items: center; gap: 8px; font-family: var(--mono); font-size: 0.74rem; color: var(--code-ink); cursor: pointer; min-width: 0; }
.cd-check span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cd-check input { accent-color: var(--code-key); width: 15px; height: 15px; flex: none; }
.cd-presets > div { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; margin-bottom: 8px; }
.cd-presets .demo-btn { width: 100%; flex-wrap: wrap; }
.check-demo.silent .cd-field, .check-demo.silent .cd-list { opacity: 0.45; }
.check-demo.silent .cd-field.cd-keep { opacity: 1; }
.cd-presets .demo-btn small { flex-basis: 100%; }
.cd-rows { display: grid; }
.cd-row { display: grid; gap: 6px; padding: 16px 20px; border-bottom: 1px solid var(--code-rule); min-width: 0; }
.cd-row-h { display: flex; justify-content: space-between; align-items: center; gap: 12px; font-size: 0.88rem; }
.cd-row-h b { font-weight: 600; }
.cd-row code { font-size: 0.72rem; color: var(--code-key); background: none; padding: 0; white-space: normal; overflow-wrap: anywhere; }
.cd-row small { font-size: 0.76rem; color: var(--code-dim); overflow-wrap: anywhere; }
.cd-pill { font-family: var(--mono); font-size: 0.64rem; letter-spacing: 0.08em; text-transform: uppercase; padding: 3px 9px; border-radius: 999px; white-space: nowrap; color: var(--code-dim); background: oklch(0.95 0.005 285 / 0.08); }
.cd-pill[data-o="satisfied"] { color: var(--code-str); background: oklch(0.82 0.11 150 / 0.12); }
.cd-pill[data-o="not-satisfied"] { color: oklch(0.78 0.15 25); background: oklch(0.7 0.17 25 / 0.16); }
.cd-pill[data-o="inconclusive"] { color: var(--code-num); background: oklch(0.82 0.12 75 / 0.14); }
.cd-foot { padding: 0 20px 18px; font-size: 0.74rem; color: var(--code-dim); line-height: 1.5; }
.cd-foot code { color: var(--code-ink); background: none; padding: 0; }

/* flow: collector, observation, criteria, verdict */
.flow { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 0; border: 1px solid var(--rule); border-radius: var(--radius); background: var(--card); overflow: hidden; }
.flow-step { padding: 22px 22px 24px; display: grid; gap: 8px; align-content: start; border-left: 1px solid var(--rule); position: relative; }
.flow-step:first-child { border-left: 0; }
.flow-step:not(:first-child)::before { content: ""; position: absolute; left: -7px; top: 30px; width: 12px; height: 12px; background: var(--card); border-top: 1px solid var(--rule-2); border-right: 1px solid var(--rule-2); transform: rotate(45deg); }
.flow-step .where { font-family: var(--mono); font-size: 0.66rem; letter-spacing: 0.1em; text-transform: uppercase; color: var(--ink-3); }
.flow-step.kernel .where { color: var(--accent); }
.flow-step h3 { font-size: 1.02rem; }
.flow-step p { font-size: 0.9rem; color: var(--ink-2); line-height: 1.5; }
.flow-step code { font-size: 0.78rem; }
.chain-list { display: grid; gap: 0; border: 1px solid var(--rule); border-radius: var(--radius); background: var(--card); overflow: hidden; }
.chain-link { display: grid; grid-template-columns: 180px minmax(0, 1fr); gap: 20px; padding: 16px 22px; border-top: 1px solid var(--rule); align-items: baseline; }
.chain-link:first-child { border-top: 0; }
.chain-link b { font-family: var(--mono); font-size: 0.86rem; font-weight: 600; }
.chain-link p { font-size: 0.92rem; color: var(--ink-2); }
.state-cols { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; }

/* ---------- screens ---------- */
.screens { display: grid; gap: 22px; }
.screen-tabs { display: flex; flex-wrap: wrap; gap: 8px; }
.screen-tab { font-size: 0.9rem; font-weight: 550; padding: 9px 15px; border-radius: 999px; border: 1px solid var(--rule-2); background: var(--card); color: var(--ink-2); cursor: pointer; }
.screen-tab:hover { color: var(--ink); border-color: var(--ink-3); }
.screen-tab[aria-selected="true"] { background: var(--ink); color: var(--paper); border-color: var(--ink); }
.screen { display: grid; gap: 16px; }
.screen[hidden] { display: none; }
.frame { border-radius: var(--radius); overflow: hidden; border: 1px solid var(--rule-2); box-shadow: var(--shadow-lg); background: var(--code-bg); }
.frame-bar { display: flex; align-items: center; gap: 12px; padding: 10px 14px; background: var(--code-bar); border-bottom: 1px solid var(--code-rule); }
.frame-url { flex: 1; min-width: 0; font-family: var(--mono); font-size: 0.7rem; color: var(--code-dim); background: oklch(0.95 0.005 285 / 0.06); border-radius: 7px; padding: 5px 12px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.frame img { width: 100%; height: auto; }
.screen figcaption { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 10px 24px; align-items: baseline; font-size: 0.92rem; color: var(--ink-2); }
.screen figcaption p { max-width: 72ch; }

/* ---------- gates / timeline ---------- */
.gates { display: grid; gap: 0; counter-reset: gate; }
.gate { display: grid; grid-template-columns: 130px 28px minmax(0, 1fr); gap: 0 20px; position: relative; }
.gate-when { font-family: var(--mono); font-size: 0.74rem; color: var(--ink-3); padding-top: 4px; text-align: right; }
.gate-rail { position: relative; display: grid; justify-items: center; }
.gate-rail::before { content: ""; position: absolute; top: 0; bottom: 0; width: 1px; background: var(--rule-2); }
.gate:first-child .gate-rail::before { top: 10px; }
.gate:last-child .gate-rail::before { bottom: calc(100% - 10px); }
.gate-rail i { position: relative; width: 13px; height: 13px; border-radius: 50%; margin-top: 5px; background: var(--green); box-shadow: 0 0 0 4px var(--paper); }
.band .gate-rail i { box-shadow: 0 0 0 4px var(--paper-2); }
.gate.rc .gate-rail i { background: var(--amber); }
.gate.prop .gate-rail i { background: var(--paper); border: 2px dashed var(--blue); }
.gate-body { padding-bottom: 34px; display: grid; gap: 8px; }
.gate-body h3 { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.gate-body p { color: var(--ink-2); font-size: 0.95rem; max-width: 74ch; }

/* ---------- tables ---------- */
.table-wrap { overflow-x: auto; border: 1px solid var(--rule); border-radius: var(--radius); background: var(--card); }
table { border-collapse: collapse; width: 100%; font-size: 0.92rem; }
th, td { text-align: left; vertical-align: top; padding: 14px 18px; border-top: 1px solid var(--rule); }
thead th { border-top: 0; font-family: var(--mono); font-size: 0.68rem; font-weight: 500; letter-spacing: 0.1em; text-transform: uppercase; color: var(--ink-3); background: var(--paper-2); white-space: nowrap; }
tbody th { font-weight: 600; }
td small, th small { display: block; font-weight: 400; margin-top: 3px; line-height: 1.4; }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; font-family: var(--mono); font-size: 0.86rem; white-space: nowrap; }
.corpus-id { display: block; font-family: var(--mono); font-size: 0.7rem; font-weight: 500; color: var(--accent); letter-spacing: 0.04em; margin-bottom: 3px; }
td a.open { font-weight: 600; color: var(--accent); white-space: nowrap; text-decoration: none; }
td a.open:hover { text-decoration: underline; }
td.yes { color: var(--green); font-weight: 600; }
td.no { color: var(--ink-3); }
td.part { color: var(--amber); font-weight: 600; }
table.compare tbody th { min-width: 22ch; }
table.compare tbody th small { color: var(--ink-3); }
table.compare td { white-space: nowrap; }
table.compare td small { white-space: normal; min-width: 11ch; }
/* the project's own column: right after the row names, framed in the accent */
table.compare .us { background: var(--accent-wash); box-shadow: inset 2px 0 0 var(--accent), inset -2px 0 0 var(--accent); }
table.compare thead th.us { background: var(--accent); color: var(--on-accent); font-weight: 700; letter-spacing: 0.12em; }
table.compare thead th.us small { color: inherit; font-family: var(--sans); font-size: 0.72rem; font-weight: 500; letter-spacing: 0.01em; text-transform: none; font-variant-caps: normal; }
table.compare tbody td.us { font-weight: 700; }
table.compare tbody tr:last-child td.us { box-shadow: inset 2px 0 0 var(--accent), inset -2px 0 0 var(--accent), inset 0 -2px 0 var(--accent); }
@media (forced-colors: active) { table.compare .us { border-inline: 2px solid CanvasText; } }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chips li { display: inline-flex; align-items: center; gap: 8px; padding: 6px 6px 6px 11px; border: 1px solid var(--rule-2); border-radius: 999px; background: var(--card); font-size: 0.8rem; }
.chips li code { background: none; padding: 0; color: var(--ink); font-size: 0.78rem; }
.chips li span { font-family: var(--mono); font-size: 0.72rem; background: var(--green-wash); color: var(--green); border-radius: 999px; padding: 2px 8px; font-weight: 600; }

/* ---------- lists ---------- */
.ticks { display: grid; gap: 12px; }
.ticks li { position: relative; padding-left: 30px; color: var(--ink-2); font-size: 0.97rem; }
.ticks li::before { content: ""; position: absolute; left: 2px; top: 0.42em; width: 14px; height: 8px; border-left: 2px solid var(--accent); border-bottom: 2px solid var(--accent); transform: rotate(-45deg) scale(0.86); transform-origin: left top; translate: 2px 6px; }
.ticks li b, .ticks li strong { color: var(--ink); }
.plain { display: grid; gap: 10px; }
.plain li { position: relative; padding-left: 20px; color: var(--ink-2); font-size: 0.95rem; }
.plain li::before { content: ""; position: absolute; left: 2px; top: 0.72em; width: 8px; height: 1.5px; background: var(--ink-3); }
.limits { display: grid; gap: 0; border-top: 1px solid var(--rule-2); }
.limit { display: grid; grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.5fr); gap: 28px; padding: 22px 0; border-bottom: 1px solid var(--rule-2); }
.limit h3 { font-size: 1rem; display: grid; gap: 10px; justify-items: start; }
.limit p { color: var(--ink-2); font-size: 0.95rem; }
.prose { display: grid; gap: 16px; max-width: 70ch; color: var(--ink-2); }
.prose h2 { color: var(--ink); font-size: clamp(1.5rem, 1.2rem + 1vw, 2rem); margin-top: 22px; }
.prose h3 { color: var(--ink); margin-top: 10px; }
.prose a { color: var(--accent); }
.prose ul { display: grid; gap: 8px; }
.prose ul li { position: relative; padding-left: 20px; }
.prose ul li::before { content: ""; position: absolute; left: 2px; top: 0.72em; width: 8px; height: 1.5px; background: var(--ink-3); }
.prose address { font-style: normal; }

/* steps */
.steps { display: grid; gap: 0; counter-reset: step; }
.step { display: grid; grid-template-columns: 56px minmax(0, 1fr); gap: 0 20px; padding: 30px 0; border-top: 1px solid var(--rule-2); counter-increment: step; }
.step:last-child { border-bottom: 1px solid var(--rule-2); }
.step::before { content: counter(step, decimal-leading-zero); font-family: var(--mono); font-size: 0.8rem; color: var(--accent); padding-top: 5px; }
.step-body { display: grid; gap: 14px; min-width: 0; }
.step-body > p { color: var(--ink-2); max-width: 72ch; }
.step-cols { display: grid; grid-template-columns: minmax(0, 0.85fr) minmax(0, 1.15fr); gap: 32px; align-items: start; }

/* role cards */
.role { position: relative; padding-top: 30px; }
.role::before { content: ""; position: absolute; left: 26px; right: 26px; top: 0; height: 3px; border-radius: 0 0 3px 3px; background: var(--accent); }
.role .who { font-family: var(--mono); font-size: 0.7rem; letter-spacing: 0.1em; text-transform: uppercase; color: var(--accent); }
.role .move { font-size: 0.9rem; padding-top: 12px; border-top: 1px dashed var(--rule-2); color: var(--ink-2); }
.role .move b { display: block; font-family: var(--mono); font-size: 0.66rem; letter-spacing: 0.1em; text-transform: uppercase; font-weight: 500; color: var(--ink-3); margin-bottom: 5px; }

/* quote / rule */
.rules3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0; border-top: 1px solid var(--rule-2); border-bottom: 1px solid var(--rule-2); }
.rule3 { padding: 30px 28px 32px; border-left: 1px solid var(--rule-2); display: grid; gap: 12px; align-content: start; }
.rule3:first-child { border-left: 0; padding-left: 0; }
.rule3 .no { font-family: var(--mono); font-size: 0.74rem; color: var(--accent); }
.rule3 h3 { font-family: var(--serif); font-size: 1.4rem; font-weight: 560; letter-spacing: -0.01em; line-height: 1.2; }
.rule3 p { font-size: 0.94rem; color: var(--ink-2); }

/* CTA band */
.cta { background: var(--ink); color: var(--paper); border-radius: calc(var(--radius) + 8px); padding: clamp(36px, 5vw, 68px); display: grid; grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr); gap: clamp(28px, 4vw, 64px); align-items: center; position: relative; overflow: hidden; }
.cta::before { content: ""; position: absolute; inset: 0; background: radial-gradient(60% 120% at 100% 0%, oklch(0.6 0.22 298 / 0.5), transparent 65%); pointer-events: none; }
.cta > * { position: relative; }
.cta h2 { font-size: clamp(1.8rem, 1.3rem + 2vw, 2.7rem); }
.cta p { color: color-mix(in oklch, var(--paper) 78%, transparent); margin-top: 16px; max-width: 54ch; }
.cta-actions { display: grid; gap: 12px; }
.cta .btn-primary { background: var(--paper); color: var(--ink); box-shadow: none; }
.cta .btn-primary:hover { background: color-mix(in oklch, var(--paper) 88%, var(--accent)); }
.cta .btn-ghost { background: transparent; color: var(--paper); border-color: color-mix(in oklch, var(--paper) 34%, transparent); }
.cta .btn-ghost:hover { border-color: var(--paper); }
.cta .btn { justify-content: space-between; padding: 1.05em 1.3em; }

/* ---------- footer ---------- */
.site-footer { border-top: 1px solid var(--rule); background: var(--paper-2); padding: 64px 0 36px; font-size: 0.9rem; }
.foot-grid { display: grid; grid-template-columns: minmax(0, 1.7fr) repeat(3, minmax(0, 1fr)); gap: 40px; }
.foot-brand { display: grid; gap: 14px; align-content: start; max-width: 40ch; color: var(--ink-2); }
.foot-licence { font-size: 0.82rem; color: var(--ink-3); }
.site-footer nav { display: grid; gap: 10px; align-content: start; }
.site-footer nav h2 { font-family: var(--mono); font-size: 0.68rem; font-weight: 500; letter-spacing: 0.1em; text-transform: uppercase; color: var(--ink-3); margin-bottom: 6px; }
.site-footer nav a { text-decoration: none; color: var(--ink-2); }
.site-footer nav a:hover { color: var(--ink); text-decoration: underline; }
.foot-base { margin-top: 48px; padding-top: 24px; border-top: 1px solid var(--rule-2); display: grid; gap: 10px; font-size: 0.8rem; color: var(--ink-3); max-width: 110ch; }
.foot-base code { background: none; padding: 0; color: var(--ink-2); }
.site-footer .foot-langs { display: flex; flex-wrap: wrap; gap: 6px 20px; font-size: 0.9rem; }
.site-footer .foot-langs a[aria-current] { color: var(--ink); font-weight: 600; text-decoration: none; }

/* ---------- motion ---------- */
.js .reveal { opacity: 0; transform: translateY(14px); transition: opacity 0.6s ease, transform 0.6s cubic-bezier(0.2, 0.7, 0.2, 1); }
.js .reveal.in { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .js .reveal { opacity: 1; transform: none; transition: none; }
  .btn, .card.lift, .link-arrow::after { transition: none; }
}

/* ---------- small screens ---------- */
@media (max-width: 1040px) {
  .hero-grid, .split, .split.even, .split.flip, .cta { grid-template-columns: minmax(0, 1fr); }
  .g4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .g3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .stat:nth-child(3) { border-left: 0; }
  .stat:nth-child(n+3) { border-top: 1px solid var(--rule); }
  .type { grid-template-columns: 180px minmax(0, 1fr); }
  .type .replaces { grid-column: 2; }
  .demo { grid-template-columns: minmax(0, 1fr); }
  .demo-edit { border-right: 0; border-bottom: 1px solid var(--code-rule); }
  .demo textarea { min-height: 300px; }
  .flow { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .flow-step:nth-child(3) { border-left: 0; }
  .flow-step:nth-child(n+3) { border-top: 1px solid var(--rule); }
  .flow-step:nth-child(3)::before { display: none; }
  .foot-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .foot-brand { grid-column: 1 / -1; }
  .step-cols { grid-template-columns: minmax(0, 1fr); gap: 16px; }
}
/* the navigation folds into the menu button below 860px, and also on a wider
   screen when its words do not fit in one line (site.js sets .compact on the
   header; the words differ in length from language to language) */
.site-header.compact .menu { display: grid; }
.site-header.compact .bar { gap: 12px; }
.site-header.compact .nav {
  position: absolute; left: 0; right: 0; top: 100%; margin: 0; flex-direction: column; align-items: stretch; gap: 2px;
  background: var(--paper); border-bottom: 1px solid var(--rule); padding: 10px var(--gutter) 18px; display: none; box-shadow: var(--shadow);
}
.site-header.compact .nav.open { display: flex; }
.site-header.compact .nav a { padding: 13px 12px; font-size: 1rem; }
.site-header.compact .nav a[aria-current="page"] { box-shadow: inset 3px 0 0 var(--accent); border-radius: 0 8px 8px 0; }
@media (max-width: 860px) {
  .menu { display: grid; }
  .bar { gap: 12px; }
  .nav {
    position: absolute; left: 0; right: 0; top: 100%; margin: 0; flex-direction: column; align-items: stretch; gap: 2px;
    background: var(--paper); border-bottom: 1px solid var(--rule); padding: 10px var(--gutter) 18px; display: none; box-shadow: var(--shadow);
  }
  .nav.open { display: flex; }
  .nav a { padding: 13px 12px; font-size: 1rem; }
  .nav a[aria-current="page"] { box-shadow: inset 3px 0 0 var(--accent); border-radius: 0 8px 8px 0; }
  .findings, .rules3 { grid-template-columns: minmax(0, 1fr); }
  .rule3 { border-left: 0; padding-left: 0; padding-right: 0; border-top: 1px solid var(--rule-2); }
  .rule3:first-child { border-top: 0; }
  .layer, .layers.compact .layer { grid-template-columns: minmax(0, 1fr); gap: 6px; }
  .layers.compact .contract { grid-column: 1; }
  .limit { grid-template-columns: minmax(0, 1fr); gap: 10px; }
  .gate { grid-template-columns: 28px minmax(0, 1fr); }
  .gate-when { grid-column: 2; grid-row: 1; text-align: left; padding: 2px 0 4px; }
  .gate-rail { grid-column: 1; grid-row: 1 / span 2; }
  .gate-body { grid-column: 2; }
}
@media (max-width: 640px) {
  body { font-size: 16px; }
  .lang-pick { position: static; }
  .lang-pick ul { left: var(--gutter); right: var(--gutter); top: 100%; min-width: 0; }
  .g2, .g3, .g4 { grid-template-columns: minmax(0, 1fr); }
  .card.feature { grid-column: auto; }
  .stats { grid-template-columns: minmax(0, 1fr); }
  .stat { border-left: 0; border-top: 1px solid var(--rule); }
  .stat:first-child { border-top: 0; }
  .type { grid-template-columns: minmax(0, 1fr); gap: 12px; }
  .type .replaces { grid-column: 1; }
  .flow, .state-cols { grid-template-columns: minmax(0, 1fr); }
  .flow-step { border-left: 0; border-top: 1px solid var(--rule); }
  .flow-step:first-child { border-top: 0; }
  .flow-step::before { display: none; }
  .chain-link { grid-template-columns: minmax(0, 1fr); gap: 4px; }
  .cd-list > div, .cd-presets > div { grid-template-columns: minmax(0, 1fr); }
  .foot-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .step { grid-template-columns: minmax(0, 1fr); }
  .step::before { padding-bottom: 8px; }
  .btn-sm.btn-primary { display: none; }
  .tier { white-space: normal; border-radius: 12px; }
  .hero-actions .btn { flex: 1 1 100%; }
  .window pre { font-size: 0.72rem; padding: 14px 14px 16px; }
  .window-note { display: none; }
  .card { padding: 22px; }
  th, td { padding: 12px 14px; }
}
/* the header holds the language menu too: tighter on a phone */
@media (max-width: 480px) {
  .bar, .site-header.compact .bar { gap: 8px; }
  .bar-end { gap: 6px; }
  .lang-pick summary { padding: 0 10px; }
  .lang-pick summary span { display: none; }
}
@media (max-width: 420px) {
  .bar-end { gap: 4px; }
  .bar-end .icon-btn { width: 34px; }
  .bar-end .lang-pick summary { padding: 0 8px; }
  .bar-end .style-pick select { padding: 0 20px 0 7px; }
  .bar-end .style-pick::after { right: 8px; }
}
@media (max-width: 380px) {
  .site-header .wrap { padding: 0 14px; }
  .site-header .wordmark { letter-spacing: 0.04em; }
}

@media print {
  .site-header, .site-footer nav, .hero-actions, .cta-actions, .screen-tabs, .copy { display: none !important; }
  body { font-size: 11pt; background: #fff; color: #000; }
  .section { padding: 24pt 0; }
  .js .reveal { opacity: 1 !important; transform: none !important; }
}
