/*
  Education Freedom Credit. Design notes:
  Audience: US taxpayers who heard about the $1,700 school choice credit and want their own number.
  One action: get a January 1 reminder with their number (email signup).
  Structure: Product Demo / Workbench. The hero is the calculator; the receipt is the proof visual.
  Type: Geist (single family), Geist Mono only for figures and dates. Tailwind type scale.
  Color: ink navy + one highlighter yellow accent; neutrals tinted toward the ink hue.
  Contrast checked for every pairing in both themes (scratchpad/contrast.py).
  Rule break: the hand drawn highlighter swipe behind the key phrase of the headline.
*/
:root {
  /* color: light */
  --bg: #fcfcfd;
  --surface: #f3f5f8;
  --surface-2: #e8ecf1;
  --ink: #0f1729;
  --ink-2: #475266;
  --ink-3: #5e697c;
  --line: #e2e6ec;
  --line-strong: #c3cbd6;
  --accent: #ffc93c;
  --accent-deep: #7a5600;
  --on-accent: #0f1729;
  --cta-bg: #0f1729;
  --cta-ink: #ffffff;
  --cta-hover: #24304a;
  --seg-state: #566781;
  --seg-ded: #a9b4c4;
  --danger: #b42318;
  --nav-bg: rgba(252, 252, 253, 0.72);
  --shadow-card: 0 1px 2px rgba(15, 23, 41, 0.04), 0 16px 40px -20px rgba(15, 23, 41, 0.22);
  --shadow-nav: 0 1px 2px rgba(15, 23, 41, 0.06), 0 8px 24px -12px rgba(15, 23, 41, 0.18);

  /* type */
  --font: "Geist", ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  --mono: "Geist Mono", ui-monospace, "SF Mono", Menlo, monospace;

  /* spacing (fixed scale) */
  --s-25: 2px; --s-50: 4px; --s-75: 8px; --s-100: 12px; --s-200: 16px; --s-300: 24px;
  --s-400: 32px; --s-500: 40px; --s-600: 48px; --s-700: 64px; --s-800: 80px; --s-900: 96px;

  /* radius */
  --r-md: 6px; --r-lg: 8px; --r-xl: 12px; --r-2xl: 16px; --r-full: 999px;

  /* motion */
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  --ease-press: cubic-bezier(0.23, 1, 0.32, 1);

  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #131209;
    --surface: #1f1f1f;
    --surface-2: #272727;
    --ink: #f6f4ec;
    --ink-2: #cbc8bc;
    --ink-3: #a3a094;
    --line: #313131;
    --line-strong: #4a4a44;
    --accent: #ffc93c;
    --accent-deep: #ffc93c;
    --on-accent: #131209;
    --cta-bg: #ffc93c;
    --cta-ink: #131209;
    --cta-hover: #ffd566;
    --seg-state: #8c97a8;
    --seg-ded: #5b616b;
    --danger: #ff8a7a;
    --nav-bg: rgba(19, 18, 9, 0.72);
    --shadow-card: 0 1px 2px rgba(0, 0, 0, 0.4), 0 16px 40px -20px rgba(0, 0, 0, 0.7);
    --shadow-nav: 0 1px 2px rgba(0, 0, 0, 0.4), 0 8px 24px -12px rgba(0, 0, 0, 0.6);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #131209; --surface: #1f1f1f; --surface-2: #272727; --ink: #f6f4ec; --ink-2: #cbc8bc; --ink-3: #a3a094;
  --line: #313131; --line-strong: #4a4a44; --accent: #ffc93c; --accent-deep: #ffc93c; --on-accent: #131209;
  --cta-bg: #ffc93c; --cta-ink: #131209; --cta-hover: #ffd566; --seg-state: #8c97a8; --seg-ded: #5b616b;
  --danger: #ff8a7a; --nav-bg: rgba(19, 18, 9, 0.72);
  --shadow-card: 0 1px 2px rgba(0, 0, 0, 0.4), 0 16px 40px -20px rgba(0, 0, 0, 0.7);
  --shadow-nav: 0 1px 2px rgba(0, 0, 0, 0.4), 0 8px 24px -12px rgba(0, 0, 0, 0.6);
  color-scheme: dark;
}

