/* ===== Base & Typography ===== */
html {
  scroll-behavior: smooth;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  overflow-x: hidden;
}

::selection {
  background: rgba(4, 120, 87, 0.2);
  color: #064e3b;
}

/* ===== Scroll Reveal (progressive enhancement) ===== */
@media (prefers-reduced-motion: no-preference) {
  .reveal {
    opacity: 0;
    transform: translateY(24px);
    transition: opacity 0.7s cubic-bezier(0.16, 1, 0.3, 1), transform 0.7s cubic-bezier(0.16, 1, 0.3, 1);
  }

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

  .reveal:nth-child(2) { transition-delay: 0.08s; }
  .reveal:nth-child(3) { transition-delay: 0.16s; }
  .reveal:nth-child(4) { transition-delay: 0.24s; }
  .reveal:nth-child(5) { transition-delay: 0.32s; }
  .reveal:nth-child(6) { transition-delay: 0.40s; }
}

/* ===== Navbar Scroll State ===== */
#navbar.scrolled {
  background: rgba(253, 248, 240, 0.95);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  box-shadow: 0 1px 0 rgba(4, 120, 87, 0.08);
}

#navbar.scrolled .menu-line {
  background: #047857;
}

#navbar.scrolled .font-serif.text-emerald-800 {
  color: #064e3b !important;
}

#navbar.scrolled .font-light.text-emerald-600 {
  color: #059669 !important;
}

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

#mobile-menu.open .mobile-link {
  animation: fadeUp 0.4s cubic-bezier(0.16, 1, 0.3, 1) both;
}

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

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

/* ===== Hamburger Animation ===== */
.menu-toggle.active .menu-line:nth-child(1) {
  transform: translateY(4px) rotate(45deg);
}

.menu-toggle.active .menu-line:nth-child(2) {
  opacity: 0;
  transform: scaleX(0);
}

.menu-toggle.active .menu-line:nth-child(3) {
  transform: translateY(-4px) rotate(-45deg);
  width: 1rem;
}

/* ===== Focus Styles ===== */
a:focus-visible,
button:focus-visible,
input:focus-visible,
textarea:focus-visible {
  outline: 2px solid #34d399;
  outline-offset: 2px;
  border-radius: 4px;
}

/* ===== Custom Scrollbar ===== */
::-webkit-scrollbar {
  width: 6px;
}

::-webkit-scrollbar-track {
  background: #FDF8F0;
}

::-webkit-scrollbar-thumb {
  background: #a7f3d0;
  border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
  background: #6ee7b7;
}
