.section-carousel {
  padding-bottom: 84px;
}

.carousel-heading {
  display: flex;
  justify-content: space-between;
  gap: 24px;
  align-items: end;
  margin-bottom: 22px;
}

.carousel-heading h2 {
  margin: 8px 0 0;
  font-size: clamp(2rem, 4vw, 3.4rem);
  letter-spacing: -0.055em;
}

.carousel-arrows {
  display: flex;
  gap: 10px;
}

.carousel-arrows button {
  display: inline-grid;
  width: 46px;
  height: 46px;
  place-items: center;
  color: #e5e7eb;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 15px;
  background: rgba(255, 255, 255, 0.045);
  font: inherit;
  font-size: 1.25rem;
  transition: color 160ms ease, border-color 160ms ease, background 160ms ease, transform 160ms ease;
}

.carousel-arrows button:hover {
  color: var(--accent-color);
  border-color: var(--accent-color);
  background: var(--accent-faint);
  transform: translateY(-1px);
}

.carousel-viewport {
  position: relative;
  overflow: hidden;
  width: 100%;
  border-radius: 34px;
  outline: none;
  touch-action: pan-y;
  user-select: none;
  cursor: grab;
}

.carousel-viewport:focus-visible {
  box-shadow: 0 0 0 3px var(--accent-soft);
}

.carousel-viewport.is-dragging {
  cursor: grabbing;
}

.carousel-track {
  display: grid;
  grid-auto-columns: min(82vw, 560px);
  grid-auto-flow: column;
  gap: 18px;
  overflow-x: auto;
  padding: 8px 4px 20px;
  scrollbar-width: none;
}

.carousel-track::-webkit-scrollbar {
  display: none;
}

.section-slide {
  display: flex;
  min-height: 300px;
  flex-direction: column;
  padding: 30px;
  border: 1px solid var(--border);
  border-radius: 30px;
  color: inherit;
  text-decoration: none;
}

.section-slide h3 {
  margin: 10px 0 12px;
  font-size: clamp(1.8rem, 3vw, 2.75rem);
  letter-spacing: -0.055em;
}

.section-slide > p:not(.eyebrow) {
  max-width: 46ch;
  flex: 1;
  margin: 0;
  color: #a7aeb8;
  line-height: 1.75;
}

.section-slide > span {
  align-self: flex-start;
  margin-top: 26px;
  color: var(--accent-color);
  font-weight: 850;
}

.section-carousel.carousel-ready .carousel-viewport {
  min-height: 348px;
}

.section-carousel.carousel-ready .carousel-track {
  position: relative;
  display: block;
  height: 340px;
  overflow: visible;
  padding: 0;
}

.section-carousel.carousel-ready .section-slide {
  --drag-x: 0px;
  position: absolute;
  top: 8px;
  left: 50%;
  width: min(48vw, 560px);
  min-width: 430px;
  height: 312px;
  opacity: 0;
  pointer-events: none;
  transform: translate3d(-50%, 18px, 0) scale(0.72);
  transform-origin: center;
  transition:
    transform 420ms cubic-bezier(.22, .75, .24, 1),
    opacity 300ms ease,
    border-color 300ms ease,
    box-shadow 300ms ease;
  will-change: transform, opacity;
}

.section-carousel.carousel-ready .section-slide.is-active {
  z-index: 3;
  opacity: 1;
  pointer-events: auto;
  transform: translate3d(calc(-50% + var(--drag-x)), 0, 0) scale(1) rotateY(0deg);
  border-color: rgba(34, 240, 208, 0.42);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.08),
    0 0 58px var(--accent-soft),
    0 28px 80px rgba(0, 0, 0, 0.46);
}

.section-carousel.carousel-ready .section-slide.is-previous {
  z-index: 2;
  opacity: 0.5;
  pointer-events: auto;
  transform:
    translate3d(calc(-122% + var(--drag-x)), 10px, 0)
    scale(0.86)
    perspective(900px)
    rotateY(7deg);
}

.section-carousel.carousel-ready .section-slide.is-next {
  z-index: 2;
  opacity: 0.5;
  pointer-events: auto;
  transform:
    translate3d(calc(22% + var(--drag-x)), 10px, 0)
    scale(0.86)
    perspective(900px)
    rotateY(-7deg);
}

.section-carousel.carousel-ready .section-slide.is-far {
  z-index: 1;
  opacity: 0;
  transform: translate3d(-50%, 22px, 0) scale(0.68);
}

.section-carousel.is-dragging .section-slide {
  transition: none;
}

.carousel-pagination {
  display: flex;
  justify-content: center;
  gap: 8px;
  margin-top: 16px;
}

.carousel-pagination button {
  width: 9px;
  height: 9px;
  padding: 0;
  border: 0;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.2);
  transition: width 200ms ease, background 200ms ease, box-shadow 200ms ease;
}

.carousel-pagination button[aria-current="true"] {
  width: 28px;
  background: var(--accent-color);
  box-shadow: 0 0 16px var(--accent-soft);
}

.carousel-status {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

@media (max-width: 720px) {
  .section-carousel {
    width: 100%;
    padding-bottom: 64px;
  }

  .carousel-heading {
    width: calc(100% - 28px);
    margin-inline: auto;
  }

  .carousel-arrows button {
    width: 42px;
    height: 42px;
  }

  .carousel-viewport {
    border-radius: 24px;
  }

  .section-carousel.carousel-ready .carousel-viewport {
    min-height: 330px;
  }

  .section-carousel.carousel-ready .carousel-track {
    height: 322px;
  }

  .section-carousel.carousel-ready .section-slide {
    top: 7px;
    width: 84vw;
    min-width: 0;
    height: 300px;
    padding: 24px;
    border-radius: 25px;
  }

  .section-carousel.carousel-ready .section-slide.is-previous {
    transform: translate3d(calc(-132% + var(--drag-x)), 12px, 0) scale(0.82) rotateY(5deg);
  }

  .section-carousel.carousel-ready .section-slide.is-next {
    transform: translate3d(calc(32% + var(--drag-x)), 12px, 0) scale(0.82) rotateY(-5deg);
  }

  .section-slide h3 {
    font-size: clamp(1.7rem, 8vw, 2.25rem);
  }

  .section-slide > p:not(.eyebrow) {
    line-height: 1.58;
  }
}

@media (max-width: 480px) {
  .carousel-heading {
    gap: 10px;
  }

  .carousel-heading h2 {
    font-size: 1.65rem;
    white-space: nowrap;
  }

  .carousel-arrows {
    gap: 6px;
  }

  .carousel-arrows button {
    width: 38px;
    height: 38px;
  }
}

@media (max-width: 350px) {
  .carousel-heading {
    flex-wrap: wrap;
  }

  .carousel-arrows {
    width: 100%;
    justify-content: flex-end;
  }
}

@media (prefers-reduced-motion: reduce) {
  .section-carousel.carousel-ready .section-slide,
  .carousel-pagination button {
    transition-duration: 1ms;
  }

  .section-carousel.carousel-ready .section-slide.is-previous,
  .section-carousel.carousel-ready .section-slide.is-next {
    transform: translate3d(calc(-50% + var(--drag-x)), 0, 0) scale(0.94);
    opacity: 0;
    pointer-events: none;
  }
}
