/* =========================================================================
   NYN — nyn.world
   Aesthetic: WEBSITE_AESTHETIC_v1.md (Daniel Popper — organic, monumental,
   mystical, warm). Structure: WEBSITE_SPEC_v2.md.

   No pure black, no pure white. Every contrast pair below was measured;
   ratios are noted beside the token that carries text.
   ========================================================================= */

/* ------------------------------------------------------------- 1. tokens */

:root {
  /* Earth --------------------------------------------------------------- */
  --clay-900: #1e1714;
  --clay-850: #241c18;
  --clay-800: #2a211c;
  --clay-700: #33281f;
  --clay-600: #3f3128;
  --clay-500: #52412f;

  --bone-100: #f4ece0;
  --bone-200: #ece0cf;
  --bone-300: #dfd0ba;
  --bone-400: #cdb99e;

  --terra:      #c4613c;
  --terra-lift: #d9754d;   /* 5.6:1 on clay-900 */
  --terra-deep: #8f3f20;   /* 5.1:1 on surface-2, the darkest ground it sits on */

  --moss:      #5e7256;
  --moss-lift: #8fa886;    /* 6.8:1 on clay-900 */
  --moss-deep: #46583f;    /* 6.6:1 on bone-100 */

  --ochre:      #d99a45;
  --ochre-deep: #7a4f0a;   /* 5.0:1 on surface-2 */

  --gold: #e8b765;         /* 9.6:1 on clay-900 — the accent that glows */

  /* Radii — squircles, never sharp boxes -------------------------------- */
  --r-xs: 8px;
  --r-sm: 14px;
  --r-md: 22px;
  --r-lg: 34px;
  --r-xl: 56px;
  --r-blob: 62% 38% 46% 54% / 55% 48% 52% 45%;

  /* Space ---------------------------------------------------------------- */
  --s-1: 4px;
  --s-2: 8px;
  --s-3: 12px;
  --s-4: 16px;
  --s-5: 24px;
  --s-6: 32px;
  --s-7: 48px;
  --s-8: 72px;
  --s-9: 112px;

  --gutter: clamp(20px, 5vw, 56px);
  --measure: 62ch;
  --page: 1180px;

  /* Type ----------------------------------------------------------------- */
  --serif: "Fraunces", "Iowan Old Style", "Palatino Linotype", Palatino,
           Georgia, "Times New Roman", serif;
  --sans: "Public Sans", ui-sans-serif, system-ui, -apple-system,
          "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, "SF Mono", "Cascadia Mono", Menlo, Consolas, monospace;

  --t-display: clamp(3rem, 11vw, 7.25rem);
  --t-h1: clamp(2.1rem, 5vw, 3.6rem);
  --t-h2: clamp(1.75rem, 4vw, 2.85rem);
  --t-h3: clamp(1.15rem, 2vw, 1.5rem);
  --t-lede: clamp(1.05rem, 1.6vw, 1.3rem);
  --t-body: 1.0625rem;
  --t-small: 0.9375rem;
  --t-micro: 0.8125rem;

  --motion-slow: 1400ms;
  --ease-unfold: cubic-bezier(0.22, 0.61, 0.28, 1);
}

/* Night is the default: projection mapping is the signature moment. ------ */
:root,
:root[data-theme="night"] {
  color-scheme: dark;
  --bg: var(--clay-900);
  --bg-alt: var(--clay-850);
  --surface: var(--clay-800);
  --surface-2: var(--clay-700);
  --line: var(--clay-600);
  --line-strong: var(--clay-500);

  --ink: #f2e7da;          /* 14.5:1 on --bg */
  --ink-2: #c3b3a2;        /*  8.7:1 on --bg */
  --ink-3: #a4907d;        /*  5.8:1 on --bg, 4.7:1 on --surface-2 */

  --land: var(--terra-lift);
  --land-solid: var(--terra);
  --relief: var(--moss-lift);
  --relief-solid: var(--moss);
  --warn: var(--ochre);
  --accent: var(--gold);
  --accent-ink: var(--gold);
  --on-accent: #241a10;    /* 9.4:1 on --gold */

  --glow-1: rgba(232, 183, 101, 0.20);
  --glow-2: rgba(196, 97, 60, 0.16);
  --grain: 0.055;
  --blend: screen;

  /* The hero form. Three plaster layers, each catching a little more light. */
  --mound-1: #2c2118;
  --mound-2: #392a1d;
  --mound-3: #483323;
  --mound-rim: rgba(232, 183, 101, 0.30);
}

