/* ============================================================
   Rupiah Stability Watch — stylesheet
   Aesthetic: after-hours watch desk. Deep navy ground, a single
   warm gold accent (the metal standard, value), editorial serif
   display married to monospace instrument numerals.
   ============================================================ */

:root {
  /* type — theme-independent */
  --display: "Fraunces", Georgia, "Times New Roman", serif;
  --body:    "Inter Tight", system-ui, sans-serif;
  --mono:    "IBM Plex Mono", ui-monospace, monospace;

  /* scale — theme-independent */
  --maxw: 1240px;
  --gutter: clamp(20px, 5vw, 64px);
}

/* ============================================================
   THEMES
   The whole site is built on a small set of semantic tokens
   (ink = grounds, paper = text, gold = accent, signal = cool
   secondary). Each theme just redefines those tokens, plus a
   few atmosphere values, so component styles never change and
   the dark theme cannot regress.

   Default (no attribute) is dark — the after-hours watch desk.
   [data-theme="light"] is daylight on the same desk: warm
   parchment ground, navy ink text, the same gold standard.
   ============================================================ */

/* ---- DARK (default) — deep navy ground, warm gold ---- */
:root,
:root[data-theme="dark"] {
  --ink:        #0a1024;   /* deepest navy ground */
  --ink-2:      #0f1730;   /* raised panel */
  --ink-3:      #16203f;   /* hairline / border */
  --paper:      #f2efe6;   /* warm off-white text */
  --paper-dim:  #aab0c4;   /* muted text */
  --paper-fade: #788099;   /* faintest text */
  --gold:       #e8b15a;   /* the accent — rupiah, value, warmth */
  --gold-soft:  #f3cd8b;
  --gold-deep:  #b9853a;
  --gold-ink:   #0a1024;   /* text that sits ON gold (e.g. buttons) */
  --signal:     #7fb3a3;   /* cool secondary, "stable" green-teal */
  --err:        #e09a8a;   /* form error text */

  /* atmosphere */
  --mesh-1:     rgba(232,177,90,0.10);
  --mesh-2:     rgba(127,179,163,0.07);
  --grain-op:   0.035;
  --grain-mode: normal;
  --topbar-bg:  rgba(10,16,36,0.78);
  --panel-grad: linear-gradient(180deg, var(--ink-2), rgba(15,23,48,0.6));
  --form-grad:  linear-gradient(180deg, var(--ink-2), rgba(15,23,48,0.55));
  --scanline:   rgba(232,177,90,0.025);
  --hatch:      rgba(255,255,255,0.012);
  --shadow-gold: 0 10px 30px rgba(232,177,90,0.22);
  --shadow-mark: 0 6px 18px rgba(232,177,90,0.25);
  --manifesto-mesh: rgba(232,177,90,0.12);
  --focus-ring: rgba(232,177,90,0.15);
  --pulse-on:  rgba(127,179,163,0.55);
  --pulse-off: rgba(127,179,163,0);

  color-scheme: dark;
}

