/* ==========================================================================
   Rito — rito-retire.netlify.app
   Brand: ink #0F2E33 · green #13564E · ochre #E39A2B · paper #FBFCFB
          mist #EAF0EE · slate #54666C · line #D6E0DE · brick #B3412F
   Type:  Newsreader (display) · Public Sans (body) · IBM Plex Mono (data)
   Rules: body ≥16px, captions ≥12px · ochre never carries text on light
          grounds · one ochre accent per view · AA contrast minimum
   ========================================================================== */

:root {
  --ink: #0F2E33;
  --ink-raised: #16383E;
  --ink-line: #2A4A4E;
  --green: #13564E;
  --green-deep: #0E423C;
  --ochre: #E39A2B;
  --paper: #FBFCFB;
  --mist: #EAF0EE;
  --slate: #54666C;
  --teal-muted: #9FB5B4; /* muted text on ink surfaces */
  --line: #D6E0DE;
  --brick: #B3412F;
  --brick-tint: #F8E8E6;

  --font-display: "Newsreader", Georgia, "Iowan Old Style", serif;
  --font-body: "Public Sans", -apple-system, "Segoe UI", "Helvetica Neue", sans-serif;
  --font-mono: "IBM Plex Mono", ui-monospace, "SF Mono", monospace;

  --wrap: 1180px;
  --radius: 12px;
}

/* ---------- Base ---------- */

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

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 17px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}

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

a { color: var(--green); }
a:hover, a:focus-visible { color: var(--ink); }

:focus-visible {
  outline: 3px solid var(--green);
  outline-offset: 2px;
  border-radius: 2px;
}

.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  background: var(--ink);
  color: var(--paper);
  padding: 10px 18px;
  z-index: 100;
}
.skip-link:focus { left: 12px; top: 12px; color: var(--paper); }

.wrap {
  max-width: var(--wrap);
  margin: 0 auto;
  padding: 0 24px;
}

/* ---------- Typography ---------- */

h1, h2, h3 {
  font-family: var(--font-display);
  font-weight: 600;
  line-height: 1.12;
  letter-spacing: -0.015em;
  margin: 0 0 0.4em;
}

h1 { font-size: clamp(38px, 5.2vw, 60px); }
h2 { font-size: clamp(28px, 3.6vw, 40px); }
h3 { font-size: clamp(19px, 2vw, 23px); line-height: 1.3; }

p { margin: 0 0 1em; }

.lede {
  font-size: clamp(17px, 1.6vw, 19px);
  color: var(--slate);
  max-width: 64ch;
}

.eyebrow {
  font-family: var(--font-mono);
  font-size: 12.5px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--green);
  margin: 0 0 14px;
}

.on-ink .eyebrow, .eyebrow.ochre { color: var(--ochre); }

.mono { font-family: var(--font-mono); }

/* ---------- Header ---------- */

.site-header {
  border-bottom: 1px solid var(--mist);
  background: var(--paper);
  position: sticky;
  top: 0;
  z-index: 60;
  transition: box-shadow 0.25s ease;
}
.site-header.scrolled { box-shadow: 0 2px 14px rgba(15, 46, 51, 0.08); }

.site-header .wrap {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 24px;
  padding-top: 16px;
  padding-bottom: 16px;
}

.wordmark {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 27px;
  letter-spacing: -0.02em;
  color: var(--ink);
  text-decoration: none;
  white-space: nowrap;
}
.wordmark .stop { color: var(--ochre); }
.wordmark:hover, .wordmark:focus-visible { color: var(--ink); }

.site-nav {
  display: flex;
  align-items: center;
  gap: 28px;
}

.site-nav a {
  font-size: 15.5px;
  font-weight: 500;
  color: var(--ink);
  text-decoration: none;
  padding: 6px 0;
}
.site-nav a:not(.btn) { position: relative; }
.site-nav a:not(.btn)::after {
  content: "";
  position: absolute;
  left: 0; right: 0; bottom: 0;
  height: 2px;
  background: var(--ochre);
  border-radius: 1px;
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.28s cubic-bezier(0.22, 1, 0.36, 1);
}
.site-nav a:not(.btn):hover::after { transform: scaleX(1); }
.site-nav a:hover { color: var(--green); }
.site-nav .btn {
  padding: 13px 30px;
  color: #FFFFFF;
  font-size: 15.5px;
}
.site-nav a[aria-current="page"] {
  color: var(--green);
  box-shadow: 0 2px 0 var(--green);
}

