.stacked-carousel-row {
  --edge: clamp(16px, 4vw, 48px);
  --carousel-height: clamp(150px, 62vh, 760px);
  --row-height: min(var(--carousel-height), calc(100vh - (var(--edge) * 2)));
  --card-size: 96%;
  width: min(1280px, calc(100% - (var(--edge) * 2)), calc(var(--row-height) * 1.6));
  margin: var(--edge) auto var(--edge);
  padding: 0 var(--edge) var(--edge);
  display: flex;
  gap: clamp(1rem, 2.4vw, 2rem);
  align-items: center;
  height: var(--row-height);
  box-sizing: border-box;
}

.stacked-carousel-wrap {
  flex: 0 1 60%;
  height: 100%;
  border-radius: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.stacked-carousel-panel {
  flex: 0 1 40%;
  height: var(--card-size);
  align-self: center;
  border-radius: 3px;
  background: linear-gradient(135deg, #f4f1ec 0%, #e3ded7 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: clamp(1.2rem, 2.4vw, 2.2rem);
  color: #1f1f1f;
  overflow: hidden;
  position: relative;
  isolation: isolate;
}

.stacked-carousel-panel.grainy-layer {
  position: relative;
  isolation: isolate;
}

.stacked-carousel-panel.grainy-layer > * {
  position: relative;
  z-index: 1;
}

.stacked-carousel-panel.grainy-layer::after {
  border-radius: 3px;
}

.stacked-carousel-panel-text {
  font-size: clamp(0.9rem, 0.7vw + 0.6rem, 1.15rem);
  line-height: 1.5;
  max-width: 100%;
}

.stacked-carousel-panel-text p + p {
  margin-top: 0.5rem;
}

.stacked-carousel-panel-text blockquote {
  margin: 0.65rem 0;
  padding-left: 0.75rem;
  border-left: 3px solid rgba(0, 0, 0, 0.15);
  font-style: italic;
}

.stacked-carousel-root {
  width: 100%;
  height: 100%;
}

.stacked-carousel {
  position: relative;
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.stacked-card {
  position: absolute;
  top: 50%;
  left: 50%;
  height: var(--card-size);
  width: var(--card-size);
  border-radius: 3px;
  background: transparent;
  box-shadow: none;
  transform: translate3d(
      calc(-50% + var(--offset-x)),
      calc(-50% + var(--offset-y)),
      0
    )
    scale(var(--scale)) rotate(0deg);
  opacity: 1;
  filter: none;
  z-index: var(--z);
  transition: transform 0.6s cubic-bezier(.2, .8, .2, 1),
    opacity 0.6s ease, filter 0.6s ease;
  overflow: hidden;
}

.stacked-card__content {
  position: absolute;
  left: var(--media-fit-x, 0px);
  top: var(--media-fit-y, 0px);
  width: var(--media-fit-w, 100%);
  height: var(--media-fit-h, 100%);
  border-radius: inherit;
  overflow: hidden;
  z-index: 0;
}

.stacked-card__media {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border-radius: inherit;
  background-position: center;
  background-size: contain;
  background-repeat: no-repeat;
  object-fit: contain;
  object-position: center;
  opacity: var(--opacity);
  transition: opacity 0.6s ease;
  z-index: 0;
  display: block;
  background-color: transparent;
}

.stacked-card.is-active {
  filter: none;
  opacity: 1;
  box-shadow: none;
}

.stacked-card__overlay {
  position: absolute;
  inset: 0;
  color: #fff;
  z-index: 1;
  --card-pad: clamp(14px, 2.2vmin, 36px);
  --text-bottom: clamp(16px, 2.4vmin, 34px);
  --text-gap: clamp(0.45rem, 0.9vmin, 0.9rem);
  --text-to-cta: clamp(0.55rem, 1.0vmin, 1.1rem);
}

.stacked-card__overlay::before {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 58%;
  background: linear-gradient(
    180deg,
    rgba(0, 0, 0, 0) 0%,
    rgba(0, 0, 0, 0.45) 50%,
    rgba(0, 0, 0, 0.7) 100%
  );
  z-index: 0;
}

.stacked-card__eyebrow {
  position: absolute;
  top: var(--card-pad);
  left: var(--card-pad);
  font-family: var(--font-anton);
  font-size: clamp(0.7rem, 1.6vmin, 1.05rem);
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.9);
  z-index: 1;
}

.stacked-card__body {
  position: absolute;
  left: var(--card-pad);
  right: var(--card-pad);
  bottom: var(--text-bottom);
  display: grid;
  gap: var(--text-gap);
  z-index: 1;
  max-width: 32ch;
}

.stacked-carousel-row.is-intro-ready .stacked-card,
.stacked-carousel-row.is-intro-ready .stacked-carousel-panel {
  opacity: 0;
}

.stacked-carousel-row.is-intro .stacked-card {
  animation: stacked-card-intro 0.8s cubic-bezier(.22, .7, .22, 1) both;
  animation-delay: calc((var(--max-depth, 0) - var(--depth, 0)) * 0.3s);
  filter: none;
}

.stacked-carousel-row.is-intro .stacked-carousel-panel {
  transform-origin: left bottom;
  animation: stacked-panel-grow 0.6s ease-out both;
  animation-delay: var(--panel-delay, 1.2s);
}

@keyframes stacked-card-intro {
  0% {
    opacity: 0;
    transform: translate3d(
        calc(-50% + var(--offset-x) - 140px),
        calc(-50% + var(--offset-y) + 140px),
        0
      )
      scale(var(--scale)) rotate(-6deg);
  }
  60% {
    opacity: 1;
  }
  100% {
    opacity: 1;
    transform: translate3d(
        calc(-50% + var(--offset-x)),
        calc(-50% + var(--offset-y)),
        0
      )
      scale(var(--scale)) rotate(0deg);
  }
}

@keyframes stacked-panel-grow {
  0% {
    opacity: 0;
    transform: scale(0);
  }
  100% {
    opacity: 1;
    transform: scale(1);
  }
}

.stacked-card__title {
  font-family: var(--font-pt-serif);
  font-weight: 700;
  font-size: clamp(1.35rem, 4.6vmin, 3.1rem);
  line-height: 1.08;
  letter-spacing: 0.01em;
  color: #ffffff;
}

.stacked-card__subtitle {
  margin-top: 0.25rem;
  font-family: var(--font-inter);
  font-weight: 500;
  font-size: clamp(0.85rem, 2.2vmin, 1.35rem);
  line-height: 1.35;
  color: rgba(255, 255, 255, 0.9);
}

.stacked-card__pill {
  margin-top: var(--text-to-cta);
  background: none;
  color: #ffffff;
  border: none;
  padding: 0;
  font-family: var(--font-inter);
  font-weight: 600;
  font-size: clamp(0.8rem, 2.1vmin, 1.25rem);
  letter-spacing: 0.01em;
  cursor: pointer;
  text-align: left;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
}

.stacked-card__pill:hover {
  color: rgba(255, 255, 255, 0.78);
}

@supports (container-type: size) {
  .stacked-card {
    container-type: size;
  }

  .stacked-card__overlay {
    --card-pad: clamp(14px, min(4cqw, 4cqh), 36px);
    --text-bottom: clamp(16px, min(4cqw, 4cqh), 34px);
    --text-gap: clamp(0.45rem, min(1.2cqw, 1.2cqh), 0.9rem);
    --text-to-cta: clamp(0.55rem, min(1.4cqw, 1.4cqh), 1.1rem);
  }

  .stacked-card__eyebrow {
    font-size: clamp(0.7rem, min(2.4cqw, 2.4cqh), 1.05rem);
  }

  .stacked-card__body {
    gap: var(--text-gap);
  }

  .stacked-card__title {
    font-size: clamp(1.35rem, min(6.2cqw, 6.2cqh), 3.1rem);
  }

  .stacked-card__subtitle {
    font-size: clamp(0.85rem, min(3.1cqw, 3.1cqh), 1.35rem);
  }

  .stacked-card__pill {
    margin-top: var(--text-to-cta);
    font-size: clamp(0.8rem, min(3.1cqw, 3.1cqh), 1.25rem);
  }
}

.stacked-carousel__nav {
  --nav-size: 48px;
  --nav-offset: calc(var(--nav-size) / 2);
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: var(--nav-size);
  height: var(--nav-size);
  border-radius: 50%;
  border: none;
  background: rgba(0, 0, 0, 0.45);
  color: #fff;
  font-size: 2rem;
  line-height: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: 0 10px 22px rgba(0, 0, 0, 0.25);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease, transform 0.2s ease, background 0.2s ease,
    box-shadow 0.2s ease;
  z-index: 6;
}

.stacked-carousel__nav--left {
  left: calc(50% - (var(--card-size) / 2) + var(--nav-offset));
}

.stacked-carousel__nav--right {
  left: calc(50% + (var(--card-size) / 2) - var(--nav-offset));
}

.stacked-carousel__nav:hover {
  background: rgba(238, 71, 3, 0.9);
  transform: translate(-50%, -50%) scale(1.05);
  box-shadow: 0 14px 26px rgba(0, 0, 0, 0.28);
}

.stacked-carousel__nav:disabled {
  cursor: default;
  opacity: 0.45;
  box-shadow: none;
}

.stacked-carousel__nav:disabled:hover {
  background: rgba(0, 0, 0, 0.45);
  transform: translate(-50%, -50%);
}

.stacked-carousel-row.is-intro-done .stacked-carousel__nav {
  opacity: 1;
  pointer-events: auto;
}

@media (max-width: 600px) {
  .stacked-carousel-row {
    height: auto;
    flex-direction: column;
    margin-bottom: var(--edge);
    padding-bottom: var(--edge);
    width: min(100%, calc(100% - (var(--edge) * 2)));
    --card-size: clamp(220px, 45vh, 460px);
  }

  .stacked-carousel-wrap {
    width: 100%;
    height: var(--card-size);
    border-radius: 22px;
  }

  .stacked-carousel-panel {
    width: 100%;
    height: var(--card-size);
    border-radius: 3px;
  }

  .stacked-card {
    height: 90%;
    max-width: 90%;
    border-radius: 24px;
  }

  .stacked-card__eyebrow {
    font-size: clamp(0.5rem, 2.2vmin, 0.75rem);
    letter-spacing: 0.18em;
  }

  .stacked-card__title {
    font-size: clamp(1rem, 3.4vmin, 2.1rem);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .stacked-card__subtitle {
    font-size: clamp(0.65rem, 2vmin, 1rem);
  }

  .stacked-card__pill {
    font-size: clamp(0.6rem, 2vmin, 0.95rem);
  }

  .stacked-carousel-panel-text {
    font-size: clamp(0.55rem, 2.6vw, 0.8rem);
    line-height: 1.3;
  }

  .stacked-carousel-panel-text p + p {
    margin-top: 0.2rem;
  }

  .stacked-carousel-panel-text blockquote {
    margin: 0.35rem 0;
    padding-left: 0.5rem;
  }

  .stacked-carousel__nav {
    --nav-size: 42px;
    font-size: 1.7rem;
  }
}