/* ---- LIGHT — daylight parchment, navy ink, same gold ---- */
:root[data-theme="light"] {
  --ink:        #f4f1e8;   /* warm parchment ground */
  --ink-2:      #fbf9f2;   /* raised panel (lighter than ground) */
  --ink-3:      #ddd6c4;   /* hairline / border */
  --paper:      #16203f;   /* deep navy ink — primary text (12.8:1 on ground) */
  --paper-dim:  #46506b;   /* muted text (7.0:1 on ground) */
  --paper-fade: #646b80;   /* faintest text (4.7:1 on ground — AA) */
  --gold:       #8f6122;   /* burnt-amber accent — AA as text on parchment (4.8:1) */
  --gold-soft:  #7a521c;   /* "soft" = deeper here, for hover on light */
  --gold-deep:  #c9a567;   /* hairline-weight gold on light (borders only) */
  --gold-ink:   #fbf9f2;   /* parchment text that sits ON gold (5.1:1) */
  --signal:     #2f6f5e;   /* deeper teal for AA on light */
  --err:        #b23b28;   /* form error — AA on light */

  /* atmosphere */
  --mesh-1:     rgba(185,133,58,0.10);
  --mesh-2:     rgba(47,111,94,0.06);
  --grain-op:   0.04;
  --grain-mode: multiply;
  --topbar-bg:  rgba(244,241,232,0.82);
  --panel-grad: linear-gradient(180deg, var(--ink-2), rgba(244,241,232,0.7));
  --form-grad:  linear-gradient(180deg, var(--ink-2), rgba(244,241,232,0.6));
  --scanline:   rgba(185,133,58,0.045);
  --hatch:      rgba(22,32,63,0.018);
  --shadow-gold: 0 10px 30px rgba(185,133,58,0.18);
  --shadow-mark: 0 6px 16px rgba(185,133,58,0.28);
  --manifesto-mesh: rgba(185,133,58,0.16);
  --focus-ring: rgba(185,133,58,0.22);
  --pulse-on:  rgba(47,111,94,0.5);
  --pulse-off: rgba(47,111,94,0);

  color-scheme: light;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

body {
  margin: 0;
  background: var(--ink);
  color: var(--paper);
  font-family: var(--body);
  font-size: 17px;
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
  background-attachment: fixed;
  transition: background-color 0.35s ease, color 0.35s ease;
  /* atmosphere: layered radial meshes + faint grain */
  background-image:
    radial-gradient(ellipse 80% 50% at 78% -8%, var(--mesh-1), transparent 60%),
    radial-gradient(ellipse 60% 45% at 0% 100%, var(--mesh-2), transparent 55%);
}

/* subtle film-grain over everything */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 1;
  opacity: var(--grain-op);
  mix-blend-mode: var(--grain-mode);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

.mono { font-family: var(--mono); font-feature-settings: "tnum" 1; letter-spacing: -0.01em; }

a { color: inherit; }

.skip {
  position: absolute; left: -999px; top: 0;
  background: var(--gold); color: var(--gold-ink);
  padding: 10px 16px; z-index: 100; font-weight: 600;
}
.skip:focus { left: 12px; top: 12px; }

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

::selection { background: var(--gold); color: var(--gold-ink); }

/* ---------------- top bar ---------------- */
.topbar {
  position: sticky; top: 0; z-index: 50;
  display: flex; align-items: center; justify-content: space-between;
  gap: 20px;
  padding: 14px var(--gutter);
  background: var(--topbar-bg);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--ink-3);
}
.wordmark { display: inline-flex; align-items: center; gap: 12px; text-decoration: none; }
.wm-mark {
  display: grid; place-items: center;
  width: 34px; height: 34px;
  font-family: var(--display); font-weight: 900; font-size: 17px;
  color: var(--gold-ink);
  background: var(--gold);
  border-radius: 7px;
  box-shadow: 0 0 0 1px var(--gold-deep), var(--shadow-mark);
}
.wm-text { font-family: var(--display); font-weight: 600; font-size: 16px; letter-spacing: 0.01em; }
.nav { display: flex; align-items: center; gap: 26px; }
.nav a {
  text-decoration: none; color: var(--paper-dim);
  font-size: 14px; font-weight: 500; letter-spacing: 0.01em;
  transition: color 0.2s ease;
}
.nav a:hover, .nav a:focus-visible { color: var(--paper); }
.nav-cta {
  color: var(--gold) !important;
  border: 1px solid var(--gold-deep);
  padding: 7px 15px; border-radius: 999px;
}
.nav-cta:hover { background: var(--gold); color: var(--gold-ink) !important; }
@media (max-width: 820px) {
  .nav a:not(.nav-cta) { display: none; }
}

