/* Home page only. Tokens come from site.css (DESIGN.md §6). One accent,
   one radius scale (8px controls, 12px panels), no card grids. */

/* ── Header CTA ───────────────────────────────────────────────────────── */

/* ── Hero: copy left, live widget right ───────────────────────────────── */
.h-hero {
  display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 64px; align-items: center; padding: 72px 0 56px;
}
.h-hero h1 { font-size: clamp(2.4rem, 3.9vw, 3.4rem); line-height: 1.06; margin: 0 0 20px; }
.h-sub { font-size: 1.1875rem; line-height: 1.55; color: var(--ink-muted); max-width: 44ch; margin: 0 0 28px; }
.text-link { font-weight: 500; text-decoration: none; display: inline-flex; align-items: center; gap: 6px; min-height: 44px; }
.text-link:hover { text-decoration: underline; }
.text-link svg { width: 18px; height: 18px; }

/* The widget is the one elevated surface on the page: it is an instrument,
   not decoration, so it earns the panel. */
.rw {
  background: var(--surface); border: 1px solid var(--border); border-radius: 12px;
  padding: 28px; box-shadow: 0 1px 0 var(--border), 0 18px 40px -28px rgb(28 27 25 / 0.25);
}
.rw-title { font-weight: 500; font-size: 1.0625rem; margin: 0 0 18px; }
.rw-fields { display: grid; grid-template-columns: 1.3fr 1.3fr 0.8fr; gap: 14px; }
.rw-field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.rw-field label { font-size: 0.8125rem; font-weight: 500; color: var(--ink); }
.rw-input {
  display: flex; align-items: center; border: 1px solid var(--border-strong); border-radius: 8px;
  background: var(--bg); min-height: 48px; padding: 0 12px; gap: 6px;
}
.rw-input:focus-within { outline: 2px solid var(--accent); outline-offset: 1px; }
.rw-input span { color: var(--ink-muted); font-size: 0.9375rem; }
.rw-input input {
  border: 0; background: transparent; color: var(--ink); width: 100%; min-width: 0;
  font-family: 'IBM Plex Mono', monospace; font-size: 1rem; font-variant-numeric: tabular-nums; padding: 0;
}
.rw-input input:focus { outline: none; }
.rw-input:has(input[aria-invalid='true']) { border-color: var(--loss); }
.rw-help { font-size: 0.75rem; color: var(--ink-muted); min-height: 1.1em; }
.rw-err { font-size: 0.75rem; color: var(--loss); min-height: 1.1em; }

