/* AI + Finance Lab — Signal / Applied Intelligence
   Ink-navy ground, slate rules, signal cyan for data and interaction,
   copper for risk, caveats and synthetic labels, warm paper for reading. */

@font-face { font-family: "Source Serif 4"; src: url(../fonts/source-serif-4-latin.woff2) format("woff2"); font-weight: 300 800; font-style: normal; font-display: swap; unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "Source Serif 4"; src: url(../fonts/source-serif-4-latin-ext.woff2) format("woff2"); font-weight: 300 800; font-style: normal; font-display: swap; unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: "Source Serif 4"; src: url(../fonts/source-serif-4-italic-latin.woff2) format("woff2"); font-weight: 300 800; font-style: italic; font-display: swap; unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "Source Serif 4"; src: url(../fonts/source-serif-4-italic-latin-ext.woff2) format("woff2"); font-weight: 300 800; font-style: italic; font-display: swap; unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: "Schibsted Grotesk"; src: url(../fonts/schibsted-grotesk-latin.woff2) format("woff2"); font-weight: 400 900; font-display: swap; unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "Schibsted Grotesk"; src: url(../fonts/schibsted-grotesk-latin-ext.woff2) format("woff2"); font-weight: 400 900; font-display: swap; unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: "JetBrains Mono"; src: url(../fonts/jetbrains-mono-latin.woff2) format("woff2"); font-weight: 400 600; font-display: swap; }

:root {
  --ink-950: oklch(0.165 0.032 256);
  --ink-900: oklch(0.2 0.036 256);
  --ink-850: oklch(0.235 0.038 256);
  --ink-800: oklch(0.27 0.038 254);
  --rule: oklch(0.36 0.035 252);
  --rule-soft: oklch(0.3 0.035 254);
  --fg: oklch(0.955 0.008 240);
  --fg-2: oklch(0.82 0.018 245);
  --fg-3: oklch(0.72 0.022 248);
  --signal: oklch(0.83 0.115 208);
  --signal-strong: oklch(0.89 0.1 208);
  --signal-wash: oklch(0.83 0.115 208 / 0.14);
  --copper: oklch(0.78 0.105 58);
  --copper-wash: oklch(0.78 0.105 58 / 0.18);
  --danger: oklch(0.72 0.15 25);
  --paper: oklch(0.968 0.011 85);
  --paper-2: oklch(0.935 0.014 82);
  --paper-rule: oklch(0.84 0.018 80);
  --paper-ink: oklch(0.24 0.03 256);
  --paper-ink-2: oklch(0.4 0.03 256);
  --paper-signal: oklch(0.46 0.09 222);
  --paper-copper: oklch(0.5 0.11 50);

  --serif: "Source Serif 4", "Iowan Old Style", Georgia, serif;
  --sans: "Schibsted Grotesk", system-ui, -apple-system, "Segoe UI", sans-serif;
  --mono: "JetBrains Mono", ui-monospace, "SFMono-Regular", Menlo, monospace;

  --gutter: clamp(16px, 4vw, 48px);
  --wrap: 1320px;
  --measure: 62ch;
  --radius: 3px;
  --ease-out: cubic-bezier(0.23, 1, 0.32, 1);
  --header-h: 68px;

  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; scroll-padding-top: calc(var(--header-h) + 16px); }
body {
  margin: 0;
  background: var(--ink-950);
  color: var(--fg);
  font-family: var(--sans);
  font-size: 1rem;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-wrap: break-word;
}
::selection { background: var(--signal); color: var(--ink-950); }
img, svg { max-width: 100%; }
a { color: inherit; text-underline-offset: 0.2em; text-decoration-thickness: 1px; }
a:hover { text-decoration-color: var(--signal); }
:focus-visible { outline: 2px solid var(--signal); outline-offset: 3px; border-radius: 2px; }
main:focus { outline: none; }
h1, h2, h3 { line-height: 1.15; margin: 0; text-wrap: balance; }
h2 { font-family: var(--serif); font-weight: 500; font-size: clamp(1.6rem, 2.6vw, 2.25rem); letter-spacing: -0.012em; font-variation-settings: "opsz" 40; }
h3 { font-size: 1.08rem; font-weight: 650; }
p { margin: 0; }
ul, ol { margin: 0; padding: 0; }
button, input, select { font: inherit; color: inherit; }
.num, td.num, .stage-num, time { font-variant-numeric: tabular-nums; }
.visually-hidden { position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
[hidden] { display: none !important; }
* { scrollbar-color: var(--rule) transparent; scrollbar-width: thin; }

.icon { flex: none; vertical-align: -0.15em; }
.icon-ext { margin-left: 0.3em; opacity: 0.75; }
.icon-arrow { margin-left: 0.45em; transition: transform 200ms var(--ease-out); }
@media (hover: hover) and (pointer: fine) { a:hover > .icon-arrow { transform: translateX(3px); } .concept-row:hover .icon-arrow { transform: translateX(4px); } }

/* Skip link */
.skip-link { position: absolute; left: var(--gutter); top: -100px; z-index: 100; background: var(--signal); color: var(--ink-950); padding: 0.6rem 1rem; font-weight: 700; border-radius: var(--radius); text-decoration: none; }
.skip-link:focus { top: 12px; }

/* Header */
.site-header { position: sticky; top: 0; z-index: 50; background: oklch(0.165 0.032 256 / 0.94); border-bottom: 1px solid var(--rule-soft); }
@supports (backdrop-filter: blur(8px)) { .site-header { background: oklch(0.165 0.032 256 / 0.82); backdrop-filter: blur(10px) saturate(1.2); } }
.header-inner { max-width: var(--wrap); margin: 0 auto; padding: 0.5rem var(--gutter); min-height: var(--header-h); display: flex; flex-wrap: wrap; align-items: center; gap: 0.5rem 1.5rem; }
.wordmark { display: inline-flex; align-items: center; gap: 0.6rem; text-decoration: none; flex: none; }
.wordmark-name { font-weight: 800; letter-spacing: 0.07em; font-size: 0.95rem; white-space: nowrap; }
.wordmark-tag { font-size: 0.72rem; letter-spacing: 0.14em; text-transform: uppercase; color: var(--fg-3); border: 1px solid var(--rule); padding: 0.12rem 0.4rem; border-radius: 2px; white-space: nowrap; }
.primary-nav { margin-left: auto; }
.primary-nav ul { list-style: none; display: flex; gap: 0.15rem; }
.primary-nav a { display: block; padding: 0.5rem 0.65rem; font-size: 0.92rem; color: var(--fg-2); text-decoration: none; border-radius: var(--radius); white-space: nowrap; transition: color 150ms ease-out, background-color 150ms ease-out; }
.primary-nav a:hover { color: var(--fg); background: var(--ink-850); }
.primary-nav a[aria-current="page"] { color: var(--signal); box-shadow: inset 0 -2px 0 var(--signal); border-radius: 0; }
.header-tools { display: flex; align-items: center; gap: 0.5rem; flex: none; }

.lang-picker { position: relative; }
.lang-picker summary { list-style: none; display: inline-flex; align-items: center; gap: 0.4rem; min-height: 40px; padding: 0 0.7rem; border: 1px solid var(--rule); border-radius: var(--radius); font-size: 0.88rem; color: var(--fg-2); cursor: pointer; user-select: none; }
.lang-picker summary::-webkit-details-marker { display: none; }
.lang-picker summary:hover { color: var(--fg); border-color: var(--fg-3); }
.lang-picker[open] summary .icon:last-child { transform: rotate(180deg); }
.lang-list { position: absolute; right: 0; top: calc(100% + 6px); list-style: none; min-width: 11rem; background: var(--ink-900); border: 1px solid var(--rule); border-radius: var(--radius); padding: 0.3rem; box-shadow: 0 12px 32px oklch(0 0 0 / 0.4), 0 2px 6px oklch(0 0 0 / 0.25); transform-origin: top right; animation: pop-in 160ms var(--ease-out); }
@keyframes pop-in { from { opacity: 0; transform: scale(0.97) translateY(-4px); } }
.lang-option { display: flex; justify-content: space-between; align-items: center; padding: 0.55rem 0.7rem; border-radius: 2px; text-decoration: none; color: var(--fg-2); }
.lang-option:hover { background: var(--ink-850); color: var(--fg); }
.lang-option[aria-current="true"] { color: var(--signal); font-weight: 650; }
.lang-option[aria-current="true"]::after { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; margin-left: 1rem; }

.menu-button { display: none; align-items: center; gap: 0.45rem; min-height: 40px; padding: 0 0.75rem; background: transparent; border: 1px solid var(--rule); border-radius: var(--radius); cursor: pointer; font-size: 0.88rem; }
.mobile-menu { border-top: 1px solid var(--rule-soft); padding: 0.5rem var(--gutter) 1.5rem; max-height: calc(100dvh - var(--header-h)); overflow-y: auto; }
.mobile-nav { list-style: none; }
.mobile-nav a { display: block; padding: 0.85rem 0; border-bottom: 1px solid var(--rule-soft); text-decoration: none; font-size: 1.05rem; }
.mobile-nav a[aria-current="page"] { color: var(--signal); }
.mobile-lang { margin-top: 1.25rem; }
.mobile-lang-label { font-size: 0.78rem; letter-spacing: 0.12em; text-transform: uppercase; color: var(--fg-3); }
.mobile-lang ul { list-style: none; display: grid; grid-template-columns: 1fr 1fr; gap: 0.35rem; margin-top: 0.5rem; }
.mobile-lang .lang-option { border: 1px solid var(--rule-soft); min-height: 44px; }

@media (max-width: 67.5em) {
  .primary-nav { display: none; }
  .menu-button { display: inline-flex; }
  .header-tools { margin-left: auto; }
}
@media (max-width: 35em) {
  .header-tools .lang-picker { display: none; }
  .wordmark-tag { display: none; }
}

/* Layout primitives */
main { display: block; max-width: var(--wrap); margin: 0 auto; padding: 0 var(--gutter) clamp(3rem, 8vw, 6rem); }
.section { margin-top: clamp(3.5rem, 8vw, 6.5rem); }
.section-head { max-width: 62ch; margin-bottom: clamp(1.5rem, 3vw, 2.25rem); }
.section-head p { color: var(--fg-2); margin-top: 0.75rem; }
.section-head-row { max-width: none; display: flex; justify-content: space-between; align-items: baseline; gap: 1rem; flex-wrap: wrap; }
.page-head { padding: clamp(2.5rem, 7vw, 5rem) 0 clamp(1.5rem, 3vw, 2.25rem); max-width: 60rem; }
.page-head h1 { font-family: var(--serif); font-weight: 500; font-variation-settings: "opsz" 60; font-size: clamp(2.3rem, 5.4vw, 4.4rem); letter-spacing: -0.02em; line-height: 1.04; }
.page-intro { color: var(--fg-2); font-size: clamp(1.05rem, 1.4vw, 1.2rem); max-width: 60ch; margin-top: 1.1rem; }
.page-head + .section, .page-head + .dataset-line + .section { margin-top: clamp(1.5rem, 4vw, 3rem); }
.tag-row { display: flex; flex-wrap: wrap; gap: 0.5rem; margin-bottom: 1.1rem; }
.fallback-notice { margin-top: 1rem; padding: 0.75rem 1rem; border: 1px dashed var(--copper); color: var(--copper); border-radius: var(--radius); }

/* Paper reading surface */
.paper { background: var(--paper); color: var(--paper-ink); border-radius: var(--radius); padding: clamp(1.5rem, 4vw, 3.25rem); }
.paper ::selection { background: var(--paper-signal); color: var(--paper); }
.paper a { color: var(--paper-signal); }
.paper a:hover { text-decoration-color: currentColor; }
.paper :focus-visible { outline-color: var(--paper-signal); }
.paper .text-link { color: var(--paper-signal); }

/* Buttons */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 0.1rem; min-height: 44px; padding: 0 1.15rem; border-radius: var(--radius); border: 1px solid transparent; font-weight: 650; font-size: 0.95rem; text-decoration: none; cursor: pointer; text-align: center; line-height: 1.25; padding-block: 0.4rem; transition: background-color 160ms ease-out, border-color 160ms ease-out, color 160ms ease-out, transform 160ms var(--ease-out); }
.btn:active { transform: scale(0.97); }
.btn-primary { background: var(--signal); color: var(--ink-950); }
.btn-primary:hover { background: var(--signal-strong); }
.btn-ghost { border-color: var(--rule); background: transparent; }
.btn-ghost:hover { background: var(--ink-850); border-color: var(--fg-3); }
.btn-quiet { background: transparent; color: var(--fg-2); padding: 0 0.5rem; text-decoration: underline; text-underline-offset: 0.25em; text-decoration-color: var(--rule); font-weight: 550; }
.btn-quiet:hover { color: var(--fg); text-decoration-color: var(--signal); }
.btn:disabled { opacity: 0.45; cursor: not-allowed; transform: none; }
.paper .btn-primary { background: var(--paper-ink); color: var(--paper); }
.paper .btn-primary:hover { background: var(--paper-signal); }
.text-link { display: inline-flex; align-items: center; font-weight: 600; color: var(--signal); text-decoration: none; }
.text-link:hover { text-decoration: underline; }