:root[data-theme="day"] {
  color-scheme: light;
  --bg: var(--bone-100);
  --bg-alt: #efe6d8;
  --surface: #ece0cf;
  --surface-2: #e4d6c1;
  --line: var(--bone-300);
  --line-strong: var(--bone-400);

  --ink: var(--clay-800);  /* 13.4:1 on --bg */
  --ink-2: #6b5a4c;        /*  5.6:1 on --bg */
  --ink-3: #665648;        /*  6.0:1 on --bg, 4.9:1 on --surface-2 */

  --land: var(--terra-deep);
  --land-solid: var(--terra);
  --relief: var(--moss-deep);
  --relief-solid: var(--moss);
  --warn: var(--ochre-deep);
  --accent: var(--gold);
  --accent-ink: var(--ochre-deep);
  --on-accent: #2a211c;

  --glow-1: rgba(196, 97, 60, 0.13);
  --glow-2: rgba(94, 114, 86, 0.11);
  --grain: 0.04;
  --blend: multiply;

  --mound-1: #e8dbc6;
  --mound-2: #ddcbaf;
  --mound-3: #d0b995;
  --mound-rim: rgba(138, 90, 18, 0.28);
}

/* ---------------------------------------------------------------- 2. base */

*,
*::before,
*::after { box-sizing: border-box; }

html {
  scroll-behavior: smooth;
  scroll-padding-top: 92px;
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 400 var(--t-body)/1.68 var(--sans);
  font-synthesis-weight: none;
  overflow-x: hidden;
  transition: background-color 600ms var(--ease-unfold), color 600ms var(--ease-unfold);
}

/* The grain sits over everything: surfaces read as plaster, not glass. */
body::after {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 60;
  pointer-events: none;
  opacity: var(--grain);
  background-image: url("assets/grain.svg");
  background-size: 260px 260px;
}

h1, h2, h3, h4 {
  font-family: var(--serif);
  font-weight: 460;
  font-variation-settings: "SOFT" 40, "WONK" 1, "opsz" 80;
  line-height: 1.06;
  letter-spacing: -0.015em;
  margin: 0 0 var(--s-4);
  text-wrap: balance;
}

p { margin: 0 0 var(--s-4); max-width: var(--measure); }
p:last-child { margin-bottom: 0; }

a { color: inherit; text-decoration-color: color-mix(in oklab, currentColor 45%, transparent); text-underline-offset: 3px; }
a:hover { text-decoration-color: currentColor; }

:focus-visible {
  outline: 3px solid var(--accent);
  outline-offset: 3px;
  border-radius: var(--r-xs);
}

img, svg { max-width: 100%; }
svg { display: block; }

.skip-link {
  position: absolute;
  left: var(--s-4);
  top: -100px;
  z-index: 200;
  padding: var(--s-3) var(--s-5);
  background: var(--accent);
  color: var(--on-accent);
  border-radius: var(--r-sm);
  font-weight: 600;
  transition: top 180ms var(--ease-unfold);
}
.skip-link:focus { top: var(--s-4); }

.vh {
  position: absolute !important;
  width: 1px; height: 1px;
  margin: -1px; padding: 0; border: 0;
  clip-path: inset(50%);
  overflow: hidden; white-space: nowrap;
}

/* ------------------------------------------------------------ 3. skeleton */

.wrap {
  width: 100%;
  max-width: var(--page);
  margin-inline: auto;
  padding-inline: var(--gutter);
}

.chamber {
  position: relative;
  padding-block: clamp(72px, 11vw, 148px);
  isolation: isolate;
}
.chamber--alt { background: var(--bg-alt); }
.chamber--surface { background: var(--surface); }

/* Dividers are gentle waves. Never a straight line. */
.wave {
  position: absolute;
  left: 0; right: 0;
  width: 100%;
  height: clamp(42px, 6vw, 86px);
  z-index: 1;
  pointer-events: none;
}
.wave--top { top: -1px; }
.wave--bottom { bottom: -1px; transform: scaleY(-1); }
.wave path { fill: var(--wave-fill, var(--bg)); }

.eyebrow {
  display: flex;
  align-items: center;
  gap: var(--s-3);
  font: 600 var(--t-micro)/1 var(--mono);
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--ink-3);
  margin-bottom: var(--s-5);
}
.eyebrow::before {
  content: "";
  width: 26px; height: 2px;
  border-radius: 2px;
  background: var(--accent);
  flex: none;
}

.lede {
  font-size: var(--t-lede);
  line-height: 1.55;
  color: var(--ink-2);
  max-width: 54ch;
}

