/* ═══════════════════════════════════════════════════════════════════════
   JOSE CASTILLO LOANS — calculator edition
   Tokens mirror josecastilloloans/assets/brand.css (v1.0). Rules from the
   guideline sheet, not negotiable:
     · Square corners. No radius anywhere.
     · Signal Red is the mark and the primary action. Never body copy.
     · Section dividers 2px ink; row dividers 1px rule grey.
     · Archivo only.
   Signature: the brand mark (red roof over an ink bar) drawn as a house,
   with the floors in between built from the visitor's payment.
   ═══════════════════════════════════════════════════════════════════════ */

:root {
  --red:       #EC3013;   /* the mark: roof, tiles, accents — exact brand value */
  /* Buttons carry white text, and #EC3013 is 4.20:1 against white — under
     WCAG AA 4.5:1. The action red is one step deeper (5.00:1). */
  --red-btn:   #D62A10;
  --red-hover: #B8230E;
  --ink:       #201E1D;
  --graphite:  #444141;
  --rule-grey: #D7D3D3;
  --ground:    #F3F2F2;

  --bg:        var(--ground);
  --surface:   #FFFFFF;
  --sunk:      #F3F2F2;
  --fg:        var(--ink);
  --fg-2:      var(--graphite);
  --fg-3:      #6F6A69;
  --rule:      var(--rule-grey);
  --rule-2:    #B9B4B3;
  --divider:   var(--ink);
  --band:      #201E1D;
  --band-fg:   #F3F2F2;
  --band-fg-2: #A9A4A2;
  --band-rule: #3D3A39;
  --bar:       var(--ink);      /* the logo's bar — reverses in dark */
  --select-bg: var(--ink);
  --select-fg: #FFFFFF;

  /* house floors — an ink ramp, not a rainbow. Identity is carried by the
     direct labels; value steps and 3px gaps separate neighbours. MI is the
     one hatched floor: it is the part of the payment that can go away. */
  --f-pi:   #201E1D;
  --f-tax:  #5B5756;
  --f-ins:  #9A9594;
  --f-hoa:  #C9C4C3;
  --f-mi-a: #201E1D;
  --f-mi-b: #D7D3D3;

  /* status — reserved for the affordability check, always with a glyph + words */
  --good: #1F6B45; --good-bg: #E3F0E8;
  --warn: #8F540B; --warn-bg: #F8EBD9;
  --crit: #8E1B1B; --crit-bg: #F5E1DF;

  /* "fill this in" highlighter for the empty rate field. Yellow means "your
     turn", not "error" — red stays for the brand and the primary action.
     Border #A8700A is 3.6:1 on white (WCAG 1.4.11 needs 3:1). */
  --need: #FFC928; --need-ink: #201E1D; --need-line: #A8700A; --need-bg: #FFF7D6; --need-ph: #6E4A00;

  --font: "Archivo", "Archivo Fallback", "Helvetica Neue", Helvetica, Arial, sans-serif;
  --track-display: -.042em;
  --track-wide: .32em;

  --gut:  clamp(16px, 4.5vw, 40px);
  --wrap: 1200px;
  --head-h: 68px;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #1A1918; --surface: #232120; --sunk: #1A1918;
    --fg: #F3F2F2; --fg-2: #C4BFBD; --fg-3: #938E8C;
    --rule: #3F3B3A; --rule-2: #5A5554; --divider: #F3F2F2;
    --band: #0F0E0E; --band-rule: #2E2B2A;
    --bar: #F3F2F2; --select-bg: #F3F2F2; --select-fg: #201E1D;
    --f-pi: #F3F2F2; --f-tax: #B4AFAD; --f-ins: #7A7473; --f-hoa: #524D4C;
    --f-mi-a: #F3F2F2; --f-mi-b: #3F3B3A;
    --good: #5FBF8C; --good-bg: #16261D; --warn: #D9A04A; --warn-bg: #2A2114; --crit: #E9837B; --crit-bg: #2C1816;
    --need-line: #FFC928; --need-bg: #2E2710; --need-ph: #FFD65C;
  }
}
:root[data-theme="dark"] {
  --bg: #1A1918; --surface: #232120; --sunk: #1A1918;
  --fg: #F3F2F2; --fg-2: #C4BFBD; --fg-3: #938E8C;
  --rule: #3F3B3A; --rule-2: #5A5554; --divider: #F3F2F2;
  --band: #0F0E0E; --band-rule: #2E2B2A;
  --bar: #F3F2F2; --select-bg: #F3F2F2; --select-fg: #201E1D;
  --f-pi: #F3F2F2; --f-tax: #B4AFAD; --f-ins: #7A7473; --f-hoa: #524D4C;
  --f-mi-a: #F3F2F2; --f-mi-b: #3F3B3A;
  --good: #5FBF8C; --good-bg: #16261D; --warn: #D9A04A; --warn-bg: #2A2114; --crit: #E9837B; --crit-bg: #2C1816;
  --need-line: #FFC928; --need-bg: #2E2710; --need-ph: #FFD65C;
}

@font-face {
  font-family: "Archivo Fallback";
  src: local("Arial"), local("Helvetica Neue"), local("Liberation Sans");
  size-adjust: 101%; ascent-override: 92%; descent-override: 24%; line-gap-override: 0%;
}

