/* Fundación Ascunce · prototype v0.2
   Concept: an endowment certificate. Ink-black and textured paper, engraved guilloche
   line-work in gold, Garamond display with tracked capitals. No logo mark: the name is the mark. */

:root {
  /* colour */
  --ink: #0B1322;            /* dark sections */
  --ink-2: #111C30;          /* raised on ink */
  --ink-line: rgba(233, 226, 210, .16);
  --paper: #E6E2D8;          /* light sections (textured, never flat) */
  --paper-2: #EFECE5;        /* raised on paper, inputs */
  --stone: #D6D0C2;          /* alternate light band */
  --text: #12161D;
  --text-2: #3A3E45;
  --muted: #6A655B;
  --on-ink: #E9E2D2;
  --on-ink-2: rgba(233, 226, 210, .72);
  --gold: #8E6E33;           /* gold for text on paper */
  --gold-line: #A88442;      /* gold for rules on paper */
  --gold-hi: #D4B676;        /* gold on ink */
  --line: rgba(18, 22, 29, .16);
  --err: #9E3B2E;

  /* type */
  --display: "Cormorant Garamond", "EB Garamond", Garamond, "Times New Roman", serif;
  --sans: "Barlow", "Helvetica Neue", Arial, sans-serif;

  /* texture: fine grain (dark specks for paper, light specks for ink) and paper fibre */
  --grain-dark: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='260' height='260'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='3' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 .07 0 0 0 0 .06 0 0 0 0 .04 .6 0 0 0 -.24'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  --grain-light: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='260' height='260'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='3' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 .92 0 0 0 0 .88 0 0 0 0 .8 .42 0 0 0 -.19'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  --fibre: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='1000' height='1000'%3E%3Cfilter id='f'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.004 .16' numOctaves='2' seed='7' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 .35 0 0 0 0 .3 0 0 0 0 .22 .32 0 0 0 -.15'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23f)'/%3E%3C/svg%3E");

  --gutter: clamp(16px, 4vw, 48px);
  --max: 1240px;
  color-scheme: light;
}

/* Language switching: show only the active language */
html[data-lang="es"] [data-l="en"],
html[data-lang="en"] [data-l="es"] { display: none !important; }

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background-color: var(--paper);
  background-image: var(--grain-dark), var(--fibre);
  color: var(--text);
  font-family: var(--sans);
  font-size: 17px;
  line-height: 1.62;
  -webkit-font-smoothing: antialiased;
  font-variant-numeric: lining-nums;
  overflow-x: hidden;
}
img, svg, canvas { display: block; max-width: 100%; }
a { color: inherit; }
button { font: inherit; color: inherit; cursor: pointer; }
:focus-visible { outline: 1.5px solid var(--gold-line); outline-offset: 4px; }

.container {
  width: 100%; max-width: var(--max); margin: 0 auto;
  padding-left: max(var(--gutter), env(safe-area-inset-left, 0px));
  padding-right: max(var(--gutter), env(safe-area-inset-right, 0px));
}

/* Surfaces */
.ink, .section-dark, .site-header, .site-footer, .cta-band {
  background-color: var(--ink);
  background-image: var(--grain-light), radial-gradient(70% 60% at 78% 20%, rgba(212, 182, 118, .07), transparent 70%);
  color: var(--on-ink);
}
.stone {
  background-color: var(--stone);
  background-image: var(--grain-dark), var(--fibre);
}

/* ---------- Type ---------- */
h1, h2, h3 { font-family: var(--display); font-weight: 500; color: inherit; margin: 0; letter-spacing: -0.005em; text-wrap: balance; }
h1 { font-size: clamp(2.9rem, 6.2vw, 5.6rem); line-height: .98; }
h2 { font-size: clamp(2.3rem, 4.6vw, 4rem); line-height: 1.02; }
h3 { font-size: clamp(1.45rem, 2.1vw, 1.8rem); line-height: 1.15; font-weight: 600; }
h1 em, h2 em { font-style: italic; font-weight: 500; }
em.accent, h1 em, h2 em { color: var(--gold); }
.ink em.accent, .ink h1 em, .ink h2 em, .section-dark h2 em, .cta-band h2 em { color: var(--gold-hi); }
.eyebrow, .kicker {
  font-family: var(--sans); font-size: .74rem; font-weight: 600; letter-spacing: .28em; text-transform: uppercase;
  color: var(--muted); display: flex; align-items: center; gap: 14px; margin: 0 0 1.6rem;
}
.eyebrow::before { content: ""; width: 34px; height: 1px; background: var(--gold-line); flex: none; }
.ink .eyebrow, .section-dark .eyebrow, .cta-band .eyebrow { color: var(--on-ink-2); }
.ink .eyebrow::before, .section-dark .eyebrow::before, .cta-band .eyebrow::before { background: var(--gold-hi); }
.lead { font-size: clamp(1.06rem, 1.45vw, 1.2rem); color: var(--text-2); max-width: 36em; }
.ink .lead, .section-dark .lead { color: var(--on-ink-2); }
p { margin: 0 0 1em; }
.mark { background: none; border-bottom: 1px solid var(--gold-hi); padding-bottom: 1px; }

/* ---------- Buttons: hairline, tracked capitals, long arrow ---------- */
.btn {
  display: inline-flex; align-items: center; gap: 14px; justify-content: center;
  padding: 1.05em 1.9em; border-radius: 999px; font-family: var(--sans); font-weight: 600; font-size: .76rem;
  letter-spacing: .22em; text-transform: uppercase; line-height: 1; text-decoration: none;
  border: 1px solid currentColor; background: transparent; transition: background .25s ease, color .25s ease, border-color .25s ease;
}
.btn .arrow { display: inline-block; width: 34px; height: 1px; background: currentColor; position: relative; font-size: 0; transition: width .25s ease; }
.btn .arrow::after { content: ""; position: absolute; right: 0; top: -3px; width: 7px; height: 7px; border-top: 1px solid currentColor; border-right: 1px solid currentColor; transform: rotate(45deg); }
.btn:hover .arrow { width: 46px; }
.btn-primary { background: var(--ink); color: var(--on-ink); border-color: var(--ink); }
.btn-primary:hover { background: transparent; color: var(--ink); }
.btn-ghost { color: var(--text); }
.btn-ghost:hover { background: var(--ink); color: var(--on-ink); border-color: var(--ink); }
.ink .btn-primary, .site-header .btn-primary, .cta-band .btn-primary { background: var(--gold-hi); color: var(--ink); border-color: var(--gold-hi); }
.ink .btn-primary:hover, .site-header .btn-primary:hover, .cta-band .btn-primary:hover { background: transparent; color: var(--gold-hi); }
.ink .btn-ghost { color: var(--on-ink); }
.ink .btn-ghost:hover { background: var(--on-ink); color: var(--ink); border-color: var(--on-ink); }

