/* Ghostlist V2, "Japandi Ledger" direction.
 * Warm ink and moss on aged ledger paper. Fraunces display, Inter body.
 * All motion collapses under prefers-reduced-motion. No em dashes in copy. */

@font-face {
  font-family: "Fraunces";
  src: url("fraunces-var.woff2") format("woff2-variations");
  font-weight: 100 900;
  font-display: swap;
}
@font-face {
  font-family: "Inter";
  src: url("inter-var.woff2") format("woff2-variations");
  font-weight: 100 900;
  font-display: swap;
}

:root {
  --bg: #e9edee;
  --surface: #f6f9fa;
  --surface-alt: #dde3e5;
  --ink: #2f3739;
  --muted: #5f6b6d;
  --moss: #405a44;
  --moss-deep: #2d4331;
  --terra: #79412b;
  --terra-deep: #5f311f; /* small-text-safe terracotta */
  --indigo: #3f4a68;
  --line: #ccd6d8;
  --success: #3b6a4b;
  --warning: #7c5518;
  --warning-deep: #614110; /* small-text-safe warning */
  --display: "Fraunces", Georgia, "Noto Serif JP", serif;
  --body: "Inter", -apple-system, "Segoe UI", "Hiragino Sans", sans-serif;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  --ease-micro: cubic-bezier(0.4, 0, 0.2, 1);
  --radius: 6px;
}

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

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: var(--body);
  font-size: 1rem;
  line-height: 1.65;
  color: var(--ink);
  background: var(--bg);
  /* cool porcelain light drifting across the page, 60s loop */
  background-image:
    radial-gradient(55% 45% at 18% 8%, rgba(170, 195, 210, 0.16), rgba(170, 195, 210, 0) 70%),
    radial-gradient(50% 42% at 85% 78%, rgba(210, 220, 230, 0.10), rgba(210, 220, 230, 0) 70%),
    radial-gradient(75% 60% at 50% 115%, rgba(170, 195, 210, 0.07), rgba(170, 195, 210, 0) 70%);
  animation: roomDrift 60s ease-in-out infinite alternate;
}
@keyframes roomDrift {
  from { background-position: 50% 0%; }
  to { background-position: 52% 2%; }
}

h1, h2, h3, .display {
  font-family: var(--display);
  font-variation-settings: "SOFT" 100, "WONK" 1;
  font-optical-sizing: auto;
  font-weight: 560;
  line-height: 1.12;
  letter-spacing: -0.01em;
  margin: 0 0 0.6em;
  text-wrap: balance;
}
h1 { font-size: clamp(2.6rem, 6vw, 4.4rem); }
h2 { font-size: clamp(1.7rem, 3.6vw, 2.5rem); }
h3 { font-size: 1.2rem; }

p { margin: 0 0 1em; }
p:last-child { margin-bottom: 0; }

a { color: var(--indigo); }
a:hover { color: var(--ink); }

::selection { background: var(--moss); color: #fff; }

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

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

.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(233, 237, 238, 0.88);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}
.nav {
  max-width: 72rem;
  margin: 0 auto;
  padding: 0.85rem 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}
.brand { display: inline-flex; align-items: center; text-decoration: none; }
.wordmark-svg { height: 30px; width: auto; display: block; }
.wordmark-svg .strike-path {
  stroke-dasharray: 100;
  stroke-dashoffset: 100;
}
body.loaded .wordmark-svg .strike-path {
  animation: strikeDraw 0.6s var(--ease) 0.45s forwards;
}
@keyframes strikeDraw { to { stroke-dashoffset: 0; } }

.nav-links { display: flex; align-items: center; gap: 1.6rem; }
.nav-links .link {
  color: var(--muted);
  text-decoration: none;
  font-size: 0.92rem;
  font-weight: 500;
  position: relative;
}
.nav-links .link::after {
  content: "";
  position: absolute;
  left: 0; right: 0; bottom: -4px;
  height: 1px;
  background: var(--moss);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.25s var(--ease-micro);
}
.nav-links .link:hover { color: var(--ink); }
.nav-links .link:hover::after { transform: scaleX(1); }

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