/* ── base ─────────────────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; border-radius: 0; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; scroll-padding-top: calc(var(--head-h) + 12px); }
body {
  margin: 0; background: var(--bg); color: var(--fg);
  font-family: var(--font); font-size: 16px; line-height: 1.6;
  font-variant-numeric: tabular-nums; overflow-x: hidden;
}
h1, h2, h3, p { margin: 0; }
h1, h2 { font-weight: 800; font-stretch: 112%; letter-spacing: var(--track-display); text-wrap: balance; }
h3 { font-weight: 700; font-size: 1.05rem; letter-spacing: -.01em; }
a { color: inherit; text-decoration-thickness: 1px; text-underline-offset: 3px; }
button, input, select, textarea { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--fg); outline-offset: 3px; }
.wrap { max-width: var(--wrap); margin: 0 auto; padding: 0 var(--gut); }
.eyebrow {
  font-size: .72rem; font-weight: 600; letter-spacing: var(--track-wide); text-transform: uppercase;
  color: var(--fg-3);
}
.sr { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip { position: absolute; left: -9999px; top: 8px; z-index: 200; background: var(--fg); color: var(--bg); padding: 10px 16px; font-weight: 600; }
.skip:focus { left: 8px; }

/* ── buttons ──────────────────────────────────────────────────────────── */
.btn {
  display: inline-flex; align-items: center; justify-content: space-between; gap: 18px;
  padding: 14px 18px; border: 2px solid var(--fg); background: transparent; color: var(--fg);
  font-size: .8rem; font-weight: 700; letter-spacing: .16em; text-transform: uppercase;
  text-decoration: none; cursor: pointer; transition: background-color .15s, color .15s, border-color .15s;
}
.btn:hover { background: var(--fg); color: var(--bg); }
.btn-red { background: var(--red-btn); border-color: var(--red-btn); color: #fff; }
.btn-red:hover { background: var(--red-hover); border-color: var(--red-hover); color: #fff; }
.btn-wide { width: 100%; }
.btn svg { flex: none; transition: transform .15s; }
.btn:hover svg { transform: translateX(3px); }
.btn-sm { padding: 9px 14px; font-size: .72rem; }
/* "Get your numbers": icon tile on the left, arrow pushed to the right */
.cta-ico { display: grid; place-items: center; width: 30px; height: 30px; margin: -6px 0 -6px -6px; background: rgba(0,0,0,.2); flex: none; }
.cta-ico svg { width: 18px; height: 18px; }
.btn-wide[data-open-lead] { justify-content: flex-start; gap: 14px; }
.btn-wide[data-open-lead] > svg { margin-left: auto; }
.btn-sm .cta-ico { width: 22px; height: 22px; margin: -4px 0 -4px -6px; }
.btn-sm .cta-ico svg { width: 14px; height: 14px; }
.btn-sm[data-open-lead] { gap: 9px; }
.btn:hover .cta-ico svg { transform: none; }
.btn-red:hover .cta-ico svg { animation: icoPop .35s cubic-bezier(.2,.8,.2,1.4); }
@keyframes icoPop { 50% { transform: scale(1.18) rotate(-6deg); } }
.link-btn {
  background: none; border: 0; padding: 0; cursor: pointer; color: var(--fg-2);
  font-size: .85rem; font-weight: 600; text-decoration: underline; text-underline-offset: 3px; text-decoration-color: var(--rule-2);
}
.link-btn:hover { color: var(--fg); text-decoration-color: var(--fg); }

/* ── header ───────────────────────────────────────────────────────────── */
.top { position: sticky; top: 0; z-index: 50; background: var(--surface); border-bottom: 2px solid var(--divider); }
.top-in { height: var(--head-h); display: flex; align-items: center; justify-content: space-between; gap: 20px; }
.lockup { display: flex; align-items: center; gap: 12px; text-decoration: none; color: var(--fg); flex: none; }
.lockup svg { flex: none; }
/* MyMortgage Calculator is the name; Jose Castillo is the small signature under it */
.lockup-name { display: block; font-weight: 800; font-size: 1.14rem; letter-spacing: -.03em; line-height: 1; }
.lockup-name span { font-weight: 500; color: var(--fg-2); }
.lockup-sub { display: block; font-size: .7rem; font-weight: 500; color: var(--fg-3); margin-top: 5px; line-height: 1; }
.nav { display: flex; gap: 26px; font-size: .86rem; font-weight: 600; }
.nav a { text-decoration: none; color: var(--fg-2); padding: 6px 0; border-bottom: 2px solid transparent; }
.nav a:hover { color: var(--fg); border-bottom-color: var(--fg); }
.top-actions { display: flex; align-items: center; gap: 8px; }
.icon-btn {
  display: inline-flex; align-items: center; justify-content: center; width: 40px; height: 40px;
  border: 1px solid var(--rule); background: none; cursor: pointer; color: var(--fg); text-decoration: none;
  font-size: .78rem; font-weight: 700; letter-spacing: .06em;
}
.icon-btn:hover { border-color: var(--fg); }
/* EN | ES — two links styled as a segmented control. Each carries the
   current scenario in its query string (app.js → updateLangLinks). */
.langs { display: flex; border: 1px solid var(--rule-2); }
.lang-opt {
  display: inline-flex; align-items: center; justify-content: center; height: 38px; min-width: 40px; padding: 0 10px;
  font-size: .74rem; font-weight: 700; letter-spacing: .1em; text-decoration: none; color: var(--fg-2);
  transition: background-color .12s, color .12s;
}
.lang-opt + .lang-opt { border-left: 1px solid var(--rule-2); }
.lang-opt:hover { color: var(--fg); background: var(--sunk); }
.lang-opt[aria-current="page"] { background: var(--select-bg); color: var(--select-fg); }

/* ── hero ─────────────────────────────────────────────────────────────── */
.hero { padding: clamp(28px, 4vw, 48px) 0 clamp(22px, 3vw, 32px); }
.hero h1 {
  font-size: clamp(1.95rem, 4.2vw, 3.4rem); line-height: 1; letter-spacing: -.045em; max-width: 17em;
}
.hero-grid { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 14px clamp(24px, 4vw, 64px); align-items: end; margin-top: clamp(14px, 2vw, 20px); }
.hero h1 .quiet { color: var(--fg-3); }

/* three hooks stacked in one grid cell: the tallest sets the height, so a
   change of headline never moves the calculator below it */
.hook.hook-ready { display: grid; }
.hook-ready .hook-line { grid-area: 1 / 1; visibility: hidden; }
.hook-ready .hook-line.is-on, .hook-ready .hook-line.is-out { visibility: visible; }
.hook-ready .w { display: inline-block; vertical-align: top; overflow: hidden; padding: .08em 0 .14em; margin: -.08em 0 -.14em; }
.hook-ready .w > span { display: inline-block; transform: translateY(118%); }
.hook-ready .is-on .w > span { transform: none; transition: transform .75s cubic-bezier(.2,.8,.2,1) calc(140ms + var(--i) * 55ms); }
.hook-ready .is-out .w > span { transform: translateY(-118%); transition: transform .42s cubic-bezier(.6,0,.8,.3) calc(var(--i) * 22ms); }
.k { position: relative; }
.k::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: .01em; height: .075em;
  background: var(--red); transform: scaleX(0); transform-origin: left;
}
.is-on .k::after { transform: scaleX(1); transition: transform .55s cubic-bezier(.6,0,.2,1) calc(560ms + var(--i) * 55ms); }

.hook-ctl { display: flex; align-items: center; gap: 12px; margin-top: 16px; transition: opacity .5s, visibility .5s; }
.hook-ctl.settled { opacity: 0; visibility: hidden; }
.hook-pause {
  width: 26px; height: 26px; display: grid; place-items: center; padding: 0; cursor: pointer;
  background: none; border: 1.5px solid var(--rule-2); color: var(--fg-2);
}
.hook-pause:hover { border-color: var(--fg); color: var(--fg); }
.hook-pause .i-play, .hook-pause[aria-pressed="true"] .i-pause { display: none; }
.hook-pause[aria-pressed="true"] .i-play { display: block; }
.hook-segs { display: flex; gap: 6px; }
.hook-segs i { display: block; width: 40px; height: 3px; background: var(--rule); position: relative; overflow: hidden; }
.hook-segs i::after { content: ""; position: absolute; inset: 0; background: var(--red); transform: scaleX(0); transform-origin: left; }
.hook-segs i.done::after { transform: none; }
.hook-segs i.run::after { animation: seg 4.6s linear forwards; }
.hook-ctl.paused i.run::after, .hook-ctl.hover i.run::after { animation-play-state: paused; }
@keyframes seg { to { transform: none; } }

/* ── motion: page load ────────────────────────────────────────────────── */
@keyframes rise { from { opacity: 0; transform: translateY(14px); } }
@keyframes draw { from { stroke-dashoffset: 1; } }
@keyframes bar  { from { transform: scaleX(0); } }
.hero-grid > * { animation: rise .8s cubic-bezier(.2,.7,.2,1) both; }
.hero-grid > .lede  { animation-delay: .5s; }
.hero-grid > .proof { animation-delay: .62s; }
.calc-grid > * { animation: rise .9s cubic-bezier(.2,.7,.2,1) .7s both; }
.calc-grid > :nth-child(2) { animation-delay: .82s; }
/* the logo builds itself: bar, then roof */
.lockup rect { transform-box: fill-box; transform-origin: left; animation: bar .45s cubic-bezier(.6,0,.2,1) .1s both; }
.lockup polyline { stroke-dasharray: 1; animation: draw .7s cubic-bezier(.6,0,.2,1) .4s both; }
/* the result card's roof goes on last, from the ridge out */
@keyframes roofIn { from { clip-path: inset(0 50% 0 50%); } to { clip-path: inset(-60% -10%); } }
.roof { animation: roofIn .8s cubic-bezier(.2,.7,.2,1) 1.35s both; }

/* ── motion: on scroll (JS adds .motion only when it's allowed) ───────── */
.motion .rv { opacity: 0; transform: translateY(22px); transition: opacity .8s cubic-bezier(.2,.7,.2,1), transform .8s cubic-bezier(.2,.7,.2,1); transition-delay: calc(var(--d, 0) * 80ms); }
.motion .rv.in { opacity: 1; transform: none; }
.mark-lg polyline, .mark-band polyline { stroke-dasharray: 1; }
.motion .rv .mark-lg polyline, .motion .rv .mark-band polyline { stroke-dashoffset: 1; transition: stroke-dashoffset .9s cubic-bezier(.6,0,.2,1) .35s; }
.motion .rv.in .mark-lg polyline, .motion .rv.in .mark-band polyline { stroke-dashoffset: 0; }

/* ── motion: the CTA catches the eye once, when the first payment appears */
.btn-red { position: relative; overflow: hidden; }
.btn-red.nudge::after {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background: linear-gradient(105deg, transparent 30%, rgba(255,255,255,.38) 50%, transparent 70%);
  transform: translateX(-110%); animation: shine 1.2s ease-in-out .9s 2;
}
@keyframes shine { to { transform: translateX(110%); } }
.btn:active { transform: translateY(1px); }

/* FAQ + DTI open smoothly where the browser can animate to height:auto */
@supports selector(::details-content) {
  :root { interpolate-size: allow-keywords; }
  .faq details::details-content, .afford::details-content {
    height: 0; overflow: clip; transition: height .35s cubic-bezier(.2,.7,.2,1), content-visibility .35s allow-discrete;
  }
  .faq details[open]::details-content, .afford[open]::details-content { height: auto; }
}
.lede { font-size: 1.04rem; color: var(--fg-2); max-width: 52ch; }
.proof { display: flex; flex-wrap: wrap; gap: 8px 24px; font-size: .82rem; color: var(--fg-2); font-weight: 500; padding-bottom: 4px; }
.proof span { display: inline-flex; align-items: center; gap: 7px; }
.proof svg { color: var(--fg); }

/* ── calculator layout ────────────────────────────────────────────────── */
.calc { border-top: 2px solid var(--divider); padding: 0 0 clamp(48px, 7vw, 88px); }
.calc-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 470px); gap: clamp(24px, 4vw, 56px); align-items: start; }
.rail { position: sticky; top: calc(var(--head-h) + 20px); margin-top: 28px; }