.grid {
  display: grid;
  gap: var(--s-6);
}
@media (min-width: 720px) {
  .grid--2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (min-width: 900px) {
  .grid--3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  padding: clamp(22px, 3vw, 36px);
  position: relative;
  overflow: hidden;
}
.chamber--surface .card { background: var(--bg-alt); }

/* ---------------------------------------------------------------- 4. nav */

.nav {
  position: sticky;
  top: 0;
  z-index: 50;
  background: color-mix(in oklab, var(--bg) 88%, transparent);
  backdrop-filter: blur(14px) saturate(1.1);
  border-bottom: 1px solid transparent;
  transition: border-color 300ms, background-color 300ms;
}
.nav[data-stuck="true"] { border-bottom-color: var(--line); }

.nav__inner {
  display: flex;
  align-items: center;
  gap: var(--s-5);
  min-height: 72px;
  padding-block: var(--s-3);
}

.nav__brand {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: var(--ink);
  flex: none;
}
.nav__brand svg { color: var(--ink); }
.nav__brand .mark { width: 30px; height: 30px; }
.nav__brand .word { width: 76px; height: 48px; }

.nav__links {
  display: none;
  gap: 2px;
  margin-inline: auto;
}
@media (min-width: 1040px) { .nav__links { display: flex; } }

.nav__link {
  padding: 9px 13px;
  border-radius: var(--r-sm);
  font-size: var(--t-small);
  color: var(--ink-2);
  text-decoration: none;
  white-space: nowrap;
  transition: color 200ms, background-color 200ms;
}
.nav__link:hover { color: var(--ink); background: var(--surface); }
.nav__link[aria-current="true"] { color: var(--ink); background: var(--surface); }

.nav__tools {
  display: flex;
  align-items: center;
  gap: var(--s-2);
  margin-left: auto;
}
@media (min-width: 1040px) { .nav__tools { margin-left: 0; } }

/* -------------------------------------------------------------- 5. buttons */

.btn {
  --btn-bg: transparent;
  --btn-ink: var(--ink);
  --btn-line: var(--line-strong);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 14px 24px;
  min-height: 48px;
  border: 1px solid var(--btn-line);
  border-radius: 999px;
  background: var(--btn-bg);
  color: var(--btn-ink);
  font: 600 var(--t-small)/1 var(--sans);
  text-decoration: none;
  cursor: pointer;
  transition: transform 260ms var(--ease-unfold), background-color 260ms,
              border-color 260ms, color 260ms;
}
.btn:hover { transform: translateY(-2px); }
.btn:active { transform: translateY(0); }

.btn--primary {
  white-space: nowrap;
  --btn-bg: var(--accent);
  --btn-ink: var(--on-accent);
  --btn-line: var(--accent);
  font-size: var(--t-body);
  padding: 17px 30px;
  min-height: 56px;
  box-shadow: 0 0 0 0 var(--glow-1);
}
.btn--primary:hover { box-shadow: 0 10px 44px -10px var(--glow-1); }

.btn--quiet { --btn-line: var(--line); color: var(--ink-2); }
.btn--quiet:hover { color: var(--ink); border-color: var(--line-strong); }

.btn--icon { width: 44px; min-height: 44px; padding: 0; }
.btn--icon svg { width: 18px; height: 18px; }

.btn[aria-disabled="true"] {
  opacity: 0.55;
  cursor: not-allowed;
  transform: none !important;
}

/* ------------------------------------------------------ 6. claims + status */

/* Every number on this site is wrapped in .claim and carries data-status,
   data-source and data-asof. The audit drawer reads them straight back out. */

.claim {
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.tag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 3px 9px;
  border-radius: 999px;
  border: 1px solid;
  font: 600 0.6875rem/1.35 var(--mono);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  vertical-align: 2px;
  white-space: nowrap;
}
.tag::before {
  content: "";
  width: 6px; height: 6px;
  border-radius: 50%;
  background: currentColor;
  flex: none;
}
.tag--verified   { color: var(--relief); border-color: color-mix(in oklab, var(--relief) 40%, transparent); }
.tag--unverified { color: var(--warn);   border-color: color-mix(in oklab, var(--warn) 40%, transparent); }
.tag--estimated  { color: var(--land);   border-color: color-mix(in oklab, var(--land) 40%, transparent); }
.tag--missing    { color: var(--ink-3);  border-color: var(--line-strong); }
.tag--missing::before { border-radius: 1px; }
.tag--beta       { color: var(--accent-ink); border-color: color-mix(in oklab, var(--accent) 45%, transparent); }
.tag--concept    { color: var(--ink-2);  border-color: var(--line-strong); }
.tag--buildable  { color: var(--relief); border-color: color-mix(in oklab, var(--relief) 40%, transparent); }

.src {
  display: block;
  margin-top: var(--s-3);
  font: 400 var(--t-micro)/1.5 var(--mono);
  color: var(--ink-3);
  max-width: 52ch;
}
.src a { color: var(--ink-2); }

/* A gap is rendered, never filled. */
.gap {
  display: flex;
  align-items: center;
  gap: var(--s-3);
  padding: var(--s-4) var(--s-5);
  border-radius: var(--r-md);
  border: 1px dashed var(--line-strong);
  background: repeating-linear-gradient(
    -45deg,
    transparent 0 9px,
    color-mix(in oklab, var(--ink-3) 8%, transparent) 9px 10px
  );
  color: var(--ink-2);
  font-size: var(--t-small);
}
.gap svg { width: 18px; height: 18px; flex: none; color: var(--ink-3); }

.figure {
  font-family: var(--serif);
  font-variation-settings: "SOFT" 30, "WONK" 0, "opsz" 100;
  font-size: clamp(2.4rem, 6vw, 4rem);
  line-height: 0.95;
  letter-spacing: -0.02em;
  display: block;
}
.figure--sm { font-size: clamp(1.7rem, 3.4vw, 2.4rem); }

/* --------------------------------------------------------------- 7. hero */

.hero-chamber {
  position: relative;
  isolation: isolate;
  padding-bottom: clamp(72px, 11vw, 148px);
}

/* Arrival is one screen: the form, the line, the one decision. */
.hero {
  position: relative;
  min-height: min(100svh, 920px);
  display: flex;
  align-items: center;
  padding-block: clamp(56px, 9vw, 110px);
  overflow: hidden;
}

.hero-extra {
  position: relative;
  z-index: 2;
  padding-top: clamp(40px, 6vw, 72px);
}

/* Projected light. Follows the pointer; falls back to a still position. */
.hero__light {
  position: absolute;
  inset: -20%;
  z-index: 0;
  pointer-events: none;
  background:
    radial-gradient(42vw 42vw at calc(var(--mx, 50%) ) calc(var(--my, 38%)),
      var(--glow-1), transparent 62%),
    radial-gradient(34vw 34vw at calc(100% - var(--mx, 50%)) calc(var(--my, 62%) + 10%),
      var(--glow-2), transparent 64%);
  mix-blend-mode: var(--blend);
  transition: background-position 400ms linear;
}

.hero__mound {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
  pointer-events: none;
}

.hero__inner {
  position: relative;
  z-index: 2;
  width: 100%;
}

.hero__copy { max-width: 40rem; }

.hero h1 {
  font-size: var(--t-h1);
  font-variation-settings: "SOFT" 60, "WONK" 1, "opsz" 120;
  margin-bottom: var(--s-5);
}

.hero__cta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--s-4);
  margin-block: var(--s-6) var(--s-4);
}