/* Tags: the words carry the meaning, style reinforces it */
.tag { display: inline-flex; align-items: center; gap: 0.35rem; max-width: 100%; font-size: 0.75rem; font-weight: 650; letter-spacing: 0.08em; text-transform: uppercase; padding: 0.2rem 0.5rem; border-radius: 2px; border: 1px solid var(--rule); color: var(--fg-2); line-height: 1.4; }
.tag-synthetic, .tag-illustrative, .tag-educational, .tag-sample { color: var(--copper); border-color: oklch(0.78 0.105 58 / 0.55); }
.tag-illustrative, .tag-sample { border-style: dashed; }
.tag-synthetic::before, .tag-educational::before { content: ""; width: 5px; height: 5px; background: currentColor; transform: rotate(45deg); }
.tag-status-simulation, .tag-status-research { color: var(--signal); border-color: oklch(0.83 0.115 208 / 0.5); }
.tag-concept { color: var(--fg-2); }
.paper .tag { color: var(--paper-ink-2); border-color: var(--paper-rule); }
.paper .tag-sample, .paper .tag-synthetic, .paper .tag-illustrative { color: var(--paper-copper); border-color: oklch(0.5 0.11 50 / 0.5); }

/* ---------- Home hero ---------- */
.hero { display: grid; grid-template-columns: minmax(0, 1fr); grid-template-areas: "mast" "copy" "switch" "figure" "stack"; padding-top: clamp(2.75rem, 7vw, 5.5rem); }
.hero-masthead { grid-area: mast; display: none; }
.hero-copy { grid-area: copy; }
.hero-switch { grid-area: switch; }
.hero-figure { grid-area: figure; display: none; }
.hero-stack { grid-area: stack; }
.eyebrow { font-size: 0.74rem; letter-spacing: 0.16em; text-transform: uppercase; color: var(--fg-3); font-weight: 650; }
.hero h1 { font-family: var(--serif); font-weight: 500; font-variation-settings: "opsz" 60; font-size: clamp(2.5rem, 5.8vw, 5rem); letter-spacing: -0.022em; line-height: 1.01; margin-top: 0.9rem; max-width: 15ch; }
.hero-intro { color: var(--fg-2); font-size: clamp(1.05rem, 1.35vw, 1.18rem); max-width: 56ch; margin-top: 1.4rem; }
.hero-ctas { display: flex; flex-wrap: wrap; gap: 0.75rem; margin-top: 1.9rem; }
.advice-note { display: flex; gap: 0.55rem; align-items: baseline; font-size: 0.85rem; color: var(--fg-3); margin-top: 1.3rem; }
.dot { width: 7px; height: 7px; border-radius: 50%; background: var(--copper); flex: none; transform: translateY(-1px); }

.hero-switch { display: flex; flex-wrap: wrap; align-items: center; gap: 0.25rem; margin-top: clamp(2.5rem, 6vw, 4rem); padding: 0.25rem; border: 1px solid var(--rule-soft); border-radius: var(--radius); justify-self: start; }
.hero-switch-label { font-size: 0.74rem; letter-spacing: 0.12em; text-transform: uppercase; color: var(--fg-3); padding: 0 0.6rem; font-weight: 650; }
.hero-switch-btn { min-height: 36px; padding: 0 0.8rem; border: 0; border-radius: 2px; background: transparent; color: var(--fg-2); cursor: pointer; font-size: 0.88rem; transition: background-color 150ms ease-out, color 150ms ease-out; }
.hero-switch-btn:hover { color: var(--fg); background: var(--ink-850); }
@media (max-width: 35em) { .hero-switch { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); justify-self: stretch; } .hero-switch-label { grid-column: 1 / -1; padding: 0.35rem 0.5rem 0.15rem; } .hero-switch-btn { padding: 0 0.4rem; line-height: 1.2; } }
.hero-switch-btn[aria-pressed="true"] { background: var(--ink-800); color: var(--signal); box-shadow: inset 0 0 0 1px oklch(0.83 0.115 208 / 0.35); }