.group { padding: 26px 0; border-bottom: 1px solid var(--rule); }
.group:last-child { border-bottom: 0; }
.group-head { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; margin-bottom: 16px; }
.fields { display: grid; gap: 20px; }
.fields.two { grid-template-columns: 1fr 1fr; }
.fields.three { grid-template-columns: 1fr 1fr 1fr; }
.field { display: grid; gap: 8px; min-width: 0; align-content: start; }
.field > label, .field > .flabel { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; font-size: .84rem; font-weight: 600; color: var(--fg); }
.field-aside { font-size: .8rem; font-weight: 500; color: var(--fg-3); }
.box {
  display: flex; align-items: stretch; background: var(--surface); border: 1px solid var(--rule-2);
  transition: border-color .12s, box-shadow .12s;
}
/* min-width: 0 lets a box shrink inside a grid column; without it the
   input's built-in ~20-character width forced three-up rows to overflow */
.box { min-width: 0; }
.box:hover { border-color: var(--fg-3); }
.box:focus-within { border-color: var(--fg); box-shadow: inset 0 0 0 1px var(--fg); }
.affix { display: flex; align-items: center; padding: 0 12px; color: var(--fg-3); font-size: .95rem; font-weight: 500; }
.affix + input { padding-left: 0; }
.box input {
  flex: 1; min-width: 0; width: 100%; border: 0; background: none; padding: 13px 12px;
  font-size: 1.12rem; font-weight: 600; letter-spacing: -.01em; font-variant-numeric: tabular-nums;
}
.box input:focus { outline: none; }

