/* =========================================================
   Best Financials LLC — Design System
   ========================================================= */

:root {
  /* Brand palette */
  --navy-950: #060b18;
  --navy-900: #0a1330;
  --navy-800: #101c45;
  --navy-700: #182a5e;
  --navy-600: #223a7a;

  --blue-600: #2f6bff;
  --blue-500: #4f81ff;
  --blue-100: #e7edff;

  --emerald-500: #10b981;
  --emerald-100: #d9f7ea;

  --gold-400: #f2c94c;

  --surface: #ffffff;
  --surface-alt: #f5f7fb;
  --surface-raised: #ffffff;

  --text-900: #0b1220;
  --text-600: #383f4d;
  --text-400: #5c6577;
  --border: #e4e8f0;

  --shadow-sm: 0 1px 2px rgba(10, 19, 48, 0.06);
  --shadow-md: 0 8px 24px rgba(10, 19, 48, 0.08);
  --shadow-lg: 0 20px 48px rgba(10, 19, 48, 0.14);
  --shadow-glow: 0 0 0 1px rgba(47, 107, 255, 0.15), 0 12px 32px rgba(47, 107, 255, 0.18);

  --radius-sm: 8px;
  --radius-md: 14px;
  --radius-lg: 22px;
  --radius-pill: 999px;

  --font-head: "Space Grotesk", "Segoe UI", sans-serif;
  --font-body: "Inter", "Segoe UI", sans-serif;

  --container: 1200px;
  --ease: cubic-bezier(0.4, 0, 0.2, 1);
}

:root[data-theme="dark"] {
  --surface: #0a1330;
  --surface-alt: #060b18;
  --surface-raised: #101c45;
  --text-900: #f3f5fb;
  --text-600: #b9c1d6;
  --text-400: #7f8bab;
  --border: #1e2b52;
  --blue-100: #17224a;
  --emerald-100: #0f2e26;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --surface: #0a1330;
    --surface-alt: #060b18;
    --surface-raised: #101c45;
    --text-900: #f3f5fb;
    --text-600: #b9c1d6;
    --text-400: #7f8bab;
    --border: #1e2b52;
    --blue-100: #17224a;
    --emerald-100: #0f2e26;
  }
}

/* ---------- Reset ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; font-size: 112.5%; } /* 18px base for stronger, easier-to-read type */
body {
  margin: 0;
  font-family: var(--font-body);
  background: var(--surface-alt);
  color: var(--text-900);
  font-size: 1rem;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  transition: background .3s var(--ease), color .3s var(--ease);
  overflow-x: hidden;
}
img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
ul { list-style: none; margin: 0; padding: 0; }
button { font-family: inherit; cursor: pointer; }
input, select, textarea { font-family: inherit; }
h1, h2, h3, h4 { font-family: var(--font-head); margin: 0; line-height: 1.18; letter-spacing: -0.01em; }
h3 { font-weight: 600; }
p { margin: 0; color: var(--text-600); line-height: 1.7; }
@media (max-width: 480px) { html { font-size: 105%; } }

.container {
  width: 100%;
  max-width: none;
  margin: 0;
  padding: 0 clamp(24px, 4vw, 64px);
}

section { position: relative; }

