/* ==========================================================================
   Horizon — tokens
   ========================================================================== */
:root {
  color-scheme: light;
  --bg:        #f2f3f6;
  --surface:   #ffffff;
  --surface-2: #f7f8fa;
  --ink:       #11152a;
  --ink-2:     #4b5170;
  --ink-3:     #666c86;
  --line:      #e1e4eb;
  --line-2:    #ccd1dc;
  --focus:     #2a78d6;
  --warn:      #b3261e;
  --good:      #0f7a3d;

  /* Series — identity follows the entity across every chart */
  --roth:      #2a78d6;
  --trad:      #eb6834;
  --taxable:   #1baf7a;
  --other:     #eda100;
  --saved:     #4a3aa7;
  --growth:    #008300;
  --spent:     #d5d9e3;

  --font-display: "Bricolage Grotesque", "Helvetica Neue", Arial, sans-serif;
  --font-body:    "Instrument Sans", "Helvetica Neue", Arial, sans-serif;
  --font-mono:    "IBM Plex Mono", ui-monospace, "SF Mono", Menlo, monospace;

  --radius: 18px;
  --radius-sm: 10px;
  --shadow: 0 1px 0 rgba(17, 21, 42, .04), 0 12px 32px -18px rgba(17, 21, 42, .18);
  --topbar-h: 60px;
  --gutter: clamp(16px, 4vw, 40px);
  --maxw: 1180px;
  --ease: cubic-bezier(.2, .7, .1, 1);
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --bg:        #0d1018;
    --surface:   #161a26;
    --surface-2: #1b2030;
    --ink:       #f2f3f8;
    --ink-2:     #b6bbcd;
    --ink-3:     #9096ab;
    --line:      #262b3b;
    --line-2:    #353b4e;
    --focus:     #6da7ec;
    --warn:      #ff8a80;
    --good:      #5fd08c;
    --roth:      #3987e5;
    --trad:      #d95926;
    --taxable:   #199e70;
    --other:     #c98500;
    --saved:     #9085e9;
    --growth:    #1f9a3a;
    --spent:     #3a4052;
    --shadow: 0 1px 0 rgba(0, 0, 0, .3), 0 18px 40px -22px rgba(0, 0, 0, .7);
  }
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --bg:        #0d1018;
  --surface:   #161a26;
  --surface-2: #1b2030;
  --ink:       #f2f3f8;
  --ink-2:     #b6bbcd;
  --ink-3:     #9096ab;
  --line:      #262b3b;
  --line-2:    #353b4e;
  --focus:     #6da7ec;
  --warn:      #ff8a80;
  --good:      #5fd08c;
  --roth:      #3987e5;
  --trad:      #d95926;
  --taxable:   #199e70;
  --other:     #c98500;
  --saved:     #9085e9;
  --growth:    #1f9a3a;
  --spent:     #3a4052;
  --shadow: 0 1px 0 rgba(0, 0, 0, .3), 0 18px 40px -22px rgba(0, 0, 0, .7);
}

/* ==========================================================================
   Base
   ========================================================================== */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 400 16px/1.55 var(--font-body);
  -webkit-font-smoothing: antialiased;
  overflow-x: clip;
  transition: background-color .3s ease, color .3s ease;
}
svg { display: block; }
button, input { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 3px; border-radius: 6px; }
.mono { font-family: var(--font-mono); font-variant-numeric: tabular-nums; }
[hidden] { display: none !important; }

.eyebrow {
  margin: 0 0 10px;
  font: 500 12px/1.2 var(--font-mono);
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--ink-3);
}
.display {
  font-family: var(--font-display);
  font-variation-settings: "wdth" 80, "opsz" 96;
  font-weight: 700;
  letter-spacing: -.035em;
  line-height: .95;
  margin: 0;
}
.display em {
  font-style: normal;
  font-weight: 300;
  font-variation-settings: "wdth" 100, "opsz" 96;
  color: var(--ink-2);
}
.section-title {
  font-family: var(--font-display);
  font-variation-settings: "wdth" 85, "opsz" 48;
  font-weight: 650;
  font-size: clamp(24px, 3vw, 34px);
  letter-spacing: -.025em;
  line-height: 1.08;
  margin: 0;
}