.hero__second {
  font-size: var(--t-small);
  color: var(--ink-2);
  max-width: 46ch;
  margin-bottom: var(--s-6);
}

.badge-line {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  font-size: var(--t-small);
  color: var(--ink-2);
  text-decoration: none;
  padding: 8px 15px 8px 11px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: color-mix(in oklab, var(--surface) 70%, transparent);
}
.badge-line:hover { border-color: var(--line-strong); color: var(--ink); }
.badge-line svg { width: 15px; height: 15px; color: var(--accent-ink); flex: none; }

.honesty {
  margin-top: clamp(48px, 8vw, 96px);
  max-width: 58ch;
  font-size: var(--t-small);
  line-height: 1.7;
  color: var(--ink-2);
}

/* ------------------------------------------------------------ 8. fork bar */

.forkbar {
  margin-block: var(--s-6);
  max-width: 44rem;
}
.forkbar__track {
  display: flex;
  height: 74px;
  border-radius: var(--r-md);
  overflow: hidden;
  border: 1px solid var(--line);
  background: var(--surface);
}
.forkbar__seg {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 3px;
  padding: 0 clamp(12px, 2vw, 20px);
  min-width: 0;
  width: 50%;
  transform-origin: left center;
  animation: unfold var(--motion-slow) var(--ease-unfold) both;
}
.forkbar__seg--a {
  background: color-mix(in oklab, var(--land-solid) 26%, var(--surface));
  border-right: 1px solid var(--line);
}
.forkbar__seg--b {
  background: color-mix(in oklab, var(--relief-solid) 24%, var(--surface));
  animation-delay: 220ms;
}
.forkbar__name {
  font: 600 var(--t-micro)/1.3 var(--mono);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ink-2);
}
.forkbar__val {
  font-size: var(--t-small);
  font-weight: 600;
  color: var(--ink);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.forkbar__foot {
  display: flex;
  justify-content: space-between;
  gap: var(--s-4);
  margin-top: var(--s-3);
  font: 400 var(--t-micro)/1.5 var(--mono);
  color: var(--ink-3);
}

@keyframes unfold {
  from { transform: scaleX(0.02); opacity: 0; }
  to   { transform: scaleX(1); opacity: 1; }
}

/* --------------------------------------------------------------- 9. slider */

.payslider {
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  background: color-mix(in oklab, var(--surface) 72%, transparent);
  padding: var(--s-5);
  max-width: 44rem;
}
.payslider__head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: var(--s-4);
  margin-bottom: var(--s-4);
}
.payslider__label { font-size: var(--t-small); color: var(--ink-2); }
.payslider__amount {
  font-family: var(--serif);
  font-size: clamp(1.6rem, 3.2vw, 2.1rem);
  font-variation-settings: "SOFT" 30, "opsz" 90;
  line-height: 1;
}

input[type="range"] {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 34px;
  background: transparent;
  cursor: pointer;
  margin: 0;
}
input[type="range"]::-webkit-slider-runnable-track {
  height: 10px;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--accent) var(--fill, 0%), var(--line) var(--fill, 0%));
}
input[type="range"]::-moz-range-track {
  height: 10px;
  border-radius: 999px;
  background: var(--line);
}
input[type="range"]::-moz-range-progress {
  height: 10px;
  border-radius: 999px;
  background: var(--accent);
}
input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 30px; height: 30px;
  margin-top: -10px;
  border-radius: 50%;
  background: var(--accent);
  border: 3px solid var(--bg);
  box-shadow: 0 2px 12px -2px var(--glow-1);
}
input[type="range"]::-moz-range-thumb {
  width: 24px; height: 24px;
  border-radius: 50%;
  background: var(--accent);
  border: 3px solid var(--bg);
}

