/* Keystone Mortgage Group — site styles */
:root {
  --navy: #0E1B2C;
  --navy-2: #14253B;
  --navy-3: #0A1422;
  --ink: #1A2230;
  --body: #2A3240;
  --muted: #5A6472;
  --accent: #0098D8;        /* keystone blue from the logo */
  --accent-light: #33B0E6;
  --accent-dark: #0A6A9C;   /* accessible blue for text on light backgrounds */
  --ivory: #F7F5F0;
  --sand: #EEF1F4;
  --line: #E1E4E8;
  --on-dark: #CBD2DC;
  --on-dark-muted: #B4BDC9;
  --serif: 'Fraunces', Georgia, 'Times New Roman', serif;
  --sans: 'IBM Plex Sans', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --mono: 'IBM Plex Mono', ui-monospace, Menlo, monospace;
  --logo: 'Poppins', 'IBM Plex Sans', system-ui, sans-serif;
  --radius: 6px;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; scroll-padding-top: 96px; }
body {
  margin: 0;
  font-family: var(--sans);
  font-size: 17px;
  line-height: 1.6;
  color: var(--ink);
  background: var(--ivory);
  -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; height: auto; display: block; }
h1, h2, h3, h4, p, figure, blockquote, ul, ol, dl, dd { margin: 0; }
ul { padding: 0; }
a { color: var(--navy); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 2px; }

