/* YucatanLands — Main Stylesheet */
/* Supplement to Tailwind CDN. Variables, keyframes, custom utilities. */

:root {
  --font-display: 'Outfit', system-ui, sans-serif;
  --font-mono: 'JetBrains Mono', monospace;

  --jungle-950: #070f0a;
  --jungle-900: #0c1a12;
  --jungle-800: #1c3025;
  --jungle-700: #274535;
  --cenote-400: #c8873a;
  --cenote-500: #b5732a;

  --ease-spring: cubic-bezier(0.32, 0.72, 0, 1);
  --ease-out-expo: cubic-bezier(0.16, 1, 0.3, 1);
}

/* ─── Base ─── */
*, *::before, *::after { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  font-family: var(--font-display);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}

/* ─── Scroll Reveal ─── */
.reveal-item {
  opacity: 0;
  transform: translateY(24px);
  transition:
    opacity 0.7s var(--ease-out-expo),
    transform 0.7s var(--ease-out-expo);
}

.reveal-item.is-visible {
  opacity: 1;
  transform: translateY(0);
}

/* Stagger siblings */
.reveal-item:nth-child(2) { transition-delay: 0.07s; }
.reveal-item:nth-child(3) { transition-delay: 0.14s; }
.reveal-item:nth-child(4) { transition-delay: 0.21s; }
.reveal-item:nth-child(5) { transition-delay: 0.28s; }
.reveal-item:nth-child(6) { transition-delay: 0.35s; }

/* ─── Nav ─── */
#nav {
  transition: transform 0.5s var(--ease-spring);
}

#nav.nav-hidden {
  transform: translateY(-120%);
}

/* ─── Mobile Menu ─── */
#mobile-menu.is-open {
  opacity: 1;
  pointer-events: auto;
}

#mobile-menu.is-open .mobile-nav-item {
  opacity: 1;
  transform: translateY(0);
}

/* Hamburger morph */
#menu-btn.is-open .hamburger-line:first-child {
  transform: translateY(3.25px) rotate(45deg);
  transform-origin: center;
}
#menu-btn.is-open .hamburger-line:last-child {
  transform: translateY(-3.25px) rotate(-45deg);
  transform-origin: center;
}

/* ─── Cenote grid image hover ─── */
.cenote-card img {
  transition: transform 0.8s var(--ease-spring);
}
.cenote-card:hover img {
  transform: scale(1.04);
}

/* ─── FAQ Accordion ─── */
.faq-content {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.4s var(--ease-out-expo);
}
.faq-item.is-open .faq-content {
  max-height: 400px;
}
.faq-item.is-open .faq-icon {
  transform: rotate(180deg);
}
.faq-icon {
  transition: transform 0.35s var(--ease-spring);
}

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

/* ─── WhatsApp button pulse ─── */
@keyframes wa-pulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(37,211,102,0.4); }
  50%       { box-shadow: 0 0 0 8px rgba(37,211,102,0); }
}
.wa-btn { animation: wa-pulse 2.5s ease-in-out infinite; }

/* ─── Stat bar dividers on mobile ─── */
@media (max-width: 767px) {
  .stat-item:not(:last-child) {
    border-bottom: 1px solid #e5e7eb;
    padding-bottom: 1.25rem;
    margin-bottom: 1.25rem;
  }
}

/* ─── Reduced motion ─── */
@media (prefers-reduced-motion: reduce) {
  .reveal-item {
    opacity: 1;
    transform: none;
    transition: none;
  }
  body::after { display: none; }
  .wa-btn { animation: none; }
  * { transition-duration: 0.01ms !important; }
}