/* the rate field while it's empty: the one input the payment can't do without */
.field.needs .box { border: 2px solid var(--need-line); background: var(--need-bg); }
.field.needs .box:focus-within { box-shadow: inset 0 0 0 1px var(--need-line); }
.field.needs .box input::placeholder { color: var(--need-ph); opacity: 1; font-weight: 600; }
.field.needs > label::after {
  content: attr(data-need); padding: 3px 7px; background: var(--need); color: var(--need-ink);
  font-size: .64rem; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; line-height: 1.3;
}
.field.needs.pulse .box { animation: needRing 1.5s ease-out 3; }
@keyframes needRing {
  0%   { box-shadow: 0 0 0 0 color-mix(in srgb, var(--need) 60%, transparent); }
  100% { box-shadow: 0 0 0 12px color-mix(in srgb, var(--need) 0%, transparent); }
}
.hint { font-size: .8rem; color: var(--fg-3); line-height: 1.5; }
.hint b { color: var(--fg-2); font-weight: 600; }

/* today's averages: MND's widget (fixed 250px, their code) + the broker note */
.rates-today {
  display: grid; grid-template-columns: 250px minmax(0, 1fr); gap: 20px 28px; align-items: start;
  margin-top: 22px; padding: 20px; background: var(--surface); border: 1px solid var(--rule);
}
.rates-widget { width: 250px; min-height: 205px; background: #fff; }
.rates-copy { display: grid; gap: 14px; justify-items: start; }
.broker-note { margin: 0; padding-left: 16px; border-left: 3px solid var(--red); }
.broker-note p { font-size: 1.22rem; font-weight: 800; letter-spacing: -.02em; line-height: 1.2; color: var(--fg); font-stretch: 108%; }
.broker-note footer { margin-top: 6px; font-size: .78rem; font-weight: 600; color: var(--fg-3); }
.broker-note footer span { white-space: nowrap; }
/* the reasons to pick Jose: why a broker, who you deal with, what it costs */
.why { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.why li { display: grid; grid-template-columns: 22px minmax(0, 1fr); gap: 8px; font-size: .92rem; font-weight: 600; line-height: 1.4; color: var(--fg); }
.why li svg { margin-top: 2px; width: 22px; height: 18px; color: var(--fg); }
.rates-today > .btn-wide, .rates-fine { grid-column: 1 / -1; }
.rates-fine { font-size: .72rem; margin-top: -8px; }

/* slider — square thumb, ink track fill */
input[type="range"] { -webkit-appearance: none; appearance: none; width: 100%; height: 22px; background: none; cursor: pointer; margin: 0; }
input[type="range"]::-webkit-slider-runnable-track { height: 3px; background: var(--track, var(--rule)); }
input[type="range"]::-webkit-slider-thumb { -webkit-appearance: none; appearance: none; width: 16px; height: 16px; margin-top: -6.5px; background: var(--fg); border: 3px solid var(--surface); outline: 1px solid var(--fg); }
input[type="range"]::-moz-range-track { height: 3px; background: var(--rule); }
input[type="range"]::-moz-range-progress { height: 3px; background: var(--fg); }
input[type="range"]::-moz-range-thumb { width: 12px; height: 12px; border-radius: 0; background: var(--fg); border: 3px solid var(--surface); outline: 1px solid var(--fg); }

/* program tiles */
.programs { display: grid; grid-template-columns: repeat(4, 1fr); border: 1px solid var(--rule-2); }
.prog {
  display: grid; gap: 2px; text-align: left; padding: 14px 14px 13px; cursor: pointer;
  background: var(--surface); border: 0; border-right: 1px solid var(--rule-2);
  transition: background-color .15s, color .15s;
}
.prog:last-child { border-right: 0; }
.prog:hover { background: var(--sunk); }
.prog strong { font-size: 1rem; font-weight: 700; letter-spacing: -.01em; }
.prog span { font-size: .76rem; color: var(--fg-3); }
.prog[aria-pressed="true"] { background: var(--select-bg); color: var(--select-fg); }
.prog[aria-pressed="true"] span { color: inherit; opacity: .72; }

/* segmented */
.seg { display: flex; border: 1px solid var(--rule-2); background: var(--surface); }
.seg button {
  flex: 1 1 0; min-width: 0; padding: 12px 8px; border: 0; border-right: 1px solid var(--rule-2);
  background: none; cursor: pointer; font-size: .92rem; font-weight: 600; white-space: nowrap;
}
.seg button:last-child { border-right: 0; }
.seg button:hover { background: var(--sunk); }
.seg button[aria-pressed="true"] { background: var(--select-bg); color: var(--select-fg); }

/* notes */
.note { display: flex; gap: 10px; padding: 11px 13px; font-size: .84rem; line-height: 1.5; color: var(--fg-2); background: var(--surface); border: 1px solid var(--rule); border-left: 3px solid var(--fg-3); }
.note b { color: var(--fg); font-weight: 600; }
.note .mk { flex: none; font-weight: 800; width: 1ch; text-align: center; color: var(--fg); }
.note[data-tone="good"] { border-left-color: var(--good); background: var(--good-bg); }
.note[data-tone="good"] .mk { color: var(--good); }
.note[data-tone="warn"] { border-left-color: var(--warn); background: var(--warn-bg); }
.note[data-tone="warn"] .mk { color: var(--warn); }
.note[data-tone="crit"] { border-left-color: var(--crit); background: var(--crit-bg); }
.note[data-tone="crit"] .mk { color: var(--crit); }
.note[hidden] { display: none; }

/* affordability — a <details>, closed by default */
/* A bordered card with its own call to action, so it reads as a tool to
   use, not one more folded row. Ink border: red stays for the primary CTA. */
.afford { margin: 28px 0 8px; border: 2px solid var(--fg); background: var(--surface); }
.afford-sum {
  list-style: none; cursor: pointer; display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 4px 14px;
  align-items: center; padding: 18px 20px; transition: background-color .12s;
}
.afford-sum::-webkit-details-marker { display: none; }
.afford-sum:hover { background: var(--sunk); }
.afford-ico { width: 44px; height: 44px; display: grid; place-items: center; background: var(--fg); color: var(--bg); }
.afford-title { display: grid; gap: 2px; min-width: 0; }
.afford-q { font-size: 1.12rem; font-weight: 800; letter-spacing: -.02em; color: var(--fg); line-height: 1.2; }
.afford-opt { font-size: .84rem; color: var(--fg-2); }
.afford-go {
  display: inline-flex; align-items: center; gap: 6px; padding: 9px 12px; border: 2px solid var(--fg);
  font-size: .72rem; font-weight: 700; letter-spacing: .14em; text-transform: uppercase; color: var(--fg);
}
.afford-sum:hover .afford-go { background: var(--fg); color: var(--bg); }
.afford-go svg { transition: transform .2s; }
.afford[open] .afford-go svg { transform: rotate(90deg); }
.afford[open] .afford-go-txt { display: none; }
.afford[open] .afford-go { border-color: transparent; padding: 9px 4px; }
.afford .status { grid-column: 2 / 3; justify-self: start; }
.afford:not([open]) .status { display: none; }
.afford[open] .afford-sum { border-bottom: 1px solid var(--rule); }
.afford-body { padding: 20px; }
.dti-link { font-weight: 700; color: var(--fg); }
.meter { position: relative; height: 10px; background: var(--rule); margin-top: 4px; }
.meter-fill { position: absolute; inset: 0 auto 0 0; background: var(--fg); transition: width .25s ease; }
.meter-fill[data-state="good"] { background: var(--good); }
.meter-fill[data-state="warn"] { background: var(--warn); }
.meter-fill[data-state="crit"] { background: var(--crit); }
.ticks { position: relative; height: 24px; }
.tick { position: absolute; top: 6px; transform: translateX(-50%); font-size: .7rem; font-weight: 600; color: var(--fg-3); white-space: nowrap; }
.tick::before { content: ""; position: absolute; left: 50%; top: -10px; width: 1px; height: 10px; background: var(--fg-3); }
.tick:first-child { transform: none; }
.tick:first-child::before { left: 0; }
.status { display: inline-flex; align-items: center; gap: 7px; padding: 4px 10px; font-size: .78rem; font-weight: 700; border: 1px solid; }
.status[data-state="good"] { color: var(--good); background: var(--good-bg); }
.status[data-state="warn"] { color: var(--warn); background: var(--warn-bg); }
.status[data-state="crit"] { color: var(--crit); background: var(--crit-bg); }
.status[data-state="none"] { color: var(--fg-3); }

/* ── result card: the house ───────────────────────────────────────────── */
.result { background: var(--surface); border: 1px solid var(--rule); border-top: 2px solid var(--divider); }
.result-top { padding: 22px 24px 18px; }
.total {
  display: block; font-weight: 800; font-stretch: 112%; letter-spacing: -.045em;
  font-size: clamp(3.1rem, 7vw, 4.6rem); line-height: 1; margin: 10px 0 8px;
}
.total small { font-size: .32em; font-weight: 600; letter-spacing: 0; color: var(--fg-3); margin-left: 4px; font-stretch: 100%; }
.total-sub { font-size: .88rem; color: var(--fg-2); }

.house-wrap { display: grid; grid-template-columns: 44% 30px minmax(0, 1fr); padding: 4px 24px 22px; border-top: 1px solid var(--rule); }
.house { --h: 224px; display: flex; flex-direction: column; padding-top: 14px; }
.roof { display: block; width: 100%; height: 58px; overflow: visible; }
.roof polyline { fill: none; stroke: var(--red); stroke-width: 9px; stroke-linejoin: miter; stroke-linecap: butt; }
.floors { height: var(--h); margin: 6px 7% 0; display: flex; flex-direction: column-reverse; gap: 3px; }
.floor { flex: 1 1 0; min-height: 3px; transition: flex-grow .55s cubic-bezier(.2,.7,.2,1); position: relative; }
.floor[hidden] { display: none; }
.floor.hl, .house-wrap:not(.hovering) .floor { opacity: 1; }
.house-wrap.hovering .floor:not(.hl) { opacity: .28; }
.floor { transition: flex-grow .55s cubic-bezier(.2,.7,.2,1), opacity .15s; }
.foundation { height: 9px; margin: 8px 3% 0; background: var(--bar); }
.fl-pi  { background: var(--f-pi); }
.fl-tax { background: var(--f-tax); }
.fl-ins { background: var(--f-ins); }
.fl-hoa { background: var(--f-hoa); }
.fl-mi  { background: repeating-linear-gradient(135deg, var(--f-mi-a) 0 2px, var(--f-mi-b) 2px 6px); }
/* P&I before a rate is entered: an empty, dashed floor waiting to be filled */
.floor.is-empty { background: transparent; outline: 2px dashed var(--rule-2); outline-offset: -2px; }
.lbl-amt em { font-style: normal; font-size: .82rem; font-weight: 600; color: var(--fg-3); letter-spacing: 0; }
.est-note { margin-top: 8px; }
.total-sub .link-btn { font-size: inherit; color: var(--fg); }
.consent-note { margin-top: -6px; }
.consent-note a { color: var(--fg-2); }

.leaders { position: relative; height: calc(var(--h) + 83px); }
.leaders svg { position: absolute; left: 0; top: 0; width: 100%; height: 100%; overflow: visible; }
.leaders path { fill: none; stroke: var(--rule-2); stroke-width: 1; }
.labels { position: relative; height: calc(var(--h) + 83px); }
.lbl { position: absolute; left: 0; right: 0; transform: translateY(-50%); transition: top .55s cubic-bezier(.2,.7,.2,1), opacity .15s; cursor: default; }
.lbl[hidden] { display: none; }
.lbl-name { display: flex; align-items: center; gap: 7px; font-size: .78rem; font-weight: 500; color: var(--fg-2); line-height: 1.25; }
.lbl-name i { width: 9px; height: 9px; flex: none; }
.lbl-amt { display: flex; align-items: baseline; gap: 8px; font-size: 1.14rem; font-weight: 700; letter-spacing: -.02em; line-height: 1.25; padding-left: 16px; }
.lbl-amt span { font-size: .74rem; font-weight: 500; color: var(--fg-3); letter-spacing: 0; }
.house-wrap.hovering .lbl:not(.hl) { opacity: .4; }

.stats { margin: 0; border-top: 1px solid var(--rule); }
.stats div:last-child { border-bottom: 0; }
.stats div { display: flex; justify-content: space-between; gap: 12px; padding: 9px 24px; border-bottom: 1px solid var(--rule); font-size: .88rem; }
.stats dt { color: var(--fg-2); }
.stats dd { margin: 0; font-weight: 600; }
.result-cta { padding: 0 24px 22px; display: grid; gap: 12px; }
.result-links { display: flex; gap: 18px; flex-wrap: wrap; }
.cta-lead { font-size: .92rem; color: var(--fg-2); line-height: 1.45; }
.cta-lead b { color: var(--fg); font-weight: 700; }
.assure { font-size: .78rem; font-weight: 600; color: var(--fg-2); text-align: center; margin-top: -4px; }
.fine { font-size: .74rem; color: var(--fg-3); line-height: 1.5; }

/* ── section scaffolding ──────────────────────────────────────────────── */
.section { padding: clamp(48px, 6vw, 80px) 0; border-top: 2px solid var(--divider); }
.section-head { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: clamp(20px, 4vw, 56px); align-items: end; margin-bottom: clamp(28px, 4vw, 44px); }
.section-head h2 { font-size: clamp(1.6rem, 3vw, 2.35rem); line-height: 1.05; margin-top: 12px; }
.section-head p { color: var(--fg-2); max-width: 52ch; }

/* about */
.about { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.2fr); gap: clamp(24px, 5vw, 72px); align-items: start; }
.card-id { background: var(--surface); border: 1px solid var(--rule); border-top: 2px solid var(--divider); padding: 28px; display: grid; gap: 20px; }
.card-id .mark-lg { width: 64px; height: 56px; }
.id-name { font-weight: 800; font-stretch: 112%; font-size: 1.8rem; letter-spacing: -.04em; line-height: 1; }
.id-role { font-size: .9rem; color: var(--fg-2); margin-top: 6px; }
.id-rows { margin: 0; border-top: 1px solid var(--rule); }
.id-rows div { display: flex; justify-content: space-between; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--rule); font-size: .88rem; }
.id-rows dt { color: var(--fg-2); }
.id-rows dd { margin: 0; font-weight: 700; text-align: right; }
.about-copy p { font-size: 1.08rem; color: var(--fg-2); max-width: 54ch; }
.about-copy p + p { margin-top: 16px; }
.about-copy .strong { color: var(--fg); font-weight: 600; }
.about-links { display: flex; gap: 12px; flex-wrap: wrap; margin-top: 28px; }

