.testimonials-carousel {
  position: relative;
  width: min(100%, 48rem);
  margin: 2.5rem auto 0;
  padding-inline: 3rem;
}

.testimonials-viewport {
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: 1.5rem;
  background: linear-gradient(145deg, #ffffff 0%, #f3f5f8 100%);
  box-shadow: 0 20px 50px -20px rgb(9 36 130 / 0.34);
  touch-action: pan-y;
}

.testimonials-track {
  display: flex;
  align-items: stretch;
  transition: transform 500ms cubic-bezier(0.22, 0.7, 0.24, 1);
  will-change: transform;
}

.testimonial-slide {
  min-width: 100%;
  display: grid;
  place-items: center;
  padding: 1rem;
}

.testimonial-slide img {
  display: block;
  width: auto;
  max-width: 100%;
  height: auto;
  max-height: min(72vh, 45rem);
  border-radius: 1rem;
  box-shadow: 0 14px 30px -18px rgb(0 0 0 / 0.5);
}

.testimonial-control {
  position: absolute;
  top: 50%;
  z-index: 2;
  width: 2.75rem;
  height: 2.75rem;
  display: grid;
  place-items: center;
  border: 1px solid rgb(9 36 130 / 0.12);
  border-radius: 9999px;
  color: #08152c;
  background: #feca00;
  box-shadow: 0 10px 25px -12px rgb(0 0 0 / 0.7);
  cursor: pointer;
  transform: translateY(-50%);
  transition: transform 180ms ease, box-shadow 180ms ease;
}

.testimonial-control:hover,
.testimonial-control:focus-visible {
  transform: translateY(-50%) scale(1.07);
  box-shadow: 0 12px 28px -10px rgb(9 36 130 / 0.55);
  outline: 3px solid rgb(254 202 0 / 0.28);
  outline-offset: 3px;
}

.testimonial-control svg {
  width: 1.25rem;
  height: 1.25rem;
}

.testimonial-control--previous {
  left: 0;
}

.testimonial-control--next {
  right: 0;
}

.testimonials-dots {
  display: flex;
  justify-content: center;
  gap: 0.5rem;
  margin-top: 1rem;
}

.testimonial-dot {
  width: 0.62rem;
  height: 0.62rem;
  border-radius: 9999px;
  background: rgb(9 36 130 / 0.22);
  cursor: pointer;
  transition: width 180ms ease, background 180ms ease;
}

.testimonial-dot[aria-current="true"] {
  width: 1.8rem;
  background: #092482;
}

@media (max-width: 40rem) {
  .testimonials-carousel {
    padding-inline: 0;
  }

  .testimonial-slide {
    padding: 0.65rem;
  }

  .testimonial-control {
    top: auto;
    bottom: -0.35rem;
    width: 2.5rem;
    height: 2.5rem;
    transform: none;
  }

  .testimonial-control:hover,
  .testimonial-control:focus-visible {
    transform: scale(1.05);
  }

  .testimonial-control--previous {
    left: calc(50% - 5.5rem);
  }

  .testimonial-control--next {
    right: calc(50% - 5.5rem);
  }

  .testimonials-dots {
    min-height: 2.5rem;
    align-items: center;
    padding-inline: 3.5rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  .testimonials-track,
  .testimonial-control,
  .testimonial-dot {
    transition: none;
  }
}
