* {
  box-sizing: border-box;
}

:root {
  /* ═══════════════════════════════════════════════════════════════
     LIGHT MODE — "Warm Institutional"
     Soft Whites · Vivid Accents · Institutional Calm
     ═══════════════════════════════════════════════════════════════ */
  
  /* Core Neutrals (White, but Done Right) */
  --bg: #F3F6FB;                    /* Page Background - Entire site */
  --panel: #FAFBFE;                 /* Primary Surface - Hero, major cards */
  --card: #F6F8FC;                  /* Secondary Surface - Inner cards, stat blocks */
  --surface-tertiary: #EEF2F8;      /* Tertiary Surface - Section breaks, feature panels */
  --border: #E2E8F0;                /* Borders / Dividers - Card edges, separators */
  
  /* Typography & Content */
  --text: #1E255E;                  /* Headings / Titles - Strong contrast */
  --text-body: #1F2937;             /* Body Text - Darker for better contrast */
  --muted: #4B5563;                 /* Muted Text / Labels (darker for visibility) */
  --link: #2563EB;                  /* Links */
  --link-hover: #1D4ED8;            /* Link Hover */
  
  /* Brand & Action Colors */
  --primary: #1F7FBF;               /* Primary Brand Blue - Buttons, highlights */
  --primary-hover: #1A6B9E;         /* Primary hover state */
  --primary-strong: #1E255E;        /* Strong accent - Headings */
  --main: #1E255E;                  /* Main brand color */
  --accent: #F6E81B;                /* Primary CTA (Yellow) - High-intent actions */
  --accent-hover: #E0D200;          /* CTA Hover - Controlled, confident */
  --accent-warm: #E57C23;           /* Secondary Accent (Orange) - Badges, emphasis */
  --focus-ring: #93C5FD;            /* Focus Ring - Accessibility-safe */
  
  /* Semantic colors */
  --success: #16A34A;
  --warning: #F59E0B;
  --error: #DC2626;
  --info: #2563EB;
  
  /* Shadows & Effects */
  --shadow: 0 14px 42px rgba(30, 37, 94, 0.08);
  --shadow-light: 0 4px 16px rgba(30, 37, 94, 0.05);
  --shadow-heavy: 0 20px 60px rgba(30, 37, 94, 0.12);
  
  /* Layout */
  --radius: 16px;
  --font-body: Arial, Helvetica, "Segoe UI", sans-serif;
  --font-heading: "Space Grotesk", "Segoe UI", sans-serif;
  --font: var(--font-body);

  /* Navigation */
  --nav-bg: rgba(238, 242, 248, 0.96);
  --nav-text: var(--text);
  
  /* Hero Gradient (removes "dull white slab" feeling) */
  --hero-gradient: linear-gradient(180deg, #FAFBFE 0%, #F3F6FB 100%);
}

.theme-dark {
  /* ═══════════════════════════════════════════════════════════════
     DARK MODE — "Quiet Authority"
     ═══════════════════════════════════════════════════════════════ */
  
  /* Core */
  --bg: #151A3A;                    /* Background */
  --panel: #1F2553;                 /* Primary Surface */
  --card: #262C61;                  /* Secondary Surface */
  --surface-tertiary: #1F2553;      /* Tertiary Surface */
  --border: #2E356D;                /* Borders */
  
  /* Text & Actions */
  --text: #F8FAFC;                  /* Headings */
  --text-body: #CBD5E1;             /* Body Text */
  --muted: #94A3B8;                 /* Muted Text */
  --link: #60A5FA;                  /* Links */
  --link-hover: #93C5FD;            /* Link Hover */
  
  /* Brand & Action Colors */
  --primary: #3B9AD9;               /* Primary Brand Blue */
  --primary-hover: #60A5FA;         /* Primary hover */
  --primary-strong: #F8FAFC;        /* Strong accent */
  --main: #151A3A;                  /* Main brand color */
  --accent: #F6E81B;                /* Primary CTA (Yellow) */
  --accent-hover: #FFF066;          /* CTA Hover */
  --accent-warm: #F59E0B;           /* Accent Orange */
  --focus-ring: #93C5FD;            /* Focus Ring */
  
  /* Shadows */
  --shadow: 0 18px 60px rgba(0, 0, 0, 0.35);
  --shadow-light: 0 4px 16px rgba(0, 0, 0, 0.25);
  --shadow-heavy: 0 24px 70px rgba(0, 0, 0, 0.45);
  
  /* Navigation */
  --nav-bg: rgba(21, 26, 58, 0.96);
  --nav-text: var(--text);
  
  /* Hero Gradient */
  --hero-gradient: linear-gradient(180deg, #1F2553 0%, #151A3A 100%);
}

body {
  margin: 0;
  font-family: var(--font-body);
  background: var(--bg);
  color: var(--text-body);
  -webkit-font-smoothing: antialiased;
  line-height: 1.7;
}

button,
input,
select,
textarea {
  font-family: inherit;
}

.theme-dark body {
  background: var(--bg);
}

h1, h2, h3, h4 {
  letter-spacing: -0.02em;
  font-family: var(--font-heading);
  font-weight: 700;
  color: var(--text);
}

.page {
  max-width: none;
  margin: 0;
  padding: 0 0 48px;
}

.page > main,
.page > footer {
  max-width: 1180px;
  margin: 0 auto;
  padding: 0 16px;
}

@media (max-width: 640px) {
  .page > main,
  .page > footer {
    padding: 0 12px;
  }
}

a {
  color: var(--link);
  transition: color 0.2s ease;
}

a:hover {
  color: var(--link-hover);
}

/* Accessibility */
.skip-link {
  position: absolute;
  left: 12px;
  top: 12px;
  z-index: 1000;
  padding: 10px 14px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: var(--nav-bg);
  color: var(--nav-text);
  text-decoration: none;
  font-weight: 700;
  transform: translateY(-220%);
  transition: transform 0.15s ease;
}

.skip-link:focus,
.skip-link:focus-visible {
  transform: translateY(0);
}

a:focus-visible,
button:focus-visible,
summary:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
  outline: 3px solid var(--focus-ring);
  outline-offset: 3px;
}

.nav {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 24px;
  padding: 12px 16px;
  position: sticky;
  top: 0;
  z-index: 10;
  background: var(--nav-bg);
  backdrop-filter: blur(14px);
  border: 1px solid var(--border);
  border-radius: 0;
  box-shadow: var(--shadow);
  margin-bottom: 16px;
}

.nav-actions {
  margin-left: auto;
}

/* Nav layout enhancements (mobile hamburger is driven by site.js) */
.nav-menu {
  display: flex;
  align-items: center;
  gap: 16px;
  flex: 1;
  justify-content: space-between;
  min-width: 0;
}

.nav-quick {
  display: none;
  align-items: center;
  gap: 10px;
}

.nav-toggle {
  white-space: nowrap;
}

.nav-toggle::before {
  content: "≡";
  display: inline-block;
  margin-right: 8px;
  font-weight: 900;
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--surface-tertiary);
  color: var(--text-body);
  font-size: 13px;
  font-weight: 700;
}

