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

html {
  scroll-behavior: smooth;
  scroll-padding-top: 80px;
}

body {
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

::selection {
  background: rgba(22, 101, 52, 0.2);
  color: #0f2419;
}

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

.reveal.revealed {
  opacity: 1;
  transform: translateY(0);
}

.reveal:nth-child(2) { transition-delay: 0.1s; }
.reveal:nth-child(3) { transition-delay: 0.2s; }
.reveal:nth-child(4) { transition-delay: 0.3s; }

/* Navbar scroll state */
#navbar.scrolled {
  background: rgba(5, 46, 22, 0.92);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  box-shadow: 0 1px 40px rgba(0, 0, 0, 0.2);
}

#navbar.scrolled a:not([class*="bg-"]) {
  color: rgba(255, 255, 255, 0.85) !important;
}

/* Mobile menu */
#mobileMenu.open {
  opacity: 1;
  pointer-events: all;
}

#mobileMenu.closed {
  opacity: 0;
  pointer-events: none;
}

/* Button focus */
button:focus-visible,
input:focus-visible,
textarea:focus-visible,
a:focus-visible {
  outline: 2px solid #4ade80;
  outline-offset: 2px;
}

/* Custom scrollbar */
::-webkit-scrollbar { width: 8px; }
::-webkit-scrollbar-track { background: #f5f5f0; }
::-webkit-scrollbar-thumb { background: #166534; border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: #14532d; }

/* Smooth image loading */
img {
  opacity: 1;
  transition: opacity 0.4s ease;
}

img[loading="lazy"] {
  opacity: 0;
}

img[loading="lazy"].loaded {
  opacity: 1;
}

/* Decorative divider animation */
@keyframes growWidth {
  from { width: 0; }
  to { width: 80px; }
}

.hero-divider {
  animation: growWidth 1s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

/* Gradient shimmer on hero */
@keyframes shimmer {
  0% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
  100% { background-position: 0% 50%; }
}

.hero-gradient {
  background-size: 200% 200%;
  animation: shimmer 8s ease infinite;
}
