@import url('https://fonts.googleapis.com/css2?family=Bebas+Neue&family=DM+Sans:opsz,wght@9..40,400;9..40,500;9..40,700&display=swap');

:root {
  --bg-color: #0a0a0a;
  --accent-color: #FFD700;
  --text-primary: #FFFFFF;
  --text-secondary: #888888;
  --font-heading: 'Bebas Neue', sans-serif;
  --font-body: 'DM Sans', sans-serif;
  --transition-smooth: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  -webkit-tap-highlight-color: transparent;
  -webkit-touch-callout: none;
}

body {
  background-color: var(--bg-color);
  color: var(--text-primary);
  font-family: var(--font-body);
  line-height: 1.6;
  overflow-x: hidden;
}

h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-heading);
  font-weight: normal;
  line-height: 1.1;
  letter-spacing: 1px;
}

a {
  text-decoration: none;
  color: inherit;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
}

button, .card {
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
}

img {
  max-width: 100%;
  display: block;
}

/* Grain Overlay */
.grain-overlay {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  pointer-events: none;
  z-index: 9999;
  opacity: 0.05;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noiseFilter'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.65' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noiseFilter)'/%3E%3C/svg%3E");
}

/* Typography Utilities */
.text-accent { color: var(--accent-color); }
.text-secondary { color: var(--text-secondary); }

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 12px 32px;
  font-family: var(--font-heading);
  font-size: 1.2rem;
  letter-spacing: 1px;
  border-radius: 50px;
  cursor: pointer;
  transition: var(--transition-smooth);
  text-transform: uppercase;
  border: 2px solid transparent;
}

.btn-primary {
  background-color: var(--accent-color);
  color: #000000;
}

.btn-primary:hover {
  background-color: #FFC300;
  box-shadow: 0 0 15px rgba(255, 215, 0, 0.5);
}

.btn-outline {
  background-color: transparent;
  border-color: var(--text-primary);
  color: var(--text-primary);
}

.btn-outline:hover {
  background-color: var(--text-primary);
  color: var(--bg-color);
}

/* Layout Utilities */
.container {
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 24px;
}

.section {
  padding: 100px 0;
}

/* Navbar */
.navbar {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 1000;
  padding: 24px 0;
  transition: var(--transition-smooth);
}