.badge.secondary {
  background: rgba(246, 232, 27, 0.18);
  border-color: rgba(246, 232, 27, 0.45);
  color: var(--text);
}

.theme-dark .badge {
  background: rgba(255, 255, 255, 0.06);
}

.theme-dark .badge.secondary {
  background: rgba(246, 232, 27, 0.12);
  border-color: rgba(246, 232, 27, 0.32);
  color: var(--text);
}

.grad-text {
  color: var(--primary);
}

.band {
  position: relative;
  padding: 56px 0;
  margin-top: 46px;
}

.band::before {
  content: "";
  position: absolute;
  left: 0;
  transform: none;
  top: 0;
  bottom: 0;
  width: 100%;
  background: var(--surface-tertiary);
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  pointer-events: none;
}

.theme-dark .band::before {
  background: rgba(255, 255, 255, 0.03);
  border-top: 1px solid rgba(255, 255, 255, 0.10);
  border-bottom: 1px solid rgba(255, 255, 255, 0.10);
}

.band-inner {
  position: relative;
}

.band-muted::before {
  background: radial-gradient(120% 120% at 14% 10%, rgba(31, 127, 191, 0.10), transparent 45%),
    radial-gradient(120% 120% at 88% 18%, rgba(246, 232, 27, 0.08), transparent 48%),
    var(--surface-tertiary);
}

.nav-links {
  display: flex;
  gap: 14px;
  align-items: center;
}

.nav-links a,
.nav-links summary {
  color: var(--nav-text);
  text-decoration: none;
  font-weight: 600;
  padding: 8px 12px;
  border-radius: 12px;
  border: 1px solid transparent;
  transition: border-color 0.2s ease, background 0.2s ease;
}

.nav-links summary {
  list-style: none;
  cursor: pointer;
}

.nav-links summary::-webkit-details-marker {
  display: none;
}

.nav-links a:hover {
  border-color: rgba(31, 127, 191, 0.40);
  background: var(--surface-tertiary);
}

.nav-links summary:hover {
  border-color: rgba(31, 127, 191, 0.40);
  background: var(--surface-tertiary);
}

.theme-dark .nav-links a:hover {
  border-color: rgba(246, 232, 27, 0.45);
  background: rgba(255, 255, 255, 0.04);
}

.theme-dark .nav-links summary:hover {
  border-color: rgba(246, 232, 27, 0.45);
  background: rgba(255, 255, 255, 0.04);
}

.nav-dd {
  position: relative;
}

.nav-dd > summary {
  list-style: none;
  cursor: pointer;
}

.nav-dd > summary::-webkit-details-marker {
  display: none;
}

.nav-dd-menu {
  position: absolute;
  top: calc(100% + 10px);
  left: 0;
  min-width: 240px;
  padding: 10px;
  border-radius: 16px;
  border: 1px solid var(--border);
  background: var(--panel);
  box-shadow: var(--shadow-heavy);
  backdrop-filter: blur(14px);
  display: none;
  gap: 6px;
  z-index: 20;
}

