:root {
  /* Brand colours — REF-BRAND-DESIGN-001 §2 (six only) */
  --as-marine: #075156;
  --as-green: #2C8248;
  --as-citrus: #ABDD65;
  --as-navy: #17232D;
  --as-pale-blue: #E5EEEF;
  --as-white: #FFFFFF;
  /* Published data-viz / semantic set — §2b */
  --as-warning: #F59E0B;
  --as-error: #BA1A1A;
  --as-gray: #6B7280;

  /* Fonts — §3 (published stacks; no CDN, system fallbacks) */
  --as-font-display: 'Chronicle Display', Georgia, 'Times New Roman', serif;
  --as-font-body: 'Montserrat', 'Helvetica Neue', Arial, sans-serif;

  /* Spacing — §4 (4px scale) */
  --s1: 4px; --s2: 8px; --s3: 12px; --s4: 16px; --s5: 20px; --s6: 24px;
  --s8: 32px; --s10: 40px; --s12: 48px; --s16: 64px; --s20: 80px; --s24: 96px;

  /* Radius — §4 */
  --r-xs: 4px; --r-sm: 8px; --r-md: 12px; --r-lg: 16px; --r-xl: 28px; --r-full: 9999px;

  /* Motion — §6 */
  --d-fast: 150ms; --d-normal: 200ms; --d-slow: 300ms; --d-slower: 500ms;
  --e-standard: cubic-bezier(0.2, 0, 0, 1);
  --e-decelerate: cubic-bezier(0, 0, 0.2, 1);
  --e-accelerate: cubic-bezier(0.4, 0, 1, 1);

  /* Semantic surface tokens (light) — derived only via opacity of brand hexes */
  --bg: var(--as-white);
  --bg-alt: var(--as-pale-blue);
  --surface: var(--as-white);
  --ink: var(--as-navy);
  --ink-soft: rgba(23, 35, 45, 0.72);
  --ink-faint: rgba(23, 35, 45, 0.55);
  --accent: var(--as-marine);
  --link: var(--as-marine);
  --line: rgba(23, 35, 45, 0.12);
  --line-strong: rgba(23, 35, 45, 0.20);
  --hero-from: #075156;
  --hero-to: #0a3236;
  --shadow-1: 0 1px 3px rgba(23, 35, 45, 0.10);
  --shadow-2: 0 6px 22px rgba(23, 35, 45, 0.13);
  --shadow-3: 0 14px 44px rgba(23, 35, 45, 0.18);
  --chip-ink: #fff;
  --tnum: "tnum" 1, "lnum" 1;
}

:root[data-theme="dark"] {
  --bg: #0f191f;
  --bg-alt: #13212a;
  --surface: #17232D;
  --ink: #eef4f4;
  --ink-soft: rgba(238, 244, 244, 0.78);
  --ink-faint: rgba(238, 244, 244, 0.58);
  --accent: #6fb9bd;          /* lightened marine — AA on dark navy */
  --link: #9ad0d3;
  --line: rgba(238, 244, 244, 0.14);
  --line-strong: rgba(238, 244, 244, 0.24);
  --hero-from: #0a3236;
  --hero-to: #071e21;
  --shadow-1: 0 1px 3px rgba(0, 0, 0, 0.5);
  --shadow-2: 0 8px 26px rgba(0, 0, 0, 0.55);
  --shadow-3: 0 16px 48px rgba(0, 0, 0, 0.6);
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0f191f; --bg-alt: #13212a; --surface: #17232D;
    --ink: #eef4f4; --ink-soft: rgba(238,244,244,0.78); --ink-faint: rgba(238,244,244,0.58);
    --accent: #6fb9bd; --link: #9ad0d3;
    --line: rgba(238,244,244,0.14); --line-strong: rgba(238,244,244,0.24);
    --hero-from: #0a3236; --hero-to: #071e21;
    --shadow-1: 0 1px 3px rgba(0,0,0,0.5); --shadow-2: 0 8px 26px rgba(0,0,0,0.55);
    --shadow-3: 0 16px 48px rgba(0,0,0,0.6);
  }
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 84px; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--as-font-body);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

h1, h2, h3, h4 { font-family: var(--as-font-display); color: var(--accent); line-height: 1.18; font-weight: 400; }
h1 { font-size: clamp(2.4rem, 5vw, 4.2rem); letter-spacing: -0.01em; }
h2 { font-size: clamp(1.7rem, 3vw, 2.4rem); margin: 0 0 var(--s4); }
h3 { font-size: 1.28rem; }
h4 { font-size: 1.05rem; font-family: var(--as-font-body); font-weight: 700; color: var(--ink); }
p { margin: 0 0 var(--s4); color: var(--ink-soft); max-width: 72ch; }
strong { color: var(--ink); }
a { color: var(--link); text-decoration: none; }
a:hover { text-decoration: underline; }
.num, .stat-num, td.n, .metric { font-variant-numeric: tabular-nums lining-nums; font-feature-settings: var(--tnum); }

.wrap { max-width: 1120px; margin: 0 auto; padding: 0 var(--s6); }
.narrow { max-width: 820px; }
.eyebrow {
  font-family: var(--as-font-body); font-weight: 700; font-size: 0.78rem;
  letter-spacing: 0.14em; text-transform: uppercase; color: var(--as-green);
  margin: 0 0 var(--s3);
}
:root[data-theme="dark"] .eyebrow, .hero .eyebrow { color: var(--as-citrus); }
.lead { font-size: 1.18rem; color: var(--ink-soft); max-width: 66ch; }

