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

html {
  scroll-behavior: smooth;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  background-color: #faf9f6;
  color: #0d2e16;
}

/* Header transition */
#header {
  background: transparent;
  transition: background 0.5s ease, box-shadow 0.5s ease;
}

#header.scrolled {
  background: rgba(250, 249, 246, 0.92);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  box-shadow: 0 1px 0 rgba(26, 92, 42, 0.08);
}

/* Navigation link underline */
.nav-link {
  position: relative;
}

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

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

/* Hero background line */
.hero-bg-line {
  position: absolute;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 1px;
  height: 100%;
  background: linear-gradient(to bottom, transparent, rgba(26, 92, 42, 0.08), transparent);
  pointer-events: none;
}

/* Hero fade-up animation */
.hero-fade-up {
  opacity: 0;
  transform: translateY(24px);
  animation: heroFadeUp 0.8s ease forwards;
}

.hero-fade-up:nth-child(1) { animation-delay: 0.1s; }
.hero-fade-up:nth-child(2) { animation-delay: 0.25s; }
.hero-fade-up:nth-child(3) { animation-delay: 0.4s; }
.hero-fade-up:nth-child(4) { animation-delay: 0.55s; }

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

/* Service cards */
.service-card {
  opacity: 0;
  transform: translateY(32px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}

.service-card.visible {
  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; }

/* Mobile menu */
#mobileMenu {
  opacity: 0;
  pointer-events: none;
}

#mobileMenu.open {
  opacity: 1;
  pointer-events: all;
}

#mobileMenu.open .mobile-link {
  animation: mobileLinkIn 0.4s ease forwards;
}

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

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

/* Menu button animation */
.menu-line {
  display: block;
}

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

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

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

/* Scroll-triggered section animations */
.section-fade {
  opacity: 0;
  transform: translateY(32px);
  transition: opacity 0.7s ease, transform 0.7s ease;
}

.section-fade.visible {
  opacity: 1;
  transform: translateY(0);
}

/* Custom select styling */
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='%231a5c2a' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0 center;
  padding-right: 2rem;
}

/* Selection color */
::selection {
  background: rgba(26, 92, 42, 0.15);
  color: #0d2e16;
}

/* Smooth image loading */
img {
  opacity: 1;
  transition: opacity 0.3s ease;
}

img[loading="lazy"] {
  opacity: 0;
  transition: opacity 0.6s ease;
}

img[loading="lazy"].loaded {
  opacity: 1;
}

/* Scrollbar */
::-webkit-scrollbar {
  width: 6px;
}

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

::-webkit-scrollbar-thumb {
  background: #d3e8d6;
  border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
  background: #a9d4ab;
}