.navbar.scrolled {
  background-color: rgba(10, 10, 10, 0.95);
  backdrop-filter: blur(10px);
  padding: 16px 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.nav-container {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.nav-logo {
  font-family: var(--font-heading);
  font-size: 2rem;
  letter-spacing: 2px;
  color: var(--text-primary);
}

.nav-links {
  display: flex;
  gap: 32px;
  align-items: center;
}

.nav-link {
  font-size: 0.95rem;
  font-weight: 500;
  color: var(--text-primary);
  transition: color 0.3s ease;
  position: relative;
}

.nav-link:hover, .nav-link.active {
  color: var(--accent-color);
}

.nav-link::after {
  content: '';
  position: absolute;
  bottom: -4px;
  left: 0;
  width: 0;
  height: 2px;
  background-color: var(--accent-color);
  transition: width 0.3s ease;
}

.nav-link:hover::after, .nav-link.active::after {
  width: 100%;
}

.mobile-menu-btn {
  display: none;
  background: none;
  border: none;
  color: var(--text-primary);
  font-size: 1.5rem;
  cursor: pointer;
  z-index: 1001;
}

/* Footer */
.footer {
  background-color: #050505;
  padding: 60px 0 30px;
  border-top: 1px solid rgba(255, 255, 255, 0.05);
}

.footer-grid {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  gap: 40px;
  align-items: center;
  margin-bottom: 40px;
}

.footer-brand h2 {
  font-size: 2.5rem;
  margin-bottom: 8px;
}

.footer-brand p {
  color: var(--text-secondary);
}

.footer-links {
  display: flex;
  gap: 24px;
}

.footer-social {
  display: flex;
  gap: 16px;
  justify-content: flex-end;
}

.footer-social a {
  width: 40px; height: 40px;
  border-radius: 50%;
  background-color: rgba(255,255,255,0.05);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: var(--transition-smooth);
}

.footer-social a:hover {
  background-color: var(--accent-color);
  transform: translateY(-3px);
}

.footer-bottom {
  text-align: center;
  padding-top: 30px;
  border-top: 1px solid rgba(255, 255, 255, 0.05);
  color: var(--text-secondary);
  font-size: 0.9rem;
}

/* Animations & Effects */
.fade-up {
  opacity: 0;
  transform: translateY(40px);
  transition: opacity 0.8s ease-out, transform 0.8s ease-out;
}

.fade-up.visible {
  opacity: 1;
  transform: translateY(0);
}

.stagger-1 { transition-delay: 0.1s; }
.stagger-2 { transition-delay: 0.2s; }
.stagger-3 { transition-delay: 0.3s; }
.stagger-4 { transition-delay: 0.4s; }

.hover-glow {
  transition: var(--transition-smooth);
}

.hover-glow:hover {
  box-shadow: 0 10px 30px rgba(255, 215, 0, 0.15);
  transform: translateY(-8px);
}

/* Mobile Responsive */
@media (max-width: 768px) {
  /* FIX 2 — HORIZONTAL SCROLL */
  *, *::before, *::after { box-sizing: border-box; }
  html, body {
    overflow-x: hidden;
    max-width: 100vw;
  }
  * { max-width: 100%; }
  
  /* Flex wrap fallback for horizontal scroll */
  .nav-container, .nav-links, .hero-ctas, .section-header, .preview-grid, .testimonials-grid, .footer-grid, .footer-links, .footer-social, .author-info, .story-grid, .timeline-container, .values-grid, .pricing-grid, .location-grid, .contact-info {
    flex-wrap: wrap;
    min-width: 0;
  }

  /* FIX 1 — HAMBURGER MENU */
  .nav-links {
    position: fixed;
    top: -100vh;
    left: 0;
    width: 100%; 
    height: 100vh;
    background-color: #0a0a0a;
    z-index: 9998;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    transition: top 0.3s ease;
    gap: 30px;
    padding: 80px 20px 40px 20px;
  }
  
  .nav-links.active {
    top: 0;
  }

  .nav-link {
    font-family: 'Bebas Neue', sans-serif;
    font-size: 36px;
    color: #ffffff;
    transition: color 0.2s ease;
  }

  .nav-link:active, .nav-link:hover {
    color: #FFD700;
  }
  
  .nav-link::after {
    display: none;
  }

  .nav-links .btn.nav-cta {
    width: 100%;
    background-color: #FFD700;
    color: #000000;
    margin-top: auto;
    font-family: 'Bebas Neue', sans-serif;
  }

  .mobile-menu-btn {
    display: block;
    z-index: 9999;
    position: relative;
  }

  .footer-grid {
    grid-template-columns: 1fr;
    text-align: center;
    gap: 30px;
  }

  .footer-social {
    justify-content: center;
  }
}

/* ── Parallax Performance Hints ────────────────────────────────────────────── */
.hero,
.page-hero {
  /* Needed so the bg-position shift doesn't bleed outside the hero bounds */
  overflow: hidden;
  /* Smooth background position transitions handled by rAF, not CSS */
  background-attachment: scroll; /* Ensure CSS parallax doesn't interfere */
}

/* FIX 3 — on mobile the hero overflow:hidden traps the page; reset it */
@media (max-width: 768px) {
  .hero,
  .page-hero {
    overflow: visible;
    min-height: 100vh;
    height: auto;
  }

  /* Ensure the loader overlay never blocks touch events after it hides */
  #loader-overlay {
    pointer-events: none;
  }
}

.hero-content,
.grain-overlay,
.stat-item,
.facility-card,
.story-content,
.story-image-placeholder,
.pricing-card.popular,
.map-container {
  will-change: transform;
}

/* Prevent map iframe from swallowing overflow during parallax shift */
.map-container {
  overflow: hidden;
}

/* ── Reduced-motion & Mobile: strip all parallax hints ─────────────────────── */
@media (max-width: 767px),
       (prefers-reduced-motion: reduce) {
  .hero-content,
  .grain-overlay,
  .stat-item,
  .facility-card,
  .story-content,
  .story-image-placeholder,
  .pricing-card.popular,
  .map-container {
    will-change: auto;
    transform: none !important;
  }

  .hero,
  .page-hero {
    background-position: center center !important;
  }
}

/* ── Loading Screen ─────────────────────────────────────────────────────────── */
#loader-overlay {
  position: fixed;
  inset: 0;
  background: #0a0a0a;
  z-index: 99999;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 24px;
  transition: opacity 0.4s ease, transform 0.4s ease;
}

#loader-overlay.hide {
  opacity: 0;
  transform: translateY(-60px);
  pointer-events: none;
}

#loader-logo {
  font-family: 'Bebas Neue', sans-serif;
  font-size: 36px;
  color: #FFD700;
  letter-spacing: 3px;
  text-transform: uppercase;
  opacity: 0;
  animation: loaderLogoFadeIn 0.3s ease 0.15s forwards;
}

#loader-bar-track {
  width: min(320px, 75vw);
  height: 3px;
  background: rgba(255, 215, 0, 0.15);
  border-radius: 2px;
  overflow: hidden;
  opacity: 0;
  animation: loaderLogoFadeIn 0.3s ease 0.15s forwards;
}

#loader-bar-fill {
  height: 100%;
  width: 0;
  background: #FFD700;
  border-radius: 2px;
  box-shadow: 0 0 8px rgba(255, 215, 0, 0.6);
  animation: loaderBarFill 1.5s cubic-bezier(0.25, 0.46, 0.45, 0.94) 0.35s forwards;
}

#loader-text {
  font-family: 'DM Sans', sans-serif;
  font-size: 11px;
  color: #888888;
  letter-spacing: 4px;
  text-transform: uppercase;
  opacity: 0;
  animation:
    loaderLogoFadeIn 0.3s ease 0.15s forwards,
    loaderBlink 1s ease-in-out 0.5s infinite;
}

@keyframes loaderLogoFadeIn {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: translateY(0); }
}

@keyframes loaderBarFill {
  from { width: 0%; }
  to   { width: 100%; }
}

@keyframes loaderBlink {
  0%, 100% { opacity: 0.9; }
  50%       { opacity: 0.25; }
}
