/* ============================================================
   Blue Key Mortgage — senior-first design system (2026 rebuild)
   Design rules: 19px+ body type, WCAG AAA text contrast, 48px
   tap targets, no animation, no external fonts, print-friendly.
   ============================================================ */

:root {
  --cream: #FDF8F1;          /* page background */
  --cream-deep: #F5EBDC;     /* alternate band */
  --white: #FFFFFF;
  --ink: #2A2620;            /* body text — 12.9:1 on cream */
  --ink-soft: #4A443B;       /* secondary text — 8.6:1 on cream */
  --navy: #1C3D5A;           /* brand blue — 9.2:1 white-on-navy */
  --navy-deep: #142C42;
  --gold: #B8862D;           /* large accents, borders, icons */
  --gold-deep: #7E5E1E;      /* gold that passes 4.5:1 as text */
  --gold-pale: #F3E4C3;
  --line: #E3D5BD;           /* hairlines on cream */
  --focus: #B25000;
  --serif: Georgia, 'Times New Roman', serif;
  --sans: 'Seravek', 'Segoe UI', 'Trebuchet MS', Verdana, sans-serif;
  --radius: 14px;
  --shadow: 0 2px 6px rgba(42, 38, 32, 0.07), 0 10px 28px rgba(42, 38, 32, 0.07);
  --maxw: 1120px;
  --prose: 46rem;
}

/* ---------- Reset & base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--cream);
  color: var(--ink);
  font-family: var(--serif);
  font-size: clamp(1.1875rem, 1.05rem + 0.45vw, 1.3125rem); /* 19–21px */
  line-height: 1.65;
}
img { max-width: 100%; height: auto; display: block; }
main { display: block; }

h1, h2, h3, h4 { font-family: var(--serif); line-height: 1.2; color: var(--navy); margin: 0 0 0.5em; font-weight: 700; }
h1 { font-size: clamp(2.1rem, 1.5rem + 2.2vw, 3.1rem); letter-spacing: -0.01em; }
h2 { font-size: clamp(1.7rem, 1.35rem + 1.2vw, 2.2rem); }
h3 { font-size: clamp(1.3rem, 1.15rem + 0.5vw, 1.5rem); }
h4 { font-size: 1.15rem; }
p, ul, ol { margin: 0 0 1.1em; }
li { margin-bottom: 0.45em; }
a { color: var(--navy); text-decoration: underline; text-decoration-thickness: 1.5px; text-underline-offset: 3px; }
a:hover { color: var(--gold-deep); }
strong { color: inherit; }
hr { border: 0; border-top: 1px solid var(--line); margin: 2.5rem 0; }

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

.skip-link {
  position: absolute; left: -9999px; top: 0; z-index: 100;
  background: var(--navy); color: #fff; padding: 0.9rem 1.4rem; font-family: var(--sans);
}
.skip-link:focus { left: 0; }