.wrap { max-width: 1200px; margin: 0 auto; padding: 0 24px; }
.section { padding: 104px 0; }
.section-tight { padding: 80px 0; }
.bg-navy { background: var(--navy); color: var(--ivory); }
.bg-sand { background: var(--sand); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.bg-white { background: #fff; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }

.skip-link { position: absolute; left: -9999px; top: 12px; z-index: 100; background: #fff; color: var(--navy); padding: 10px 16px; border-radius: 4px; font-weight: 600; }
.skip-link:focus { left: 12px; }

/* ---------- Type ---------- */
.eyebrow {
  font-family: var(--mono);
  font-size: 13px;
  letter-spacing: .2em;
  text-transform: uppercase;
  color: var(--accent-dark);
  margin-bottom: 14px;
}
.bg-navy .eyebrow, .hero .eyebrow, .page-hero .eyebrow { color: var(--accent-light); }
.display {
  font-family: var(--serif);
  font-weight: 400;
  font-size: clamp(40px, 5.4vw, 68px);
  line-height: 1.05;
  letter-spacing: -.015em;
  margin-bottom: 24px;
}
.h2 {
  font-family: var(--serif);
  font-weight: 400;
  font-size: clamp(32px, 3.6vw, 46px);
  line-height: 1.1;
  letter-spacing: -.01em;
  color: var(--navy);
}
.bg-navy .h2 { color: var(--ivory); }
.lede { font-size: 19px; color: var(--on-dark); max-width: 580px; }
.lede-dark { font-size: 19px; color: var(--body); max-width: 640px; }
.prose p { font-size: 18px; color: var(--body); }
.prose p + p { margin-top: 18px; }

/* ---------- Buttons ---------- */
.btn-row { display: flex; flex-wrap: wrap; gap: 14px; }
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  min-height: 48px;
  padding: 14px 26px;
  border-radius: 4px;
  border: 1px solid transparent;
  font: 600 16px/1.2 var(--sans);
  text-decoration: none;
  cursor: pointer;
  transition: background-color .15s, color .15s, border-color .15s;
}
.btn-accent { background: var(--accent); color: var(--navy); }
.btn-accent:hover { background: var(--accent-light); }
.btn-ghost { border-color: rgba(247,245,240,.45); color: var(--ivory); font-weight: 500; }
.btn-ghost:hover { background: rgba(247,245,240,.08); border-color: var(--ivory); }
.btn-dark { background: var(--navy); color: var(--ivory); }
.btn-dark:hover { background: #1C3150; }
.btn-outline { border-color: var(--navy); color: var(--navy); font-weight: 500; }
.btn-outline:hover { background: var(--navy); color: var(--ivory); }
.btn-sm { min-height: 44px; padding: 10px 20px; font-size: 15px; }
.text-link { font-weight: 600; color: var(--navy); text-decoration: none; padding: 8px 0; border-bottom: 2px solid var(--accent); }
.text-link:hover { color: var(--accent-dark); }

/* ---------- Header ---------- */
.site-header { position: sticky; top: 0; z-index: 50; background: var(--navy); border-bottom: 1px solid rgba(0,152,216,.25); }
.nav { display: flex; align-items: center; justify-content: space-between; gap: 24px; min-height: 78px; }
.brand { display: flex; align-items: center; gap: 12px; color: var(--ivory); text-decoration: none; }
.brand img { width: 52px; height: auto; flex: none; }
.brand-text { display: flex; flex-direction: column; line-height: 1; font-family: var(--logo); }
.brand-name { font-size: 20px; font-weight: 500; letter-spacing: .16em; }
.brand-sub { font-size: 10px; font-weight: 300; letter-spacing: .3em; color: var(--on-dark); margin-top: 6px; }
.nav-menu { display: flex; align-items: center; gap: 28px; list-style: none; }
.nav-menu a:not(.btn) { color: #E6E8EC; text-decoration: none; font-size: 15px; padding: 10px 0; border-bottom: 2px solid transparent; }
.nav-menu a:not(.btn):hover, .nav-menu a[aria-current="page"] { color: #fff; border-bottom-color: var(--accent); }
.nav-phone { font-family: var(--mono); font-size: 14px !important; }
.nav-toggle {
  display: none; align-items: center; justify-content: center;
  width: 44px; height: 44px; padding: 0;
  background: transparent; border: 1px solid rgba(247,245,240,.3); border-radius: 4px;
  color: var(--ivory); cursor: pointer;
}
.nav-toggle .icon-close { display: none; }
.nav-toggle[aria-expanded="true"] .icon-open { display: none; }
.nav-toggle[aria-expanded="true"] .icon-close { display: block; }

@media (max-width: 940px) {
  .nav-toggle { display: inline-flex; }
  .nav-menu {
    display: none;
    position: absolute; top: 100%; left: 0; right: 0;
    flex-direction: column; align-items: stretch; gap: 0;
    background: var(--navy);
    padding: 4px 24px 24px;
    border-bottom: 1px solid rgba(0,152,216,.25);
    box-shadow: 0 16px 32px rgba(10,20,34,.35);
  }
  .nav-menu.is-open { display: flex; }
  .nav-menu li a:not(.btn) { display: block; padding: 14px 0; border-bottom: 1px solid rgba(247,245,240,.1); }
  .nav-menu li a[aria-current="page"] { border-bottom-color: rgba(247,245,240,.1); color: var(--accent-light); }
  .nav-menu .btn { width: 100%; margin-top: 18px; }
}
@media (max-width: 380px) {
  .brand img { width: 44px; }
  .brand-name { font-size: 17px; }
}

/* ---------- Hero ---------- */
.hero { background: var(--navy); color: var(--ivory); }
.hero-inner { padding-top: 104px; padding-bottom: 112px; display: flex; flex-wrap: wrap; align-items: center; gap: 56px; }
.hero-main { flex: 999 1 520px; min-width: 0; }
.hero-side { flex: 1 1 360px; min-width: 0; }
.hero .lede { margin-bottom: 36px; }
.who { background: var(--navy-2); border: 1px solid rgba(0,152,216,.3); border-radius: var(--radius); padding: 32px; }
.who .eyebrow { font-size: 12px; margin-bottom: 8px; }
.who-row { display: flex; gap: 16px; padding: 20px 0; border-top: 1px solid rgba(247,245,240,.12); color: inherit; text-decoration: none; }
.who-row:first-of-type { border-top: 0; }
.who-row:last-child { padding-bottom: 0; }
.who-num { font-family: var(--serif); font-size: 22px; color: var(--accent-light); line-height: 1.25; }
.who-title { font-weight: 600; font-size: 18px; color: var(--ivory); }
a.who-row:hover .who-title { color: var(--accent-light); }
.who-desc { color: var(--on-dark-muted); font-size: 15px; }

.page-hero { background: var(--navy); color: var(--ivory); }
.page-hero .wrap { padding-top: 88px; padding-bottom: 88px; }
.page-hero .display { font-size: clamp(38px, 4.8vw, 60px); max-width: 860px; }
.page-hero .lede { max-width: 640px; }

/* ---------- Layout helpers ---------- */
.section-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: flex-end; gap: 24px; margin-bottom: 52px; }
.section-head > div { max-width: 660px; }
.grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(290px, 1fr)); gap: 24px; }
.split { display: flex; flex-wrap: wrap; align-items: center; gap: 72px; }
.split-main { flex: 999 1 480px; min-width: 0; }
.split-side { flex: 1 1 300px; min-width: 0; max-width: 400px; }

/* ---------- Cards ---------- */
.card { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 36px 32px; display: flex; flex-direction: column; }
.card-dark { background: var(--navy); border-color: var(--navy); color: var(--ivory); }
.card h3 { font-family: var(--serif); font-weight: 500; font-size: 26px; line-height: 1.2; color: var(--navy); margin-bottom: 6px; }
.card-dark h3 { color: var(--ivory); }
.card-sub { color: var(--muted); font-size: 15px; margin-bottom: 6px; }
.card-dark .card-sub { color: var(--on-dark-muted); }
.card-item { margin-top: 18px; }
.card-item-title { font-weight: 600; }
.card-dark .card-item-title { color: var(--accent-light); }
.card-item-desc { color: var(--muted); font-size: 15px; }
.card-dark .card-item-desc { color: var(--on-dark); }
.card-foot { margin-top: auto; padding-top: 28px; }
.card-foot a { font-weight: 600; font-size: 15px; text-decoration: none; border-bottom: 2px solid var(--accent); padding: 6px 0; }
.card-dark .card-foot a { color: var(--ivory); }

/* ---------- Steps ---------- */
.steps { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 40px; }
.step-num { font-family: var(--serif); font-size: 44px; line-height: 1; color: var(--accent-dark); margin-bottom: 18px; }
.step h3 { font-size: 20px; font-weight: 600; color: var(--navy); margin-bottom: 8px; }
.step p { color: #4A5462; }

/* ---------- Bio ---------- */
.headshot-frame { position: relative; width: 100%; max-width: 380px; aspect-ratio: 1; margin: 0 auto; }
.headshot-frame::before { content: ""; position: absolute; inset: -14px; border: 1px solid var(--accent); border-radius: 50%; }
.headshot { width: 100%; height: 100%; object-fit: cover; border-radius: 50%; background: var(--line); box-shadow: 0 24px 48px rgba(14,27,44,.14); }
.bio-meta { font-family: var(--mono); font-size: 14px; color: var(--muted); margin: 10px 0 28px; }
.facts { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 0; border-top: 1px solid var(--line); margin: 32px 0 36px; }
.fact { padding: 18px 20px 0 0; }
.fact dt { font-family: var(--mono); font-size: 12px; letter-spacing: .16em; text-transform: uppercase; color: var(--accent-dark); }
.fact dd { font-size: 16px; color: var(--ink); font-weight: 500; margin-top: 4px; }

/* ---------- Values (about) ---------- */
.value { border-top: 2px solid var(--accent); padding-top: 24px; }
.value h3 { font-family: var(--serif); font-weight: 500; font-size: 26px; color: var(--navy); margin-bottom: 10px; }
.value p { color: var(--body); }

/* ---------- Reviews band ---------- */
.reviews-band { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 32px; }
.stars { color: var(--accent); letter-spacing: 4px; font-size: 20px; margin-bottom: 10px; }
.review { background: var(--ivory); border-radius: var(--radius); padding: 32px; }
.review blockquote { font-family: var(--serif); font-size: 20px; line-height: 1.45; color: var(--navy); margin-bottom: 18px; }
.review figcaption { font-size: 14px; color: var(--muted); }

/* ---------- CTA band ---------- */
.cta-band { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 32px; }
.cta-band > div:first-child { max-width: 640px; }
.cta-band p { color: var(--on-dark); font-size: 18px; margin-top: 14px; }

/* ---------- Loans page ---------- */
.jump { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 16px; }
.jump a {
  display: flex; flex-direction: column; gap: 4px;
  padding: 22px 24px; border-radius: var(--radius);
  background: var(--navy-2); border: 1px solid rgba(0,152,216,.28);
  color: var(--ivory); text-decoration: none;
  transition: border-color .15s, background-color .15s;
}
.jump a:hover { border-color: var(--accent); background: #182C45; }
.jump-label { font-family: var(--mono); font-size: 12px; letter-spacing: .16em; text-transform: uppercase; color: var(--accent-light); }
.jump-title { font-weight: 600; font-size: 18px; }

.program-group { padding: 88px 0; border-top: 1px solid var(--line); }
.program-group:first-child { border-top: 0; }
.program-group-head { display: flex; flex-wrap: wrap; gap: 16px 64px; margin-bottom: 40px; }
.program-group-head > div:first-child { flex: 1 1 320px; }
.program-group-head > p { flex: 1 1 420px; color: var(--body); font-size: 18px; align-self: flex-end; }
.program { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 32px; display: flex; flex-direction: column; }
.program h3 { font-family: var(--serif); font-weight: 500; font-size: 26px; color: var(--navy); margin-bottom: 8px; }
.program > p { color: var(--body); margin-bottom: 20px; }
.checks { list-style: none; display: flex; flex-direction: column; gap: 10px; margin-bottom: 4px; }
.checks li { position: relative; padding-left: 28px; font-size: 15px; color: var(--body); }
.checks li::before {
  content: ""; position: absolute; left: 2px; top: 7px;
  width: 12px; height: 7px;
  border-left: 2px solid var(--accent-dark); border-bottom: 2px solid var(--accent-dark);
  transform: rotate(-45deg);
}
.program-featured { background: var(--navy); border-color: var(--navy); }
.program-featured h3 { color: var(--ivory); }
.program-featured > p, .program-featured .checks li { color: var(--on-dark); }
.program-featured .checks li::before { border-color: var(--accent-light); }
.tag { align-self: flex-start; font-family: var(--mono); font-size: 11px; letter-spacing: .16em; text-transform: uppercase; color: var(--navy); background: var(--accent); padding: 4px 10px; border-radius: 3px; margin-bottom: 16px; }

.disclaimer { font-size: 14px; color: var(--muted); max-width: 860px; }

/* ---------- Contact ---------- */
.contact-grid { display: flex; flex-wrap: wrap; gap: 56px; align-items: flex-start; }
.contact-info { flex: 1 1 300px; min-width: 0; }
.contact-form-wrap { flex: 999 1 520px; min-width: 0; }
.contact-person { display: flex; align-items: center; gap: 18px; margin-top: 28px; }
.contact-person img { width: 76px; height: 76px; border-radius: 50%; object-fit: cover; }
.contact-person strong { display: block; font-size: 18px; color: var(--navy); }
.contact-person span { font-size: 14px; color: var(--muted); }
.contact-list { list-style: none; display: flex; flex-direction: column; gap: 0; border-top: 1px solid var(--line); margin-top: 28px; }
.contact-list li { padding: 18px 0; border-bottom: 1px solid var(--line); }
.contact-list .label { display: block; font-family: var(--mono); font-size: 12px; letter-spacing: .16em; text-transform: uppercase; color: var(--accent-dark); margin-bottom: 4px; }
.contact-list a { font-size: 18px; font-weight: 500; text-decoration: none; }
.contact-list a:hover { color: var(--accent-dark); }
.form-card { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 40px; }
.form-card h2 { font-family: var(--serif); font-weight: 400; font-size: 32px; color: var(--navy); margin-bottom: 6px; }
.form-card > p { color: var(--muted); margin-bottom: 28px; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; }
.form-grid .full { grid-column: 1 / -1; }
.field label { display: block; font-size: 14px; font-weight: 600; color: var(--ink); margin-bottom: 6px; }
.field .opt { font-weight: 400; color: var(--muted); }
.field input, .field select, .field textarea {
  width: 100%; min-height: 48px;
  padding: 12px 14px;
  font: 400 16px/1.4 var(--sans); color: var(--ink);
  background: var(--ivory); border: 1px solid #C9CED6; border-radius: 4px;
  transition: border-color .15s, background-color .15s;
}
.field textarea { min-height: 130px; resize: vertical; }
.field select { appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%235A6472' stroke-width='1.6' fill='none'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 14px center; padding-right: 40px; }
.field input:focus, .field select:focus, .field textarea:focus { outline: none; border-color: var(--navy); background-color: #fff; box-shadow: 0 0 0 3px rgba(0,152,216,.3); }
.check { display: flex; gap: 12px; align-items: flex-start; font-size: 14px; color: var(--body); }
.check input { width: 20px; height: 20px; margin: 2px 0 0; accent-color: var(--navy); flex: none; }
.form-note { font-size: 13px; color: var(--muted); }
.hidden { position: absolute !important; left: -9999px !important; }
@media (max-width: 600px) {
  .form-grid { grid-template-columns: minmax(0, 1fr); }
  .form-card { padding: 28px 20px; }
}

/* ---------- Legal ---------- */
.legal { max-width: 780px; }
.legal h2 { font-family: var(--serif); font-weight: 500; font-size: 26px; color: var(--navy); margin: 44px 0 12px; }
.legal p, .legal li { color: var(--body); }
.legal p + p { margin-top: 14px; }
.legal ul { padding-left: 22px; margin-top: 12px; display: flex; flex-direction: column; gap: 8px; }
.legal address { font-style: normal; margin-top: 12px; color: var(--body); }

/* ---------- Footer ---------- */
.site-footer { background: var(--navy-3); color: var(--on-dark-muted); font-size: 15px; }
.site-footer a { color: #E6E8EC; text-decoration: none; }
.site-footer a:hover { color: var(--accent-light); }
.footer-cols { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 40px; padding: 72px 0 40px; border-bottom: 1px solid rgba(247,245,240,.12); }
.footer-col { display: flex; flex-direction: column; gap: 8px; }
.footer-logo { width: 190px; margin-bottom: 10px; }
.footer-label { font-family: var(--mono); font-size: 12px; letter-spacing: .2em; text-transform: uppercase; color: var(--accent-light); margin-bottom: 6px; }
.footer-legal { padding: 28px 0 40px; font-size: 13px; color: #8E98A6; display: flex; flex-direction: column; gap: 18px; }
.footer-legal-row { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 16px; }
.eho { display: flex; align-items: center; gap: 10px; color: var(--on-dark-muted); }

@media (max-width: 640px) {
  body { font-size: 16px; }
  .section { padding: 76px 0; }
  .hero-inner { padding-top: 72px; padding-bottom: 80px; gap: 44px; }
  .page-hero .wrap { padding-top: 64px; padding-bottom: 64px; }
  .program-group { padding: 64px 0; }
  .split { gap: 56px; }
  .headshot-frame { max-width: 280px; }
  .who { padding: 24px; }
  .card, .program { padding: 28px 24px; }
  .btn-row .btn { flex: 1 1 auto; }
}