details.nav-dd[open] .nav-dd-menu {
  display: grid;
}

.theme-dark .nav-dd-menu {
  background: rgba(21, 26, 58, 0.96);
  box-shadow: 0 22px 70px rgba(0, 0, 0, 0.45);
}

.nav-dd-menu a {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 10px;
  border-radius: 12px;
  border: 1px solid transparent;
  color: var(--nav-text);
}

.nav-dd-menu a:hover {
  border-color: rgba(31, 127, 191, 0.30);
  background: rgba(31, 127, 191, 0.08);
}

.theme-dark .nav-dd-menu a {
  color: var(--text);
}

details.nav-dd[open] > summary {
  border-color: rgba(31, 127, 191, 0.35);
  background: rgba(31, 127, 191, 0.08);
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
}

/* Make brand (logo + name) clickable without changing layout */
.brand-link {
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
  color: inherit;
}

.brand-link:focus-visible {
  outline: 3px solid var(--focus-ring);
  outline-offset: 4px;
  border-radius: 14px;
}

.logo {
  width: 72px;
  height: 72px;
  aspect-ratio: 1 / 1;
  object-fit: contain;
  border-radius: 2px;
  border: 1px solid var(--border);
  background: var(--panel);
}

.name-banner {
  height: 56px;
  width: auto;
  object-fit: fit;
}

.logo-banner {
  height: 100px;
  width: auto;
  max-width: 380px;
  object-fit: contain;
}

.brand-text {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.brand-name {
  font-weight: 700;
  letter-spacing: -0.02em;
  font-family: var(--font-heading);
  font-size: 20px;
  line-height: 1.15;
}

.brand-tag {
  font-size: 14px;
  color: var(--muted);
}

@media (min-width: 900px) {
  .brand-name {
    font-size: 22px;
  }
}

.nav-actions {
  display: flex;
  gap: 10px;
}

/* Settings Dropdown Menu */
.settings-dd {
  position: relative;
}

.settings-dd > summary {
  list-style: none;
  cursor: pointer;
}

.settings-dd > summary::-webkit-details-marker {
  display: none;
}

.settings-menu {
  position: absolute;
  top: calc(100% + 10px);
  right: 0;
  left: auto;
  min-width: 220px;
  padding: 10px;
  border-radius: 16px;
  border: 1px solid var(--border);
  background: var(--panel);
  box-shadow: var(--shadow-heavy);
  backdrop-filter: blur(14px);
  display: none;
  gap: 6px;
  z-index: 20;
}

details.settings-dd[open] .settings-menu {
  display: grid;
}

.theme-dark .settings-menu {
  background: rgba(21, 26, 58, 0.96);
  box-shadow: 0 22px 70px rgba(0, 0, 0, 0.45);
}

.settings-menu a {
  display: flex;
  align-items: center;
  padding: 12px 14px;
  border-radius: 10px;
  color: var(--nav-text);
  text-decoration: none;
  font-weight: 600;
  transition: background 0.2s ease;
}

.settings-menu a:hover {
  background: var(--surface-tertiary);
}

.theme-dark .settings-menu a:hover {
  background: rgba(255, 255, 255, 0.08);
}

.menu-divider {
  height: 1px;
  background: var(--border);
  margin: 8px 0;
}

.language-switch-menu {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 12px 14px;
  color: var(--nav-text);
  font-weight: 600;
}

.language-switch-menu select {
  background: var(--surface-tertiary);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 6px 10px;
  color: var(--nav-text);
  font-weight: 600;
  cursor: pointer;
}

.theme-dark .language-switch-menu select {
  background: rgba(255, 255, 255, 0.08);
  color: var(--text);
}

.theme-toggle-menu {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  padding: 12px 14px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--surface-tertiary);
  color: var(--nav-text);
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s ease;
}

.theme-toggle-menu:hover {
  background: var(--card);
}

.theme-dark .theme-toggle-menu {
  background: rgba(255, 255, 255, 0.06);
  color: var(--text);
}

.theme-dark .theme-toggle-menu:hover {
  background: rgba(255, 255, 255, 0.10);
}

/* Mobile nav links - hidden on desktop */
.mobile-nav-links {
  display: none;
}

.language-switch {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 12px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: var(--surface-tertiary);
  color: var(--nav-text);
}

.theme-dark .language-switch {
  background: rgba(255, 255, 255, 0.06);
  color: var(--text);
}

.language-switch select {
  background: transparent;
  border: none;
  color: currentColor;
  font-weight: 600;
  outline: none;
}

.pill {
  padding: 10px 16px;
  border-radius: 999px;
  border: 1px solid var(--border);
  color: var(--nav-text);
  text-decoration: none;
  font-weight: 600;
  transition: transform 0.2s ease, background 0.2s ease, border-color 0.2s ease;
}

.theme-dark .pill {
  color: var(--text);
}