.btn {
  display: inline-block;
  position: relative;
  min-height: 44px;
  background: var(--moss);
  color: #fff;
  font-family: var(--body);
  font-weight: 600;
  font-size: 0.95rem;
  letter-spacing: 0.01em;
  padding: 1rem 2rem;
  border-radius: 4px;
  text-decoration: none;
  border: 1px solid var(--moss);
  cursor: pointer;
  transition: background 0.18s var(--ease-micro), border-color 0.18s var(--ease-micro),
              transform 0.18s var(--ease);
}
.btn::after {
  content: "";
  position: absolute;
  left: 2rem; right: 2rem; bottom: 0.65rem;
  height: 2px;
  background: var(--terra);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.2s var(--ease-micro);
}
.btn:hover {
  background: var(--moss-deep);
  border-color: var(--moss-deep);
  transform: translateY(-1px);
}
.btn:hover::after { transform: scaleX(1); }
.btn:active { transform: translateY(0); }

.btn-sm {
  padding: 0.6rem 1.25rem;
  font-size: 0.86rem;
  min-height: 44px;
}
.btn-sm::after { left: 1.25rem; right: 1.25rem; bottom: 0.45rem; }
/* short/long button labels, swapped on small screens */
.btn .short { display: none; }
@media (max-width: 560px) {
  .btn .full { display: none; }
  .btn .short { display: inline; }
}

.btn-secondary {
  background: transparent;
  color: var(--ink);
  border: 1px solid var(--line);
}
.btn-secondary:hover {
  background: var(--surface-alt);
  border-color: var(--line);
}
.btn-secondary::after { display: none; }

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

.hero {
  max-width: 72rem;
  margin: 0 auto;
  padding: 5.5rem 1.5rem 4rem;
}
.hero-grid {
  display: grid;
  grid-template-columns: 1.05fr 0.95fr;
  gap: 3.5rem;
  align-items: center;
}
.hero-inner { max-width: 46rem; }
/* Hero result preview: static, clearly illustrative, desktop only */
.hero-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: 0 2px 12px rgba(33, 31, 28, 0.06);
  padding: 2rem 2.25rem;
  max-width: 26rem;
  margin-left: auto;
}
.hero-card-tag {
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--moss);
  margin-bottom: 1.1rem;
}
.hero-card-annual { margin-top: 0.9rem; font-size: 1rem; color: var(--muted); }
.hero-card-annual strong {
  font-family: var(--display);
  font-weight: 600;
  font-size: 1.3rem;
  color: var(--ink);
  font-variant-numeric: tabular-nums;
}
.hero-card-ghosts { color: var(--muted); font-size: 0.95rem; margin-top: 0.25rem; }
.hero-visual-caption {
  font-size: 0.8rem;
  color: var(--muted);
  margin-top: 0.9rem;
  text-align: right;
  max-width: 26rem;
  margin-left: auto;
}
.hero-proof {
  font-size: 0.82rem;
  color: var(--muted);
  margin-top: 0.9rem;
}
.kicker {
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 1.4rem;
  display: flex;
  align-items: center;
  gap: 0.7rem;
}
.kicker::before {
  content: "";
  width: 2rem;
  height: 1px;
  background: var(--moss);
  display: inline-block;
}
.hero h1 em {
  font-style: italic;
  color: var(--terra);
}
.lede {
  font-size: 1.18rem;
  color: var(--muted);
  max-width: 38rem;
  margin-bottom: 2.2rem;
}
.hero-ctas { display: flex; flex-wrap: wrap; gap: 0.9rem; margin-bottom: 1.4rem; }
.hero-note { font-size: 0.86rem; color: var(--muted); }

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

.section {
  max-width: 72rem;
  margin: 0 auto;
  padding: 4rem 1.5rem;
  border-top: 1px solid var(--line);
}
.eyebrow {
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--moss);
  margin-bottom: 1rem;
}
h2.eyebrow { margin-top: 0; } /* heading swap keeps the old paragraph spacing */

/* Screen-reader-only headings: keep section structure without visual change */
.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}
.sub { color: var(--muted); max-width: 42rem; font-size: 1.05rem; }
.sub strong { color: var(--ink); font-weight: 600; }

/* ---------- Ledger ---------- */

