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

/* Base slideshow container */
.slideshow {
  margin-top: 70px;
  position: relative;
  width: 100%;
  height: clamp(420px, 40vw, 580px); /* scales around 1440 breakpoint */
  overflow: hidden;
  background-color: #333;
}

/* Slides wrapper */
.slides {
  position: absolute;
  inset: 0;
}

/* Individual slides */
.slides span {
  position: absolute;
  inset: 0;
  background-image: var(--bg);
  background-size: cover;
  background-position: center;
  opacity: 0;
  animation: slideshow 12s linear infinite;
  transform: scale(1.0); /* start farther away */
}

.slides span::after {
  content: "";
  position: absolute;
  inset: 0;
  background-color: rgba(0, 0, 0, 0.5); /* 50% darker */
  z-index: 1;
}

/* Stagger animations */
.slides span:nth-child(1) { animation-delay: 0s; }
.slides span:nth-child(2) { animation-delay: 3s; }
.slides span:nth-child(3) { animation-delay: 6s; }
.slides span:nth-child(4) { animation-delay: 9s; }

/* Ken Burns + crossfade */
@keyframes slideshow {
  0% {
    opacity: 0;
    transform: scale(1.0);
  }

  5% {
    opacity: 1;
  }

  30% {
    opacity: 1;
    transform: scale(1.12); /* steadily moving closer */
  }

  35% {
    opacity: 0;
    transform: scale(1.12);
  }

  100% {
    opacity: 0;
    transform: scale(1.12);
  }
}

/* Centered overlay text */
.slideshow-text {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;

  font-size: 64px;
  font-weight: 600;
  color: #fff;
  text-shadow: 0 4px 16px rgba(0,0,0,0.5);
  z-index: 2; /* higher than overlay */
  padding: 0 1rem;
}

.slideshow-arrow-link {
  position: absolute;
  bottom: 20px;         /* 20px from the bottom edge */
  left: 50%;            /* center horizontally */
  transform: translateX(-50%);
  z-index: 2;           /* above slides and overlay */
  display: block;
}

.slideshow-arrow {
  width: 48px;          /* adjust as needed */
  height: auto;
  display: block;
  pointer-events: auto; /* make it clickable */
}

/* Mobile: full viewport height */
@media (max-width: 768px) {
  .slideshow {
    height: 70vh;
  }

  .slideshow-text {
    font-size: 40px;
  }

  .text h2 {
    line-height: 1.4em;
  }
}