/* ==========================================================================
   Chrome
   ========================================================================== */
.announce {
  background: var(--ink);
  color: var(--bg);
  text-align: center;
  padding: 10px var(--gutter);
}
.announce p {
  margin: 0;
  font: 600 14px/1.3 var(--font-body);
  letter-spacing: .01em;
}

.topbar {
  position: sticky; top: 0; z-index: 30;
  height: var(--topbar-h);
  display: flex; align-items: center; gap: 24px;
  padding: 0 var(--gutter);
  background: color-mix(in srgb, var(--bg) 82%, transparent);
  backdrop-filter: saturate(1.4) blur(14px);
  -webkit-backdrop-filter: saturate(1.4) blur(14px);
  border-bottom: 1px solid transparent;
  transition: border-color .3s ease;
}
.topbar.is-scrolled { border-bottom-color: var(--line); }
.brand {
  display: inline-flex; align-items: center; gap: 10px;
  font: 700 19px/1 var(--font-display);
  font-variation-settings: "wdth" 80;
  letter-spacing: -.02em;
  color: var(--ink); text-decoration: none;
}
.brand svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 3; stroke-linecap: round; }
.topbar-nav { display: flex; gap: 20px; margin-left: auto; }
.topbar-nav a { color: var(--ink-2); text-decoration: none; font-size: 14px; font-weight: 500; }
.topbar-nav a:hover { color: var(--ink); }
.topbar-nav .needs-results { display: none; }
body.has-results .topbar-nav .needs-results { display: inline; }
.theme-toggle {
  width: 38px; height: 38px; border-radius: 50%;
  display: grid; place-items: center;
  background: var(--surface); border: 1px solid var(--line); cursor: pointer;
}
.theme-toggle svg { width: 18px; height: 18px; fill: none; stroke: var(--ink); stroke-width: 1.8; stroke-linecap: round; }
.theme-toggle .icon-moon { display: none; }
:root[data-theme="dark"] .theme-toggle .icon-sun { display: none; }
:root[data-theme="dark"] .theme-toggle .icon-moon { display: block; }

.scroll-progress { position: fixed; inset: 0 0 auto 0; height: 3px; z-index: 40; pointer-events: none; }
.scroll-progress span {
  display: block; height: 100%; width: 100%;
  background: linear-gradient(90deg, var(--roth), var(--taxable));
  transform-origin: 0 50%; transform: scaleX(0);
}

main { max-width: var(--maxw); margin: 0 auto; padding: 0 var(--gutter); }

/* ==========================================================================
   Intro + form
   ========================================================================== */
.intro {
  display: grid;
  grid-template-columns: minmax(0, 5fr) minmax(0, 7fr);
  gap: clamp(32px, 6vw, 88px);
  padding: clamp(40px, 8vw, 96px) 0 96px;
  scroll-margin-top: var(--topbar-h);
}
.intro-copy { position: sticky; top: calc(var(--topbar-h) + 32px); align-self: start; }
.intro .display { font-size: clamp(52px, 8.4vw, 112px); }
.intro .display em { display: block; }
.lede { font-size: clamp(17px, 1.6vw, 19px); color: var(--ink-2); max-width: 34ch; margin: 28px 0 20px; }
.privacy, .disclaimer {
  display: flex; gap: 10px; align-items: flex-start;
  font-size: 14px; color: var(--ink-3); max-width: 38ch; margin: 0 0 12px;
}
.privacy svg { width: 18px; height: 18px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.7; margin-top: 1px; }
.disclaimer {
  display: block;
  padding: 12px 14px;
  border: 1px dashed var(--line-2);
  border-radius: var(--radius-sm);
  color: var(--ink-2);
}
.disclaimer strong { color: var(--ink); font-weight: 600; }
.hero-curve { width: 100%; height: 140px; margin-top: 36px; overflow: visible; }
.hero-curve-line {
  fill: none; stroke: var(--ink); stroke-width: 2.5; stroke-linecap: round;
  stroke-dasharray: 800; stroke-dashoffset: 800;
  animation: draw 2.4s var(--ease) .3s forwards;
  vector-effect: non-scaling-stroke;
}
.hero-curve-fill { fill: var(--ink); opacity: 0; animation: fadein 1.6s ease 1.4s forwards; }
@keyframes draw { to { stroke-dashoffset: 0; } }
@keyframes fadein { to { opacity: .06; } }

