/* Colors and fonts come from config.json → injected as :root variables by scripts/build.mjs. */

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-padding-top: 16px; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font-sans), system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  font-size: 16px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; display: block; }
a { color: var(--blue); }
h1, h2, h3 { margin: 0; line-height: 1.15; letter-spacing: -0.02em; }
p { margin: 0; }
[hidden] { display: none !important; }
:focus-visible { outline: 3px solid var(--sky); outline-offset: 2px; border-radius: 6px; }

.wrap { max-width: 760px; margin: 0 auto; padding: 0 16px; }

/* ---------- header / hero ---------- */
.site-header { padding: 20px 0 0; }
.logo-link { display: inline-block; }
.logo-link img { height: 30px; width: auto; }

.hero { padding: 40px 0 32px; }
.eyebrow {
  font-family: var(--font-mono), ui-monospace, monospace;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--blue);
  margin-bottom: 14px;
}
.hero h1 { font-size: clamp(32px, 8.4vw, 54px); font-weight: 800; color: var(--navy); max-width: 16ch; }
.hl {
  background: linear-gradient(90deg, var(--blue) 0%, var(--sky) 55%, var(--teal) 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.lede { margin: 18px 0 28px; font-size: 18px; color: var(--slate); max-width: 34em; }

/* ---------- buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  min-height: 48px; padding: 12px 22px;
  border: 1.5px solid transparent; border-radius: 12px;
  font: inherit; font-weight: 600; font-size: 16px;
  text-decoration: none; cursor: pointer;
  transition: background-color .2s ease, border-color .2s ease, color .2s ease, transform .2s ease;
}
.btn:disabled { opacity: .6; cursor: progress; }
.btn-primary { background: var(--blue); color: var(--white); }
.btn-primary:hover { background: var(--navy); }
.btn-lg { min-height: 56px; padding: 14px 28px; font-size: 17px; }
.btn-ghost { background: transparent; color: var(--ink); border-color: var(--line); }
.btn-ghost:hover { border-color: var(--slate); }
.btn-mint { background: var(--mint); color: var(--navy); }
.btn-mint:hover { background: var(--white); }
.btn-block { width: 100%; }

/* ---------- calculator card ---------- */
.calc-section { padding: 0 0 48px; }
.card {
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: 20px;
  box-shadow: 0 1px 2px color-mix(in srgb, var(--navy) 6%, transparent),
              0 12px 40px color-mix(in srgb, var(--navy) 8%, transparent);
}
.calc-card { padding: 20px 16px 24px; scroll-margin-top: 16px; }

.progress {
  list-style: none; margin: 0 0 24px; padding: 0;
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px;
}
.progress li { display: flex; flex-direction: column; gap: 8px; font-size: 13px; color: var(--slate); }
.progress li::before {
  content: ''; display: block; height: 4px; border-radius: 4px; background: var(--line);
  transition: background-color .4s ease;
}
.progress li.is-current::before, .progress li.is-done::before { background: var(--blue); }
.progress-btn {
  all: unset; box-sizing: border-box; font-size: 13px; color: inherit; min-height: 24px; text-align: left;
}
.progress-btn:not(:disabled) { cursor: pointer; text-decoration: underline; text-underline-offset: 3px; text-decoration-color: var(--line); }
.progress-btn:not(:disabled):hover { color: var(--blue); }
.progress-btn:focus-visible { outline: 3px solid var(--sky); outline-offset: 2px; border-radius: 4px; }
.progress li.is-current { color: var(--navy); font-weight: 600; }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

.step { border: 0; margin: 0; padding: 0; min-width: 0; animation: fade-in .35s ease both; }
.step-title { font-size: 24px; font-weight: 700; color: var(--navy); padding: 0; margin-bottom: 6px; }
.step-title:focus { outline: none; }
.step-note { color: var(--slate); font-size: 14px; margin-bottom: 20px; }
@keyframes fade-in { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

.fields { display: grid; gap: 22px; }
.field-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin-bottom: 4px; }
.field-label { font-weight: 600; font-size: 16px; color: var(--ink); }
.field-help { font-size: 14px; color: var(--slate); margin-bottom: 8px; }
.tag {
  flex: none;
  font-family: var(--font-mono), ui-monospace, monospace;
  font-size: 10.5px; letter-spacing: 0.08em; text-transform: uppercase;
  color: var(--slate); background: var(--paper); border-radius: 999px; padding: 3px 9px;
  white-space: nowrap;
}
.tag.is-yours { color: var(--blue); background: color-mix(in srgb, var(--blue) 8%, transparent); }

.field-controls { display: flex; align-items: center; gap: 14px; margin-top: 6px; }
.field-controls .range { flex: 1; min-width: 0; }
.num-box {
  flex: none; display: flex; align-items: center; width: 132px; height: 48px;
  border: 1.5px solid var(--line); border-radius: 12px; padding: 0 12px; background: var(--white);
  transition: border-color .2s ease;
}
.num-box:focus-within { border-color: var(--blue); }
.num {
  width: 100%; min-width: 0; border: 0; outline: none; background: transparent;
  font: inherit; font-size: 17px; font-weight: 600; color: var(--ink);
  font-variant-numeric: tabular-nums; -moz-appearance: textfield;
}
.num::-webkit-inner-spin-button, .num::-webkit-outer-spin-button { -webkit-appearance: none; margin: 0; }
.affix { color: var(--slate); font-size: 14px; }
.affix-pre { margin-right: 2px; font-size: 17px; font-weight: 600; color: var(--ink); }
.affix-post { margin-left: 6px; }

/* range slider */
.range {
  --fill: 0%;
  -webkit-appearance: none; appearance: none;
  height: 28px; background: transparent; cursor: pointer; margin: 0;
}
.range::-webkit-slider-runnable-track {
  height: 6px; border-radius: 6px;
  background: linear-gradient(90deg, var(--blue) var(--fill), var(--line) var(--fill));
}
.range::-moz-range-track { height: 6px; border-radius: 6px; background: var(--line); }
.range::-moz-range-progress { height: 6px; border-radius: 6px; background: var(--blue); }
.range::-webkit-slider-thumb {
  -webkit-appearance: none; width: 24px; height: 24px; margin-top: -9px; border-radius: 50%;
  background: var(--white); border: 2px solid var(--blue);
  box-shadow: 0 2px 6px color-mix(in srgb, var(--navy) 18%, transparent);
}
.range::-moz-range-thumb {
  width: 22px; height: 22px; border-radius: 50%; background: var(--white); border: 2px solid var(--blue);
}

.advanced { margin-top: 22px; border-top: 1px solid var(--line); padding-top: 14px; }
.advanced summary, .math summary {
  cursor: pointer; font-weight: 600; color: var(--blue); min-height: 32px; display: flex; align-items: center;
}
.advanced[open] summary { margin-bottom: 14px; }

.step-actions { display: flex; justify-content: space-between; gap: 12px; margin-top: 28px; }
.step-actions .btn-primary { flex: 1; max-width: 240px; margin-left: auto; }

/* ---------- results ---------- */
.big-number {
  margin: 16px 0 20px; padding: 24px 20px; border-radius: 16px;
  background: var(--navy); color: var(--white);
}
.big-label { font-size: 15px; color: color-mix(in srgb, var(--white) 72%, transparent); }
.big-value {
  font-size: clamp(44px, 13vw, 68px); font-weight: 800; letter-spacing: -0.03em; line-height: 1.05;
  margin: 6px 0 10px; font-variant-numeric: tabular-nums;
}
.per { font-size: .42em; font-weight: 600; letter-spacing: 0; margin-left: 4px; color: color-mix(in srgb, var(--white) 72%, transparent); }
.big-sub { font-size: 16px; color: color-mix(in srgb, var(--white) 80%, transparent); }
.big-sub strong { color: var(--mint); }

.breakdown { margin-bottom: 28px; }
.bar { display: flex; height: 14px; border-radius: 8px; overflow: hidden; background: var(--line); }
.seg { display: block; height: 100%; width: 0; transition: width .6s cubic-bezier(.16, 1, .3, 1); }
.seg-time { background: var(--blue); }
.seg-redo { background: var(--teal); }
.legend { list-style: none; margin: 12px 0 0; padding: 0; display: grid; gap: 6px; font-size: 15px; }
.legend li { display: flex; align-items: center; gap: 8px; }
.legend strong { margin-left: auto; font-variant-numeric: tabular-nums; }
.dot { width: 10px; height: 10px; border-radius: 3px; flex: none; }
.dot-time { background: var(--blue); }
.dot-redo { background: var(--teal); }

.recovery { border-top: 1px solid var(--line); padding-top: 22px; }
.recovery-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }
.recovery-head label { font-weight: 600; }
.recovery .range { width: 100%; margin-top: 10px; }
.recovery-hint { font-size: 14px; color: var(--slate); margin-top: 4px; }

.compare { display: grid; gap: 12px; margin-top: 20px; }
.compare-item { border: 1px solid var(--line); border-radius: 14px; padding: 16px; }
.compare-label { font-size: 14px; color: var(--slate); }
.compare-value { font-size: 30px; font-weight: 700; color: var(--navy); font-variant-numeric: tabular-nums; margin-top: 2px; }
.compare-value .per { color: var(--slate); }
.compare-note { font-size: 13px; color: var(--slate); margin-top: 4px; }
.payback, .payback-none { margin-top: 16px; font-size: 16px; }
.payback strong { color: var(--blue); }
.payback-none { color: var(--slate); }

.math { margin-top: 24px; border-top: 1px solid var(--line); padding-top: 14px; }
.math-list { margin: 14px 0 0; display: grid; gap: 4px; font-size: 15px; }
.math-list dt { font-weight: 600; margin-top: 10px; }
.math-list dd { margin: 0; color: var(--slate); font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.math-list dd strong { color: var(--ink); }
.math-note { font-size: 13px; color: var(--slate); margin-top: 16px; }

.btn-edit { margin-top: 20px; }

/* ---------- CTA ---------- */
.cta {
  margin: 28px -16px -24px; padding: 28px 16px; border-radius: 0 0 20px 20px;
  background: var(--navy); color: var(--white);
}
.eyebrow-light { color: var(--mint); }
.cta h2 { font-size: 28px; font-weight: 700; }
.cta-sub { margin-top: 8px; color: color-mix(in srgb, var(--white) 80%, transparent); }
.lead-form { display: grid; gap: 14px; margin-top: 22px; }
.lf-row { display: grid; gap: 6px; }
.lf-row label { font-size: 14px; font-weight: 600; }
.opt { font-weight: 400; color: color-mix(in srgb, var(--white) 65%, transparent); }
.lead-form input {
  height: 50px; border-radius: 12px; border: 1.5px solid transparent; padding: 0 14px;
  font: inherit; font-size: 16px; color: var(--ink); background: var(--white);
}
.lead-form input:focus { outline: none; border-color: var(--mint); box-shadow: 0 0 0 3px color-mix(in srgb, var(--mint) 40%, transparent); }
.hp { position: absolute; left: -10000px; width: 1px; height: 1px; overflow: hidden; }
.lf-error { color: var(--navy); background: var(--mint); border-radius: 10px; padding: 10px 12px; font-size: 14px; font-weight: 600; }
.consent { font-size: 13px; color: color-mix(in srgb, var(--white) 70%, transparent); }
.consent a, .book-call { color: var(--mint); }
.lf-done { margin-top: 22px; display: grid; gap: 10px; justify-items: start; animation: fade-in .35s ease both; }
.lf-done:focus { outline: none; }
.lf-done-title { font-size: 22px; }
.lf-done-body { color: color-mix(in srgb, var(--white) 85%, transparent); }
.book-call { display: inline-block; margin-top: 18px; font-weight: 600; min-height: 32px; }

/* ---------- footer ---------- */
.site-footer { padding: 8px 0 40px; font-size: 13px; color: var(--slate); }
.site-footer a { color: var(--slate); }

/* ---------- embed mode (?embed=1) ---------- */
.embedded .site-header, .embedded .site-footer { display: none; }
.embedded body { background: transparent; }

/* ---------- larger screens ---------- */
@media (min-width: 640px) {
  .wrap { padding: 0 24px; }
  .hero { padding: 64px 0 44px; }
  .calc-card { padding: 32px 36px 36px; }
  .compare { grid-template-columns: 1fr 1fr; }
  .cta { margin: 32px -36px -36px; padding: 36px; }
  .lead-form { grid-template-columns: 1fr 1fr; }
  .lead-form .lf-error, .lead-form .btn, .lead-form .consent { grid-column: 1 / -1; }
  .num-box { width: 150px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
}