/* ---------- top nav ---------- */
header.site {
  position: sticky; top: 0; z-index: 50;
  background: var(--bg);
  border-bottom: 1px solid var(--line);
}
header.site .bar { display: flex; align-items: center; gap: var(--s5); height: 66px; }
.brand { display: flex; align-items: center; gap: var(--s3); font-family: var(--as-font-display);
  font-size: 1.2rem; color: var(--ink); white-space: nowrap; }
.brand svg { width: 30px; height: 30px; flex: none; }
.brand svg path { stroke: var(--accent); stroke-width: 12; fill: none; }
.brand .sub { font-family: var(--as-font-body); font-size: 0.72rem; letter-spacing: 0.12em;
  text-transform: uppercase; color: var(--ink-faint); border-left: 1px solid var(--line-strong);
  padding-left: var(--s3); margin-left: var(--s1); }
nav.primary { margin-left: auto; display: flex; gap: var(--s1); align-items: center; }
nav.primary a { color: var(--ink-soft); font-size: 0.9rem; font-weight: 500;
  padding: var(--s2) var(--s3); border-radius: var(--r-xs); white-space: nowrap; }
nav.primary a:hover { color: var(--accent); text-decoration: none; background: var(--bg-alt); }
nav.primary a.active { color: var(--accent); font-weight: 700; }
.navdrop { position: relative; }
.navdrop > summary { list-style: none; cursor: pointer; color: var(--ink-soft); font-size: 0.9rem;
  font-weight: 500; padding: var(--s2) var(--s3); border-radius: var(--r-xs); white-space: nowrap; }
.navdrop > summary::-webkit-details-marker { display: none; }
.navdrop > summary::marker { content: ""; }
.navdrop > summary:hover, .navdrop > summary.active { color: var(--accent); }
.navdrop .menu { position: absolute; top: calc(100% + 6px); left: 0; min-width: 250px; background: var(--surface);
  border: 1px solid var(--line); border-radius: var(--r-sm); box-shadow: var(--shadow-2); padding: 6px; display: none; z-index: 60; }
.navdrop[open] .menu, .navdrop:hover .menu { display: block; }
.navdrop .menu a { display: block; padding: 8px 12px; border-radius: var(--r-xs); color: var(--ink-soft);
  font-size: 0.9rem; font-weight: 500; white-space: nowrap; }
.navdrop .menu a:hover { background: var(--bg-alt); color: var(--accent); text-decoration: none; }
.nav-sample { border: 1px solid var(--line-strong); }
.theme-toggle, .nav-toggle { background: none; border: 1px solid var(--line-strong); color: var(--ink-soft);
  width: 38px; height: 38px; border-radius: var(--r-full); cursor: pointer; font-size: 1rem;
  align-items: center; justify-content: center; }
.theme-toggle { display: inline-flex; }
.theme-toggle:hover, .nav-toggle:hover { border-color: var(--accent); color: var(--accent); }
.nav-toggle { display: none; }

/* ---------- hero ---------- */
.hero { position: relative; overflow: hidden; color: #fff;
  background: linear-gradient(135deg, var(--hero-from) 0%, var(--hero-to) 100%); }
.hero::after { content: ""; position: absolute; right: -8%; top: -30%; width: 60%; height: 160%;
  background: radial-gradient(closest-side, rgba(171,221,101,0.18), transparent 70%); pointer-events: none; }
.hero .spiral { position: absolute; right: -60px; bottom: -80px; width: 520px; height: 520px;
  opacity: 0.10; pointer-events: none; }