.plan-form { display: flex; flex-direction: column; gap: 16px; }
.card {
  margin: 0; min-width: 0;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 22px 24px 24px;
  box-shadow: var(--shadow);
}
.card legend {
  float: left; width: 100%;
  display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 4px 16px;
  padding: 0; margin-bottom: 18px;
}
.card legend + * { clear: both; }
.legend-title {
  font: 650 19px/1.2 var(--font-display);
  font-variation-settings: "wdth" 85;
  letter-spacing: -.015em;
}
.legend-hint { font-size: 13px; color: var(--ink-3); }

.grid-3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.grid-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.field > span { font-size: 13px; font-weight: 500; color: var(--ink-2); display: flex; align-items: center; gap: 8px; }
.field small { font-size: 12px; color: var(--ink-3); }
.field-wide { grid-column: span 1; }
.input {
  display: flex; align-items: center; gap: 6px;
  height: 46px; padding: 0 14px;
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  transition: border-color .15s ease, box-shadow .15s ease, background-color .15s ease;
}
.input:focus-within { border-color: var(--focus); box-shadow: 0 0 0 3px color-mix(in srgb, var(--focus) 22%, transparent); background: var(--surface); }
.input.is-invalid { border-color: var(--warn); }
.input i { font: 400 14px var(--font-mono); font-style: normal; color: var(--ink-3); flex: none; }
.input input {
  flex: 1; min-width: 0; width: 100%;
  border: 0; background: transparent; outline: none; padding: 0;
  font: 500 16px var(--font-mono); font-variant-numeric: tabular-nums;
  -moz-appearance: textfield;
}
.input input::-webkit-outer-spin-button,
.input input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.input input:focus-visible { outline: none; }

.accounts { display: grid; gap: 12px; margin-top: 16px; }
.account {
  display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr); gap: 16px;
  padding-top: 12px; border-top: 1px solid var(--line);
}
.swatch { width: 10px; height: 10px; border-radius: 3px; display: inline-block; }
[data-account="roth"] .swatch, .split-bar [data-k="roth"] { background: var(--roth); }
[data-account="trad"] .swatch, .split-bar [data-k="trad"] { background: var(--trad); }
[data-account="taxable"] .swatch, .split-bar [data-k="taxable"] { background: var(--taxable); }

.split-meter { margin-top: 16px; }
.split-bar {
  display: flex; gap: 2px; height: 8px; border-radius: 4px; overflow: hidden;
  background: var(--line);
}
.split-bar span { display: block; height: 100%; transition: flex-grow .4s var(--ease); flex-basis: 0; }
.split-note { font-size: 13px; color: var(--ink-3); margin: 8px 0 0; }
.split-note.is-off { color: var(--warn); }
.derived {
  display: flex; justify-content: space-between; align-items: baseline; gap: 12px;
  margin: 16px 0 0; padding: 12px 14px;
  background: var(--surface-2); border-radius: var(--radius-sm);
  font-size: 14px; color: var(--ink-2);
}
.derived strong { color: var(--ink); font-weight: 500; }
.derived.is-off strong { color: var(--warn); }

