:root {
  --color-primary: #1E3A8A;
  --color-primary-dark: #0B1F5C;
  --color-accent: #C9A961;
  --color-accent-light: #E5C687;
  --color-cream: #FAF6EE;
  --color-ink: #0B1733;
}

* { -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; }
html { scroll-behavior: smooth; scroll-padding-top: 80px; }
body { overflow-x: hidden; }

/* ========== HEADER STATES ========== */
#header {
  color: #fff;
  background: rgba(250, 246, 238, 0);
  backdrop-filter: blur(0px);
  -webkit-backdrop-filter: blur(0px);
  border-bottom: 1px solid rgba(11, 23, 51, 0);
  box-shadow: 0 4px 30px rgba(11, 23, 51, 0);
  transition: background 0.3s ease, backdrop-filter 0.3s ease, -webkit-backdrop-filter 0.3s ease, border-color 0.3s ease, box-shadow 0.3s ease, color 0.3s ease;
}
#header .nav-link { color: rgba(255, 255, 255, 0.9); transition: color 0.2s ease; }
#header .nav-link:hover { color: var(--color-accent-light); }
#header .logo-mark { background: linear-gradient(135deg, rgba(255,255,255,0.15), rgba(255,255,255,0.06)); border: 1px solid rgba(255,255,255,0.25); }
#header .logo-mark span { color: #fff; }
#header .logo-name { color: #fff; }
#header .logo-tag { color: var(--color-accent-light); }

#header.scrolled {
  background: rgba(250, 246, 238, 0.92);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom-color: rgba(11, 23, 51, 0.06);
  color: var(--color-ink);
  box-shadow: 0 4px 30px rgba(11, 23, 51, 0.06);
}
#header.scrolled .nav-link { color: var(--color-ink); }
#header.scrolled .nav-link:hover { color: var(--color-primary); }
#header.scrolled .logo-mark { background: linear-gradient(135deg, var(--color-primary), var(--color-primary-dark)); border-color: transparent; }
#header.scrolled .logo-mark span { color: #fff; }
#header.scrolled .logo-name { color: var(--color-ink); }
#header.scrolled .logo-tag { color: var(--color-primary); }
#header.scrolled #menuToggle { color: var(--color-ink); }

#menuToggle { color: #fff; }

/* ========== MOBILE MENU ========== */
#mobileMenu.is-open {
  visibility: visible;
  opacity: 1;
}
#mobileMenu { transition: opacity 0.3s ease, visibility 0.3s ease; }
#mobileMenu .mobile-link { transform: translateY(20px); opacity: 0; transition: transform 0.5s ease, opacity 0.5s ease; }
#mobileMenu.is-open .mobile-link { transform: translateY(0); opacity: 1; }
#mobileMenu.is-open .mobile-link:nth-child(1) { transition-delay: 0.1s; }
#mobileMenu.is-open .mobile-link:nth-child(2) { transition-delay: 0.15s; }
#mobileMenu.is-open .mobile-link:nth-child(3) { transition-delay: 0.2s; }
#mobileMenu.is-open .mobile-link:nth-child(4) { transition-delay: 0.25s; }
#mobileMenu.is-open .mobile-link:nth-child(5) { transition-delay: 0.3s; }

body.menu-open { overflow: hidden; }

/* hamburger -> X animation */
#menuToggle.is-active .hamburger-line:nth-child(1) { transform: translateY(7px) rotate(45deg); }
#menuToggle.is-active .hamburger-line:nth-child(2) { opacity: 0; }
#menuToggle.is-active .hamburger-line:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* ========== HERO ========== */
.hero-bg {
  background:
    radial-gradient(ellipse 80% 60% at 85% 15%, rgba(201, 169, 97, 0.22), transparent 60%),
    radial-gradient(ellipse 70% 50% at 15% 85%, rgba(59, 91, 217, 0.28), transparent 60%),
    linear-gradient(160deg, #0B1733 0%, #0B1F5C 45%, #1E3A8A 100%);
}

.hero-orb {
  border-radius: 50%;
  filter: blur(80px);
  will-change: transform;
}
.hero-orb-gold {
  width: 520px;
  height: 520px;
  top: -120px;
  right: -80px;
  background: radial-gradient(circle, rgba(229,198,135,0.45), rgba(201,169,97,0.15) 40%, transparent 70%);
  animation: orb-drift-1 14s ease-in-out infinite alternate;
}
.hero-orb-blue {
  width: 600px;
  height: 600px;
  bottom: -180px;
  left: -120px;
  background: radial-gradient(circle, rgba(59,91,217,0.5), rgba(30,58,138,0.2) 40%, transparent 70%);
  animation: orb-drift-2 18s ease-in-out infinite alternate;
}
@keyframes orb-drift-1 {
  from { transform: translate(0, 0) scale(1); }
  to { transform: translate(-40px, 30px) scale(1.08); }
}
@keyframes orb-drift-2 {
  from { transform: translate(0, 0) scale(1); }
  to { transform: translate(50px, -40px) scale(1.1); }
}

.hero-text { text-shadow: 0 2px 10px rgba(0,0,0,0.45), 0 6px 22px rgba(0,0,0,0.25); }

.hero-title { animation: hero-fade-up 1.2s ease-out 0.2s both; }
.hero-label { animation: hero-fade-up 1.2s ease-out 0.05s both; }
.hero-sub { animation: hero-fade-up 1.2s ease-out 0.4s both; }
.hero-title + p, .hero-title ~ p, .hero-title ~ div { animation: hero-fade-up 1.2s ease-out 0.6s both; }
.hero-scroll { animation: hero-fade-up 1.5s ease-out 1s both, scroll-bounce 2.4s ease-in-out 2s infinite; }
.hero-badge-top { animation: hero-fade-in 1.5s ease-out 0.8s both, hero-float 5s ease-in-out 2s infinite; }
.hero-years {
  background: linear-gradient(120deg, var(--color-accent-light) 0%, #fff 50%, var(--color-accent-light) 100%);
  background-size: 200% auto;
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  text-shadow: none;
  filter: drop-shadow(0 2px 10px rgba(0,0,0,0.5));
  animation: shine 4s ease-in-out infinite;
}
@keyframes shine {
  0%, 100% { background-position: 0% center; }
  50% { background-position: 200% center; }
}
@keyframes hero-fade-up {
  from { opacity: 0; transform: translateY(28px); }
  to { opacity: 1; transform: translateY(0); }
}
@keyframes hero-fade-in {
  from { opacity: 0; }
  to { opacity: 1; }
}
@keyframes hero-float {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-8px); }
}
@keyframes scroll-bounce {
  0%, 100% { transform: translate(-50%, 0); }
  50% { transform: translate(-50%, 6px); }
}