.pill.btn {
  background: var(--surface-tertiary);
  cursor: pointer;
  font-family: var(--font);
}

.theme-dark .pill.btn {
  background: rgba(255, 255, 255, 0.06);
}

.pill:hover {
  transform: translateY(-2px);
  border-color: rgba(31, 127, 191, 0.50);
}

.pill.solid {
  background: var(--primary);
  border-color: transparent;
  color: #FFFFFF;
}

.pill.solid:hover {
  background: var(--primary-hover);
}

.hero {
  display: grid;
  grid-template-columns: 2fr 1.1fr;
  gap: 24px;
  padding: 32px;
  border: 1px solid var(--border);
  border-radius: 28px;
  background: var(--hero-gradient);
  box-shadow: var(--shadow);
}

.theme-dark .hero {
  background: var(--hero-gradient);
}

.hero.hero-centered {
  grid-template-columns: 1fr;
  text-align: center;
  padding: 48px 34px;
}

.hero.hero-centered .cta-group {
  justify-content: center;
}

.hero.hero-centered .lede {
  max-width: 820px;
  margin-left: auto;
  margin-right: auto;
}

.hero-scene {
  position: relative;
  margin: 26px auto 0;
  height: 420px;
  max-width: 980px;
  border-radius: 22px;
  border: 1px solid var(--border);
  background: rgba(31, 127, 191, 0.06);
  overflow: hidden;
}

.hero-scene::after {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(60% 60% at 50% 40%, rgba(246, 232, 27, 0.08), transparent 55%);
  pointer-events: none;
}

.scene-hub {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  width: 128px;
  height: 128px;
  border-radius: 28px;
  background: linear-gradient(140deg, var(--primary), rgba(30, 37, 94, 0.88));
  box-shadow: 0 30px 90px rgba(0, 0, 0, 0.35);
}

.scene-hub::before {
  content: "";
  position: absolute;
  inset: 26px;
  border-radius: 18px;
  background: var(--panel);
}

.scene-hub::after {
  content: "";
  position: absolute;
  inset: 44px;
  border-radius: 12px;
  background: var(--primary);
}

.floating-card {
  position: absolute;
  border-radius: 18px;
  border: 1px solid var(--border);
  background: var(--card);
  box-shadow: var(--shadow);
  padding: 14px;
  color: var(--muted);
  text-decoration: none;
  cursor: pointer;
  transform: translate3d(0, 0, 0);
  animation: floaty 5.2s ease-in-out infinite;
}

.floating-card:hover {
  border-color: rgba(31, 127, 191, 0.45);
  background: var(--panel);
}

.theme-dark .floating-card {
  background: rgba(255, 255, 255, 0.06);
}

.theme-dark .floating-card:hover {
  border-color: rgba(246, 232, 27, 0.42);
  background: rgba(255, 255, 255, 0.10);
}

.floating-card strong {
  display: block;
  color: var(--text);
  font-size: 13px;
}

.floating-card .mini {
  margin-top: 10px;
  display: grid;
  gap: 8px;
}

.floating-card .bar {
  height: 10px;
  border-radius: 999px;
  background: var(--surface-tertiary);
  border: 1px solid var(--border);
}

.theme-dark .floating-card .bar {
  background: rgba(255, 255, 255, 0.10);
  border: 1px solid rgba(255, 255, 255, 0.14);
}

.floating-card .bar.primary {
  background: rgba(31, 127, 191, 0.50);
  border-color: rgba(31, 127, 191, 0.60);
}

.floating-card.delay-1 { animation-delay: 0.2s; }
.floating-card.delay-2 { animation-delay: 0.6s; }
.floating-card.delay-3 { animation-delay: 1.0s; }
.floating-card.delay-4 { animation-delay: 1.4s; }

@keyframes floaty {
  0%, 100% { transform: translate3d(0, 0, 0) rotate(-0.3deg); }
  50% { transform: translate3d(0, -14px, 0) rotate(0.3deg); }
}

.hero.has-image {
  position: relative;
  overflow: hidden;
  background: linear-gradient(140deg, rgba(250, 251, 254, 0.95), rgba(243, 246, 251, 0.85));
}

.theme-dark .hero.has-image {
  background: linear-gradient(140deg, rgba(21, 26, 58, 0.90), rgba(21, 26, 58, 0.60));
}

.hero-visual {
  position: absolute;
  inset: 0;
  background-image: url('media/all-loans-destination.jpeg');
  background-position: center;
  background-size: cover;
  background-repeat: no-repeat;
  opacity: 0.30;
  pointer-events: none;
}

.hero-visual::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(160deg, rgba(250, 251, 254, 0.92), rgba(243, 246, 251, 0.60));
}

.theme-dark .hero-visual {
  opacity: 0.70;
}

.theme-dark .hero-visual::before {
  background: linear-gradient(160deg, rgba(21, 26, 58, 0.85), rgba(21, 26, 58, 0.45));
}

.hero.has-image .stat-pill {
  background: var(--panel);
  box-shadow: var(--shadow-light);
}