.expenses { display: grid; gap: 10px; margin-bottom: 14px; }
.expense {
  display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, .8fr) minmax(0, 1.2fr) 40px; gap: 10px; align-items: end;
  animation: rowin .35s var(--ease);
}
@keyframes rowin { from { opacity: 0; transform: translateY(-6px); } }
.expense .input input[type="text"]:not([data-money]) { font-family: var(--font-body); font-weight: 500; }
.icon-btn {
  width: 40px; height: 46px; border-radius: var(--radius-sm);
  display: grid; place-items: center; cursor: pointer;
  background: transparent; border: 1px solid transparent; color: var(--ink-3);
}
.icon-btn:hover { color: var(--warn); border-color: var(--line); }
.icon-btn svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; }
.expenses-empty { font-size: 14px; color: var(--ink-3); margin: 0; }

.btn-ghost {
  display: inline-flex; align-items: center; gap: 8px;
  height: 40px; padding: 0 14px;
  background: transparent; border: 1px dashed var(--line-2); border-radius: var(--radius-sm);
  font-size: 14px; font-weight: 500; color: var(--ink-2); cursor: pointer;
}
.btn-ghost:hover { border-style: solid; color: var(--ink); }
.btn-ghost svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; }

.form-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 24px; margin-top: 8px; }
.btn-primary {
  display: inline-flex; align-items: center; gap: 12px;
  height: 58px; padding: 0 28px;
  background: var(--ink); color: var(--bg);
  border: 0; border-radius: 999px; cursor: pointer;
  font: 650 18px/1 var(--font-display); font-variation-settings: "wdth" 90; letter-spacing: -.01em;
  transition: transform .2s var(--ease), box-shadow .2s ease;
  box-shadow: 0 10px 30px -12px color-mix(in srgb, var(--ink) 60%, transparent);
}
.btn-primary:hover { transform: translateY(-2px); }
.btn-primary:active { transform: translateY(0); }
.btn-primary svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }
.btn-link {
  background: none; border: 0; padding: 4px 0; cursor: pointer;
  font-size: 14px; font-weight: 500; color: var(--ink-2);
  text-decoration: underline; text-underline-offset: 4px; text-decoration-color: var(--line-2);
}
.btn-link:hover { color: var(--ink); text-decoration-color: currentColor; }
.form-error {
  margin: 0; padding: 12px 16px; border-radius: var(--radius-sm);
  background: color-mix(in srgb, var(--warn) 10%, var(--surface));
  color: var(--warn); font-size: 14px; font-weight: 500;
}

/* ==========================================================================
   Results
   ========================================================================== */
#results { scroll-margin-top: var(--topbar-h); padding-bottom: 64px; }

