/* ============================================================
   The Doctor Loan Guy — Trace Kuhn, Fifth Third Bank
   Design tokens + base + components
   ============================================================ */

@import url('https://api.fontshare.com/v2/css?f[]=general-sans@400,500,600,700&display=swap');

:root,
[data-theme='light'] {
  /* Surfaces — cream */
  --color-bg: #faf6ec;
  --color-surface: #ffffff;
  --color-surface-2: #f4eddb;
  --color-surface-offset: #eee4cb;
  --color-divider: #e2d6b8;
  --color-border: #d6c79e;

  /* Text — navy */
  --color-text: #12233f;
  --color-text-muted: #55647a;
  --color-text-faint: #93a0b2;
  --color-text-inverse: #faf6ec;

  /* Navy (brand dark) */
  --color-navy: #0e2340;
  --color-navy-2: #163259;
  --color-navy-3: #1d3f6b;

  /* Gold (brand accent / CTA) */
  --color-gold: #c6952e;
  --color-gold-hover: #a97d22;
  --color-gold-active: #8c6519;
  --color-gold-highlight: #f1e3c2;

  --color-primary: var(--color-gold);
  --color-primary-hover: var(--color-gold-hover);
  --color-primary-active: var(--color-gold-active);
  --color-primary-highlight: var(--color-gold-highlight);

  --color-success: #3f7a4e;
  --color-error: #9b3a3a;

  --radius-sm: 0.375rem;
  --radius-md: 0.6rem;
  --radius-lg: 1rem;
  --radius-xl: 1.5rem;
  --radius-full: 9999px;

  --transition-interactive: 180ms cubic-bezier(0.16, 1, 0.3, 1);

  --shadow-sm: 0 1px 2px rgba(14, 35, 64, 0.08);
  --shadow-md: 0 8px 24px rgba(14, 35, 64, 0.1);
  --shadow-lg: 0 20px 48px rgba(14, 35, 64, 0.16);

  --content-narrow: 640px;
  --content-default: 960px;
  --content-wide: 1200px;
  --content-full: 100%;

  --font-display: 'Fraunces', Georgia, serif;
  --font-body: 'General Sans', 'Inter', sans-serif;
}

[data-theme='dark'] {
  --color-bg: #0b1a2e;
  --color-surface: #102338;
  --color-surface-2: #14293f;
  --color-surface-offset: #0f2036;
  --color-divider: #1e3550;
  --color-border: #294263;

  --color-text: #ede6d2;
  --color-text-muted: #a9b6c7;
  --color-text-faint: #71839c;
  --color-text-inverse: #10233f;

  --color-navy: #0b1a2e;
  --color-navy-2: #0f2338;
  --color-navy-3: #16324f;

  --color-gold: #e3b24c;
  --color-gold-hover: #f0c468;
  --color-gold-active: #f6d488;
  --color-gold-highlight: #3a3018;

  --color-primary: var(--color-gold);
  --color-primary-hover: var(--color-gold-hover);
  --color-primary-active: var(--color-gold-active);
  --color-primary-highlight: var(--color-gold-highlight);

  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.3);
  --shadow-md: 0 8px 24px rgba(0, 0, 0, 0.35);
  --shadow-lg: 0 20px 48px rgba(0, 0, 0, 0.45);
}

/* ---------------- Type scale ---------------- */
:root {
  --text-xs: clamp(0.75rem, 0.7rem + 0.25vw, 0.875rem);
  --text-sm: clamp(0.875rem, 0.8rem + 0.35vw, 1rem);
  --text-base: clamp(1rem, 0.95rem + 0.25vw, 1.125rem);
  --text-lg: clamp(1.125rem, 1rem + 0.75vw, 1.5rem);
  --text-xl: clamp(1.5rem, 1.2rem + 1.25vw, 2.25rem);
  --text-2xl: clamp(2rem, 1.2rem + 2.5vw, 3.25rem);
  --text-3xl: clamp(2.5rem, 1rem + 4vw, 4.5rem);

  --space-1: 0.25rem;
  --space-2: 0.5rem;
  --space-3: 0.75rem;
  --space-4: 1rem;
  --space-5: 1.25rem;
  --space-6: 1.5rem;
  --space-8: 2rem;
  --space-10: 2.5rem;
  --space-12: 3rem;
  --space-16: 4rem;
  --space-20: 5rem;
  --space-24: 6rem;
  --space-32: 8rem;
}