/* Hero chart */
.hero-chart { margin: 0; }
.hero-chart svg { display: block; width: 100%; height: clamp(220px, 30vw, 360px); overflow: visible; }
.hero-chart .axis { stroke: var(--rule); stroke-width: 1; vector-effect: non-scaling-stroke; }
.hero-chart .line { fill: none; stroke: var(--signal); stroke-width: 2; vector-effect: non-scaling-stroke; stroke-linejoin: round; }
.hero-chart .area { fill: var(--signal-wash); }
.hero-chart .dd-area { fill: var(--copper-wash); }
.hero-chart .dd-line { fill: none; stroke: var(--copper); stroke-width: 1.25; vector-effect: non-scaling-stroke; }
.hero-chart .band { fill: var(--signal); opacity: 0; transition: opacity 240ms var(--ease-out); }
.chart-labels { display: flex; justify-content: space-between; font-family: var(--mono); font-size: 0.72rem; color: var(--fg-3); margin-top: 0.5rem; }
.hero-chart figcaption, .chart-source { display: flex; flex-wrap: wrap; gap: 0.6rem; align-items: center; font-size: 0.82rem; color: var(--fg-3); margin-top: 0.75rem; }

/* Intelligence stack */
.stack { margin-top: clamp(1.5rem, 3vw, 2rem); }
.stack-head { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.4fr); gap: 1rem 3rem; align-items: end; margin-bottom: 1.4rem; }
.stack-title { font-size: clamp(1.4rem, 2.2vw, 1.85rem); }
.stack-sub { color: var(--fg-2); max-width: 60ch; }
.stack-tabs { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); border-top: 1px solid var(--rule); }
.stack-tabs [role="tab"] { display: flex; flex-direction: column; align-items: flex-start; gap: 0.3rem; text-align: left; padding: 1rem 1rem 1.1rem 0; margin-top: -1px; background: none; border: 0; border-top: 2px solid transparent; cursor: pointer; color: var(--fg-2); transition: color 160ms ease-out, border-color 220ms var(--ease-out); }
.stack-tabs [role="tab"]:hover { color: var(--fg); border-top-color: var(--rule); }
.stack-tabs [role="tab"][aria-selected="true"] { color: var(--signal); border-top-color: var(--signal); }
.stack-tabs [role="tab"]:focus-visible { outline-offset: -2px; }
.stage-num { font-family: var(--mono); font-size: 0.75rem; color: var(--fg-3); }
.stage-name { font-weight: 650; font-size: 1.04rem; line-height: 1.25; }
.stack-panels { border-top: 1px solid var(--rule); }
.stack-panel { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr); gap: 1.5rem clamp(2rem, 5vw, 4.5rem); padding: 1.75rem 0 0.5rem; }
@keyframes panel-in { from { opacity: 0; transform: translateY(6px); } }
.stack-panel h3 { font-family: var(--serif); font-weight: 500; font-size: clamp(1.45rem, 2.3vw, 1.9rem); font-variation-settings: "opsz" 36; }
.stack-panel h3 .stage-num { font-size: 0.85rem; vertical-align: 0.3em; margin-right: 0.3rem; }
.stack-panel p { color: var(--fg-2); margin-top: 0.8rem; max-width: 56ch; }
.stack-io { margin: 0; display: grid; gap: 0; align-content: start; }
.stack-io div { display: grid; grid-template-columns: 8.5rem minmax(0, 1fr); gap: 1rem; padding: 0.7rem 0; border-bottom: 1px solid var(--rule-soft); }
.stack-io dt { font-size: 0.78rem; letter-spacing: 0.08em; text-transform: uppercase; color: var(--fg-3); font-weight: 650; padding-top: 0.15rem; }
.stack-io dd { margin: 0; }
.stack-io div:last-child dd { color: var(--copper); }

/* Hero layout: Signal trace */
.hero[data-layout="instrument"] .hero-copy, .hero[data-layout="trace"] .hero-copy { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); gap: 1.5rem clamp(2rem, 5vw, 5rem); align-items: end; }
.hero[data-layout="instrument"] .hero-intro, .hero[data-layout="trace"] .hero-intro { margin-top: 0; }
.hero[data-layout="trace"] .hero-figure { display: block; margin-top: 1.75rem; }
.hero[data-layout="trace"] .stack { margin-top: 0; }
.hero[data-layout="trace"] .stack-head { display: none; }
.hero[data-layout="trace"] .stack-tabs { border-top-color: transparent; }
.hero[data-layout="trace"] .hero-figure .hero-chart figcaption { display: none; }
.hero[data-layout="trace"] .band[data-active] { opacity: 0.08; }

/* Hero layout: Front page */
.hero[data-layout="front"] { grid-template-columns: minmax(0, 1.55fr) minmax(0, 1fr); grid-template-areas: "mast mast" "switch switch" "copy stack" "figure stack"; column-gap: 0; padding-top: clamp(1.5rem, 4vw, 2.5rem); }
.hero[data-layout="front"] .hero-masthead { display: flex; justify-content: space-between; gap: 1rem; flex-wrap: wrap; padding-bottom: 0.7rem; border-bottom: 3px double var(--rule); font-size: 0.74rem; letter-spacing: 0.16em; text-transform: uppercase; color: var(--fg-3); font-weight: 650; }
.hero[data-layout="front"] .hero-switch { margin-top: 1rem; margin-bottom: 1.5rem; }
.hero[data-layout="front"] .eyebrow { display: none; }
.hero[data-layout="front"] .hero-copy, .hero[data-layout="front"] .hero-figure { padding-right: clamp(1.5rem, 3vw, 3rem); border-right: 1px solid var(--rule); }
.hero[data-layout="front"] .hero h1, .hero[data-layout="front"] h1 { margin-top: 0; font-size: clamp(2.3rem, 5vw, 4.6rem); }
.hero[data-layout="front"] .hero-figure { display: block; padding-top: 2rem; }
.hero[data-layout="front"] .hero-chart svg { height: clamp(180px, 20vw, 260px); }
.hero[data-layout="front"] .hero-stack { padding-left: clamp(1.5rem, 3vw, 3rem); }
.hero[data-layout="front"] .stack { margin-top: 0; }
.hero[data-layout="front"] .stack-head { display: block; }
.hero[data-layout="front"] .stack-title { font-size: 1.3rem; }
.hero[data-layout="front"] .stack-sub { margin-top: 0.6rem; font-size: 0.95rem; }
.hero[data-layout="front"] .stack-tabs { grid-template-columns: 1fr; }
.hero[data-layout="front"] .stack-tabs [role="tab"] { flex-direction: row; align-items: baseline; gap: 0.8rem; padding: 0.75rem 0; border-top: 1px solid var(--rule-soft); margin-top: 0; }
.hero[data-layout="front"] .stack-tabs [role="tab"][aria-selected="true"] { border-top-color: var(--signal); }
.hero[data-layout="front"] .stack-panel { grid-template-columns: 1fr; padding-top: 1.25rem; }
.hero[data-layout="front"] .stack-io div { grid-template-columns: 7rem minmax(0, 1fr); }

@media (max-width: 56.25em) {
  .stack-head, .stack-panel { grid-template-columns: minmax(0, 1fr); }
  .stack-tabs { grid-template-columns: minmax(0, 1fr); border-top: 0; }
  .stack-tabs [role="tab"] { flex-direction: row; align-items: baseline; gap: 0.8rem; padding: 0.8rem 0 0.8rem 0.9rem; margin: 0; border-top: 0; border-left: 2px solid var(--rule-soft); }
  .stack-tabs [role="tab"]:hover { border-top-color: transparent; border-left-color: var(--rule); }
  .stack-tabs [role="tab"][aria-selected="true"] { border-left-color: var(--signal); }
  .hero[data-layout="instrument"] .hero-copy, .hero[data-layout="trace"] .hero-copy { grid-template-columns: minmax(0, 1fr); }
  .hero[data-layout="instrument"] .hero-intro, .hero[data-layout="trace"] .hero-intro { margin-top: 1.2rem; }
  .hero[data-layout="front"] { grid-template-columns: minmax(0, 1fr); grid-template-areas: "mast" "switch" "copy" "figure" "stack"; }
  .hero[data-layout="front"] .hero-copy, .hero[data-layout="front"] .hero-figure { border-right: 0; padding-right: 0; }
  .hero[data-layout="front"] .hero-stack { padding-left: 0; margin-top: 2.5rem; }
  .hero[data-layout="front"] .stack-tabs [role="tab"] { border-left: 0; padding-left: 0; }
  .stack-io div { grid-template-columns: minmax(0, 1fr); gap: 0.2rem; }
}