.nav-toggle {
  display: none;
  background: none;
  border: 1.5px solid var(--line);
  border-radius: 8px;
  padding: 9px 11px;
  cursor: pointer;
  color: var(--ink);
}

.header-right { display: flex; align-items: center; gap: 18px; }

.theme-toggle {
  background: none;
  border: 1.5px solid var(--line);
  border-radius: 8px;
  padding: 8px 10px;
  cursor: pointer;
  color: var(--ink);
  display: inline-flex;
  align-items: center;
  transition: border-color 0.2s, color 0.2s;
}
.theme-toggle:hover { border-color: var(--green); color: var(--green); }
.theme-toggle svg { display: block; }
.theme-toggle .icon-sun { display: none; }
html[data-theme="dark"] .theme-toggle .icon-moon { display: none; }
html[data-theme="dark"] .theme-toggle .icon-sun { display: block; }

/* ---------- Buttons ---------- */

.btn {
  display: inline-block;
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 16px;
  text-decoration: none;
  text-align: center;
  border-radius: 8px;
  padding: 14px 26px;
  border: 1.5px solid transparent;
  cursor: pointer;
  transition: background 0.15s, color 0.15s, border-color 0.15s;
}

.btn-primary { background: var(--green); color: var(--paper); }
.btn-primary:hover, .btn-primary:focus-visible { background: var(--green-deep); color: var(--paper); }

.btn-sun { background: var(--ochre); color: var(--ink); font-weight: 700; }
.btn-sun:hover, .btn-sun:focus-visible { background: #D18E24; color: var(--ink); }

.btn-ghost { border-color: var(--line); color: var(--ink); background: transparent; }
.btn-ghost:hover, .btn-ghost:focus-visible { border-color: var(--green); color: var(--green); }

.on-ink .btn-ghost { border-color: var(--ink-line); color: var(--paper); }
.on-ink .btn-ghost:hover, .on-ink .btn-ghost:focus-visible { border-color: var(--teal-muted); color: var(--paper); }

/* ---------- Sections ---------- */

section { padding: 76px 0; }
section.tight { padding: 48px 0; }

.on-ink {
  background: var(--ink);
  color: var(--paper);
}
.on-ink h1, .on-ink h2, .on-ink h3 { color: var(--paper); }
.on-ink p, .on-ink .lede, .on-ink li { color: var(--teal-muted); }

.on-mist { background: var(--mist); }

/* ---------- Hero ---------- */

.hero {
  padding: 88px 0 0;
  text-align: center;
}

.hero .lede { margin: 0 auto 28px; }
.on-ink.hero .lede, .on-ink .hero .lede { color: var(--teal-muted); }
.hero.inner:not(.on-ink) .lede { color: var(--slate); }

.hero-question {
  display: block;
  font-family: var(--font-display);
  font-style: italic;
  font-size: clamp(21px, 2.4vw, 27px);
  color: var(--paper);
  margin-bottom: 10px;
}

.hero-actions {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 14px;
  margin-bottom: 12px;
}

.hero-horizon { display: block; width: 100%; height: auto; margin-top: 28px; }

.hero.inner {
  padding: 64px 0;
  text-align: left;
}
.hero.inner .lede { margin: 0 0 8px; }

/* ---------- Stat strip ---------- */

.stat-strip {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 1px;
  background: var(--line);
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.stat {
  background: var(--paper);
  padding: 30px 28px;
}

.stat .num {
  font-family: var(--font-mono);
  font-weight: 500;
  font-size: clamp(28px, 3vw, 38px);
  color: var(--green);
  display: block;
  margin-bottom: 6px;
}

.stat .cap {
  font-size: 14px;
  line-height: 1.5;
  color: var(--slate);
}

.source-note {
  font-size: 12px;
  color: var(--slate);
  text-align: right;
  padding: 10px 24px 0;
  max-width: var(--wrap);
  margin: 0 auto;
}

/* ---------- Cards & grids ---------- */

.grid-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 24px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 20px; }

.card {
  background: #FFFFFF;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 32px;
}

.card.ink { background: var(--ink); border-color: var(--ink); }
.card.ink h3 { color: var(--paper); }
.card.ink p, .card.ink li { color: var(--teal-muted); }

.card.mist { background: var(--mist); border-color: var(--mist); }

.tag {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: 11.5px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  border-radius: 5px;
  padding: 5px 10px;
  margin-bottom: 14px;
}
.tag.green { background: var(--mist); color: var(--green); }
.tag.sun { background: var(--ochre); color: var(--ink); }

.checklist { list-style: none; margin: 0; padding: 0; }
.checklist li {
  position: relative;
  padding-left: 30px;
  margin-bottom: 12px;
  font-size: 15.5px;
  line-height: 1.55;
  color: var(--slate);
}
.checklist li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 5px;
  width: 16px;
  height: 16px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 18 18' fill='none'%3E%3Cpath d='M3 9.5 L7 13.5 L15 4.5' stroke='%2313564E' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-size: contain;
  background-repeat: no-repeat;
}
.on-ink .checklist li, .card.ink .checklist li { color: #D9E4E2; }
.card.ink .checklist li::before,
.on-ink .checklist li::before {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 18 18' fill='none'%3E%3Cpath d='M3 9.5 L7 13.5 L15 4.5' stroke='%23E39A2B' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
}

/* score chip used on home + members pages */
.score-chip {
  display: flex;
  align-items: center;
  gap: 18px;
  background: var(--mist);
  border-radius: 10px;
  padding: 18px 22px;
  margin: 18px 0;
}
.score-chip .score {
  font-family: var(--font-mono);
  font-weight: 500;
  font-size: 44px;
  color: var(--green);
  line-height: 1;
}
.score-chip .label { font-weight: 600; font-size: 15px; }
.score-chip .sub { font-size: 13px; color: var(--slate); }

/* cohort mini-table on ink cards */
.cohort-rows { background: var(--ink-raised); border-radius: 10px; padding: 18px 22px; margin: 18px 0; }
.cohort-rows .row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 16px;
  padding: 6px 0;
  font-size: 14.5px;
}
.cohort-rows .row span:first-child { color: var(--paper); }
.cohort-rows .row .n { font-family: var(--font-mono); color: var(--ochre); }
.cohort-rows .foot { font-size: 12px; color: var(--teal-muted); padding-top: 8px; }

