.hero-demo.hero-carousel {
  display: block;
  align-self: center;
  width: min(100%, 620px);
  margin: 2.75rem auto 3.6rem;
  overflow: visible;
  border: 1px solid rgba(132, 176, 154, 0.42);
  border-radius: 18px;
  aspect-ratio: 4 / 3;
  background: #a5afa6;
  box-shadow: 18px 22px 0 rgba(67, 50, 30, 0.09);
  isolation: isolate;
}

.hero-carousel-viewport,
.hero-carousel-slide,
.hero-carousel-slide picture,
.hero-carousel-slide img {
  position: absolute;
  inset: 0;
  display: block;
  width: 100%;
  height: 100%;
}

.hero-carousel-viewport {
  overflow: hidden;
  border-radius: inherit;
}

.hero-carousel-slide {
  z-index: 0;
  opacity: 0;
  visibility: hidden;
  transition: opacity 260ms ease, visibility 0ms step-start;
}

.hero-carousel-slide.is-active {
  z-index: 1;
  opacity: 1;
  visibility: visible;
  transition: opacity 260ms ease, visibility 0ms step-start;
}

.hero-carousel-slide img {
  object-fit: cover;
}

.hero-carousel-slide::after {
  content: "";
  position: absolute;
  z-index: 1;
  inset: auto 0 0;
  height: 44%;
  background: linear-gradient(180deg, transparent, rgba(20, 29, 24, 0.9));
  pointer-events: none;
}

.hero-carousel-copy {
  position: absolute;
  z-index: 2;
  right: 0;
  bottom: 0;
  left: 0;
  display: grid;
  gap: 0.2rem;
  padding: clamp(2.4rem, 8vw, 4rem) clamp(1rem, 3vw, 1.45rem) clamp(2.65rem, 6vw, 3.35rem);
  color: #fff9ee;
  text-align: left;
  text-shadow: 0 2px 12px rgba(12, 18, 15, 0.58);
}

.hero-carousel-copy strong {
  max-width: 18ch;
  font-size: clamp(1.25rem, 2.6vw, 2rem);
  font-weight: 950;
  letter-spacing: -0.035em;
  line-height: 0.96;
  text-transform: uppercase;
}

.hero-carousel-copy span {
  max-width: 46ch;
  font-size: clamp(0.76rem, 1.2vw, 0.9rem);
  font-weight: 750;
  line-height: 1.28;
}

@media (min-width: 821px) {
  .hero-carousel-slide-portrait::after {
    inset: 0 0 0 auto;
    width: 31%;
    height: 100%;
    background: linear-gradient(90deg, rgba(20, 29, 24, 0.12), rgba(20, 29, 24, 0.94) 24%);
  }

  .hero-carousel-slide-portrait .hero-carousel-copy {
    top: 0;
    right: 0;
    bottom: 0;
    left: 72%;
    align-content: center;
    padding: 3.25rem 1.15rem 3rem 1.35rem;
  }

  .hero-carousel-slide-portrait .hero-carousel-copy strong {
    max-width: 11ch;
    font-size: clamp(1.1rem, 1.8vw, 1.45rem);
  }

  .hero-carousel-slide-portrait .hero-carousel-copy span {
    max-width: 24ch;
    font-size: clamp(0.7rem, 1vw, 0.82rem);
  }

}

.hero-carousel figcaption {
  z-index: 4;
  top: 0.75rem;
  left: 0.75rem;
  max-width: calc(100% - 8.5rem);
  border-color: rgba(255, 249, 238, 0.76);
  background: rgba(24, 32, 27, 0.88);
  box-shadow: 0 4px 14px rgba(20, 25, 22, 0.2);
}

.hero-carousel-arrow,
.hero-carousel-toggle,
.hero-carousel-dots button {
  position: absolute;
  z-index: 5;
  border: 1px solid rgba(255, 249, 238, 0.72);
  background: rgba(24, 32, 27, 0.84);
  color: #fff9ee;
  box-shadow: 0 3px 12px rgba(20, 25, 22, 0.22);
  cursor: pointer;
}