.verdict {
  padding: clamp(72px, 12vw, 140px) 0 clamp(40px, 6vw, 72px);
  border-top: 1px solid var(--line);
}
.verdict-line {
  font-size: clamp(40px, 6.4vw, 88px);
  max-width: 15ch;
}
.verdict-line .num {
  font-variation-settings: "wdth" 75, "opsz" 96;
  font-weight: 800;
  background: linear-gradient(100deg, var(--roth), var(--taxable) 70%);
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.verdict-facts {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 1px; margin-top: 48px;
  background: var(--line); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden;
}
.fact { background: var(--surface); padding: 20px 22px 22px; }
.fact-value {
  font: 700 clamp(28px, 3vw, 36px)/1 var(--font-display);
  font-variation-settings: "wdth" 80;
  letter-spacing: -.02em;
  display: flex; align-items: center; gap: 8px;
}
.fact-label { font-size: 14px; color: var(--ink-2); margin-top: 8px; }
.fact-status { display: inline-flex; align-items: center; gap: 6px; font: 500 12px var(--font-mono); text-transform: uppercase; letter-spacing: .06em; margin-top: 10px; }
.fact-status svg { width: 14px; height: 14px; fill: none; stroke: currentColor; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }
.fact-status.good { color: var(--good); }
.fact-status.bad { color: var(--warn); }

.units { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; margin-top: 28px; }
.units-label { font-size: 14px; color: var(--ink-3); }
.segmented { display: inline-flex; padding: 4px; background: var(--surface); border: 1px solid var(--line); border-radius: 999px; }
.segmented button {
  border: 0; background: transparent; cursor: pointer;
  padding: 8px 16px; border-radius: 999px; font-size: 14px; font-weight: 500; color: var(--ink-2);
  transition: background-color .2s ease, color .2s ease;
}
.segmented button[aria-pressed="true"] { background: var(--ink); color: var(--bg); }

/* ---------- Journey (scroll-scrubbed) ---------- */
.journey { position: relative; margin: 0 calc(var(--gutter) * -1); }
.journey-sticky {
  position: sticky; top: var(--topbar-h);
  height: calc(100vh - var(--topbar-h));
  height: calc(100svh - var(--topbar-h));
  display: grid; grid-template-rows: auto 1fr auto auto;
  padding: 20px var(--gutter) 24px;
  z-index: 1;
}
.journey-track { height: 240vh; margin-top: calc((100vh - var(--topbar-h)) * -1); }
.journey-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 24px; }
.journey-readout { text-align: right; display: grid; justify-items: end; }
.journey-age-label { font: 500 12px var(--font-mono); letter-spacing: .08em; text-transform: uppercase; color: var(--ink-3); }
.journey-age {
  font: 800 clamp(72px, 11vw, 150px)/.8 var(--font-display);
  font-variation-settings: "wdth" 75, "opsz" 96;
  letter-spacing: -.05em;
  font-variant-numeric: tabular-nums;
}
.journey-total { font-size: clamp(16px, 1.8vw, 20px); font-weight: 500; margin-top: 8px; color: var(--ink-2); }
.journey-chart { min-height: 0; position: relative; margin-top: 12px; }
.journey-caption {
  min-height: 52px; margin-top: 10px;
  display: flex; align-items: center; gap: 12px;
  font-size: 16px; color: var(--ink-2);
}
.journey-caption .chip {
  font: 500 12px var(--font-mono); letter-spacing: .06em; text-transform: uppercase;
  padding: 5px 10px; border-radius: 999px; background: var(--ink); color: var(--bg); flex: none;
}
.journey-caption .caption-text { animation: capin .45s var(--ease); }
@keyframes capin { from { opacity: 0; transform: translateY(8px); } }

/* ---------- Panels ---------- */
.panel {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: calc(var(--radius) + 6px);
  padding: clamp(20px, 3vw, 36px);
  margin-top: 24px;
  box-shadow: var(--shadow);
  min-width: 0;
}
.panel-head { margin-bottom: 24px; }
.panel-sub { color: var(--ink-2); margin: 10px 0 0; max-width: 60ch; }
.panel-row { display: grid; grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr); gap: 24px; }
.panel-row > .panel { margin-top: 24px; }
.chart { height: clamp(280px, 38vw, 420px); position: relative; }
.chart-short { height: clamp(240px, 28vw, 320px); }

/* Chart anatomy */
.axis text { font: 400 12px var(--font-mono); fill: var(--ink-3); }
.axis .domain { display: none; }
.axis .tick line { stroke: var(--line); }
.grid line { stroke: var(--line); stroke-dasharray: 2 4; }
.grid .domain { display: none; }
.baseline { stroke: var(--line-2); }
.crosshair { stroke: var(--ink-3); stroke-width: 1; pointer-events: none; }
.hover-dot { stroke: var(--surface); stroke-width: 2; pointer-events: none; }
.marker-line { stroke: var(--ink-3); stroke-dasharray: 3 3; }
.marker-label { font: 500 11px var(--font-mono); fill: var(--ink-2); letter-spacing: .03em; }
.direct-label { font: 500 12px var(--font-body); fill: var(--ink-2); }
.direct-label-value { font: 500 12px var(--font-mono); fill: var(--ink); }
.area-seg { stroke: var(--surface); stroke-width: 2; stroke-linejoin: round; }
.series-line { fill: none; stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }
.overlay { fill: transparent; cursor: crosshair; touch-action: pan-y; }
.bar { transition: opacity .15s ease; }
.bar-group:hover .bar, .bar-group:focus .bar { opacity: .82; }
.bar-group:focus { outline: none; }
.bar-group:focus-visible .bar { stroke: var(--focus); stroke-width: 2; }
.event-dot { fill: var(--surface); stroke: var(--ink); stroke-width: 2; }