/* ---------------- Base ---------------- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html {
  -webkit-text-size-adjust: none;
  text-size-adjust: none;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  scroll-behavior: smooth;
  scroll-padding-top: 5.5rem;
}

body {
  min-height: 100dvh;
  line-height: 1.65;
  font-family: var(--font-body);
  font-size: var(--text-base);
  color: var(--color-text);
  background-color: var(--color-bg);
}

img, picture, video, svg { display: block; max-width: 100%; height: auto; }
ul[role='list'], ol[role='list'] { list-style: none; }
input, button, textarea, select { font: inherit; color: inherit; }

h1, h2, h3, h4 { font-family: var(--font-display); text-wrap: balance; line-height: 1.15; font-weight: 600; letter-spacing: -0.01em; }
p, li, figcaption { text-wrap: pretty; max-width: 68ch; }

a { color: inherit; text-decoration: none; }

::selection { background: color-mix(in oklab, var(--color-gold) 30%, transparent); }

:focus-visible { outline: 2px solid var(--color-gold); outline-offset: 3px; border-radius: var(--radius-sm); }

button { cursor: pointer; background: none; border: none; }

a, button, [role='button'], input {
  transition: color var(--transition-interactive), background var(--transition-interactive),
    border-color var(--transition-interactive), box-shadow var(--transition-interactive),
    transform var(--transition-interactive);
}

.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border-width: 0;
}

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

/* ---------------- Layout helpers ---------------- */
.wrap { width: 100%; max-width: var(--content-wide); margin-inline: auto; padding-inline: clamp(1.25rem, 5vw, 3rem); }
.wrap--narrow { max-width: var(--content-default); }
.section { padding-block: clamp(var(--space-16), 8vw, var(--space-32)); }
.section--tight { padding-block: clamp(var(--space-10), 6vw, var(--space-20)); }

.eyebrow {
  display: inline-flex; align-items: center; gap: var(--space-2);
  font-size: var(--text-xs); font-weight: 600; letter-spacing: 0.12em; text-transform: uppercase;
  color: var(--color-gold-active);
}
[data-theme='dark'] .eyebrow { color: var(--color-gold); }

.lede { font-size: var(--text-lg); color: var(--color-text-muted); max-width: 44ch; }

/* ---------------- Header ---------------- */
.header {
  position: sticky; top: 0; z-index: 50;
  background: color-mix(in oklab, var(--color-bg) 90%, transparent);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--color-divider);
  transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}
.header__inner {
  display: flex; align-items: center; justify-content: space-between;
  padding-block: var(--space-4);
}
.brand { display: flex; align-items: center; gap: var(--space-3); }
.brand__mark { width: 38px; height: 38px; color: var(--color-gold); flex-shrink: 0; }
.brand__text { display: flex; flex-direction: column; line-height: 1.05; }
.brand__name { font-family: var(--font-display); font-weight: 600; font-size: var(--text-base); color: var(--color-text); }
.brand__tag { font-size: var(--text-xs); color: var(--color-text-muted); letter-spacing: 0.04em; }

.nav { display: flex; align-items: center; gap: var(--space-8); }
.nav__links { display: flex; gap: var(--space-6); list-style: none; }
.nav__links a { font-size: var(--text-sm); font-weight: 500; color: var(--color-text-muted); }
.nav__links a:hover, .nav__links a.is-active { color: var(--color-text); }
.nav__actions { display: flex; align-items: center; gap: var(--space-3); }

.theme-toggle {
  width: 36px; height: 36px; border-radius: var(--radius-full);
  display: flex; align-items: center; justify-content: center;
  color: var(--color-text-muted); border: 1px solid var(--color-border);
}
.theme-toggle:hover { color: var(--color-text); border-color: var(--color-gold); }

.nav__toggle { display: none; width: 40px; height: 40px; align-items: center; justify-content: center; color: var(--color-text); }
.nav__toggle svg { width: 22px; height: 22px; }

@media (max-width: 860px) {
  .nav__links { display: none; }
  .nav__toggle { display: flex; }
  .header--open .nav__links {
    display: flex; position: absolute; top: 100%; left: 0; right: 0;
    flex-direction: column; gap: 0; background: var(--color-bg);
    border-bottom: 1px solid var(--color-divider); padding: var(--space-4) clamp(1.25rem, 5vw, 3rem);
  }
  .header--open .nav__links a { padding-block: var(--space-3); border-bottom: 1px solid var(--color-divider); }
}

@media (max-width: 560px) {
  .brand__tag { display: none; }
  .nav__actions .btn--gold { display: none; }
  .nav__actions { gap: var(--space-2); }
}

@media (max-width: 400px) {
  .brand__name { font-size: var(--text-sm); }
  .brand__mark { width: 30px; height: 30px; }
}