/* objective cards */
.obj-num { font-family: var(--font-mono); font-size: 12px; color: var(--green); letter-spacing: 0.08em; margin-bottom: 8px; }

.callout {
  background: var(--mist);
  border-radius: var(--radius);
  padding: 22px 28px;
  font-size: 15.5px;
  line-height: 1.6;
}

.callout.brick { background: var(--brick-tint); }

/* ---------- Trust band ---------- */

.trust-band { padding: 60px 0; }
.trust-item svg { display: block; margin-bottom: 12px; }
.trust-item h3 { font-family: var(--font-body); font-weight: 600; font-size: 17px; letter-spacing: 0; }
.trust-item p { font-size: 14.5px; }

/* ---------- Forms ---------- */

.form-row {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 8px;
}

input[type="text"], input[type="email"], select, textarea {
  font-family: var(--font-body);
  font-size: 16px;
  color: var(--ink);
  background: #FFFFFF;
  border: 1.5px solid var(--line);
  border-radius: 8px;
  padding: 13px 16px;
  min-width: 0;
}
input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: var(--green);
  box-shadow: 0 0 0 3px rgba(19, 86, 78, 0.15);
}

label { font-weight: 600; font-size: 15px; display: block; margin-bottom: 6px; }

.field { margin-bottom: 18px; }
.field input, .field select, .field textarea { width: 100%; }

.checkbox-row {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  font-size: 14px;
  font-weight: 400;
  color: var(--slate);
  margin-bottom: 16px;
  cursor: pointer;
}
.checkbox-row input {
  width: 18px;
  height: 18px;
  margin-top: 2px;
  flex: none;
  accent-color: var(--green);
}

.form-note { font-size: 13px; color: var(--slate); margin-top: 10px; }