.legend { display: flex; flex-wrap: wrap; gap: 8px 20px; margin-top: 16px; font-size: 14px; color: var(--ink-2); }
.legend-item { display: inline-flex; align-items: center; gap: 8px; }
.legend-key { width: 12px; height: 12px; border-radius: 3px; flex: none; }
.legend-key.line { height: 2px; width: 16px; border-radius: 1px; }
.legend-key.dash { height: 0; width: 16px; border-top: 2px dashed var(--ink-3); background: none !important; }

/* Tooltip */
.tooltip {
  position: fixed; z-index: 50; pointer-events: none;
  min-width: 180px; max-width: 280px;
  padding: 12px 14px;
  background: var(--surface); color: var(--ink);
  border: 1px solid var(--line-2); border-radius: 12px;
  box-shadow: 0 16px 40px -16px rgba(0, 0, 0, .35);
  font-size: 13px;
}
.tt-title { font: 500 12px var(--font-mono); color: var(--ink-3); letter-spacing: .04em; text-transform: uppercase; margin-bottom: 8px; }
.tt-row { display: grid; grid-template-columns: 14px 1fr; column-gap: 8px; align-items: center; padding: 2px 0; }
.tt-key { width: 12px; height: 2px; border-radius: 1px; }
.tt-val { font: 500 14px var(--font-mono); font-variant-numeric: tabular-nums; }
.tt-name { grid-column: 2; font-size: 12px; color: var(--ink-3); margin-top: -2px; }
.tt-total { border-top: 1px solid var(--line); margin-top: 6px; padding-top: 6px; display: flex; justify-content: space-between; gap: 12px; }
.tt-total strong { font: 600 14px var(--font-mono); }

/* ---------- Mix ---------- */
.mix { display: flex; flex-direction: column; gap: 20px; }
.mix-bar { display: flex; gap: 2px; height: 56px; border-radius: 6px; overflow: hidden; }
.mix-bar span { display: block; height: 100%; transform-origin: 0 50%; transform: scaleX(0); transition: transform 1.1s var(--ease); }
.mix.is-in .mix-bar span { transform: scaleX(1); }
.mix-rows { display: grid; gap: 2px; }
.mix-row {
  display: grid; grid-template-columns: 12px minmax(0, 1fr) auto; column-gap: 12px; align-items: baseline;
  padding: 12px 0; border-top: 1px solid var(--line);
}
.mix-row .legend-key { align-self: center; }
.mix-row b { font-weight: 600; }
.mix-row small { grid-column: 2; font-size: 13px; color: var(--ink-3); }
.mix-row .mono { grid-row: 1; grid-column: 3; text-align: right; }
.mix-row .mix-pct { grid-column: 3; text-align: right; font: 400 13px var(--font-mono); color: var(--ink-3); }

/* ---------- Milestones timeline ---------- */
.milestones { margin-top: 96px; }
.timeline {
  list-style: none; margin: 0; padding: 0 0 0 36px; position: relative;
  counter-reset: ms;
}
.timeline::before {
  content: ""; position: absolute; left: 11px; top: 8px; bottom: 8px; width: 2px;
  background: var(--line);
}
.timeline::after {
  content: ""; position: absolute; left: 11px; top: 8px; width: 2px;
  height: calc((100% - 16px) * var(--tl-progress, 0));
  background: var(--ink);
}
.ms {
  position: relative; padding: 0 0 36px;
  display: grid; grid-template-columns: 110px minmax(0, 1fr); gap: 4px 24px;
  opacity: .25; transform: translateX(12px);
  transition: opacity .6s var(--ease), transform .6s var(--ease);
}
.ms.is-in { opacity: 1; transform: none; }
.ms::before {
  content: ""; position: absolute; left: -31px; top: 6px;
  width: 12px; height: 12px; border-radius: 50%;
  background: var(--bg); border: 2px solid var(--line-2);
  transition: background-color .4s ease, border-color .4s ease;
}
.ms.is-in::before { background: var(--ink); border-color: var(--ink); }
.ms-when { grid-row: span 2; font: 500 13px/1.3 var(--font-mono); color: var(--ink-3); padding-top: 3px; }
.ms-when b { display: block; font: 700 28px/1 var(--font-display); font-variation-settings: "wdth" 80; color: var(--ink); letter-spacing: -.02em; margin-bottom: 4px; }
.ms-title { font: 650 22px/1.2 var(--font-display); font-variation-settings: "wdth" 85; letter-spacing: -.015em; margin: 0; }
.ms-body { color: var(--ink-2); margin: 0; grid-column: 2; }
.ms { grid-template-rows: auto 1fr; }