.theme-dark .hero.has-image .stat-pill {
  background: rgba(255, 255, 255, 0.06);
  box-shadow: var(--shadow);
}

.hero.has-image .card.subtle {
  background: var(--panel);
}

.theme-dark .hero.has-image .card.subtle {
  background: rgba(255, 255, 255, 0.06);
}

.hero-content.relative {
  position: relative;
  z-index: 1;
}

.page-hero {
  display: grid;
  grid-template-columns: 1.6fr 1fr;
  gap: 20px;
  padding: 28px;
  border: 1px solid var(--border);
  border-radius: 24px;
  background: linear-gradient(150deg, rgba(31, 127, 191, 0.12), rgba(30, 37, 94, 0.08)), var(--surface-tertiary);
  box-shadow: var(--shadow);
}

.eyebrow {
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-size: 12px;
  color: var(--accent-warm);
  margin: 0 0 8px;
}

.hero h1 {
  margin: 0 0 12px;
  font-size: 38px;
  line-height: 1.1;
}

.lede {
  color: var(--muted);
  margin: 0 0 20px;
  font-size: 17px;
}

/* User request: make hero description black (higher contrast) */
.hero .lede {
  color: #111827;
}

.theme-dark .hero .lede {
  color: var(--text-body);
}

.tagline {
  margin: 0 0 16px;
  color: var(--accent-warm);
  font-weight: 600;
}

.cta-group {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 20px;
}

.cta {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 12px 18px;
  border-radius: 12px;
  font-weight: 700;
  text-decoration: none;
  color: var(--text);
  border: 1px solid var(--border);
  transition: transform 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}

.cta.primary {
  background: var(--primary);
  box-shadow: 0 10px 30px rgba(31, 127, 191, 0.25);
  border-color: transparent;
  color: #FFFFFF;
}

.cta.primary:hover {
  background: var(--primary-hover);
  box-shadow: 0 14px 40px rgba(31, 127, 191, 0.35);
}

.cta.ghost {
  background: var(--surface-tertiary);
}

.theme-dark .cta.ghost {
  background: rgba(255, 255, 255, 0.06);
}

.cta.outline {
  background: transparent;
  border-color: rgba(31, 127, 191, 0.50);
}

.cta.outline:hover {
  background: rgba(31, 127, 191, 0.10);
}

.cta.secondary {
  background: rgba(246, 232, 27, 0.20);
  border-color: rgba(246, 232, 27, 0.45);
  color: var(--text);
}

.cta.small {
  padding: 10px 14px;
  font-size: 14px;
}

.cta:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow);
}

.cta.ghost:hover {
  background: var(--card);
}

.theme-dark .cta.ghost:hover {
  background: rgba(255, 255, 255, 0.10);
}

.hero-meta {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
  color: var(--muted);
  font-size: 15px;
}

.stat-bar {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 12px;
  margin-top: 18px;
}

.stat-pill {
  padding: 14px 16px;
  border-radius: 14px;
  border: 1px solid var(--border);
  background: var(--card);
  box-shadow: var(--shadow-light);
}

.theme-dark .stat-pill {
  background: rgba(255, 255, 255, 0.05);
}

.stat-pill .value {
  display: block;
  font-size: 18px;
  font-weight: 700;
  color: var(--text);
}

.stat-pill .label {
  color: var(--muted);
  font-size: 13px;
}

.hero-meta strong {
  color: var(--text);
}

.hero-card {
  padding: 20px;
  border-radius: 20px;
  border: 1px solid var(--border);
  background: var(--card);
  display: flex;
  flex-direction: column;
  gap: 12px;
  box-shadow: var(--shadow-light);
}

.theme-dark .hero-card {
  background: rgba(255, 255, 255, 0.05);
}

.hero-card .card-header {
  font-weight: 700;
  color: var(--accent);
  letter-spacing: 0.02em;
}

.hero-card ul {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
  color: var(--muted);
}

.hero-card li span {
  margin-right: 10px;
}

.section {
  margin-top: 56px;
}

.section-header h2 {
  margin: 6px 0 10px;
  font-size: 30px;
}

.section-lede {
  color: var(--muted);
  margin: 0;
  max-width: 720px;
}

.grid {
  display: grid;
  gap: 18px;
}

.grid.two { grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); }
.grid.three { grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); }
.grid.four { grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); }

.card {
  padding: 18px;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: var(--card);
  box-shadow: var(--shadow);
}

.card-media {
  width: 100%;
  height: auto;
  max-height: 280px;
  object-fit: contain;
  object-position: center;
  border-radius: 14px;
  border: 1px solid var(--border);
  display: block;
  margin-bottom: 12px;
  background: var(--surface-tertiary);
}

@media (max-width: 520px) {
  .card-media {
    max-height: 220px;
  }
}

@media (max-width: 520px) {
  .logo {
    width: 40px;
    height: 40px;
  }

  .brand-tag {
    display: none;
  }

  .brand-name {
    font-size: 16px;
  }

  .nav {
    padding: 10px 12px;
  }

  .nav-quick .pill {
    padding: 9px 12px;
  }
}