/* ========== SCROLL REVEAL ========== */
.reveal {
  opacity: 0;
  transform: translateY(30px);
  transition: opacity 0.9s ease-out, transform 0.9s cubic-bezier(0.22, 1, 0.36, 1);
}
.reveal.is-visible {
  opacity: 1;
  transform: translateY(0);
}

/* Cascade for category cards */
.category-card.reveal { transition-delay: 0s; }
.grid > .category-card.reveal:nth-child(1).is-visible { transition-delay: 0.05s; }
.grid > .category-card.reveal:nth-child(2).is-visible { transition-delay: 0.15s; }
.grid > .category-card.reveal:nth-child(3).is-visible { transition-delay: 0.25s; }
.grid > .category-card.reveal:nth-child(4).is-visible { transition-delay: 0.35s; }

/* ========== STAT COUNTERS ========== */
.stat-item { position: relative; }
.stat-item::before {
  content: '';
  position: absolute;
  inset: -10px -8px;
  border-radius: 16px;
  border: 1px solid transparent;
  pointer-events: none;
  transition: border-color 0.3s ease;
}
@media (min-width: 768px) {
  .stat-item:not(:last-child)::after {
    content: '';
    position: absolute;
    right: 0;
    top: 25%;
    bottom: 25%;
    width: 1px;
    background: linear-gradient(to bottom, transparent, rgba(255,255,255,0.2), transparent);
  }
}

/* ========== FEATURE / VALUE CARDS ========== */
.value-card {
  transition: transform 0.4s cubic-bezier(0.22, 1, 0.36, 1), box-shadow 0.4s, border-color 0.3s;
}
.value-card:hover {
  box-shadow: 0 18px 40px rgba(11, 23, 51, 0.08);
  border-color: rgba(30, 58, 138, 0.15);
}

.feature-card {
  transition: transform 0.4s cubic-bezier(0.22, 1, 0.36, 1), box-shadow 0.4s, border-color 0.3s;
}
.feature-card:hover {
  box-shadow: 0 18px 50px rgba(11, 23, 51, 0.1);
}

/* ========== REVIEW CARDS ========== */
.review-card {
  transition: background 0.3s, border-color 0.3s, box-shadow 0.4s;
}

/* ========== INFO CARDS ========== */
.info-card {
  transition: transform 0.4s cubic-bezier(0.22, 1, 0.36, 1), box-shadow 0.4s, border-color 0.3s;
}
.info-card:not(.bg-gradient-to-br):hover {
  box-shadow: 0 18px 40px rgba(11, 23, 51, 0.08);
}

/* ========== STICKY CTA ========== */
#stickyCta {
  transform: translateY(100px) scale(0.8);
  opacity: 0;
  transition: transform 0.45s cubic-bezier(0.22, 1, 0.36, 1), opacity 0.4s;
}
#stickyCta.is-visible {
  transform: translateY(0) scale(1);
  opacity: 1;
}
#stickyCta:active { transform: translateY(0) scale(0.95); }
@keyframes cta-pulse {
  0%, 100% { box-shadow: 0 12px 36px rgba(30, 58, 138, 0.4), 0 0 0 0 rgba(30, 58, 138, 0.4); }
  50% { box-shadow: 0 12px 36px rgba(30, 58, 138, 0.4), 0 0 0 10px rgba(30, 58, 138, 0); }
}
#stickyCta.is-visible { animation: cta-pulse 2.4s ease-in-out infinite; }

/* ========== GLIGHTBOX ========== */
.glightbox-clean .gslide-media {
  max-width: 90vw !important;
  max-height: 90vh !important;
}
.glightbox-clean .gslide-image img {
  max-width: 100%;
  max-height: 90vh;
  object-fit: contain;
  width: auto;
  height: auto;
}

/* ========== SECTION DIVIDER GRAIN ========== */
.bg-cream::after,
.bg-cream-dark\/40::after {
  content: '';
  position: absolute;
  inset: 0;
  background-image: url('data:image/svg+xml;utf8,<svg xmlns=%22http://www.w3.org/2000/svg%22 width=%22150%22 height=%22150%22><filter id=%22n%22><feTurbulence type=%22fractalNoise%22 baseFrequency=%220.85%22/></filter><rect width=%22150%22 height=%22150%22 filter=%22url(%23n)%22 opacity=%220.4%22/></svg>');
  opacity: 0.04;
  pointer-events: none;
  mix-blend-mode: multiply;
}

/* ========== UTILITIES ========== */
@media (max-width: 768px) {
  .hero-title { line-height: 1; }
}

/* Reduce motion */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
  .hero-orb { animation: none; }
}