/* ---------- base ---------- */
*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; overflow-x: clip; scroll-padding-top: 96px; }
body {
  margin: 0; background: var(--bg); color: var(--ink); overflow-x: clip;
  font-family: var(--font); font-size: 16px; line-height: 24px; font-weight: 400;
  font-variant-numeric: tabular-nums; -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility;
}
h1, h2, h3, h4, p, ul, ol, dl, dd, figure { margin: 0; }
ul, ol { padding: 0; list-style: none; }
a { color: inherit; text-underline-offset: 3px; text-decoration-thickness: 1px; }
button, input, select, textarea { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--ink); outline-offset: 2px; }
h1, h2, h3, .heading-1, .heading-2, .heading-3, .heading-4, .heading-5 { text-wrap: balance; overflow-wrap: anywhere; min-width: 0; }
p, li, dd, summary { text-wrap: pretty; }
.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; }
.mono { font-family: var(--mono); font-variant-numeric: tabular-nums; }

/* ---------- text styles (Tailwind scale) ---------- */
.heading-1 { font-size: 36px; line-height: 40px; font-weight: 600; letter-spacing: -0.02em; }
.heading-2 { font-size: 30px; line-height: 36px; font-weight: 600; letter-spacing: -0.02em; }
.heading-3 { font-size: 30px; line-height: 36px; font-weight: 600; letter-spacing: -0.015em; }
.heading-4 { font-size: 24px; line-height: 32px; font-weight: 600; letter-spacing: -0.01em; }
.heading-5 { font-size: 20px; line-height: 28px; font-weight: 600; letter-spacing: -0.01em; }
.heading-6 { font-size: 20px; line-height: 28px; font-weight: 600; }
.title-2 { font-size: 18px; line-height: 28px; font-weight: 500; }
.title-3 { font-size: 16px; line-height: 24px; font-weight: 500; }
.title-4 { font-size: 14px; line-height: 20px; font-weight: 500; }
.body-3 { font-size: 16px; line-height: 24px; font-weight: 400; }
.body-4 { font-size: 14px; line-height: 20px; font-weight: 600; }
.body-5 { font-size: 14px; line-height: 20px; font-weight: 500; }
.body-6 { font-size: 14px; line-height: 20px; font-weight: 400; }
.caption-2 { font-size: 14px; line-height: 20px; font-weight: 400; }
.caption-3 { font-size: 12px; line-height: 16px; font-weight: 600; }
.caption-4 { font-size: 12px; line-height: 16px; font-weight: 500; }
.caption-5 { font-size: 12px; line-height: 16px; font-weight: 400; }
.button-md { font-size: 16px; line-height: 24px; font-weight: 600; }
.button-sm { font-size: 14px; line-height: 20px; font-weight: 600; }
@media (min-width: 640px) {
  .heading-1 { font-size: 48px; line-height: 48px; }
  .heading-2 { font-size: 36px; line-height: 40px; }
  .heading-3 { font-size: 36px; line-height: 40px; }
}
@media (min-width: 1024px) {
  .heading-1 { font-size: 60px; line-height: 60px; }
  .heading-2 { font-size: 48px; line-height: 48px; }
}
.muted { color: var(--ink-2); }
.faint { color: var(--ink-3); }

.wrap { width: 100%; max-width: 1200px; margin: 0 auto; padding: 0 var(--s-200); }
@media (min-width: 768px) { .wrap { padding: 0 var(--s-400); } }

.skip { position: fixed; left: var(--s-200); top: var(--s-200); z-index: 100; background: var(--cta-bg); color: var(--cta-ink); padding: var(--s-75) var(--s-100); border-radius: var(--r-lg); transform: translateY(-200%); }
.skip:focus { transform: none; }