/* theme toggle */
.theme-toggle {
  display: inline-grid; place-items: center;
  width: 38px; height: 38px;
  margin-left: 4px;
  padding: 0;
  background: transparent;
  color: var(--paper-dim);
  border: 1px solid var(--ink-3);
  border-radius: 999px;
  cursor: pointer;
  transition: color 0.2s ease, border-color 0.2s ease, background 0.2s ease, transform 0.2s ease;
}
.theme-toggle:hover { color: var(--gold); border-color: var(--gold-deep); }
.theme-toggle:active { transform: scale(0.94); }
.theme-toggle svg { width: 18px; height: 18px; display: block; }
/* show sun in dark mode (offer light), moon in light mode (offer dark) */
.theme-toggle .icon-moon { display: none; }
.theme-toggle .icon-sun  { display: block; }
:root[data-theme="light"] .theme-toggle .icon-sun  { display: none; }
:root[data-theme="light"] .theme-toggle .icon-moon { display: block; }
@media (prefers-reduced-motion: reduce) {
  .theme-toggle { transition: none; }
}

/* ---------------- shared ---------------- */
main { position: relative; z-index: 2; }
section { padding: clamp(64px, 9vw, 130px) var(--gutter); max-width: var(--maxw); margin: 0 auto; }

.section-kicker {
  font-family: var(--mono); font-size: 12.5px; letter-spacing: 0.22em;
  text-transform: uppercase; color: var(--gold);
  margin: 0 0 18px;
}
.eyebrow {
  display: inline-flex; align-items: center; gap: 10px;
  font-family: var(--mono); font-size: 12.5px; letter-spacing: 0.16em;
  text-transform: uppercase; color: var(--paper-dim);
  margin: 0 0 26px;
}
.dot {
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--signal);
  box-shadow: 0 0 0 0 var(--pulse-on);
  animation: pulse 2.6s ease-out infinite;
}
@keyframes pulse {
  0% { box-shadow: 0 0 0 0 var(--pulse-on); }
  70% { box-shadow: 0 0 0 9px var(--pulse-off); }
  100% { box-shadow: 0 0 0 0 var(--pulse-off); }
}

/* buttons */
.btn {
  display: inline-block; text-decoration: none;
  font-weight: 600; font-size: 15px; letter-spacing: 0.01em;
  padding: 13px 24px; border-radius: 999px;
  transition: transform 0.18s ease, background 0.2s ease, color 0.2s ease, box-shadow 0.2s ease;
}
.btn-solid {
  background: var(--gold); color: var(--gold-ink);
  box-shadow: var(--shadow-gold);
}
.btn-solid:hover { transform: translateY(-2px); background: var(--gold-soft); }
.btn-ghost { color: var(--paper); border: 1px solid var(--ink-3); }
.btn-ghost:hover { border-color: var(--gold-deep); color: var(--gold-soft); }
.btn-block { width: 100%; text-align: center; border: 0; cursor: pointer; font-family: var(--body); }

/* ---------------- hero ---------------- */
.hero { padding-top: clamp(48px, 7vw, 90px); }
.hero-grid {
  display: grid; grid-template-columns: 1.35fr 0.85fr;
  gap: clamp(32px, 5vw, 72px); align-items: start;
}
.hero-copy h1 {
  font-family: var(--display);
  font-weight: 900;
  font-size: clamp(40px, 6.4vw, 86px);
  line-height: 1.02;
  letter-spacing: -0.02em;
  margin: 0 0 28px;
}
.hero-copy h1 em {
  font-style: italic; font-weight: 500; color: var(--gold);
}
.lede {
  font-size: clamp(17px, 1.6vw, 20px);
  color: var(--paper-dim); max-width: 56ch;
  margin: 0 0 34px;
}
.hero-actions { display: flex; flex-wrap: wrap; gap: 14px; }

