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

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

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

/* Custom scrollbar */
::-webkit-scrollbar { width: 8px; }
::-webkit-scrollbar-track { background: #FDF9F0; }
::-webkit-scrollbar-thumb { background: #065F46; border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: #047857; }

/* Selection */
::selection { background: #064E3B; color: #FDF9F0; }

/* Nav scroll state */
#site-header.scrolled {
  background: rgba(253, 249, 240, 0.95);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  box-shadow: 0 1px 0 rgba(6, 78, 59, 0.08);
}

/* Nav links */
.nav-link {
  position: relative;
}
.nav-link::after {
  content: '';
  position: absolute;
  bottom: -2px;
  left: 0;
  width: 0;
  height: 2px;
  background: #059669;
  transition: width 0.25s ease;
}
.nav-link:hover::after {
  width: 100%;
}

/* Mobile links */
.mobile-link {
  display: block;
  padding: 8px 0;
  border-bottom: 1px solid rgba(6, 78, 59, 0.06);
}
.mobile-link:last-child {
  border-bottom: none;
}

/* Scroll animations */
.reveal {
  opacity: 0;
  transform: translateY(30px);
  transition: opacity 0.7s cubic-bezier(0.22, 1, 0.36, 1), transform 0.7s cubic-bezier(0.22, 1, 0.36, 1);
}
.reveal.revealed {
  opacity: 1;
  transform: translateY(0);
}
.reveal-delay-1 { transition-delay: 0.1s; }
.reveal-delay-2 { transition-delay: 0.2s; }
.reveal-delay-3 { transition-delay: 0.3s; }
.reveal-delay-4 { transition-delay: 0.4s; }

/* Service cards */
.service-card {
  position: relative;
  overflow: hidden;
}
.service-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, #34D399, #10B981);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.35s ease;
}
.service-card:hover::before {
  transform: scaleX(1);
}

/* Process steps */
.process-step::after {
  content: '';
  display: block;
  height: 3px;
  background: linear-gradient(90deg, #A7F3D0, #34D399);
  border-radius: 2px;
  margin-top: 16px;
  width: 60px;
}
.process-step:last-child::after {
  display: none;
}

/* Testimonial cards */
.testimonial-card {
  position: relative;
}
.testimonial-card::before {
  content: '\201C';
  position: absolute;
  top: 16px;
  right: 24px;
  font-family: 'Playfair Display', serif;
  font-size: 6rem;
  line-height: 1;
  color: rgba(6, 78, 59, 0.06);
  pointer-events: none;
}

/* Back to top */
.back-to-top {
  position: fixed;
  bottom: 2rem;
  right: 2rem;
  width: 44px;
  height: 44px;
  background: #064E3B;
  color: #FDF9F0;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 12px rgba(6, 78, 59, 0.3);
  transition: opacity 0.3s ease, transform 0.3s ease, background 0.2s ease;
  z-index: 40;
  text-decoration: none;
}
.back-to-top:hover {
  background: #059669;
  transform: translateY(-2px);
}

/* Scroll indicator animation */
@keyframes scroll-indicator {
  0% { transform: translateY(-100%); }
  100% { transform: translateY(100%); }
}
.animate-scroll-indicator {
  animation: scroll-indicator 1.5s ease-in-out infinite;
}

/* Form focus states */
input:focus, select:focus, textarea:focus {
  outline: none;
}

/* Smooth image loading */
img {
  loading: lazy;
}

/* Responsive adjustments */
@media (max-width: 640px) {
  html { scroll-padding-top: 70px; }
}

/* 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 {
    opacity: 1;
    transform: none;
  }
}
