/* ============================================
   Cotton Plant Gin & Elevator — Custom Styles
   ============================================ */

/* --- Smooth scroll --- */
html {
  scroll-behavior: smooth;
}

/* --- Custom scrollbar --- */
::-webkit-scrollbar {
  width: 8px;
}
::-webkit-scrollbar-track {
  background: #fdf9ed;
}
::-webkit-scrollbar-thumb {
  background: #b9d4b8;
  border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
  background: #8bb88a;
}

/* --- Navbar shadow on scroll --- */
#navbar.scrolled {
  box-shadow: 0 1px 20px rgba(44, 90, 46, 0.08);
}

/* --- Nav link underline animation --- */
.nav-link {
  position: relative;
}
.nav-link::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 50%;
  width: 0;
  height: 2px;
  background: #2c5a2e;
  transition: all 0.25s ease;
  transform: translateX(-50%);
}
.nav-link:hover::after {
  width: 60%;
}

/* --- Mobile link --- */
.mobile-link {
  border-radius: 0.75rem;
}

/* --- Service card stagger animation (progressive enhancement) --- */
@media (prefers-reduced-motion: no-preference) {
  .service-card {
    opacity: 0;
    transform: translateY(24px);
    transition: opacity 0.6s ease, transform 0.6s ease, background 0.3s ease, border-color 0.3s ease, box-shadow 0.3s ease;
  }
  .service-card.revealed {
    opacity: 1;
    transform: translateY(0);
  }
}

/* --- Hero headline animation (progressive enhancement) --- */
@media (prefers-reduced-motion: no-preference) {
  #hero-headline {
    opacity: 0;
    transform: translateY(20px);
    animation: heroReveal 0.8s ease forwards;
  }
  @keyframes heroReveal {
    to {
      opacity: 1;
      transform: translateY(0);
    }
  }
}

/* --- Floating card pulse --- */
@keyframes float {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-8px); }
}
.floating-card {
  animation: float 4s ease-in-out infinite;
}

/* --- Back to top --- */
#back-to-top.visible {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0);
}

/* --- Testimonial card hover --- */
@media (prefers-reduced-motion: no-preference) {
  #testimonials .bg-white\/10 {
    transition: background-color 0.3s ease, transform 0.3s ease;
  }
  #testimonials .bg-white\/10:hover {
    transform: translateY(-4px);
  }
}

/* --- Form focus ring --- */
input:focus,
select:focus,
textarea:focus {
  outline: none;
  box-shadow: 0 0 0 3px rgba(139, 184, 138, 0.3);
}

/* --- Selection color --- */
::selection {
  background: #dce9dc;
  color: #1b371d;
}