/* Concept list (home) */
.concept-list { list-style: none; border-top: 1px solid var(--rule); }
.concept-row { position: relative; display: grid; grid-template-columns: 10rem minmax(0, 1fr) minmax(0, 1.2fr) 2rem; gap: 0.5rem 2rem; align-items: baseline; padding: 1.5rem 0; border-bottom: 1px solid var(--rule); transition: background-color 200ms ease-out; }
.concept-row:hover { background: linear-gradient(90deg, var(--signal-wash), transparent 70%); }
.concept-status { display: grid; gap: 0.9rem; justify-items: start; }
.concept-mark { display: block; overflow: visible; fill: none; stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; }
.concept-mark .m-line, .concept-mark .m-on-line { stroke: var(--signal); }
.concept-mark .m-risk, .concept-mark .m-risk-line { stroke: var(--copper); }
.concept-mark .m-rule { stroke: var(--rule); }
.concept-mark .m-on { fill: var(--signal-wash); stroke: var(--signal); }
.concept-mark .m-warn { fill: var(--copper-wash); stroke: var(--copper); }
.concept-mark .m-off, .concept-mark .m-node { fill: var(--ink-950); stroke: var(--fg-3); }
.concept-mark .m-gate { stroke: var(--copper); stroke-dasharray: 2 2; }
.concept-mark .m-token { fill: var(--signal); stroke: none; }
.concept-mark .m-node-risk { fill: var(--ink-950); stroke: var(--copper); stroke-dasharray: 2 2; }
.concept-title { font-family: var(--serif); font-weight: 500; font-size: clamp(1.25rem, 2vw, 1.6rem); font-variation-settings: "opsz" 30; }
.concept-title a { text-decoration: none; }
.concept-title a::after { content: ""; position: absolute; inset: 0; }
.concept-body { color: var(--fg-2); }
.concept-arrow { color: var(--signal); justify-self: end; }
.concept-row:focus-within { outline: 2px solid var(--signal); outline-offset: 2px; }
.concept-title a:focus-visible { outline: none; }
@media (max-width: 53.75em) { .concept-row { grid-template-columns: minmax(0, 1fr) 2rem; } .concept-status, .concept-title, .concept-body { grid-column: 1; } .concept-arrow { grid-column: 2; grid-row: 2; } }

/* Article list */
.article-list { list-style: none; border-top: 1px solid var(--rule); }
.article-row { padding: 1.5rem 0; border-bottom: 1px solid var(--rule); display: grid; gap: 0.55rem; }
.meta-line { display: flex; flex-wrap: wrap; align-items: center; gap: 0.6rem; font-size: 0.84rem; color: var(--fg-3); }
.meta-sep { width: 3px; height: 3px; border-radius: 50%; background: var(--rule); }
.article-row-title { font-family: var(--serif); font-weight: 500; font-size: clamp(1.3rem, 2.1vw, 1.65rem); font-variation-settings: "opsz" 30; max-width: 40ch; }
.article-row-title a { text-decoration: none; }
.article-row-title a:hover { text-decoration: underline; text-decoration-color: var(--signal); }
.article-row-excerpt { color: var(--fg-2); max-width: var(--measure); }
.article-row-topics { display: flex; flex-wrap: wrap; gap: 0.4rem 1rem; font-size: 0.82rem; color: var(--fg-3); }
.sample-mark { color: var(--copper); }
.paper .article-list, .paper .article-row { border-color: var(--paper-rule); }

/* Trust block */
.trust h2 { max-width: 24ch; }
.trust-list { list-style: none; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 2rem; margin: 2rem 0; counter-reset: trust; }
.trust-list li { border-top: 2px solid var(--paper-ink); padding-top: 1rem; }
.trust-list p { color: var(--paper-ink-2); margin-top: 0.5rem; }
@media (max-width: 53.75em) { .trust-list { grid-template-columns: minmax(0, 1fr); gap: 1.5rem; } }

/* Workbench (Operate pages) */
.dataset-line { display: flex; flex-wrap: wrap; gap: 0.6rem 0.9rem; align-items: baseline; font-size: 0.92rem; color: var(--fg-2); max-width: 70rem; padding-top: 1rem; border-top: 1px solid var(--rule-soft); }
.workbench { display: grid; grid-template-columns: minmax(280px, 340px) minmax(0, 1fr); gap: clamp(1.5rem, 3vw, 2.5rem); margin-top: 2rem; align-items: start; }
.panel { min-width: 0; overflow-wrap: anywhere; background: var(--ink-900); border: 1px solid var(--rule-soft); border-radius: var(--radius); padding: 1.4rem; }
.controls { position: sticky; top: calc(var(--header-h) + 1rem); display: grid; grid-template-columns: minmax(0, 1fr); gap: 1.1rem; }
.panel-title { font-family: var(--sans); font-size: 0.8rem; letter-spacing: 0.12em; text-transform: uppercase; color: var(--fg-3); font-weight: 700; }
.panel-sub { color: var(--fg-2); font-size: 0.92rem; }
fieldset { border: 0; padding: 0; margin: 0; min-width: 0; }
legend, .field label { font-size: 0.88rem; font-weight: 600; color: var(--fg); padding: 0; margin-bottom: 0.45rem; display: block; }
.field-row { display: flex; align-items: center; gap: 0.75rem; }
.field-number { display: inline-flex; align-items: center; border: 1px solid var(--rule); border-radius: var(--radius); background: var(--ink-950); flex: none; }
.field-number:focus-within { border-color: var(--signal); }
.field-number input { width: 4.6rem; min-height: 40px; padding: 0 0.5rem; background: transparent; border: 0; font-family: var(--mono); font-size: 0.9rem; font-variant-numeric: tabular-nums; text-align: right; }
.field-number input:focus { outline: none; }
.field-number .unit { min-width: 2.9rem; padding: 0 0.6rem 0 0.1rem; color: var(--fg-3); font-size: 0.8rem; font-family: var(--mono); }
.field[data-invalid] .field-number { border-color: var(--danger); }
.field-error { color: var(--danger); font-size: 0.84rem; margin-top: 0.35rem; }
.field-output { font-family: var(--mono); font-variant-numeric: tabular-nums; min-width: 3.6rem; text-align: right; color: var(--signal); }
input[type="range"] { flex: 1; min-width: 0; accent-color: var(--signal); height: 28px; background: transparent; }
.field-check { display: flex; align-items: center; gap: 0.6rem; }
.field-check label { margin: 0; font-weight: 500; }
input[type="checkbox"] { width: 18px; height: 18px; accent-color: var(--signal); flex: none; }
.form-actions { display: flex; flex-wrap: wrap; gap: 0.6rem; }
.safety-note { font-size: 0.82rem; color: var(--fg-3); border-top: 1px solid var(--rule-soft); padding-top: 0.9rem; }
.segmented { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(6.75rem, 100%), 1fr)); gap: 0.25rem; padding: 0.25rem; border: 1px solid var(--rule-soft); border-radius: var(--radius); background: var(--ink-950); }
.segmented-wrap { display: flex; flex-wrap: wrap; }
.segmented-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.segmented-2x2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.seg-btn { min-height: 36px; min-width: 0; padding: 0.3rem 0.75rem; line-height: 1.2; border: 0; border-radius: 2px; background: transparent; color: var(--fg-2); cursor: pointer; font-size: 0.88rem; transition: background-color 150ms ease-out, color 150ms ease-out; }
.seg-btn:hover { background: var(--ink-850); color: var(--fg); }
.seg-btn[aria-pressed="true"] { background: var(--ink-800); color: var(--signal); box-shadow: inset 0 0 0 1px oklch(0.83 0.115 208 / 0.35); }

