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

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

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

img, svg {
  display: block;
  max-width: 100%;
}

/* ─── NAVBAR SCROLL STATE ────────────────────────────────────────── */
#navbar {
  background: transparent;
}

#navbar.scrolled {
  background: rgba(253, 252, 250, 0.95);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  box-shadow: 0 1px 0 rgba(31, 62, 49, 0.08);
}

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

#navbar.scrolled .nav-link:hover {
  color: #4d8269;
}

#navbar.scrolled #nav-brand {
  color: #1f3e31;
}

#navbar.scrolled #nav-logo path:last-child {
  fill: #1f3e31;
}

/* ─── HERO ANIMATIONS ────────────────────────────────────────────── */
#hero-eyebrow {
  animation: fadeUp 0.8s ease forwards;
  animation-delay: 0.3s;
  opacity: 0;
}

#hero-headline {
  animation: fadeUp 0.8s ease forwards;
  animation-delay: 0.5s;
  opacity: 0;
}

#hero-sub {
  animation: fadeUp 0.8s ease forwards;
  animation-delay: 0.7s;
  opacity: 0;
}

#hero-cta {
  animation: fadeUp 0.8s ease forwards;
  animation-delay: 0.9s;
  opacity: 0;
}

#hero-scroll {
  animation: fadeIn 0.8s ease forwards;
  animation-delay: 1.4s;
  opacity: 0;
}

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

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

/* ─── SERVICE CARDS ──────────────────────────────────────────────── */
.service-card {
  transform: translateY(0);
  transition: transform 0.4s ease, box-shadow 0.4s ease, border-color 0.4s ease;
}

.service-card:hover {
  transform: translateY(-4px);
}

/* ─── GALLERY ────────────────────────────────────────────────────── */
.gallery-item {
  cursor: pointer;
}

.gallery-item::after {
  content: '';
  position: absolute;
  inset: 0;
  background: rgba(31, 62, 49, 0);
  transition: background 0.4s ease;
  border-radius: inherit;
}

.gallery-item:hover::after {
  background: rgba(31, 62, 49, 0.15);
}

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

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

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

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

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

/* ─── SCROLL REVEAL (below fold only) ────────────────────────────── */
.reveal {
  opacity: 1;
  transform: translateY(0);
  transition: opacity 0.7s ease, transform 0.7s ease;
}

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

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

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

  .service-card {
    opacity: 0;
    transform: translateY(24px);
    transition: opacity 0.6s ease, transform 0.6s ease, box-shadow 0.4s ease, border-color 0.4s ease;
  }

  .service-card.revealed {
    opacity: 1;
    transform: translateY(0);
  }

  .service-card:nth-child(1) { transition-delay: 0s; }
  .service-card:nth-child(2) { transition-delay: 0.08s; }
  .service-card:nth-child(3) { transition-delay: 0.16s; }
  .service-card:nth-child(4) { transition-delay: 0.24s; }
  .service-card:nth-child(5) { transition-delay: 0.32s; }
  .service-card:nth-child(6) { transition-delay: 0.4s; }

  .testimonial-card {
    opacity: 0;
    transform: translateY(24px);
    transition: opacity 0.6s ease, transform 0.6s ease;
  }

  .testimonial-card.revealed {
    opacity: 1;
    transform: translateY(0);
  }

  .testimonial-card:nth-child(1) { transition-delay: 0s; }
  .testimonial-card:nth-child(2) { transition-delay: 0.1s; }
  .testimonial-card:nth-child(3) { transition-delay: 0.2s; }
}

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

  .gallery-item img {
    transition: none;
  }

  .gallery-item:hover img {
    transform: none;
  }
}

/* ─── SELECTION ──────────────────────────────────────────────────── */
::selection {
  background: rgba(77, 130, 105, 0.2);
  color: #1f3e31;
}

/* ─── FOCUS VISIBLE ──────────────────────────────────────────────── */
:focus-visible {
  outline: 2px solid #4d8269;
  outline-offset: 2px;
}

/* ─── SCROLLBAR ──────────────────────────────────────────────────── */
::-webkit-scrollbar {
  width: 8px;
}

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

::-webkit-scrollbar-thumb {
  background: #bdd3c8;
  border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
  background: #93bba8;
}
