/* ==========================================================================
   Garrett Myers | Elev8 Mortgage
   Built on the Elev8 Mortgage design system.
   Every value below comes from a token. Change a token, not a rule.
   ========================================================================== */

:root {
  color-scheme: light;

  /* --- brand, taken from the Elev8 logo ------------------------------- */
  --brand-navy:      #16205b;
  --brand-navy-700:  #111946;
  --brand-navy-900:  #0b102d;
  --brand-cyan:      #31d1ff;   /* rules, fills, 24px+ only. Never small text on light. */
  --accent-ink:      #00789b;   /* cyan when it has to be readable. 5.05:1 on white. */

  /* --- surfaces -------------------------------------------------------- */
  --surface:         #ffffff;
  --surface-sunken:  #f2f2f2;
  --surface-raised:  #ffffff;
  --surface-brand:   #16205b;
  --surface-tint:    #f2f3fa;

  /* --- ink ------------------------------------------------------------- */
  --ink:             #0a0a0a;
  --ink-muted:       #666c93;
  --ink-on-brand:    #ffffff;

  /* --- action ---------------------------------------------------------- */
  --action:          #16205b;
  --action-hover:    #111946;
  --ink-on-action:   #ffffff;

  /* --- lines and focus -------------------------------------------------- */
  --line:            #d6d9ea;
  --line-strong:     #8b92c0;
  --focus:           #00789b;

  /* --- shape ------------------------------------------------------------ */
  --radius-sharp:    1px;    /* buttons. Elev8 buttons are square. Do not round them. */
  --radius-card:     10px;
  --radius-pill:     100px;

  /* --- space ------------------------------------------------------------ */
  --space-1: 4px;  --space-2: 8px;  --space-3: 12px; --space-4: 16px;
  --space-5: 24px; --space-6: 32px; --space-7: 48px; --space-8: 64px; --space-9: 96px;
  --container: 1080px;

  /* --- elevation, used sparingly ---------------------------------------- */
  --shadow-sm: 0 1px 2px rgba(11, 16, 45, .06);
  --shadow-md: 0 8px 24px rgba(11, 16, 45, .10);

  --font-sans: "Plus Jakarta Sans", ui-sans-serif, system-ui, -apple-system,
               "Segoe UI", Roboto, sans-serif;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --surface:        #0b102d;
    --surface-sunken: #070b20;
    --surface-raised: #141b3f;
    --surface-tint:   #141b3f;
    --ink:            #eef0f8;
    --ink-muted:      #a8b0d4;
    --accent-ink:     #7ee0ff;
    --action:         #31d1ff;
    --action-hover:   #7ee0ff;
    --ink-on-action:  #0b102d;
    --line:           #26305f;
    --line-strong:    #7c88c4;
    --focus:          #31d1ff;
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, .5);
    --shadow-md: 0 10px 30px rgba(0, 0, 0, .55);
  }
}

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

html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--surface);
  color: var(--ink);
  font-family: var(--font-sans);
  font-size: 18px;
  line-height: 32px;
  -webkit-font-smoothing: antialiased;
}

/* Headings sit at weight 500, not 700. This is the brand's signature and the
   thing most often lost when someone rebuilds a page from memory. */
h1, h2, h3, h4 {
  color: var(--brand-navy);
  font-weight: 500;
  margin: 0 0 .5em;
  text-wrap: balance;
}
h1 { font-size: 46px; line-height: 56px; letter-spacing: -.015em; }
h2 { font-size: 28px; line-height: 38px; margin-top: var(--space-7); }
h3 { font-size: 24px; line-height: 32px; margin-top: var(--space-6); }
h4 { font-size: 19px; line-height: 28px; font-weight: 600; }

/* The brand navy is a constant, so on a dark ground it sits on itself.
   Headings take ink there instead. */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) h1,
  :root:not([data-theme="light"]) h2,
  :root:not([data-theme="light"]) h3,
  :root:not([data-theme="light"]) h4 { color: var(--ink); }
}

p  { margin: 0 0 var(--space-5); }
ul, ol { margin: 0 0 var(--space-5); padding-left: 1.3em; }
li { margin-bottom: var(--space-2); }
li::marker { color: var(--accent-ink); }

a  { color: var(--accent-ink); text-decoration: underline; text-underline-offset: 3px; }
a:hover { color: var(--brand-navy); }

:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }

.wrap { max-width: var(--container); margin: 0 auto; padding-inline: var(--space-4); }

.lead { font-size: 20px; line-height: 34px; color: var(--ink-muted); }

/* ---------- Header ---------- */
.site-header {
  background: var(--surface);
  border-bottom: 1px solid var(--line);
  position: sticky; top: 0; z-index: 50;
}
.site-header .wrap {
  display: flex; align-items: center; justify-content: space-between;
  gap: var(--space-5); min-height: 76px; flex-wrap: nowrap;
  padding-block: var(--space-3);
}
.brand {
  display: flex; align-items: center; gap: var(--space-3);
  text-decoration: none; flex: 0 1 auto; min-width: 0;
}
.brand img { height: 34px; width: auto; display: block; flex: 0 0 auto; }
.brand-text {
  font-weight: 600; color: var(--brand-navy);
  font-size: 16px; line-height: 22px; white-space: nowrap;
}
.brand-text span {
  display: block; font-weight: 500; font-size: 12px; line-height: 18px;
  color: var(--ink-muted);
}
/* The Elev8 mark is a two-ink logo: its navy half vanishes on a dark ground.
   Until Elev8 marketing supplies a reversed lockup, it sits on a white plate
   in dark theme, which keeps both brand inks correct. */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .brand-text { color: var(--ink); }
  :root:not([data-theme="light"]) .brand img {
    background: #fff; padding: 6px 10px; border-radius: var(--radius-card);
    box-sizing: content-box;
  }
}

.site-nav { display: flex; gap: var(--space-4); align-items: center; flex-wrap: wrap;
             flex: 1 1 auto; justify-content: flex-end; }
.site-nav a {
  text-decoration: none; font-size: 14px; line-height: 22px;
  font-weight: 500; color: var(--ink);
}
.site-nav a:hover, .site-nav a[aria-current="page"] { color: var(--accent-ink); }

.site-header .btn { flex: 0 0 auto; white-space: nowrap; padding: 13px 24px; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-block; border: 0; cursor: pointer; text-decoration: none;
  font-family: var(--font-sans); font-size: 14px; font-weight: 500; line-height: 1;
  padding: 15px 35px; border-radius: var(--radius-sharp);
  background: var(--action); color: var(--ink-on-action);
  transition: background .14s ease;
}
.btn:hover { background: var(--action-hover); color: var(--ink-on-action); }

.btn-outline {
  background: transparent; color: var(--ink);
  border: 2px solid var(--line-strong); padding: 13px 33px;
}
.btn-outline:hover { background: transparent; border-color: var(--action); color: var(--action); }

/* ---------- Hero ---------- */
.hero {
  background: var(--surface-brand); color: var(--ink-on-brand);
  padding-block: var(--space-9) var(--space-8);
}
.hero h1 { color: var(--ink-on-brand); font-size: 58px; line-height: 68px; max-width: 18ch; }
.hero .lead { color: #c9d6e6; max-width: 58ch; }
.hero-grid { display: grid; grid-template-columns: 1.4fr .85fr; gap: var(--space-7); align-items: center; }
.hero-photo img { width: 100%; border-radius: var(--radius-card); display: block; }
.hero-cta { display: flex; gap: var(--space-3); flex-wrap: wrap; margin-top: var(--space-6); }
.hero .btn { background: var(--brand-cyan); color: var(--brand-navy-900); }
.hero .btn:hover { background: #7ee0ff; }
.hero .btn-outline { background: transparent; color: var(--ink-on-brand); border-color: var(--ink-on-brand); }
.hero .btn-outline:hover { background: var(--ink-on-brand); color: var(--brand-navy); }

.photo-hint { display: none; }
.hero-photo.is-empty {
  border: 2px dashed #3a5171; border-radius: var(--radius-card);
  min-height: 280px; display: flex; align-items: center; justify-content: center;
}
.hero-photo.is-empty .photo-hint {
  display: block; text-align: center; color: #8aa2bf;
  font-size: 13px; line-height: 20px; margin: 0; padding: var(--space-4);
}
.hero-photo.is-empty code { color: #c9d6e6; font-size: 13px; }

/* ---------- Proof bar ---------- */
.proof {
  background: var(--surface-sunken);
  border-bottom: 1px solid var(--line);
  padding-block: var(--space-5);
}
.proof-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: var(--space-5); text-align: center; }
.proof-item strong {
  display: block; font-size: 28px; line-height: 38px; font-weight: 500;
  color: var(--brand-navy); font-variant-numeric: tabular-nums;
}
.proof-item span { font-size: 14px; line-height: 22px; font-weight: 500; color: var(--ink-muted); }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .proof-item strong { color: var(--accent-ink); }
}

/* ---------- Sections ---------- */
section { padding-block: var(--space-8); }
section.tight { padding-block: var(--space-6); }
section.soft { background: var(--surface-sunken); }
section > .wrap > h1:first-child,
section > .wrap > h2:first-child { margin-top: 0; }

.cols-2 { display: grid; grid-template-columns: 1fr 1fr; gap: var(--space-6); }
.cols-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--space-6); }