.hero-carousel-arrow {
  top: auto;
  bottom: -3.15rem;
  display: grid;
  width: 2.7rem;
  height: 2.7rem;
  place-items: center;
  padding: 0;
  border-radius: 50%;
  font-size: 1.35rem;
  font-weight: 900;
  line-height: 1;
  transform: none;
}

.hero-carousel-previous {
  left: calc(50% - 5.75rem);
}

.hero-carousel-next {
  right: calc(50% - 5.75rem);
}

.hero-carousel-toggle {
  top: 0.75rem;
  right: 0.75rem;
  display: grid;
  width: 2.15rem;
  height: 2.15rem;
  place-items: center;
  padding: 0;
  border-radius: 50%;
  font: inherit;
  font-size: 0.76rem;
  font-weight: 900;
  letter-spacing: 0.035em;
  text-transform: uppercase;
}

.hero-carousel-dots {
  position: absolute;
  z-index: 5;
  right: auto;
  bottom: -2.15rem;
  left: 50%;
  display: flex;
  gap: 0.42rem;
  transform: translateX(-50%);
}

.hero-carousel-dots button {
  position: relative;
  width: 0.72rem;
  height: 0.72rem;
  padding: 0;
  border-radius: 50%;
}

.hero-carousel-dots button[aria-current="true"] {
  border-color: #fff9ee;
  background: #f0ba55;
  transform: scale(1.22);
}

.hero-carousel-arrow:hover,
.hero-carousel-arrow:focus-visible,
.hero-carousel-toggle:hover,
.hero-carousel-toggle:focus-visible,
.hero-carousel-dots button:hover,
.hero-carousel-dots button:focus-visible {
  outline: 3px solid rgba(244, 223, 183, 0.82);
  outline-offset: 2px;
  background: rgba(49, 61, 53, 0.96);
}

@media (max-width: 820px) {
  .hero-demo.hero-carousel {
    width: min(100%, 560px);
    margin: 2.2rem auto 3.4rem;
    border-radius: 14px;
    aspect-ratio: 1;
    box-shadow: 12px 15px 0 rgba(67, 50, 30, 0.08);
  }

  .hero-carousel-copy {
    padding-top: 2.6rem;
    padding-right: 1rem;
    padding-bottom: 3rem;
    padding-left: 1rem;
  }

  .hero-carousel-copy strong {
    font-size: clamp(1.3rem, 6.4vw, 1.9rem);
  }

  .hero-carousel-copy span {
    max-width: 34ch;
    font-size: clamp(0.75rem, 3.2vw, 0.88rem);
  }

  .hero-carousel-slide-portrait::after {
    display: none;
  }

  .hero-carousel-slide-portrait .hero-carousel-copy {
    top: auto;
    right: auto;
    bottom: 0.75rem;
    left: 50%;
    display: block;
    padding: 0;
    text-align: center;
    transform: translateX(-50%);
  }

  .hero-carousel-slide-portrait .hero-carousel-copy strong {
    display: block;
    max-width: 16ch;
    padding: 0.42rem 0.68rem;
    border: 1px solid rgba(255, 249, 238, 0.72);
    border-radius: 999px;
    background: rgba(24, 32, 27, 0.9);
    font-size: clamp(0.82rem, 3.8vw, 1rem);
    line-height: 1;
  }

  .hero-carousel-slide-portrait .hero-carousel-copy span {
    display: none;
  }

  .hero-carousel-arrow {
    width: 2.45rem;
    height: 2.45rem;
  }

}

@media (min-width: 1100px) {
  .hero-demo.hero-carousel {
    width: 100%;
    margin: 0 0 3.6rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  .hero-carousel-slide,
  .hero-carousel-slide.is-active,
  .hero-carousel-dots button[aria-current="true"] {
    transition: none;
  }
}

@media (forced-colors: active) {
  .hero-carousel-arrow,
  .hero-carousel-toggle,
  .hero-carousel-dots button,
  .hero-carousel figcaption {
    border: 2px solid ButtonText;
  }
}