.results { min-width: 0; display: grid; gap: 1.25rem; }
.state-msg { padding: 1rem 1.1rem; border: 1px dashed var(--copper); color: var(--copper); border-radius: var(--radius); }
.result-body { display: grid; gap: 1.5rem; min-width: 0; }
.metrics-scroll { max-width: 100%; overflow-x: auto; }
.metrics-table { width: 100%; border-collapse: collapse; font-variant-numeric: tabular-nums; }
.metrics-table th, .metrics-table td { padding: 0.65rem 0.5rem; border-bottom: 1px solid var(--rule-soft); text-align: right; }
.metrics-table thead th { font-size: 0.82rem; color: var(--fg-2); font-weight: 650; border-bottom-color: var(--rule); vertical-align: bottom; line-height: 1.3; }
.metrics-table td { white-space: nowrap; }
@media (max-width: 30em) { .metrics-table th, .metrics-table td { padding: 0.55rem 0.3rem; } .metrics-table td { font-size: 0.84rem; } .metrics-table tbody th { font-size: 0.9rem; } }
.metrics-table tbody th { text-align: left; font-weight: 500; color: var(--fg-2); padding-left: 0; }
.metrics-table td { font-family: var(--mono); font-size: 0.92rem; }
.metrics-table td[data-tone="neg"] { color: var(--copper); }
.key { display: inline-block; width: 14px; height: 3px; margin-right: 0.45rem; vertical-align: middle; border-radius: 2px; }
.key-strategy { background: var(--signal); }
.key-hold { background: repeating-linear-gradient(90deg, var(--fg-2) 0 4px, transparent 4px 7px); }

.chart { margin: 0; min-width: 0; }
.chart figcaption { display: flex; flex-wrap: wrap; align-items: baseline; gap: 0.25rem 0.8rem; margin-bottom: 0.6rem; }
.chart-title { font-weight: 650; }
.chart-desc { color: var(--fg-3); font-size: 0.86rem; }
.chart-canvas { position: relative; height: clamp(220px, 28vw, 320px); }
.chart-short .chart-canvas { height: clamp(120px, 14vw, 160px); }
.chart-canvas svg { display: block; width: 100%; height: 100%; overflow: visible; }
.chart-canvas .grid line { stroke: var(--rule-soft); stroke-width: 1; }
.chart-canvas .tick { fill: var(--fg-3); font: 500 11.5px var(--mono); }
.chart-canvas .s-strategy { fill: none; stroke: var(--signal); stroke-width: 2; stroke-linejoin: round; }
.chart-canvas .s-hold { fill: none; stroke: var(--fg-2); stroke-width: 1.5; stroke-dasharray: 4 3; }
.chart-canvas .s-dd { fill: var(--copper-wash); stroke: var(--copper); stroke-width: 1.25; }
.chart-canvas .s-shock { stroke: var(--copper); stroke-dasharray: 2 3; }
.chart-canvas .crosshair { stroke: var(--fg-3); stroke-width: 1; }
.chart-tip { position: absolute; top: 0; pointer-events: none; background: var(--ink-850); border: 1px solid var(--rule); border-radius: var(--radius); padding: 0.45rem 0.6rem; font-size: 0.8rem; font-variant-numeric: tabular-nums; white-space: nowrap; box-shadow: 0 8px 20px oklch(0 0 0 / 0.35); }
.table-toggle { display: grid; gap: 0.75rem; justify-items: start; }
.data-table-wrap, .table-scroll { max-width: 100%; overflow-x: auto; border: 1px solid var(--rule-soft); border-radius: var(--radius); }
.data-table-wrap { max-height: 360px; overflow-y: auto; width: 100%; }
.data-table { width: 100%; border-collapse: collapse; font-size: 0.88rem; font-variant-numeric: tabular-nums; }
.data-table caption { font-variant-numeric: normal; text-align: left; padding: 0.7rem 0.8rem; color: var(--fg-3); font-size: 0.82rem; }
.caption-note { display: block; margin-top: 0.35rem; color: var(--fg-2); max-width: 70ch; }
.data-table th, .data-table td { padding: 0.5rem 0.8rem; border-top: 1px solid var(--rule-soft); text-align: left; vertical-align: top; }
.data-table thead th { position: sticky; top: 0; background: var(--ink-900); font-weight: 650; color: var(--fg-2); white-space: nowrap; }
.data-table td.num, .data-table td[data-n] { text-align: right; font-family: var(--mono); }

.caveats { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 2rem; margin-top: clamp(2.5rem, 5vw, 3.5rem); padding-top: 1.75rem; border-top: 1px solid var(--rule); }
.caveats h3 { font-size: 0.8rem; letter-spacing: 0.12em; text-transform: uppercase; color: var(--copper); }
.caveats ul { list-style: none; margin-top: 0.75rem; display: grid; gap: 0.7rem; }
.caveats li { color: var(--fg-2); padding-left: 1.1rem; position: relative; max-width: 62ch; }
.caveats li::before { content: ""; position: absolute; left: 0; top: 0.68em; width: 6px; height: 1px; background: var(--copper); }

@media (max-width: 56.25em) {
  .workbench { grid-template-columns: minmax(0, 1fr); }
  .controls { position: static; }
  .caveats { grid-template-columns: minmax(0, 1fr); }
}