/* ---------- Card ---------- */
.card {
  background: var(--surface-raised);
  border: 1px solid var(--line);
  border-radius: var(--radius-card);
  padding: var(--space-5);
}
.card h3 { margin-top: 0; }
.card p { font-size: 17px; line-height: 28px; color: var(--ink-muted); }
.card p:last-child { margin-bottom: 0; }

/* ---------- Review ---------- */
.review {
  border-left: 3px solid var(--brand-cyan);
  padding: var(--space-1) 0 var(--space-1) var(--space-5);
  margin: 0 0 var(--space-5); max-width: 62ch;
}
.review p { margin-bottom: var(--space-2); }
.review cite { font-style: normal; font-size: 14px; line-height: 22px; color: var(--ink-muted); }

/* ---------- FAQ ---------- */
.faq-item { border-bottom: 1px solid var(--line); padding-block: var(--space-5); }
.faq-item:last-child { border-bottom: 0; }
.faq-item h3 { margin: 0 0 var(--space-2); font-size: 19px; line-height: 28px; font-weight: 600; }
.faq-item p:last-child { margin-bottom: 0; }

/* ---------- Callout ---------- */
.callout {
  background: var(--surface-tint);
  border: 1px solid var(--line);
  border-radius: var(--radius-card);
  padding: var(--space-5); margin-block: var(--space-6);
  max-width: 66ch;
}
.callout p { font-size: 17px; line-height: 28px; }
.callout p:last-child { margin-bottom: 0; }
.callout strong { color: var(--brand-navy); font-weight: 600; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .callout strong { color: var(--accent-ink); }
}