.card.subtle {
  background: var(--surface-tertiary);
}

/* Page hero card images - show full image */
.page-hero .card.subtle .card-media {
  max-height: 320px;
  margin-bottom: 16px;
}

.theme-dark .card.subtle {
  background: rgba(255, 255, 255, 0.04);
}

.table-card {
  padding: 0;
  overflow: hidden;
  max-width: 100%;
}

/* Compact variant for tables */
.table-card.compact {
  font-size: 14px;
}

.table-card.compact .table-row {
  padding: 10px 14px;
  gap: 10px;
}

.table-card.compact .table-head {
  font-size: 13px;
}

.table-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(100px, 1fr));
  gap: 10px;
  padding: 12px 14px;
  color: var(--text-body);
  border-bottom: 1px solid var(--border);
  font-size: 14px;
  line-height: 1.4;
}

/* Override for specific column counts */
.table-row.cols-2 { grid-template-columns: 1fr 1fr; }
.table-row.cols-3 { grid-template-columns: 1fr 1fr 1fr; }
.table-row.cols-4 { grid-template-columns: 1.1fr 1fr 0.8fr 1fr; }
.table-row.cols-5 { grid-template-columns: repeat(5, 1fr); }

.table-head {
  background: var(--surface-tertiary);
  color: var(--text);
  font-weight: 700;
  font-size: 13px;
}

.theme-dark .table-head {
  background: rgba(255, 255, 255, 0.05);
}

.table-card .table-row:last-child {
  border-bottom: none;
}

.card h3 {
  margin: 0 0 8px;
}

.card p, .card ul {
  margin: 0;
  color: var(--text-body);
  line-height: 1.5;
}

.card ul {
  padding-left: 18px;
  display: grid;
  gap: 6px;
}

.feature ul { padding-left: 18px; }

/* Grid cards with images - ensure consistent layout */
.grid .card.feature {
  display: flex;
  flex-direction: column;
}

.grid .card.feature .card-media {
  flex-shrink: 0;
}

.grid .card.feature h3 {
  margin-top: 4px;
}

.grid .card.feature p {
  flex-grow: 1;
  margin-bottom: 12px;
}

.grid .card.feature .cta {
  margin-top: auto;
  align-self: flex-start;
}

.stats {
  gap: 14px;
}

.stat {
  padding: 18px;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: linear-gradient(160deg, rgba(31, 127, 191, 0.10), var(--card));
  text-align: left;
}

.theme-dark .stat {
  background: linear-gradient(160deg, rgba(31, 127, 191, 0.16), rgba(255, 255, 255, 0.02));
}

.stat .value {
  display: block;
  font-size: 24px;
  font-weight: 700;
}

.stat .label {
  color: var(--muted);
  font-size: 14px;
}

.step {
  position: relative;
  overflow: hidden;
}

.step-number {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: rgba(246, 232, 27, 0.18);
  border: 1px solid rgba(246, 232, 27, 0.50);
  color: var(--text);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  margin-bottom: 12px;
}

.notice {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 18px;
  background: rgba(229, 124, 35, 0.08);
  border-color: rgba(229, 124, 35, 0.35);
}

.media-grid {
  display: grid;
  gap: 14px;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
}

.media-item {
  border: 1px solid var(--border);
  border-radius: 16px;
  background: var(--card);
  overflow: hidden;
  box-shadow: var(--shadow-light);
}

.theme-dark .media-item {
  background: rgba(255, 255, 255, 0.05);
}

.media-item img {
  width: 100%;
  height: 160px;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  display: block;
}

.media-item .media-body {
  padding: 12px 14px;
  color: var(--text-body);
}

.media-wide {
  position: relative;
  border-radius: 18px;
  overflow: hidden;
  min-height: 240px;
  background: linear-gradient(160deg, rgba(31, 127, 191, 0.14), rgba(30, 37, 94, 0.10));
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
}

.media-wide img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  position: absolute;
  inset: 0;
  opacity: 0.55;
}

.media-wide .overlay {
  position: relative;
  padding: 22px;
  color: var(--text);
  text-shadow: 0 8px 24px rgba(0, 0, 0, 0.5);
}

.doc-grid {
  display: grid;
  gap: 14px;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
}

.doc-card {
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 14px;
  background: var(--card);
  box-shadow: var(--shadow-light);
}

.theme-dark .doc-card {
  background: rgba(255, 255, 255, 0.04);
}

.doc-card h4 {
  margin: 0 0 6px;
}

.doc-card p {
  margin: 0 0 10px;
  color: var(--muted);
}

.doc-card a {
  font-weight: 700;
}

.carousel {
  display: grid;
  gap: 12px;
}

.carousel-track {
  display: flex;
  gap: 12px;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  padding-bottom: 6px;
}

.carousel-card {
  min-width: 240px;
  scroll-snap-align: start;
  border: 1px solid var(--border);
  border-radius: 16px;
  background: var(--card);
  padding: 14px;
  box-shadow: var(--shadow-light);
}

