.carouselSection {
  margin: 0 auto;
  max-width: 1600px;
  padding: 1.75rem 0 clamp(5rem, 9vw, 8rem);
  position: relative;
}

.carouselSection::before {
  background: linear-gradient(90deg, transparent, rgb(88 232 244 / 30%), rgb(170 103 255 / 38%), transparent);
  content: "";
  height: 1px;
  left: 10%;
  position: absolute;
  right: 10%;
  top: 5.4rem;
}

.familyNav {
  display: flex;
  gap: 0.55rem;
  justify-content: flex-start;
  margin: 0 auto;
  max-width: min(94vw, 1100px);
  overflow-x: auto;
  padding: 0.25rem 0.5rem 1.5rem;
  scrollbar-width: none;
}

.familyNav::-webkit-scrollbar {
  display: none;
}

.familyButton,
.activeFamilyButton {
  appearance: none;
  background: rgb(255 255 255 / 4%);
  border: 1px solid rgb(255 255 255 / 12%);
  border-radius: 999px;
  color: #aebdd1;
  cursor: pointer;
  flex: 0 0 auto;
  font: inherit;
  font-size: 0.76rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  padding: 0.64rem 0.94rem;
  transition: background 160ms ease, border-color 160ms ease, color 160ms ease, transform 160ms ease;
}

.familyButton:hover,
.activeFamilyButton {
  background: linear-gradient(135deg, rgb(88 232 244 / 16%), rgb(170 103 255 / 20%));
  border-color: rgb(88 232 244 / 48%);
  color: #fff;
  transform: translateY(-1px);
}

.familyButton:focus-visible,
.activeFamilyButton:focus-visible,
.carousel:focus-visible,
.arrow:focus-visible,
.card:focus-visible {
  outline: 3px solid var(--vroomster-cyan);
  outline-offset: 4px;
}

.carousel {
  cursor: grab;
  height: clamp(350px, 48vw, 585px);
  margin: 0 auto;
  max-width: 100%;
  outline: none;
  perspective: 1400px;
  position: relative;
  touch-action: pan-y;
  user-select: none;
}

.dragging {
  cursor: grabbing;
}

.instruction {
  color: #778aa3;
  font-size: 0.74rem;
  font-weight: 750;
  left: 50%;
  letter-spacing: 0.1em;
  margin: 0;
  position: absolute;
  text-transform: uppercase;
  top: 0.6rem;
  transform: translateX(-50%);
  white-space: nowrap;
}

.stage {
  contain: layout paint;
  height: 100%;
  overflow: hidden;
  position: relative;
  transform-style: preserve-3d;
  width: 100%;
}

.card {
  --carousel-step: clamp(9rem, 25vw, 23rem);
  align-items: center;
  appearance: none;
  background: transparent;
  border: 0;
  color: #f8fbff;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  left: 50%;
  padding: 0;
  position: absolute;
  top: clamp(2.4rem, 4vw, 3.2rem);
  transform:
    translate3d(calc(-50% + var(--offset) * var(--carousel-step)), calc(var(--distance) * 1.55rem), calc(var(--distance) * -5rem))
    rotateY(calc(var(--offset) * -11deg))
    scale(var(--card-scale));
  transform-origin: center center;
  width: clamp(13rem, 32vw, 26rem);
  opacity: var(--card-opacity);
  backface-visibility: hidden;
  transform-style: preserve-3d;
}

.card[data-visible="false"] {
  pointer-events: none;
}

.dragging .card,
.is-moving .card {
  will-change: transform, opacity;
}

.imageFrame {
  align-items: center;
  aspect-ratio: 1;
  background:
    radial-gradient(circle at 50% 44%, rgb(255 255 255 / 10%), transparent 60%),
    linear-gradient(145deg, rgb(14 33 52 / 74%), rgb(12 13 29 / 46%));
  border: 1px solid rgb(255 255 255 / 11%);
  border-radius: clamp(2rem, 5vw, 4rem);
  box-shadow: 0 2.4rem 6rem rgb(0 0 0 / 42%), inset 0 1px rgb(255 255 255 / 10%);
  display: flex;
  justify-content: center;
  overflow: hidden;
  position: relative;
  width: 100%;
}