.rw-out { display: grid; grid-template-columns: 1fr 1fr; margin: 22px 0 22px; border-top: 1px solid var(--border); }
.rw-out > div { padding: 18px 20px 0 0; }
.rw-out > div + div { border-left: 1px solid var(--border); padding-left: 20px; }
.rw-k { font-size: 0.8125rem; color: var(--ink-muted); margin: 0 0 6px; }
.rw-v {
  font-family: 'Fraunces Variable', Georgia, serif; font-weight: 600; font-size: 2rem;
  line-height: 1.1; display: block; font-variant-numeric: tabular-nums;
}
.rw-s { font-size: 0.8125rem; color: var(--ink-muted); margin: 6px 0 0; }
#rw-results[data-state='invalid'] .rw-out { opacity: 0.35; }
.rw-foot { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.rw-note { font-size: 0.8125rem; color: var(--ink-muted); margin: 0; display: inline-flex; gap: 6px; align-items: center; }
.rw-note svg { width: 15px; height: 15px; }

@media (prefers-reduced-motion: no-preference) {
  .rw-flash { animation: rwIn 280ms cubic-bezier(0.16, 1, 0.3, 1); }
  @keyframes rwIn { from { opacity: 0.25; transform: translateY(3px); } to { opacity: 1; transform: none; } }
}
.btn:active { transform: translateY(1px); }

/* ── Proof strip under the hero ───────────────────────────────────────── */
.proof { border-top: 1px solid var(--border); padding: 22px 0; display: flex; flex-wrap: wrap; justify-content: space-between; gap: 14px 44px; }
.proof p { margin: 0; display: inline-flex; align-items: center; gap: 10px; font-size: 0.9375rem; color: var(--ink-muted); }
.proof svg { width: 20px; height: 20px; color: var(--accent); flex: none; }

/* ── The gap: stacked header, figures, full-width chart ──────────────── */
.band { background: var(--surface-2); padding: 72px 0; margin-top: 24px; }
.band h2 { margin: 0 0 10px; }
.band .lead { color: var(--ink-muted); margin: 0 0 36px; font-size: 1.0625rem; }
/* The three numbers take the chart's colours, so each one points at the dots
   it describes; hovering one lights up that group. */
.figs { display: flex; justify-content: space-between; gap: 20px 48px; margin: 0 0 40px; }
.fig { max-width: 44ch; padding-left: 14px; border-left: 3px solid var(--ink-muted); }
.fig-ok { border-color: var(--gain); }
.fig-out { border-color: var(--loss); }
.fig-n { font-family: 'Fraunces Variable', Georgia, serif; font-weight: 600; font-size: clamp(2.6rem, 5vw, 3.6rem); line-height: 1; display: block; }
.fig-ok .fig-n { color: var(--gain); }
.fig-out .fig-n { color: var(--loss); }
.fig-l { font-size: 0.9375rem; color: var(--ink-muted); display: block; margin-top: 8px; }

/* Dot chart: one dot per retiree, at the age their money ran out. */
.dc { width: 100%; height: auto; display: block; overflow: visible; }
.dc text { font-family: 'DM Sans', sans-serif; }
.dc .tick { font-family: 'IBM Plex Mono', monospace; font-size: 12px; fill: var(--ink-muted); }
.dc .dc-axis { font-size: 13px; fill: var(--ink-muted); }
.dc .dc-steady { font-size: 13px; fill: var(--ink); font-weight: 500; }
.dc .dc-lbl { font-size: 17px; font-weight: 600; }
.dc .dc-lbl-out { fill: var(--loss); }
.dc .dc-lbl-ok { fill: var(--gain); }
.dc-plan { stroke: var(--ink-muted); stroke-width: 1.5; stroke-dasharray: 5 5; }
.dot-out { fill: var(--loss); }
.dot-ok { fill: var(--gain); }
.dc-wrap { position: relative; }
.dc .dot { transform-box: fill-box; transform-origin: center; cursor: pointer; }
.dc.is-out .dot-ok, .dc.is-ok .dot-out, [data-reveal].is-in .dc.is-out .dot-ok, [data-reveal].is-in .dc.is-ok .dot-out { opacity: 0.25; }
.dc .dot.is-hot, [data-reveal].is-in .dc .dot.is-hot { transform: scale(1.45); }
.dc-tip {
  position: absolute; z-index: 2; pointer-events: none; transform: translate(-50%, calc(-100% - 12px));
  background: var(--ink); color: var(--bg); font-size: 0.875rem; font-weight: 500; white-space: nowrap;
  padding: 6px 10px; border-radius: 6px;
}
.dc-src { margin: 14px 0 0; font-size: 0.8125rem; color: var(--ink-muted); }
.dc-src a { color: inherit; }
.dc .tick-narrow { display: none; }
/* On a phone the chart renders at under half size, so its text is set larger
   in chart units to land at a readable size on screen. */
@media (max-width: 560px) {
  .figs { flex-direction: column; gap: 20px; }
  .dc .tick { font-size: 24px; transform: translateY(10px); }
  .dc .tick-wide { display: none; }
  .dc .tick-narrow { display: inline; }
  .dc .dc-steady, .dc .dc-axis { font-size: 26px; }
  .dc .dc-lbl { font-size: 30px; }
  .dc .dc-axis { transform: translateY(16px); font-size: 24px; }
}

@media (prefers-reduced-motion: no-preference) {
  /* Dots arrive left to right, so the eye follows the ages in order. */
  [data-reveal] .dot { opacity: 0; transform: translateY(10px); transition: opacity 350ms ease-out, transform 350ms ease-out; transition-delay: var(--d); }
  [data-reveal].is-in .dot { opacity: 1; transform: none; }
  /* Once revealed, hover changes are quick and undelayed. */
  [data-reveal].is-in.is-done .dot { transition: opacity 150ms ease-out, transform 150ms ease-out; transition-delay: 0ms; }
}

/* ── How it works: three small illustrations of the process ──────── */
.how { padding: 88px 0 24px; }
.how > h2 { margin: 0 0 8px; }
.how-lede { margin: 0 0 40px; color: var(--ink-muted); font-size: 1.0625rem; }
.flow { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(3, 1fr); gap: 40px; }
/* Subgrid keeps the four parts of each step on shared rows, so the three
   pictures line up even when one heading wraps to two lines. */
.flow-step { position: relative; display: grid; grid-row: span 4; grid-template-rows: subgrid; row-gap: 0; }
.stage {
  position: relative; min-height: 240px; border-radius: 14px; background: var(--surface-2);
  display: flex; align-items: center; justify-content: center; padding: 20px; box-sizing: border-box; margin: 14px 0 16px;
}
/* The connector: a small arrow between one stage and the next. */
.flow-step:not(:last-child) .stage::after {
  content: '→'; position: absolute; right: -32px; top: 50%; transform: translateY(-50%);
  width: 24px; text-align: center; color: var(--ink-muted); font-size: 1.25rem;
}
.step-no { font-family: 'IBM Plex Mono', monospace; font-size: 0.8125rem; color: var(--accent); }
.flow-step h3 { margin: 4px 0 0; font-size: 1.25rem; line-height: 1.3; }
.flow-step > p { margin: 0; color: var(--ink-muted); font-size: 0.9375rem; }

.chips { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; }
.chip { display: inline-flex; align-items: baseline; gap: 6px; background: var(--bg); border-radius: 999px; padding: 8px 14px; font-size: 0.9375rem; font-weight: 500; box-shadow: 0 1px 2px rgba(60, 50, 30, 0.08); }
.chip i { font-style: normal; font-weight: 400; color: var(--ink-muted); font-size: 0.8125rem; }
.chip-more { background: transparent; box-shadow: inset 0 0 0 1px var(--border-strong); color: var(--ink-muted); font-weight: 400; }

.ledger { width: 100%; max-width: 300px; background: var(--bg); border-radius: 10px; padding: 16px 18px; box-shadow: 0 1px 3px rgba(60, 50, 30, 0.1); font-size: 0.875rem; }
.ledger p { display: flex; justify-content: space-between; gap: 12px; margin: 0; padding: 7px 0; border-bottom: 1px dashed var(--border); }
.ledger b { font-family: 'IBM Plex Mono', monospace; font-weight: 500; font-variant-numeric: tabular-nums; }
.ledger .ledger-h { font-weight: 600; padding-top: 0; }
.ledger .ledger-t { font-weight: 600; border-bottom: 0; }
.ledger .ledger-t b { font-weight: 600; }
.ledger .ledger-f { border: 0; padding-bottom: 0; padding-top: 10px; border-top: 1px solid var(--border); color: var(--ink-muted); font-size: 0.8125rem; display: block; }

.inputs { width: 100%; }
.in-k { margin: 0 0 8px; font-size: 0.8125rem; color: var(--ink-muted); }
.in-k + .chips { justify-content: flex-start; margin-bottom: 18px; }
/* Spending as a rising staircase: the same plan, a bigger monthly bill each decade. */
.spend { display: flex; align-items: flex-end; gap: 6px; }
.spend span { flex: 1; display: flex; flex-direction: column; justify-content: flex-end; background: var(--bg); border-radius: 8px; padding: 8px 10px; font-weight: 600; font-size: 0.9375rem; white-space: nowrap; box-shadow: 0 1px 2px rgba(60, 50, 30, 0.08); }
.spend span:nth-child(2) { min-height: 58px; }
.spend span:nth-child(3) { min-height: 72px; color: var(--loss); }
.spend i { font-style: normal; font-weight: 400; font-size: 0.75rem; color: var(--ink-muted); }
.answer { width: 100%; }
.answer p { margin: 0; }
.ans-k { font-size: 0.8125rem; color: var(--ink-muted); }
.answer .ans-v { font-family: 'Fraunces Variable', Georgia, serif; font-size: 1.75rem; font-weight: 600; line-height: 1.2; margin-bottom: 12px; }
.ans-v i { font-style: normal; font-family: 'DM Sans', system-ui, sans-serif; font-weight: 400; color: var(--ink-muted); font-size: 1.25rem; }
.answer .ans-n { font-size: 0.8125rem; color: var(--ink-muted); line-height: 1.45; margin: -6px 0 14px; }


@media (max-width: 960px) {
  .flow { grid-template-columns: 1fr; gap: 36px; }
  .flow-step:not(:last-child) .stage::after { display: none; }
  .stage { height: auto; min-height: 200px; }
}
/* ── Situations: full width, three across ────────────────────────── */
.starts { padding: 88px 0 24px; }
.starts h2 { margin: 0 0 6px; }
.starts-sub { margin: 0 0 24px; color: var(--ink-muted); }
.sits { display: grid; grid-template-columns: repeat(3, 1fr); column-gap: 48px; }
.sit { display: block; padding: 20px 0 22px; border-top: 1px solid var(--border); text-decoration: none; color: var(--ink); }
.sit-t { display: flex; justify-content: space-between; align-items: center; gap: 12px; font-weight: 500; font-size: 1.0625rem; }
.sit-t svg { width: 18px; height: 18px; color: var(--ink-muted); flex: none; transition: transform 150ms ease-out; }
.sit-d { display: block; margin-top: 6px; color: var(--ink-muted); font-size: 0.9375rem; }
.sit:hover .sit-t { color: var(--accent); }
.sit:hover .sit-t svg { color: var(--accent); transform: translateX(3px); }
.sit-own .sit-t, .sit-own .sit-t svg { color: var(--accent); }
@media (prefers-reduced-motion: reduce) { .sit-t svg { transition: none; } .sit:hover .sit-t svg { transform: none; } }

/* ── FAQ ─────────────────────────────────────────────────────────────── */
.faq { padding: 88px 0 24px; }
.faq-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 24px; flex-wrap: wrap; margin: 0 0 28px; }
.faq-head h2 { margin: 0 0 8px; }
.faq-head p { margin: 0; color: var(--ink-muted); }
.faq-list { border-top: 1px solid var(--border); }
.faq-a > :last-child { margin-bottom: 22px; }
.faq-t { width: 100%; border-collapse: collapse; margin: 0 0 16px; font-size: 0.9375rem; }
.faq-t th { text-align: left; font-weight: 500; color: var(--ink-muted); font-size: 0.8125rem; padding: 0 12px 8px 0; border-bottom: 1px solid var(--border); }
.faq-t td { padding: 10px 12px 10px 0; border-bottom: 1px solid var(--border); font-family: 'IBM Plex Mono', monospace; font-variant-numeric: tabular-nums; }
.faq details { border-bottom: 1px solid var(--border); }
.faq summary {
  list-style: none; cursor: pointer; padding: 20px 0; font-weight: 500; font-size: 1.0625rem;
  display: flex; justify-content: space-between; align-items: center; gap: 16px; min-height: 44px;
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary svg { width: 20px; height: 20px; color: var(--ink-muted); flex: none; transition: transform 200ms ease-out; }
.faq details[open] summary svg { transform: rotate(180deg); }
.faq details p { margin: 0 0 16px; color: var(--ink-muted); }

/* Every answer: the direct answer big, one small visual, then a way in. */
.faq details .faq-a .faq-big { font-family: 'Fraunces Variable', Georgia, serif; font-weight: 600; font-size: 1.375rem; line-height: 1.25; color: var(--ink); margin: 0 0 16px; }
.faq-go { display: inline-flex; align-items: center; gap: 6px; font-weight: 500; color: var(--accent); text-decoration: none; margin-top: 4px; }
.faq-go svg { width: 16px; height: 16px; transition: transform 150ms ease-out; }
.faq-go:hover svg { transform: translateX(3px); }
.faq-a > .faq-go:last-child { margin-bottom: 22px; }
.fq-track { height: 10px; border-radius: 5px; background: var(--border); overflow: hidden; }
.fq-track span { display: block; height: 100%; border-radius: 5px; }
.fq-bars { display: grid; gap: 12px; margin: 0 0 16px; }
.fq-bar { display: grid; grid-template-columns: 9.5rem 1fr 9rem; align-items: center; gap: 14px; font-size: 0.9375rem; }
.fq-bar .fq-track span { background: var(--ink-muted); }
.fq-bar strong { font-weight: 500; text-align: right; }
.fq-prop { margin: 0 0 16px; }
.fq-prop-h { display: flex; justify-content: space-between; gap: 12px; font-size: 0.9375rem; margin: 0 0 6px; }
.fq-prop-h strong { font-weight: 600; color: var(--gain); }
.fq-prop .fq-track { background: var(--loss); opacity: 0.9; }
.fq-prop .fq-track span { background: var(--gain); border-radius: 0; }
.faq details .fq-prop p { margin: 6px 0 0; font-size: 0.8125rem; color: var(--ink-muted); }
.fq-dots { display: flex; align-items: center; gap: 14px; margin: 0 0 10px; font-size: 0.9375rem; flex-wrap: wrap; }
.fq-dotrow { display: inline-flex; gap: 5px; }
.fq-dotrow i { width: 12px; height: 12px; border-radius: 50%; background: var(--loss); }
.fq-dotrow i.ok { background: var(--gain); }
.fq-dots + p { margin-top: 16px; }
.fq-vs { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin: 0 0 16px; }
.fq-vs > div { background: var(--bg); border-radius: 10px; padding: 16px 18px; }
.fq-vs > div:last-child { box-shadow: inset 0 0 0 1.5px var(--accent); }
.fq-vs h4 { margin: 0 0 8px; font-size: 0.875rem; font-weight: 600; }
.fq-vs > div:last-child h4 { color: var(--accent); }
.fq-vs ul { margin: 0; padding-left: 18px; font-size: 0.9375rem; }
.fq-vs li + li { margin-top: 4px; }
.fq-nums { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; margin: 0 0 16px; }
.fq-nums strong { display: block; font-family: 'Fraunces Variable', Georgia, serif; font-size: 2rem; font-weight: 600; line-height: 1; }
.fq-nums span { display: block; margin-top: 6px; font-size: 0.875rem; color: var(--ink-muted); }
@media (max-width: 560px) {
  .fq-bar { grid-template-columns: 1fr; gap: 6px; }
  .fq-bar strong { text-align: left; }
  .fq-vs, .fq-nums { grid-template-columns: 1fr; }
}

/* Desktop: questions on the left, the open answer in a panel on the right.
   Still one set of <details>, so phones get a plain accordion and every
   answer stays in the HTML for search. */
@media (min-width: 961px) {
  .faq-list { position: relative; width: 38%; border-top: 0; }
  .faq summary { padding: 16px 18px; border-radius: 10px; min-height: 56px; }
  .faq details { border-bottom: 0; }
  .faq details + details summary { margin-top: 4px; }
  .faq summary:hover { background: var(--surface-2); }
  .faq details[open] summary { background: var(--surface); color: var(--accent); box-shadow: inset 3px 0 0 var(--accent); }
  .faq summary svg, .faq details[open] summary svg { transform: rotate(-90deg); }
  /* Sized to its own content, so a short answer is a short card, not an
     empty form. Tinted rather than bordered: it belongs to the selected row. */
  .faq-a {
    position: absolute; top: 0; box-sizing: border-box; left: calc(100% + 48px); width: calc(163.16% - 48px);
    background: var(--surface-2); border-radius: 14px; padding: 32px 36px 30px;
  }
  .faq-big { font-size: 1.75rem; }
  .faq details .faq-a p { color: var(--ink); }
}

/* ── Closing band ───────────────────────────────────────────────────── */
.close { margin: 72px 0 0; background: var(--surface); border-top: 1px solid var(--border); padding: 56px 0; }
.close .shell { display: flex; justify-content: space-between; align-items: center; gap: 24px; flex-wrap: wrap; }
.close h2 { margin: 0 0 6px; }
.close p { margin: 0; color: var(--ink-muted); }


/* ── Mobile collapse, declared per section ──────────────────────────── */
@media (max-width: 960px) {
  .h-hero { grid-template-columns: 1fr; gap: 36px; padding: 40px 0 36px; }
  .sits { grid-template-columns: 1fr 1fr; }
  .faq { padding-top: 64px; }
}
@media (max-width: 560px) {
  .rw { padding: 20px; }
  .rw-fields { grid-template-columns: 1fr 1fr; }
  .rw-fields .rw-field:first-child { grid-column: 1 / -1; }
  .rw-out { grid-template-columns: 1fr; }
  .rw-out > div + div { border-left: 0; border-top: 1px solid var(--border); padding: 16px 0 0; margin-top: 16px; }
  .band { padding: 48px 0; }
  .sits { grid-template-columns: 1fr; }
  .close .shell { flex-direction: column; align-items: flex-start; }
}

.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; }

@media (max-width: 560px) {
  .h-hero { padding-top: 24px; }
}