/* faq */
.faq { border-top: 1px solid var(--rule); }
.faq details { border-bottom: 1px solid var(--rule); }
.faq summary { cursor: pointer; list-style: none; display: flex; justify-content: space-between; gap: 20px; padding: 20px 0; font-size: 1.12rem; font-weight: 700; letter-spacing: -.015em; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; font-size: 1.4rem; font-weight: 400; line-height: 1; flex: none; }
.faq details[open] summary::after { content: "–"; }
.faq summary:hover { color: var(--fg-2); }
.faq .a { padding: 0 0 22px; color: var(--fg-2); max-width: 72ch; }
.faq .a p + p { margin-top: 10px; }

/* closing band */
.band { background: var(--band); color: var(--band-fg); padding: clamp(48px, 6vw, 80px) 0; }
.band-grid { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr); gap: 32px; align-items: end; }
.band h2 { font-size: clamp(1.8rem, 3.6vw, 2.8rem); line-height: 1.02; }
.band p { color: var(--band-fg-2); margin-top: 16px; max-width: 46ch; }
.band .mark-band { width: 72px; height: 62px; margin-bottom: 26px; }
.band-cta { display: grid; gap: 14px; }
.band-num { font-size: .9rem; color: var(--band-fg-2); }
.band-list { margin-top: 22px; }
.band-list li { color: var(--band-fg); font-size: 1.02rem; }
.band-list li svg { color: var(--red); flex: none; }
.band-assure { font-size: .82rem; color: var(--band-fg-2); line-height: 1.6; }
.band-assure a { color: var(--band-fg); font-weight: 700; }
.band-num strong { color: var(--band-fg); font-size: 1.4rem; font-weight: 800; letter-spacing: -.03em; font-stretch: 112%; margin-left: 6px; }