/* ---------------- Buttons ---------------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: var(--space-2);
  padding: 0.85rem 1.6rem; border-radius: var(--radius-full);
  font-size: var(--text-sm); font-weight: 600; white-space: nowrap;
  border: 1px solid transparent;
}
.btn--gold { background: var(--color-gold); color: var(--color-navy); }
.btn--gold:hover { background: var(--color-gold-hover); transform: translateY(-1px); box-shadow: var(--shadow-md); }
.btn--outline { background: transparent; border-color: var(--color-border); color: var(--color-text); }
.btn--outline:hover { border-color: var(--color-gold); color: var(--color-text); }
.btn--ghost-light { background: color-mix(in oklab, white 14%, transparent); border-color: color-mix(in oklab, white 35%, transparent); color: #fff; }
.btn--ghost-light:hover { background: color-mix(in oklab, white 22%, transparent); }
.btn--block { width: 100%; }
.btn--lg { padding: 1.05rem 2rem; font-size: var(--text-base); }

/* ---------------- Hero ---------------- */
.hero {
  position: relative; min-height: 86vh; display: flex; align-items: center;
  color: #fff; overflow: hidden;
}
.hero__bg {
  position: absolute; inset: 0; background-size: cover; background-position: center;
}
.hero__scrim {
  position: absolute; inset: 0;
  background: linear-gradient(105deg, rgba(10,20,38,0.92) 0%, rgba(10,20,38,0.75) 42%, rgba(10,20,38,0.35) 75%, rgba(10,20,38,0.15) 100%);
}
.hero__content { position: relative; z-index: 2; max-width: 640px; padding-block: var(--space-20); }
.hero__title { font-size: clamp(1.9rem, 1.1rem + 2.6vw, 3rem); color: #fff; margin-bottom: var(--space-6); }
.hero__title em { color: var(--color-gold); font-style: normal; }
.hero__subtitle { font-size: var(--text-lg); color: rgba(250,246,236,0.88); max-width: 46ch; margin-bottom: var(--space-8); }
.hero__actions { display: flex; flex-wrap: wrap; gap: var(--space-4); }
.hero__meta { margin-top: var(--space-10); display: flex; gap: var(--space-8); flex-wrap: wrap; }
.hero__meta-item { font-size: var(--text-xs); color: rgba(250,246,236,0.75); letter-spacing: 0.06em; text-transform: uppercase; }
.hero__meta-item strong { display: block; font-family: var(--font-display); font-size: var(--text-lg); color: var(--color-gold); text-transform: none; letter-spacing: 0; }

/* Page header (non-home hero) */
.pagehead { position: relative; min-height: 46vh; display: flex; align-items: center; color: #fff; overflow: hidden; }
.pagehead__content { position: relative; z-index: 2; max-width: 620px; padding-block: var(--space-20); }
.pagehead__title { font-size: var(--text-2xl); color: #fff; margin-bottom: var(--space-4); }
.pagehead__subtitle { font-size: var(--text-base); color: rgba(250,246,236,0.85); max-width: 48ch; }

/* ---------------- Story / two-col ---------------- */
.split {
  display: grid; grid-template-columns: 1fr 1fr; gap: clamp(2rem, 5vw, 5rem); align-items: center;
}
.split--reverse .split__media { order: 2; }
.split__eyebrow { margin-bottom: var(--space-4); }
.split h2 { font-size: var(--text-xl); margin-bottom: var(--space-5); }
.split p + p { margin-top: var(--space-4); }
.split__media img { border-radius: var(--radius-lg); box-shadow: var(--shadow-lg); }
.split__quote {
  margin-top: var(--space-6); padding-left: var(--space-5); border-left: 3px solid var(--color-gold);
  font-family: var(--font-display); font-size: var(--text-lg); color: var(--color-text);
}
.headshot-frame { display: flex; align-items: center; gap: var(--space-4); margin-top: var(--space-8); }
.headshot-frame img { width: 64px; height: 64px; border-radius: var(--radius-full); object-fit: cover; box-shadow: var(--shadow-md); }
.headshot-frame__name { font-weight: 600; font-family: var(--font-display); }
.headshot-frame__role { font-size: var(--text-xs); color: var(--color-text-muted); }

@media (max-width: 860px) {
  .split { grid-template-columns: 1fr; }
  .split--reverse .split__media { order: -1; }
}

/* ---------------- Cards / grid ---------------- */
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--space-6); }
.grid-2 { display: grid; grid-template-columns: repeat(2, 1fr); gap: var(--space-6); }
@media (max-width: 860px) { .grid-3, .grid-2 { grid-template-columns: 1fr; } }

.card {
  background: var(--color-surface); border: 1px solid var(--color-divider);
  border-radius: var(--radius-lg); padding: var(--space-8);
}
.card__icon {
  width: 44px; height: 44px; border-radius: var(--radius-md);
  background: var(--color-gold-highlight); color: var(--color-gold-active);
  display: flex; align-items: center; justify-content: center; margin-bottom: var(--space-5);
}
.card__icon svg { width: 22px; height: 22px; }
.card h3 { font-size: var(--text-lg); margin-bottom: var(--space-3); }
.card p { color: var(--color-text-muted); font-size: var(--text-sm); }

/* Steps */
.steps { display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--space-8); counter-reset: step; }
@media (max-width: 860px) { .steps { grid-template-columns: 1fr; } }
.step { position: relative; padding-top: var(--space-10); }
.step__num {
  position: absolute; top: 0; left: 0; font-family: var(--font-display); font-size: var(--text-lg);
  width: 44px; height: 44px; border-radius: var(--radius-full); border: 1px solid var(--color-gold);
  color: var(--color-gold-active); display: flex; align-items: center; justify-content: center;
}
[data-theme='dark'] .step__num { color: var(--color-gold); }
.step h3 { font-size: var(--text-base); margin-bottom: var(--space-2); }
.step p { font-size: var(--text-sm); color: var(--color-text-muted); }