/* Applied AI pipeline */
.case-options { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0.75rem; }
.case-option { position: relative; display: grid; gap: 0.3rem; padding: 1rem 1rem 1rem 2.6rem; border: 1px solid var(--rule-soft); border-radius: var(--radius); cursor: pointer; transition: border-color 150ms ease-out, background-color 150ms ease-out; }
.case-option:hover { border-color: var(--rule); background: var(--ink-900); }
.case-option input { position: absolute; left: 1rem; top: 1.15rem; accent-color: var(--signal); width: 16px; height: 16px; margin: 0; }
.case-option:has(input:checked) { border-color: var(--signal); background: var(--ink-900); }
.case-option:has(input:focus-visible) { outline: 2px solid var(--signal); outline-offset: 2px; }
.case-name { font-weight: 650; }
.case-summary { color: var(--fg-3); font-size: 0.88rem; }
.pipeline-board { margin-top: 2rem; }
.pipeline-svg { display: block; width: 100%; height: auto; }
.pipe-link { stroke: var(--rule); stroke-width: 2; }
.pipe-dot { fill: var(--ink-950); stroke: var(--rule); stroke-width: 2; transition: stroke 240ms ease-out, fill 240ms ease-out; }
.pipe-mark { fill: none; stroke-width: 2.5; stroke-linecap: round; stroke-linejoin: round; opacity: 0; }
.pipe-gate { fill: none; stroke: var(--copper); stroke-dasharray: 3 4; stroke-width: 1.25; }
.pipe-node[data-state="passed"] .pipe-dot { stroke: var(--signal); fill: var(--signal-wash); }
.pipe-node[data-state="passed"] .pipe-mark-passed { opacity: 1; stroke: var(--signal); }
.pipe-node[data-state="warning"] .pipe-dot { stroke: var(--copper); fill: var(--copper-wash); }
.pipe-node[data-state="warning"] .pipe-mark-warning { opacity: 1; stroke: var(--copper); }
.pipe-node[data-state="blocked"] .pipe-dot, .pipe-node[data-state="rejected"] .pipe-dot { stroke: var(--danger); fill: oklch(0.72 0.15 25 / 0.15); }
.pipe-node[data-state="blocked"] .pipe-mark-blocked, .pipe-node[data-state="rejected"] .pipe-mark-blocked { opacity: 1; stroke: var(--danger); }
.pipe-node[data-state="waiting"] .pipe-dot, .pipe-node[data-state="returned"] .pipe-dot { stroke: var(--fg); }
.pipe-node[data-state="waiting"] .pipe-mark-waiting, .pipe-node[data-state="returned"] .pipe-mark-waiting { opacity: 1; stroke: var(--fg); }
.pipe-node[data-state="approved"] .pipe-dot { stroke: var(--signal); fill: var(--signal); }
.pipe-node[data-state="approved"] .pipe-mark-passed { opacity: 1; stroke: var(--ink-950); }
.pipe-node[data-current] .pipe-dot { stroke: var(--fg); stroke-width: 3; stroke-dasharray: 4 3; }
.pipe-stages { list-style: none; display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 1rem; margin-top: 0.25rem; }
.pipe-stage { display: grid; gap: 0.25rem; align-content: start; text-align: center; justify-items: center; }
.pipe-stage-name { font-weight: 650; line-height: 1.25; }
.pipe-stage-state { font-size: 0.78rem; font-weight: 650; letter-spacing: 0.04em; color: var(--fg-3); }
.pipe-stage[data-state="passed"] .pipe-stage-state, .pipe-stage[data-state="approved"] .pipe-stage-state { color: var(--signal); }
.pipe-stage[data-state="warning"] .pipe-stage-state { color: var(--copper); }
.pipe-stage[data-state="blocked"] .pipe-stage-state, .pipe-stage[data-state="rejected"] .pipe-stage-state { color: var(--danger); }
.pipe-stage[data-state="waiting"] .pipe-stage-state, .pipe-stage[data-state="returned"] .pipe-stage-state { color: var(--fg); }
.pipe-stage-desc { font-size: 0.84rem; color: var(--fg-3); }
.pipeline-console { display: grid; gap: 1.1rem; margin-top: 2rem; padding: 1.4rem; background: var(--ink-900); border: 1px solid var(--rule-soft); border-radius: var(--radius); }
.console-controls, .approval { display: flex; flex-wrap: wrap; gap: 0.6rem; }
.approval { padding: 1rem; border: 1px dashed var(--copper); border-radius: var(--radius); }
.confidence { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 1rem; align-items: center; }
.confidence-label { font-weight: 600; }
.confidence-track { position: relative; height: 8px; background: var(--ink-950); border: 1px solid var(--rule-soft); border-radius: 4px; overflow: hidden; }
.confidence-fill { position: absolute; inset: 0; background: var(--signal); transform-origin: left center; transform: scaleX(0); transition: transform 280ms var(--ease-out), background-color 200ms ease-out; }
.confidence[data-low] .confidence-fill { background: var(--danger); }
.confidence[data-mid] .confidence-fill { background: var(--copper); }
.confidence-floor { position: absolute; left: 40%; top: -2px; bottom: -2px; width: 2px; background: var(--fg); }
.confidence-value { font-family: var(--mono); font-variant-numeric: tabular-nums; font-size: 0.9rem; min-width: 6ch; text-align: right; }
.log-title { font-size: 0.8rem; letter-spacing: 0.12em; text-transform: uppercase; color: var(--fg-3); }
.run-log { list-style: none; display: grid; gap: 0; border-top: 1px solid var(--rule-soft); }
.run-log li { display: grid; grid-template-columns: 9.5rem minmax(0, 1fr); gap: 1rem; padding: 0.65rem 0; border-bottom: 1px solid var(--rule-soft); font-size: 0.92rem; animation: panel-in 180ms var(--ease-out); }
.run-log .log-empty { display: block; color: var(--fg-3); }
.log-stage { font-weight: 650; }
.log-stage small { display: block; font-weight: 600; font-size: 0.76rem; color: var(--fg-3); letter-spacing: 0.04em; }
.log-stage[data-state="warning"] small { color: var(--copper); }
.log-stage[data-state="blocked"] small, .log-stage[data-state="rejected"] small { color: var(--danger); }
.log-stage[data-state="passed"] small, .log-stage[data-state="approved"] small { color: var(--signal); }
@media (max-width: 53.75em) {
  .case-options { grid-template-columns: minmax(0, 1fr); }
  .pipeline-svg { display: none; }
  .pipe-stages { grid-template-columns: minmax(0, 1fr); gap: 0; border-top: 1px solid var(--rule-soft); }
  .pipe-stage { grid-template-columns: 2.2rem minmax(0, 1fr) auto; text-align: left; justify-items: start; padding: 0.8rem 0; border-bottom: 1px solid var(--rule-soft); }
  .pipe-stage-desc { grid-column: 2 / -1; }
  .run-log li { grid-template-columns: minmax(0, 1fr); gap: 0.2rem; }
}

.perm-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 2rem; margin-top: 1.5rem; }
.perm-may, .perm-maynot { font-size: 0.82rem; letter-spacing: 0.12em; text-transform: uppercase; padding-bottom: 0.6rem; border-bottom: 2px solid var(--paper-ink); }
.perm-maynot { border-bottom-style: dashed; border-color: var(--paper-copper); color: var(--paper-copper); }
.perm-list { list-style: none; display: grid; }
.perm-list li { padding: 0.75rem 0 0.75rem 1.7rem; border-bottom: 1px solid var(--paper-rule); position: relative; }
.perm-list li::before { position: absolute; left: 0; top: 0.75rem; width: 1.1rem; text-align: center; font-weight: 800; }
.perm-list-may li::before { content: "+"; color: var(--paper-signal); }
.perm-list-maynot li::before { content: "–"; color: var(--paper-copper); }
@media (max-width: 47.5em) { .perm-grid { grid-template-columns: minmax(0, 1fr); } }

.def-list { margin: 1.5rem 0 0; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 2rem; }
.def-list-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.def-list div { border-top: 1px solid var(--rule); padding-top: 1rem; }
.paper .def-list div { border-color: var(--paper-ink); }
.def-list dt { font-weight: 650; font-size: 1.05rem; }
.def-list dd { margin: 0.5rem 0 0; color: var(--fg-2); }
.paper .def-list dd { color: var(--paper-ink-2); }
@media (max-width: 53.75em) { .def-list, .def-list-2 { grid-template-columns: minmax(0, 1fr); gap: 1.25rem; } }
.disclaimer { margin-top: 2rem; font-size: 0.9rem; color: var(--paper-ink-2); border-top: 1px solid var(--paper-rule); padding-top: 1rem; }

/* Lifecycle */
.life-track { position: relative; padding-top: 0.5rem; }
.life-rail { position: absolute; left: 0; right: 0; top: 1.15rem; width: 100%; height: 40px; }
.life-rail line { stroke: var(--rule); stroke-width: 2; vector-effect: non-scaling-stroke; }
.life-rail .life-progress { stroke: var(--signal); transform-box: fill-box; transform-origin: left center; transform: scaleX(0); transition: transform 240ms var(--ease-out); }
.life-token { position: absolute; top: 1.15rem; left: 10%; width: 20px; height: 20px; margin: 10px 0 0 -10px; background: var(--signal); rotate: 45deg; scale: 0.85; border-radius: 2px; box-shadow: 0 0 0 6px var(--ink-950); transition: transform 240ms var(--ease-out); z-index: 1; }
.life-steps { position: relative; display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); }
.life-step { display: grid; justify-items: center; gap: 0.35rem; padding: 0 0.4rem 1rem; background: none; border: 0; cursor: pointer; text-align: center; color: var(--fg-2); }
.life-node { width: 16px; height: 16px; margin: 12px 0 0.6rem; border-radius: 50%; background: var(--ink-950); border: 2px solid var(--rule); transition: border-color 200ms ease-out, background-color 200ms ease-out; position: relative; z-index: 2; }
.life-step:hover .life-node { border-color: var(--fg-3); }
.life-step[aria-selected="true"] { color: var(--signal); }
.life-step[aria-selected="true"] .life-node { border-color: var(--signal); }
.life-step[data-done] .life-node { border-color: var(--signal); background: var(--signal); }
.life-step:focus-visible { outline-offset: -2px; }
.life-name { font-weight: 650; line-height: 1.25; }
.life-panels { border-top: 1px solid var(--rule); }
.life-panel { padding: 1.5rem 0 0; }
.life-panel h3 { font-family: var(--serif); font-weight: 500; font-size: clamp(1.4rem, 2.2vw, 1.8rem); }
.life-facts { margin: 1.25rem 0 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1.25rem 2.5rem; }
.life-facts dt { font-size: 0.78rem; letter-spacing: 0.1em; text-transform: uppercase; color: var(--fg-3); font-weight: 650; }
.life-facts dd { margin: 0.35rem 0 0; color: var(--fg-2); max-width: 60ch; }
.fact-risk dt { color: var(--copper); }
.fact-ask dd { color: var(--fg); font-family: var(--serif); font-size: 1.15rem; font-style: italic; }
@media (max-width: 53.75em) {
  .life-rail, .life-token { display: none; }
  .life-steps { grid-template-columns: minmax(0, 1fr); border-left: 2px solid var(--rule-soft); }
  .life-step { grid-template-columns: auto auto minmax(0, 1fr); justify-items: start; align-items: center; text-align: left; gap: 0.7rem; padding: 0.7rem 0.8rem; }
  .life-node { margin: 0; }
  .life-facts { grid-template-columns: minmax(0, 1fr); }
}

