.site-carousel {
  --carousel-accent: var(--accent, #34d399);
  --carousel-pitch-ink: #f4faf8;
  --carousel-pitch-muted: rgba(236, 253, 245, 0.72);
  position: relative;
  z-index: 2;
  width: 100%;
  padding: 5.7rem 0 1.25rem;
  opacity: 0;
  animation: siteCarouselFadeIn 4s ease forwards;
}

@keyframes siteCarouselFadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

body.region-uk .site-carousel {
  --carousel-accent: #818cf8;
}

body.region-us .site-carousel {
  --carousel-accent: #60a5fa;
}

/* Mixed-cache fallback for the retired carousel CTA markup. */
.site-carousel a.button.button--primary {
  background: var(--carousel-accent);
  color: #03110c !important;
  -webkit-text-fill-color: #03110c;
}

.site-carousel a.button.button--primary:hover,
.site-carousel a.button.button--primary:focus-visible {
  color: #03110c !important;
  -webkit-text-fill-color: #03110c;
}

.site-carousel + .hero {
  padding-top: 4.5rem;
}

.site-carousel__stage {
  position: relative;
  width: min(1320px, calc(100% - 2rem));
  height: clamp(420px, 46vw, 660px);
  margin: 0 auto;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.13);
  border-radius: clamp(18px, 2.2vw, 30px);
  background: #030608;
  box-shadow: 0 30px 100px rgba(0, 0, 0, 0.48);
  isolation: isolate;
  touch-action: pan-y;
}

.site-carousel__stage:focus-visible,
.carousel-arrow:focus-visible,
.carousel-dot:focus-visible {
  outline: 3px solid rgba(255, 255, 255, 0.96);
  outline-offset: 3px;
}

.site-carousel__slides,
.site-carousel__slide,
.site-carousel__slide picture,
.site-carousel__slide img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

.site-carousel__slide {
  margin: 0;
  opacity: 0;
  transform: scale(1.012);
  transition: opacity 420ms ease, transform 900ms ease;
}

.site-carousel__slide[hidden] {
  display: none;
}

.site-carousel__slide.is-active {
  opacity: 1;
  transform: scale(1);
}

.site-carousel__slide img {
  display: block;
  object-fit: cover;
  object-position: center;
}

.site-carousel__stage::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 2;
  pointer-events: none;
  background:
    linear-gradient(180deg, rgba(0, 0, 0, 0.08), transparent 62%, rgba(0, 0, 0, 0.42)),
    linear-gradient(
      90deg,
      rgba(0, 0, 0, 0.62) 0%,
      rgba(0, 0, 0, 0.38) 18%,
      rgba(0, 0, 0, 0.08) 28%,
      transparent 38%,
      transparent 86%,
      rgba(0, 0, 0, 0.1)
    );
}

/* Left gutter pitch — stays clear of device mockups (~25% desktop). */
.site-carousel__pitch {
  position: absolute;
  z-index: 3;
  top: 0;
  left: 0;
  bottom: 0;
  width: min(26%, 320px);
  /* Upper-left band keeps copy clear of mid-height arrows + mockups. */
  padding: clamp(2.4rem, 5.5vw, 4.2rem) 0.85rem clamp(3.2rem, 5vw, 4rem) clamp(1.35rem, 2.8vw, 2.35rem);
  display: flex;
  align-items: flex-start;
  pointer-events: none;
  perspective: 900px;
}

.site-carousel__pitch-track {
  position: relative;
  width: 100%;
  min-height: clamp(7.5rem, 18vw, 11rem);
  transform-style: preserve-3d;
}

.site-carousel__pitch-frame {
  position: absolute;
  inset: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 0.55rem;
  opacity: 0;
  transform-origin: 20% 60%;
  transform: rotateX(72deg) rotateZ(-8deg) translate3d(0, 28%, 0) scale(0.9);
  filter: blur(2px);
  backface-visibility: hidden;
  animation: carouselPitchSpin 24s cubic-bezier(0.2, 0.85, 0.25, 1) infinite;
  animation-fill-mode: both;
  will-change: transform, opacity, filter;
}

.site-carousel__pitch-frame:nth-child(1) { animation-delay: 0s; }
.site-carousel__pitch-frame:nth-child(2) { animation-delay: 4s; }
.site-carousel__pitch-frame:nth-child(3) { animation-delay: 8s; }
.site-carousel__pitch-frame:nth-child(4) { animation-delay: 12s; }
.site-carousel__pitch-frame:nth-child(5) { animation-delay: 16s; }
.site-carousel__pitch-frame:nth-child(6) { animation-delay: 20s; }