.hidden { display: none !important; }

/* ---------- Footer ---------- */

.site-footer {
  background: var(--ink);
  color: var(--teal-muted);
  padding: 40px 0 28px;
}

.footer-top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  flex-wrap: wrap;
  gap: 28px;
  margin-bottom: 18px;
}

.footer-brand .wordmark { color: var(--paper); font-size: 29px; }
.footer-brand p { margin: 6px 0 0; font-size: 14px; }

.footer-tagline { display: flex; align-items: center; gap: 12px; margin-top: 6px; }
.footer-tagline p { margin: 0; font-size: 14px; }
.footer-mark { display: block; flex: none; overflow: visible; }
@keyframes fm-rise {
  0%, 100% { transform: translateY(4px); opacity: 0.5; }
  50%      { transform: translateY(-1px); opacity: 1; }
}
html.js .footer-mark .fm-sun { animation: fm-rise 7s ease-in-out infinite; }

.footer-nav { display: flex; gap: 56px; }
.footer-nav div { display: flex; flex-direction: column; gap: 4px; }
.footer-nav a {
  color: var(--paper);
  text-decoration: none;
  font-size: 14.5px;
  line-height: 1.9;
}
.footer-nav a:hover { color: var(--teal-muted); }

.footer-legal {
  border-top: 1px solid var(--ink-line);
  padding-top: 16px;
  font-size: 13px;
  line-height: 1.6;
}
.footer-legal p { margin: 0 0 8px; color: var(--teal-muted); max-width: 900px; }

/* ---------- Page-specific helpers ---------- */

.split {
  display: grid;
  grid-template-columns: 1.15fr 1fr;
  gap: 48px;
  align-items: center;
}

.faq-item { border-bottom: 1px solid var(--line); padding: 20px 0; }
.faq-item h3 { margin-bottom: 6px; }
.faq-item p { color: var(--slate); margin: 0; font-size: 15.5px; }

.timeline { list-style: none; margin: 24px 0 0; padding: 0; border-left: 2px solid var(--line); }
.timeline li { position: relative; padding: 0 0 26px 26px; }
.timeline li::before {
  content: "";
  position: absolute;
  left: -7px;
  top: 5px;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--paper);
  border: 2.5px solid var(--green);
}
.timeline .when { font-family: var(--font-mono); font-size: 12.5px; color: var(--green); letter-spacing: 0.06em; }
.timeline h3 { margin: 4px 0 6px; }
.timeline p { font-size: 15px; color: var(--slate); margin: 0; }

/* ---------- Responsive ---------- */