/* DeFi / CeFi table */
.compare-table { width: 100%; min-width: 640px; border-collapse: collapse; }
.compare-table th, .compare-table td { padding: 0.9rem 1rem; text-align: left; vertical-align: top; border-bottom: 1px solid var(--rule-soft); }
.compare-table thead th { font-size: 0.82rem; letter-spacing: 0.06em; text-transform: uppercase; color: var(--fg-3); border-bottom: 1px solid var(--rule); background: var(--ink-900); }
.compare-table tbody th { font-weight: 650; width: 24%; }
.compare-table td { color: var(--fg-2); }
.table-note { color: var(--fg-3); font-size: 0.92rem; max-width: 70ch; margin-top: 1rem; }

/* Sources */
.source-list { margin-top: 1.25rem; padding-left: 1.2rem; display: grid; gap: 0.6rem; font-size: 0.92rem; }
.source-list li::marker { color: var(--fg-3); font-family: var(--mono); font-size: 0.8rem; }
.source-meta { display: block; color: var(--fg-3); font-size: 0.84rem; }
.paper .source-meta { color: var(--paper-ink-2); }

/* Split + coverage model */
.split { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.05fr); gap: clamp(2rem, 5vw, 4rem); align-items: start; }
.split-text p { color: var(--fg-2); margin-top: 1rem; max-width: 60ch; }
.coverage { display: grid; gap: 1.1rem; }
.cov-chart { display: grid; gap: 0.75rem; padding: 1rem 0; border-top: 1px solid var(--rule-soft); border-bottom: 1px solid var(--rule-soft); }
.cov-bar { display: grid; grid-template-columns: 9rem minmax(0, 1fr) 7rem; gap: 0.75rem; align-items: center; font-size: 0.88rem; }
.cov-bar-track { height: 14px; background: var(--ink-950); border: 1px solid var(--rule-soft); border-radius: 2px; overflow: hidden; }
.cov-fill { display: block; height: 100%; width: 0; }
.cov-fill-liquid { background: var(--signal); }
.cov-fill-req { background: repeating-linear-gradient(135deg, var(--copper) 0 4px, oklch(0.78 0.105 58 / 0.55) 4px 8px); }
.cov-bar-value { text-align: right; font-family: var(--mono); font-size: 0.84rem; }
.cov-result { font-weight: 650; padding-left: 1.6rem; position: relative; }
.cov-result::before { content: ""; position: absolute; left: 0; top: 0.3em; width: 12px; height: 12px; border-radius: 50%; }
.cov-result[data-state="met"] { color: var(--signal); }
.cov-result[data-state="met"]::before { background: var(--signal); }
.cov-result[data-state="partial"] { color: var(--copper); }
.cov-result[data-state="partial"]::before { border: 2px solid var(--copper); }
.cov-result[data-state="unbacked"] { color: var(--danger); }
.cov-result[data-state="unbacked"]::before { background: var(--danger); border-radius: 1px; transform: rotate(45deg); }
@media (max-width: 60em) { .split { grid-template-columns: minmax(0, 1fr); } }
@media (max-width: 30em) { .cov-bar { grid-template-columns: minmax(0, 1fr) auto; } .cov-bar-track { grid-column: 1 / -1; grid-row: 2; } }

/* Scenario explorer */
.educational-flag { margin-top: -0.5rem; }
.net { position: relative; aspect-ratio: 600 / 420; max-height: 460px; width: 100%; }
.net-edges { position: absolute; inset: 0; width: 100%; height: 100%; }
.net-edge { stroke: var(--rule); stroke-width: 2; vector-effect: non-scaling-stroke; }
.net-edge[data-stress="strained"] { stroke: var(--copper); stroke-width: 3; }
.net-edge[data-stress="failing"] { stroke: var(--danger); stroke-width: 4; stroke-dasharray: 6 4; }
.net-node { position: absolute; left: var(--x); top: var(--y); transform: translate(-50%, -50%); width: clamp(7.5rem, 24%, 11rem); padding: 0.6rem 0.7rem; display: grid; gap: 0.15rem; text-align: center; background: var(--ink-950); border: 2px solid var(--signal); border-radius: var(--radius); }
.net-node[data-node="bank"] { --x: 50%; --y: 15%; }
.net-node[data-node="fund"] { --x: 83%; --y: 45%; }
.net-node[data-node="exchange"] { --x: 70%; --y: 85%; }
.net-node[data-node="issuer"] { --x: 30%; --y: 85%; }
.net-node[data-node="households"] { --x: 17%; --y: 45%; }
.net-name { overflow-wrap: anywhere; font-weight: 650; font-size: 0.86rem; line-height: 1.2; }
.net-status { font-size: 0.74rem; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; color: var(--signal); }
.net-node[data-status="strained"] { border-color: var(--copper); border-style: dashed; background: oklch(0.2 0.04 60 / 0.9); }
.net-node[data-status="strained"] .net-status { color: var(--copper); }
.net-node[data-status="failing"] { border-color: var(--danger); border-style: double; border-width: 4px; background: oklch(0.2 0.05 25 / 0.95); }
.net-node[data-status="failing"] .net-status { color: var(--danger); }
.legend { list-style: none; display: flex; flex-wrap: wrap; gap: 0.5rem 1.4rem; font-size: 0.86rem; color: var(--fg-2); }
.legend li { display: flex; align-items: center; gap: 0.5rem; }
.legend-swatch { width: 18px; height: 12px; border-radius: 2px; border: 2px solid var(--signal); }
.legend-strained { border: 2px dashed var(--copper); }
.legend-failing { border: 4px double var(--danger); }
.system-line { display: flex; justify-content: space-between; gap: 1rem; padding: 0.8rem 0; border-top: 1px solid var(--rule-soft); border-bottom: 1px solid var(--rule-soft); }
.system-line strong { font-family: var(--mono); }
.scn-table td[data-tone="strained"] { color: var(--copper); }
.scn-table td[data-tone="failing"] { color: var(--danger); font-weight: 650; }
@media (max-width: 35em) {
  .net { aspect-ratio: auto; display: grid; grid-template-columns: repeat(auto-fit, minmax(min(9rem, 100%), 1fr)); gap: 0.5rem; }
  .net-edges { display: none; }
  .net-node { position: static; transform: none; width: auto; }
}

/* Research */
.filters { display: grid; grid-template-columns: minmax(0, 1.4fr) auto minmax(0, 0.8fr); gap: 1.25rem; align-items: end; padding: 1.25rem; background: var(--ink-900); border: 1px solid var(--rule-soft); border-radius: var(--radius); }
.filters input[type="search"], .filters select { width: 100%; min-height: 44px; padding: 0 0.8rem; background: var(--ink-950); border: 1px solid var(--rule); border-radius: var(--radius); }
.filters input::placeholder { color: var(--fg-3); opacity: 1; }
.filters input[type="search"]:focus, .filters select:focus { border-color: var(--signal); outline: none; box-shadow: 0 0 0 1px var(--signal); }
.filters select { appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='M4 6l4 4 4-4' fill='none' stroke='%23a9b6c8' stroke-width='1.5'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 0.7rem center; background-size: 14px; padding-right: 2.2rem; }
.filters select option { background: var(--ink-900); }
.result-count { margin: 1.5rem 0 0.5rem; color: var(--fg-3); font-size: 0.9rem; font-variant-numeric: tabular-nums; }
.empty-state { display: grid; gap: 0.6rem; justify-items: start; padding: 2.5rem 0; border-top: 1px solid var(--rule); }
.empty-title { font-family: var(--serif); font-size: 1.4rem; max-width: 40ch; }
.empty-state p:not(.empty-title) { color: var(--fg-2); }
@media (max-width: 60em) { .filters { grid-template-columns: minmax(0, 1fr); } }

