/* Base & Animations */
html {
  scroll-behavior: smooth;
}

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

/* Custom scrollbar */
::-webkit-scrollbar {
  width: 8px;
}
::-webkit-scrollbar-track {
  background: #f0faf6;
}
::-webkit-scrollbar-thumb {
  background: #7cc9a3;
  border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
  background: #50b381;
}

/* Floating animations */
@keyframes float {
  0%, 100% { transform: translateY(0px) rotate(0deg); }
  50% { transform: translateY(-20px) rotate(3deg); }
}

@keyframes float-delay {
  0%, 100% { transform: translateY(0px) rotate(0deg); }
  50% { transform: translateY(-15px) rotate(-2deg); }
}

@keyframes float-delay-2 {
  0%, 100% { transform: translateY(0px); }
  50% { transform: translateY(-25px); }
}

.animate-float {
  animation: float 6s ease-in-out infinite;
}

.animate-float-delay {
  animation: float-delay 7s ease-in-out infinite;
  animation-delay: 1s;
}

.animate-float-delay-2 {
  animation: float-delay-2 8s ease-in-out infinite;
  animation-delay: 2s;
}

/* Reveal animations — progressive enhancement */
@media (prefers-reduced-motion: no-preference) {
  .reveal {
    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);
  }

  .reveal.revealed {
    opacity: 1;
    transform: translateY(0);
  }

  .reveal:nth-child(2) { transition-delay: 0.1s; }
  .reveal:nth-child(3) { transition-delay: 0.2s; }
  .reveal:nth-child(4) { transition-delay: 0.3s; }
  .reveal:nth-child(5) { transition-delay: 0.4s; }
  .reveal:nth-child(6) { transition-delay: 0.5s; }
}

/* Service card hover */
.service-card {
  transform: translateY(0);
  transition: transform 0.3s ease, box-shadow 0.3s ease, background 0.3s ease;
}

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

/* Navbar scroll state */
#navbar.scrolled {
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(12px);
  box-shadow: 0 1px 20px rgba(15, 43, 76, 0.08);
}

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

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

/* Mobile menu animation */
#mobile-menu {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

#mobile-menu.open {
  max-height: 500px;
}

/* Active nav link */
.nav-link.active {
  color: #359466;
}

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

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

/* Selection color */
::selection {
  background: #a8e0c5;
  color: #0f2b4c;
}