.site-carousel__pitch-kicker {
  display: block;
  font-family: var(--font-sans, 'IBM Plex Sans', system-ui, sans-serif);
  font-size: clamp(0.62rem, 0.95vw, 0.74rem);
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--carousel-accent);
  text-shadow:
    0 0 18px color-mix(in srgb, var(--carousel-accent) 45%, transparent),
    0 2px 10px rgba(0, 0, 0, 0.75);
}

.site-carousel__pitch-line {
  display: block;
  max-width: 12ch;
  font-family: var(--font-sans, 'IBM Plex Sans', system-ui, sans-serif);
  font-size: clamp(1.35rem, 2.35vw, 2.05rem);
  font-weight: 700;
  line-height: 1.12;
  letter-spacing: -0.035em;
  color: var(--carousel-pitch-ink);
  text-wrap: balance;
  text-shadow:
    0 1px 0 rgba(0, 0, 0, 0.35),
    0 8px 28px rgba(0, 0, 0, 0.72),
    0 2px 8px rgba(0, 0, 0, 0.55);
}

.site-carousel__pitch-frame:nth-child(1) .site-carousel__pitch-line { color: #ecfdf5; }
.site-carousel__pitch-frame:nth-child(2) .site-carousel__pitch-line { color: #e0f2fe; }
.site-carousel__pitch-frame:nth-child(2) .site-carousel__pitch-kicker { color: #38bdf8; }
.site-carousel__pitch-frame:nth-child(3) .site-carousel__pitch-line { color: #f0fdfa; }
.site-carousel__pitch-frame:nth-child(3) .site-carousel__pitch-kicker { color: #2dd4bf; }
.site-carousel__pitch-frame:nth-child(4) .site-carousel__pitch-line { color: #eff6ff; }
.site-carousel__pitch-frame:nth-child(4) .site-carousel__pitch-kicker { color: #60a5fa; }
.site-carousel__pitch-frame:nth-child(5) .site-carousel__pitch-line { color: #f5f3ff; }
.site-carousel__pitch-frame:nth-child(5) .site-carousel__pitch-kicker {
  color: color-mix(in srgb, var(--carousel-accent) 70%, #a5b4fc);
}
.site-carousel__pitch-frame:nth-child(6) .site-carousel__pitch-line { color: #ecfeff; }
.site-carousel__pitch-frame:nth-child(6) .site-carousel__pitch-kicker { color: #22d3ee; }

body.region-uk .site-carousel__pitch-frame:nth-child(2) .site-carousel__pitch-kicker { color: #a5b4fc; }
body.region-uk .site-carousel__pitch-frame:nth-child(4) .site-carousel__pitch-kicker { color: #818cf8; }
body.region-us .site-carousel__pitch-frame:nth-child(1) .site-carousel__pitch-kicker { color: #60a5fa; }
body.region-us .site-carousel__pitch-frame:nth-child(3) .site-carousel__pitch-kicker { color: #38bdf8; }

@keyframes carouselPitchSpin {
  0% {
    opacity: 0;
    transform: rotateX(72deg) rotateZ(-8deg) translate3d(0, 28%, 0) scale(0.9);
    filter: blur(2px);
  }
  2.4% {
    opacity: 1;
    transform: rotateX(-8deg) rotateZ(1.5deg) translate3d(0, -4%, 0) scale(1.03);
    filter: blur(0);
  }
  4.2% {
    opacity: 1;
    transform: rotateX(0) rotateZ(0) translate3d(0, 0, 0) scale(1);
    filter: blur(0);
  }
  14% {
    opacity: 1;
    transform: rotateX(0) rotateZ(0) translate3d(0, 0, 0) scale(1);
    filter: blur(0);
  }
  16.4% {
    opacity: 0;
    transform: rotateX(-58deg) rotateZ(6deg) translate3d(0, -22%, 0) scale(0.92);
    filter: blur(2px);
  }
  16.66%,
  100% {
    opacity: 0;
    transform: rotateX(-58deg) rotateZ(6deg) translate3d(0, -22%, 0) scale(0.92);
    filter: blur(2px);
  }
}

.carousel-arrow,
.carousel-dot {
  border: 0;
  color: #fff;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

.carousel-arrow {
  position: absolute;
  top: 50%;
  z-index: 4;
  display: grid;
  width: 46px;
  height: 46px;
  padding: 0;
  place-items: center;
  border: 1px solid rgba(255, 255, 255, 0.25);
  border-radius: 50%;
  background: rgba(3, 6, 8, 0.56);
  box-shadow: 0 8px 26px rgba(0, 0, 0, 0.24);
  opacity: 0.8;
  transform: translateY(-50%);
  transition: opacity 160ms ease, background-color 160ms ease, transform 160ms ease;
  backdrop-filter: blur(10px);
}

.carousel-arrow:hover {
  background: rgba(3, 6, 8, 0.82);
  opacity: 1;
}

.carousel-arrow::before {
  content: "";
  width: 10px;
  height: 10px;
  border-top: 2px solid currentColor;
  border-right: 2px solid currentColor;
}

.carousel-arrow--previous {
  left: 1rem;
}

.carousel-arrow--previous::before {
  margin-left: 4px;
  transform: rotate(-135deg);
}

.carousel-arrow--next {
  right: 1rem;
}

.carousel-arrow--next::before {
  margin-right: 4px;
  transform: rotate(45deg);
}

.carousel-dots {
  position: absolute;
  z-index: 4;
  bottom: 1rem;
  left: 50%;
  display: flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.35rem 0.5rem;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 999px;
  background: rgba(3, 6, 8, 0.48);
  transform: translateX(-50%);
  backdrop-filter: blur(10px);
}

.carousel-dot {
  position: relative;
  flex: 0 0 auto;
  width: 24px;
  min-width: 24px;
  height: 24px;
  min-height: 24px;
  padding: 0;
  border-radius: 999px;
  background: transparent;
  transition: background-color 180ms ease;
}

.carousel-dot::after {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.46);
  transform: translate(-50%, -50%);
  transition: width 180ms ease, height 180ms ease, background-color 180ms ease;
}

.carousel-dot.is-active::after {
  width: 16px;
  height: 8px;
  border-radius: 999px;
  background: var(--carousel-accent);
}

@media (max-width: 980px) {
  .site-carousel__pitch {
    width: min(30%, 260px);
    padding-left: 1rem;
  }

  .site-carousel__pitch-line {
    font-size: clamp(1.2rem, 2.8vw, 1.65rem);
  }
}

@media (max-width: 760px) {
  .site-carousel {
    padding-top: 4.7rem;
    padding-bottom: 0.5rem;
  }

  .site-carousel + .hero {
    padding-top: 3.25rem;
  }

  .site-carousel__stage {
    width: calc(100% - 0.75rem);
    height: clamp(260px, 74vw, 340px);
    border-radius: 16px;
  }

  .site-carousel__slide img {
    object-position: 58% center;
  }

  .site-carousel__stage::after {
    background:
      linear-gradient(180deg, rgba(0, 0, 0, 0.55) 0%, rgba(0, 0, 0, 0.18) 42%, transparent 68%, rgba(0, 0, 0, 0.45)),
      linear-gradient(90deg, rgba(0, 0, 0, 0.42) 0%, rgba(0, 0, 0, 0.16) 36%, transparent 52%);
  }

  /* Stack into a compact top-left band so mockups stay clear. */
  .site-carousel__pitch {
    top: 0.7rem;
    left: 0.65rem;
    right: auto;
    bottom: auto;
    width: min(48%, 11.5rem);
    height: auto;
    padding: 0.55rem 0.65rem 0.65rem;
    align-items: flex-start;
    border-radius: 12px;
    background: linear-gradient(145deg, rgba(3, 6, 8, 0.62), rgba(3, 6, 8, 0.18));
    box-shadow: 0 10px 28px rgba(0, 0, 0, 0.28);
    backdrop-filter: blur(6px);
  }

  .site-carousel__pitch-track {
    min-height: 4.6rem;
  }

  .site-carousel__pitch-frame {
    gap: 0.35rem;
    transform-origin: top left;
  }

  .site-carousel__pitch-kicker {
    font-size: 0.58rem;
    letter-spacing: 0.14em;
  }

  .site-carousel__pitch-line {
    max-width: 14ch;
    font-size: clamp(1.02rem, 4.4vw, 1.22rem);
  }

  .carousel-arrow {
    width: 40px;
    height: 40px;
    opacity: 0.88;
  }

  .carousel-arrow--previous {
    left: 0.65rem;
  }

  .carousel-arrow--next {
    right: 0.65rem;
  }

  .carousel-dots {
    bottom: 0.65rem;
    gap: 0.45rem;
    padding: 0.48rem 0.6rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  .site-carousel {
    opacity: 1;
    animation: none;
  }

  .site-carousel__slide,
  .carousel-arrow,
  .carousel-dot {
    transition-duration: 0.001ms !important;
  }

  .site-carousel__pitch-frame {
    animation: none;
    opacity: 0;
    transform: none;
    filter: none;
  }

  .site-carousel__pitch-frame:first-child {
    opacity: 1;
  }
}