/* Article */
.breadcrumb { padding-top: 1.75rem; font-size: 0.86rem; color: var(--fg-3); }
.breadcrumb ol { list-style: none; display: flex; flex-wrap: wrap; gap: 0.3rem; }
.breadcrumb li:not(:last-child)::after { content: "/"; margin-left: 0.4rem; color: var(--rule); }
.breadcrumb [aria-current] { color: var(--fg-2); }
.article-head { padding: clamp(2rem, 5vw, 3.5rem) 0 2rem; max-width: 52rem; }
.article-head h1 { font-family: var(--serif); font-weight: 500; font-variation-settings: "opsz" 60; font-size: clamp(2.1rem, 4.6vw, 3.8rem); letter-spacing: -0.018em; line-height: 1.06; margin-top: 1rem; }
.article-standfirst { font-family: var(--serif); font-size: clamp(1.15rem, 1.6vw, 1.35rem); color: var(--fg-2); margin-top: 1.1rem; max-width: 60ch; line-height: 1.5; }
.article-byline { margin-top: 1.25rem; display: flex; flex-wrap: wrap; gap: 0.6rem; align-items: center; color: var(--fg-3); font-size: 0.9rem; }
.article-body { max-width: 52rem; font-family: var(--serif); font-size: clamp(1.07rem, 1.2vw, 1.16rem); line-height: 1.7; }
.article-body > * { max-width: var(--measure); }
.article-body > * + * { margin-top: 1.1rem; }
.article-body h2 { font-size: clamp(1.4rem, 2.2vw, 1.75rem); margin-top: 2.4rem; }
.article-body ul { padding-left: 1.3rem; display: grid; gap: 0.55rem; }
.article-body li::marker { color: var(--paper-copper); }
.sample-callout { margin-top: 2.4rem !important; padding: 0.9rem 0; font-family: var(--sans); font-size: 0.92rem; border-top: 1px dashed var(--paper-copper); border-bottom: 1px dashed var(--paper-copper); color: var(--paper-ink-2); }
.article-body .btn { font-family: var(--sans); margin-top: 0.5rem; white-space: normal; text-align: left; padding: 0.6rem 1.1rem; }
.article-sources { max-width: 52rem; margin-top: 2.5rem; }
@media (min-width: 80em) {
  .article-layout { display: grid; grid-template-columns: minmax(0, 52rem) minmax(15rem, 1fr); gap: 3rem; align-items: start; }
  .article-sources { position: sticky; top: calc(var(--header-h) + 1.5rem); margin-top: 0; padding-top: 1rem; border-top: 2px solid var(--rule); }
  .article-sources .source-list { font-size: 0.86rem; }
}
.article-sources h2 { font-size: 1.3rem; }

/* References */
.ref-list { list-style: none; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 2rem; margin-top: 1.5rem; }
.ref-item { border-top: 2px solid var(--rule); padding-top: 1rem; display: grid; gap: 0.6rem; align-content: start; }
.ref-item p { color: var(--fg-2); }
.ref-meta { display: grid; gap: 0.4rem; font-size: 0.86rem; color: var(--fg-3) !important; }
.recreation-list { list-style: none; margin-top: 1.5rem; border-top: 1px solid var(--paper-ink); }
.recreation-list li { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.2fr) auto; gap: 0.5rem 1.5rem; align-items: center; padding: 0.9rem 0; border-bottom: 1px solid var(--paper-rule); }
.recreation-topic { color: var(--paper-ink-2); }
.recreation-list a { font-weight: 650; }
.recreation-list .tag { white-space: normal; justify-self: start; }
.register-table { min-width: 860px; }
.register-table th[scope="row"] { font-weight: 500; max-width: 32ch; }
.cell-sub { font-size: 0.8rem; color: var(--fg-3); }
.used-in { list-style: none; display: grid; gap: 0.3rem; }
@media (max-width: 56.25em) { .ref-list { grid-template-columns: minmax(0, 1fr); } .recreation-list li { grid-template-columns: minmax(0, 1fr); } }

/* About / document */
.doc { display: grid; grid-template-columns: minmax(200px, 260px) minmax(0, 1fr); gap: clamp(2rem, 4vw, 3.5rem); align-items: start; margin-top: 1rem; }
.doc-toc { position: sticky; top: calc(var(--header-h) + 1.5rem); }
.toc-title { font-family: var(--sans); font-size: 0.8rem; letter-spacing: 0.12em; text-transform: uppercase; color: var(--fg-3); }
.doc-toc ol { list-style: none; margin-top: 0.75rem; border-left: 1px solid var(--rule); }
.doc-toc a { display: block; padding: 0.4rem 0 0.4rem 1rem; color: var(--fg-2); text-decoration: none; font-size: 0.92rem; margin-left: -1px; border-left: 2px solid transparent; }
.doc-toc a:hover { color: var(--fg); border-left-color: var(--signal); }
.doc-body { max-width: 52rem; }
.doc-section + .doc-section { margin-top: 2.25rem; padding-top: 2.25rem; border-top: 1px solid var(--paper-rule); }
.doc-section h2 { font-size: clamp(1.35rem, 2vw, 1.65rem); }
.doc-section p { margin-top: 0.9rem; color: var(--paper-ink-2); max-width: var(--measure); }
.doc-section-flag { padding-left: 1.25rem; border-left: 1px solid var(--paper-copper); }
.doc-section-flag + .doc-section { border-top: 0; }
.doc-section-flag p:first-of-type { color: var(--paper-ink); font-weight: 600; }
@media (max-width: 56.25em) { .doc { grid-template-columns: minmax(0, 1fr); } .doc-toc { position: static; } }

/* Footer */
.site-footer { border-top: 1px solid var(--rule); background: var(--ink-900); margin-top: clamp(3rem, 8vw, 6rem); }
.footer-inner { max-width: var(--wrap); margin: 0 auto; padding: clamp(2.5rem, 5vw, 3.5rem) var(--gutter) 2rem; display: grid; grid-template-columns: minmax(0, 1.8fr) repeat(3, minmax(0, 1fr)); gap: 2.5rem; }
.footer-lead { display: grid; gap: 1rem; align-content: start; }
.footer-disclosure { color: var(--fg-2); font-size: 0.92rem; max-width: 52ch; padding-left: 0.9rem; border-left: 1px solid var(--copper); }
.footer-advice { color: var(--fg-3); font-size: 0.86rem; }
.footer-heading { font-family: var(--sans); font-size: 0.78rem; letter-spacing: 0.12em; text-transform: uppercase; color: var(--fg-3); font-weight: 700; }
.footer-col ul { list-style: none; margin-top: 0.8rem; display: grid; gap: 0.15rem; }
.footer-col a { display: inline-flex; align-items: center; padding: 0.3rem 0; color: var(--fg-2); text-decoration: none; font-size: 0.92rem; }
.footer-col a:hover { color: var(--fg); text-decoration: underline; }
.footer-lang .lang-option { padding: 0.3rem 0; display: inline-flex; }
.footer-lang .lang-option[aria-current="true"]::after { margin-left: 0.6rem; }
.footer-copy { max-width: var(--wrap); margin: 0 auto; padding: 1.25rem var(--gutter) 2rem; border-top: 1px solid var(--rule-soft); color: var(--fg-3); font-size: 0.84rem; }
@media (max-width: 60em) { .footer-inner { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); } .footer-lead { grid-column: 1 / -1; } }
@media (max-width: 30em) { .footer-inner { grid-template-columns: minmax(0, 1fr); } }

/* AIHS demo badge: same component as the sibling showcase concepts (techsavvymn, pulsemedlb DemoBadge:
   fixed bottom-4 left-4 z-50, flex gap-2, rounded-full glass px-4 py-2, text-xs font-medium, shadow-lg),
   in techsavvymn's palette. Links back to the AIHS Showcase. */
.demo-badge { position: fixed; left: 16px; bottom: 16px; z-index: 50; display: flex; align-items: center; gap: 8px; padding: 8px 16px; border: 1px solid rgb(255 255 255 / 0.1); border-radius: 9999px; background-color: rgb(6 29 42 / 0.7); -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px); box-shadow: 0 10px 15px -3px rgb(6 29 42 / 0.5), 0 4px 6px -4px rgb(6 29 42 / 0.5); color: #e5e5e5; font-family: Inter, system-ui, -apple-system, sans-serif; font-size: 12px; font-weight: 500; line-height: 16px; letter-spacing: normal; text-decoration: none; transition: color 150ms cubic-bezier(0.4, 0, 0.2, 1); }
.demo-badge:hover { color: #2bc4c0; }
.demo-badge-icon { width: 14px; height: 14px; flex: none; }
.demo-badge-name { color: #2bc4c0; }

/* Root language picker (no-JS fallback) */
.root-picker main { padding-top: 4rem; }
.root-langs { list-style: none; display: grid; gap: 0.5rem; margin-top: 1.5rem; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; transition-duration: 0.01ms !important; scroll-behavior: auto !important; }
}

@media print {
  .site-header, .site-footer, .hero-switch, .controls, .filters, .demo-badge { display: none !important; }
  body { background: #fff; color: #000; }
}
