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

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

body {
  margin: 0;
  overflow-x: hidden;
}

::selection {
  background: #064e3b;
  color: #FDF8F0;
}

/* ── NAVBAR ── */
#navbar {
  background: rgba(253, 248, 240, 0.92);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid rgba(6, 78, 59, 0.06);
  transition: background 0.4s ease, box-shadow 0.4s ease;
}

#navbar.scrolled {
  background: rgba(253, 248, 240, 0.97);
  box-shadow: 0 1px 20px rgba(6, 78, 59, 0.08);
}

.nav-link {
  position: relative;
  color: #064e3b;
  transition: color 0.3s ease;
}

.nav-link::after {
  content: '';
  position: absolute;
  bottom: -4px;
  left: 0;
  width: 0;
  height: 1px;
  background: #059669;
  transition: width 0.3s ease;
}

.nav-link:hover::after {
  width: 100%;
}

.nav-link:hover {
  color: #059669;
}

/* ── SCROLL INDICATOR ── */
.scroll-line {
  width: 100%;
  height: 40%;
  background: #059669;
  position: absolute;
  top: 0;
  left: 0;
  animation: scrollDown 1.8s ease-in-out infinite;
}

@keyframes scrollDown {
  0% { transform: translateY(-100%); opacity: 0; }
  50% { opacity: 1; }
  100% { transform: translateY(200%); opacity: 0; }
}

/* ── REVEAL ANIMATIONS ── */
.reveal-up {
  opacity: 1;
  transform: translateY(0);
  transition: opacity 0.7s cubic-bezier(0.22, 1, 0.36, 1), transform 0.7s cubic-bezier(0.22, 1, 0.36, 1);
}

.reveal-scale {
  opacity: 1;
  transform: scale(1);
  transition: opacity 0.8s cubic-bezier(0.22, 1, 0.36, 1), transform 0.8s cubic-bezier(0.22, 1, 0.36, 1);
}

/* Progressive enhancement: reduce motion */
@media (prefers-reduced-motion: reduce) {
  .reveal-up,
  .reveal-scale {
    opacity: 1;
    transform: none;
    transition: none;
  }
  html { scroll-behavior: auto; }
  .scroll-line { animation: none; opacity: 0.5; }
}

/* JS-enabled enhancement only */
@media (prefers-reduced-motion: no-preference) {
  .reveal-up {
    opacity: 0;
    transform: translateY(30px);
  }
  .reveal-scale {
    opacity: 1;
    transform: scale(0.97);
  }
  .reveal-up.revealed {
    opacity: 1;
    transform: translateY(0);
  }
  .reveal-scale.revealed {
    transform: scale(1);
  }
}

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

/* ── MOBILE MENU ── */
#mobile-menu.open {
  opacity: 1;
  pointer-events: all;
}

.mobile-menu-link {
  opacity: 0;
  transform: translateY(10px);
  transition: opacity 0.3s ease, transform 0.3s ease;
}

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

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

/* ── IMAGE HOVER ── */
img {
  display: block;
  max-width: 100%;
}

/* ── FORM ── */
input:focus,
textarea:focus {
  box-shadow: 0 0 0 3px rgba(5, 150, 105, 0.1);
}

/* ── SMOOTH SCROLL OFFSET ── */
section[id] {
  scroll-margin-top: 80px;
}

/* ── UTILITIES ── */
@media (max-width: 767px) {
  section[id] {
    scroll-margin-top: 60px;
  }
}