.imageFrame::after {
  background: linear-gradient(110deg, transparent 20%, rgb(255 255 255 / 10%) 48%, transparent 68%);
  content: "";
  inset: 0;
  pointer-events: none;
  position: absolute;
  transform: translateX(-100%);
  transition: transform 650ms ease;
}

.activeCard .imageFrame {
  border-color: rgb(88 232 244 / 38%);
  box-shadow:
    0 2.8rem 7rem rgb(0 0 0 / 52%),
    0 0 5rem rgb(110 84 255 / 15%),
    inset 0 1px rgb(255 255 255 / 15%);
}

.activeCard:hover .imageFrame::after {
  transform: translateX(100%);
}

.card img {
  backface-visibility: hidden;
  display: block;
  height: 100%;
  object-fit: contain;
  pointer-events: none;
  transform: translateZ(0);
  width: 100%;
}

.card strong {
  font-size: clamp(1rem, 2vw, 1.35rem);
  letter-spacing: -0.025em;
  margin-top: 0.9rem;
  text-shadow: 0 2px 18px rgb(0 0 0 / 80%);
}

.arrow {
  align-items: center;
  appearance: none;
  backdrop-filter: blur(14px);
  background: rgb(9 18 31 / 74%);
  border: 1px solid rgb(255 255 255 / 16%);
  border-radius: 999px;
  color: #fff;
  cursor: pointer;
  display: flex;
  font-size: 1.2rem;
  height: 3.25rem;
  justify-content: center;
  position: absolute;
  top: 46%;
  transition: background 160ms ease, border-color 160ms ease, transform 160ms ease;
  width: 3.25rem;
  z-index: 30;
}

.arrow:hover {
  background: rgb(88 232 244 / 18%);
  border-color: rgb(88 232 244 / 60%);
  transform: scale(1.06);
}

.previousArrow {
  left: clamp(0.75rem, 4vw, 4rem);
}

.nextArrow {
  right: clamp(0.75rem, 4vw, 4rem);
}

.activeDetails {
  align-items: center;
  display: flex;
  flex-direction: column;
  margin: clamp(-1.6rem, -2vw, -0.4rem) auto 0;
  max-width: 620px;
  min-height: 11rem;
  padding: 0 1.5rem;
  text-align: center;
}

.familyName {
  color: var(--vroomster-cyan) !important;
  font-size: 0.74rem !important;
  font-weight: 850;
  letter-spacing: 0.14em;
  margin: 0 0 0.35rem !important;
  text-transform: uppercase;
}

.activeDetails h2 {
  font-size: clamp(2rem, 5vw, 3.5rem);
  letter-spacing: -0.055em;
  line-height: 1;
  margin: 0;
}

.activeDetails > p:not(.familyName) {
  color: #9eafc4;
  line-height: 1.6;
  margin: 0.75rem 0 0;
}

.activeDetails > span {
  color: #71849d;
  font-size: 0.72rem;
  font-variant-numeric: tabular-nums;
  font-weight: 800;
  letter-spacing: 0.16em;
  margin-top: 1rem;
}

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

@media (max-width: 640px) {
  .carouselSection {
    padding-top: 0.75rem;
  }

  .carouselSection::before {
    top: 4.4rem;
  }

  .familyNav {
    padding-inline: 1rem;
  }

  .carousel {
    height: 360px;
  }

  .instruction {
    font-size: 0.64rem;
    letter-spacing: 0.08em;
    white-space: normal;
    width: calc(100% - 2rem);
  }

  .card {
    --carousel-step: clamp(8.5rem, 39vw, 10.5rem);
    top: 2.7rem;
    width: clamp(13.5rem, 62vw, 16rem);
  }

  .arrow {
    height: 2.8rem;
    top: 44%;
    width: 2.8rem;
  }

  .previousArrow {
    left: 0.65rem;
  }

  .nextArrow {
    right: 0.65rem;
  }

  .activeDetails {
    margin-top: -0.6rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  .card,
  .familyButton,
  .activeFamilyButton,
  .arrow,
  .imageFrame::after {
    transition: none;
  }
}

