/* 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: 1;
  z-index: 1;
}

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

.hero-content p {
  animation: heroSlideIn 0.45s ease-out both;
  animation-delay: 0.1s;
}

.hero-content a {
  opacity: 1;
  animation: heroSlideIn 0.45s ease-out both, pulseCTA 3s infinite;
  animation-delay: 0.2s;
}

@keyframes heroSlideIn {
  from {
    transform: translateY(12px);
  }
  to {
    transform: translateY(0);
  }
}

@keyframes pulseCTA {
  0%,
  100% {
    box-shadow: 0 0 0 0 rgba(52, 98, 108, 0.35);
  }
  50% {
    box-shadow: 0 0 15px 8px rgba(52, 98, 108, 0.45);
  }
}

.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;
  }
}