.ledger {
  margin-top: 2.5rem;
  border-top: 2px solid var(--moss);
  max-width: 56rem;
}
.ledger-row {
  display: grid;
  grid-template-columns: 1.2fr 1fr 1.4fr;
  gap: 1.5rem;
  align-items: baseline;
  padding: 1.35rem 0;
  border-bottom: 1px solid var(--line);
}
.ledger-head {
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
  padding: 0.9rem 0;
}
.ledger-row .fig {
  font-family: var(--display);
  font-variation-settings: "SOFT" 100, "WONK" 1;
  font-size: 1.9rem;
  font-weight: 560;
  font-variant-numeric: tabular-nums;
}
.ledger-row .fig .unit { font-size: 1rem; color: var(--muted); font-family: var(--body); }
.ledger-row .note { color: var(--muted); font-size: 0.95rem; }
.ledger-row .fig.glow { color: var(--terra); }
.est-tag {
  font-size: 0.68rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
  border: 1px solid var(--line);
  border-radius: 3px;
  padding: 0.1rem 0.4rem;
  vertical-align: middle;
  margin-left: 0.4rem;
  font-family: var(--body);
}

/* ---------- Steps ---------- */

.grid-3 {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.25rem;
  margin-top: 2.5rem;
}
.step {
  background: none;
  border: 0;
  border-top: 1px solid var(--line);
  border-radius: 0;
  box-shadow: none;
  padding: 1.75rem 0 0;
}
.step:hover {
  transform: none;
  box-shadow: none;
}
.step-num {
  font-family: var(--display);
  font-variation-settings: "SOFT" 100, "WONK" 1;
  font-style: normal;
  font-size: 2.6rem;
  font-weight: 560;
  color: var(--terra);
  margin-bottom: 0.6rem;
  display: block;
}
.step h3 { margin-bottom: 0.5rem; }
.step p { color: var(--muted); font-size: 0.95rem; margin: 0; }

/* ---------- Field notes (honesty) ---------- */

.field-notes { max-width: 56rem; }
.field-notes.small { max-width: 56rem; margin: 3rem auto 0; padding: 0 1.5rem; }
.fn-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.75rem 2.5rem;
  margin-top: 1.75rem;
}
.fn-item { display: flex; gap: 0.8rem; align-items: flex-start; }
.fn-mark { color: var(--terra-deep); font-weight: 700; line-height: 1.65; }
.fn-item p { color: var(--muted); font-size: 0.95rem; margin: 0; }
.fn-item strong { color: var(--ink); }

/* ---------- CTA band ---------- */

.cta-band {
  max-width: 72rem;
  margin: 0 auto;
  padding: 4.5rem 1.5rem 5.5rem;
  text-align: center;
  border-top: 1px solid var(--line);
}
.cta-band .kicker { justify-content: center; }
.cta-band .kicker::after {
  content: "";
  width: 2rem;
  height: 1px;
  background: var(--moss);
  display: inline-block;
}
.cta-band h2 { max-width: 34rem; margin-left: auto; margin-right: auto; }
.cta-band p { color: var(--muted); margin-bottom: 2rem; }

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

.site-footer { border-top: 1px solid var(--line); }
.footer-inner {
  max-width: 72rem;
  margin: 0 auto;
  padding: 1.6rem 1.5rem;
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
  font-size: 0.88rem;
  color: var(--muted);
}

/* ---------- Calculator / audit layout ---------- */

.calc-wrap {
  max-width: 72rem;
  margin: 0 auto;
  padding: 3rem 1.5rem 4rem;
}
.back-link {
  display: inline-block;
  color: var(--muted);
  text-decoration: none;
  font-size: 0.9rem;
  font-weight: 500;
  margin-bottom: 2.2rem;
  min-height: 44px;
  line-height: 44px;
}
.back-link:hover { color: var(--ink); }
.calc-wrap h1 { max-width: 40rem; }
.calc-wrap .sub { margin-bottom: 2.5rem; }

.calc-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.25rem;
  align-items: start;
}
.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 2.25rem;
  box-shadow: 0 2px 12px rgba(33, 31, 28, 0.06);
}

/* ---------- Fields ---------- */