/* ---------- buttons ---------- */
.btn {
  appearance: none; border: 1px solid transparent; border-radius: var(--r-lg); cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center; gap: var(--s-75);
  padding: var(--s-100) var(--s-200); min-height: 48px; white-space: nowrap; text-decoration: none;
  transition: transform 160ms var(--ease-press), background-color 200ms var(--ease), color 200ms var(--ease), border-color 200ms var(--ease);
}
.btn:active { transform: scale(0.97); }
.btn svg { width: 18px; height: 18px; flex: none; }
.btn-primary { background: var(--cta-bg); color: var(--cta-ink); }
.btn-quiet { background: transparent; color: var(--ink); border-color: var(--line-strong); }
.btn-sm { min-height: 36px; padding: var(--s-75) var(--s-100); }
.btn[disabled] { opacity: 0.6; cursor: not-allowed; }
@media (hover: hover) and (pointer: fine) {
  .btn-primary:hover { background: var(--cta-hover); }
  .btn-quiet:hover { background: var(--surface); }
}
.linklike { appearance: none; background: none; border: 0; padding: 0; cursor: pointer; color: var(--ink); text-decoration: underline; text-underline-offset: 3px; text-decoration-color: var(--line-strong); }
@media (hover: hover) and (pointer: fine) { .linklike:hover { text-decoration-color: var(--ink); } }

/* ---------- nav (floating pill) ---------- */
.nav-wrap { position: fixed; top: var(--s-100); left: 0; right: 0; z-index: 50; display: flex; justify-content: center; padding: 0 var(--s-100); pointer-events: none; }
.nav {
  pointer-events: auto; display: flex; align-items: center; gap: var(--s-75);
  background: var(--nav-bg); backdrop-filter: saturate(1.6) blur(16px); -webkit-backdrop-filter: saturate(1.6) blur(16px);
  border: 1px solid var(--line); border-radius: var(--r-full); padding: var(--s-50) var(--s-50) var(--s-50) var(--s-200);
  box-shadow: var(--shadow-nav); max-width: 100%;
}
.brand { display: inline-flex; align-items: center; gap: var(--s-75); text-decoration: none; margin-right: var(--s-200); white-space: nowrap; }
.brand svg { width: 22px; height: 22px; flex: none; }
.nav-links { display: none; gap: var(--s-50); }
.nav-links a { text-decoration: none; color: var(--ink-2); padding: var(--s-75) var(--s-100); border-radius: var(--r-full); white-space: nowrap; transition: color 200ms var(--ease), background-color 200ms var(--ease); }
.nav-links a[aria-current="page"] { color: var(--ink); background: var(--surface-2); }
@media (hover: hover) and (pointer: fine) { .nav-links a:hover { color: var(--ink); background: var(--surface); } }
.nav .btn-sm { border-radius: var(--r-full); }
.menu-btn { appearance: none; background: transparent; border: 0; width: 36px; height: 36px; border-radius: var(--r-full); position: relative; cursor: pointer; }
.menu-btn span:not(.sr-only) { position: absolute; left: 10px; right: 10px; height: 1.5px; background: var(--ink); border-radius: 2px; transition: transform 300ms var(--ease); }
.menu-btn span:nth-child(1) { transform: translateY(-4px); }
.menu-btn span:nth-child(2) { transform: translateY(4px); }
.menu-btn[aria-expanded="true"] span:nth-child(1) { transform: rotate(45deg); }
.menu-btn[aria-expanded="true"] span:nth-child(2) { transform: rotate(-45deg); }
@media (min-width: 860px) { .nav-links { display: flex; } .menu-btn { display: none; } }
@media (max-width: 420px) { .brand span { display: none; } .brand { margin-right: var(--s-75); } }

.menu {
  position: fixed; inset: 0; z-index: 40; padding: 96px var(--s-300) var(--s-400);
  background: color-mix(in srgb, var(--bg) 92%, transparent); backdrop-filter: blur(24px); -webkit-backdrop-filter: blur(24px);
  display: flex; flex-direction: column; gap: var(--s-75);
}
.menu a { text-decoration: none; padding: var(--s-100) 0; border-bottom: 1px solid var(--line); opacity: 0; transform: translateY(24px); transition: opacity 400ms var(--ease), transform 400ms var(--ease); }
.menu.open a { opacity: 1; transform: none; }

/* ---------- hero / workbench ---------- */
.hero { padding: 96px 0 var(--s-700); }
@media (min-width: 1024px) { .hero { padding: 120px 0 var(--s-900); } }
.hero-grid { display: grid; gap: var(--s-400); align-items: start; }
@media (min-width: 1024px) { .hero-grid { grid-template-columns: minmax(0, 1.05fr) minmax(0, 0.95fr); gap: var(--s-700); } }
.eyebrow { color: var(--ink-2); margin-bottom: var(--s-200); letter-spacing: 0.02em; }
.h1 { max-width: 680px; }
.lede { color: var(--ink-2); max-width: 600px; margin-top: var(--s-300); font-weight: 400; }

