/* Hero section optimization */
#hero {
  min-height: 320px;
  contain: layout style paint;
}

@media (min-width: 768px) {
  #hero {
    min-height: 80vh;
  }
}

#hero picture {
  position: absolute;
  inset: 0;
  z-index: 0;
}

#hero img {
  object-fit: cover;
  object-position: center;
  width: 100%;
  height: 100%;
}

.hero-content {
  opacity: 0;
  transition: opacity 0.4s ease-in-out;
  z-index: 1;
}

.hero-content.visible {
  opacity: 1;
}

/* Simplified animations for better performance */
.hero-content h1 {
  display: inline-block;
}

.hero-content p {
  animation: slideIn 0.5s ease-in-out forwards;
  animation-delay: 0.3s;
}

.hero-content a {
  opacity: 0;
  animation: slideIn 0.5s ease-in-out forwards, pulseCTA 3s infinite;
  animation-delay: 0.6s;
}

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

@keyframes pulseCTA {
  0%,
  100% {
    box-shadow: 0 0 0 0 rgba(45, 115, 16, 0.3);
  }
  50% {
    box-shadow: 0 0 15px 8px rgba(45, 115, 16, 0.5);
  }
}

.scroll-down {
  animation: pulse 2s infinite;
  z-index: 1;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.8);
  transition: transform 0.3s ease;
}

.scroll-down:hover {
  transform: scale(1.1);
}

@keyframes pulse {
  0%,
  100% {
    transform: translateY(0);
    opacity: 0.8;
  }
  50% {
    transform: translateY(8px);
    opacity: 1;
  }
}

.services-bg {
  background: linear-gradient(to bottom, #f3f4f6, #e5e7eb);
}

/* Reduce motion for accessibility */
@media (prefers-reduced-motion: reduce) {
  .hero-content h1,
  .hero-content p,
  .hero-content a,
  .scroll-down {
    animation: none;
    opacity: 1;
    transform: translateY(0);
  }
}

/* Ensure buttons wrap properly on small screens */
@media (max-width: 640px) {
  .hero-content {
    padding-top: 2rem !important;
    padding-bottom: 2rem !important;
  }

  .hero-content h1 {
    word-wrap: break-word;
    overflow-wrap: break-word;
    hyphens: auto;
  }
}