/* ---------- Header ---------- */
body::before { content: ""; position: fixed; inset: 0 0 auto; height: env(safe-area-inset-top, 0px); z-index: 60; background: var(--ink); }
.site-header { position: sticky; top: env(safe-area-inset-top, 0px); z-index: 50; border-bottom: 1px solid var(--ink-line); }
.nav { display: flex; align-items: center; justify-content: space-between; height: 74px; gap: 24px; }
.wordmark { display: inline-flex; align-items: baseline; gap: 12px; text-decoration: none; color: var(--on-ink); white-space: nowrap; }
.wordmark .wm-pre { font-family: var(--sans); font-size: .64rem; font-weight: 600; letter-spacing: .32em; text-transform: uppercase; color: var(--on-ink-2); }
.wordmark .wm-name { font-family: var(--display); font-size: 1.6rem; font-weight: 600; letter-spacing: .24em; text-transform: uppercase; line-height: 1; margin-right: -.24em; }
.nav-links { display: flex; align-items: center; gap: 30px; list-style: none; margin: 0; padding: 0; }
.nav-links a { text-decoration: none; font-size: .72rem; font-weight: 500; letter-spacing: .22em; text-transform: uppercase; color: var(--on-ink-2); position: relative; padding: 6px 0; transition: color .2s ease; }
.nav-links a::after { content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 1px; background: var(--gold-hi); transform: scaleX(0); transform-origin: left; transition: transform .3s ease; }
.nav-links a:hover, .nav-links a.active { color: var(--on-ink); }
.nav-links a:hover::after, .nav-links a.active::after { transform: scaleX(1); }
.nav-right { display: flex; align-items: center; gap: 18px; }
.lang { display: inline-flex; align-items: center; gap: 2px; }
.lang button { border: 0; background: transparent; padding: 6px 7px; font-size: .72rem; font-weight: 600; letter-spacing: .18em; color: var(--on-ink-2); border-bottom: 1px solid transparent; }
.lang button[aria-pressed="true"] { color: var(--gold-hi); border-bottom-color: var(--gold-hi); }
.nav .btn { padding: .9em 1.4em; font-size: .7rem; }
.nav-links .menu-only { display: none; }
.menu-toggle { display: none; border: 0; background: transparent; width: 44px; height: 44px; align-items: center; justify-content: center; }
.menu-toggle span { display: block; width: 24px; height: 1px; background: var(--on-ink); position: relative; transition: background .2s; }
.menu-toggle span::before, .menu-toggle span::after { content: ""; position: absolute; left: 0; width: 24px; height: 1px; background: var(--on-ink); transition: transform .25s ease; }
.menu-toggle span::before { top: -7px; } .menu-toggle span::after { top: 7px; }
body.menu-open .menu-toggle span { background: transparent; }
body.menu-open .menu-toggle span::before { transform: translateY(7px) rotate(45deg); }
body.menu-open .menu-toggle span::after { transform: translateY(-7px) rotate(-45deg); }

/* ---------- Sections ---------- */
.section { padding-block: clamp(84px, 11vw, 150px); position: relative; }
.section-head { max-width: 780px; margin-bottom: clamp(44px, 6vw, 76px); }
.section-head h2 { margin-bottom: 1.2rem; }

/* Engraved band (drawn by script) */
.band { display: block; width: 100%; height: 34px; }
.band-wrap { padding-block: 0; }

/* ---------- Hero ---------- */
.hero { padding-block: clamp(48px, 7vw, 96px) 0; position: relative; overflow: hidden; }
.hero-grid { display: grid; grid-template-columns: 1.1fr .9fr; gap: clamp(28px, 5vw, 80px); align-items: center; }
.hero h1 { margin-bottom: 1.7rem; }
.hero h1 em { font-weight: 500; }
.hero .lead { margin-bottom: 2.4rem; }
.hero-ctas { display: flex; flex-wrap: wrap; gap: 14px; }
.kicker { color: var(--on-ink-2); }
.status-dot { width: 6px; height: 6px; border-radius: 50%; background: var(--gold-hi); flex: none; }