/* the one rule break: a hand drawn highlighter swipe */
.hl { position: relative; background: none; color: var(--on-accent); white-space: nowrap; isolation: isolate; }
.hl::before {
  content: ""; position: absolute; z-index: -1; left: -0.08em; right: -0.1em; top: 0.12em; bottom: 0.02em;
  background: var(--accent); border-radius: 0.18em 0.32em 0.22em 0.4em; transform: rotate(-1.2deg) skewX(-6deg);
  clip-path: inset(0 0 0 0);
}
.js .hl::before { clip-path: inset(0 100% 0 0); transition: clip-path 700ms var(--ease) 350ms; }
.js.ready .hl::before { clip-path: inset(0 0 0 0); }
/* before the swipe lands, keep the phrase readable on the page background */
.js .hl { color: var(--ink); transition: color 300ms var(--ease) 700ms; }
.js.ready .hl { color: var(--on-accent); }

.state-note { margin-top: var(--s-300); display: flex; gap: var(--s-100); align-items: baseline; max-width: 600px; color: var(--ink-2); }
.tag { display: inline-flex; align-items: center; gap: var(--s-50); padding: var(--s-25) var(--s-75); border-radius: var(--r-md); white-space: nowrap; background: var(--surface-2); color: var(--ink-2); }
.tag.in { background: var(--ink); color: var(--bg); }