/* ---------- Photo hero (used across all pages except Apply) ---------- */
.photo-hero {
  position: relative; overflow: hidden; background-size: cover;
  background-position: center; color: #fff;
}
.photo-hero::after { content: ""; position: absolute; inset: 0; z-index: 0; }
.photo-hero > .container { position: relative; z-index: 1; }
.photo-hero.overlay-center::after { background: linear-gradient(180deg, rgba(6,11,24,.68), rgba(6,11,24,.86)); }
.photo-hero.overlay-side::after { background: linear-gradient(100deg, rgba(6,11,24,.96) 0%, rgba(6,11,24,.88) 32%, rgba(6,11,24,.55) 62%, rgba(6,11,24,.22) 100%); }
.photo-hero.overlay-light::after { background: linear-gradient(180deg, rgba(6,11,24,.55), rgba(6,11,24,.72)); }
.photo-hero .eyebrow { background: rgba(255,255,255,.16); color: #fff; backdrop-filter: blur(6px); }
.photo-hero h1, .photo-hero h2 { color: #fff; }
.photo-hero p, .photo-hero .lead { color: #dbe2f5; }
.photo-hero .trust-item { color: #dbe2f5; }
.photo-hero .trust-item svg { color: #8fb2ff; }
.photo-hero .breadcrumb, .photo-hero .breadcrumb a { color: #c3cce8; }
.photo-hero .spec-box { background: rgba(10,19,48,.55); border-color: rgba(255,255,255,.16); backdrop-filter: blur(6px); }
.photo-hero .spec-box .stat-number { color: #fff; }
.photo-hero .spec-box .stat-label { color: #c3cce8; }

.gallery-strip { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 20px; }
@media (max-width: 760px) { .gallery-strip { grid-template-columns: minmax(0, 1fr); } }
.gallery-photo { border-radius: var(--radius-lg); overflow: hidden; aspect-ratio: 4 / 3; box-shadow: var(--shadow-md); }
.gallery-photo img { width: 100%; height: 100%; object-fit: cover; transition: transform .5s var(--ease); }
.gallery-photo:hover img { transform: scale(1.06); }

.avatar-photo { width: 52px; height: 52px; border-radius: 50%; overflow: hidden; flex-shrink: 0; }
.avatar-photo img { width: 100%; height: 100%; object-fit: cover; }

.photo-hero.hero-lg { min-height: 620px; display: flex; align-items: center; }
.photo-hero.hero-md { padding: 100px 0 80px; }
.photo-hero.hero-sm { padding: 64px 0; }
@media (max-width: 860px) { .photo-hero.hero-lg { min-height: 0; padding: 56px 0; } }
@media (max-width: 640px) { .photo-hero.hero-md { padding: 70px 0 56px; } .photo-hero.hero-sm { padding: 48px 0; } }

/* ---------- Split hero (full-bleed photo + content, used mid-page and pre-footer) ---------- */
.split-hero { display: grid; grid-template-columns: 1fr 1fr; min-height: 460px; margin: 100px 0; }
.split-hero.reverse { grid-template-columns: 1fr 1fr; }
.split-hero.reverse .split-hero-media { order: 2; }
.split-hero.reverse .split-hero-content { order: 1; }
.split-hero-media { background-size: cover; background-position: center; min-height: 320px; position: relative; }
.split-hero-content {
  background: linear-gradient(135deg, var(--navy-900), var(--navy-700));
  display: flex; flex-direction: column; justify-content: center;
  padding: clamp(36px, 5vw, 72px); color: #fff; position: relative; overflow: hidden;
}
.split-hero-content::after {
  content: ""; position: absolute; width: 300px; height: 300px; border-radius: 50%;
  background: radial-gradient(circle, rgba(47,107,255,.3), transparent 70%);
  top: -120px; right: -100px; pointer-events: none;
}
.split-hero-content > * { position: relative; z-index: 1; }
.split-hero-content .eyebrow { background: rgba(255,255,255,.16); color: #fff; backdrop-filter: blur(6px); width: fit-content; }
.split-hero-content h2, .split-hero-content h3 { color: #fff; margin-top: 14px; }
.split-hero-content p { color: #c6d3ff; margin-top: 12px; }
.split-hero-content .btn { margin-top: 26px; width: fit-content; }
@media (max-width: 860px) {
  .split-hero, .split-hero.reverse { grid-template-columns: 1fr; min-height: 0; margin: 64px 0; }
  .split-hero.reverse .split-hero-media { order: 1; }
  .split-hero.reverse .split-hero-content { order: 2; }
  .split-hero-media { min-height: 240px; }
}

/* Mid-content photo hero: shorter variant of .photo-hero for use between sections */
.mid-hero { margin: 20px 0; }
.mid-hero .h2 { max-width: 640px; }
.mid-hero .lead { max-width: 560px; }

/* ---------- Type scale ---------- */
.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--blue-600);
  background: var(--blue-100);
  padding: 6px 14px;
  border-radius: var(--radius-pill);
}
.h1 { font-size: clamp(2.6rem, 4.8vw, 4rem); font-weight: 700; }
.h2 { font-size: clamp(2.05rem, 3.2vw, 2.75rem); font-weight: 700; }
.h3 { font-size: 1.42rem; font-weight: 600; }
.lead { font-size: 1.22rem; line-height: 1.65; color: var(--text-600); }
.section-head { max-width: 640px; margin-bottom: 48px; }
.section-head.center { margin-inline: auto; text-align: center; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 14px 26px;
  border-radius: var(--radius-pill);
  font-weight: 600;
  font-size: 0.95rem;
  border: 1px solid transparent;
  transition: transform .25s var(--ease), box-shadow .25s var(--ease), background .25s var(--ease), color .25s var(--ease);
  white-space: nowrap;
}
.btn-primary {
  background: linear-gradient(135deg, var(--blue-600), #1c4fe0);
  color: #fff;
  box-shadow: var(--shadow-glow);
}
.btn-primary:hover { transform: translateY(-2px); box-shadow: 0 16px 36px rgba(47,107,255,.3); }
.btn-secondary {
  background: var(--surface);
  color: var(--text-900);
  border-color: var(--border);
}
.btn-secondary:hover { border-color: var(--blue-600); color: var(--blue-600); transform: translateY(-2px); }
.btn-ghost { background: transparent; color: var(--text-900); }
.btn-ghost:hover { color: var(--blue-600); }
.btn-block { width: 100%; }
.btn-lg { padding: 16px 32px; font-size: 1.02rem; }
.btn-sm { padding: 10px 18px; font-size: .85rem; }

/* ---------- Header ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: color-mix(in srgb, var(--surface) 88%, transparent);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid transparent;
  transition: border-color .3s var(--ease), box-shadow .3s var(--ease);
}
.site-header.scrolled { border-color: var(--border); box-shadow: var(--shadow-sm); }
.nav-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 16px 24px;
}
.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-head);
  font-weight: 700;
  font-size: 1.15rem;
  color: var(--text-900);
}
.brand-mark {
  width: 38px; height: 38px;
  border-radius: 11px;
  background: linear-gradient(135deg, var(--blue-600), var(--emerald-500));
  display: flex; align-items: center; justify-content: center;
  color: #fff; font-weight: 800; font-size: 1rem;
  box-shadow: var(--shadow-glow);
}
.brand-sub { display: block; font-size: 10px; font-weight: 600; letter-spacing: .12em; color: var(--text-400); }

.nav-links { display: flex; align-items: center; gap: 4px; }
.nav-links > li { position: relative; }
.nav-links a.nav-link {
  display: flex; align-items: center; gap: 6px;
  padding: 10px 14px; border-radius: var(--radius-pill);
  font-weight: 500; font-size: 1rem; color: var(--text-600);
  transition: background .2s var(--ease), color .2s var(--ease);
}
.nav-links a.nav-link:hover, .nav-links a.nav-link.active { color: var(--text-900); background: var(--surface-alt); }
.nav-actions { display: flex; align-items: center; gap: 10px; }

.dropdown-panel {
  position: absolute; top: calc(100% + 10px); left: 0;
  min-width: 260px;
  background: var(--surface-raised);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
  padding: 10px;
  opacity: 0; visibility: hidden; transform: translateY(8px);
  transition: all .2s var(--ease);
}
.nav-links > li:hover .dropdown-panel,
.nav-links > li:focus-within .dropdown-panel { opacity: 1; visibility: visible; transform: translateY(0); }
.dropdown-panel a {
  display: flex; flex-direction: column; gap: 2px;
  padding: 10px 12px; border-radius: var(--radius-sm);
  font-size: .9rem; font-weight: 600; color: var(--text-900);
}
.dropdown-panel a span { font-weight: 400; font-size: .78rem; color: var(--text-400); }
.dropdown-panel a:hover { background: var(--surface-alt); }

.nav-toggle {
  display: none;
  width: 42px; height: 42px;
  border-radius: 10px; border: 1px solid var(--border);
  background: var(--surface);
  align-items: center; justify-content: center;
  flex-direction: column; gap: 4px;
}
.nav-toggle span { width: 18px; height: 2px; background: var(--text-900); border-radius: 2px; transition: all .25s var(--ease); }

/* ---------- Footer ---------- */
.site-footer { background: var(--navy-950); color: #c6cde3; padding: 72px 0 28px; margin-top: 120px; }
.footer-grid { display: grid; grid-template-columns: minmax(0, 1.4fr) repeat(3, minmax(0, 1fr)); gap: 40px; padding-bottom: 48px; border-bottom: 1px solid rgba(255,255,255,.08); }
.footer-grid h4 { color: #fff; font-size: .82rem; letter-spacing: .06em; text-transform: uppercase; margin-bottom: 18px; }
.footer-grid ul { display: flex; flex-direction: column; gap: 11px; }
.footer-grid a { font-size: .98rem; color: #a9b3d1; transition: color .2s; }
.footer-grid a:hover { color: #fff; }
.footer-brand p { color: #a3aecb; margin: 14px 0 20px; max-width: 320px; font-size: .96rem; }
.footer-badges { display: flex; gap: 10px; flex-wrap: wrap; }
.footer-badge { display: flex; align-items: center; gap: 6px; font-size: .8rem; color: #a9b3d1; border: 1px solid rgba(255,255,255,.12); padding: 6px 10px; border-radius: var(--radius-pill); }
.footer-bottom { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 12px; padding-top: 24px; font-size: .88rem; color: #8b96b8; }
.footer-legal-note { font-size: .84rem; color: #8390b3; max-width: 900px; margin-top: 18px; line-height: 1.7; }

/* ---------- Cards / components ---------- */
.card {
  background: var(--surface-raised);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  transition: transform .3s var(--ease), box-shadow .3s var(--ease), border-color .3s var(--ease);
}
.card:hover { transform: translateY(-6px); box-shadow: var(--shadow-lg); border-color: transparent; }

.badge { display: inline-flex; align-items: center; gap: 6px; font-size: .78rem; font-weight: 600; padding: 5px 12px; border-radius: var(--radius-pill); background: var(--emerald-100); color: var(--emerald-500); }

.stat-number { font-family: var(--font-head); font-weight: 700; font-size: clamp(2rem, 3.4vw, 2.8rem); color: var(--text-900); }
.stat-label { font-size: .96rem; font-weight: 400; color: var(--text-400); margin-top: 4px; }

/* ---------- Reveal animation ---------- */
.reveal { opacity: 0; transform: translateY(28px); transition: opacity .7s var(--ease), transform .7s var(--ease); }
.reveal.in-view { opacity: 1; transform: translateY(0); }
.reveal-scale { opacity: 0; transform: scale(.94); transition: opacity .7s var(--ease), transform .7s var(--ease); }
.reveal-scale.in-view { opacity: 1; transform: scale(1); }
.stagger > * { transition-delay: calc(var(--i, 0) * 90ms); }

@keyframes float { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-14px); } }
@keyframes pulseRing { 0% { box-shadow: 0 0 0 0 rgba(16,185,129,.35); } 100% { box-shadow: 0 0 0 14px rgba(16,185,129,0); } }
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes shimmer { 0% { background-position: -200% 0; } 100% { background-position: 200% 0; } }

.skip-link { position: absolute; left: -999px; top: 0; background: var(--blue-600); color: #fff; padding: 10px 16px; border-radius: 0 0 8px 0; z-index: 999; }
.skip-link:focus { left: 0; }

/* ---------- Responsive ---------- */
@media (max-width: 980px) {
  .nav-links, .nav-actions .btn-secondary { display: none; }
  .nav-toggle { display: flex; }
  .footer-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 560px) {
  .footer-grid { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 480px) {
  .nav-inner { padding: 14px 16px; gap: 8px; }
  .brand { font-size: .92rem; gap: 6px; }
  .brand-mark { width: 32px; height: 32px; font-size: .8rem; flex-shrink: 0; }
  .brand-sub { display: none; }
  .nav-actions { gap: 6px; }
  .nav-actions [data-theme-toggle] { display: none; }
  .nav-actions .btn-primary { padding: 10px 14px; font-size: .82rem; }
  .nav-toggle { width: 38px; height: 38px; flex-shrink: 0; }
}
