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

body {
  overflow-x: hidden;
}

/* Selection Color */
::selection {
  background-color: #059669;
  color: #fefdf8;
}

/* Navbar Scroll State */
#navbar.scrolled {
  background-color: rgba(254, 253, 248, 0.95);
  backdrop-filter: blur(12px);
  box-shadow: 0 1px 20px rgba(6, 78, 59, 0.08);
}

#navbar.scrolled .menu-line {
  background-color: #064e3b;
}

/* Mobile Menu */
.mobile-link {
  opacity: 0;
  transform: translateY(10px);
  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; }

/* Menu Button Animation */
.menu-line:last-child {
  transform-origin: center;
}

#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) {
  transform: rotate(-45deg) translate(4px, -4px);
  width: 1.25rem;
}

/* Service Cards */
.service-card {
  transition: transform 0.4s ease, box-shadow 0.4s ease;
}

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

/* Gallery */
.gallery-item {
  cursor: pointer;
  transition: box-shadow 0.3s ease;
}

.gallery-item:hover {
  box-shadow: 0 20px 40px rgba(6, 78, 59, 0.15);
}

/* Review Cards */
.review-card {
  transition: transform 0.4s ease, box-shadow 0.4s ease;
}

.review-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 20px 40px rgba(6, 78, 59, 0.08);
}

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

.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; }

/* Stagger children */
.stagger-children .reveal:nth-child(1) { transition-delay: 0.05s; }
.stagger-children .reveal:nth-child(2) { transition-delay: 0.15s; }
.stagger-children .reveal:nth-child(3) { transition-delay: 0.25s; }
.stagger-children .reveal:nth-child(4) { transition-delay: 0.35s; }
.stagger-children .reveal:nth-child(5) { transition-delay: 0.45s; }
.stagger-children .reveal:nth-child(6) { transition-delay: 0.55s; }

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

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

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

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

/* Focus styles for accessibility */
a:focus-visible,
button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
  outline: 2px solid #059669;
  outline-offset: 2px;
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  .reveal {
    opacity: 1;
    transform: none;
    transition: none;
  }

  .gallery-item img,
  .service-card img {
    transition: none;
  }

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

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

/* 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='%23059669' 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;
}