.hero .spiral svg { width: 100%; height: 100%; }
.hero .spiral svg path { stroke: #fff !important; }
/* padding-top/bottom only (NOT the `padding: X 0 Y` shorthand): .inner shares
   its element with .wrap, and this two-class selector outranks .wrap — the
   shorthand zeroed .wrap's side gutters. Invisible at desktop widths (the
   centring margins provide the inset) but below the 1120px max-width the hero
   text sat flush against the screen edge. */
.hero .inner { position: relative; padding-top: var(--s24); padding-bottom: var(--s20); }
.hero h1 { color: #fff; max-width: 20ch; }
.hero p { color: rgba(255,255,255,0.90); }
.hero .lead { color: rgba(255,255,255,0.92); }
.hero .eyebrow { color: var(--as-citrus); }
.hero-cta { display: flex; flex-wrap: wrap; gap: var(--s4); margin-top: var(--s8); }

/* ---------- buttons ---------- */
.btn { display: inline-flex; align-items: center; gap: var(--s2); font-family: var(--as-font-body);
  font-weight: 600; font-size: 0.96rem; padding: var(--s3) var(--s6); border-radius: var(--r-xs);
  cursor: pointer; border: 1px solid transparent; transition: transform var(--d-fast) var(--e-standard),
  background var(--d-fast), border-color var(--d-fast); text-decoration: none; }
.btn-primary { background: var(--as-citrus); color: var(--as-navy); }  /* Navy on Citrus 6.7:1 */
.btn-primary:hover { transform: translateY(-2px); text-decoration: none; }
.btn-ghost { background: transparent; color: #fff; border-color: rgba(255,255,255,0.5); }
.btn-ghost:hover { background: rgba(255,255,255,0.12); text-decoration: none; }
.btn-solid { background: var(--as-marine); color: #fff; }
:root[data-theme="dark"] .btn-solid { background: var(--accent); color: var(--as-navy); }
.btn-solid:hover { transform: translateY(-2px); text-decoration: none; }

/* ---------- sections ---------- */
section { padding: var(--s20) 0; }
section.alt { background: var(--bg-alt); }
.section-head { max-width: 68ch; margin-bottom: var(--s10); }

/* ---------- reveal on scroll (progressive enhancement — hidden only when JS is present) ---------- */
.js .reveal { opacity: 0; transform: translateY(18px); transition: opacity var(--d-slower) var(--e-decelerate),
  transform var(--d-slower) var(--e-decelerate); }
.js .reveal.in { opacity: 1; transform: none; }

/* ---------- cards / grids ---------- */
.grid { display: grid; gap: var(--s6); }
.grid.two { grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); }
.grid.three { grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-md);
  padding: var(--s6); box-shadow: var(--shadow-1); }
.card.lift { transition: transform var(--d-normal) var(--e-standard), box-shadow var(--d-normal); }
.card.lift:hover { transform: translateY(-4px); box-shadow: var(--shadow-2); }
.card h3 { margin: 0 0 var(--s2); }

/* ---------- tier cards + selector ---------- */
.tierbar { display: flex; flex-wrap: wrap; gap: var(--s2); margin: 0 0 var(--s8); }
.tierbtn { font-family: var(--as-font-body); font-weight: 600; font-size: 0.88rem;
  padding: var(--s2) var(--s5); border-radius: var(--r-full); cursor: pointer;
  border: 1px solid var(--line-strong); background: var(--surface); color: var(--ink-soft);
  transition: all var(--d-fast) var(--e-standard); }
.tierbtn:hover { border-color: var(--accent); color: var(--accent); }
.tierbtn[aria-pressed="true"] { background: var(--as-marine); color: #fff; border-color: var(--as-marine); }
:root[data-theme="dark"] .tierbtn[aria-pressed="true"] { background: var(--accent); color: var(--as-navy); }

.domain-card { position: relative; border-left: 5px solid var(--as-marine);
  transition: opacity var(--d-slow) var(--e-standard), transform var(--d-slow) var(--e-standard),
  box-shadow var(--d-normal); }
.domain-card.dim { opacity: 0.32; filter: saturate(0.5); }
.domain-card .tierchips { display: flex; flex-wrap: wrap; gap: var(--s1); margin-top: var(--s4); }
.domain-card .arrow { color: var(--accent); font-weight: 700; }

.chip { display: inline-block; padding: 2px var(--s3); border-radius: var(--r-full);
  font-size: 0.72rem; font-weight: 700; letter-spacing: 0.04em; }
.chip-tier { background: var(--as-pale-blue); color: var(--as-marine); border: 1px solid transparent; }
:root[data-theme="dark"] .chip-tier { background: rgba(111,185,189,0.16); color: var(--accent); }
.chip-roadmap { background: rgba(107,114,128,0.15); color: var(--as-gray); }
:root[data-theme="dark"] .chip-roadmap { color: #b6bcc6; }
.chip-anchor { background: var(--as-citrus); color: var(--as-navy); }
.chip-sub { background: var(--as-green); color: #fff; }

/* ---------- health dial ---------- */
.dial-wrap { display: flex; gap: var(--s10); align-items: center; flex-wrap: wrap; }
.dial { position: relative; width: 200px; height: 200px; flex: none; }
.dial svg { transform: rotate(-90deg); width: 100%; height: 100%; }
.dial .ring-bg { fill: none; stroke: rgba(255,255,255,0.18); stroke-width: 14; }
.dial .ring-fg { fill: none; stroke: var(--as-citrus); stroke-width: 14; stroke-linecap: round;
  transition: stroke-dashoffset var(--d-slower) var(--e-decelerate); }
.dial .val { position: absolute; inset: 0; display: flex; flex-direction: column;
  align-items: center; justify-content: center; }
.dial .val b { font-family: var(--as-font-display); font-size: 3rem; color: #fff; line-height: 1;
  font-variant-numeric: tabular-nums; }
.dial .val span { font-size: 0.74rem; letter-spacing: 0.1em; text-transform: uppercase; color: rgba(255,255,255,0.8); }
.minis { display: grid; grid-template-columns: repeat(2, minmax(160px, 1fr)); gap: var(--s4); }
.mini { background: rgba(255,255,255,0.08); border: 1px solid rgba(255,255,255,0.14);
  border-radius: var(--r-sm); padding: var(--s4) var(--s5); }
.mini b { font-family: var(--as-font-display); font-size: 1.7rem; color: #fff; font-variant-numeric: tabular-nums; }
.mini span { display: block; font-size: 0.8rem; color: rgba(255,255,255,0.82); }
.mini .track { height: 6px; border-radius: var(--r-full); background: rgba(255,255,255,0.16); margin-top: var(--s2); overflow: hidden; }
.mini .fill { height: 100%; border-radius: var(--r-full); background: var(--as-citrus); width: 0;
  transition: width var(--d-slower) var(--e-decelerate); }

/* ---------- callout (secondary, linking notice) ---------- */
.callout { background: var(--surface-2, var(--surface)); border: 1px solid var(--line);
  border-left: 4px solid var(--as-marine); border-radius: var(--r-sm);
  padding: var(--s5) var(--s6); font-size: 0.92rem; }
.callout a { font-weight: 600; }

/* ---------- stat tiles ---------- */
.tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: var(--s5); }
.tile { background: var(--surface); border: 1px solid var(--line); border-top: 4px solid var(--accent);
  border-radius: var(--r-sm); padding: var(--s5) var(--s6); box-shadow: var(--shadow-1); }
.tile b { display: block; font-family: var(--as-font-display); font-size: 2.4rem; color: var(--accent);
  line-height: 1; font-variant-numeric: tabular-nums; }
.tile span { font-size: 0.86rem; color: var(--ink-soft); }
.tile.warn { border-top-color: var(--as-warning); } .tile.warn b { color: var(--as-warning); }
.tile.err { border-top-color: var(--as-error); } .tile.err b { color: var(--as-error); }
.tile.ok { border-top-color: var(--as-green); } .tile.ok b { color: var(--as-green); }

/* ---------- domain page layout ---------- */
.dhero { background: linear-gradient(135deg, var(--hero-from), var(--hero-to)); color: #fff; }
.dhero .inner { padding: var(--s16) 0 var(--s12); position: relative; }
.dhero h1 { color: #fff; font-size: clamp(2rem, 4vw, 3.2rem); }
.dhero .kicker { color: var(--as-citrus); }
.dlayout { display: grid; grid-template-columns: 220px 1fr; gap: var(--s12); align-items: start; }
/* grid items default to min-width:auto, so one long unbreakable token in the
   content column widens the 1fr track past the wrap and the page pans sideways */
.dlayout > * { min-width: 0; }
.subnav { position: sticky; top: 90px; }
.subnav ul { list-style: none; margin: 0; padding: 0; border-left: 2px solid var(--line); }
.subnav a { display: block; padding: var(--s2) var(--s4); font-size: 0.9rem; color: var(--ink-faint);
  margin-left: -2px; border-left: 2px solid transparent; }
.subnav a:hover { color: var(--accent); text-decoration: none; }
.subnav a.active { color: var(--accent); font-weight: 700; border-left-color: var(--accent); }
.block { margin-bottom: var(--s16); scroll-margin-top: 90px; }
.block > h2 { display: flex; align-items: center; gap: var(--s3); }
.block .step { font-family: var(--as-font-body); font-size: 0.8rem; font-weight: 700; color: #fff;
  background: var(--as-marine); width: 26px; height: 26px; border-radius: var(--r-full);
  display: inline-flex; align-items: center; justify-content: center; flex: none; }
:root[data-theme="dark"] .block .step { background: var(--accent); color: var(--as-navy); }

/* ---------- accordions (drill-down checks) ---------- */
.acc { border: 1px solid var(--line); border-radius: var(--r-sm); overflow: hidden;
  background: var(--surface); margin-bottom: var(--s3); }
.acc summary { list-style: none; cursor: pointer; padding: var(--s4) var(--s6); font-weight: 600;
  color: var(--ink); display: flex; align-items: center; gap: var(--s3); }
.acc summary::-webkit-details-marker { display: none; }
.acc summary .plus { margin-left: auto; color: var(--accent); font-size: 1.3rem; line-height: 1;
  transition: transform var(--d-normal) var(--e-standard); flex: none; }
.acc[open] summary .plus { transform: rotate(45deg); }
.acc summary .rule { font-size: 0.7rem; font-weight: 700; color: var(--as-marine);
  background: var(--as-pale-blue); padding: 2px 8px; border-radius: var(--r-xs); letter-spacing: 0.03em; }
:root[data-theme="dark"] .acc summary .rule { background: rgba(111,185,189,0.16); color: var(--accent); }
.acc .body { padding: 0 var(--s6) var(--s5); color: var(--ink-soft); }
.acc .body p { margin-top: 0; }

/* ---------- example finding callout ---------- */
.example { border: 1px solid var(--line); border-radius: var(--r-md); background: var(--surface);
  box-shadow: var(--shadow-1); overflow: hidden; }
.example .tag { background: var(--as-navy); color: #fff; font-size: 0.76rem; font-weight: 600;
  letter-spacing: 0.03em; padding: var(--s2) var(--s6); display: flex; align-items: center; gap: var(--s2); }
:root[data-theme="dark"] .example .tag { background: #0a1319; }
.example .tag::before { content: "◆"; color: var(--as-citrus); }
.example .inner { padding: var(--s6); }
.example figure { margin: var(--s5) 0 0; }
figcaption { font-size: 0.85rem; color: var(--ink-faint); margin-top: var(--s2); }

/* ---------- benefit callout ---------- */
.benefit { border-left: 5px solid var(--as-green); background: var(--bg-alt); border-radius: var(--r-sm);
  padding: var(--s5) var(--s6); }
.benefit h4 { color: var(--as-green); margin: 0 0 var(--s2); }
:root[data-theme="dark"] .benefit h4 { color: var(--as-citrus); }
.benefit p { margin: 0; }

/* ---------- honesty marker ---------- */
.note { font-size: 0.86rem; color: var(--ink-faint); border-left: 3px solid var(--line-strong);
  padding: var(--s2) var(--s4); margin: var(--s4) 0; }
.note b { color: var(--ink-soft); }

/* ---------- tables ---------- */
table { border-collapse: collapse; width: 100%; margin: var(--s4) 0; font-size: 0.92rem; }
th, td { text-align: left; padding: var(--s3) var(--s4); border-bottom: 1px solid var(--line); vertical-align: top; }
th { font-family: var(--as-font-body); font-weight: 700; color: var(--ink); background: var(--bg-alt); }
td.n { text-align: right; }

/* ---------- charts ---------- */
.chart { width: 100%; height: auto; font-family: var(--as-font-body); }
.chart text { fill: var(--ink-soft); }
.chart .lbl { font-size: 12px; }
.chart .val { font-size: 12px; font-variant-numeric: tabular-nums; fill: var(--ink); }
.bar { transition: opacity var(--d-fast); }
.bar:hover { opacity: 0.78; }

/* tooltip */
#tt { position: fixed; z-index: 100; background: var(--as-navy); color: #fff; font-size: 0.8rem;
  padding: 6px 10px; border-radius: var(--r-xs); pointer-events: none; opacity: 0; transform: translateY(4px);
  transition: opacity var(--d-fast); max-width: 260px; box-shadow: var(--shadow-2); }
#tt.show { opacity: 1; transform: none; }

/* ---------- method timeline ---------- */
.timeline { list-style: none; margin: 0; padding: 0; counter-reset: step; }
.timeline li { position: relative; padding: 0 0 var(--s10) var(--s16); }
.timeline li::before { counter-increment: step; content: counter(step); position: absolute; left: 0; top: 0;
  width: 44px; height: 44px; border-radius: var(--r-full); background: var(--as-marine); color: #fff;
  font-family: var(--as-font-display); font-size: 1.3rem; display: flex; align-items: center; justify-content: center; }
:root[data-theme="dark"] .timeline li::before { background: var(--accent); color: var(--as-navy); }
.timeline li::after { content: ""; position: absolute; left: 21px; top: 44px; bottom: 8px; width: 2px; background: var(--line); }
.timeline li:last-child { padding-bottom: 0; }
.timeline li:last-child::after { display: none; }
.timeline h3 { margin: 6px 0 var(--s2); }

/* ---------- footer ---------- */
footer.site { background: var(--as-navy); color: rgba(255,255,255,0.82); padding: var(--s16) 0 var(--s10); }
:root[data-theme="dark"] footer.site { background: #0a1319; border-top: 1px solid var(--line); }
footer.site h4 { color: #fff; }
footer.site a { color: var(--as-citrus); }
footer.site .cols { display: grid; grid-template-columns: 1.4fr 1fr 1fr; gap: var(--s10); }
footer.site .fine { margin-top: var(--s10); padding-top: var(--s6); border-top: 1px solid rgba(255,255,255,0.14);
  font-size: 0.82rem; color: rgba(255,255,255,0.6); }
footer.site .brand { color: #fff; }
footer.site .brand svg path { stroke: #fff; }
footer.site nav a { display: block; padding: 3px 0; color: rgba(255,255,255,0.82); }

/* ---------- responsive ---------- */
@media (max-width: 900px) {
  .dlayout { grid-template-columns: 1fr; }
  .subnav { position: static; display: none; }
  footer.site .cols { grid-template-columns: 1fr; gap: var(--s8); }
  /* in-flow menu that wraps below the bar (no fixed overlay -> no stacking gotchas) */
  header.site .bar { gap: var(--s3); flex-wrap: wrap; height: auto; min-height: 66px; align-content: center; }
  nav.primary { display: none; flex-basis: 100%; width: 100%; margin: 0; flex-direction: column; align-items: stretch;
    background: var(--surface); padding: var(--s3) 0 var(--s4); gap: 2px; border-top: 1px solid var(--line); }
  nav.primary.open { display: flex; }
  .nav-toggle { display: inline-flex; margin-left: auto; }
  .navdrop .menu { position: static; display: block; box-shadow: none; border: none;
    padding: 0 0 0 var(--s4); min-width: 0; background: transparent; }
  .navdrop > summary { font-weight: 700; }
  .brand .sub { display: none; }
  .dlayout { gap: var(--s8); }
}

@media (max-width: 760px) {
  /* Wide tables (findings, delta, methodology) scroll inside their own box
     instead of forcing the whole page to pan sideways. display:block keeps
     the internal table layout while giving the element an overflow context. */
  table { display: block; overflow-x: auto; -webkit-overflow-scrolling: touch; }
}

@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; }
  .js .reveal, .reveal { opacity: 1 !important; transform: none !important; }
}

/* ===== report design system ===== */
:root {
  --peach: #E59E6D; --peach-dk: #C97A45; --peach-soft: #FBEEE3;
  --neutral-mark: var(--as-marine); --warn-mark: var(--peach-dk);
}
:root[data-theme="dark"] {
  --peach: #eaa877; --peach-dk: #e0925a; --peach-soft: rgba(229,158,109,0.14);
  --neutral-mark: var(--accent); --warn-mark: #e0925a;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --peach: #eaa877; --peach-dk: #e0925a; --peach-soft: rgba(229,158,109,0.14);
    --neutral-mark: var(--accent); --warn-mark: #e0925a;
  }
}

/* ---------- co-brand report header ---------- */
/* Not sticky: it scrolls away and the tab nav sticks to the top (the reference
   deliverable's folder-tab behaviour). Two sticky top:0 bars would overlap. */
header.rep {
  background: linear-gradient(135deg, #17232d 0%, #0f3138 68%, #075156 130%);
  color: #fff; border-bottom: 3px solid var(--peach); }
header.rep .bar { display: flex; align-items: center; gap: var(--s5); min-height: 62px; padding: var(--s3) 0; }
header.rep .cobrand { display: flex; align-items: center; gap: var(--s3); font-family: var(--as-font-display);
  font-size: 1.12rem; color: #fff; white-space: nowrap; }
header.rep .cobrand svg { width: 26px; height: 26px; flex: none; }
header.rep .cobrand svg path { stroke: #fff; }
header.rep .cobrand .client { font-weight: 400; }
header.rep .cobrand .x { color: var(--peach); font-weight: 300; font-size: 1rem; padding: 0 2px; }
header.rep .cobrand .as { font-family: var(--as-font-body); font-weight: 600; font-size: 0.82rem;
  letter-spacing: 0.06em; text-transform: uppercase; color: rgba(255,255,255,0.86);
  display: inline-flex; align-items: center; gap: var(--s2); }
header.rep .meta { margin-left: auto; text-align: right; font-family: var(--as-font-body);
  font-size: 0.72rem; line-height: 1.5; color: rgba(255,255,255,0.72); letter-spacing: 0.04em; }
header.rep .meta b { display: block; color: var(--as-citrus); font-weight: 700;
  letter-spacing: 0.1em; text-transform: uppercase; }
header.rep .theme-toggle { border-color: rgba(255,255,255,0.4); color: rgba(255,255,255,0.9); }
header.rep .theme-toggle:hover { border-color: var(--as-citrus); color: var(--as-citrus); }
header.rep .nav-toggle { border-color: rgba(255,255,255,0.4); color: rgba(255,255,255,0.9); display: none; }
@media (max-width: 900px) {
  /* The co-brand line ("<client> × Alterspective") is long — un-pin it so the
     bar wraps instead of dragging the whole page wider than the viewport
     (a ~120px sideways pan on phones before this rule existed). */
  header.rep .bar { flex-wrap: wrap; row-gap: var(--s2); }
  header.rep .cobrand { white-space: normal; min-width: 0; flex: 1 1 auto; font-size: 1rem; }
  header.rep .meta { flex-basis: 100%; margin-left: 0; text-align: left; order: 10; padding-bottom: var(--s2); }
}

/* ---------- folder-tab nav (the sticky element) ---------- */
nav.tabs { background: var(--as-navy); position: sticky; top: 0; z-index: 50; }
nav.tabs .row { display: flex; flex-wrap: wrap; gap: 2px; padding-top: var(--s2); }
nav.tabs a { color: rgba(255,255,255,0.80); font-family: var(--as-font-body); font-size: 0.85rem;
  font-weight: 500; padding: var(--s2) var(--s4); border-radius: 8px 8px 0 0; white-space: nowrap;
  border-bottom: 3px solid transparent; }
nav.tabs a:hover { color: #fff; background: rgba(229,158,109,0.22); text-decoration: none; }
nav.tabs a.active { color: var(--as-navy); background: var(--bg); font-weight: 700;
  border-bottom-color: var(--as-citrus); }
:root[data-theme="dark"] nav.tabs a.active { color: var(--ink); }

/* ---------- report hero ---------- */
.rhero { background: linear-gradient(135deg, var(--hero-from), var(--hero-to)); color: #fff;
  position: relative; overflow: hidden; }
.rhero::after { content: ""; position: absolute; right: -6%; top: -40%; width: 52%; height: 180%;
  background: radial-gradient(closest-side, rgba(171,221,101,0.16), transparent 70%); pointer-events: none; }
/* padding-top/bottom only — same .wrap-gutter-clobbering trap as .hero .inner */
.rhero .inner { position: relative; padding-top: var(--s12); padding-bottom: var(--s10); }
.rhero .eyebrow { color: var(--as-citrus); }
.rhero h1 { color: #fff; font-size: clamp(2rem, 4vw, 3.1rem); margin: 0 0 var(--s3); max-width: 22ch; }
.rhero p.lead { color: rgba(255,255,255,0.92); }

/* ---------- report main column ----------
   The builder emits `main.rep > header.rhero` (a full-bleed band whose inner
   content is boxed by its own .wrap) followed by `main.rep > .wrap` holding the
   sections. So `main.rep` itself must NOT constrain/pad (that would box the hero
   and double-gutter the body); the boxing lives on the `.wrap` children. */
main.rep { margin: 0; padding: 0; }
main.rep > .wrap { max-width: 1060px; padding-top: var(--s10); padding-bottom: var(--s20); }
main.rep .wrap > section { padding: 0; margin: 0 0 var(--s12); }
main.rep h2 { display: flex; align-items: center; gap: var(--s3); scroll-margin-top: 96px; }
main.rep h2::before { content: ""; width: 22px; height: 4px; border-radius: 3px;
  background: var(--peach); flex: none; }
main.rep h3 { color: var(--ink); margin: var(--s6) 0 var(--s3); }

/* ---------- "how to read this page" strip ---------- */
.section-guide { display: grid; grid-template-columns: repeat(4, 1fr); gap: var(--s3);
  margin: var(--s6) 0 var(--s8); }
.section-guide .g { background: var(--bg-alt); border: 1px solid var(--line); border-radius: var(--r-sm);
  padding: var(--s4) var(--s5); }
.section-guide .g h4 { font-size: 0.7rem; letter-spacing: 0.1em; text-transform: uppercase;
  color: var(--as-marine); margin: 0 0 var(--s2); }
:root[data-theme="dark"] .section-guide .g h4 { color: var(--accent); }
.section-guide .g p { font-size: 0.86rem; margin: 0; color: var(--ink-soft); }
@media (max-width: 1024px) { .section-guide { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 560px) { .section-guide { grid-template-columns: 1fr; } }

/* ---------- KPI stat tiles (report) ---------- */
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: var(--s4);
  margin: var(--s6) 0; }
.stat { background: var(--surface); border: 1px solid var(--line); border-top: 3px solid var(--peach);
  border-radius: var(--r-md); padding: var(--s5) var(--s6); box-shadow: var(--shadow-1); }
.stat .n { display: block; font-family: var(--as-font-display); font-size: 1.9rem; line-height: 1;
  color: var(--as-marine); font-variant-numeric: tabular-nums; }
:root[data-theme="dark"] .stat .n { color: var(--accent); }
.stat.warn .n { color: var(--peach-dk); } .stat.warn { border-top-color: var(--peach-dk); }
.stat.ok .n { color: var(--as-green); } .stat.ok { border-top-color: var(--as-green); }
.stat .k { display: block; font-size: 0.82rem; color: var(--ink-soft); margin-top: var(--s2); }

/* ---------- framed figure ---------- */
.figure { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-md);
  padding: var(--s5) var(--s6); box-shadow: var(--shadow-1); margin: var(--s5) 0; overflow-x: auto; }
.figure svg { display: block; margin: 0 auto; max-width: 100%; height: auto; }
.figcap { font-size: 0.85rem; color: var(--ink-faint); text-align: center; margin-top: var(--s3); }

/* ---------- honesty / method callouts ---------- */
.callout-h { background: var(--peach-soft); border: 1px solid transparent; border-left: 4px solid var(--peach);
  border-radius: var(--r-sm); padding: var(--s5) var(--s6); margin: var(--s5) 0; font-size: 0.94rem;
  color: var(--ink-soft); }
.callout-h b, .callout-h strong { color: var(--ink); }
:root[data-theme="dark"] .callout-h { color: var(--ink-soft); }
.note-teal { background: rgba(7,81,86,0.06); border: 1px solid transparent; border-left: 4px solid var(--as-marine);
  border-radius: var(--r-sm); padding: var(--s4) var(--s6); margin: var(--s5) 0; font-size: 0.9rem;
  color: var(--ink-soft); }
:root[data-theme="dark"] .note-teal { background: rgba(111,185,189,0.10); border-left-color: var(--accent); }
.note-teal code, .callout-h code { background: rgba(23,35,45,0.08); padding: 1px 6px; border-radius: 4px;
  font-size: 0.86em; }
:root[data-theme="dark"] .note-teal code, :root[data-theme="dark"] .callout-h code { background: rgba(255,255,255,0.10); }

/* ---------- field notes (live-engagement provenance, per page) ---------- */
.fieldnote { display: flex; gap: var(--s4); align-items: flex-start; background: var(--surface);
  border: 1px solid var(--line); border-left: 4px solid var(--as-green); border-radius: var(--r-sm);
  padding: var(--s5) var(--s6); margin: var(--s5) 0; font-size: 0.94rem; color: var(--ink-soft); }
.fieldnote .fn-tag { flex: none; font-weight: 700; font-size: 0.68rem; letter-spacing: 0.08em;
  text-transform: uppercase; color: var(--as-green); padding-top: 3px; white-space: nowrap; }
:root[data-theme="dark"] .fieldnote { border-left-color: var(--as-citrus); }
:root[data-theme="dark"] .fieldnote .fn-tag { color: var(--as-citrus); }

/* ---------- story nav (next-chapter link at the foot of every report page) ---------- */
.storynav { display: flex; align-items: center; justify-content: space-between; gap: var(--s4);
  flex-wrap: wrap; border-top: 1px solid var(--line); margin-top: var(--s8);
  padding: var(--s6) 0 var(--s10); }
.storynav .snlabel { font-size: 0.78rem; letter-spacing: 0.1em; text-transform: uppercase;
  font-weight: 700; color: var(--ink-faint); }

/* ---------- universe preview (matter-universe chapter) ---------- */
.uprev { display: block; position: relative; border-radius: var(--r-md); overflow: hidden;
  border: 1px solid var(--line); box-shadow: var(--shadow-2); margin: var(--s5) 0; }
.uprev img { display: block; width: 100%; height: auto; }
.uprev .uplay { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center;
  background: rgba(10,20,26,0); transition: background var(--d-fast); }
.uprev:hover .uplay, .uprev:focus-visible .uplay { background: rgba(10,20,26,0.28); }
.uprev .uplay span { background: var(--as-citrus); color: var(--as-navy); font-weight: 700;
  padding: var(--s3) var(--s6); border-radius: var(--r-full); opacity: 0;
  transform: translateY(6px); transition: opacity var(--d-fast), transform var(--d-fast); }
.uprev:hover .uplay span, .uprev:focus-visible .uplay span { opacity: 1; transform: none; }
.uprev:focus-visible { outline: 3px solid var(--as-citrus); outline-offset: 2px; }

/* ---------- provenance pills ---------- */
.pill { display: inline-block; padding: 1px 9px; border-radius: var(--r-full); font-size: 0.68rem;
  font-weight: 700; letter-spacing: 0.04em; text-transform: uppercase; vertical-align: 1px; }
.pill.fact { background: rgba(44,130,72,0.14); color: var(--as-green); }
.pill.inf { background: var(--peach-soft); color: #8a4e20; }  /* darker brown on peach-soft = AA */
:root[data-theme="dark"] .pill.fact { color: var(--as-citrus); }
:root[data-theme="dark"] .pill.inf { background: var(--peach-soft); color: #e0925a; }
.pill.roadmap { background: rgba(107,114,128,0.16); color: var(--as-gray); }
:root[data-theme="dark"] .pill.roadmap { color: #b6bcc6; }

/* ---------- severity chips (findings) ---------- */
.sev { display: inline-block; padding: 1px 9px; border-radius: var(--r-full); font-size: 0.68rem;
  font-weight: 700; letter-spacing: 0.04em; text-transform: uppercase; color: #fff; white-space: nowrap; }
.sev.critical, .sev.high { background: var(--as-error); }
.sev.medium { background: var(--peach-dk); color: var(--as-navy); }  /* navy on peach = AA */
.sev.low { background: #6a6f8a; } .sev.info { background: #6f7d6f; }
.sev.green { background: var(--as-green); } .sev.amber { background: var(--peach-dk); color: var(--as-navy); } .sev.red { background: var(--as-error); }

/* ---------- findings table + evidence disclosure ---------- */
table.findings td { vertical-align: top; }
table.findings details { margin-top: var(--s2); }
table.findings summary { cursor: pointer; color: var(--link); font-size: 0.82rem; font-weight: 600;
  list-style: none; }
table.findings summary::-webkit-details-marker { display: none; }
table.findings summary::before { content: "▸ "; color: var(--peach-dk); }
table.findings details[open] summary::before { content: "▾ "; }
table.findings pre { background: var(--bg-alt); border: 1px solid var(--line); padding: var(--s3) var(--s4);
  border-radius: var(--r-sm); overflow-x: auto; font-size: 0.78rem; max-height: 22rem; margin: var(--s2) 0 0; }
table.findings code { font-size: 0.82em; }

/* ---------- report chart marks (theme-aware, tooltip-driven) ---------- */
.rchart { font-family: var(--as-font-body); }
.rchart text { fill: var(--ink-soft); font-size: 12px; }
.rchart .axis { stroke: var(--line-strong); }
.rchart .grid { stroke: var(--line); }
.rchart .val { fill: var(--ink); font-variant-numeric: tabular-nums; }
.rchart .mark { fill: var(--neutral-mark); transition: opacity var(--d-fast); }
.rchart .mark.warn { fill: var(--warn-mark); }
.rchart .mark.ok { fill: var(--as-green); }
.rchart:hover .mark { opacity: 0.34; }
.rchart .mark:hover { opacity: 1; }
.rchart [data-tip] { cursor: default; }
.rchart .zone { fill: var(--peach-dk); fill-opacity: 0.08; }
.rchart .zone-lbl { fill: var(--peach-dk); font-size: 11px; font-weight: 600; }
.rchart .line-raw { fill: none; stroke: var(--neutral-mark); stroke-opacity: 0.26; stroke-width: 1; }
.rchart .line-mean { fill: none; stroke: var(--neutral-mark); stroke-width: 2.4;
  stroke-linejoin: round; stroke-linecap: round; }
.rchart .anno-dot { fill: var(--as-citrus); stroke: var(--as-navy); stroke-width: 1.5; }
.rchart .anno-lbl { fill: var(--ink); font-size: 11px; font-weight: 600; }
.rchart .area { fill: var(--neutral-mark); fill-opacity: 0.13; }
.rchart .lblx { fill: var(--ink-soft); font-size: 11px; }
.rchart .legend-lbl { fill: var(--ink-soft); font-size: 11px; }
/* gauge / donut */
.rchart .gauge-track { fill: none; stroke: var(--line); }
.rchart .gauge-fill { fill: none; stroke: var(--as-marine); stroke-linecap: round; }
:root[data-theme="dark"] .rchart .gauge-fill { stroke: var(--accent); }
.rchart .gauge-fill.warn { stroke: var(--peach-dk); }
.rchart .gauge-num { fill: var(--ink); font-family: var(--as-font-display); font-variant-numeric: tabular-nums; }
.rchart .gauge-cap { fill: var(--ink-faint); font-size: 11px; }

/* ---------- CSS stacked proportion bars (msplit) ---------- */
.msplit { display: flex; flex-direction: column; gap: var(--s3); margin: var(--s5) 0; }
.msplit .row { display: grid; grid-template-columns: 180px 1fr 64px; gap: var(--s3); align-items: center; }
.msplit .name { font-size: 0.86rem; color: var(--ink-soft); text-align: right; }
.msplit .track { display: flex; height: 20px; border-radius: var(--r-xs); overflow: hidden;
  background: var(--bg-alt); }
.msplit .seg { height: 100%; }
.msplit .v { font-size: 0.86rem; color: var(--ink); text-align: right; font-variant-numeric: tabular-nums; }
.msplit .legend { display: flex; flex-wrap: wrap; gap: var(--s4); font-size: 0.8rem; color: var(--ink-soft);
  margin-top: var(--s2); }
.msplit .legend i { width: 11px; height: 11px; border-radius: 3px; display: inline-block; margin-right: 6px;
  vertical-align: -1px; }
@media (max-width: 560px) { .msplit .row { grid-template-columns: 110px 1fr 54px; } }

/* ---------- heatmap ---------- */
.heat { border-collapse: separate; border-spacing: 2px; }
.heat td.cell { width: 30px; height: 26px; border-radius: 3px; text-align: center; font-size: 0.72rem;
  color: #fff; font-variant-numeric: tabular-nums; }
.heat th { background: transparent; color: var(--ink-faint); font-weight: 600; font-size: 0.72rem;
  padding: 2px 6px; }
.heat-legend { display: inline-flex; align-items: center; gap: var(--s2); font-size: 0.78rem;
  color: var(--ink-faint); margin-top: var(--s3); }
.heat-legend .grad { width: 120px; height: 12px; border-radius: 3px; }

/* ---------- exec-summary header findings ---------- */
.rhero .dial .ring-bg { stroke: rgba(255,255,255,0.18); }
.threads { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: var(--s5); }
.thread { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-md);
  padding: var(--s5) var(--s6); box-shadow: var(--shadow-1); border-left: 4px solid var(--peach);
  transition: transform var(--d-normal) var(--e-standard), box-shadow var(--d-normal); }
.thread:hover { transform: translateY(-3px); box-shadow: var(--shadow-2); }
.thread .xref { font-size: 0.72rem; letter-spacing: 0.08em; text-transform: uppercase;
  color: var(--peach-dk); font-weight: 700; }
.thread h3 { margin: var(--s2) 0; }
.thread p { margin: 0; font-size: 0.92rem; }
.thread a.more { display: inline-block; margin-top: var(--s3); font-weight: 600; font-size: 0.86rem; }

/* ---------- domain grid (exec summary) ---------- */
.domgrid { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: var(--s5); }
.domgrid a.dom { display: block; background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--r-md); padding: var(--s5) var(--s6); box-shadow: var(--shadow-1);
  transition: transform var(--d-normal) var(--e-standard), box-shadow var(--d-normal); }
.domgrid a.dom:hover { transform: translateY(-3px); box-shadow: var(--shadow-2); text-decoration: none; }
.domgrid a.dom h3 { margin: 0 0 var(--s2); color: var(--accent); }
.domgrid a.dom .meta { font-size: 0.82rem; color: var(--ink-faint); }
.domgrid a.dom .arrow { color: var(--peach-dk); font-weight: 700; margin-top: var(--s3); font-size: 0.86rem; }

/* ---------- report banner ---------- */
.banner { background: var(--as-navy); color: var(--as-citrus); text-align: center;
  font-size: 0.8rem; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase;
  padding: var(--s2) var(--s4); border-bottom: 1px solid rgba(255,255,255,0.1); }

@media (max-width: 760px) {
  header.rep .meta { display: none; }
  header.rep .nav-toggle { display: inline-flex; }
  .msplit .name { font-size: 0.78rem; }
}
