/*
 * Hero slider.
 *
 * Each slide reuses the theme's existing .hero markup and styling, so the
 * look and responsive behaviour stay identical; the rules below only stack
 * the slides into a fading carousel and add the zoom + reveal animations.
 *
 * The Ken Burns zoom restarts every time a slide becomes active, so each new
 * slide eases from a slight zoom back to rest and then holds still.
 */

.hero-slider {
  position: relative;
  min-height: 560px;
  background: #f8f8f3;
  isolation: isolate;
  overflow: hidden
}

.hero-slider > .hero-slide {
  position: absolute;
  inset: 0;
  min-height: 0;
  opacity: 0;
  visibility: hidden;
  z-index: 0;
  transition: opacity 1s ease, visibility 1s ease
}

.hero-slider > .hero-slide.active {
  opacity: 1;
  visibility: visible;
  z-index: 1
}

/* Ken Burns — start slightly zoomed in, glide back to rest, then stop. */
.hero-slider .hero-photo {
  transform: scale(1.14);
  will-change: transform
}

.hero-slider .hero-slide.active .hero-photo {
  animation: retromaniacsKenBurns 8s cubic-bezier(.16, .84, .44, 1) forwards
}

@keyframes retromaniacsKenBurns {
  from {
    transform: scale(1.14)
  }
  to {
    transform: scale(1)
  }
}

/* Copy fades and lifts in, one element after another. */
.hero-slider .hero-slide .hero-copy > * {
  opacity: 0;
  transform: translateY(22px);
  transition: opacity .8s ease, transform .8s cubic-bezier(.16, .84, .44, 1)
}

.hero-slider .hero-slide.active .hero-copy > * {
  opacity: 1;
  transform: none
}

.hero-slider .hero-slide.active .hero-copy > *:nth-child(1) {
  transition-delay: .16s
}

.hero-slider .hero-slide.active .hero-copy > *:nth-child(2) {
  transition-delay: .26s
}

.hero-slider .hero-slide.active .hero-copy > *:nth-child(3) {
  transition-delay: .36s
}

.hero-slider .hero-slide.active .hero-copy > *:nth-child(4) {
  transition-delay: .46s
}

.hero-slider .hero-slide.active .hero-copy > *:nth-child(5) {
  transition-delay: .56s
}

/* Controls */
.hero-dots {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 28px;
  z-index: 5;
  display: flex;
  justify-content: center;
  gap: 10px
}

.hero-dot {
  width: 34px;
  height: 4px;
  padding: 0;
  border: 0;
  border-radius: 99px;
  background: rgba(19, 35, 59, .22);
  cursor: pointer;
  transition: width .35s ease, background .35s ease
}

.hero-dot.active {
  width: 54px;
  background: var(--coral)
}

.hero-arrow {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  z-index: 5;
  width: 54px;
  height: 54px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(19, 35, 59, .14);
  border-radius: 50%;
  background: rgba(255, 255, 255, .82);
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
  color: var(--ink);
  font-size: 28px;
  line-height: 1;
  cursor: pointer;
  transition: .3s ease
}

.hero-arrow:hover {
  background: var(--coral);
  border-color: transparent;
  color: #fff
}

.hero-arrow.prev {
  left: 24px
}

.hero-arrow.next {
  right: 24px
}

@media(max-width:900px) {
  .hero-slider {
    min-height: 620px
  }
  .hero-arrow {
    width: 46px;
    height: 46px;
    font-size: 24px
  }
  .hero-arrow.prev {
    left: 14px
  }
  .hero-arrow.next {
    right: 14px
  }
}

@media(max-width:560px) {
  .hero-slider {
    min-height: 650px
  }
  .hero-dots {
    bottom: 20px
  }
  .hero-arrow {
    display: none
  }
}

@media (prefers-reduced-motion: reduce) {
  .hero-slider > .hero-slide,
  .hero-slider .hero-slide .hero-copy > * {
    transition: none
  }
  .hero-slider .hero-photo {
    transform: none
  }
  .hero-slider .hero-slide.active .hero-photo {
    animation: none
  }
}