/* footer */
.foot { background: var(--band); color: var(--band-fg-2); border-top: 1px solid var(--band-rule); padding: 32px 0 44px; font-size: .8rem; }
.foot-row { display: flex; flex-wrap: wrap; gap: 20px 40px; align-items: center; justify-content: space-between; padding-bottom: 22px; border-bottom: 1px solid var(--band-rule); }
.foot strong { color: var(--band-fg); font-weight: 700; }
.foot a { color: var(--band-fg); }
.eho { display: flex; align-items: center; gap: 10px; font-size: .68rem; font-weight: 700; letter-spacing: .08em; line-height: 1.3; }
.disclaim { margin-top: 18px; max-width: 100ch; line-height: 1.65; font-size: .75rem; }
.disclaim + .disclaim { margin-top: 10px; }

/* ── legal pages (privacy) ────────────────────────────────────────────── */
.legal { max-width: 760px; padding-top: clamp(32px, 5vw, 56px); padding-bottom: 64px; }
.legal h1 { font-size: clamp(1.9rem, 4vw, 2.8rem); line-height: 1.02; margin-top: 12px; }
.legal-date { color: var(--fg-3); font-size: .86rem; margin-top: 10px; }
.legal h2 { font-size: 1.2rem; font-stretch: 100%; letter-spacing: -.015em; margin-top: 34px; padding-top: 18px; border-top: 1px solid var(--rule); }
.legal p, .legal li { color: var(--fg-2); }
.legal p { margin-top: 10px; }
.legal ul { margin: 10px 0 0; padding-left: 20px; display: grid; gap: 6px; }
.legal strong { color: var(--fg); }

