/* ══════════════════════════════════════════════════
   ForeShiloh Premium Theme
   Shared across all website pages.
   Loaded AFTER page-specific <style> so these override.
   ══════════════════════════════════════════════════ */

/* ── Color palette (overrides per-page :root) ── */
:root {
  --royal-deep: #3D5E42;
  --royal-navy: #4E7054;
  --royal-green: #5E8560;
  --royal-green-light: #839B72;
  --gold: #C5A55A;
  --gold-light: #D4BC78;
  --gold-soft: #EDE3C4;
  --earth: #A89680;
  --earth-light: #BFB09E;
  --sage: #839B72;
  --sage-light: #98AC8A;
  --sage-mist: #DDE6D6;
  --sage-wash: #E8EFE3;
  --cream: #F8FAF6;
  --cream-warm: #F2F5EF;
  --stone: #D6DED0;
  --charcoal: #2D3B2D;
  --slate: #4A5A4A;
  --white: #FFFFFF;
}

/* ── Base rendering ── */
html {
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  scroll-behavior: smooth;
}

body {
  background: var(--white);
  overflow-x: hidden;
}

::selection {
  background: rgba(131, 155, 114, 0.25);
  color: inherit;
}

h1, h2, h3 {
  text-wrap: balance;
}

/* ── Grain overlay ── */
body::after {
  content: '';
  position: fixed;
  inset: 0;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  opacity: 0.025;
  pointer-events: none;
  z-index: 9999;
}

/* ── Cursor spotlight ── */
.cursor-spotlight {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 1;
  background: radial-gradient(800px circle at var(--mx, 50%) var(--my, 50%),
    rgba(131, 155, 114, 0.04), transparent 40%);
  transition: background 0.15s;
}

/* ── Scroll progress bar ── */
.scroll-progress {
  position: fixed;
  top: 0;
  left: 0;
  height: 2px;
  background: linear-gradient(90deg, var(--sage), var(--gold));
  width: 0%;
  z-index: 10001;
  transition: width 0.1s linear;
}

/* ── Glass nav ── */
.nav {
  transition: all 0.5s cubic-bezier(0.16, 1, 0.3, 1) !important;
}

.nav.scrolled {
  background: rgba(255, 255, 255, 0.72) !important;
  backdrop-filter: blur(24px) saturate(1.4) !important;
  -webkit-backdrop-filter: blur(24px) saturate(1.4) !important;
  border-bottom: 1px solid rgba(131, 155, 114, 0.1) !important;
  box-shadow: 0 4px 30px rgba(0, 0, 0, 0.04) !important;
}

/* ── Section spacing ── */
section {
  padding: clamp(64px, 10vh, 120px) 0;
}

/* ── Section dividers ── */
.section-divider {
  height: 1px;
  background: linear-gradient(to right, transparent, var(--stone), transparent);
  max-width: 800px;
  margin: 0 auto;
}

/* ── Gold rule ── */
.gold-rule {
  background: linear-gradient(90deg, var(--gold), var(--gold-light));
}

/* ── Buttons ── */
.btn-gold {
  background: var(--sage) !important;
  color: var(--white) !important;
  border-radius: 8px !important;
  border: none !important;
  transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1) !important;
  box-shadow: 0 2px 8px rgba(131, 155, 114, 0.2), 0 0 0 0 rgba(131, 155, 114, 0);
}

.btn-gold:hover {
  background: var(--royal-deep) !important;
  transform: translateY(-2px);
  box-shadow: 0 16px 48px rgba(131, 155, 114, 0.3), 0 0 0 4px rgba(131, 155, 114, 0.08) !important;
}

.btn-outline {
  color: var(--charcoal) !important;
  font-weight: 500 !important;
  border: 1.5px solid var(--sage-light) !important;
  border-radius: 8px !important;
  transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1) !important;
}

.btn-outline:hover {
  border-color: var(--sage) !important;
  background: var(--sage-wash) !important;
  color: var(--royal-deep) !important;
  transform: translateY(-1px);
}