.field { margin-bottom: 1.9rem; }
.field:last-child { margin-bottom: 0; }
.field-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 0.35rem;
}
.field label, .field-label {
  display: block;
  font-size: 0.76rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 0.5rem;
}
.field-head label { margin-bottom: 0; }

input[type="number"], input[type="text"] {
  width: 100%;
  min-height: 52px;
  font: inherit;
  font-size: 1.15rem;
  font-variant-numeric: tabular-nums;
  color: var(--ink);
  background: var(--surface-alt);
  border: 0;
  border-bottom: 1px solid var(--line);
  border-radius: 4px 4px 0 0;
  padding: 0.7rem 1rem;
  transition: border-color 0.18s var(--ease-micro), background 0.18s var(--ease-micro);
}
input[type="number"]:hover, input[type="text"]:hover { background: #dde3e5; }
input[type="number"]:focus, input[type="text"]:focus {
  outline: none;
  border-bottom: 2px solid var(--moss);
  background: #fff;
}
.hint { font-size: 0.85rem; color: var(--muted); margin-top: 0.5rem; }

.example-btn {
  appearance: none;
  background: transparent;
  border: 1px solid var(--line);
  box-shadow: none;
  color: var(--ink);
  font: inherit;
  font-size: 0.82rem;
  font-weight: 600;
  min-height: 44px;
  padding: 0.45rem 1.1rem;
  border-radius: 4px;
  cursor: pointer;
  transition: background 0.18s var(--ease-micro), border-color 0.18s var(--ease-micro),
              color 0.18s var(--ease-micro);
}
.example-btn:hover { background: var(--surface-alt); border-color: var(--moss); color: var(--moss-deep); }

/* ---------- Slider ---------- */

input[type="range"] {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 44px;
  background: transparent;
  cursor: pointer;
  margin: 0.25rem 0 0;
  --fill: var(--moss);
}
input[type="range"]::-webkit-slider-runnable-track {
  height: 2px;
  background: linear-gradient(to right, var(--fill) var(--fill-pct, 37.5%), var(--line) var(--fill-pct, 37.5%));
  border-radius: 2px;
}
input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 20px; height: 20px;
  margin-top: -9px;
  border-radius: 50%;
  background: #fff;
  border: 1px solid var(--moss);
  box-shadow: 0 2px 8px rgba(33, 31, 28, 0.18);
  transition: transform 0.15s var(--ease-micro), box-shadow 0.15s var(--ease-micro);
}
input[type="range"]:active::-webkit-slider-thumb {
  transform: scale(1.2);
  box-shadow: 0 4px 14px rgba(33, 31, 28, 0.25);
}
input[type="range"]::-moz-range-track {
  height: 2px;
  background: var(--line);
  border-radius: 2px;
}
input[type="range"]::-moz-range-progress {
  height: 2px;
  background: var(--fill);
  border-radius: 2px;
}
input[type="range"]::-moz-range-thumb {
  width: 18px; height: 18px;
  border-radius: 50%;
  background: #fff;
  border: 1px solid var(--moss);
  box-shadow: 0 2px 8px rgba(33, 31, 28, 0.18);
}
.slider-value {
  font-family: var(--display);
  font-variation-settings: "SOFT" 100, "WONK" 1;
  font-size: 1.35rem;
  font-weight: 560;
  color: var(--moss-deep);
  font-variant-numeric: tabular-nums;
}
.slider-scale {
  position: relative;
  height: 3.2rem;
  margin-top: 0.2rem;
}
.slider-scale .tick {
  position: absolute;
  transform: translateX(-50%);
  font-size: 0.72rem;
  color: var(--muted);
  text-align: center;
  line-height: 1.35;
  white-space: nowrap;
}
.slider-scale .tick:first-child { transform: none; }
.slider-scale .tick:last-child { transform: translateX(-100%); }
.tick-default { color: var(--terra-deep); font-weight: 700; }