/* Program comparison cards */
.program-card {
  background: var(--color-surface); border: 1px solid var(--color-divider); border-radius: var(--radius-lg);
  padding: var(--space-8); display: flex; flex-direction: column; height: 100%;
}
.program-card--featured { border-color: var(--color-gold); box-shadow: var(--shadow-md); position: relative; }
.program-card__badge {
  display: inline-flex; font-size: var(--text-xs); font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase;
  color: var(--color-gold-active); background: var(--color-gold-highlight); padding: 0.3rem 0.7rem; border-radius: var(--radius-full);
  margin-bottom: var(--space-4); width: fit-content;
}
.program-card h3 { font-size: var(--text-lg); margin-bottom: var(--space-2); }
.program-card__desc { color: var(--color-text-muted); font-size: var(--text-sm); margin-bottom: var(--space-5); }
.program-card ul { display: flex; flex-direction: column; gap: var(--space-3); margin-top: auto; }
.program-card li { display: flex; gap: var(--space-3); font-size: var(--text-sm); align-items: flex-start; }
.program-card li svg { width: 18px; height: 18px; flex-shrink: 0; margin-top: 0.15rem; color: var(--color-gold-active); }
[data-theme='dark'] .program-card li svg { color: var(--color-gold); }

/* ---------------- Band / CTA ---------------- */
.band {
  background: var(--color-navy); color: var(--color-text-inverse);
  border-radius: var(--radius-xl); padding: clamp(2.5rem, 6vw, 4.5rem);
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: var(--space-8);
}
[data-theme='dark'] .band { background: var(--color-surface-offset); border: 1px solid var(--color-border); }
.band h2 { font-size: var(--text-xl); color: #fff; max-width: 26ch; }
[data-theme='dark'] .band h2 { color: var(--color-text); }
.band p { color: rgba(250,246,236,0.75); margin-top: var(--space-3); max-width: 42ch; }
[data-theme='dark'] .band p { color: var(--color-text-muted); }
.band__actions { display: flex; gap: var(--space-4); flex-wrap: wrap; }

/* ---------------- FAQ accordion ---------------- */
.faq-cat { margin-bottom: var(--space-12); }
.faq-cat__title { font-size: var(--text-lg); margin-bottom: var(--space-5); display: flex; align-items: center; gap: var(--space-3); }
.faq-cat__title .eyebrow-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--color-gold); }

.faq-item { border-bottom: 1px solid var(--color-divider); }
.faq-item__q {
  width: 100%; display: flex; align-items: center; justify-content: space-between; gap: var(--space-4);
  padding: var(--space-5) 0; text-align: left; font-size: var(--text-base); font-weight: 600; color: var(--color-text);
}
.faq-item__q svg { width: 20px; height: 20px; color: var(--color-text-muted); flex-shrink: 0; transition: transform var(--transition-interactive); }
.faq-item.is-open .faq-item__q svg { transform: rotate(45deg); color: var(--color-gold); }
.faq-item__a { max-height: 0; overflow: hidden; transition: max-height 0.3s ease; }
.faq-item__a-inner { padding-bottom: var(--space-5); color: var(--color-text-muted); font-size: var(--text-sm); }
.faq-item__a-inner p + p { margin-top: var(--space-3); }
.faq-item__a-inner cite { font-size: var(--text-xs); color: var(--color-text-faint); font-style: normal; }
.faq-item__a-inner a { color: var(--color-gold-active); text-decoration: underline; text-decoration-color: color-mix(in oklab, var(--color-gold) 50%, transparent); }
[data-theme='dark'] .faq-item__a-inner a { color: var(--color-gold); }