@media (max-width: 920px) {
  .grid-3 { grid-template-columns: 1fr; }
  .grid-2 { grid-template-columns: 1fr; }
  .split { grid-template-columns: 1fr; gap: 32px; }
  .stat-strip { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .footer-nav { gap: 36px; }
}

@media (max-width: 720px) {
  section { padding: 56px 0; }
  .hero { padding-top: 56px; }

  .nav-toggle { display: block; }

  .site-nav {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    background: var(--paper);
    border-bottom: 1px solid var(--line);
    padding: 8px 24px 16px;
    z-index: 50;
  }
  .site-nav.open { display: flex; }
  .site-nav a { padding: 12px 0; font-size: 17px; border-bottom: 1px solid var(--mist); }
  .site-nav a:last-of-type { border-bottom: 0; }
  .site-nav .btn { margin-top: 10px; }

  /* sticky header is already a positioned ancestor for the dropdown nav */

  .hero-actions { flex-direction: column; align-items: stretch; }
  .form-row { flex-direction: column; }
  .form-row .btn { width: 100%; }
}

@media (max-width: 480px) {
  .stat-strip { grid-template-columns: 1fr; }
}

/* ==========================================================================
   Motion & interaction — calm, paced, always optional.
   Gated on html.js (added by main.js): with JavaScript off the site is fully
   visible, and prefers-reduced-motion turns everything static.
   ========================================================================== */

/* ---------- Ochre accents ---------- */

.eyebrow::before {
  content: "";
  display: inline-block;
  width: 20px;
  height: 2px;
  background: var(--ochre);
  border-radius: 1px;
  vertical-align: middle;
  margin-right: 10px;
}

/* highlighter sweep behind key phrases — the band carries no text,
   so the ochre-on-light contrast rule holds */
.hl {
  background-image: linear-gradient(transparent 56%, rgba(227, 154, 43, 0.45) 56%, rgba(227, 154, 43, 0.45) 94%, transparent 94%);
  background-repeat: no-repeat;
  background-size: 100% 100%;
}
/* on dark grounds a translucent band muddies to brown — use a full-strength
   ochre stroke that sits under the text instead of behind it */
.on-ink .hl {
  background-image: linear-gradient(transparent 80%, var(--ochre) 80%, var(--ochre) 97%, transparent 97%);
}
html.js .hl {
  background-size: 0% 100%;
  transition: background-size 0.8s cubic-bezier(0.22, 1, 0.36, 1) 0.25s;
}
html.js .hl.hl-in { background-size: 100% 100%; }

/* ---------- Story section (homepage journey) ---------- */

.story p {
  font-size: clamp(18px, 1.8vw, 21px);
  line-height: 1.7;
  color: var(--slate);
  max-width: 58ch;
  margin-bottom: 1.2em;
}

.pull-line {
  font-family: var(--font-display);
  font-style: italic;
  font-weight: 500;
  font-size: clamp(27px, 4vw, 42px);
  line-height: 1.25;
  letter-spacing: -0.01em;
  color: var(--green);
  max-width: 20ch;
  margin: 36px 0;
}

/* ---------- Scroll reveals (replay on re-entry) ---------- */

html.js .reveal {
  opacity: 0;
  transform: translateY(18px);
  transition: opacity 0.7s cubic-bezier(0.22, 0.61, 0.36, 1),
              transform 0.7s cubic-bezier(0.22, 0.61, 0.36, 1);
}
html.js .reveal.is-visible { opacity: 1; transform: none; }

html.js .reveal.d1 { transition-delay: 0.12s; }
html.js .reveal.d2 { transition-delay: 0.24s; }
html.js .reveal.d3 { transition-delay: 0.36s; }

/* ---------- Hero entrance (replays when scrolled back to) ---------- */

@keyframes fade-up {
  from { opacity: 0; transform: translateY(16px); }
  to   { opacity: 1; transform: none; }
}
@keyframes horizon-draw {
  to { stroke-dashoffset: 0; }
}
@keyframes sun-rise {
  from { opacity: 0; transform: translateY(18px); }
  to   { opacity: 1; transform: none; }
}

html.js .hero .eyebrow,
html.js .hero h1,
html.js .hero .lede,
html.js .hero .hero-actions { opacity: 0; }

html.js .hero.play .eyebrow,
html.js .hero.play h1,
html.js .hero.play .lede,
html.js .hero.play .hero-actions {
  animation: fade-up 0.8s cubic-bezier(0.22, 0.61, 0.36, 1) forwards;
}
html.js .hero.play h1 { animation-delay: 0.15s; }
html.js .hero.play .lede { animation-delay: 0.3s; }
html.js .hero.play .hero-actions { animation-delay: 0.45s; }

html.js .hero-horizon path { stroke-dasharray: 1700; stroke-dashoffset: 1700; }
html.js .hero-horizon circle { opacity: 0; }
html.js .hero.play .hero-horizon path {
  animation: horizon-draw 1.8s ease-out 0.4s forwards;
}
html.js .hero.play .hero-horizon circle {
  animation: sun-rise 1.1s ease-out 1.4s forwards;
}

.hero-horizon { margin-top: 12px; }

/* ---------- Interactive stat cards ---------- */

.on-mist .stat-strip {
  background: transparent;
  border-top: 0;
  border-bottom: 0;
  gap: 16px;
}
.on-mist .stat {
  background: #FFFFFF;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  position: relative;
  overflow: hidden;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}
.on-mist .stat::before {
  content: "";
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 3px;
  background: var(--ochre);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.45s cubic-bezier(0.22, 1, 0.36, 1);
}
.on-mist .stat:hover,
.on-mist .stat:focus-visible {
  transform: translateY(-4px);
  box-shadow: 0 10px 26px rgba(15, 46, 51, 0.08);
}
.on-mist .stat:hover::before,
.on-mist .stat:focus-visible::before { transform: scaleX(1); }

/* the human line under each number arrives on its own, a beat after
   the count-up — no hover required to discover it */
.stat .more {
  display: block;
  font-size: 13.5px;
  font-weight: 600;
  color: var(--green);
  margin-top: 10px;
  max-height: 0;
  opacity: 0;
  overflow: hidden;
  transition: max-height 0.5s ease, opacity 0.5s ease 0.15s;
}
.stat.show-more .more { max-height: 5em; opacity: 1; }

.on-mist .source-note { color: var(--slate); text-align: left; padding: 18px 0 0; }

/* ---------- What-if widget (readiness score you can poke) ---------- */

.whatif .wf-row { margin-bottom: 14px; }
.whatif .wf-label {
  display: block;
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--slate);
  margin-bottom: 7px;
}
.whatif .seg { display: flex; gap: 8px; flex-wrap: wrap; }
.whatif .seg button {
  font-family: var(--font-body);
  font-size: 14px;
  font-weight: 600;
  color: var(--green);
  background: #FFFFFF;
  border: 1.5px solid var(--line);
  border-radius: 999px;
  padding: 8px 15px;
  cursor: pointer;
  transition: background 0.2s, color 0.2s, border-color 0.2s, transform 0.2s;
}
.whatif .seg button:hover { border-color: var(--green); transform: translateY(-1px); }
.whatif .seg button.active {
  background: var(--ochre);
  border-color: var(--ochre);
  color: var(--ink);
  font-weight: 700;
}
.whatif .wf-comment {
  font-size: 14.5px;
  line-height: 1.55;
  color: var(--ink);
  background: var(--mist);
  border-radius: 8px;
  padding: 11px 15px;
  margin: 16px 0 0;
}
.whatif .score { transition: color 0.3s; display: inline-block; position: relative; }
.whatif .score::after {
  content: "";
  position: absolute;
  left: 2px; right: 2px; bottom: 2px;
  height: 4px;
  border-radius: 2px;
  background: var(--ochre);
  transform: scaleX(0);
  transform-origin: left;
  opacity: 0;
}
.whatif .score.landed::after { animation: score-land 1s cubic-bezier(0.22, 1, 0.36, 1); }
@keyframes score-land {
  0%   { transform: scaleX(0); opacity: 1; }
  40%  { transform: scaleX(1); opacity: 1; }
  70%  { transform: scaleX(1); opacity: 1; }
  100% { transform: scaleX(1); opacity: 0; }
}
.whatif .score.low { color: var(--brick); }
@keyframes score-bump { 30% { transform: scale(1.1); } }
.whatif .score.bump { display: inline-block; animation: score-bump 0.5s ease; }