/* ── lead dialog ──────────────────────────────────────────────────────── */
dialog.lead {
  margin: 0 0 0 auto; height: 100dvh; max-height: 100dvh; width: min(520px, 100vw); max-width: 100vw;
  padding: 0; border: 0; border-left: 2px solid var(--divider); background: var(--surface); color: var(--fg);
}
dialog.lead::backdrop { background: rgba(20, 19, 18, .62); }
dialog.lead[open] { animation: slide .32s cubic-bezier(.2,.7,.2,1); }
@keyframes slide { from { transform: translateX(40px); opacity: 0; } to { transform: none; opacity: 1; } }
.lead-in { min-height: 100%; display: flex; flex-direction: column; }
.lead-head { display: flex; justify-content: space-between; align-items: center; padding: 18px 24px; border-bottom: 1px solid var(--rule); }
.progress { display: grid; grid-template-columns: repeat(3, 1fr); gap: 4px; padding: 0 24px; margin-top: 22px; }
.progress i { height: 3px; background: var(--rule); transition: background-color .2s; }
.progress i.on { background: var(--fg); }
.lead-body { padding: 22px 24px 28px; flex: 1; }
.lead-body h2 { font-size: 1.9rem; line-height: 1.02; font-stretch: 112%; margin: 8px 0 8px; }
.lead-body > .step-pane > p.hint { font-size: .9rem; }
.step-pane[hidden] { display: none; }
.choices { display: grid; gap: 8px; margin-top: 22px; }
.choice {
  display: flex; justify-content: space-between; align-items: center; gap: 12px; text-align: left;
  padding: 16px 18px; border: 1px solid var(--rule-2); background: var(--surface); cursor: pointer;
  transition: border-color .12s, background-color .12s;
}
.choice:hover { border-color: var(--fg); }
.choice strong { display: block; font-size: 1.02rem; font-weight: 700; }
.choice span { display: block; font-size: .8rem; color: var(--fg-3); margin-top: 1px; }
.choice[aria-pressed="true"] { background: var(--select-bg); color: var(--select-fg); border-color: var(--select-bg); }
.choice[aria-pressed="true"] span { color: inherit; opacity: .75; }
.lead select, .lead textarea {
  width: 100%; border: 1px solid var(--rule-2); background: var(--surface); padding: 13px 12px; font-size: 1rem;
}
.lead select:focus, .lead textarea:focus { outline: none; border-color: var(--fg); box-shadow: inset 0 0 0 1px var(--fg); }
.lead textarea { min-height: 84px; resize: vertical; }
.lead .box input { font-size: 1rem; font-weight: 500; }
.lead-form { display: grid; gap: 16px; margin-top: 22px; }
.check { display: flex; gap: 10px; align-items: flex-start; font-size: .8rem; color: var(--fg-2); line-height: 1.5; cursor: pointer; }
.check input { margin-top: 3px; width: 17px; height: 17px; flex: none; accent-color: var(--ink); }
.lead-foot { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 16px 24px; border-top: 1px solid var(--rule); position: sticky; bottom: 0; background: var(--surface); }
.lead-foot[hidden] { display: none; }
.err { padding: 10px 12px; border: 1px solid var(--crit); border-left-width: 3px; background: var(--crit-bg); color: var(--crit); font-size: .84rem; font-weight: 600; }
.err[hidden] { display: none; }
.gotcha { position: absolute; left: -9999px; }
/* the offer: what a lead actually gets, shown where they decide */
.offer { margin-top: 22px; padding: 16px 18px; background: var(--sunk); border-left: 3px solid var(--red); }
.offer ul, .band-list { list-style: none; margin: 10px 0 0; padding: 0; display: grid; gap: 8px; }
.offer li, .band-list li { display: flex; align-items: center; gap: 10px; font-weight: 600; font-size: .95rem; }
.offer li svg { color: var(--fg); flex: none; }
.offer-foot { margin-top: 10px; font-size: .8rem; color: var(--fg-3); }
.call-now { margin-top: 14px; font-size: .95rem; font-weight: 600; }
.call-alt { margin-top: 18px; font-size: .84rem; color: var(--fg-3); }
.call-now a, .call-alt a { color: var(--fg); font-weight: 700; }
#lead[data-step="done"] .call-alt { display: none; }

