.latest-projects {
  width: 100%;
  max-width: 100%;
}

@media screen and (min-width: 1024px) {
  .latest-projects {
    margin: 2.5rem auto;
  }
}

.latest-projects__stage {
  position: relative;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  border-radius: var(--border-radius, 0.5rem);
  background: #1a1a1a;
}

.latest-projects__slide {
  position: absolute;
  inset: 0;
  display: block;
  opacity: 0;
  transition: opacity 1.2s ease-in-out;
  color: inherit;
  text-decoration: none;
}

.latest-projects__slide.is-active {
  opacity: 1;
  z-index: 1;
}

.latest-projects__image {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  transform: scale(1);
  transform-origin: center;
  will-change: transform;
}

/* Slow linear zoom: runs while the slide is visible and keeps going through its fade-out
   (.is-leaving uses the same animation, so it continues instead of restarting). */
.latest-projects__slide.is-active .latest-projects__image,
.latest-projects__slide.is-leaving .latest-projects__image {
  animation: latest-projects-zoom var(--lp-zoom-duration, 6.2s) linear forwards;
}

.latest-projects__slide.is-leaving {
  z-index: 0;
}

@keyframes latest-projects-zoom {
  from {
    transform: scale(1);
  }
  to {
    transform: scale(1.08);
  }
}

.latest-projects__title {
  position: absolute;
  left: 1.25rem;
  bottom: 1.25rem;
  max-width: calc(100% - 2.5rem);
  color: #fff;
  font-size: 1.125rem;
  line-height: 1.3;
  text-shadow: 0 1px 12px rgba(0, 0, 0, 0.6);
}

@media screen and (min-width: 1024px) {
  .latest-projects__title {
    left: 2rem;
    bottom: 2rem;
    font-size: 1.5rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  .latest-projects__slide {
    transition: none;
  }
  .latest-projects__slide .latest-projects__image {
    animation: none !important;
  }
}