/* ---------- Links & cards ---------- */

.more-link { font-weight: 600; text-decoration: none; }
.more-link .arr { display: inline-block; transition: transform 0.25s ease-out; }
.more-link:hover .arr, .more-link:focus-visible .arr { transform: translateX(5px); }

.btn { transition: background 0.15s, color 0.15s, border-color 0.15s,
                   transform 0.15s ease, box-shadow 0.15s ease; }
.btn:hover { transform: translateY(-1px); }
.btn:active { transform: none; }
.btn-sun:hover { box-shadow: 0 4px 14px rgba(227, 154, 43, 0.35); }

.card { transition: transform 0.3s ease-out, box-shadow 0.3s ease-out, border-color 0.3s; }
.card:hover {
  transform: translateY(-3px);
  box-shadow: 0 10px 28px rgba(15, 46, 51, 0.07);
  border-color: rgba(227, 154, 43, 0.45);
}
.card.ink:hover { border-color: rgba(227, 154, 43, 0.55); }
form.card:hover { transform: none; border-color: var(--line); }

/* ---------- Next chapter (journey link above the footer) ---------- */

.next-chapter { border-top: 1px solid var(--line); }
.next-chapter a {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 24px;
  text-decoration: none;
  color: var(--ink);
  padding: 46px 0;
}
.next-chapter .nc-label {
  display: block;
  font-family: var(--font-mono);
  font-size: 12.5px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--green);
  margin-bottom: 8px;
}
.next-chapter .nc-title {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: clamp(25px, 3.6vw, 38px);
  letter-spacing: -0.015em;
  transition: color 0.25s;
}
.next-chapter .nc-arrow {
  flex: none;
  width: 54px;
  height: 54px;
  border-radius: 50%;
  border: 1.5px solid var(--line);
  display: grid;
  place-items: center;
  font-size: 22px;
  color: var(--ink);
  transition: background 0.3s, color 0.3s, border-color 0.3s,
              transform 0.35s cubic-bezier(0.22, 1, 0.36, 1);
}
.next-chapter a:hover .nc-title { color: var(--green); }
.next-chapter a:hover .nc-arrow {
  background: var(--ochre);
  border-color: var(--ochre);
  transform: translateX(8px);
}