/* ── Cards ── */
.division-card {
  border-radius: 16px !important;
  transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1) !important;
  position: relative;
  overflow: hidden;
}

.division-card:hover {
  border-color: var(--sage-light) !important;
  box-shadow: 0 20px 60px rgba(131, 155, 114, 0.1), 0 8px 24px rgba(0, 0, 0, 0.04) !important;
  transform: translateY(-6px);
}

.division-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--sage), var(--gold-light));
  opacity: 0;
  transition: opacity 0.4s;
}

.division-card:hover::before {
  opacity: 1;
}

.value-card {
  border-radius: 16px !important;
  transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1) !important;
}

.value-card:hover {
  transform: translateY(-6px);
  box-shadow: 0 20px 60px rgba(131, 155, 114, 0.1), 0 8px 24px rgba(0, 0, 0, 0.04) !important;
  border-color: var(--sage-light) !important;
}

/* ── Glow cards ── */
.glow-card {
  transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
  border-radius: 12px;
  position: relative;
}

.glow-card:hover {
  transform: translateY(-8px) scale(1.01);
  box-shadow: 0 24px 64px rgba(131, 155, 114, 0.15), 0 8px 24px rgba(0,0,0,0.05);
}

/* ── Testimonial cards ── */
.testimonial-card {
  transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
  border-radius: 20px;
}

.testimonial-card:hover {
  transform: translateY(-6px);
  box-shadow: 0 24px 64px rgba(131, 155, 114, 0.1), 0 8px 24px rgba(0,0,0,0.05);
  border-color: var(--sage-light);
}

/* ── Reveal animations ── */
.reveal {
  opacity: 0;
  transform: translateY(30px);
  transition: all 1s cubic-bezier(0.16, 1, 0.3, 1);
}

.reveal.visible {
  opacity: 1;
  transform: translateY(0) rotate(0) scale(1);
}

.reveal-left {
  opacity: 0;
  transform: translateX(-40px);
  transition: all 1s cubic-bezier(0.16, 1, 0.3, 1);
}

.reveal-right {
  opacity: 0;
  transform: translateX(40px);
  transition: all 1s cubic-bezier(0.16, 1, 0.3, 1);
}

.reveal-left.visible, .reveal-right.visible {
  opacity: 1;
  transform: translateX(0);
}

.reveal-scale {
  opacity: 0;
  transform: scale(0.92);
  transition: all 1s cubic-bezier(0.16, 1, 0.3, 1);
}

.reveal-scale.visible {
  opacity: 1;
  transform: scale(1);
}

.reveal-delay-1 { transition-delay: 0.1s; }
.reveal-delay-2 { transition-delay: 0.2s; }
.reveal-delay-3 { transition-delay: 0.3s; }
.reveal-delay-4 { transition-delay: 0.4s; }
.reveal-delay-5 { transition-delay: 0.5s; }

/* ── Footer (light theme) ── */
footer {
  background: var(--white) !important;
  border-top: 1px solid var(--stone);
}

footer a {
  color: var(--earth) !important;
  transition: color 0.3s;
}

footer a:hover {
  color: var(--gold) !important;
}

/* ── About-dark (contact CTA, light theme) ── */
.about-dark {
  background: linear-gradient(160deg, var(--sage-mist) 0%, var(--cream) 100%) !important;
  border-top: 1px solid var(--stone);
}

/* ── Hero sections (convert dark heroes to light) ── */
.hero,
.page-hero {
  background: linear-gradient(160deg, var(--sage-wash) 0%, var(--sage-mist) 40%, var(--cream) 100%) !important;
}

.hero::before,
.page-hero::before {
  background: radial-gradient(circle, rgba(131, 155, 114, 0.08) 0%, transparent 70%) !important;
}

.hero::after,
.page-hero::after {
  background: radial-gradient(circle, rgba(197, 165, 90, 0.06) 0%, transparent 70%) !important;
}