.payslider__preview {
  margin-top: var(--s-4);
  font-size: var(--t-small);
  color: var(--ink-2);
}
.payslider__preview strong { color: var(--ink); font-weight: 600; }

/* ------------------------------------------------------------- 10. the fork */

.outcome {
  border-radius: var(--r-lg);
  border: 1px solid var(--line);
  padding: clamp(22px, 3vw, 34px);
  background: var(--surface);
  position: relative;
  overflow: hidden;
}
.outcome::before {
  content: "";
  position: absolute;
  inset: 0 0 auto 0;
  height: 4px;
  background: var(--outcome-hue, var(--line-strong));
}
.outcome--land   { --outcome-hue: var(--land-solid);   --outcome-ink: var(--land); }
.outcome--relief { --outcome-hue: var(--relief-solid); --outcome-ink: var(--relief); }
.outcome h3 { font-size: var(--t-h3); margin-bottom: var(--s-3); }
.outcome__path {
  font: 600 var(--t-micro)/1.5 var(--mono);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--outcome-ink, var(--ink-2));
  margin-bottom: var(--s-4);
}

.tree { width: 100%; height: auto; margin-block: var(--s-6); }
.tree text { font: 500 13px var(--mono); fill: var(--ink-2); }
.tree .tree__node { fill: var(--surface); stroke: var(--line-strong); }
.tree .tree__edge { stroke: var(--line-strong); fill: none; stroke-width: 2; }
.tree .tree__edge--a { stroke: var(--land-solid); }
.tree .tree__edge--b { stroke: var(--relief-solid); }
.tree .tree__lbl { fill: var(--ink); font-weight: 600; }

/* ---------------------------------------------------------------- 11. pool */

.meter {
  position: relative;
  border-radius: var(--r-lg);
  border: 1px solid var(--line);
  background: var(--surface);
  padding: clamp(22px, 3vw, 34px);
  overflow: hidden;
}
.meter__vessel {
  position: relative;
  height: clamp(200px, 30vw, 300px);
  border-radius: var(--r-md);
  background: var(--bg-alt);
  border: 1px solid var(--line);
  overflow: hidden;
  margin-block: var(--s-5);
}
.meter__fill {
  position: absolute;
  left: 0; right: 0; bottom: 0;
  height: var(--level, 0%);
  background: linear-gradient(180deg,
    color-mix(in oklab, var(--accent) 60%, transparent),
    color-mix(in oklab, var(--land-solid) 55%, transparent));
  transition: height 1600ms var(--ease-unfold);
}
.meter__fill::before {
  content: "";
  position: absolute;
  top: -14px; left: -50%;
  width: 200%; height: 28px;
  border-radius: 50%;
  background: color-mix(in oklab, var(--accent) 70%, transparent);
  animation: swell 7s ease-in-out infinite;
}
@keyframes swell {
  0%, 100% { transform: translate(-2%, 0) scaleY(1); }
  50%      { transform: translate(2%, -4px) scaleY(1.25); }
}
.meter__ticks {
  position: absolute;
  inset: 0;
  pointer-events: none;
}
.meter__tick {
  position: absolute;
  left: 0; right: 0;
  bottom: var(--at, 50%);
  border-top: 1px dashed var(--line-strong);
  padding: 0 12px 4px;
  font: 500 var(--t-micro)/1.4 var(--mono);
  color: var(--ink-3);
}
.meter__state {
  display: flex;
  flex-direction: column;
  gap: var(--s-2);
}

.offers[hidden] { display: none; }

/* ----------------------------------------------------------------- 12. map */

.map {
  position: relative;
  border-radius: var(--r-lg);
  border: 1px solid var(--line);
  background: var(--bg-alt);
  overflow: hidden;
}
.map__canvas { display: block; width: 100%; height: auto; touch-action: pan-y; }

.map__graticule line,
.map__graticule path { stroke: var(--line-strong); fill: none; stroke-width: 0.6; opacity: 0.75; }
.map__graticule .major { stroke: var(--line-strong); stroke-width: 0.9; }
.map__graticule text { font: 400 9px var(--mono); fill: var(--ink-3); }
.map__land { fill: color-mix(in oklab, var(--ink-3) 22%, transparent); stroke: var(--line-strong); stroke-width: 0.4; }

.map__labels text {
  font: 500 10.5px var(--mono);
  fill: var(--ink-2);
  stroke: var(--bg-alt);
  pointer-events: none;
}
.map__labels .label--sites { fill: var(--accent-ink); }