/* instrument rail */
.instrument {
  background: var(--panel-grad);
  border: 1px solid var(--ink-3);
  border-radius: 16px;
  padding: 26px;
  position: relative;
  overflow: hidden;
}
.instrument::after {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background: repeating-linear-gradient(180deg, transparent 0 27px, var(--scanline) 27px 28px);
}
.inst-head { display: flex; flex-direction: column; gap: 4px; margin-bottom: 18px; }
.inst-label { font-family: var(--mono); font-size: 11px; letter-spacing: 0.2em; color: var(--gold); }
.inst-sub { font-family: var(--mono); font-size: 12.5px; color: var(--paper-dim); }
.inst-figure { display: flex; flex-direction: column; gap: 2px; margin-bottom: 16px; }
.inst-num {
  font-family: var(--mono); font-weight: 600;
  font-size: clamp(44px, 6vw, 60px); line-height: 1; color: var(--paper);
  letter-spacing: -0.02em;
}
.inst-sep { color: var(--gold); }
.inst-unit { font-family: var(--mono); font-size: 12.5px; color: var(--paper-dim); letter-spacing: 0.04em; }

/* live-rate states */
.inst-skel {
  display: inline-block; color: var(--paper-fade); opacity: 0.55;
  animation: instPulse 1.4s ease-in-out infinite;
}
@keyframes instPulse { 0%, 100% { opacity: 0.30; } 50% { opacity: 0.7; } }
.inst-dash { color: var(--paper-fade); }
.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

/* a small state badge in the head, driven by data-state */
.inst-head { position: relative; }
.inst-head::before {
  content: ""; position: absolute; top: 4px; right: 0;
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--paper-fade); opacity: 0.5;
}
.instrument[data-state="loading"] .inst-head::before {
  background: var(--paper-fade);
  animation: instPulse 1.2s ease-in-out infinite;
}
.instrument[data-state="live"] .inst-head::before {
  background: #36c98a; opacity: 1;
  box-shadow: 0 0 0 4px rgba(54, 201, 138, 0.16);
}
.instrument[data-state="unavailable"] .inst-head::before {
  background: var(--gold); opacity: 0.85;
}

.inst-meta { font-size: 13px; color: var(--paper-dim); margin: 0 0 18px; line-height: 1.6; }
.inst-meta strong { color: var(--paper); font-weight: 600; }
.inst-loading-txt { color: var(--paper-fade); }
.inst-unavail {
  font-size: 13.5px; color: var(--paper-dim); margin: 0 0 18px; line-height: 1.6;
  padding: 12px 14px; border-left: 2px solid var(--gold);
  background: var(--scanline); border-radius: 0 8px 8px 0;
}

.inst-pairs { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--ink-3); }
.inst-pairs li {
  display: flex; align-items: baseline; justify-content: space-between; gap: 12px;
  padding: 11px 0; border-bottom: 1px solid var(--ink-3);
}
.inst-pairs li span:first-child { font-family: var(--mono); font-weight: 600; color: var(--gold-soft); font-size: 14px; }
.inst-pairs .pair-val { font-size: 13px; color: var(--paper); text-align: right; font-weight: 500; }
.instrument[data-state="unavailable"] .inst-pairs .pair-val { color: var(--paper-fade); }
.inst-source { font-size: 11.5px; color: var(--paper-fade); margin: 14px 0 0; line-height: 1.5; }
.inst-source a { color: var(--gold-soft); text-decoration: underline; text-underline-offset: 2px; }
.inst-source a:hover { color: var(--gold); }

@media (max-width: 880px) {
  .hero-grid { grid-template-columns: 1fr; }
  .instrument { max-width: 460px; }
}