/* ---------- CTA band ---------- */
.cta-band {
  background: var(--surface-brand); color: var(--ink-on-brand);
  padding-block: var(--space-8); text-align: center;
}
.cta-band h2 { color: var(--ink-on-brand); margin-top: 0; }
.cta-band p { color: #c9d6e6; max-width: 54ch; margin-inline: auto; }
.cta-band .btn { background: var(--brand-cyan); color: var(--brand-navy-900); }
.cta-band .btn:hover { background: #7ee0ff; }

/* ---------- Footer ---------- */
.site-footer {
  background: var(--brand-navy-900); color: #9fb0c6;
  padding-block: var(--space-7) var(--space-6);
  font-size: 13px; line-height: 20px;
}
.site-footer a { color: #cddcec; }
.site-footer h4 { color: #fff; margin: 0 0 var(--space-2); }
.footer-grid { display: grid; grid-template-columns: 1.4fr 1fr 1fr; gap: var(--space-6); }
.footer-grid p { margin-bottom: var(--space-3); }
.footer-legal {
  border-top: 1px solid #1e3554; margin-top: var(--space-6); padding-top: var(--space-5);
  font-size: 12px; line-height: 19px; color: #8398b1;
}
.footer-legal p { margin: 0 0 var(--space-2); }
.eho { display: flex; align-items: flex-start; gap: var(--space-3); }
.eho svg { flex: 0 0 auto; margin-top: 2px; }

/* ---------- Utility ---------- */
.mt0 { margin-top: 0; }
.center { text-align: center; }
.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;
}

/* ---------- Mobile ---------- */
@media (max-width: 860px) {
  body { font-size: 17px; line-height: 29px; }
  h1 { font-size: 34px; line-height: 42px; }
  h2 { font-size: 24px; line-height: 32px; }
  h3 { font-size: 20px; line-height: 28px; }
  .lead { font-size: 18px; line-height: 30px; }
  .hero { padding-block: var(--space-7) var(--space-6); }
  .hero h1 { font-size: 34px; line-height: 42px; }
  .hero-grid, .cols-2, .cols-3, .footer-grid { grid-template-columns: 1fr; gap: var(--space-5); }
  .hero-photo { order: -1; max-width: 280px; }
  .proof-grid { grid-template-columns: 1fr 1fr; gap: var(--space-4); }
  .site-header .wrap { min-height: 0; flex-wrap: wrap; }
  .site-nav { gap: var(--space-4); justify-content: flex-start; }
  .brand img { height: 30px; }
  section { padding-block: var(--space-7); }
}

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

/* ---------- Nav dropdown ---------- */
.nav-dropdown { position: relative; display: flex; align-items: center; }

.nav-dropdown-toggle {
  background: none; border: none; cursor: pointer; padding: 0;
  font-family: var(--font-sans); font-size: 14px; line-height: 22px;
  font-weight: 500; color: var(--ink);
  display: flex; align-items: center; gap: 4px;
}
.nav-dropdown-toggle:hover { color: var(--accent-ink); }
.nav-dropdown-toggle[aria-expanded="true"] { color: var(--accent-ink); }

.nav-dropdown-menu {
  display: none; position: absolute; top: calc(100% + 12px); left: 50%;
  transform: translateX(-50%);
  background: var(--surface-raised); border: 1px solid var(--line);
  border-radius: var(--radius-card); box-shadow: var(--shadow-md);
  padding: var(--space-2); min-width: 160px; z-index: 100;
}
.nav-dropdown-menu a {
  display: block; padding: var(--space-2) var(--space-4);
  text-decoration: none; font-size: 14px; font-weight: 500;
  color: var(--ink); border-radius: 6px; white-space: nowrap;
}
.nav-dropdown-menu a:hover,
.nav-dropdown-menu a[aria-current="page"] { 
  background: var(--surface-tint); color: var(--accent-ink); 
}
.nav-dropdown-toggle[aria-expanded="true"] + .nav-dropdown-menu { display: block; }

@media (max-width: 860px) {
  .nav-dropdown { width: 100%; }
  .nav-dropdown-toggle { width: 100%; justify-content: flex-start; }
  .nav-dropdown-menu {
    position: static; transform: none; box-shadow: none;
    border: none; border-left: 2px solid var(--line);
    border-radius: 0; padding: 0 0 0 var(--space-4);
    margin-top: var(--space-1);
  }
}

/* ---------- Compact mobile header ----------
   Row 1: logo + name on the left, Apply now on the right.
   Row 2: every page link on one line that scrolls sideways.
   On mobile the city links sit inline instead of in the dropdown. */
@media (max-width: 860px) {
  .site-header .wrap {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    grid-template-areas: "brand btn" "nav nav";
    align-items: center;
    gap: var(--space-2) var(--space-3);
    padding-block: var(--space-2);
  }
  .brand { grid-area: brand; gap: var(--space-2); }
  .brand img { height: 24px; }
  .brand-text { font-size: 14px; line-height: 18px; white-space: normal; }
  .brand-text span { font-size: 11px; line-height: 15px; }
  .site-header .btn { grid-area: btn; padding: 10px 14px; font-size: 13px; }

  .site-nav {
    grid-area: nav;
    flex-wrap: nowrap;
    justify-content: flex-start;
    gap: var(--space-4);
    overflow-x: auto;
    scrollbar-width: none;
    -webkit-overflow-scrolling: touch;
    padding-bottom: 2px;
    -webkit-mask-image: linear-gradient(to right, #000 88%, transparent);
            mask-image: linear-gradient(to right, #000 88%, transparent);
  }
  .site-nav::-webkit-scrollbar { display: none; }
  .site-nav a { white-space: nowrap; font-size: 14px; }

  .nav-dropdown { width: auto; display: contents; }
  .nav-dropdown-toggle { display: none; }
  .nav-dropdown-menu,
  .nav-dropdown-toggle[aria-expanded="true"] + .nav-dropdown-menu {
    display: contents;
  }
  .nav-dropdown-menu a { padding: 0; background: none; border-radius: 0; }
  .nav-dropdown-menu a[aria-current="page"] { background: none; }
}