.map__marker { cursor: pointer; }
.map__marker circle { transition: r 300ms var(--ease-unfold), opacity 300ms; }
.map__marker:focus-visible { outline: none; }
.map__marker:focus-visible .hit { stroke: var(--accent); stroke-width: 2.5; }
.marker--stateless circle.body  { fill: color-mix(in oklab, var(--terra) 78%, transparent); stroke: var(--terra-lift); }
.marker--refugees  circle.body  { fill: color-mix(in oklab, var(--ochre) 70%, transparent); stroke: var(--ochre); }
.marker--idp       circle.body  { fill: color-mix(in oklab, var(--moss) 78%, transparent); stroke: var(--moss-lift); }
.marker--sites     circle.body  { fill: none; stroke: var(--accent); stroke-width: 2; stroke-dasharray: 4 3; }
.map__band { fill: color-mix(in oklab, var(--terra) 16%, transparent); stroke: var(--terra); stroke-dasharray: 3 3; stroke-width: 0.8; }

.map__layers {
  display: flex;
  flex-wrap: wrap;
  gap: var(--s-3);
  padding: var(--s-5);
  border-bottom: 1px solid var(--line);
  background: var(--surface);
}

.switch {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 10px 16px 10px 12px;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  cursor: pointer;
  font-size: var(--t-small);
  color: var(--ink-2);
  background: transparent;
  transition: color 200ms, border-color 200ms, background-color 200ms;
}
.switch input { position: absolute; opacity: 0; width: 0; height: 0; }
.switch__dot {
  width: 15px; height: 15px;
  border-radius: 50%;
  border: 2px solid currentColor;
  flex: none;
  position: relative;
}
.switch__dot::after {
  content: "";
  position: absolute;
  inset: 2px;
  border-radius: 50%;
  background: currentColor;
  transform: scale(0);
  transition: transform 220ms var(--ease-unfold);
}
.switch:has(input:checked) { color: var(--ink); background: var(--bg-alt); border-color: currentColor; }
.switch:has(input:checked) .switch__dot::after { transform: scale(1); }
.switch:has(input:focus-visible) { outline: 3px solid var(--accent); outline-offset: 3px; }
.switch--stateless:has(input:checked) { color: var(--land); }
.switch--refugees:has(input:checked)  { color: var(--warn); }
.switch--idp:has(input:checked)       { color: var(--relief); }
.switch--sites:has(input:checked)     { color: var(--accent-ink); }

.legend {
  display: grid;
  gap: var(--s-4);
  padding: var(--s-5);
  border-top: 1px solid var(--line);
  background: var(--surface);
}
@media (min-width: 760px) { .legend { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (min-width: 1040px) { .legend { grid-template-columns: repeat(4, minmax(0, 1fr)); } }

.legend__item { display: flex; flex-direction: column; gap: 6px; }
.legend__top { display: flex; align-items: center; gap: 8px; font-size: var(--t-small); font-weight: 600; }
.legend__swatch { width: 12px; height: 12px; border-radius: 50%; flex: none; }
.legend__count { font-family: var(--serif); font-size: 1.5rem; font-variation-settings: "opsz" 60; }

.map__tip {
  position: absolute;
  z-index: 5;
  pointer-events: none;
  max-width: 260px;
  padding: 12px 14px;
  border-radius: var(--r-sm);
  background: var(--clay-900);
  color: var(--bone-100);
  border: 1px solid var(--clay-600);
  font-size: var(--t-micro);
  line-height: 1.5;
  box-shadow: 0 18px 40px -18px rgba(0, 0, 0, 0.7);
  opacity: 0;
  transition: opacity 160ms;
}
.map__tip[data-show="true"] { opacity: 1; }
.map__tip strong { display: block; font-size: var(--t-small); margin-bottom: 3px; }

/* ------------------------------------------------------------ 13. finances */

.balance {
  display: grid;
  gap: var(--s-5);
  align-items: start;
}
@media (min-width: 860px) { .balance { grid-template-columns: 1.15fr 1fr; } }

.ledger {
  width: 100%;
  border-collapse: collapse;
  font-size: var(--t-small);
  font-variant-numeric: tabular-nums;
}
.ledger caption { text-align: left; color: var(--ink-3); font-size: var(--t-micro); padding-bottom: var(--s-3); }
.ledger th, .ledger td {
  text-align: left;
  padding: 12px 14px;
  border-bottom: 1px solid var(--line);
  vertical-align: top;
}
.ledger th {
  font: 600 var(--t-micro)/1.4 var(--mono);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-3);
  white-space: nowrap;
}
.ledger td.num, .ledger th.num { text-align: right; }
.ledger tbody tr:hover { background: var(--bg-alt); }
.table-scroll { overflow-x: auto; margin-inline: calc(var(--gutter) * -1); padding-inline: var(--gutter); overscroll-behavior-x: contain; }

.donut { display: flex; align-items: center; gap: var(--s-5); flex-wrap: wrap; }
.donut svg { width: 150px; height: 150px; flex: none; }
.donut circle { fill: none; stroke-width: 16; }
.donut .track { stroke: var(--line); }
.donut .value { stroke: var(--accent); stroke-linecap: round; transition: stroke-dasharray 900ms var(--ease-unfold); }

.tracker { display: flex; flex-direction: column; gap: var(--s-3); }
.tracker__bar {
  height: 14px;
  border-radius: 999px;
  background: var(--line);
  overflow: hidden;
}
.tracker__bar span {
  display: block;
  height: 100%;
  width: var(--pct, 0%);
  border-radius: 999px;
  background: linear-gradient(90deg, var(--land-solid), var(--accent));
  transition: width 1200ms var(--ease-unfold);
}

.alarm {
  display: flex;
  gap: var(--s-4);
  align-items: flex-start;
  padding: var(--s-5);
  border-radius: var(--r-md);
  border: 1px solid color-mix(in oklab, var(--warn) 45%, transparent);
  background: color-mix(in oklab, var(--warn) 10%, transparent);
  color: var(--ink);
}
.alarm svg { width: 22px; height: 22px; flex: none; color: var(--warn); margin-top: 2px; }
.alarm h3 { font-family: var(--sans); font-size: var(--t-body); font-weight: 700; margin-bottom: 4px; letter-spacing: 0; }
.alarm p { font-size: var(--t-small); color: var(--ink-2); }

/* ----------------------------------------------------------------- 14. kpi */

.kpi-table { width: 100%; border-collapse: collapse; font-size: var(--t-small); }
.kpi-table th, .kpi-table td { text-align: left; padding: 14px; border-bottom: 1px solid var(--line); vertical-align: top; }
.kpi-table th {
  font: 600 var(--t-micro)/1.4 var(--mono);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-3);
}
.kpi-table td:first-child { font-weight: 600; color: var(--ink); }
.kpi-table .await { color: var(--ink-3); font-style: italic; }