/* ---------- Reduced motion: everything visible, nothing moves ---------- */

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  * { transition: none !important; animation: none !important; }
  html.js .reveal,
  html.js .hero .eyebrow,
  html.js .hero h1,
  html.js .hero .lede,
  html.js .hero .hero-actions,
  html.js .hero-horizon circle { opacity: 1; transform: none; }
  html.js .hero-horizon path { stroke-dasharray: none; stroke-dashoffset: 0; }
  html.js .hl { background-size: 100% 100%; }
  .stat .more { max-height: none; opacity: 1; }
}

/* ==========================================================================
   Dark mode — set by the header toggle (saved) or the system preference.
   Three depths keep the page from blurring into one dark wash:
     deep bands (hero, trust, footer)  #081B20   — the drama
     page ground                        #0E262B   — the reading surface
     raised cards & tiles               #17393F   — the content that floats
   Ochre is untouched — it pops harder in the dark.
   ========================================================================== */

html[data-theme="dark"] { color-scheme: dark; }

html[data-theme="dark"] {
  --mist: #133136;
  --line: #2A4D52;
  --slate: #9FB5B4;
  --brick-tint: #3A201B;
}

html[data-theme="dark"] body { background: #0E262B; color: #E9F1EF; }

/* the three depths */
html[data-theme="dark"] .on-ink { background: #081B20; }
html[data-theme="dark"] .site-footer { background: #081B20; }
html[data-theme="dark"] .on-mist { background: #133136; }
html[data-theme="dark"] .card { background: #17393F; border-color: #2A4D52; }
html[data-theme="dark"] .card.ink { background: #0A2025; border-color: #0A2025; }
html[data-theme="dark"] .stat,
html[data-theme="dark"] .on-mist .stat { background: #17393F; border-color: #2A4D52; }

/* header */
html[data-theme="dark"] .site-header { background: #0E262B; border-color: #1F4046; }
html[data-theme="dark"] .site-header.scrolled { box-shadow: 0 2px 14px rgba(0, 0, 0, 0.45); }
html[data-theme="dark"] .wordmark,
html[data-theme="dark"] .site-nav a,
html[data-theme="dark"] .nav-toggle,
html[data-theme="dark"] .theme-toggle { color: #E9F1EF; }
html[data-theme="dark"] .site-nav a:hover,
html[data-theme="dark"] .theme-toggle:hover { color: #8FD0C2; }
html[data-theme="dark"] .site-nav a[aria-current="page"] { color: #8FD0C2; box-shadow: 0 2px 0 #8FD0C2; }

/* text & links on what used to be light ground */
html[data-theme="dark"] a { color: #8FD0C2; }
html[data-theme="dark"] a:hover, html[data-theme="dark"] a:focus-visible { color: #E9F1EF; }
html[data-theme="dark"] .eyebrow { color: #8FD0C2; }
html[data-theme="dark"] .on-ink .eyebrow, html[data-theme="dark"] .eyebrow.ochre { color: var(--ochre); }
html[data-theme="dark"] .pull-line,
html[data-theme="dark"] .stat .num,
html[data-theme="dark"] .stat .more,
html[data-theme="dark"] .score-chip .score,
html[data-theme="dark"] .timeline .when { color: #8FD0C2; }
html[data-theme="dark"] .whatif .score.low { color: #E0715C; }
html[data-theme="dark"] .whatif .wf-comment { color: #E9F1EF; }
html[data-theme="dark"] .next-chapter a, html[data-theme="dark"] .next-chapter .nc-arrow { color: #E9F1EF; }
html[data-theme="dark"] .next-chapter a:hover .nc-title { color: #8FD0C2; }
html[data-theme="dark"] .next-chapter a:hover .nc-arrow { color: var(--ink); }
html[data-theme="dark"] .next-chapter .nc-label { color: #8FD0C2; }

/* buttons keep their fills AND their own text colours — these must outrank
   the dark `a` rules above, so state them explicitly, hover included */
html[data-theme="dark"] .btn-primary,
html[data-theme="dark"] .btn-primary:hover,
html[data-theme="dark"] .btn-primary:focus-visible { color: #FFFFFF; }
html[data-theme="dark"] .btn-sun,
html[data-theme="dark"] .btn-sun:hover,
html[data-theme="dark"] .btn-sun:focus-visible { background: var(--ochre); color: #0F2E33; }
html[data-theme="dark"] .btn-sun:hover { background: #EFA83C; }
html[data-theme="dark"] .btn-ghost { color: #E9F1EF; border-color: #2A4D52; }
html[data-theme="dark"] .btn-ghost:hover,
html[data-theme="dark"] .btn-ghost:focus-visible { border-color: #8FD0C2; color: #8FD0C2; }
html[data-theme="dark"] .on-ink .btn-ghost { color: #FBFCFB; border-color: #2A4A4E; }
html[data-theme="dark"] .on-ink .btn-ghost:hover,
html[data-theme="dark"] .on-ink .btn-ghost:focus-visible { border-color: #8FD0C2; color: #8FD0C2; }

/* surface details */
html[data-theme="dark"] .card:hover { box-shadow: 0 10px 28px rgba(0, 0, 0, 0.4); border-color: rgba(227, 154, 43, 0.5); }
html[data-theme="dark"] form.card:hover { border-color: #2A4D52; }
html[data-theme="dark"] .score-chip { background: #0F2B30; }
html[data-theme="dark"] .whatif .wf-comment { background: #0F2B30; }
html[data-theme="dark"] .callout { background: #133136; }
html[data-theme="dark"] .callout.brick { background: var(--brick-tint); }
html[data-theme="dark"] .tag.green { background: #0F2B30; color: #8FD0C2; }
html[data-theme="dark"] .timeline li::before { background: #0E262B; }

/* checklist ticks, drawn light */
html[data-theme="dark"] .checklist li::before {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 18 18' fill='none'%3E%3Cpath d='M3 9.5 L7 13.5 L15 4.5' stroke='%238FD0C2' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
}
html[data-theme="dark"] .card.ink .checklist li::before,
html[data-theme="dark"] .on-ink .checklist li::before {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 18 18' fill='none'%3E%3Cpath d='M3 9.5 L7 13.5 L15 4.5' stroke='%23E39A2B' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
}

/* forms & controls */
html[data-theme="dark"] input[type="text"],
html[data-theme="dark"] input[type="email"],
html[data-theme="dark"] select,
html[data-theme="dark"] textarea { background: #102A2F; color: #E9F1EF; border-color: #2A4D52; }
html[data-theme="dark"] .whatif .seg button { background: #102A2F; color: #8FD0C2; border-color: #2A4D52; }
html[data-theme="dark"] .whatif .seg button:hover { border-color: #8FD0C2; }
html[data-theme="dark"] .whatif .seg button.active { background: var(--ochre); border-color: var(--ochre); color: #0F2E33; }
html[data-theme="dark"] .checkbox-row input { accent-color: #8FD0C2; }

/* mobile nav sheet */
html[data-theme="dark"] .site-nav.open { background: #0E262B; border-color: #2A4D52; }

/* highlight bands: translucent ochre muddies on dark, so use the stroke */
html[data-theme="dark"] .hl {
  background-image: linear-gradient(transparent 80%, var(--ochre) 80%, var(--ochre) 97%, transparent 97%);
}

html[data-theme="dark"] .obj-num { color: var(--ochre); }

/* the horizon arc reads against the deep band */
html[data-theme="dark"] .hero-horizon path { stroke: #2F7A6D; }
