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

html {
  scroll-behavior: smooth;
  scroll-padding-top: 80px;
}

body {
  overflow-x: hidden;
}

::selection {
  background-color: #2C4A3E;
  color: #FDFCFA;
}

/* ─── REVEAL ANIMATIONS ────────────────────────────────── */
.reveal {
  opacity: 0;
  transform: translateY(30px);
  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);
}

/* Staggered delays for hero reveals */
.reveal:nth-child(1) { transition-delay: 0.1s; }
.reveal:nth-child(2) { transition-delay: 0.2s; }
.reveal:nth-child(3) { transition-delay: 0.3s; }
.reveal:nth-child(4) { transition-delay: 0.4s; }
.reveal:nth-child(5) { transition-delay: 0.5s; }
.reveal:nth-child(6) { transition-delay: 0.6s; }

/* ─── SERVICE CARDS ─────────────────────────────────────── */
.service-card {
  opacity: 0;
  transform: translateY(40px);
  transition: opacity 0.7s cubic-bezier(0.16, 1, 0.3, 1), transform 0.7s cubic-bezier(0.16, 1, 0.3, 1);
}

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

.service-card:nth-child(1) { transition-delay: 0.05s; }
.service-card:nth-child(2) { transition-delay: 0.1s; }
.service-card:nth-child(3) { transition-delay: 0.15s; }
.service-card:nth-child(4) { transition-delay: 0.2s; }
.service-card:nth-child(5) { transition-delay: 0.25s; }
.service-card:nth-child(6) { transition-delay: 0.3s; }

/* ─── TESTIMONIAL CARDS ─────────────────────────────────── */
.testimonial-card {
  opacity: 0;
  transform: translateY(30px);
  transition: opacity 0.7s cubic-bezier(0.16, 1, 0.3, 1), transform 0.7s cubic-bezier(0.16, 1, 0.3, 1);
}

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

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

/* ─── HEADER SCROLL STATE ──────────────────────────────── */
#site-header.scrolled {
  background-color: rgba(253, 252, 250, 0.95);
  backdrop-filter: blur(12px);
  box-shadow: 0 1px 0 rgba(44, 74, 62, 0.08);
}

#site-header.scrolled .font-serif,
#site-header.scrolled span {
  color: #1C3029 !important;
}

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

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

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

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

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

/* ─── MENU ICON ANIMATION ───────────────────────────────── */
.menu-line {
  transition: transform 0.3s ease, opacity 0.3s ease;
}

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

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

#menu-toggle.active .menu-line:nth-child(3) {
  transform: translateY(-4px) rotate(-45deg);
  width: 1.25rem;
}

/* ─── FORM SELECT ARROW ─────────────────────────────────── */
select {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%232C4A3E' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 1rem center;
  padding-right: 2.5rem;
}

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

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

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

::-webkit-scrollbar-thumb:hover {
  background: #7ba37d;
}

/* ─── FOCUS VISIBLE ─────────────────────────────────────── */
a:focus-visible,
button:focus-visible,
input:focus-visible,
textarea:focus-visible,
select:focus-visible {
  outline: 2px solid #2C4A3E;
  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;
  }
  .reveal, .service-card, .testimonial-card {
    opacity: 1;
    transform: none;
  }
}
