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

body {
  overflow-x: hidden;
}

::selection {
  background-color: #065f46;
  color: #fefdf8;
}

/* ── Scroll Reveal (progressive enhancement) ── */
@media (prefers-reduced-motion: no-preference) {
  .scroll-reveal {
    opacity: 0;
    transform: translateY(32px);
    transition: opacity 0.8s cubic-bezier(0.16, 1, 0.3, 1), transform 0.8s cubic-bezier(0.16, 1, 0.3, 1);
  }
  .scroll-reveal.revealed {
    opacity: 1;
    transform: translateY(0);
  }
  .scroll-reveal:nth-child(2) { transition-delay: 0.1s; }
  .scroll-reveal:nth-child(3) { transition-delay: 0.2s; }
  .scroll-reveal:nth-child(4) { transition-delay: 0.3s; }
  .scroll-reveal:nth-child(5) { transition-delay: 0.4s; }
  .scroll-reveal:nth-child(6) { transition-delay: 0.5s; }
}

/* ── Hero Animations (above-the-fold — always visible) ── */
.hero-anim {
  opacity: 1;
  transform: translateY(0);
  animation: heroSlideUp 0.8s cubic-bezier(0.16, 1, 0.3, 1) both;
}
.hero-anim:nth-child(1) { animation-delay: 0.1s; }
.hero-anim:nth-child(2) { animation-delay: 0.25s; }
.hero-anim:nth-child(3) { animation-delay: 0.4s; }
.hero-anim:nth-child(4) { animation-delay: 0.55s; }

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

.hero-img-anim {
  animation: heroImgIn 1s cubic-bezier(0.16, 1, 0.3, 1) 0.2s both;
}

@keyframes heroImgIn {
  from {
    opacity: 0;
    transform: translateX(40px) scale(0.97);
  }
  to {
    opacity: 1;
    transform: translateX(0) scale(1);
  }
}

/* ── Navbar ── */
#navbar {
  background: transparent;
  transition: background-color 0.4s ease, box-shadow 0.4s ease, backdrop-filter 0.4s ease;
}

#navbar.scrolled {
  background: rgba(254, 253, 248, 0.92);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  box-shadow: 0 1px 0 rgba(6, 95, 70, 0.08);
}

.nav-link {
  position: relative;
}

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

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

/* ── Mobile Menu ── */
#mobile-menu.open {
  transform: translateX(0);
}

.menu-line:last-child {
  width: 1.5rem;
}

body.menu-open {
  overflow: hidden;
}

/* ── Custom Select Styling ── */
select option {
  background: #064e3b;
  color: #fefdf8;
}

/* ── Button micro-interactions ── */
a, button {
  -webkit-tap-highlight-color: transparent;
}

/* ── Image hover containers ── */
.overflow-hidden {
  overflow: hidden;
}

/* ── Focus styles ── */
:focus-visible {
  outline: 2px solid #065f46;
  outline-offset: 2px;
  border-radius: 4px;
}

/* ── Reduced motion ── */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
  html {
    scroll-behavior: auto;
  }
  .hero-anim {
    opacity: 1;
    transform: none;
    animation: none;
  }
  .hero-img-anim {
    opacity: 1;
    transform: none;
    animation: none;
  }
}

/* ── Utility ── */
@media (max-width: 767px) {
  .font-serif {
    word-spacing: -0.02em;
  }
}