.bill-details { margin-top: 0.4rem; }
.bill-details summary {
  cursor: pointer;
  min-height: 44px;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  color: var(--indigo);
  font-weight: 600;
  font-size: 0.95rem;
  list-style: none;
}
.bill-details summary::-webkit-details-marker { display: none; }
.bill-details summary::before {
  content: "";
  width: 0.55rem;
  height: 0.55rem;
  flex-shrink: 0;
  margin-right: 0.2rem;
  border-right: 2px solid var(--terra-deep);
  border-bottom: 2px solid var(--terra-deep);
  transform: rotate(-45deg);
  transition: transform 0.2s var(--ease-micro);
}
.bill-details[open] summary::before { transform: rotate(45deg); }
.bill-details summary:hover { color: var(--ink); }
.summary-hint { color: var(--muted); font-weight: 400; font-size: 0.85rem; }
.bill-details-inner { padding: 1.25rem 0 0.25rem; }

/* ---------- Warnings ---------- */

.warning {
  border: 1px solid var(--warning);
  border-left: 3px solid var(--warning);
  background: #f6f9fa;
  border-radius: 4px;
  padding: 1rem 1.25rem;
  margin: 1.25rem 0;
  font-size: 0.92rem;
  color: var(--ink);
}
.warning p { margin: 0 0 0.5em; }
.warning p:last-child { margin-bottom: 0; }
.warning strong { color: var(--warning-deep); }

/* ---------- Tier readout ---------- */

.tier-readout { min-height: 12rem; }
.tr-empty { color: var(--muted); font-size: 0.98rem; }
.tr-tier {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 1rem;
  padding-bottom: 1rem;
  margin-bottom: 1rem;
  border-bottom: 2px solid var(--moss);
}
.tr-tier-name {
  font-family: var(--display);
  font-variation-settings: "SOFT" 100, "WONK" 1;
  font-size: 1.45rem;
  font-weight: 560;
}
.tr-tier-range {
  font-size: 0.78rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
  font-weight: 600;
}
.tr-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 1rem;
  padding: 0.55rem 0;
  border-bottom: 1px solid var(--line);
  font-size: 0.95rem;
}
.tr-row:last-of-type { border-bottom: 0; }
.tr-row-label { color: var(--muted); }
.tr-row-value { font-weight: 600; font-variant-numeric: tabular-nums; text-align: right; }
.tr-tag {
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--moss);
  margin-left: 0.35rem;
}
.tr-savings {
  margin-top: 1.25rem;
  padding-top: 1.25rem;
  border-top: 1px dashed var(--line);
  text-align: center;
}
.tr-savings-label {
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 0.4rem;
}
.tr-savings-figure {
  position: relative;
  display: inline-block;
  font-family: var(--display);
  font-variation-settings: "SOFT" 100, "WONK" 1;
  font-size: clamp(2.6rem, 5vw, 3.4rem);
  font-weight: 600;
  color: var(--ink);
  font-variant-numeric: tabular-nums;
  margin: 0;
  line-height: 1.15;
}
.tr-savings-figure.zero { color: var(--muted); }
.tr-savings-figure .unit {
  font-family: var(--body);
  font-size: 1.1rem;
  color: var(--muted);
  font-weight: 500;
}
/* terracotta underline draws beneath the figure once the count settles */
.tr-savings-figure::after {
  content: "";
  position: absolute;
  left: 4%; right: 4%; bottom: -2px;
  height: 3px;
  background: var(--terra);
  border-radius: 2px;
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.25s var(--ease);
}
.tr-savings-figure.settled:not(.zero)::after { transform: scaleX(1); }
.tr-savings-sub { color: var(--muted); font-size: 0.92rem; margin-top: 0.7rem; }
.tr-annual { margin-top: 0.9rem; font-size: 1.02rem; }
.tr-annual .fig {
  font-family: var(--display);
  font-variation-settings: "SOFT" 100, "WONK" 1;
  font-weight: 600;
  font-size: 1.35rem;
  font-variant-numeric: tabular-nums;
}
.tr-cycle { font-size: 0.85rem; color: var(--muted); margin-top: 0.5rem; }
.tr-caveat { font-size: 0.8rem; color: var(--muted); margin-top: 1.1rem; line-height: 1.55; }

/* ---------- Notify capture (static: mailto, no database) ---------- */