/* ---------- Table ---------- */
.table-panel details > summary {
  list-style: none; cursor: pointer;
  display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 8px 16px;
}
.table-panel details > summary::-webkit-details-marker { display: none; }
.table-panel summary .section-title::after {
  content: "+"; display: inline-block; margin-left: 12px; font-weight: 300; color: var(--ink-3);
  transition: transform .25s var(--ease);
}
.table-panel details[open] summary .section-title::after { transform: rotate(45deg); }
.table-panel summary .panel-sub { margin: 0; }
.table-wrap { overflow: auto; max-height: 560px; margin-top: 20px; border: 1px solid var(--line); border-radius: var(--radius-sm); }
.data-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.data-table th, .data-table td { padding: 9px 14px; text-align: right; white-space: nowrap; border-bottom: 1px solid var(--line); }
.data-table th:first-child, .data-table td:first-child { text-align: left; }
.data-table thead th {
  position: sticky; top: 0; background: var(--surface-2);
  font: 500 12px var(--font-body); color: var(--ink-2);
}
.data-table td { font-family: var(--font-mono); font-variant-numeric: tabular-nums; }
.data-table tr.is-retire td { background: color-mix(in srgb, var(--roth) 8%, transparent); }

.fineprint {
  margin-top: 64px; padding-top: 24px; border-top: 1px solid var(--line);
  font-size: 13px; color: var(--ink-3); max-width: 80ch;
}
.fineprint .disclaimer { max-width: none; font-size: 14px; margin-bottom: 16px; }

/* ==========================================================================
   Scroll reveals
   ========================================================================== */
.reveal { opacity: 0; transform: translateY(40px); transition: opacity .9s var(--ease), transform .9s var(--ease); }
.reveal.is-in { opacity: 1; transform: none; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: .001ms !important; animation-delay: 0s !important; transition-duration: .001ms !important; }
  .reveal, .ms { opacity: 1; transform: none; }
  .hero-curve-line { stroke-dashoffset: 0; }
}

/* ==========================================================================
   Responsive
   ========================================================================== */
@media (max-width: 960px) {
  .intro { grid-template-columns: 1fr; }
  .intro-copy { position: static; }
  .hero-curve { height: 90px; margin-top: 24px; }
  .panel-row { grid-template-columns: 1fr; }
  .panel-row > .panel + .panel { margin-top: 0; }
}
@media (max-width: 640px) {
  .topbar-nav { display: none; }
  .theme-toggle { margin-left: auto; }
  .grid-3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .grid-2 { grid-template-columns: 1fr; }
  .card { padding: 18px 16px 20px; }
  .account { grid-template-columns: 1fr; gap: 10px; }
  .expense { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) 40px; }
  .expense .field:first-child { grid-column: 1 / -1; }
  .journey-head { flex-direction: column; align-items: flex-start; gap: 8px; }
  .journey-readout { justify-items: start; text-align: left; grid-template-columns: auto auto; column-gap: 12px; align-items: baseline; }
  .journey-age-label { grid-column: 1 / -1; }
  .journey-caption { font-size: 14px; }
  .ms { grid-template-columns: 1fr; }
  .ms-when { grid-row: auto; }
  .ms-body { grid-column: 1; }
  .btn-primary { width: 100%; justify-content: center; }
}