/* ---------------- Contact page ---------------- */
.contact-options { display: grid; grid-template-columns: 1fr 1fr; gap: var(--space-8); }
@media (max-width: 860px) { .contact-options { grid-template-columns: 1fr; } }
.option-card {
  background: var(--color-surface); border: 1px solid var(--color-divider); border-radius: var(--radius-xl);
  padding: clamp(1.75rem, 4vw, 2.75rem); display: flex; flex-direction: column; gap: var(--space-5);
}
.option-card--primary { border-color: var(--color-gold); background: linear-gradient(160deg, var(--color-surface) 0%, var(--color-gold-highlight) 140%); }
.option-card__icon {
  width: 52px; height: 52px; border-radius: var(--radius-md); background: var(--color-navy); color: var(--color-gold);
  display: flex; align-items: center; justify-content: center;
}
.option-card__icon svg { width: 26px; height: 26px; }
.option-card h3 { font-size: var(--text-xl); }
.option-card p { color: var(--color-text-muted); font-size: var(--text-sm); }
.option-card__list { display: flex; flex-direction: column; gap: var(--space-2); margin-top: var(--space-2); }
.option-card__list li { font-size: var(--text-xs); color: var(--color-text-muted); display: flex; gap: var(--space-2); align-items: baseline; }
.option-card__list li::before { content: '—'; color: var(--color-gold-active); }

.contact-info { display: flex; flex-wrap: wrap; gap: var(--space-10); margin-top: var(--space-16); }
.contact-info__item { min-width: 180px; }
.contact-info__label { font-size: var(--text-xs); text-transform: uppercase; letter-spacing: 0.08em; color: var(--color-text-faint); margin-bottom: var(--space-2); }
.contact-info__value { font-family: var(--font-display); font-size: var(--text-lg); }
.contact-info__value a { border-bottom: 1px solid transparent; }
.contact-info__value a:hover { border-color: var(--color-gold); }

/* ---------------- Footer ---------------- */
.footer { background: var(--color-navy); color: var(--color-text-inverse); }
[data-theme='dark'] .footer { background: var(--color-surface-offset); border-top: 1px solid var(--color-border); }
.footer__top { display: flex; flex-wrap: wrap; justify-content: space-between; gap: var(--space-10); padding-block: var(--space-16); }
.footer__brand { max-width: 340px; }
.footer .brand__name, .footer .brand__tag { color: var(--color-text-inverse); }
[data-theme='dark'] .footer .brand__name, [data-theme='dark'] .footer .brand__tag { color: var(--color-text); }
.footer__desc { margin-top: var(--space-4); font-size: var(--text-sm); color: rgba(250,246,236,0.65); }
[data-theme='dark'] .footer__desc { color: var(--color-text-muted); }
.footer__cols { display: flex; gap: var(--space-16); flex-wrap: wrap; }
.footer__col-title { font-size: var(--text-xs); text-transform: uppercase; letter-spacing: 0.08em; color: rgba(250,246,236,0.5); margin-bottom: var(--space-4); }
[data-theme='dark'] .footer__col-title { color: var(--color-text-faint); }
.footer__col a, .footer__col span { display: block; font-size: var(--text-sm); color: rgba(250,246,236,0.85); margin-bottom: var(--space-3); }
[data-theme='dark'] .footer__col a, [data-theme='dark'] .footer__col span { color: var(--color-text-muted); }
.footer__col a:hover { color: var(--color-gold); }
.footer__legal {
  border-top: 1px solid rgba(250,246,236,0.14); padding-block: var(--space-8);
  font-size: var(--text-xs); color: rgba(250,246,236,0.55); line-height: 1.7;
}
[data-theme='dark'] .footer__legal { border-color: var(--color-border); color: var(--color-text-faint); }
.footer__legal p + p { margin-top: var(--space-3); }

/* Reveal-on-scroll (simple, respects reduced motion) */
[data-reveal] { opacity: 0; transform: translateY(16px); transition: opacity 0.6s ease, transform 0.6s ease; }
[data-reveal].is-visible { opacity: 1; transform: translateY(0); }