.notify {
  margin-top: 1.75rem;
  padding-top: 1.5rem;
  border-top: 1px dashed var(--line);
}
.notify-title { font-weight: 600; font-size: 0.98rem; margin-bottom: 0.2rem; }
.notify-sub { color: var(--muted); font-size: 0.88rem; margin-bottom: 0.9rem; }
.notify-form { display: flex; gap: 0.6rem; flex-wrap: wrap; align-items: stretch; }
.notify-form input[type="email"] {
  flex: 1 1 12rem;
  min-height: 44px;
  font: inherit;
  font-size: 1rem;
  color: var(--ink);
  background: var(--surface-alt);
  border: 0;
  border-bottom: 1px solid var(--line);
  border-radius: 4px 4px 0 0;
  padding: 0.6rem 0.9rem;
  transition: border-color 0.18s var(--ease-micro), background 0.18s var(--ease-micro);
}
.notify-form input[type="email"]:hover { background: #dde3e5; }
.notify-form input[type="email"]:focus {
  outline: none;
  border-bottom: 2px solid var(--moss);
  background: #fff;
}
.notify-error { color: var(--warning-deep); font-size: 0.88rem; margin-top: 0.6rem; }
.notify-note { color: var(--muted); font-size: 0.82rem; margin-top: 0.7rem; }
.notify-done { font-size: 0.95rem; color: var(--moss-deep); }
.cta-band .notify {
  max-width: 30rem;
  margin-left: auto;
  margin-right: auto;
  border-top: 0;
  padding-top: 0;
  margin-top: 2rem;
}

/* ---------- Compact calculator header: tool above the fold ---------- */

.calc-head {
  display: flex;
  align-items: baseline;
  gap: 1.25rem;
  flex-wrap: wrap;
  margin-bottom: 1.9rem;
}
.calc-head .back-link { margin-bottom: 0; }
.calc-title {
  font-size: clamp(1.4rem, 2.6vw, 1.8rem);
  margin: 0;
  max-width: none;
}
.calc-sub { color: var(--muted); font-size: 0.92rem; margin: 0; flex-basis: 100%; }

/* ---------- Audit page ---------- */

.seg {
  position: relative;
  display: grid;
  grid-template-columns: 1fr 1fr;
  background: var(--surface-alt);
  border-radius: 999px;
  padding: 4px;
  isolation: isolate;
}
.seg-thumb {
  position: absolute;
  top: 4px; bottom: 4px; left: 4px;
  width: calc(50% - 4px);
  background: var(--surface);
  border-radius: 999px;
  box-shadow: 0 2px 8px rgba(33, 31, 28, 0.14);
  transition: transform 0.3s var(--ease);
  z-index: 0;
}
.seg.annual .seg-thumb { transform: translateX(100%); }
.seg button {
  appearance: none;
  border: 0;
  background: transparent;
  padding: 0.75rem 0;
  min-height: 44px;
  font: inherit;
  font-size: 0.95rem;
  font-weight: 500;
  color: var(--muted);
  cursor: pointer;
  border-radius: 999px;
  position: relative;
  z-index: 1;
  transition: color 0.2s var(--ease-micro), font-weight 0.2s;
}
.seg button[aria-pressed="true"] { color: var(--ink); font-weight: 700; }
.seg button:focus-visible { outline: 2px solid var(--moss); outline-offset: 2px; }
.btn[type="submit"] { cursor: pointer; width: 100%; }
.audit-cta {
  margin-top: 1.5rem;
  padding: 1.4rem 1.5rem;
  border-top: 2px solid var(--moss);
  background: var(--surface-alt);
  border-radius: 0 0 var(--radius) var(--radius);
}
.audit-cta p { margin: 0 0 0.5em; font-size: 0.95rem; }
.audit-cta p:last-child { margin-bottom: 0; }
.audit-cta a { color: var(--moss-deep); font-weight: 600; }
.conf-line { margin-top: 1.1rem; font-size: 0.87rem; color: var(--muted); }
.conf-line strong { color: var(--ink); }

/* ---------- Reveals ---------- */

.reveal {
  opacity: 0;
  transform: translateY(16px);
  transition: opacity 0.6s var(--ease), transform 0.6s var(--ease);
}
.reveal.in { opacity: 1; transform: none; }
.ledger .ledger-row.reveal { transition-delay: 0s; }
.ledger .ledger-row.reveal:nth-child(3) { transition-delay: 0.06s; }
.ledger .ledger-row.reveal:nth-child(4) { transition-delay: 0.12s; }
.ledger .ledger-row.reveal:nth-child(5) { transition-delay: 0.18s; }

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

@media (max-width: 900px) {
  .calc-grid { grid-template-columns: 1fr; }
  .grid-3 { grid-template-columns: 1fr; }
  .fn-grid { grid-template-columns: 1fr; }
  /* ledger rows become stat cards: figure on top, then label, then note */
  .ledger { border-top: 0; }
  .ledger-row {
    display: grid;
    grid-template-columns: 1fr;
    gap: 0.3rem;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 1.4rem 1.5rem;
    margin-bottom: 0.9rem;
  }
  .ledger-row .fig { order: -1; font-size: 2.4rem; margin-bottom: 0.15rem; }
  .ledger-row > span:first-child { font-weight: 600; color: var(--ink); }
  .ledger-row .note { grid-column: auto; }
  .ledger-head { display: none; }
  .hero-grid { grid-template-columns: 1fr; }
  .hero-visual { display: none; }
}
@media (max-width: 560px) {
  .nav-links .link { display: none; }
  .hero { padding: 3.5rem 1.25rem 3rem; }
  .section { padding: 3rem 1.25rem; }
  .card { padding: 1.6rem; }
  .calc-wrap { padding: 2rem 1.25rem 3rem; }
}

/* ---------- Reduced motion: everything collapses to instant ---------- */

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
  body { animation: none; }
  .reveal { opacity: 1; transform: none; }
  .wordmark-svg .strike-path { stroke-dashoffset: 0; }
  .tr-savings-figure.settled:not(.zero)::after { transform: scaleX(1); }
}