.seal { position: relative; margin: 0; width: 100%; max-width: 540px; aspect-ratio: 1; justify-self: center; }
.seal canvas { position: absolute; inset: 0; width: 100%; height: 100%; }
.seal .spin { animation: spin 320s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.seal-center {
  position: absolute; inset: 27%; border-radius: 50%; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center;
  background: radial-gradient(circle, var(--ink) 58%, rgba(11, 19, 34, 0) 72%);
}
.seal-label { font-size: .62rem; letter-spacing: .26em; text-transform: uppercase; color: var(--on-ink-2); font-weight: 600; margin-bottom: 10px; max-width: 14em; line-height: 1.5; }
.seal-from { font-size: .82rem; color: var(--on-ink-2); }
.seal-value { font-family: var(--display); font-weight: 500; font-size: clamp(2.2rem, 4.4vw, 3.4rem); line-height: 1.05; color: var(--on-ink); font-variant-numeric: lining-nums tabular-nums; margin: 4px 0 2px; }
.seal-to { font-size: .82rem; color: var(--gold-hi); letter-spacing: .04em; }

.hero-facts { display: grid; grid-template-columns: repeat(3, 1fr); margin: clamp(40px, 6vw, 72px) 0 0; border-top: 1px solid var(--ink-line); }
.hero-facts > div { padding: 22px 24px 24px 0; display: flex; align-items: baseline; gap: 14px; }
.hero-facts > div + div { padding-left: 24px; border-left: 1px solid var(--ink-line); }
.hero-facts dt { font-family: var(--display); font-size: 1.7rem; font-weight: 500; color: var(--on-ink); line-height: 1; }
.hero-facts dd { margin: 0; font-size: .9rem; color: var(--on-ink-2); line-height: 1.35; }
.hero-note { font-size: .74rem; color: rgba(233, 226, 210, .45); margin: 0; padding-bottom: 26px; }
.hero .band { margin-top: 0; opacity: .9; }

/* ---------- Precedents ---------- */
.precedents { padding-block: 34px 36px; border-bottom: 1px solid var(--line); }
.precedents-row { display: flex; align-items: baseline; gap: 6px clamp(18px, 3vw, 44px); flex-wrap: wrap; }
.precedents-label { flex: 0 0 100%; font-size: .7rem; letter-spacing: .28em; text-transform: uppercase; font-weight: 600; color: var(--muted); margin-bottom: 6px; }
.precedent { border: 0; background: transparent; padding: 4px 0; font-family: var(--display); font-size: clamp(1.15rem, 1.8vw, 1.45rem); font-weight: 500; color: var(--text-2); opacity: .6; border-bottom: 1px solid transparent; transition: opacity .2s, border-color .2s; }
.precedent:hover, .precedent[aria-expanded="true"] { opacity: 1; color: var(--text); border-bottom-color: var(--gold-line); }
.precedent-caption { margin: 16px 0 0; font-size: .96rem; color: var(--text-2); min-height: 1.6em; max-width: 62em; }
.precedent-caption b { color: var(--text); font-weight: 600; }

/* ---------- Problem ---------- */
.problem-grid { display: grid; grid-template-columns: .9fr 1.1fr; gap: clamp(32px, 6vw, 96px); align-items: start; }
.problem-grid h2 { font-size: clamp(2.4rem, 5vw, 4.3rem); }
.problem-grid .lead { margin-top: 1.5rem; }
.stat { padding: 26px 0 24px; border-top: 1px solid var(--line); display: grid; gap: 8px; }
.stat:last-child { border-bottom: 1px solid var(--line); }
.stat-num { font-family: var(--display); font-weight: 500; font-size: clamp(2.8rem, 5vw, 4.4rem); line-height: .95; color: var(--text); white-space: nowrap; font-variant-numeric: lining-nums; }
.stat-num .unit { font-size: .45em; margin-left: .12em; color: var(--gold); }
.stat p { margin: 0; font-size: 1rem; color: var(--text-2); max-width: 32em; }
sup.ref a { text-decoration: none; font-size: .72em; font-weight: 700; color: var(--gold); padding: 0 1px; }

/* ---------- Model ---------- */
.split-visual { display: grid; gap: 16px; margin-bottom: clamp(52px, 7vw, 84px); }
.split-bar { display: flex; height: 78px; border: 1px solid var(--text); }
.split-bar > div { display: flex; flex-direction: column; justify-content: center; padding: 0 22px; min-width: 0; }
.split-bar .seg-grant { background: var(--ink); color: var(--on-ink); flex: 2000 1 0; }
.split-bar .seg-edu { background: transparent; color: var(--text); flex: 1950 1 0; background-image: repeating-linear-gradient(135deg, transparent 0 7px, rgba(168, 132, 66, .22) 7px 8px); }
.split-bar b { font-family: var(--display); font-weight: 600; font-size: 1.3rem; line-height: 1.1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.split-bar span { font-size: .78rem; letter-spacing: .04em; opacity: .85; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.split-caption { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; }
.split-caption div { font-size: .95rem; color: var(--text-2); }
.split-caption strong { color: var(--text); font-weight: 600; }

.stepper { display: grid; grid-template-columns: 330px 1fr; gap: clamp(24px, 4vw, 64px); align-items: start; }
.step-tabs { display: grid; border-top: 1px solid var(--line); }
.step-tab { text-align: left; border: 0; border-bottom: 1px solid var(--line); background: transparent; padding: 20px 6px; display: grid; grid-template-columns: 46px 1fr; gap: 4px 10px; align-items: baseline; transition: background .25s ease; }
.step-tab .n { font-family: var(--display); font-size: 1.1rem; color: var(--muted); font-variant-numeric: lining-nums; }
.step-tab .t { font-family: var(--display); font-size: 1.65rem; font-weight: 500; color: var(--text-2); line-height: 1.1; }
.step-tab .s { grid-column: 2; font-size: .88rem; color: var(--muted); line-height: 1.4; }
.step-tab:hover .t { color: var(--text); }
.step-tab[aria-selected="true"] .n { color: var(--gold); }
.step-tab[aria-selected="true"] .t { color: var(--text); font-style: italic; }
.step-panel { border: 1px solid var(--line); background: rgba(239, 236, 229, .55); padding: clamp(24px, 4vw, 48px); min-height: 450px; display: grid; grid-template-rows: auto 1fr; gap: 26px; }
.step-panel h3 { font-size: clamp(1.8rem, 2.8vw, 2.4rem); font-weight: 500; margin-bottom: .8rem; }
.step-panel p { color: var(--text-2); max-width: 36em; }
.step-panel .panel-visual { align-self: end; }
.step-panel.enter { animation: panelIn .45s ease; }
@keyframes panelIn { from { opacity: .4; transform: translateY(8px); } to { opacity: 1; transform: none; } }
.tick-list { list-style: none; padding: 0; margin: 0; display: grid; border-top: 1px solid var(--line); }
.tick-list li { padding: 13px 0 13px 30px; position: relative; color: var(--text-2); font-size: .98rem; border-bottom: 1px solid var(--line); }
.tick-list li::before { content: ""; position: absolute; left: 2px; top: 1.45em; width: 14px; height: 1px; background: var(--gold-line); }

.glide { display: grid; grid-template-columns: repeat(13, 1fr); gap: 5px; align-items: end; height: 150px; }
.glide .bar { display: flex; flex-direction: column; height: 100%; }
.glide .eq { background: var(--ink); }
.glide .bd { background: repeating-linear-gradient(135deg, transparent 0 4px, rgba(168, 132, 66, .45) 4px 5px); border: 1px solid rgba(168, 132, 66, .5); border-bottom: 0; }
.glide-axis { display: flex; justify-content: space-between; font-size: .76rem; color: var(--muted); margin-top: 10px; letter-spacing: .04em; }
.legend { display: flex; flex-wrap: wrap; gap: 8px 20px; font-size: .8rem; color: var(--muted); margin-top: 12px; }
.legend i { display: inline-block; width: 12px; height: 12px; margin-right: 7px; vertical-align: -1px; }
.legend i.l-ink { background: var(--ink); }
.legend i.l-hatch { background: repeating-linear-gradient(135deg, transparent 0 3px, rgba(168, 132, 66, .6) 3px 4px); border: 1px solid rgba(168, 132, 66, .6); }

.years { display: grid; grid-template-columns: repeat(14, 1fr); gap: 3px; }
.years span { height: 46px; display: flex; align-items: flex-end; justify-content: center; font-size: .72rem; color: var(--text-2); padding-bottom: 5px; border: 1px solid rgba(168, 132, 66, .5); background: repeating-linear-gradient(135deg, transparent 0 5px, rgba(168, 132, 66, .2) 5px 6px); font-variant-numeric: tabular-nums; }
.years span.end { background: var(--ink); color: var(--gold-hi); border-color: var(--ink); font-weight: 600; }

.paths { display: grid; grid-template-columns: repeat(3, 1fr); border-top: 1px solid var(--line); }
.paths div { padding: 18px 16px 4px 0; }
.paths div + div { padding-left: 16px; border-left: 1px solid var(--line); }
.paths svg { width: 26px; height: 26px; margin-bottom: 12px; color: var(--gold); }
.paths b { display: block; font-family: var(--display); font-weight: 600; font-size: 1.3rem; }
.paths small { color: var(--muted); font-size: .84rem; line-height: 1.4; display: block; margin-top: 2px; }

/* ---------- Calculator (ink) ---------- */
.calc { display: grid; grid-template-columns: 400px 1fr; gap: 0; border: 1px solid var(--ink-line); }
.calc-panel { padding: clamp(22px, 3vw, 34px); border-right: 1px solid var(--ink-line); }
.calc-label { font-size: .68rem; letter-spacing: .26em; text-transform: uppercase; font-weight: 600; color: var(--on-ink-2); display: block; margin-bottom: 12px; }
.amount-wrap { display: flex; align-items: baseline; gap: 8px; border-bottom: 1px solid var(--ink-line); padding-bottom: 6px; margin-bottom: 22px; }
.amount-wrap:focus-within { border-bottom-color: var(--gold-hi); }
#amount { width: 100%; min-width: 0; background: transparent; border: 0; color: var(--on-ink); font-family: var(--display); font-weight: 500; font-size: clamp(2.6rem, 4.2vw, 3.4rem); line-height: 1.05; padding: 0; outline: none; font-variant-numeric: lining-nums tabular-nums; }
.amount-wrap .cur { font-family: var(--display); font-size: 2.2rem; color: var(--gold-hi); }
input[type="range"] { -webkit-appearance: none; appearance: none; width: 100%; height: 2px; background: linear-gradient(to right, var(--gold-hi) var(--p, 50%), rgba(233, 226, 210, .2) var(--p, 50%)); outline: none; margin: 10px 0 10px; }
input[type="range"]::-webkit-slider-thumb { -webkit-appearance: none; width: 20px; height: 20px; border-radius: 50%; background: var(--ink); border: 1.5px solid var(--gold-hi); cursor: grab; box-shadow: 0 0 0 5px rgba(212, 182, 118, .12); }
input[type="range"]::-moz-range-thumb { width: 18px; height: 18px; border-radius: 50%; background: var(--ink); border: 1.5px solid var(--gold-hi); cursor: grab; }
.range-scale { display: flex; justify-content: space-between; font-size: .74rem; color: rgba(233, 226, 210, .5); margin-bottom: 20px; font-variant-numeric: tabular-nums; }
.presets { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 28px; }
.chip { border: 1px solid var(--ink-line); background: transparent; color: var(--on-ink-2); border-radius: 999px; padding: 8px 13px; font-size: .8rem; font-weight: 500; transition: all .2s ease; font-variant-numeric: tabular-nums; }
.chip:hover { border-color: rgba(212, 182, 118, .6); color: var(--on-ink); }
.chip.on { border-color: var(--gold-hi); color: var(--gold-hi); }
.seg { display: grid; grid-template-columns: repeat(3, 1fr); border: 1px solid var(--ink-line); margin-bottom: 10px; }
.seg button { border: 0; background: transparent; color: var(--on-ink-2); padding: 11px 6px; font-size: .78rem; font-weight: 600; letter-spacing: .12em; text-transform: uppercase; line-height: 1.2; }
.seg button + button { border-left: 1px solid var(--ink-line); }
.seg button small { display: block; font-weight: 500; font-size: .78rem; letter-spacing: 0; text-transform: none; opacity: .8; margin-top: 3px; }
.seg button[aria-checked="true"] { background: var(--gold-hi); color: var(--ink); }
.seg-note { font-size: .76rem; color: rgba(233, 226, 210, .5); margin: 0 0 24px; }
.mini-split { display: flex; height: 6px; background: rgba(233, 226, 210, .1); margin: 12px 0 12px; }
.mini-split div { transition: flex-grow .5s ease; }
.mini-split .g { background: var(--on-ink); }
.mini-split .e { background: var(--gold-hi); }
.mini-split .r { background: rgba(233, 226, 210, .2); }
.mini-legend { display: grid; gap: 7px; font-size: .86rem; color: var(--on-ink-2); }
.mini-legend div { display: flex; justify-content: space-between; gap: 10px; }
.mini-legend i { display: inline-block; width: 9px; height: 9px; margin-right: 9px; }
.mini-legend b { font-weight: 600; color: var(--on-ink); font-variant-numeric: tabular-nums; white-space: nowrap; }

.calc-results { display: grid; grid-template-rows: auto 1fr; min-width: 0; }
.kpis { display: grid; grid-template-columns: repeat(4, 1fr); border-bottom: 1px solid var(--ink-line); }
.kpi { padding: 22px 20px 20px; min-width: 0; }
.kpi + .kpi { border-left: 1px solid var(--ink-line); }
.kpi .k-label { font-size: .66rem; letter-spacing: .2em; text-transform: uppercase; color: var(--on-ink-2); font-weight: 600; line-height: 1.45; min-height: 2.9em; }
.kpi .k-val { font-family: var(--display); font-weight: 500; font-size: clamp(1.8rem, 2.6vw, 2.5rem); line-height: 1.05; margin: 10px 0 6px; font-variant-numeric: lining-nums tabular-nums; white-space: nowrap; }
.kpi .k-sub { font-size: .8rem; color: rgba(233, 226, 210, .58); line-height: 1.4; }
.kpi.hi .k-val { color: var(--gold-hi); }
.chart-card { padding: 22px 22px 14px; position: relative; min-width: 0; }
.chart-head { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; flex-wrap: wrap; margin-bottom: 6px; }
.chart-head h3 { font-size: 1.25rem; }
.chart-legend { display: flex; gap: 16px; font-size: .76rem; color: var(--on-ink-2); flex-wrap: wrap; }
.chart-legend i { display: inline-block; width: 18px; height: 1.5px; vertical-align: middle; margin-right: 7px; }
#calcChart { width: 100%; height: auto; touch-action: pan-y; }
.chart-tip { position: absolute; pointer-events: none; background: var(--paper-2); color: var(--text); padding: 8px 12px; font-size: .78rem; line-height: 1.35; border: 1px solid var(--gold-line); transform: translate(-50%, -112%); opacity: 0; transition: opacity .15s ease; white-space: nowrap; }
.chart-tip b { font-family: var(--display); font-size: 1.1rem; font-weight: 600; }
.fineprint { font-size: .8rem; color: rgba(233, 226, 210, .55); max-width: 72em; margin: 24px 0 0; line-height: 1.6; }
.fineprint sup.ref a, .ink sup.ref a { color: var(--gold-hi); }

/* ---------- Principles ---------- */
.cards { display: grid; grid-template-columns: repeat(4, 1fr); border-top: 1px solid var(--text); border-bottom: 1px solid var(--line); }
.card { padding: 30px 26px 36px 0; }
.card + .card { padding-left: 26px; border-left: 1px solid var(--line); }
.card .num { font-family: var(--sans); font-size: .7rem; font-weight: 600; letter-spacing: .28em; text-transform: uppercase; color: var(--gold); margin-bottom: 26px; }
.card h3 { margin-bottom: .8rem; font-size: 1.6rem; font-weight: 500; }
.card p { color: var(--text-2); font-size: .97rem; margin: 0; }

.numbers { display: grid; grid-template-columns: repeat(4, 1fr); margin-top: clamp(64px, 9vw, 110px); }
.numbers div { padding: 0 24px 0 0; }
.numbers div + div { padding-left: 24px; border-left: 1px solid var(--line); }
.numbers b { display: block; font-family: var(--display); font-weight: 500; font-size: clamp(3rem, 5.4vw, 4.8rem); line-height: 1; margin-bottom: 12px; font-variant-numeric: lining-nums tabular-nums; }
.numbers div > span { font-size: .92rem; color: var(--text-2); }

/* ---------- Kenya ---------- */
.kenya-grid { display: grid; grid-template-columns: 1fr 1fr; gap: clamp(32px, 6vw, 96px); align-items: start; }
.big-word { font-family: var(--display); font-style: italic; font-weight: 500; font-size: clamp(5rem, 14vw, 12rem); line-height: .82; color: transparent; -webkit-text-stroke: 1.2px var(--text); margin: 0 0 30px; letter-spacing: -.01em; }
.big-word em { color: var(--gold-line); -webkit-text-stroke: 0; }
.reasons { display: grid; margin-top: 34px; border-top: 1px solid var(--line); }
.reasons div { padding: 16px 0; border-bottom: 1px solid var(--line); display: grid; grid-template-columns: 30px 1fr; gap: 10px; color: var(--text-2); }
.reasons div span:first-child { width: 14px; height: 1px; background: var(--gold-line); margin-top: 13px; font-size: 0; }
.phases { display: grid; border-top: 1px solid var(--text); }
.phase { padding: 28px 0 30px; border-bottom: 1px solid var(--line); }
.phase .tag { display: block; font-size: .7rem; letter-spacing: .26em; text-transform: uppercase; font-weight: 600; color: var(--muted); margin-bottom: 10px; }
.phase.current .tag { color: var(--gold); }
.phase h3 { margin-bottom: .5rem; }
.phase p { color: var(--text-2); margin: 0; font-size: .98rem; max-width: 34em; }

/* ---------- Progress ---------- */
.progress-wrap { display: grid; grid-template-columns: .8fr 1.2fr; gap: clamp(32px, 6vw, 96px); align-items: start; }
.timeline { list-style: none; margin: 0; padding: 0; position: relative; }
.timeline::before { content: ""; position: absolute; left: 7px; top: 10px; bottom: 10px; width: 1px; background: var(--line); }
.timeline li { position: relative; padding: 0 0 32px 40px; }
.timeline li:last-child { padding-bottom: 0; }
.timeline .dot { position: absolute; left: 0; top: 6px; width: 15px; height: 15px; border-radius: 50%; border: 1px solid var(--muted); background: var(--stone); }
.timeline .done .dot { background: var(--ink); border-color: var(--ink); }
.timeline .now .dot { border-color: var(--gold-line); background: radial-gradient(circle, var(--gold-line) 0 3.5px, var(--stone) 4px); }
.timeline .st { font-size: .66rem; letter-spacing: .26em; text-transform: uppercase; font-weight: 600; color: var(--muted); display: block; margin-bottom: 3px; }
.timeline .now .st { color: var(--gold); }
.timeline h3 { font-size: 1.5rem; font-weight: 500; margin-bottom: 4px; }
.timeline p { margin: 0; color: var(--text-2); font-size: .96rem; }
.honest { border-top: 1px solid var(--text); border-bottom: 1px solid var(--line); padding: 20px 0; margin-top: 32px; color: var(--text-2); font-size: 1rem; }
.honest strong { color: var(--text); }

/* ---------- About ---------- */
.about-grid { display: grid; grid-template-columns: 1fr 1fr; border: 1px solid var(--line); }
.about-card { padding: clamp(26px, 4vw, 48px); }
.about-card.dark { background-color: var(--ink); background-image: var(--grain-light); color: var(--on-ink); }
.about-card .avatar { display: none; }
.about-card h3 { margin-bottom: .3rem; font-size: 2rem; font-weight: 500; }
.about-card .role { color: var(--muted); font-size: .7rem; letter-spacing: .26em; text-transform: uppercase; font-weight: 600; margin-bottom: 1.4rem; display: block; }
.about-card p { color: var(--text-2); }
.about-card.dark p, .about-card.dark li { color: var(--on-ink-2); }
.gov-list { list-style: none; padding: 0; margin: 20px 0 0; display: grid; }
.gov-list li { padding: 14px 0; border-top: 1px solid var(--ink-line); display: grid; grid-template-columns: 28px 1fr; gap: 6px; font-size: .97rem; }
.gov-list li::before { content: ""; width: 14px; height: 1px; background: var(--gold-hi); margin-top: .8em; }

/* ---------- CTA band (ink with faint seal) ---------- */
.cta-band { padding-block: clamp(84px, 10vw, 140px); position: relative; overflow: hidden; }
.cta-band .container { position: relative; z-index: 1; }
.cta-seal { position: absolute; right: -8%; top: 50%; width: min(70vw, 760px); aspect-ratio: 1; transform: translateY(-50%); opacity: .5; pointer-events: none; }
.cta-seal canvas { width: 100%; height: 100%; }
.cta-band h2 { font-size: clamp(2.4rem, 5vw, 4.4rem); max-width: 14em; margin-bottom: 1.3rem; }
.cta-band p { font-size: 1.12rem; max-width: 34em; color: var(--on-ink-2); margin-bottom: 2rem; }
.who-row { display: flex; flex-wrap: wrap; gap: 0; margin-bottom: 2.4rem; border-top: 1px solid var(--ink-line); border-bottom: 1px solid var(--ink-line); max-width: 52rem; }
.who-row span { padding: 12px 18px 12px 0; font-size: .74rem; letter-spacing: .2em; text-transform: uppercase; font-weight: 600; color: var(--on-ink); }
.who-row span + span { padding-left: 18px; border-left: 1px solid var(--ink-line); }

/* ---------- Form ---------- */
.contact-grid { display: grid; grid-template-columns: .8fr 1.2fr; gap: clamp(32px, 6vw, 96px); align-items: start; }
.contact-aside p { color: var(--text-2); }
.contact-steps { list-style: none; padding: 0; margin: 30px 0 0; display: grid; counter-reset: s; border-top: 1px solid var(--line); }
.contact-steps li { counter-increment: s; display: grid; grid-template-columns: 38px 1fr; gap: 10px; color: var(--text-2); font-size: .97rem; padding: 13px 0; border-bottom: 1px solid var(--line); }
.contact-steps li::before { content: counter(s, upper-roman); font-family: var(--display); color: var(--gold); font-size: 1.1rem; font-weight: 600; }
form.contact { border-top: 1px solid var(--text); padding-top: 18px; display: grid; grid-template-columns: 1fr 1fr; gap: 26px 28px; }
.field { display: grid; gap: 4px; min-width: 0; }
.field.full { grid-column: 1 / -1; }
.field label, .field legend { font-size: .66rem; letter-spacing: .24em; text-transform: uppercase; font-weight: 600; color: var(--muted); padding: 0; }
.field input, .field textarea {
  width: 100%; font: inherit; font-size: 1.05rem; color: var(--text); background: transparent; border: 0; border-bottom: 1px solid var(--text-2); border-radius: 0; padding: 10px 0 9px; transition: border-color .2s ease;
}
.field textarea { min-height: 120px; resize: vertical; line-height: 1.5; }
.field input:focus, .field textarea:focus { outline: none; border-bottom-color: var(--gold-line); box-shadow: 0 1px 0 0 var(--gold-line); }
.field.invalid input, .field.invalid textarea { border-bottom-color: var(--err); }
.err { font-size: .78rem; color: var(--err); display: none; }
.field.invalid .err { display: block; }
fieldset.field { border: 0; margin: 0; padding: 0; }
.radio-chips { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 8px; }
.radio-chips label { cursor: pointer; font-size: inherit; letter-spacing: 0; text-transform: none; font-weight: 400; color: inherit; }
.radio-chips input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.radio-chips input + span { display: inline-block; border: 1px solid var(--line); border-radius: 999px; padding: 9px 15px; font-size: .86rem; color: var(--text-2); transition: all .2s ease; }
.radio-chips input:checked + span { background: var(--ink); border-color: var(--ink); color: var(--on-ink); }
.radio-chips input:focus-visible + span { outline: 1.5px solid var(--gold-line); outline-offset: 3px; }
.consent { grid-column: 1 / -1; display: grid; grid-template-columns: 22px 1fr; gap: 10px; font-size: .84rem; color: var(--muted); align-items: start; }
.consent input { width: 20px; height: 20px; margin: 1px 0 0; accent-color: var(--ink); }
.consent.invalid { color: var(--err); }
.form-foot { grid-column: 1 / -1; display: flex; flex-wrap: wrap; gap: 14px; align-items: center; justify-content: space-between; }
.form-foot small { color: var(--muted); font-size: .8rem; }
.form-error { color: var(--err) !important; font-weight: 600; flex-basis: 100%; }
.form-success { grid-column: 1 / -1; display: none; text-align: left; padding: 30px 0 10px; }
.form-success .ok { width: 46px; height: 46px; border-radius: 50%; border: 1px solid var(--gold-line); display: flex; align-items: center; justify-content: center; margin: 0 0 20px; }
.form-success h3 { margin-bottom: .6rem; font-size: 2rem; font-weight: 500; }
.form-success p { color: var(--text-2); max-width: 34em; margin: 0; }
.form-success strong { color: var(--text); user-select: all; word-break: break-all; }
.proto-mail { margin-top: 22px !important; }
form.contact.sent > *:not(.form-success) { display: none; }
form.contact.sent .form-success { display: block; }

/* ---------- FAQ ---------- */
.faq-grid { display: grid; grid-template-columns: .7fr 1.3fr; gap: clamp(32px, 6vw, 96px); align-items: start; }
.faq { border-top: 1px solid var(--text); }
.faq details { border-bottom: 1px solid var(--line); }
.faq summary { list-style: none; cursor: pointer; padding: 22px 48px 22px 0; font-family: var(--display); font-size: clamp(1.25rem, 1.9vw, 1.55rem); font-weight: 500; position: relative; line-height: 1.25; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::before, .faq summary::after { content: ""; position: absolute; right: 8px; top: 50%; width: 15px; height: 1px; background: var(--text); transition: transform .3s ease; }
.faq summary::after { transform: rotate(90deg); }
.faq details[open] summary::after { transform: rotate(0deg); }
.faq .ans { padding: 0 48px 24px 0; color: var(--text-2); }
.faq .ans p:last-child { margin: 0; }

/* ---------- Footer ---------- */
.site-footer { padding-block: 0 36px; font-size: .92rem; color: var(--on-ink-2); }
.site-footer .band { margin-bottom: 64px; opacity: .8; }
.foot-grid { display: grid; grid-template-columns: 1.3fr 1fr 1fr; gap: 40px; padding-bottom: 44px; border-bottom: 1px solid var(--ink-line); }
.site-footer h4 { font-size: .66rem; letter-spacing: .26em; text-transform: uppercase; color: rgba(233, 226, 210, .5); margin: 0 0 16px; font-weight: 600; }
.site-footer ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 9px; }
.site-footer a { text-decoration: none; color: var(--on-ink); }
.site-footer a:hover { color: var(--gold-hi); }
.sources { padding-block: 28px; border-bottom: 1px solid var(--ink-line); }
.sources ol { margin: 0; padding-left: 1.3em; display: grid; gap: 6px; font-size: .8rem; color: rgba(233, 226, 210, .6); }
.sources a { color: var(--on-ink-2); word-break: break-word; }
.foot-bottom { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 12px; padding-top: 24px; font-size: .8rem; color: rgba(233, 226, 210, .5); }
.proto-badge { display: inline-flex; align-items: center; border: 1px solid rgba(212, 182, 118, .5); color: var(--gold-hi); border-radius: 999px; padding: 4px 12px; font-size: .68rem; font-weight: 600; letter-spacing: .14em; text-transform: uppercase; }

/* Reveal on scroll (only when JS is running) */
.js .reveal { opacity: 0; transform: translateY(22px); transition: opacity .9s ease, transform .9s cubic-bezier(.2, .7, .2, 1); }
.js .reveal.in { opacity: 1; transform: none; }
.js .reveal.d1 { transition-delay: .08s; } .js .reveal.d2 { transition-delay: .16s; } .js .reveal.d3 { transition-delay: .24s; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .js .reveal { opacity: 1; transform: none; transition: none; }
  .seal .spin { animation: none; }
}

/* ---------- Responsive ---------- */
@media (max-width: 1080px) {
  .calc { grid-template-columns: 1fr; }
  .calc-panel { border-right: 0; border-bottom: 1px solid var(--ink-line); }
  .kpis { grid-template-columns: repeat(2, 1fr); }
  .kpi:nth-child(3) { border-left: 0; }
  .kpi:nth-child(-n+2) { border-bottom: 1px solid var(--ink-line); }
  .cards { grid-template-columns: repeat(2, 1fr); }
  .card:nth-child(3) { padding-left: 0; border-left: 0; }
  .card:nth-child(-n+2) { border-bottom: 1px solid var(--line); }
  .stepper { grid-template-columns: 1fr; }
  .step-tabs { grid-template-columns: repeat(4, 1fr); border-top: 1px solid var(--line); }
  .step-tab { grid-template-columns: 1fr; padding: 14px 4px; }
  .step-tab .s { display: none; }
  .step-tab .t { font-size: 1.3rem; }
}
@media (max-width: 900px) {
  .nav-links, .nav-right .btn { display: none; }
  .menu-toggle { display: inline-flex; }
  /* absolute (not fixed): the sticky header is the containing block */
  body.menu-open .nav-links {
    display: flex; flex-direction: column; align-items: flex-start; gap: 0; position: absolute; top: 100%; left: 0; right: 0;
    height: calc(100vh - 74px); height: calc(100dvh - 74px);
    background-color: var(--ink); background-image: var(--grain-light);
    padding: 20px max(var(--gutter), env(safe-area-inset-left, 0px)); overflow-y: auto; border-top: 1px solid var(--ink-line);
  }
  body.menu-open .nav-links li { width: 100%; border-bottom: 1px solid var(--ink-line); }
  body.menu-open .nav-links a { display: block; padding: 18px 0; font-family: var(--display); font-size: 1.9rem; letter-spacing: 0; text-transform: none; color: var(--on-ink); }
  body.menu-open .nav-links a::after { display: none; }
  body.menu-open .nav-links .menu-only { display: block; }
  body.menu-open .nav-links .menu-only a { color: var(--gold-hi); }
  body.menu-open { overflow: hidden; }
  .hero-grid, .problem-grid, .kenya-grid, .progress-wrap, .contact-grid, .faq-grid, .about-grid { grid-template-columns: 1fr; }
  .seal { max-width: 440px; }
  .foot-grid { grid-template-columns: 1fr 1fr; }
  .foot-grid > :first-child { grid-column: 1 / -1; }
  .numbers { grid-template-columns: repeat(2, 1fr); row-gap: 36px; }
  .numbers div:nth-child(3) { padding-left: 0; border-left: 0; }
}
@media (max-width: 620px) {
  body { font-size: 16px; }
  .nav { height: 64px; }
  body.menu-open .nav-links { height: calc(100vh - 64px); height: calc(100dvh - 64px); }
  .wordmark { gap: 9px; }
  .wordmark .wm-pre { font-size: .56rem; letter-spacing: .26em; }
  .wordmark .wm-name { font-size: 1.3rem; letter-spacing: .18em; }
  .hero-facts { grid-template-columns: 1fr; }
  .hero-facts > div { padding: 16px 0; }
  .hero-facts > div + div { padding-left: 0; border-left: 0; border-top: 1px solid var(--ink-line); }
  .seal-label { font-size: .54rem; }
  .split-bar { height: 70px; }
  .split-bar > div { padding: 0 12px; }
  .split-bar b { font-size: 1.1rem; }
  .split-caption { grid-template-columns: 1fr; gap: 10px; }
  .step-tabs { grid-template-columns: repeat(2, 1fr); }
  .paths { grid-template-columns: 1fr; }
  .paths div + div { padding-left: 0; border-left: 0; border-top: 1px solid var(--line); }
  .glide { height: 110px; gap: 3px; }
  .years span { font-size: .6rem; height: 36px; }
  .kpi { padding: 16px 14px; }
  .kpi .k-val { font-size: 1.6rem; }
  .cards { grid-template-columns: 1fr; }
  .card, .card + .card { padding: 24px 0 26px; border-left: 0; border-bottom: 1px solid var(--line); }
  .numbers div, .numbers div + div { padding: 0 12px; }
  .numbers div:nth-child(odd) { padding-left: 0; border-left: 0; }
  form.contact { grid-template-columns: 1fr; }
  .foot-grid { grid-template-columns: 1fr; }
  .chart-card { padding: 16px 10px 10px; }
  .who-row span, .who-row span + span { padding: 10px 14px 10px 0; border-left: 0; }
  .cta-seal { width: 120vw; right: -50%; opacity: .3; }
}

/* =====================================================================
   v0.3 · pages, contents, impact, governance diagram, founder
   ===================================================================== */

/* Pages: one visible at a time */
.page.enter { animation: pageIn .55s ease; }
@keyframes pageIn { from { opacity: .2; transform: translateY(10px); } to { opacity: 1; transform: none; } }

/* Contents (home) */
.index-grid { display: grid; grid-template-columns: .8fr 1.2fr; gap: clamp(32px, 6vw, 96px); align-items: start; }
.toc { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--text); }
.toc a { display: flex; align-items: baseline; gap: 16px; padding: 18px 4px; border-bottom: 1px solid var(--line); text-decoration: none; transition: background .25s ease, padding .25s ease; }
.toc a:hover { background: rgba(239, 236, 229, .6); padding-left: 14px; }
.toc-n { font-family: var(--display); font-weight: 600; color: var(--gold); width: 2.6em; flex: none; font-size: 1.05rem; }
.toc-t { font-family: var(--display); font-size: clamp(1.4rem, 2.2vw, 1.85rem); font-weight: 500; white-space: nowrap; }
.toc-lead { flex: 1; border-bottom: 1px dotted rgba(18, 22, 29, .35); transform: translateY(-6px); min-width: 24px; }
.toc-d { font-size: .9rem; color: var(--text-2); text-align: right; }

/* Previous / next */
.next-nav { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-top: clamp(64px, 8vw, 104px); border-top: 1px solid var(--line); padding-top: 22px; }
.np { display: grid; gap: 4px; text-decoration: none; padding: 6px 0; align-content: start; }
.np.next { text-align: right; justify-items: end; }
.np-k { font-size: .66rem; letter-spacing: .26em; text-transform: uppercase; font-weight: 600; color: var(--muted); }
.np-t { font-family: var(--display); font-size: clamp(1.5rem, 2.8vw, 2.4rem); font-weight: 500; line-height: 1.1; transition: color .2s ease; }
.np.next .np-t::after { content: " →"; color: var(--gold); }
.np.prev .np-t::before { content: "← "; color: var(--gold); }
.np:hover .np-t { color: var(--gold); }
.next-nav.on-ink { border-top-color: var(--ink-line); }
.next-nav.on-ink .np-k { color: var(--on-ink-2); }
.next-nav.on-ink .np-t { color: var(--on-ink); }
.next-nav.on-ink .np:hover .np-t { color: var(--gold-hi); }
.next-nav.on-ink .np.next .np-t::after, .next-nav.on-ink .np.prev .np-t::before { color: var(--gold-hi); }

/* Impact */
.plan-tabs { display: grid; grid-template-columns: repeat(3, 1fr); border-top: 1px solid var(--text); }
.plan-tab { text-align: left; background: transparent; border: 0; border-bottom: 1px solid var(--line); padding: 22px 22px 22px 0; display: grid; grid-template-columns: 34px 1fr; gap: 2px 14px; align-items: start; position: relative; color: var(--text-2); transition: color .2s ease; }
.plan-tab + .plan-tab { padding-left: 22px; border-left: 1px solid var(--line); }
.plan-tab svg { width: 30px; height: 30px; grid-row: span 2; color: var(--muted); transition: color .2s ease; }
.plan-tab .pt-k { font-size: .66rem; letter-spacing: .26em; text-transform: uppercase; font-weight: 600; color: var(--muted); }
.plan-tab .pt-t { font-family: var(--display); font-size: clamp(1.25rem, 1.9vw, 1.6rem); font-weight: 500; line-height: 1.15; }
.plan-tab::after { content: ""; position: absolute; left: 0; right: 0; bottom: -1px; height: 2px; background: var(--gold-line); transform: scaleX(0); transform-origin: left; transition: transform .35s ease; }
.plan-tab + .plan-tab::after { left: 22px; }
.plan-tab:hover { color: var(--text); }
.plan-tab[aria-selected="true"] { color: var(--text); }
.plan-tab[aria-selected="true"] svg, .plan-tab[aria-selected="true"] .pt-k { color: var(--gold); }
.plan-tab[aria-selected="true"]::after { transform: scaleX(1); }

.impact { display: grid; grid-template-columns: 1.35fr .65fr; border-bottom: 1px solid var(--line); }
.impact-main { padding: 34px 40px 34px 0; min-width: 0; }
.payments { padding: 34px 0 34px 40px; border-left: 1px solid var(--line); min-width: 0; }
.calc-label-paper { font-size: .66rem; letter-spacing: .26em; text-transform: uppercase; font-weight: 600; color: var(--muted); display: block; margin-bottom: 10px; }
.grant-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 20px; flex-wrap: wrap; }
.grant-amt { font-family: var(--display); font-weight: 500; font-size: clamp(2.6rem, 5vw, 4.2rem); line-height: 1; font-variant-numeric: lining-nums tabular-nums; }
.grant-amt small { font-family: var(--sans); font-size: .9rem; color: var(--muted); margin-left: 12px; letter-spacing: .02em; }
.seg-paper { border-color: var(--line); min-width: 300px; margin: 0; }
.seg-paper button { color: var(--text-2); }
.seg-paper button + button { border-left-color: var(--line); }
.seg-paper button[aria-checked="true"] { background: var(--ink); color: var(--on-ink); }
.outcome { font-family: var(--display); font-style: italic; font-size: clamp(1.4rem, 2.3vw, 1.95rem); line-height: 1.25; margin: 30px 0 26px; color: var(--text); max-width: 26em; min-height: 2.5em; }
.outcome b { font-style: normal; font-weight: 600; color: var(--gold); }
.ledger { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--text); }
.ledger li { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 8px 18px; padding: 14px 0 12px; border-bottom: 1px solid var(--line); align-items: baseline; animation: rowIn .5s ease both; }
.ledger li:nth-child(2) { animation-delay: .05s; } .ledger li:nth-child(3) { animation-delay: .1s; } .ledger li:nth-child(4) { animation-delay: .15s; }
.ledger li:nth-child(5) { animation-delay: .2s; } .ledger li:nth-child(6) { animation-delay: .25s; } .ledger li:nth-child(7) { animation-delay: .3s; }
@keyframes rowIn { from { opacity: .2; transform: translateX(-8px); } to { opacity: 1; transform: none; } }
.ledger .li-name { font-size: .98rem; color: var(--text); min-width: 0; }
.ledger .li-name small { display: block; color: var(--muted); font-size: .8rem; margin-top: 1px; }
.ledger .li-amt { text-align: right; font-variant-numeric: tabular-nums; font-weight: 600; font-size: .98rem; white-space: nowrap; }
.ledger .li-amt small { display: block; font-weight: 400; color: var(--muted); font-size: .76rem; }
.ledger .li-bar { grid-column: 1 / -1; height: 5px; background: rgba(18, 22, 29, .06); position: relative; overflow: hidden; }
.ledger .li-bar i { position: absolute; inset: 0 auto 0 0; width: 0; background: var(--ink); transition: width .9s cubic-bezier(.2, .7, .2, 1); }
.ledger li.flex .li-bar i { background: repeating-linear-gradient(135deg, var(--gold-line) 0 3px, rgba(168, 132, 66, .35) 3px 6px); }
.ledger li.rest .li-name { color: var(--muted); font-style: italic; }
.ledger li.rest .li-bar i { background: rgba(18, 22, 29, .2); }
.imp-note { font-size: .82rem; color: var(--muted); margin: 14px 0 0; }
.tranches { list-style: none; margin: 8px 0 0; padding: 0; position: relative; counter-reset: t; }
.tranches::before { content: ""; position: absolute; left: 15px; top: 16px; bottom: 30px; width: 1px; background: var(--line); }
.tranches li { position: relative; padding: 0 0 26px 50px; counter-increment: t; animation: rowIn .5s ease both; }
.tranches li:nth-child(2) { animation-delay: .1s; } .tranches li:nth-child(3) { animation-delay: .2s; }
.tranches li::before { content: counter(t, upper-roman); position: absolute; left: 0; top: 0; width: 31px; height: 31px; border: 1px solid var(--gold-line); border-radius: 50%; background: var(--paper); display: flex; align-items: center; justify-content: center; font-family: var(--display); font-weight: 600; color: var(--gold); font-size: .92rem; }
.tranches .tr-when { font-size: .64rem; letter-spacing: .22em; text-transform: uppercase; font-weight: 600; color: var(--muted); display: block; }
.tranches .tr-what { font-family: var(--display); font-size: 1.3rem; font-weight: 500; line-height: 1.2; display: block; margin: 3px 0 3px; }
.tranches .tr-to { font-size: .86rem; color: var(--text-2); display: block; }
.tranches .tr-to b { font-weight: 600; color: var(--text); }
.tranches .tr-amt { font-variant-numeric: tabular-nums; color: var(--gold); font-weight: 600; font-size: .88rem; }
.pay-rule { font-size: .86rem; color: var(--text-2); border-top: 1px solid var(--line); padding-top: 14px; margin: 4px 0 0; }
.imp-foot { font-size: .8rem; color: var(--muted); margin-top: 18px; max-width: 72em; }