/* Fix text colors in converted hero sections */
.hero h1,
.hero h2,
.hero p,
.page-hero h1,
.page-hero h2,
.page-hero-heading {
  color: var(--charcoal) !important;
}

.hero .label,
.page-hero .label {
  color: var(--gold) !important;
}

.hero em,
.page-hero em {
  color: var(--gold) !important;
}

.hero .font-body,
.page-hero .font-body,
.hero-sub {
  color: var(--slate) !important;
}

/* ── School banner (education page) ── */
.school-banner {
  background: linear-gradient(160deg, var(--sage-mist) 0%, var(--cream) 100%) !important;
}

.school-banner h2,
.school-banner h3,
.school-banner p {
  color: var(--charcoal) !important;
}

/* ── Pricing section (masterclass) ── */
.pricing {
  background: var(--cream) !important;
  color: var(--charcoal) !important;
}

.pricing h2,
.pricing h3,
.pricing p {
  color: var(--charcoal) !important;
}

/* ── Dark sections (converted to light) ── */
.dark-section {
  background: linear-gradient(160deg, var(--sage-wash) 0%, var(--sage-mist) 40%, var(--cream) 100%) !important;
}

.dark-section::before,
.dark-section::after {
  background: radial-gradient(circle, rgba(131, 155, 114, 0.06) 0%, transparent 70%) !important;
}

.dark-section h1,
.dark-section h2,
.dark-section h3,
.dark-section .font-display,
.dark-section .savings-number {
  color: var(--charcoal) !important;
}

.dark-section p,
.dark-section .font-body,
.dark-section li {
  color: var(--slate) !important;
}

.dark-section .label {
  color: var(--gold) !important;
}

.dark-section em,
.dark-section .font-accent {
  color: var(--gold) !important;
}

.features-section {
  background: var(--cream) !important;
}

/* ── CTA sections ── */
.cta-section {
  background: linear-gradient(160deg, var(--sage-mist) 0%, var(--cream) 100%) !important;
}

/* ── Form inputs ── */
.form-input {
  border-radius: 8px;
  background: var(--white) !important;
  border-color: var(--stone) !important;
  color: var(--charcoal) !important;
}

.form-input:focus {
  border-color: var(--sage) !important;
  box-shadow: 0 0 0 3px rgba(131, 155, 114, 0.12);
}

/* ── Dot grid pattern ── */
.dot-grid-bg {
  position: relative;
}

.dot-grid-bg::before {
  content: '';
  position: absolute;
  inset: 0;
  background-image: radial-gradient(circle, var(--stone) 1px, transparent 1px);
  background-size: 32px 32px;
  opacity: 0.5;
  pointer-events: none;
}

/* ── Animations ── */
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(28px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes float {
  0%, 100% { transform: translateY(0px); }
  50% { transform: translateY(-12px); }
}

@keyframes drift {
  0%, 100% { transform: translate(0, 0) scale(1); }
  25% { transform: translate(10px, -15px) scale(1.02); }
  50% { transform: translate(-5px, -25px) scale(0.98); }
  75% { transform: translate(-15px, -10px) scale(1.01); }
}

@keyframes breathe {
  0%, 100% { opacity: 0.4; transform: scale(1); }
  50% { opacity: 0.7; transform: scale(1.08); }
}

@keyframes gradient-shift {
  0% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
  100% { background-position: 0% 50%; }
}

/* ── Stagger grid children ── */
.stagger-grid > * { transition: all 0.8s cubic-bezier(0.16, 1, 0.3, 1); }
.stagger-grid > *:nth-child(1) { transition-delay: 0.05s; }
.stagger-grid > *:nth-child(2) { transition-delay: 0.12s; }
.stagger-grid > *:nth-child(3) { transition-delay: 0.19s; }
.stagger-grid > *:nth-child(4) { transition-delay: 0.26s; }

/* ── Reduced motion ── */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