.timeline {
  display: grid;
  gap: var(--s-4);
  margin-top: var(--s-7);
}
@media (min-width: 720px) { .timeline { grid-template-columns: repeat(2, 1fr); } }
.phase {
  border-radius: var(--r-md);
  border: 1px solid var(--line);
  padding: var(--s-5);
  background: var(--surface);
  position: relative;
}
.phase__year {
  font-family: var(--serif);
  font-size: clamp(2rem, 4vw, 2.75rem);
  font-variation-settings: "opsz" 100;
  line-height: 1;
  color: var(--accent-ink);
  margin-bottom: var(--s-2);
}
.phase__what { font: 600 var(--t-micro)/1.4 var(--mono); letter-spacing: 0.14em; text-transform: uppercase; color: var(--ink-3); margin-bottom: var(--s-3); }

/* -------------------------------------------------------------- 15. designs */

.design { display: flex; flex-direction: column; }
.design__art {
  border-radius: var(--r-md);
  overflow: hidden;
  background: var(--bg-alt);
  border: 1px solid var(--line);
  margin-bottom: var(--s-5);
}
.design__art svg,
.design__art img { display: block; width: 100%; height: auto; }
.design__meta {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 8px var(--s-4);
  margin-top: var(--s-4);
  font-size: var(--t-small);
}
.design__meta dt { color: var(--ink-3); font: 500 var(--t-micro)/1.6 var(--mono); text-transform: uppercase; letter-spacing: 0.07em; }
.design__meta dd { margin: 0; color: var(--ink); }

/* ---------------------------------------------------------------- 16. game */

.game {
  display: grid;
  gap: var(--s-7);
  align-items: center;
}
@media (min-width: 900px) { .game { grid-template-columns: 1.05fr 1fr; } }

/* ------------------------------------------------------------- 17. mission */

.mechanism {
  display: grid;
  gap: var(--s-4);
  margin-block: var(--s-7);
  counter-reset: step;
}
@media (min-width: 780px) { .mechanism { grid-template-columns: repeat(3, 1fr); } }
.step {
  position: relative;
  padding: var(--s-5) var(--s-5) var(--s-5) 60px;
  border-radius: var(--r-md);
  border: 1px solid var(--line);
  background: var(--surface);
  font-size: var(--t-small);
  color: var(--ink-2);
}
.step::before {
  counter-increment: step;
  content: counter(step);
  position: absolute;
  left: 18px; top: 18px;
  width: 30px; height: 30px;
  display: grid; place-items: center;
  border-radius: 50%;
  border: 1px solid var(--accent);
  color: var(--accent-ink);
  font: 600 var(--t-micro)/1 var(--mono);
}
.step strong { display: block; color: var(--ink); font-size: var(--t-body); margin-bottom: 4px; font-weight: 600; }

.pull {
  font-family: var(--serif);
  font-size: clamp(1.35rem, 2.7vw, 2rem);
  font-variation-settings: "SOFT" 50, "WONK" 1, "opsz" 90;
  line-height: 1.3;
  color: var(--ink);
  max-width: 34ch;
  margin: 0;
}

/* --------------------------------------------------------------- 18. audit */

.audit-open {
  position: fixed;
  right: max(16px, env(safe-area-inset-right));
  bottom: max(16px, env(safe-area-inset-bottom));
  z-index: 55;
  box-shadow: 0 14px 40px -14px rgba(0, 0, 0, 0.55);
  background: var(--surface);
}