/* Pilot */
.kenya-grid h2 { font-size: clamp(2.4rem, 4.8vw, 4.2rem); }
.reasons-k { display: block; font-size: .66rem; letter-spacing: .26em; text-transform: uppercase; font-weight: 600; color: var(--muted); padding: 16px 0 4px; }

/* Governance diagram */
.gov { display: grid; grid-template-columns: minmax(0, 1fr) 330px; border: 1px solid var(--ink-line); }
.gov-diagram {
  position: relative; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr));
  grid-template-areas:
    ".       donors    donors  protect"
    ".       board     board   ."
    "manager grant     edu     schools"
    "panel   providers .       ."
    ".       youth     youth   youth";
  gap: 46px 26px; padding: 40px 32px 44px; min-width: 0;
}
.gov-lines { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; overflow: visible; }
.gov-lines path { fill: none; stroke-linecap: round; transition: stroke .3s ease, opacity .3s ease; }
.gov-lines path.money { stroke: rgba(212, 182, 118, .75); stroke-width: 1.6; stroke-dasharray: 1 7; animation: flow 1.4s linear infinite; }
.gov-lines path.ctrl { stroke: rgba(212, 182, 118, .4); stroke-width: 1; stroke-dasharray: 6 5; }
.gov-lines path.dim { opacity: .5; }
.gov-lines path.hl { stroke: var(--gold-hi); opacity: 1; }
@keyframes flow { to { stroke-dashoffset: -16; } }
.gnode { text-align: left; background: rgba(17, 28, 48, .92); border: 1px solid var(--ink-line); padding: 14px 16px 15px; color: var(--on-ink); display: grid; gap: 3px; align-content: start; position: relative; z-index: 1; transition: border-color .25s ease, background .25s ease, opacity .25s ease, color .25s ease; min-width: 0; }
.gnode .gk { font-size: .58rem; letter-spacing: .24em; text-transform: uppercase; color: var(--gold-hi); font-weight: 600; }
.gnode b { font-family: var(--display); font-weight: 600; font-size: 1.18rem; line-height: 1.15; }
.gnode small { font-size: .76rem; color: var(--on-ink-2); line-height: 1.35; }
.gnode.g-core, .gnode.g-end { border-color: rgba(212, 182, 118, .55); }
.gnode.g-out { background: rgba(11, 19, 34, .92); border-style: dashed; }
.gnode:hover { border-color: var(--gold-hi); }
.gnode.on { background: var(--gold-hi); color: var(--ink); border-color: var(--gold-hi); border-style: solid; }
.gnode.on .gk, .gnode.on small { color: rgba(11, 19, 34, .72); }
.gnode.dim { opacity: .5; }
.gov-detail { padding: 36px 30px; border-left: 1px solid var(--ink-line); min-width: 0; }
.gov-detail .gk { font-size: .62rem; letter-spacing: .26em; text-transform: uppercase; color: var(--gold-hi); font-weight: 600; display: block; margin-bottom: 10px; }
.gov-detail h3 { font-size: clamp(1.7rem, 2.4vw, 2.2rem); font-weight: 500; margin-bottom: .8rem; }
.gov-detail p { color: var(--on-ink-2); font-size: .98rem; }
.gov-detail ul { list-style: none; margin: 18px 0 0; padding: 0; border-top: 1px solid var(--ink-line); }
.gov-detail li { padding: 11px 0 11px 26px; border-bottom: 1px solid var(--ink-line); font-size: .9rem; color: var(--on-ink); position: relative; }
.gov-detail li::before { content: ""; position: absolute; left: 0; top: 1.25em; width: 14px; height: 1px; background: var(--gold-hi); }
.gov-detail.swap { animation: rowIn .4s ease; }
.gov-legend { display: flex; gap: 10px 28px; margin-top: 16px; font-size: .8rem; color: var(--on-ink-2); flex-wrap: wrap; }
.gov-legend i { display: inline-block; width: 36px; height: 0; vertical-align: middle; margin-right: 10px; border-top: 2px dotted var(--gold-hi); }
.gov-legend i.lg-ctrl { border-top: 1px dashed rgba(212, 182, 118, .7); }

