.hero-visual.has-home-carousel,
.hero-visual:has(.home-carousel) {
  width: min(100%, 460px);
}

.hero-visual.has-home-carousel .experience-card,
.hero-visual:has(.home-carousel) .experience-card {
  left: auto;
  right: calc(100% + clamp(16px, 2vw, 28px));
}

.image-frame.home-carousel {
  aspect-ratio: 1706 / 2048;
  background: #fff;
  border-radius: 28px;
  isolation: isolate;
}

.home-carousel__track {
  position: absolute;
  inset: 0;
}

.image-frame.home-carousel .home-carousel__slide {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
  object-position: center;
  opacity: 0;
  visibility: hidden;
  transition: opacity 500ms ease, visibility 500ms ease;
}

.image-frame.home-carousel .home-carousel__slide.is-active {
  opacity: 1;
  visibility: visible;
}

.home-carousel__control {
  position: absolute;
  z-index: 3;
  top: 50%;
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  padding: 0;
  color: #fff;
  background: rgb(21 58 104 / 82%);
  border: 1px solid rgb(255 255 255 / 70%);
  border-radius: 50%;
  box-shadow: 0 4px 14px rgb(0 0 0 / 18%);
  cursor: pointer;
  transform: translateY(-50%);
  transition: background-color 160ms ease, transform 160ms ease;
}

.home-carousel__control:hover {
  background: #153a68;
  transform: translateY(-50%) scale(1.05);
}

.home-carousel__control:focus-visible,
.home-carousel__dot:focus-visible {
  outline: 3px solid #fff;
  outline-offset: 3px;
}

.home-carousel__control--previous {
  left: 12px;
}

.home-carousel__control--next {
  right: 12px;
}

.home-carousel__control svg {
  width: 20px;
  height: 20px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 2.3;
}

.home-carousel__dots {
  position: absolute;
  z-index: 3;
  right: 50%;
  bottom: 12px;
  display: flex;
  gap: 8px;
  padding: 8px 10px;
  background: rgb(21 58 104 / 78%);
  border-radius: 999px;
  transform: translateX(50%);
}

.home-carousel__dot {
  width: 10px;
  height: 10px;
  padding: 0;
  background: rgb(255 255 255 / 55%);
  border: 0;
  border-radius: 50%;
  cursor: pointer;
  transition: background-color 160ms ease, transform 160ms ease;
}

.home-carousel__dot.is-active {
  background: #fff;
  transform: scale(1.25);
}

.home-carousel__status {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

@media (width <= 1100px) {
  .hero-visual.has-home-carousel .experience-card,
  .hero-visual:has(.home-carousel) .experience-card {
    position: static;
    width: fit-content;
    max-width: 100%;
    margin: 18px auto 0;
  }
}

@media (width <= 900px) {
  .hero-visual.has-home-carousel,
  .hero-visual:has(.home-carousel) {
    width: min(88vw, 460px);
  }
}

@media (width <= 600px) {
  .image-frame.home-carousel {
    aspect-ratio: 1706 / 2048;
    border-width: 4px;
    border-radius: 20px;
  }

  .home-carousel__control {
    width: 38px;
    height: 38px;
  }

  .home-carousel__control--previous {
    left: 8px;
  }

  .home-carousel__control--next {
    right: 8px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .image-frame.home-carousel .home-carousel__slide,
  .home-carousel__control,
  .home-carousel__dot {
    transition: none;
  }
}