/* ---------- Dark theme: "Indigo Haze" ---------- */

html[data-theme="dark"] {
  --bg: #07070a;
  --surface: #0e0e13;
  --surface-alt: #15151c;
  --ink: #f0f0f4;
  --muted: #a6a6b3;
  --moss: #8fa695;
  --moss-deep: #4c6b57;
  --terra: #c9ab8c;
  --terra-deep: #a98763;
  --indigo: #7c8dc9;
  --line: #201f2a;
  --success: #8fa695;
  --warning: #c9ab8c;
  --warning-deep: #a98763;
}

html[data-theme="dark"] body {
  background-image:
    radial-gradient(55% 45% at 18% 8%, rgba(63, 78, 158, 0.16), rgba(63, 78, 158, 0) 70%),
    radial-gradient(50% 42% at 85% 78%, rgba(40, 44, 96, 0.10), rgba(40, 44, 96, 0) 70%),
    radial-gradient(75% 60% at 50% 115%, rgba(63, 78, 158, 0.07), rgba(63, 78, 158, 0) 70%);
}

html[data-theme="dark"] .site-header { background: rgba(7, 7, 10, 0.88); }

/* brand wordmark recolor for dark backgrounds */
html[data-theme="dark"] .wordmark-svg g[fill] { fill: var(--ink); }
html[data-theme="dark"] .wordmark-svg .strike-path { stroke: var(--terra); }

/* hardcoded light-mode spots, rescoped for dark */
html[data-theme="dark"] input[type="number"]:hover,
html[data-theme="dark"] input[type="text"]:hover { background: #15151c; }
html[data-theme="dark"] .warning { background: #0e0e13; }
html[data-theme="dark"] .notify-form input[type="email"]:hover { background: #15151c; }

/* ---------- Theme toggle ---------- */

.theme-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  border: 1px solid var(--line);
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  padding: 0;
  flex: none;
}
.theme-toggle:hover { color: var(--ink); border-color: var(--muted); }
.theme-toggle:focus-visible { outline: 2px solid var(--terra); outline-offset: 2px; }
.theme-toggle svg { width: 17px; height: 17px; display: block; }
.theme-toggle .icon-sun { display: none; }
html[data-theme="dark"] .theme-toggle .icon-sun { display: block; }
html[data-theme="dark"] .theme-toggle .icon-moon { display: none; }

/* gentle cross-fade on theme switch; reduced-motion collapses it to instant */
body, .site-header, .card, .hero-card, .warning {
  transition: background-color 0.35s ease, color 0.35s ease, border-color 0.35s ease;
}
