/* ── Base ── */
html {
  scroll-behavior: smooth;
}

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

::selection {
  background: #166534;
  color: #fefdf8;
}

/* ── Scroll Reveal (progressive enhancement) ── */
@media (prefers-reduced-motion: no-preference) {
  .reveal {
    opacity: 0;
    transform: translateY(24px);
    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 ── */
#navbar {
  background: transparent;
}

#navbar.scrolled {
  background: rgba(254, 253, 248, 0.92);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  box-shadow: 0 1px 0 rgba(22, 101, 52, 0.08);
}

#navbar.scrolled .nav-link {
  color: rgba(20, 83, 45, 0.7);
}

#navbar.scrolled .font-serif {
  color: #14532d;
}

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

/* ── 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) forwards;
}

#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); }
}

/* ── Menu Button Animation ── */
.menu-btn-active .menu-line:first-child {
  transform: rotate(45deg) translate(3px, 3px);
}

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

.menu-btn-active .menu-line:last-child {
  width: 24px;
  transform: rotate(-45deg) translate(3px, -3px);
}

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

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

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

::-webkit-scrollbar-thumb:hover {
  background: #22c55e;
}

/* ── Focus styles ── */
a:focus-visible,
button:focus-visible,
input:focus-visible,
textarea:focus-visible {
  outline: 2px solid #16a34a;
  outline-offset: 2px;
  border-radius: 4px;
}

/* ── Image placeholder fallback ── */
img {
  background: linear-gradient(135deg, #dcfce7 0%, #bbf7d0 100%);
}