.theme-dark .carousel-card {
  background: rgba(255, 255, 255, 0.05);
}

@media (min-width: 740px) {
  .carousel-track {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    overflow: visible;
    padding-bottom: 0;
  }

  .carousel-card {
    min-width: auto;
  }

  .carousel-dots {
    display: none;
  }
}

.carousel-dots {
  display: flex;
  gap: 8px;
}

.carousel-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  border: 1px solid var(--border);
  background: var(--surface-tertiary);
}

.theme-dark .carousel-dot {
  background: rgba(255, 255, 255, 0.08);
}

.carousel-dot.active {
  background: var(--primary);
  border-color: var(--primary);
}

.cta-ribbon {
  margin-top: 32px;
  padding: 18px 20px;
  border-radius: 18px;
  border: 1px solid rgba(31, 127, 191, 0.25);
  background: linear-gradient(120deg, rgba(31, 127, 191, 0.12), rgba(30, 37, 94, 0.08));
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  flex-wrap: wrap;
}

.theme-dark .cta-ribbon {
  background: linear-gradient(120deg, rgba(31, 127, 191, 0.20), rgba(30, 37, 94, 0.15));
}

.cta-ribbon strong { font-size: 18px; }
.cta-ribbon p { margin: 0; color: var(--muted); }

.map-shell {
  height: 240px;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: var(--surface-tertiary);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--muted);
}

.theme-dark .map-shell {
  background: rgba(255, 255, 255, 0.04);
}

.contact {
  align-items: stretch;
}

.contact-card {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.contact-form {
  display: grid;
  gap: 10px;
}

.contact-form label {
  display: grid;
  gap: 6px;
  color: var(--text);
  font-weight: 600;
}

.contact-form input,
.contact-form textarea {
  width: 100%;
  padding: 12px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--panel);
  color: var(--text);
  font-family: var(--font);
}

.theme-dark .contact-form input,
.theme-dark .contact-form textarea {
  background: rgba(255, 255, 255, 0.04);
}

.contact-form input::placeholder,
.contact-form textarea::placeholder {
  color: var(--muted);
}

.contact-form button {
  padding: 12px 14px;
  background: var(--primary);
  border: none;
  color: #FFFFFF;
  border-radius: 12px;
  font-weight: 700;
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}

.contact-form button:hover {
  background: var(--primary-hover);
  transform: translateY(-2px);
  box-shadow: 0 12px 30px rgba(31, 127, 191, 0.30);
}

.language-note {
  color: var(--muted);
  font-size: 14px;
  margin-top: 8px;
}

.form-hint {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
}

.footer {
  margin-top: 56px;
  padding-top: 22px;
  border-top: 1px solid var(--border);
  color: var(--text-body);
}

.footer-grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr;
  gap: 22px;
  padding: 18px 0;
}

.footer-brand strong {
  color: var(--text);
  font-size: 16px;
}

.footer-brand p {
  margin: 8px 0 0;
  max-width: 520px;
}

.footer-col h4 {
  margin: 0 0 10px;
  color: var(--text);
  font-size: 14px;
  letter-spacing: 0.02em;
}

.footer-col a {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  text-decoration: none;
  padding: 6px 0;
  transition: color 0.2s ease;
}

.footer-col a:hover {
  color: var(--text);
}

.footer-bottom {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding: 16px 0 10px;
  border-top: 1px solid var(--border);
}