/* form */
.calc-form { margin-top: var(--s-500); display: grid; gap: var(--s-300); max-width: 600px; }
.field { border: 0; padding: 0; margin: 0; min-width: 0; display: grid; gap: var(--s-75); }
.field > legend, .field label.lbl, .lbl { display: block; color: var(--ink); padding: 0; margin-bottom: var(--s-75); }
.row2 { display: grid; gap: var(--s-200); grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
.row2.one { grid-template-columns: minmax(0, 1fr); }
.row2 > div { min-width: 0; }
.hint { color: var(--ink-3); }

.calc-form { container-type: inline-size; }
.seg { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--s-50); padding: var(--s-50); background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-xl); }
@container (min-width: 540px) { .seg { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
.seg input { position: absolute; opacity: 0; pointer-events: none; }
.seg label { display: flex; align-items: center; justify-content: center; text-align: center; min-height: 40px; padding: var(--s-75); border-radius: var(--r-lg); cursor: pointer; color: var(--ink-2); user-select: none; white-space: nowrap; transition: color 200ms var(--ease), background-color 200ms var(--ease); }
.seg input:checked + label { background: var(--bg); color: var(--ink); box-shadow: 0 1px 2px rgba(15, 23, 41, 0.08), 0 0 0 1px var(--line); }
.seg input:focus-visible + label { outline: 2px solid var(--ink); outline-offset: 1px; }
@media (hover: hover) and (pointer: fine) { .seg label:hover { color: var(--ink); } }

.input, select.input {
  width: 100%; min-height: 48px; padding: var(--s-100) var(--s-100); border: 1px solid var(--line-strong); border-radius: var(--r-lg);
  background: var(--bg); color: var(--ink); font-size: 16px; line-height: 24px;
  transition: border-color 200ms var(--ease), box-shadow 200ms var(--ease);
}
.input:focus, select.input:focus { outline: none; border-color: var(--ink); box-shadow: 0 0 0 3px color-mix(in srgb, var(--ink) 14%, transparent); }
.input[aria-invalid="true"] { border-color: var(--danger); }
select.input { appearance: none; padding-right: var(--s-500); background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 256 256' fill='%235e697c'%3E%3Cpath d='M213.66,101.66l-80,80a8,8,0,0,1-11.32,0l-80-80A8,8,0,0,1,53.66,90.34L128,164.69l74.34-74.35a8,8,0,0,1,11.32,11.32Z'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 12px center; background-size: 16px; }
.money { position: relative; }
.money::before { content: "$"; position: absolute; left: var(--s-100); top: 50%; transform: translateY(-50%); color: var(--ink-3); pointer-events: none; font-family: var(--mono); }
.money .input { padding-left: var(--s-400); font-family: var(--mono); }

.more { border-top: 1px solid var(--line); padding-top: var(--s-200); }
.more > summary { list-style: none; cursor: pointer; display: inline-flex; align-items: center; gap: var(--s-75); color: var(--ink); min-height: 32px; }
.more > summary::-webkit-details-marker { display: none; }
.more > summary svg { width: 16px; height: 16px; transition: transform 200ms var(--ease); }
.more[open] > summary svg { transform: rotate(180deg); }
.more-body { display: grid; gap: var(--s-200); padding-top: var(--s-200); }
.js .more[open] .more-body { animation: fadeUp 240ms var(--ease) both; }
.check { display: flex; gap: var(--s-100); align-items: flex-start; cursor: pointer; }
.check input { width: 18px; height: 18px; margin: 1px 0 0; accent-color: var(--ink); flex: none; }
.sub-panel { display: grid; gap: var(--s-200); padding: var(--s-200); background: var(--surface); border-radius: var(--r-xl); }
.estimate { color: var(--ink-3); }
.estimate b { color: var(--ink); font-weight: 600; font-family: var(--mono); }

/* ---------- receipt ---------- */
.receipt { background: var(--bg); border: 1px solid var(--line); border-radius: var(--r-2xl); box-shadow: var(--shadow-card); padding: var(--s-300); }
@media (min-width: 640px) { .receipt { padding: var(--s-400); } }
@media (min-width: 1024px) and (min-height: 760px) { .hero-receipt { position: sticky; top: 88px; } }
.r-top { display: flex; justify-content: space-between; align-items: baseline; gap: var(--s-200); color: var(--ink-2); }
.r-big { margin-top: var(--s-100); font-variant-numeric: tabular-nums lining-nums; letter-spacing: -0.03em; }
.r-sub { color: var(--ink-3); margin-top: var(--s-75); }

.bar { position: relative; display: flex; gap: var(--s-25); height: 12px; margin-top: var(--s-300); border-radius: var(--r-full); overflow: hidden; background: var(--surface-2); }
.bar i { display: block; height: 100%; min-width: 0; }
.k-fed { background: var(--ink); }
.k-carry { background: repeating-linear-gradient(135deg, var(--ink) 0 3px, transparent 3px 6px); box-shadow: inset 0 0 0 1px var(--ink); }
.k-state { background: var(--seg-state); }
.k-ded { background: var(--seg-ded); }
.k-net { background: var(--accent); }

.ledger { margin-top: var(--s-300); display: grid; }
.lrow { display: flex; justify-content: space-between; align-items: baseline; gap: var(--s-200); padding: var(--s-75) 0; }
.lrow dt { display: flex; align-items: center; gap: var(--s-75); color: var(--ink-2); min-width: 0; }
.lrow dd { font-family: var(--mono); color: var(--ink); white-space: nowrap; }
.lrow .sw { width: 10px; height: 10px; border-radius: 3px; flex: none; }
.lrow.head dt { color: var(--ink); }
.lrow.total { border-top: 1px dashed var(--line-strong); margin-top: var(--s-75); padding-top: var(--s-100); }
.lrow.total dt, .lrow.total dd { color: var(--ink); font-weight: 600; }

.per { width: 100%; border-collapse: collapse; margin-top: var(--s-200); }
.per th, .per td { text-align: right; padding: var(--s-75) 0; border-top: 1px solid var(--line); font-weight: 400; }
.per th:first-child, .per td:first-child { text-align: left; color: var(--ink-2); }
.per thead th { border-top: 0; color: var(--ink-3); }
.per td { font-family: var(--mono); }
.per td:first-child { font-family: var(--font); }

.r-cta { margin-top: var(--s-300); padding-top: var(--s-300); border-top: 1px solid var(--line); display: grid; gap: var(--s-100); }
.signup { display: flex; gap: var(--s-75); flex-wrap: wrap; margin-top: var(--s-75); }
.signup .input { flex: 1 1 200px; }
.signup .btn { flex: 0 0 auto; }
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.form-msg { min-height: 0; }
.form-msg:empty { display: none; }
.form-msg.err { color: var(--danger); }
.done { display: flex; gap: var(--s-100); align-items: flex-start; padding: var(--s-200); border-radius: var(--r-xl); background: var(--surface); }
.done svg { width: 20px; height: 20px; flex: none; margin-top: 2px; }

.tips { display: grid; gap: var(--s-75); margin-top: var(--s-200); }
.tips li { display: flex; gap: var(--s-100); align-items: flex-start; padding: var(--s-100) var(--s-200); border-radius: var(--r-xl); background: var(--surface); color: var(--ink-2); }
.tips li::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: var(--ink-3); margin-top: 7px; flex: none; }
.tips li.win { color: var(--ink); }
.tips li.win::before { background: var(--accent); box-shadow: 0 0 0 2px color-mix(in srgb, var(--accent) 35%, transparent); }
.tips li.warn { color: var(--ink); }
.tips li.warn::before { background: var(--ink); }
.receipt-foot { margin-top: var(--s-200); color: var(--ink-3); display: flex; flex-wrap: wrap; gap: var(--s-75) var(--s-200); align-items: center; }
.receipt-foot svg { width: 16px; height: 16px; vertical-align: -3px; }

/* mobile mini result bar */
.minibar {
  position: fixed; left: var(--s-100); right: var(--s-100); bottom: var(--s-100); z-index: 30;
  display: flex; align-items: center; justify-content: space-between; gap: var(--s-200);
  padding: var(--s-75) var(--s-75) var(--s-75) var(--s-200); border-radius: var(--r-xl);
  background: var(--cta-bg); color: var(--cta-ink); box-shadow: var(--shadow-nav);
  transform: translateY(calc(100% + 24px)); transition: transform 180ms var(--ease-press);
}
.minibar.show { transform: none; transition-duration: 260ms; }
.minibar .btn { background: color-mix(in srgb, var(--cta-ink) 14%, transparent); color: var(--cta-ink); min-height: 40px; }
.minibar b { font-family: var(--mono); font-weight: 600; }
@media (min-width: 1024px) { .minibar { display: none; } }

/* ---------- sections ---------- */
.section { padding: var(--s-800) 0; }
@media (min-width: 1024px) { .section { padding: var(--s-900) 0; } }
.section-head { display: grid; gap: var(--s-200); max-width: 680px; margin-bottom: var(--s-600); }
.section-head p { color: var(--ink-2); }

/* statement (word reveal) */
.statement { padding: var(--s-900) 0; }
.statement p { max-width: 900px; }
.statement .w { color: color-mix(in srgb, var(--ink) 28%, transparent); transition: color 500ms var(--ease); }
.statement .w.on { color: var(--ink); }

/* rules */
.rules { display: grid; }
.rule { display: grid; gap: var(--s-300); padding: var(--s-500) 0; border-top: 1px solid var(--line); }
.rule:last-child { border-bottom: 1px solid var(--line); }
@media (min-width: 900px) { .rule { grid-template-columns: 64px minmax(0, 1fr) minmax(0, 1.1fr); gap: var(--s-400); align-items: center; } }
.rule-n { color: var(--ink-3); }
.rule-copy { display: grid; gap: var(--s-100); max-width: 480px; }
.rule-copy p { color: var(--ink-2); }
.viz { background: var(--surface); border-radius: var(--r-2xl); padding: var(--s-300); }

.viz-pair { display: grid; grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr) auto auto; gap: var(--s-100); align-items: center; }
.mini { background: var(--bg); border: 1px solid var(--line); border-radius: var(--r-lg); padding: var(--s-100); display: grid; gap: var(--s-50); min-width: 0; }
.mini .k { color: var(--ink-3); }
.mini .v { font-family: var(--mono); font-weight: 600; }
.op { color: var(--ink-3); font-family: var(--mono); }
.sum { font-family: var(--mono); font-weight: 600; font-size: 20px; line-height: 28px; }
@media (max-width: 520px) { .viz-pair { grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr); } .viz-pair .op.eq, .viz-pair .sum { grid-column: span 1; } .viz-pair .op.eq { grid-column: 1 / 2; justify-self: end; } }

