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

body {
  overflow-x: hidden;
}

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

/* Navbar transitions */
#navbar.scrolled {
  background: rgba(250, 247, 242, 0.95);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  box-shadow: 0 1px 0 rgba(45, 42, 38, 0.08);
}

#navbar.scrolled .nav-link {
  color: #2D2A26;
}

#navbar.scrolled .nav-link:hover {
  color: #064E3B;
}

/* Hero animation */
.hero-tag {
  animation: fadeSlideUp 0.8s ease forwards;
}

.hero-tag span {
  animation: expandWidth 0.6s ease forwards 0.2s;
  transform-origin: left;
}

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

@keyframes expandWidth {
  from {
    width: 0;
  }
  to {
    width: 32px;
  }
}

/* Service card hover */
.service-card {
  transform: translateY(0);
  transition: transform 0.5s cubic-bezier(0.22, 1, 0.36, 1), background-color 0.5s ease;
}

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

/* Gallery item */
.gallery-item {
  transition: transform 0.4s ease;
}

.gallery-item:hover {
  transform: translateY(-2px);
}

/* Process step */
.process-step {
  position: relative;
}

.process-step:not(:last-child)::after {
  content: '';
  position: absolute;
  top: 24px;
  right: -24px;
  width: 48px;
  height: 2px;
  background: rgba(110, 231, 183, 0.3);
  display: none;
}

@media (min-width: 1024px) {
  .process-step:not(:last-child)::after {
    display: block;
  }
}

/* Mobile menu */
#mobileMenu.open {
  opacity: 1;
  pointer-events: all;
}

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

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

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

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

/* Hamburger animation */
.menu-line {
  transition: transform 0.3s ease, opacity 0.3s ease;
}

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

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

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

/* Scroll reveal */
.reveal {
  opacity: 0;
  transform: translateY(32px);
  transition: opacity 0.8s cubic-bezier(0.22, 1, 0.36, 1), transform 0.8s cubic-bezier(0.22, 1, 0.36, 1);
}

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

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

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

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

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

/* Select dropdown arrow */
select {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%238B8680' 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 12px center;
  background-size: 16px;
  padding-right: 40px;
}

/* Reduce motion */
@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
  .reveal {
    opacity: 1;
    transform: none;
    transition: none;
  }
  .service-card {
    transition: none;
  }
  .gallery-item img {
    transition: none;
  }
  * {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