/* ── mobile total bar ─────────────────────────────────────────────────── */
.mbar { display: none; }

/* ── responsive ───────────────────────────────────────────────────────── */
@media (max-width: 1020px) {
  .nav { display: none; }
  .calc-grid { grid-template-columns: 1fr; }
  .rail { position: static; margin-top: 8px; }
  .about, .band-grid { grid-template-columns: 1fr; }
  .mbar {
    display: flex; align-items: center; justify-content: space-between; gap: 14px;
    position: fixed; left: 0; right: 0; bottom: 0; z-index: 40;
    background: var(--surface); border-top: 2px solid var(--divider); padding: 10px var(--gut);
    transition: transform .25s ease;
  }
  .mbar[data-hide="1"] { transform: translateY(110%); }
  .mbar-l { font-size: .64rem; font-weight: 600; letter-spacing: .2em; text-transform: uppercase; color: var(--fg-3); }
  .mbar-n { font-size: 1.5rem; font-weight: 800; letter-spacing: -.04em; font-stretch: 112%; line-height: 1.1; }
  body { padding-bottom: 76px; }
}
@media (max-width: 760px) {
  .hero-grid, .section-head { grid-template-columns: 1fr; }
  .proof { gap: 6px 18px; }
  .fields.two, .fields.three { grid-template-columns: 1fr 1fr; }
  .programs { grid-template-columns: 1fr 1fr; }
  .prog:nth-child(2) { border-right: 0; }
  .prog:nth-child(-n+2) { border-bottom: 1px solid var(--rule-2); }
  .top-actions .btn-red { display: none; }
  .lockup-name { font-size: .98rem; }
}
@media (max-width: 480px) {
  .fields.two, .fields.three { grid-template-columns: 1fr; }
  .house-wrap { grid-template-columns: 46% 22px minmax(0, 1fr); padding-left: 16px; padding-right: 16px; }
  .house { --h: 200px; }
  .result-top, .result-cta { padding-left: 16px; padding-right: 16px; }
  .stats div { padding-left: 16px; padding-right: 16px; }
  .lbl-amt { font-size: 1rem; padding-left: 0; }
  .lbl-name { font-size: .72rem; }
  .theme-btn { display: none; }
  .sub-nmls { display: none; }
  .rates-today { grid-template-columns: 1fr; padding: 16px 14px; }
  .rates-widget { justify-self: center; }
  .afford-sum { padding: 14px; gap: 4px 12px; }
  .afford-ico { width: 38px; height: 38px; }
  .afford-opt { display: none; }
  .afford-body { padding: 16px 14px; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition: none !important; animation: none !important; }
}

@media print {
  .rv { opacity: 1 !important; transform: none !important; }
  .rates-today { display: none !important; }
  .hook-ctl { display: none !important; }
  .top, .mbar, .result-cta, .band, #faq, details.more, .about-links { display: none !important; }
  body { background: #fff; padding: 0; }
  .calc-grid { grid-template-columns: 1fr 1fr; }
  .rail { position: static; }
  .section { padding: 24px 0; break-inside: avoid; }
}