.viz-split .track { display: flex; gap: var(--s-25); height: 40px; border-radius: var(--r-lg); overflow: hidden; }
.viz-split .track i { display: flex; align-items: center; padding: 0 var(--s-100); font-style: normal; font-family: var(--mono); font-size: 12px; line-height: 16px; white-space: nowrap; overflow: hidden; }
.viz-split .used { background: var(--ink); color: var(--bg); flex: 900; }
.viz-split .carry { background: repeating-linear-gradient(135deg, color-mix(in srgb, var(--ink) 22%, transparent) 0 3px, transparent 3px 7px); box-shadow: inset 0 0 0 1px var(--ink); color: var(--ink); flex: 800; }
.viz-split .legend { display: flex; justify-content: space-between; gap: var(--s-200); margin-top: var(--s-100); color: var(--ink-2); flex-wrap: wrap; }
.viz-split .legend b { font-family: var(--mono); color: var(--ink); font-weight: 600; }

.viz-ledger { display: grid; gap: 0; }
.viz-ledger .lrow { padding: var(--s-50) 0; }

/* timeline */
.timeline { display: grid; gap: 0; position: relative; }
.stop { position: relative; display: grid; gap: var(--s-75); padding: 0 0 var(--s-400) var(--s-400); }
.stop::before { content: ""; position: absolute; left: 5px; top: 18px; bottom: -6px; width: 2px; background: var(--line); }
.stop:last-child::before { display: none; }
.stop .dot { position: absolute; left: 0; top: 6px; width: 12px; height: 12px; border-radius: 50%; background: var(--bg); border: 2px solid var(--line-strong); }
.stop.past .dot { background: var(--ink-3); border-color: var(--ink-3); }
.stop.now .dot { background: var(--accent); border-color: var(--ink); box-shadow: 0 0 0 4px color-mix(in srgb, var(--accent) 35%, transparent); }
.stop .date { color: var(--ink); font-family: var(--mono); font-size: 14px; line-height: 20px; font-weight: 500; display: flex; gap: var(--s-75); align-items: center; flex-wrap: wrap; }
.stop .here { font-family: var(--font); }
.stop p { color: var(--ink-2); max-width: 300px; }
@media (min-width: 900px) {
  .timeline { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: var(--s-300); }
  .stop { padding: var(--s-400) 0 0; }
  .stop::before { left: 18px; right: calc(-1 * var(--s-300) - 6px); top: 5px; bottom: auto; width: auto; height: 2px; }
  .stop .dot { top: 0; }
}