/* ---------- Layout helpers ---------- */
.wrap { max-width: var(--maxw); margin: 0 auto; padding: 0 clamp(1.1rem, 4vw, 2rem); }
.prose { max-width: var(--prose); }
.center { text-align: center; }
.center .prose { margin-left: auto; margin-right: auto; }
section.band { padding: clamp(2.6rem, 6vw, 4.5rem) 0; }
section.band.alt { background: var(--cream-deep); }
section.band.navy { background: var(--navy); color: #F4EFE6; }
section.band.navy h2, section.band.navy h3 { color: #fff; }
section.band.navy a { color: #F5DFA8; }
.eyebrow {
  font-family: var(--sans); font-size: 0.95rem; font-weight: 700;
  letter-spacing: 0.14em; text-transform: uppercase; color: var(--gold-deep);
  margin-bottom: 0.9rem;
}
.band.navy .eyebrow { color: #E9C877; }
.lede { font-size: 1.18em; color: var(--ink-soft); }
.band.navy .lede { color: #E8E0D2; }

.grid-2, .grid-3 { display: grid; gap: clamp(1.2rem, 3vw, 2rem); }
@media (min-width: 720px) {
  .grid-2 { grid-template-columns: 1fr 1fr; }
  .grid-3 { grid-template-columns: repeat(3, 1fr); }
}
.split { display: grid; gap: clamp(1.5rem, 4vw, 3rem); align-items: center; }
@media (min-width: 860px) { .split { grid-template-columns: 1.1fr 0.9fr; } .split.flip > :first-child { order: 2; } }

/* ---------- Cards ---------- */
.card {
  background: var(--white); border: 1px solid var(--line); border-radius: var(--radius);
  padding: clamp(1.3rem, 3vw, 1.8rem); box-shadow: var(--shadow);
}
.card h3 { margin-top: 0.2rem; }
.card .icon { color: var(--gold); margin-bottom: 0.6rem; }
.card.quiet { box-shadow: none; background: var(--cream); }
.note {
  background: var(--gold-pale); border-left: 6px solid var(--gold); border-radius: 0 10px 10px 0;
  padding: 1.1rem 1.3rem; margin: 1.4rem 0;
}
.note.navy { background: #E8EEF4; border-left-color: var(--navy); }

/* ---------- Buttons ---------- */
.btn {
  display: inline-block; font-family: var(--sans); font-weight: 700; text-decoration: none;
  border-radius: 12px; padding: 0.95rem 1.7rem; min-height: 48px; font-size: 1.05rem;
  border: 2.5px solid var(--navy); background: var(--navy); color: #fff; cursor: pointer;
  text-align: center;
}
.btn:hover { background: var(--navy-deep); border-color: var(--navy-deep); color: #fff; }
.btn.gold { background: var(--gold); border-color: var(--gold); color: #241B06; }
.btn.gold:hover { background: #A3761F; border-color: #A3761F; color: #fff; }
.btn.ghost { background: transparent; color: var(--navy); }
.btn.ghost:hover { background: var(--navy); color: #fff; }
.band.navy .btn.ghost { color: #fff; border-color: #fff; }
.band.navy .btn.ghost:hover { background: #fff; color: var(--navy); }
.btn.big { font-size: 1.15rem; padding: 1.15rem 2.1rem; }
.actions { display: flex; flex-wrap: wrap; gap: 0.9rem; align-items: center; margin: 1.4rem 0 0; padding: 0; list-style: none; }

/* ---------- Header ---------- */
.site-header {
  background: var(--white); border-bottom: 1px solid var(--line);
  position: sticky; top: 0; z-index: 50;
}
.site-header .bar {
  display: flex; align-items: center; justify-content: space-between; gap: 1rem;
  min-height: 76px; padding: 0.6rem 0;
}
.brand { display: flex; align-items: center; gap: 0.65rem; text-decoration: none; }
.brand svg { flex: none; }
.brand .name { font-family: var(--serif); font-weight: 700; font-size: 1.35rem; color: var(--navy); line-height: 1.1; }
.brand .tag { display: block; font-family: var(--sans); font-size: 0.78rem; font-weight: 400; color: var(--ink-soft); letter-spacing: 0.02em; }
.header-cta { display: flex; align-items: center; gap: 0.9rem; }
.call-link {
  display: flex; flex-direction: column; align-items: flex-end; text-decoration: none;
  font-family: var(--sans); line-height: 1.25; padding: 0.4rem 0.2rem;
}
.call-link .call-label { font-size: 0.82rem; color: var(--ink-soft); }
.call-link .call-number { font-size: 1.25rem; font-weight: 800; color: var(--navy); white-space: nowrap; }
.call-link:hover .call-number { color: var(--gold-deep); }

.site-nav { background: var(--navy); }
.site-nav ul { display: flex; flex-wrap: wrap; margin: 0; padding: 0; list-style: none; }
.site-nav a {
  display: block; padding: 0.85rem 1.05rem; color: #fff; text-decoration: none;
  font-family: var(--sans); font-weight: 600; font-size: 1.02rem;
}
.site-nav a:hover, .site-nav a[aria-current="page"] { background: var(--navy-deep); color: #F5DFA8; }
.nav-toggle { display: none; }

@media (max-width: 820px) {
  .brand .tag { display: none; }
  .call-link .call-label { display: none; }
  .site-header .bar { gap: 0.6rem; }
  .header-cta { gap: 0.6rem; }
  .nav-toggle {
    display: inline-flex; align-items: center; gap: 0.5rem; background: var(--cream);
    border: 2px solid var(--navy); border-radius: 10px; color: var(--navy);
    font-family: var(--sans); font-weight: 700; font-size: 1rem; padding: 0.55rem 0.95rem; cursor: pointer;
  }
  .site-nav ul { display: none; flex-direction: column; padding: 0.4rem 0; }
  .site-nav.open ul { display: flex; }
  .site-nav a { padding: 1rem 1.3rem; border-bottom: 1px solid rgba(255,255,255,0.12); font-size: 1.1rem; }
}

@media (max-width: 600px) {
  .header-cta > .btn.gold { display: none; }
  .brand .name { font-size: 1.15rem; }
  .call-link .call-number { font-size: 1.1rem; }
}

/* ---------- Hero ---------- */
.hero { padding: clamp(2.5rem, 6vw, 4.8rem) 0; }
.hero .photo img { border-radius: var(--radius); box-shadow: var(--shadow); object-fit: cover; }
.trust-bar {
  background: var(--navy-deep); color: #E8E0D2; font-family: var(--sans); font-size: 0.98rem;
  padding: 0.65rem 0; text-align: center;
}
.trust-bar strong { color: #F5DFA8; font-weight: 700; }

/* ---------- Steps / checklists ---------- */
ol.steps { counter-reset: step; list-style: none; padding: 0; margin: 1.5rem 0; }
ol.steps > li {
  counter-increment: step; position: relative; padding: 0 0 1.4rem 4rem; margin: 0;
}
ol.steps > li::before {
  content: counter(step); position: absolute; left: 0; top: -0.2rem;
  width: 2.7rem; height: 2.7rem; border-radius: 50%; background: var(--gold-pale);
  border: 2px solid var(--gold); color: var(--gold-deep);
  font-family: var(--sans); font-weight: 800; font-size: 1.25rem;
  display: flex; align-items: center; justify-content: center;
}
ul.checks { list-style: none; padding: 0; }
ul.checks > li { position: relative; padding-left: 2.3rem; margin-bottom: 0.8em; }
ul.checks > li::before {
  content: "✓"; position: absolute; left: 0; top: 0;
  color: var(--gold-deep); font-weight: 800; font-size: 1.2em; font-family: var(--sans);
}
ul.xs > li::before { content: "•"; }

/* ---------- FAQ accordions ---------- */
details.faq {
  background: var(--white); border: 1px solid var(--line); border-radius: 12px;
  margin-bottom: 0.9rem; box-shadow: var(--shadow);
}
details.faq summary {
  cursor: pointer; padding: 1.1rem 1.3rem; font-weight: 700; color: var(--navy);
  font-size: 1.12em; list-style: none; display: flex; justify-content: space-between; gap: 1rem;
}
details.faq summary::-webkit-details-marker { display: none; }
details.faq summary::after { content: "+"; font-family: var(--sans); font-weight: 800; font-size: 1.4em; color: var(--gold-deep); flex: none; }
details.faq[open] summary::after { content: "–"; }
details.faq .answer { padding: 0 1.3rem 1.2rem; border-top: 1px solid var(--line); padding-top: 1rem; }

/* ---------- Tables ---------- */
.table-scroll { overflow-x: auto; margin: 1.5rem 0; }
table.compare { border-collapse: collapse; width: 100%; background: var(--white); font-size: 0.98em; }
table.compare caption { text-align: left; font-weight: 700; padding-bottom: 0.6rem; color: var(--navy); }
table.compare th, table.compare td { border: 1px solid var(--line); padding: 0.8rem 1rem; text-align: left; vertical-align: top; }
table.compare thead th { background: var(--navy); color: #fff; font-family: var(--sans); }
table.compare tbody th { background: var(--cream-deep); font-family: var(--sans); }

/* ---------- Forms ---------- */
form.bk label { display: block; font-family: var(--sans); font-weight: 700; margin-bottom: 0.35rem; color: var(--navy); }
form.bk input, form.bk select, form.bk textarea {
  width: 100%; font-size: 1.1rem; font-family: var(--sans); color: var(--ink);
  border: 2px solid #8C8272; border-radius: 10px; background: #fff;
  padding: 0.85rem 1rem; margin-bottom: 1.2rem; min-height: 52px;
}
form.bk textarea { min-height: 9rem; }
form.bk input:focus, form.bk select:focus, form.bk textarea:focus { border-color: var(--navy); outline: 3px solid rgba(28,61,90,0.25); }
.privacy-note { font-size: 0.92em; color: var(--ink-soft); display: flex; gap: 0.5rem; align-items: flex-start; }

/* ---------- CTA band & footer ---------- */
.cta-band { background: var(--navy); color: #F4EFE6; padding: clamp(2.5rem, 6vw, 4rem) 0; }
.cta-band h2 { color: #fff; }
.site-footer { background: var(--navy-deep); color: #D9D2C4; padding: 3rem 0 2rem; font-size: 0.98rem; }
.site-footer h3 { color: #fff; font-size: 1.05rem; font-family: var(--sans); letter-spacing: 0.06em; text-transform: uppercase; }
.site-footer a { color: #F0E7D4; }
.site-footer a:hover { color: #F5DFA8; }
.site-footer ul { list-style: none; padding: 0; }
.site-footer li { margin-bottom: 0.7em; }
.footer-cols { display: grid; gap: 2rem; margin-bottom: 2rem; }
@media (min-width: 760px) { .footer-cols { grid-template-columns: 1.3fr 1fr 1fr 1.2fr; } }
.footer-legal { border-top: 1px solid rgba(255,255,255,0.18); padding-top: 1.5rem; font-size: 0.9rem; color: #C4BBA9; }
.footer-legal p { margin-bottom: 0.7em; }

/* ---------- Breadcrumb ---------- */
.crumbs { font-family: var(--sans); font-size: 0.95rem; padding: 1rem 0 0; color: var(--ink-soft); }
.crumbs ol { list-style: none; display: flex; flex-wrap: wrap; gap: 0.4rem; padding: 0; margin: 0; }
.crumbs li + li::before { content: "›"; margin-right: 0.4rem; color: var(--gold-deep); }

/* ---------- Utility ---------- */
.small { font-size: 0.92em; color: var(--ink-soft); }
.placeholder-photo {
  border: 2.5px dashed var(--gold); border-radius: var(--radius); background: var(--gold-pale);
  display: flex; align-items: center; justify-content: center; text-align: center;
  color: var(--gold-deep); font-family: var(--sans); font-weight: 600; padding: 2rem; min-height: 320px;
}

/* ---------- Print ---------- */
@media print {
  .site-header, .site-nav, .trust-bar, .cta-band, .site-footer .footer-cols, .no-print { display: none !important; }
  body { background: #fff; color: #000; font-size: 12pt; }
  a { color: #000; text-decoration: none; }
  .card, details.faq { box-shadow: none; }
  details.faq { page-break-inside: avoid; }
  details.faq:not([open]) .answer { display: block; }
}
