/* Custom styles for TRU Family Hydraulics */

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

/* Custom selection color */
::selection {
  background-color: #16a34a;
  color: white;
}

/* Service card hover glow */
.service-card::after {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: 20px;
  opacity: 0;
  transition: opacity 0.3s ease;
  pointer-events: none;
  box-shadow: 0 0 0 1px rgba(22, 163, 74, 0.1);
}

.service-card {
  position: relative;
}

.service-card:hover::after {
  opacity: 1;
}

/* Scroll reveal animations (progressive enhancement) */
.reveal {
  opacity: 1;
  transform: none;
  transition: opacity 0.6s ease, transform 0.6s ease;
}

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

@media (prefers-reduced-motion: no-preference) {
  .reveal {
    opacity: 0;
    transform: translateY(24px);
  }

  .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; }
  .reveal-delay-5 { transition-delay: 0.5s; }
  .reveal-delay-6 { transition-delay: 0.6s; }
}

/* Mobile menu transitions */
#mobileMenu {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.3s ease, padding 0.3s ease;
}

#mobileMenu.open {
  max-height: 400px;
  padding-top: 0.5rem;
  padding-bottom: 0.5rem;
}

/* Mobile link transitions */
.mobile-link {
  transition: all 0.2s ease;
}

/* Subtle pattern for hero */
.hero-pattern {
  background-image: radial-gradient(circle at 1px 1px, rgba(255,255,255,0.03) 1px, transparent 0);
  background-size: 40px 40px;
}

/* Navbar shadow on scroll */
nav.scrolled {
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
}

/* Focus styles for accessibility */
a:focus-visible,
button:focus-visible,
input:focus-visible,
textarea:focus-visible {
  outline: 2px solid #16a34a;
  outline-offset: 2px;
  border-radius: 4px;
}

/* Ensure images don't cause layout shift */
img {
  max-width: 100%;
  height: auto;
}

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

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

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

::-webkit-scrollbar-thumb:hover {
  background: #15803d;
}

/* Geometric shape animations */
@keyframes float {
  0%, 100% { transform: translateY(0px) rotate(0deg); }
  50% { transform: translateY(-10px) rotate(2deg); }
}

@keyframes float-slow {
  0%, 100% { transform: translateY(0px) rotate(0deg); }
  50% { transform: translateY(-6px) rotate(-1deg); }
}

.floating-shape-1 {
  animation: float 6s ease-in-out infinite;
}

.floating-shape-2 {
  animation: float-slow 8s ease-in-out infinite;
}

/* Button press effect */
button:active,
a:active {
  transform: scale(0.98) translateY(0) !important;
}