/* states tile map */
.states-layout { display: grid; gap: var(--s-500); }
@media (min-width: 1024px) { .states-layout { grid-template-columns: minmax(0, 0.8fr) minmax(0, 1.2fr); align-items: center; } }
.tilemap { display: grid; grid-template-columns: repeat(11, minmax(0, 1fr)); grid-template-rows: repeat(8, auto); gap: 3px; }
.tile { aspect-ratio: 1; display: grid; place-items: center; border-radius: var(--r-md); text-decoration: none; font-family: var(--mono); font-size: 10px; line-height: 16px; font-weight: 500; background: var(--surface); color: var(--ink-3); border: 1px solid var(--line); transition: background-color 200ms var(--ease), color 200ms var(--ease), transform 160ms var(--ease-press); }
@media (min-width: 480px) { .tile { font-size: 12px; } }
.tile.in { background: var(--ink); color: var(--bg); border-color: var(--ink); }
.tile.current { background: var(--accent); color: var(--on-accent); border-color: var(--ink); }
.tile:active { transform: scale(0.94); }
@media (hover: hover) and (pointer: fine) { .tile:hover { background: var(--surface-2); color: var(--ink); } .tile.in:hover { background: var(--cta-hover); color: var(--cta-ink); } }
:root[data-theme="dark"] .tile.in:hover { color: var(--on-accent); }
.map-key { display: flex; gap: var(--s-300); flex-wrap: wrap; margin-top: var(--s-200); color: var(--ink-3); }
.map-key span { display: inline-flex; gap: var(--s-75); align-items: center; }
.map-key i { width: 12px; height: 12px; border-radius: 3px; background: var(--ink); display: inline-block; }
.map-key i.o { background: var(--surface); border: 1px solid var(--line-strong); }
.state-list { margin-top: var(--s-300); columns: 2; column-gap: var(--s-300); }
.state-list li { break-inside: avoid; }
.state-list a { display: block; padding: var(--s-75) 0; text-decoration: none; color: var(--ink-2); }
@media (min-width: 640px) { .state-list { display: none; } }