.audit {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: none;
  grid-template-columns: 1fr min(660px, 100%);
  border: 0;
  padding: 0;
  max-width: 100%;
  max-height: 100%;
  width: 100%;
  height: 100%;
  background: transparent;
}
.audit[open] { display: grid; }
.audit::backdrop { background: rgba(12, 8, 6, 0.6); backdrop-filter: blur(3px); }
.audit__scrim { border: 0; background: transparent; cursor: pointer; }
.audit__panel {
  background: var(--bg);
  border-left: 1px solid var(--line);
  overflow-y: auto;
  padding: var(--s-6) var(--s-5) var(--s-8);
  color: var(--ink);
}
.audit__head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: var(--s-4);
  margin-bottom: var(--s-5);
}
.audit__list { display: flex; flex-direction: column; gap: var(--s-3); margin-top: var(--s-5); }
.audit__row {
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
  padding: var(--s-4);
  background: var(--surface);
  font-size: var(--t-small);
}
.audit__row header { display: flex; justify-content: space-between; gap: var(--s-3); align-items: baseline; margin-bottom: 6px; }
.audit__val { font-family: var(--serif); font-size: 1.25rem; font-variation-settings: "opsz" 60; }
.audit__meta { font: 400 var(--t-micro)/1.6 var(--mono); color: var(--ink-3); word-break: break-word; }
.audit__meta a { color: var(--ink-2); }

/* -------------------------------------------------------------- 19. footer */

.footer {
  border-top: 1px solid var(--line);
  padding-block: var(--s-8) var(--s-7);
  background: var(--bg-alt);
  font-size: var(--t-small);
  color: var(--ink-2);
}
.footer__grid { display: grid; gap: var(--s-6); }
@media (min-width: 820px) { .footer__grid { grid-template-columns: 1.4fr 1fr 1fr; } }
.footer h4 { font-family: var(--sans); font-size: var(--t-micro); letter-spacing: 0.12em; text-transform: uppercase; color: var(--ink-3); margin-bottom: var(--s-4); font-weight: 700; }
.footer ul { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.footer__stamp { margin-top: var(--s-7); padding-top: var(--s-5); border-top: 1px solid var(--line); font: 400 var(--t-micro)/1.7 var(--mono); color: var(--ink-3); }

/* -------------------------------------------------------- 20. reveal/motion */

[data-reveal] {
  opacity: 0;
  transform: translateY(22px) scale(0.995);
  transition: opacity 900ms var(--ease-unfold), transform 900ms var(--ease-unfold);
}
[data-reveal][data-shown="true"] { opacity: 1; transform: none; }

.breathe { animation: breathe 13s ease-in-out infinite; transform-origin: 50% 100%; }
.breathe--slow { animation-duration: 19s; animation-delay: -4s; }
.breathe--slower { animation-duration: 24s; animation-delay: -9s; }
@keyframes breathe {
  0%, 100% { transform: translateY(0) scale(1); }
  50%      { transform: translateY(-9px) scale(1.012); }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
  }
  [data-reveal] { opacity: 1; transform: none; }
  .hero__light { display: none; }
}

@media print {
  .nav, .audit-open, .audit, .hero__light, .hero__mound { display: none !important; }
  body { background: #fff; color: #000; }
}

/* -------------------------------------------------------- 21. demo mode */
/* Visible only while data/finances.json has demo.enabled = true. */

.tag--sample {
  color: var(--warn);
  border-color: currentColor;
  background: color-mix(in oklab, var(--warn) 14%, transparent);
}

.demo-banner {
  display: flex;
  align-items: center;
  gap: var(--s-3);
  padding: 11px var(--gutter);
  background: color-mix(in oklab, var(--warn) 16%, var(--bg));
  border-bottom: 1px solid color-mix(in oklab, var(--warn) 45%, transparent);
  color: var(--ink);
  font-size: var(--t-small);
  line-height: 1.5;
}
.demo-banner strong { font-weight: 700; }
.demo-banner a { color: var(--ink); }
.demo-banner__dot {
  width: 9px; height: 9px;
  border-radius: 50%;
  background: var(--warn);
  flex: none;
}

/* ------------------------------------------------------- 22. small screens */

@media (max-width: 760px) {
  .nav__inner { gap: var(--s-3); min-height: 64px; }
  .nav__brand .mark { width: 26px; height: 26px; }
  .nav__brand .word { width: 62px; height: 39px; }
  .nav .btn--primary { font-size: var(--t-small); padding: 12px 16px; min-height: 44px; }
  .cta-long { display: none; }

  .audit-open { padding: 11px 16px; font-size: var(--t-micro); }
  .forkbar__track { height: auto; flex-direction: column; }
  .forkbar__seg { width: 100%; padding: 12px 16px; }
  .forkbar__seg--a { border-right: 0; border-bottom: 1px solid var(--line); }
  .forkbar__foot { flex-direction: column; gap: 4px; }
  .donut { justify-content: center; }
  .audit__panel { padding-inline: var(--s-4); }
}

@media (max-width: 420px) {
  .payslider, .card, .outcome, .meter { border-radius: var(--r-md); }
}