/* Founder */
.about { display: grid; grid-template-columns: .8fr 1.2fr; gap: clamp(32px, 6vw, 96px); align-items: start; }
.about-name h2 { font-size: clamp(3rem, 6vw, 5.2rem); line-height: .95; margin-bottom: .6rem; }
.about-name .role { color: var(--gold); font-size: .7rem; letter-spacing: .28em; text-transform: uppercase; font-weight: 600; display: block; }
.about-facts { margin: 34px 0 0; border-top: 1px solid var(--text); }
.about-facts div { display: grid; grid-template-columns: 120px 1fr; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--line); }
.about-facts dt { font-size: .64rem; letter-spacing: .24em; text-transform: uppercase; font-weight: 600; color: var(--muted); padding-top: 4px; }
.about-facts dd { margin: 0; color: var(--text); }
.about-text p { color: var(--text-2); max-width: 36em; }
.about-text .about-lead { font-family: var(--display); font-size: clamp(1.6rem, 2.6vw, 2.2rem); line-height: 1.25; font-weight: 500; color: var(--text); margin-bottom: 1.4rem; }

/* Footer disclaimer */
.disclaimer { font-size: .86rem; color: var(--on-ink-2); padding-block: 24px; margin: 0; max-width: 74em; border-bottom: 1px solid var(--ink-line); }
.disclaimer strong { color: var(--gold-hi); font-weight: 600; }
.foot-pages { grid-template-columns: 1fr 1fr; column-gap: 20px; }