/* ---------------- stat band ---------------- */
.band {
  display: grid; grid-template-columns: repeat(4, 1fr);
  gap: 1px; background: var(--ink-3);
  border-top: 1px solid var(--ink-3); border-bottom: 1px solid var(--ink-3);
  max-width: none; padding: 0;
}
.band-item {
  background: var(--ink);
  padding: clamp(32px, 4vw, 50px) var(--gutter);
  display: flex; flex-direction: column; gap: 12px;
}
.band-num {
  font-family: var(--display); font-weight: 900;
  font-size: clamp(38px, 5vw, 60px); line-height: 1; color: var(--gold);
}
.band-cap { font-size: 14px; color: var(--paper-dim); line-height: 1.5; max-width: 24ch; }
@media (max-width: 880px) { .band { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 480px) { .band { grid-template-columns: 1fr; } }

/* ---------------- statement / mandate ---------------- */
.statement-h {
  font-family: var(--display); font-weight: 500;
  font-size: clamp(28px, 3.8vw, 50px); line-height: 1.12;
  letter-spacing: -0.015em; margin: 0 0 40px; max-width: 22ch;
}
.statement-h em { font-style: italic; color: var(--gold); }
.statement-body { display: grid; grid-template-columns: 1fr 1fr; gap: 28px 48px; max-width: 1000px; }
.statement-body p { margin: 0; color: var(--paper-dim); }
.limits {
  grid-column: 1 / -1;
  border-left: 2px solid var(--gold-deep);
  padding: 16px 22px; background: var(--ink-2);
  border-radius: 0 10px 10px 0; color: var(--paper) !important;
  font-size: 15.5px;
}
.limits-label { color: var(--gold); font-weight: 600; }
@media (max-width: 720px) { .statement-body { grid-template-columns: 1fr; } }

/* ---------------- what we watch / pillars ---------------- */
.watch-head { max-width: 60ch; margin-bottom: 52px; }
.watch-head h2 {
  font-family: var(--display); font-weight: 600;
  font-size: clamp(28px, 4vw, 46px); line-height: 1.08; margin: 0 0 18px;
  letter-spacing: -0.015em;
}
.watch-intro { color: var(--paper-dim); margin: 0; }
.pillars {
  list-style: none; margin: 0; padding: 0;
  display: grid; grid-template-columns: 1fr 1fr; gap: 1px;
  background: var(--ink-3); border: 1px solid var(--ink-3); border-radius: 16px; overflow: hidden;
}
.pillar {
  background: var(--ink); padding: clamp(28px, 3.5vw, 44px);
  position: relative; transition: background 0.25s ease;
}
.pillar:hover { background: var(--ink-2); }
.pillar-no {
  font-family: var(--mono); font-size: 13px; color: var(--gold);
  letter-spacing: 0.1em;
}
.pillar h3 {
  font-family: var(--display); font-weight: 600; font-size: 24px;
  margin: 14px 0 12px; letter-spacing: -0.01em;
}
.pillar p { margin: 0; color: var(--paper-dim); font-size: 15.5px; }
@media (max-width: 720px) { .pillars { grid-template-columns: 1fr; } }

/* ---------------- manifesto pull quote ---------------- */
.manifesto {
  background:
    radial-gradient(ellipse 70% 120% at 50% 0%, var(--manifesto-mesh), transparent 60%),
    var(--ink-2);
  border-top: 1px solid var(--ink-3); border-bottom: 1px solid var(--ink-3);
  max-width: none; text-align: center;
}
.manifesto blockquote { margin: 0 auto; max-width: 18ch; }
.manifesto p {
  font-family: var(--display); font-weight: 500; font-style: italic;
  font-size: clamp(28px, 5vw, 58px); line-height: 1.12;
  letter-spacing: -0.02em; margin: 0;
  max-width: 22ch; margin-inline: auto;
  text-wrap: balance;
}

/* ---------------- how we work / steps ---------------- */
.work-head { margin-bottom: 48px; }
.work-head h2 {
  font-family: var(--display); font-weight: 600;
  font-size: clamp(28px, 4vw, 46px); margin: 0; letter-spacing: -0.015em;
}
.steps { display: grid; grid-template-columns: repeat(4, 1fr); gap: 22px; }
.step {
  border-top: 2px solid var(--gold-deep);
  padding-top: 20px;
}
.step-no { font-family: var(--mono); font-size: 14px; color: var(--gold); letter-spacing: 0.06em; }
.step h3 { font-family: var(--display); font-weight: 600; font-size: 21px; margin: 12px 0 10px; }
.step p { margin: 0; color: var(--paper-dim); font-size: 15px; }
@media (max-width: 860px) { .steps { grid-template-columns: 1fr 1fr; } }
@media (max-width: 480px) { .steps { grid-template-columns: 1fr; } }

/* ---------------- publications ---------------- */
.pubs-head { margin-bottom: 36px; max-width: 720px; }
.pubs-head h2 {
  font-family: var(--display); font-weight: 600;
  font-size: clamp(26px, 3.6vw, 42px); margin: 0; letter-spacing: -0.015em;
}
.pubs-intro { color: var(--paper-dim); margin: 16px 0 0; font-size: 15.5px; line-height: 1.6; }

.pubs-list {
  list-style: none; margin: 0 0 28px; padding: 0;
  border-top: 1px solid var(--ink-3);
}
.pub {
  display: grid; grid-template-columns: 168px 1fr; gap: 28px;
  padding: 28px 0; border-bottom: 1px solid var(--ink-3);
  transition: background 0.25s ease;
}
.pub:hover { background: var(--scanline); }
.pub-meta { display: flex; flex-direction: column; gap: 8px; padding-top: 4px; }
.pub-date { font-size: 13px; color: var(--paper); letter-spacing: 0.02em; }
.pub-kind {
  font-size: 11px; letter-spacing: 0.16em; text-transform: uppercase;
  color: var(--gold); align-self: start;
  padding: 3px 9px; border: 1px solid var(--ink-3); border-radius: 999px;
}
.pub-title {
  font-family: var(--display); font-weight: 600; font-size: clamp(20px, 2.4vw, 27px);
  line-height: 1.2; margin: 0 0 10px; letter-spacing: -0.01em; color: var(--paper);
}
.pub-excerpt { margin: 0; color: var(--paper-dim); font-size: 15.5px; line-height: 1.65; max-width: 62ch; }
.pubs-cta { color: var(--paper); margin: 0; }
.pubs-cta a { color: var(--gold); text-decoration: underline; text-underline-offset: 3px; }
@media (max-width: 720px) {
  .pub { grid-template-columns: 1fr; gap: 12px; }
  .pub-meta { flex-direction: row; align-items: center; gap: 14px; }
}

/* ---------------- reach / form ---------------- */
.reach-grid { display: grid; grid-template-columns: 1fr 1fr; gap: clamp(32px, 5vw, 72px); align-items: start; }
.reach-copy h2 {
  font-family: var(--display); font-weight: 600;
  font-size: clamp(28px, 3.8vw, 46px); line-height: 1.08; margin: 0 0 22px;
  letter-spacing: -0.015em; max-width: 16ch;
}
.reach-copy p { color: var(--paper-dim); margin: 0 0 18px; }
.reach-promise {
  font-size: 14.5px; border-left: 2px solid var(--signal);
  padding-left: 18px; color: var(--paper-fade) !important;
}
.form {
  background: var(--form-grad);
  border: 1px solid var(--ink-3); border-radius: 18px;
  padding: clamp(24px, 3vw, 36px);
}
.field { margin-bottom: 20px; display: flex; flex-direction: column; gap: 8px; }
.field label { font-size: 14px; font-weight: 500; color: var(--paper); }
.opt { color: var(--paper-fade); font-weight: 400; }
.req {
  font-family: var(--mono); font-size: 10px; letter-spacing: 0.12em; text-transform: uppercase;
  color: var(--gold); border: 1px solid var(--gold-deep); border-radius: 4px;
  padding: 1px 6px; margin-left: 4px;
}
.field input, .field textarea {
  width: 100%; font-family: var(--body); font-size: 15.5px;
  color: var(--paper); background: var(--ink);
  border: 1px solid var(--ink-3); border-radius: 10px;
  padding: 13px 15px; resize: vertical;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}
.field input::placeholder, .field textarea::placeholder { color: var(--paper-fade); }
.field input:focus, .field textarea:focus {
  outline: none; border-color: var(--gold-deep);
  box-shadow: 0 0 0 3px var(--focus-ring);
}
.form-status { margin: 16px 0 0; font-size: 14.5px; min-height: 1.2em; }
.form-status.ok { color: var(--signal); }
.form-status.err { color: var(--err); }
@media (max-width: 820px) { .reach-grid { grid-template-columns: 1fr; } }

/* ---------------- footer ---------------- */
.footer {
  position: relative; z-index: 2;
  border-top: 1px solid var(--ink-3);
  padding: clamp(48px, 6vw, 72px) var(--gutter) 40px;
  background: var(--ink-2);
}
.foot-top {
  max-width: var(--maxw); margin: 0 auto clamp(28px, 4vw, 44px);
  display: flex; align-items: center; justify-content: space-between; gap: 18px; flex-wrap: wrap;
}
.foot-brand { display: inline-flex; align-items: center; gap: 12px; font-family: var(--display); font-weight: 600; font-size: 18px; }
.foot-brand .wm-mark { width: 30px; height: 30px; font-size: 15px; }
.foot-tag { font-family: var(--display); font-style: italic; color: var(--paper-dim); margin: 0; }
.foot-bottom { max-width: var(--maxw); margin: 0 auto; border-top: 1px solid var(--ink-3); padding-top: 26px; }
.foot-bottom > p:first-child { color: var(--paper-dim); margin: 0 0 18px; max-width: 70ch; font-size: 15px; }
.foot-meta { display: flex; flex-direction: column; gap: 4px; font-size: 12px; color: var(--paper-fade); letter-spacing: 0.02em; }

/* ---------------- reveal animation ---------------- */
.reveal { opacity: 0; transform: translateY(22px); transition: opacity 0.7s ease, transform 0.7s ease; }
.reveal.in { opacity: 1; transform: none; }
/* staggered hero load */
.hero-copy .eyebrow,
.hero-copy h1,
.hero-copy .lede,
.hero-copy .hero-actions,
.instrument {
  opacity: 0; animation: rise 0.8s cubic-bezier(0.2,0.7,0.2,1) forwards;
}
.hero-copy .eyebrow { animation-delay: 0.05s; }
.hero-copy h1 { animation-delay: 0.16s; }
.hero-copy .lede { animation-delay: 0.30s; }
.hero-copy .hero-actions { animation-delay: 0.42s; }
.instrument { animation-delay: 0.34s; }
@keyframes rise { from { opacity: 0; transform: translateY(26px); } to { opacity: 1; transform: none; } }

@media (prefers-reduced-motion: reduce) {
  .reveal { opacity: 1 !important; transform: none !important; transition: none; }
  .hero-copy .eyebrow, .hero-copy h1, .hero-copy .lede,
  .hero-copy .hero-actions, .instrument { animation: none; opacity: 1; }
  .dot { animation: none; }
}

/* focus visibility */
:focus-visible { outline: 2px solid var(--gold); outline-offset: 3px; border-radius: 4px; }

/* ---------------- hero endorse (vote widget) ---------------- */
.hero-endorse {
  margin-top: 24px;
  display: flex;
  align-items: center;
  justify-content: flex-start;
}
.hero-endorse [data-aga-vote="org"] {
  display: inline-flex;
  align-items: center;
}

/* ---------------- publications index vote mounts ---------------- */
.pubs-list [data-aga-vote-pub] {
  position: relative;
}
.pubs-list [data-aga-vote-pub] > :first-child {
  position: relative;
  z-index: 1;
}

/* ---------------- the record: archive + reader (publications.html) ---------------- */
.archive-state { color: var(--paper-dim); font-size: 13px; letter-spacing: 0.04em; margin: 18px 0; }
.archive-error { color: var(--err); }
a.pub-row { text-decoration: none; color: inherit; }
.pub-readmore { display: inline-block; margin-top: 12px; font-size: 12px; letter-spacing: 0.14em; text-transform: uppercase; color: var(--gold); }
a.pub-row:hover .pub-title { color: var(--gold); }
.reader { max-width: 760px; margin: 0 auto; padding: clamp(40px, 7vw, 88px) var(--gutter) 80px; }
.reader-back { margin: 0 0 28px; }
.reader-back a { color: var(--gold); text-decoration: none; font-size: 14px; }
.reader-back a:hover { text-decoration: underline; text-underline-offset: 3px; }
.reader-meta { flex-direction: row; gap: 14px; align-items: center; display: flex; margin-bottom: 18px; }
.reader-title { font-family: var(--display); font-weight: 600; font-size: clamp(30px, 4.6vw, 46px); line-height: 1.12; letter-spacing: -0.015em; color: var(--paper); margin: 0 0 30px; }
.reader-body { color: var(--paper); font-size: 17px; line-height: 1.75; }
.reader-body p { margin: 0 0 1.25em; color: var(--paper); }
.reader-body h2, .reader-body h3, .reader-body h4 { font-family: var(--display); font-weight: 600; line-height: 1.2; color: var(--paper); margin: 1.8em 0 0.7em; }
.reader-body h2 { font-size: clamp(22px, 3vw, 30px); }
.reader-body h3 { font-size: clamp(19px, 2.4vw, 24px); }
.reader-body ul { margin: 0 0 1.25em; padding-left: 1.3em; }
.reader-body li { margin: 0.35em 0; }
.reader-body blockquote { margin: 1.6em 0; padding: 4px 0 4px 20px; border-left: 2px solid var(--gold); }
.reader-body blockquote p { color: var(--paper-dim); font-style: italic; margin: 0; }
.reader-body code { font-family: var(--mono); font-size: 0.9em; background: var(--ink-2); padding: 1px 6px; border-radius: 5px; }
.reader-body a { color: var(--gold); text-decoration: underline; text-underline-offset: 3px; }
@media (max-width: 720px) { .reader { padding-top: 36px; } }

/* ---------------- marked.js GFM output styles ---------------- */
.reader-body table {
  width: 100%;
  border-collapse: collapse;
  margin: 1.5em 0;
  font-size: 0.95em;
}
.reader-body th,
.reader-body td {
  border: 1px solid var(--ink-3);
  padding: 8px 12px;
  text-align: left;
}
.reader-body th {
  background: var(--ink-2);
  font-weight: 600;
  color: var(--paper);
}
.reader-body td {
  color: var(--paper);
}
.reader-body tr:nth-child(even) td {
  background: var(--ink-2);
}
.reader-body caption {
  font-family: var(--display);
  font-weight: 500;
  margin-bottom: 0.5em;
  color: var(--gold);
}
.reader-body pre {
  background: var(--ink-2);
  border: 1px solid var(--ink-3);
  border-radius: 8px;
  padding: 16px;
  overflow-x: auto;
  margin: 1.5em 0;
}
.reader-body pre code {
  background: transparent;
  padding: 0;
  border-radius: 0;
  font-size: 0.9em;
  line-height: 1.6;
  color: var(--paper);
}
.reader-body code {
  font-family: var(--mono);
  font-size: 0.9em;
  background: var(--ink-2);
  padding: 1px 6px;
  border-radius: 5px;
}
.reader-body hr {
  border: 0;
  border-top: 1px solid var(--ink-3);
  margin: 2em 0;
}
.reader-body ol {
  margin: 0 0 1.25em;
  padding-left: 1.3em;
}
.reader-body ul ul,
.reader-body ol ol,
.reader-body ul ol,
.reader-body ol ul {
  margin: 0.5em 0;
}
.reader-body li > p {
  margin: 0.25em 0;
}
.reader-body img {
  max-width: 100%;
  height: auto;
  border-radius: 8px;
  margin: 1.5em 0;
}
.reader-body blockquote {
  margin: 1.6em 0;
  padding: 4px 0 4px 20px;
  border-left: 2px solid var(--gold);
}
.reader-body blockquote p {
  color: var(--paper-dim);
  font-style: italic;
  margin: 0;
}
