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

body {
  overflow-x: hidden;
}

::selection {
  background: color-mix(in srgb, #4a7a4a 80%, transparent);
  color: #faf9f6;
}

/* ── Navbar ── */
#navbar {
  background: transparent;
}

#navbar.scrolled {
  background: rgba(250, 249, 246, 0.92);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  box-shadow: 0 1px 0 rgba(49, 80, 51, 0.08);
}

.nav-link {
  position: relative;
}

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

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

#navbar.scrolled .nav-link {
  color: #1f3521;
}

#navbar:not(.scrolled) .nav-link {
  color: #1f3521;
}

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

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

.menu-line {
  transition: all 0.3s ease;
}

#menu-btn.active .menu-line:nth-child(1) {
  transform: rotate(45deg) translate(4px, 4px);
}

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

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

.mobile-link {
  transition: all 0.2s ease;
}

/* ── Hero Animations ── */
.hero-anim {
  opacity: 0;
  transform: translateY(30px);
  animation: heroReveal 0.8s ease forwards;
}

.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; }
.hero-anim:nth-child(5) { animation-delay: 0.7s; }

@keyframes heroReveal {
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* ── Floating Cards ── */
.floating-card {
  animation: float 4s ease-in-out infinite;
}

.floating-card:nth-child(1) {
  animation-delay: 0s;
}

.floating-card:nth-child(2) {
  animation-delay: 1.3s;
}

.floating-card:nth-child(3) {
  animation-delay: 2.6s;
}

@keyframes float {
  0%, 100% { transform: translateY(0px); }
  50% { transform: translateY(-10px); }
}

/* ── Scroll Reveal ── */
.reveal-section {
  opacity: 1;
  transform: translateY(0);
  transition: opacity 0.7s ease, transform 0.7s ease;
}

@media (prefers-reduced-motion: no-preference) {
  .reveal-section {
    opacity: 0;
    transform: translateY(40px);
  }

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

/* stagger children */
.service-card.revealed {
  transition-delay: calc(var(--index, 0) * 0.1s);
}

/* ── Service Cards ── */
.service-card {
  transition: background 0.5s ease, border-color 0.5s ease, transform 0.3s ease, box-shadow 0.3s ease;
}

.service-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 20px 60px -20px rgba(15, 27, 16, 0.3);
}

/* ── Back to Top ── */
#back-to-top.visible {
  opacity: 1;
  pointer-events: auto;
}

/* ── Form ── */
select option {
  background: #faf9f6;
  color: #1f3521;
}

/* ── Gallery hover ── */
.rounded-2xl.overflow-hidden {
  overflow: hidden;
}

.rounded-2xl.overflow-hidden img {
  transition: transform 0.7s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

/* ── Accessibility ── */
@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;
  }

  .floating-card {
    animation: none;
  }

  .rounded-2xl.overflow-hidden img {
    transition: none;
  }

  .rounded-2xl.overflow-hidden:hover img {
    transform: none;
  }
}

/* ── Responsive tweaks ── */
@media (max-width: 767px) {
  .font-serif.text-5xl {
    font-size: 2.75rem;
    line-height: 1.1;
  }

  .font-serif.text-4xl {
    font-size: 2.25rem;
  }
}