/* faq */
.faq-layout { display: grid; gap: var(--s-400); }
@media (min-width: 1024px) { .faq-layout { grid-template-columns: minmax(0, 0.8fr) minmax(0, 1.2fr); gap: var(--s-700); } .faq-layout .section-head { position: sticky; top: 112px; align-self: start; } }
.faq details { border-top: 1px solid var(--line); }
.faq details:last-child { border-bottom: 1px solid var(--line); }
.faq summary { list-style: none; cursor: pointer; display: flex; justify-content: space-between; gap: var(--s-200); padding: var(--s-200) 0; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary svg { width: 20px; height: 20px; flex: none; margin-top: 2px; color: var(--ink-3); transition: transform 200ms var(--ease); }
.faq details[open] summary svg { transform: rotate(45deg); }
.faq .a { padding: 0 0 var(--s-300); color: var(--ink-2); max-width: 640px; }

/* final cta */
.final { background: var(--surface); border-radius: var(--r-2xl); padding: var(--s-400) var(--s-300); display: grid; gap: var(--s-300); }
@media (min-width: 900px) { .final { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); padding: var(--s-700); align-items: center; gap: var(--s-700); } }
.final .signup .input { background: var(--bg); }

/* secondary pages */
.page { padding: 120px 0 var(--s-900); }
.page .prose { max-width: 680px; display: grid; gap: var(--s-200); color: var(--ink-2); }
.page .prose h2 { color: var(--ink); margin-top: var(--s-300); }
.page .prose a { color: var(--ink); }
.sgo-grid { display: grid; gap: var(--s-600); }
@media (min-width: 960px) { .sgo-grid { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); align-items: start; } }
.points { display: grid; gap: var(--s-200); margin-top: var(--s-400); }
.points li { display: flex; gap: var(--s-100); color: var(--ink-2); }
.points svg { width: 20px; height: 20px; flex: none; color: var(--ink); margin-top: 2px; }
.form-card { background: var(--bg); border: 1px solid var(--line); border-radius: var(--r-2xl); box-shadow: var(--shadow-card); padding: var(--s-300); display: grid; gap: var(--s-200); }
.form-card .row2 { grid-template-columns: minmax(0, 1fr); }
@media (min-width: 640px) { .form-card { padding: var(--s-400); } .form-card .row2 { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); } }
textarea.input { min-height: 96px; resize: vertical; }

/* footer */
.footer { padding: var(--s-700) 0 var(--s-900); }
.footer-grid { display: grid; gap: var(--s-400); border-top: 1px solid var(--line); padding-top: var(--s-400); }
@media (min-width: 900px) { .footer-grid { grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); } }
.footer p { color: var(--ink-3); max-width: 680px; }
.footer p + p { margin-top: var(--s-100); }
.footer a { color: var(--ink-2); }
.footer-links { display: grid; gap: var(--s-75); align-content: start; }
.footer-links a { text-decoration: none; color: var(--ink-2); }
@media (hover: hover) and (pointer: fine) { .footer-links a:hover { color: var(--ink); text-decoration: underline; } }

/* ---------- motion ---------- */
@keyframes fadeUp { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
.js [data-enter] { opacity: 0; transform: translateY(16px); transition: opacity 600ms var(--ease), transform 600ms var(--ease); }
.js.ready [data-enter] { opacity: 1; transform: none; }
.js.ready [data-enter="2"] { transition-delay: 60ms; }
.js.ready [data-enter="3"] { transition-delay: 120ms; }
.js.ready [data-enter="4"] { transition-delay: 180ms; }
.js [data-reveal] { opacity: 0; transform: translateY(32px); transition: opacity 700ms var(--ease), transform 700ms var(--ease); }
.js [data-reveal].in { opacity: 1; transform: none; }

@media (prefers-reduced-motion: reduce) {
  .js [data-enter], .js [data-reveal] { transform: none !important; transition: opacity 150ms linear !important; }
  .js .hl::before { clip-path: inset(0 0 0 0) !important; transition: none !important; }
  .menu a { transform: none !important; transition: opacity 150ms linear !important; }
  .minibar { transition: opacity 150ms linear !important; transform: none; opacity: 0; pointer-events: none; }
  .minibar.show { opacity: 1; pointer-events: auto; }
  .statement .w { transition: none !important; color: var(--ink) !important; }
  .js .more[open] .more-body { animation: none; }
  .btn:active, .tile:active { transform: none; }
}