.footer-links {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

.footer-links a {
  color: var(--text);
  text-decoration: none;
  font-weight: 600;
  padding: 6px 10px;
  border-radius: 10px;
  background: var(--surface-tertiary);
  border: 1px solid var(--border);
  transition: border-color 0.2s ease, background 0.2s ease;
}

.theme-dark .footer-links a {
  background: rgba(255, 255, 255, 0.04);
}

.footer-links a:hover {
  border-color: rgba(31, 127, 191, 0.50);
}

/* Scrolling Headline */
.scrolling-headline {
  width: 100%;
  background: transparent;
  overflow: hidden;
  padding: 14px 16px;
  margin-bottom: 16px;
  border-radius: 0;
}

.scrolling-headline-text {
  display: inline-block;
  white-space: nowrap;
  animation: scroll-left 40s linear infinite;
  color: var(--main);
  font-weight: 700;
  font-size: 20px;
  background: var(--accent);
  padding: 8px 12px;
  border-radius: 8px;
}

.scrolling-headline-text span {
  color: var(--primary);
}

.scrolling-headline-text .telugu-text {
  font-family: "Noto Sans Telugu", Arial, sans-serif;
  color: var(--main);
  font-size: 22px;
}

@keyframes scroll-left {
  0% {
    transform: translateX(0%);
  }
  100% {
    transform: translateX(-50%);
  }
}

@media (max-width: 900px) {
  .hero {
    grid-template-columns: 1fr;
  }

  .stat-bar {
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  }

  .page-hero {
    grid-template-columns: 1fr;
  }

  .nav {
    position: sticky;
    top: 0;
    flex-wrap: wrap;
    gap: 10px;
  }

  /* Hide desktop nav links on mobile */
  .nav-links {
    display: none;
  }

  /* Show mobile menu button */
  .nav-actions {
    margin-left: auto;
  }

  /* Brand stays visible */
  .brand {
    flex: 1;
    min-width: 0;
  }

  .name-banner {
    height: 36px;
    max-width: 160px;
  }

  .logo {
    width: 48px;
    height: 48px;
  }

  /* Mobile menu with all navigation */
  .settings-menu {
    min-width: 280px;
  }

  /* Show mobile nav links in dropdown */
  .mobile-nav-links {
    display: flex;
    flex-direction: column;
    gap: 4px;
    padding-bottom: 8px;
    border-bottom: 1px solid var(--border);
    margin-bottom: 8px;
  }

  .mobile-nav-links a {
    display: flex;
    align-items: center;
    padding: 12px 14px;
    border-radius: 10px;
    color: var(--nav-text);
    text-decoration: none;
    font-weight: 600;
    transition: background 0.2s ease;
  }

  .mobile-nav-links a:hover {
    background: var(--surface-tertiary);
  }

  .theme-dark .mobile-nav-links a:hover {
    background: rgba(255, 255, 255, 0.08);
  }

  .table-card .table-row {
    grid-template-columns: 1fr 1fr;
    font-size: 13px;
    padding: 10px 12px;
    gap: 8px;
  }

  .table-card .table-row div:nth-child(3),
  .table-card .table-row div:nth-child(4) {
    font-size: 13px;
  }
  
  .table-card.compact .table-row {
    padding: 8px 10px;
  }
}

@media (max-width: 1050px) {
  .nav {
    flex-wrap: wrap;
    gap: 12px;
  }

  .nav-menu {
    flex-wrap: wrap;
    justify-content: center;
  }

  .nav-actions {
    flex-wrap: wrap;
    justify-content: center;
  }
}

/* Animations */
.fade-in {
  opacity: 0;
  animation: fadeIn 0.8s ease forwards;
}

.slide-up {
  opacity: 0;
  transform: translateY(12px);
  animation: slideUp 0.9s ease forwards;
}

.delay-1 { animation-delay: 0.1s; }
.delay-2 { animation-delay: 0.2s; }
.delay-3 { animation-delay: 0.3s; }

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes slideUp {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: translateY(0); }
}

@media (max-width: 640px) {
  .page { padding: 0 0 32px; }

  /* Keep header compact: brand + quick actions in one row */
  .nav { gap: 10px; }

  .hero h1 { font-size: 30px; }

  .hero-scene { height: 300px; }
  .hero-scene .floating-card { display: none; }

  .hero-meta { grid-template-columns: 1fr; }

  .footer-grid { grid-template-columns: 1fr; }
  .footer-bottom { flex-direction: column; align-items: flex-start; }
}

/* Mobile-first readable rate tables (labels populated by site.js) */
@media (max-width: 640px) {
  .table-card .table-head {
    display: none;
  }

  .table-card .table-row {
    grid-template-columns: 1fr;
    gap: 6px;
    padding: 10px 12px;
    font-size: 13px;
  }

  .table-card .table-row > div {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 8px;
    padding: 4px 0;
    border-bottom: 1px dashed var(--border);
    word-break: break-word;
  }

  .table-card .table-row > div:last-child {
    border-bottom: none;
  }

  .table-card .table-row > div::before {
    content: attr(data-label);
    font-weight: 700;
    color: var(--text);
    margin-right: 8px;
    flex-shrink: 0;
    font-size: 12px;
  }
  
  .table-card.compact .table-row {
    padding: 8px 10px;
  }
}

/* Loading Screen */
.loading-screen {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: var(--bg);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.4s ease;
}

.loading-screen.active {
  opacity: 1;
  pointer-events: auto;
}

.theme-dark .loading-screen {
  background: var(--bg);
}

.loading-screen-content {
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 24px;
}

.loading-logo {
  width: 140px;
  height: 140px;
  animation: breathing 2.5s ease-in-out infinite;
  filter: drop-shadow(0 8px 24px rgba(30, 37, 94, 0.12));
}

.theme-dark .loading-logo {
  filter: drop-shadow(0 8px 24px rgba(0, 0, 0, 0.25));
}

.loading-text {
  font-size: 20px;
  font-weight: 700;
  color: var(--text);
  letter-spacing: -0.01em;
  margin: 0;
  animation: fadeInOut 2.5s ease-in-out infinite;
}

.theme-dark .loading-text {
  color: var(--text);
}

@keyframes breathing {
  0% {
    transform: scale(1);
    opacity: 0.8;
  }
  50% {
    transform: scale(1.12);
    opacity: 1;
  }
  100% {
    transform: scale(1);
    opacity: 0.8;
  }
}

@keyframes fadeInOut {
  0% {
    opacity: 0.6;
  }
  50% {
    opacity: 1;
  }
  100% {
    opacity: 0.6;
  }
}