@media (prefers-reduced-motion: reduce) {
  .page.enter, .ledger li, .tranches li, .gov-detail.swap { animation: none; }
  .gov-lines path.money { animation: none; }
}

/* Seven links: switch to the menu earlier */
@media (max-width: 1200px) {
  .nav-links, .nav-right .btn { display: none; }
  .menu-toggle { display: inline-flex; }
  body.menu-open .nav-links {
    display: flex; flex-direction: column; align-items: flex-start; gap: 0; position: absolute; top: 100%; left: 0; right: 0;
    height: calc(100vh - 74px); height: calc(100dvh - 74px);
    background-color: var(--ink); background-image: var(--grain-light);
    padding: 20px max(var(--gutter), env(safe-area-inset-left, 0px)); overflow-y: auto; border-top: 1px solid var(--ink-line);
  }
  body.menu-open .nav-links li { width: 100%; border-bottom: 1px solid var(--ink-line); }
  body.menu-open .nav-links a { display: block; padding: 16px 0; font-family: var(--display); font-size: 1.8rem; letter-spacing: 0; text-transform: none; color: var(--on-ink); }
  body.menu-open .nav-links a::after { display: none; }
  body.menu-open .nav-links .menu-only { display: block; }
  body.menu-open .nav-links .menu-only a { color: var(--gold-hi); }
  body.menu-open { overflow: hidden; }
  .gov { grid-template-columns: 1fr; }
  .gov-detail { border-left: 0; border-top: 1px solid var(--ink-line); }
}
@media (max-width: 900px) {
  .index-grid, .about, .impact { grid-template-columns: 1fr; }
  .impact-main { padding-right: 0; }
  .payments { padding-left: 0; border-left: 0; border-top: 1px solid var(--line); }
}
@media (max-width: 760px) {
  .gov-diagram { grid-template-columns: 1fr; grid-template-areas: none; gap: 22px; padding: 26px 18px; }
  .gov-diagram .gnode { grid-area: auto !important; }
  .gov-lines { display: none; }
  .gnode[data-g="donors"] { order: 1; } .gnode[data-g="protect"] { order: 2; } .gnode[data-g="board"] { order: 3; }
  .gnode[data-g="grant"] { order: 4; } .gnode[data-g="manager"] { order: 5; } .gnode[data-g="edu"] { order: 6; }
  .gnode[data-g="schools"] { order: 7; } .gnode[data-g="panel"] { order: 8; } .gnode[data-g="providers"] { order: 9; } .gnode[data-g="youth"] { order: 10; }
  .gnode + .gnode::before { content: ""; position: absolute; left: 22px; top: -23px; height: 22px; border-left: 2px dotted rgba(212, 182, 118, .7); }
  .plan-tabs { grid-template-columns: 1fr; }
  .plan-tab, .plan-tab + .plan-tab { padding: 16px 0; border-left: 0; }
  .plan-tab + .plan-tab::after { left: 0; }
  .seg-paper { min-width: 0; width: 100%; }
}
@media (max-width: 620px) {
  .toc a { flex-wrap: wrap; row-gap: 2px; }
  .toc-lead { display: none; }
  .toc-d { width: 100%; text-align: left; padding-left: calc(2.73rem + 16px); }
  .next-nav { gap: 10px; }
  .np-t { font-size: 1.35rem; }
  .about-facts div { grid-template-columns: 96px 1fr; }
  .foot-pages { grid-template-columns: 1fr; }
}
.section[id], #fuentes { scroll-margin-top: 90px; }

/* v0.4: one scrolling page again; header buttons jump to each section */
.page[id] { scroll-margin-top: 73px; }
@media (max-width: 620px) { .page[id] { scroll-margin-top: 63px; } }

/* English wordmark: name first, then 'Foundation' */
.wordmark .wm-post { margin-left: .24em; }
