/* Base styles & custom properties */
:root {
  --emerald-600: #059669;
  --emerald-700: #047857;
  --cream-50: #fefdf8;
}

/* Smooth scrolling */
html {
  scroll-behavior: smooth;
}

/* Navbar glass effect */
#navbar {
  background: rgba(254, 253, 248, 0.9);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid rgba(5, 150, 105, 0.08);
}

#navbar.scrolled {
  box-shadow: 0 1px 20px rgba(5, 150, 105, 0.08);
}

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

#mobileMenu.active .mobile-link {
  animation: slideIn 0.3s ease forwards;
  opacity: 1;
}

#mobileMenu .mobile-link:nth-child(1) { animation-delay: 0.05s; }
#mobileMenu .mobile-link:nth-child(2) { animation-delay: 0.1s; }
#mobileMenu .mobile-link:nth-child(3) { animation-delay: 0.15s; }
#mobileMenu .mobile-link:nth-child(4) { animation-delay: 0.2s; }
#mobileMenu .mobile-link:nth-child(5) { animation-delay: 0.25s; }

@keyframes slideIn {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: translateY(0); }
}

/* Mobile hamburger animation */
body.menu-open #menuToggle .menu-line:nth-child(1) {
  transform: rotate(45deg) translate(5px, 5px);
}
body.menu-open #menuToggle .menu-line:nth-child(2) {
  opacity: 0;
}
body.menu-open #menuToggle .menu-line:nth-child(3) {
  width: 24px;
  transform: rotate(-45deg) translate(5px, -5px);
}

/* Scroll reveal animations */
/* Default state: visible (progressive enhancement) */
.reveal-up,
.reveal-left,
.reveal-right,
.reveal-card {
  opacity: 1;
  transform: none;
  transition: opacity 0.6s ease, transform 0.6s ease;
}

/* JS-enabled state: hide initially, animate in */
.js .reveal-up {
  opacity: 0;
  transform: translateY(30px);
}

.js .reveal-left {
  opacity: 0;
  transform: translateX(-30px);
}

.js .reveal-right {
  opacity: 0;
  transform: translateX(30px);
}

.js .reveal-card {
  opacity: 0;
  transform: translateY(20px);
}

.js .reveal-up.revealed,
.js .reveal-left.revealed,
.js .reveal-right.revealed,
.js .reveal-card.revealed {
  opacity: 1;
  transform: none;
}

/* Staggered delays for cards */
.js .reveal-card:nth-child(1) { transition-delay: 0.05s; }
.js .reveal-card:nth-child(2) { transition-delay: 0.1s; }
.js .reveal-card:nth-child(3) { transition-delay: 0.15s; }
.js .reveal-card:nth-child(4) { transition-delay: 0.2s; }
.js .reveal-card:nth-child(5) { transition-delay: 0.25s; }
.js .reveal-card:nth-child(6) { transition-delay: 0.3s; }

/* Hero reveal animations */
.js .reveal-up {
  opacity: 0;
  transform: translateY(20px);
}

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

/* Form focus styles */
input:focus,
select:focus,
textarea:focus {
  box-shadow: 0 0 0 3px rgba(5, 150, 105, 0.15);
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
  .reveal-up,
  .reveal-left,
  .reveal-right,
  .reveal-card {
    opacity: 1;
    transform: none;
    transition: none;
  }
  .js .reveal-up,
  .js .reveal-left,
  .js .reveal-right,
  .js .reveal-card {
    opacity: 1;
    transform: none;
  }
  #navbar {
    transition: none;
  }
  #mobileMenu {
    transition: none;
  }
}

/* Custom scrollbar */
::-webkit-scrollbar {
  width: 8px;
}
::-webkit-scrollbar-track {
  background: #fefdf8;
}
::-webkit-scrollbar-thumb {
  background: #a7f3d0;
  border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
  background: #34d399;
}

/* Selection color */
::selection {
  background: rgba(5, 150, 105, 0.2);
  color: #064e3b;
}
