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

body {
  overflow-x: hidden;
}

::selection {
  background-color: rgba(45, 90, 61, 0.2);
  color: #142a1c;
}

/* ===== HEADER ===== */
#header {
  background: rgba(253, 252, 250, 0);
  backdrop-filter: blur(0px);
  transition: background 0.5s ease, backdrop-filter 0.5s ease, box-shadow 0.5s ease;
}

#header.scrolled {
  background: rgba(253, 252, 250, 0.92);
  backdrop-filter: blur(16px);
  box-shadow: 0 1px 0 rgba(45, 90, 61, 0.08);
}

/* ===== MOBILE MENU ===== */
.mobile-link {
  opacity: 0;
  transform: translateY(12px);
  transition: opacity 0.3s ease, transform 0.3s ease, color 0.2s ease;
}

body.menu-open .mobile-link {
  opacity: 1;
  transform: translateY(0);
}

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

#mobileMenu {
  transition: opacity 0.3s ease, visibility 0.3s ease;
}

#mobileMenu.open {
  opacity: 1;
  pointer-events: all;
}

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

/* Hamburger animation */
body.menu-open .menu-line:nth-child(1) {
  transform: rotate(45deg) translate(4px, 4px);
}
body.menu-open .menu-line:nth-child(2) {
  opacity: 0;
}
body.menu-open .menu-line:nth-child(3) {
  transform: rotate(-45deg) translate(5px, -5px);
  width: 1.25rem;
}

/* ===== SCROLL REVEAL ===== */
.reveal {
  opacity: 0;
  transform: translateY(32px);
  transition: opacity 0.7s cubic-bezier(0.22, 1, 0.36, 1), transform 0.7s cubic-bezier(0.22, 1, 0.36, 1);
}

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

.reveal-delay-1 { transition-delay: 0.1s; }
.reveal-delay-2 { transition-delay: 0.2s; }
.reveal-delay-3 { transition-delay: 0.3s; }
.reveal-delay-4 { transition-delay: 0.4s; }
.reveal-delay-5 { transition-delay: 0.5s; }
.reveal-delay-6 { transition-delay: 0.6s; }

/* ===== FORM ===== */
input:focus,
select:focus,
textarea:focus {
  outline: none;
}

/* ===== ACCESSIBILITY ===== */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
  html { scroll-behavior: auto; }
  .reveal { opacity: 1; transform: none; }
}

/* ===== FOCUS VISIBLE ===== */
a:focus-visible,
button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
  outline: 2px solid #2D5A3D;
  outline-offset: 2px;
  border-radius: 4px;
}
