/* ===========================================================
   Self-hosted variable fonts.
   Served from our own domain, so there is no DNS lookup, TLS
   handshake or render-blocking CSS request to Google's servers.
   Variable files: one file covers the whole weight range.
   =========================================================== */
@font-face {
  font-family: 'Fraunces';
  font-style: italic;
  font-weight: 400 500;
  font-display: swap;
  src: url('fonts/fraunces-italic.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: 'Fraunces';
  font-style: normal;
  font-weight: 400 600;
  font-display: swap;
  src: url('fonts/fraunces-normal.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: 'Inter';
  font-style: normal;
  font-weight: 400 700;
  font-display: swap;
  src: url('fonts/inter-normal.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

/* ===========================================================
   Mansbridge Mortgage — design system
   Warm + confident + understated. One stylesheet, no build step.
   =========================================================== */

:root {
  /* Surfaces */
  --paper:        #F7F6F2;
  --paper-2:      #EBE9E2;
  --paper-3:      #DEDBD1;
  --white:        #FFFFFF;

  /* Ink */
  --ink:          #15201C;
  --ink-2:        #394641;
  --muted:        #6C7772;
  --line:         #DCD9CF;
  --line-soft:    #E9E7E0;

  /* Brand */
  --forest:       #1E4D3F;
  --forest-dk:    #143529;
  --forest-lt:    #2F6E58;
  --bronze:       #B4503C;
  --bronze-lt:    #C96A55;
  --sand:         #DEDBD1;

  /* Type */
  --display: "Fraunces", "Iowan Old Style", Georgia, serif;
  --sans: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;

  /* Space + shape */
  --gutter: 24px;
  --max: 1180px;
  --r-sm: 12px;
  --r: 18px;
  --r-lg: 28px;
  --r-pill: 999px;
  --shadow-sm: 0 1px 2px rgba(22,32,27,.05), 0 2px 8px rgba(22,32,27,.04);
  --shadow:    0 2px 6px rgba(22,32,27,.06), 0 12px 32px rgba(22,32,27,.07);
  --shadow-lg: 0 4px 12px rgba(22,32,27,.07), 0 24px 60px rgba(22,32,27,.10);
}

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

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

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 17px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

img, svg { max-width: 100%; display: block; }

h1, h2, h3, h4 {
  font-family: var(--display);
  font-weight: 500;
  line-height: 1.12;
  letter-spacing: -0.015em;
  margin: 0 0 .5em;
}
h1 { font-size: clamp(2.6rem, 6vw, 4.1rem); }
h2 { font-size: clamp(2rem, 4vw, 2.85rem); }
h3 { font-size: clamp(1.25rem, 2vw, 1.5rem); }
p  { margin: 0 0 1.1em; }
p:last-child { margin-bottom: 0; }

a { color: var(--forest); text-decoration-color: rgba(30,77,63,.3); text-underline-offset: 3px; }
a:hover { text-decoration-color: currentColor; }

:focus-visible {
  outline: 2.5px solid var(--bronze);
  outline-offset: 3px;
  border-radius: 4px;
}

/* ---------- Layout ---------- */
.wrap { width: 100%; max-width: var(--max); margin-inline: auto; padding-inline: var(--gutter); }
.section { padding-block: clamp(54px, 7vw, 94px); }
.section--tight { padding-block: clamp(40px, 5vw, 64px); }
.section--paper2 { background: var(--paper-2); }
.section--ink { background: var(--forest-dk); color: #EAF0EC; }
.section--ink h2, .section--ink h3 { color: #FBFBF8; }
.section--ink p { color: #C3D2CA; }

.rule { border: 0; border-top: 1px solid var(--line); margin: 0; }

.eyebrow {
  font-size: .72rem;
  letter-spacing: .16em;
  text-transform: uppercase;
  font-weight: 700;
  color: var(--bronze);
  margin: 0 0 1.4rem;
  padding-top: .9rem;
  border-top: 2px solid var(--bronze);
  display: inline-block;
}
.section--ink .eyebrow { color: var(--bronze-lt); }

.lede { font-size: clamp(1.06rem, 1.6vw, 1.22rem); color: var(--ink-2); max-width: 60ch; }
.section--ink .lede { color: #C3D2CA; }

.measure { max-width: 68ch; }
.center { text-align: center; margin-inline: auto; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; gap: .55em;
  font-family: var(--sans);
  font-size: .97rem; font-weight: 600; letter-spacing: -0.005em;
  padding: .86em 1.5em;
  border-radius: 999px;
  border: 1.5px solid transparent;
  text-decoration: none;
  cursor: pointer;
  transition: transform .15s ease, background-color .2s ease, border-color .2s ease, box-shadow .2s ease, color .2s ease;
  white-space: nowrap;
}
.btn:active { transform: translateY(1px); }
.btn--primary { background: var(--forest); color: #FBFBF8; box-shadow: var(--shadow-sm); }
.btn--primary:hover { background: var(--forest-dk); box-shadow: var(--shadow); }
.btn--bronze { background: var(--bronze); color: #FBFBF8; box-shadow: var(--shadow-sm); }
.btn--bronze:hover { background: #9A4330; box-shadow: var(--shadow); }
.btn--ghost { border-color: var(--line); color: var(--ink); background: transparent; }
.btn--ghost:hover { border-color: var(--forest); background: rgba(30,77,63,.04); }
.btn--onink { background: #FBFBF8; color: var(--forest-dk); }
.btn--onink:hover { background: var(--sand); }
.btn--ghost-onink { border-color: rgba(251,251,248,.35); color: #FBFBF8; }
.btn--ghost-onink:hover { border-color: #FBFBF8; background: rgba(251,251,248,.08); }
.btn--sm { font-size: .88rem; padding: .62em 1.15em; }
.btn--block { width: 100%; justify-content: center; }
.btn .arr { transition: transform .2s ease; }
.btn:hover .arr { transform: translateX(3px); }

.btn-row { display: flex; flex-wrap: wrap; gap: 12px; }

/* ---------- Header ---------- */
.site-header {
  position: sticky; top: 0; z-index: 60;
  background: rgba(251,248,243,.82);
  backdrop-filter: saturate(150%) blur(14px);
  -webkit-backdrop-filter: saturate(150%) blur(14px);
  border-bottom: 1px solid transparent;
  transition: border-color .25s ease, box-shadow .25s ease;
}
.site-header.is-stuck { border-bottom-color: var(--line); box-shadow: 0 1px 12px rgba(22,32,27,.04); }
.header-inner { display: flex; align-items: center; gap: 18px; min-height: 76px; flex-wrap: nowrap; }
@media (min-width: 901px) and (max-width: 1080px) {
  .nav a { padding: .5em .6em; font-size: .9rem; }
  .header-cta .btn { font-size: .88rem; padding: .7em 1.1em; }
}

.brand { display: flex; align-items: center; gap: 11px; text-decoration: none; color: var(--ink); margin-right: auto; }
.brand-mark { width: 34px; height: 34px; flex: none; }
.brand-name { font-family: var(--display); font-size: 1.16rem; font-weight: 600; letter-spacing: -0.02em; line-height: 1.1; }
.brand-sub { display: block; font-family: var(--sans); font-size: .66rem; font-weight: 500; letter-spacing: .13em; text-transform: uppercase; color: var(--muted); }

.nav { display: flex; align-items: center; gap: 4px; }
.nav a {
  font-size: .94rem; font-weight: 500; color: var(--ink-2);
  text-decoration: none; padding: .5em .8em; border-radius: 999px;
  white-space: nowrap;
  transition: color .18s ease, background-color .18s ease;
}
.nav a:hover { color: var(--ink); background: rgba(30,77,63,.06); }
.nav a[aria-current="page"] { color: var(--forest); font-weight: 600; }
/* The nav's apply button is the mobile-menu duplicate of the header CTA;
   hide it on desktop, and keep button colours from losing to `.nav a`. */
.nav a.btn { display: none; }
.nav a.btn--primary { color: #FBFBF8; background: var(--forest); }
.nav a.btn--primary:hover { color: #FBFBF8; background: var(--forest-dk); }
.header-cta { display: flex; align-items: center; gap: 10px; }

.nav-toggle { display: none; background: none; border: 1.5px solid var(--line); border-radius: 50%; width: 42px; height: 42px; align-items: center; justify-content: center; cursor: pointer; }
.nav-toggle span { display: block; width: 17px; height: 1.6px; background: var(--ink); position: relative; transition: background .2s; }
.nav-toggle span::before, .nav-toggle span::after { content: ""; position: absolute; left: 0; width: 17px; height: 1.6px; background: var(--ink); transition: transform .22s ease; }
.nav-toggle span::before { top: -5.5px; }
.nav-toggle span::after { top: 5.5px; }
.nav-toggle[aria-expanded="true"] span { background: transparent; }
.nav-toggle[aria-expanded="true"] span::before { transform: translateY(5.5px) rotate(45deg); }
.nav-toggle[aria-expanded="true"] span::after { transform: translateY(-5.5px) rotate(-45deg); }

@media (max-width: 900px) {
  .nav-toggle { display: inline-flex; }
  .header-cta .btn--ghost { display: none; }
  .nav a.btn { display: inline-flex; }
  .nav {
    position: absolute; top: 100%; left: 0; right: 0; flex-direction: column; align-items: stretch;
    background: var(--paper); border-bottom: 1px solid var(--line);
    padding: 12px var(--gutter) 22px; gap: 2px;
    box-shadow: var(--shadow);
    display: none;
  }
  .nav.is-open { display: flex; }
  .nav a { padding: .8em .6em; font-size: 1.02rem; }
  .nav .btn { margin-top: 10px; justify-content: center; }
}
@media (max-width: 560px) {
  .header-cta .btn { font-size: .85rem; padding: .62em 1em; }
  .brand-sub { display: none; }
}

/* ---------- Hero ---------- */
.hero { position: relative; overflow: hidden; padding-block: clamp(52px, 7vw, 92px) clamp(56px, 8vw, 104px); }
.hero::before {
  content: ""; position: absolute; inset: -30% -10% auto -10%; height: 78%;
  background:
    radial-gradient(60% 70% at 22% 40%, rgba(222,219,209,.7), transparent 70%),
    radial-gradient(48% 62% at 80% 20%, rgba(30,77,63,.10), transparent 72%);
  pointer-events: none;
}
.hero-grid { position: relative; display: grid; grid-template-columns: 1.06fr .94fr; gap: clamp(32px, 5vw, 72px); align-items: center; }
.hero h1 { margin-bottom: .34em; }
.hero h1 em { font-style: italic; color: inherit; }
.hero .lede { margin-bottom: 1.4em; }
.hero .btn-row { margin-bottom: 2.2em; }

/* Hero byline — photo + name, high on the page so the face registers early.
   The initials sit behind the photo, so they show if the image is missing. */
.byline { display: flex; align-items: center; gap: 16px; margin: 0 0 .86em; }
.byline-avatar { position: relative; width: 80px; height: 80px; flex: none; }
.byline-photo {
  position: absolute; inset: 0; width: 100%; height: 100%;
  border-radius: 50%; object-fit: cover; object-position: 34% 34%;
  border: 2px solid var(--white); box-shadow: var(--shadow-sm);
}
.byline-fallback {
  position: absolute; inset: 0; border-radius: 50%;
  display: grid; place-items: center;
  background: var(--forest); color: var(--sand);
  font-family: var(--display); font-weight: 600; font-size: 1.55rem; letter-spacing: .02em;
  border: 2px solid var(--white); box-shadow: var(--shadow-sm);
}
.byline .who b { display: block; font-size: 1rem; letter-spacing: -.01em; }
.byline .who span { font-size: .85rem; color: var(--muted); line-height: 1.4; display: block; }
@media (max-width: 480px) {
  .byline-avatar, .byline-photo, .byline-fallback { width: 68px; height: 68px; }
  .byline .who span { font-size: .8rem; }
}

.trust-row { display: flex; flex-wrap: wrap; gap: 10px 30px; padding-top: 22px; border-top: 1px solid var(--line); }
.trust-item { display: flex; align-items: baseline; gap: 8px; font-size: .88rem; color: var(--muted); }
.trust-item b { font-family: var(--display); font-size: 1.32rem; font-weight: 600; color: var(--ink); letter-spacing: -.02em; }

@media (max-width: 940px) {
  .hero-grid { grid-template-columns: 1fr; }
  .hero-aside { order: 2; max-width: 460px; margin-inline: auto; width: 100%; }
}

/* ---------- Hero quick-quote card ---------- */
.quote-card {
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-lg);
  padding: 26px 26px 22px;
  position: relative;
}
.quote-card h2 { font-family: var(--sans); font-size: .78rem; font-weight: 700; letter-spacing: .13em; text-transform: uppercase; color: var(--muted); margin-bottom: 18px; }
.qc-result {
  background: var(--paper-2);
  border-radius: var(--r);
  padding: 18px 20px;
  margin-bottom: 20px;
  border: 1px solid var(--line-soft);
}
.qc-result .label { font-size: .8rem; color: var(--muted); margin: 0 0 2px; font-weight: 500; }
.qc-amount { font-family: var(--display); font-size: clamp(2.2rem, 4.4vw, 2.9rem); font-weight: 600; letter-spacing: -.03em; line-height: 1; color: var(--forest-dk); font-variant-numeric: tabular-nums; }
.qc-amount span { font-size: .42em; font-family: var(--sans); font-weight: 600; color: var(--muted); letter-spacing: 0; }
.qc-note { font-size: .76rem; color: var(--muted); margin: 8px 0 0; line-height: 1.45; }
.qc-fields { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.qc-fields .field--full { grid-column: 1 / -1; }
.quote-card .btn { margin-top: 18px; }

/* ---------- Fields ---------- */
.field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.field > label { font-size: .8rem; font-weight: 600; color: var(--ink-2); display: flex; justify-content: space-between; align-items: baseline; gap: 8px; }
.field .hint { font-weight: 500; color: var(--muted); font-size: .74rem; }
.input-shell {
  display: flex; align-items: center;
  background: var(--white);
  border: 1.5px solid var(--line);
  border-radius: var(--r-pill);
  padding: 0 16px;
  transition: border-color .18s ease, box-shadow .18s ease;
}
.input-shell:focus-within { border-color: var(--forest); box-shadow: 0 0 0 3px rgba(30,77,63,.11); }
.input-shell .affix { color: var(--muted); font-size: .92rem; font-weight: 600; flex: none; }
.input-shell .affix--pre { margin-right: 2px; }
.input-shell .affix--post { margin-left: 2px; }
.input-shell input, .input-shell select {
  flex: 1; min-width: 0;
  border: 0; background: transparent; outline: none;
  font-family: var(--sans); font-size: 1rem; font-weight: 500; color: var(--ink);
  padding: .68em 0;
  font-variant-numeric: tabular-nums;
}
.input-shell select { cursor: pointer; padding-right: 4px; appearance: none; }
.input-shell--select { position: relative; }
.input-shell--select::after {
  content: ""; width: 9px; height: 9px; flex: none; margin-left: 6px;
  border-right: 1.8px solid var(--muted); border-bottom: 1.8px solid var(--muted);
  transform: translateY(-2px) rotate(45deg);
}
input[type="range"] { accent-color: var(--forest); width: 100%; }

.seg { display: inline-flex; background: var(--paper-2); border: 1.5px solid var(--line); border-radius: 999px; padding: 3px; gap: 2px; }
.seg button {
  border: 0; background: transparent; cursor: pointer;
  font-family: var(--sans); font-size: .84rem; font-weight: 600; color: var(--muted);
  padding: .42em 1em; border-radius: 999px;
  transition: background .18s ease, color .18s ease;
}
.seg button[aria-pressed="true"] { background: var(--white); color: var(--forest); box-shadow: var(--shadow-sm); }

/* ---------- Cards / grids ---------- */
.grid { display: grid; gap: 20px; }
.grid--3 { grid-template-columns: repeat(3, 1fr); }
.grid--2 { grid-template-columns: repeat(2, 1fr); }
@media (max-width: 900px) { .grid--3 { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 640px) { .grid--3, .grid--2 { grid-template-columns: 1fr; } }

.card {
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  padding: 28px 26px;
  box-shadow: var(--shadow-sm);
  transition: transform .22s ease, box-shadow .22s ease, border-color .22s ease;
}
.card h3 { margin-bottom: .45em; }
.card p { font-size: .96rem; color: var(--ink-2); }
a.card { text-decoration: none; color: inherit; display: block; }
a.card:hover { transform: translateY(-3px); box-shadow: var(--shadow); border-color: var(--sand); }
.card-icon {
  width: 48px; height: 48px; border-radius: 50%;
  background: var(--paper-2); color: var(--forest);
  display: grid; place-items: center; margin-bottom: 18px;
}
.card-icon svg { width: 23px; height: 23px; }
/* A 7th card would otherwise sit alone in its row; span it instead. */
.card--wide { grid-column: 1 / -1; display: grid; grid-template-columns: auto 1fr; gap: 6px 22px; align-items: center; }
.card--wide .card-icon { margin-bottom: 0; grid-row: 1 / span 2; }
.card--wide h3 { margin-bottom: .25em; }
.card--wide p { margin-bottom: 0; max-width: 70ch; }
.card--wide .card-more { grid-column: 2; margin-top: 10px; }
@media (max-width: 640px) {
  .card--wide { grid-template-columns: 1fr; }
  .card--wide .card-icon { grid-row: auto; margin-bottom: 18px; }
  .card--wide .card-more { grid-column: 1; }
}

.card-more { font-size: .88rem; font-weight: 600; color: var(--forest); margin-top: 14px; display: inline-flex; gap: .4em; align-items: center; }

/* ---------- Steps ---------- */
.steps { display: grid; grid-template-columns: repeat(4, 1fr); gap: 0; counter-reset: step; }
.step { position: relative; padding: 0 22px 0 0; }
.step::before {
  counter-increment: step; content: counter(step, decimal-leading-zero);
  font-family: var(--display); font-size: .92rem; font-weight: 600; color: var(--bronze);
  display: block; margin-bottom: 14px;
}
.step::after {
  content: ""; position: absolute; top: 34px; left: 0; right: 22px; height: 1px;
  background: var(--line);
}
.step:last-child::after { right: 0; }
.step h3 { font-size: 1.18rem; margin: 18px 0 .4em; }
.step p { font-size: .93rem; color: var(--ink-2); }
@media (max-width: 860px) { .steps { grid-template-columns: repeat(2, 1fr); row-gap: 34px; } }
@media (max-width: 520px) { .steps { grid-template-columns: 1fr; } .step::after { display: none; } }

/* ---------- Split (about / feature) ---------- */
.split { display: grid; grid-template-columns: .88fr 1.12fr; gap: clamp(30px, 5vw, 66px); align-items: center; }
.split--rev { grid-template-columns: 1.12fr .88fr; }
@media (max-width: 880px) { .split, .split--rev { grid-template-columns: 1fr; } }

.portrait {
  border-radius: 50%; overflow: hidden; background: var(--paper-3);
  aspect-ratio: 1 / 1; position: relative; box-shadow: var(--shadow);
  display: grid; place-items: center; text-align: center;
  border: 6px solid var(--white);
  max-width: 380px; margin-inline: auto; width: 100%;
}
.portrait img { width: 100%; height: 100%; object-fit: cover; object-position: center 24%; }
/* A standing, full-length shot frames badly in a circle. Give it a tall
   rounded frame instead, which also varies the rhythm between pages. */
.portrait--tall { border-radius: var(--r-lg); aspect-ratio: 3 / 4; max-width: 430px; border-width: 0; box-shadow: var(--shadow-lg); }
.portrait--tall img { object-position: center 18%; }
.portrait .ph { color: var(--muted); font-size: .84rem; max-width: 22ch; padding: 24px; }

/* ---------- Quotes ---------- */
.quote-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
@media (max-width: 900px) { .quote-grid { grid-template-columns: 1fr; max-width: 640px; margin-inline: auto; } }
blockquote.tm {
  margin: 0; background: var(--white); border: 1px solid var(--line);
  border-radius: var(--r-lg); padding: 28px 26px; box-shadow: var(--shadow-sm);
  display: flex; flex-direction: column;
}
blockquote.tm p { font-family: var(--display); font-size: 1.12rem; line-height: 1.5; color: var(--ink); margin-bottom: 18px; flex: 1; }
blockquote.tm footer { font-size: .85rem; color: var(--muted); font-style: normal; }
blockquote.tm footer b { color: var(--ink-2); font-weight: 600; display: block; }
.stars { color: var(--bronze); letter-spacing: .12em; font-size: .9rem; margin-bottom: 14px; }

/* The long review gets room to breathe instead of being squeezed into a card. */
blockquote.tm--feature {
  background: var(--forest-dk); border-color: var(--forest-dk);
  padding: 40px clamp(26px, 5vw, 56px); box-shadow: var(--shadow);
}
blockquote.tm--feature p { color: #EAF0EC; font-size: clamp(1.15rem, 2vw, 1.42rem); line-height: 1.55; }
blockquote.tm--feature footer { color: #9FB8AC; }
blockquote.tm--feature footer b { color: var(--sand); }
blockquote.tm--feature .stars { color: var(--bronze-lt); }

/* ---------- FAQ ---------- */
.faq { max-width: 820px; margin-inline: auto; }
.faq details { border-bottom: 1px solid var(--line); }
.faq details:first-child { border-top: 1px solid var(--line); }
.faq summary {
  cursor: pointer; list-style: none; padding: 22px 44px 22px 0; position: relative;
  font-family: var(--display); font-size: 1.16rem; font-weight: 500; color: var(--ink);
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after {
  content: ""; position: absolute; right: 8px; top: 30px;
  width: 11px; height: 11px;
  border-right: 1.8px solid var(--bronze); border-bottom: 1.8px solid var(--bronze);
  transform: rotate(45deg); transition: transform .22s ease;
}
.faq details[open] summary::after { transform: rotate(-135deg); top: 33px; }
.faq .answer { padding: 0 40px 24px 0; color: var(--ink-2); font-size: .98rem; }

/* ---------- CTA band ---------- */
.cta-band { background: var(--forest-dk); color: #FBFBF8; border-radius: 0; position: relative; overflow: hidden; }
.cta-band::after {
  content: ""; position: absolute; right: -8%; top: -60%; width: 60%; aspect-ratio: 1;
  background: radial-gradient(circle, rgba(180,80,60,.28), transparent 62%);
  pointer-events: none;
}
.cta-inner { position: relative; text-align: center; max-width: 720px; margin-inline: auto; }
.cta-inner h2 { color: #FBFBF8; }
.cta-inner p { color: #C3D2CA; }
.cta-inner .btn-row { justify-content: center; margin-top: 28px; }

/* ---------- Footer ---------- */
.site-footer { background: var(--paper-2); border-top: 1px solid var(--line); padding-block: 56px 32px; font-size: .92rem; }
.footer-grid { display: grid; grid-template-columns: 1.5fr 1fr 1fr 1fr; gap: 34px; margin-bottom: 40px; }
@media (max-width: 820px) { .footer-grid { grid-template-columns: 1fr 1fr; gap: 28px; } }
@media (max-width: 520px) { .footer-grid { grid-template-columns: 1fr; } }
.site-footer h4 { font-family: var(--sans); font-size: .76rem; letter-spacing: .13em; text-transform: uppercase; color: var(--muted); margin-bottom: 14px; font-weight: 700; }
.site-footer ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 9px; }
.site-footer a { color: var(--ink-2); text-decoration: none; }
.site-footer a:hover { color: var(--forest); text-decoration: underline; }
.footer-legal { border-top: 1px solid var(--line); padding-top: 24px; display: flex; flex-wrap: wrap; gap: 16px 28px; align-items: flex-start; justify-content: space-between; }
.footer-legal p { font-size: .78rem; color: var(--muted); line-height: 1.6; max-width: 76ch; }
.cred { display: flex; align-items: center; gap: 10px; flex: none; }
.cred svg { width: 34px; height: 34px; color: var(--ink-2); }
.cred span { font-size: .7rem; line-height: 1.25; color: var(--muted); max-width: 12ch; text-transform: uppercase; letter-spacing: .06em; font-weight: 600; }

/* ---------- Utility ---------- */
.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;
}
.skip-link {
  position: absolute; left: 12px; top: -60px; z-index: 100;
  background: var(--forest); color: #fff; padding: .7em 1.2em; border-radius: 0 0 var(--r) var(--r);
  text-decoration: none; font-weight: 600; transition: top .2s ease;
}
.skip-link:focus { top: 0; }
.placeholder-flag {
  display: inline-block; font-size: .68rem; font-weight: 700; letter-spacing: .08em;
  text-transform: uppercase; color: #8A3A26; background: #F7E3DD;
  border: 1px solid #E8C3B8; border-radius: var(--r-pill); padding: .15em .5em; vertical-align: middle;
}
.reveal { opacity: 0; transform: translateY(14px); transition: opacity .6s ease, transform .6s ease; }
.reveal.is-in { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) { .reveal { opacity: 1; transform: none; } }

/* ===========================================================
   Calculator
   =========================================================== */
.calc-grid { display: grid; grid-template-columns: 380px 1fr; gap: 34px; align-items: start; }
/* Grid items default to min-width:auto, which lets a wide table push the
   track past the viewport. Pin them to zero and let the tables scroll. */
.calc-grid > * { min-width: 0; }
.tbl-x { overflow-x: auto; -webkit-overflow-scrolling: touch; }
@media (max-width: 1000px) { .calc-grid { grid-template-columns: 1fr; } }

.calc-panel {
  background: var(--white); border: 1px solid var(--line); border-radius: var(--r-lg);
  padding: 26px 24px; box-shadow: var(--shadow); position: sticky; top: 96px;
}
@media (max-width: 1000px) { .calc-panel { position: static; } }
.calc-panel h2 { font-family: var(--sans); font-size: .78rem; font-weight: 700; letter-spacing: .13em; text-transform: uppercase; color: var(--muted); margin-bottom: 20px; }
.panel-group { display: grid; gap: 16px; }
.panel-group + .panel-group { margin-top: 22px; padding-top: 22px; border-top: 1px solid var(--line-soft); }
.panel-group > h3 { font-family: var(--sans); font-size: .74rem; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); margin: 0; }
.row-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }

/* Down payment: amount + unit toggle */
.dp-row { display: grid; grid-template-columns: 1fr auto; gap: 10px; align-items: end; }

/* Results */
.result-hero {
  background: var(--forest-dk); color: #FBFBF8; border-radius: var(--r-lg);
  padding: 30px 32px; box-shadow: var(--shadow); margin-bottom: 20px;
  display: flex; flex-wrap: wrap; gap: 24px; align-items: flex-end; justify-content: space-between;
}
.result-hero .rh-label { font-size: .76rem; letter-spacing: .13em; text-transform: uppercase; color: #9FB8AC; margin: 0 0 6px; font-weight: 700; }
.result-hero .rh-amount { font-family: var(--display); font-size: clamp(2.7rem, 6vw, 3.9rem); font-weight: 600; letter-spacing: -.035em; line-height: 1; font-variant-numeric: tabular-nums; }
.result-hero .rh-amount small { font-size: .3em; font-family: var(--sans); font-weight: 600; color: #9FB8AC; letter-spacing: 0; margin-left: .4em; }
.rh-side { text-align: right; }
.rh-side .k { font-size: .76rem; letter-spacing: .1em; text-transform: uppercase; color: #9FB8AC; font-weight: 700; margin: 0 0 4px; }
.rh-side .v { font-family: var(--display); font-size: 1.5rem; font-weight: 600; color: #FBFBF8; font-variant-numeric: tabular-nums; }
@media (max-width: 560px) { .rh-side { text-align: left; } }

.kpi-row { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin-bottom: 20px; }
@media (max-width: 900px) { .kpi-row { grid-template-columns: repeat(2, 1fr); } }
.kpi {
  background: var(--white); border: 1px solid var(--line); border-radius: var(--r);
  padding: 18px 18px 16px; box-shadow: var(--shadow-sm);
}
.kpi .k { font-size: .74rem; font-weight: 600; color: var(--muted); margin: 0 0 6px; line-height: 1.35; }
.kpi .v { font-family: var(--display); font-size: 1.44rem; font-weight: 600; letter-spacing: -.025em; color: var(--ink); font-variant-numeric: tabular-nums; line-height: 1.1; }
.kpi .sub { font-size: .74rem; color: var(--muted); margin: 5px 0 0; }

.panel-card {
  background: var(--white); border: 1px solid var(--line); border-radius: var(--r-lg);
  padding: 26px 26px 24px; box-shadow: var(--shadow-sm); margin-bottom: 20px;
}
.panel-card > h3 { font-size: 1.2rem; margin-bottom: .25em; }
.panel-card > .sub { font-size: .9rem; color: var(--muted); margin: 0 0 20px; }

/* --- Stacked bar ------------------------------------------- */
.viz-root {
  --series-principal: #1baf7a;
  --series-premium:   #4a3aa7;
  --series-interest:  #eb6834;
  --viz-surface: #FFFFFF;
}
.stack {
  display: flex; width: 100%; height: 42px; border-radius: var(--r-pill); overflow: hidden;
  background: var(--paper-2); gap: 2px; margin-bottom: 18px;
}
.stack .seg-bar { min-width: 0; transition: flex-basis .35s ease; position: relative; }
.stack .seg-bar:first-child { border-radius: var(--r-pill) 0 0 var(--r-pill); }
.stack .seg-bar:last-child  { border-radius: 0 var(--r-pill) var(--r-pill) 0; }
.stack .seg-bar[data-k="principal"] { background: var(--series-principal); }
.stack .seg-bar[data-k="premium"]   { background: var(--series-premium); }
.stack .seg-bar[data-k="interest"]  { background: var(--series-interest); }

.legend { display: grid; gap: 12px; }
.legend-item { display: grid; grid-template-columns: 12px 1fr auto auto; gap: 12px; align-items: baseline; font-size: .93rem; }
.legend-item .swatch { width: 12px; height: 12px; border-radius: 50%; transform: translateY(1px); }
.legend-item .swatch[data-k="principal"] { background: var(--series-principal); }
.legend-item .swatch[data-k="premium"]   { background: var(--series-premium); }
.legend-item .swatch[data-k="interest"]  { background: var(--series-interest); }
.legend-item .nm { color: var(--ink-2); }
.legend-item .val { font-weight: 600; color: var(--ink); font-variant-numeric: tabular-nums; }
.legend-item .pct { color: var(--muted); font-variant-numeric: tabular-nums; min-width: 4.5ch; text-align: right; }

/* --- Tables ------------------------------------------------- */
.tbl { width: 100%; border-collapse: collapse; font-size: .9rem; }
.tbl th, .tbl td { text-align: right; padding: 10px 8px; border-bottom: 1px solid var(--line-soft); font-variant-numeric: tabular-nums; }
.tbl th { font-size: .72rem; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); font-weight: 700; border-bottom-color: var(--line); }
.tbl th:first-child, .tbl td:first-child { text-align: left; font-variant-numeric: normal; }
.tbl tbody tr:hover { background: var(--paper); }
.tbl tr.is-highlight td { background: rgba(180,80,60,.09); font-weight: 600; }
.tbl-scroll { max-height: 360px; overflow: auto; border: 1px solid var(--line-soft); border-radius: var(--r-sm); }
@media (max-width: 560px) {
  .tbl { font-size: .82rem; }
  .tbl th, .tbl td { padding: 9px 6px; }
  .panel-card { padding: 22px 18px 20px; }
}
.tbl-scroll thead th { position: sticky; top: 0; background: var(--white); z-index: 2; }

.linkish {
  background: none; border: 0; padding: 0; cursor: pointer;
  font: inherit; font-size: .86rem; font-weight: 600; color: var(--forest);
  text-decoration: underline; text-underline-offset: 3px;
}

/* --- Notices ------------------------------------------------ */
.notice {
  display: flex; gap: 12px; align-items: flex-start;
  border-radius: var(--r); padding: 14px 16px; font-size: .9rem; line-height: 1.5;
  margin-bottom: 16px; border: 1px solid;
}
.notice svg { width: 18px; height: 18px; flex: none; margin-top: 2px; }
.notice--warn  { background: #FAEFEA; border-color: #E5C7BB; color: #7A3B26; }
.notice--info  { background: #E9F0EC; border-color: #C5D8CE; color: #1D4437; }
.notice[hidden] { display: none; }

.disclaimer { font-size: .8rem; color: var(--muted); line-height: 1.6; max-width: 80ch; }


/* ===========================================================
   Editorial restyle
   The generic template look comes from centred headings, boxed
   cards and a coloured italic in the headline. All three go.
   =========================================================== */

/* Headline accent: italic in the same ink, with a bronze rule under it. */
.hero h1 em {
  font-style: italic;
  color: inherit;
  background-image: linear-gradient(var(--bronze), var(--bronze));
  background-size: 100% 2px;
  background-repeat: no-repeat;
  background-position: 0 92%;
  padding-bottom: .06em;
}

/* Section headings sit left, with the eyebrow hanging in its own column. */
.section-head { display: grid; grid-template-columns: 190px minmax(0, 1fr); gap: 0 48px; align-items: start; }
.section-head > .eyebrow { grid-column: 1; grid-row: 1; margin: 0; }
.section-head > :not(.eyebrow) { grid-column: 2; }
@media (max-width: 820px) {
  .section-head { grid-template-columns: 1fr; gap: 0; }
  .section-head > .eyebrow { grid-column: 1; margin-bottom: 1.2rem; }
  .section-head > :not(.eyebrow) { grid-column: 1; }
}

/* How I help: an editorial list, not a wall of boxes. */
.topics { display: grid; grid-template-columns: repeat(2, 1fr); gap: 0 56px; }
@media (max-width: 760px) { .topics { grid-template-columns: 1fr; gap: 0; } }
.topics .card {
  background: none; border: 0; border-top: 1px solid var(--line);
  border-radius: 0; box-shadow: none;
  padding: 26px 0 28px; display: grid;
  grid-template-columns: 44px minmax(0, 1fr); gap: 4px 18px;
}
.topics .card:hover { transform: none; box-shadow: none; border-color: var(--bronze); }
.topics .card-icon {
  grid-row: 1 / span 3; width: 44px; height: 44px; margin: 0;
  background: none; border: 1.5px solid var(--line);
  color: var(--bronze); border-radius: 50%;
}
.topics .card:hover .card-icon { border-color: var(--bronze); background: rgba(180,80,60,.07); }
.topics .card h3 { font-size: 1.22rem; margin: 0 0 .3em; align-self: center; }
.topics .card p { margin: 0; font-size: .95rem; }
.topics .card .card-more { margin-top: 12px; }

/* Process: numerals in circles, which suits the rounded language elsewhere. */
.steps { gap: 36px 30px; }
.step { padding-right: 0; }
.step::before {
  width: 62px; height: 62px; border-radius: 50%;
  border: 1.5px solid var(--bronze); color: var(--bronze);
  display: grid; place-items: center;
  font-family: var(--display); font-size: 1.15rem; font-weight: 600;
  margin-bottom: 20px;
}
.step::after { display: none; }
.step h3 { margin-top: 0; }

/* Paper grain. Sits above the background, below everything else. */
body::before {
  content: ""; position: fixed; inset: 0; z-index: 0; pointer-events: none;
  opacity: .5; mix-blend-mode: multiply;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='180' height='180'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='3' stitchTiles='stitch'/%3E%3CfeColorMatrix type='saturate' values='0'/%3E%3C/filter%3E%3Crect width='180' height='180' filter='url(%23n)' opacity='.055'/%3E%3C/svg%3E");
}
body > * { position: relative; z-index: 1; }

/* An arch lifted from the logo, set large and very faint behind the hero. */
.hero::after {
  content: ""; position: absolute; right: -6%; top: -14%;
  width: min(620px, 52vw); aspect-ratio: 1 / 1.25;
  border: 1.5px solid var(--line);
  border-radius: 50% 50% 0 0 / 60% 60% 0 0;
  opacity: .5; pointer-events: none; z-index: 0;
}
.hero > .wrap { position: relative; z-index: 1; }
@media (max-width: 940px) { .hero::after { display: none; } }

/* ===========================================================
   Hero portrait, with the estimate as the next beat
   =========================================================== */
.hero-portrait {
  border-radius: var(--r-lg); overflow: hidden;
  max-width: 440px; margin-inline: auto; width: 100%;
  aspect-ratio: 4 / 5; box-shadow: var(--shadow-lg);
  background: var(--paper-3);
}
.hero-portrait img { width: 100%; height: 100%; object-fit: cover; object-position: center 20%; display: block; }
@media (max-width: 940px) { .hero-portrait { max-width: 360px; } }

/* The estimate card no longer competes with the headline for a column. */
#estimate .quote-card { max-width: 520px; }
#estimate .split { align-items: center; }

/* The large hero portrait makes the small avatar redundant; a ruled
   credit line carries the name and licensing instead. */
.credit {
  margin: 0 0 1.6em; padding-left: 16px;
  border-left: 2px solid var(--bronze);
  font-size: .88rem; color: var(--muted); line-height: 1.5;
}
.credit b { display: block; font-size: 1rem; color: var(--ink); letter-spacing: -.01em; }


