.testimonials {
  --testimonial-ink: #26133f;
  --testimonial-muted: #624d7c;
  --testimonial-border: #eadff7;
  --testimonial-panel: #fffcff;
  --testimonial-chip: #f1e7fc;
  --testimonial-gold: #a96411;
  --testimonial-empty-star: #d7c6e8;
  position: relative;
  isolation: isolate;
  display: grid;
  grid-template-columns: minmax(0, .65fr) minmax(0, 1.35fr);
  align-items: center;
  gap: clamp(14px, 3vw, 36px);
  margin: 0 0 36px;
  padding: clamp(18px, 3vw, 36px);
  overflow: hidden;
  border: 1px solid #9870df70;
  border-radius: 24px;
  background:
    radial-gradient(ellipse at 99% 0, #8150de 0, transparent 58%),
    radial-gradient(ellipse at 5% 106%, #5b319b 0, transparent 54%),
    linear-gradient(122deg, #22103e 16%, #45277e 100%);
  color: #fff;
}

html[data-theme="dark"] .testimonials {
  --testimonial-ink: #fbf5ff;
  --testimonial-muted: #cbb9de;
  --testimonial-border: #634781;
  --testimonial-panel: #251637;
  --testimonial-chip: #3c2853;
  --testimonial-gold: #f7cd82;
  --testimonial-empty-star: #6b5582;
}

.testimonial-art {
  position: absolute;
  z-index: -1;
  inset: auto auto -106px -104px;
  width: min(40%, 420px);
  color: #dab8ff;
  opacity: .35;
  pointer-events: none;
}

.testimonial-heading h2 {
  margin: 0 0 6px;
  font: 800 clamp(20px, 2.4vw, 26px)/1.2 Manrope, sans-serif;
  letter-spacing: -.03em;
}

.testimonial-heading p { margin: 0; color: #f0e2ff; font-size: 13px; }

.testimonial-content {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.testimonial-track {
  overflow: hidden;
  border: 1px solid var(--testimonial-border);
  border-radius: 16px;
  background: var(--testimonial-panel);
  color: var(--testimonial-ink);
}

.testimonial-slide {
  display: flex;
  flex-direction: column;
  min-height: 146px;
  padding: clamp(14px, 2vw, 22px);
}

.testimonial-slide[hidden], .testimonial-controls[hidden] { display: none; }

.testimonial-rating, .testimonial-stars, .testimonial-credit, .testimonial-controls,
.testimonial-position, .testimonial-steps {
  display: flex;
  align-items: center;
}

.testimonial-rating { gap: 12px; }
.testimonial-stars { gap: 4px; }

.testimonial-star {
  width: 16px;
  aspect-ratio: 1;
  background: linear-gradient(to right, var(--testimonial-gold) var(--star-fill), var(--testimonial-empty-star) var(--star-fill));
  clip-path: polygon(50% 0, 65% 33%, 100% 38%, 75% 63%, 80% 98%, 50% 82%, 20% 98%, 25% 63%, 0 38%, 35% 33%);
}

.testimonial-score {
  font: 800 23px/1.2 Manrope, sans-serif;
  font-variant-numeric: tabular-nums;
  letter-spacing: -.03em;
  white-space: nowrap;
}

.testimonial-score > span {
  color: var(--testimonial-muted);
  font-size: 12px;
  letter-spacing: 0;
}

.testimonial-message {
  margin: 10px 0 14px;
  font-size: 15px;
  line-height: 1.5;
  overflow-wrap: anywhere;
  white-space: pre-line;
}

.testimonial-credit {
  flex-wrap: wrap;
  gap: 8px;
  margin-block-start: auto;
  padding-block-start: 10px;
  border-top: 1px solid var(--testimonial-border);
  font-size: 12px;
}

.testimonial-avatar {
  display: grid;
  flex: none;
  width: 26px;
  height: 26px;
  place-items: center;
  border-radius: 50%;
  background: var(--testimonial-chip);
  color: var(--testimonial-muted);
}

.testimonial-source {
  margin-inline-start: auto;
  color: var(--testimonial-muted);
  font-size: 11px;
}

.testimonial-controls {
  order: 1;
  gap: 6px;
  margin-block-start: 8px;
}

.testimonial-position {
  order: -1;
  flex-wrap: wrap;
  gap: 4px 10px;
  margin-inline-end: auto;
  color: #f0e2ff;
  font-size: 11px;
  font-variant-numeric: tabular-nums;
}

.testimonial-position strong { color: #fff; }
.testimonial-steps { gap: 4px; }

.testimonial-step {
  width: 5px;
  height: 5px;
  border-radius: 999px;
  background: #f8ecff70;
}

.testimonial-step.is-current { width: 19px; background: #f7cd82; }

.testimonial-controls button {
  display: grid;
  flex: none;
  width: 44px;
  height: 44px;
  place-items: center;
  border: 1px solid #f1dbff56;
  border-radius: 12px;
  background: #f0dfff16;
  color: #fff;
  font-size: 17px;
  cursor: pointer;
}

.testimonial-controls button:hover { background: #f1deff38; }
.testimonial-controls button:focus-visible { outline: 2px solid #f7cd82; outline-offset: 2px; }

@media (max-width: 680px) {
  .testimonials { grid-template-columns: minmax(0, 1fr); padding: 17px 15px; border-radius: 20px; }
  .testimonial-art { inset: -34px -52px auto auto; width: 248px; opacity: .22; }
  .testimonial-step.is-current { width: 14px; }
}

@media (prefers-reduced-motion: no-preference) {
  .testimonial-step { transition: width .25s ease, background-color .25s ease; }
  .testimonials[data-direction] .testimonial-slide:not([hidden]) { animation: testimonial-enter .42s cubic-bezier(.2, .75, .25, 1); }
  .testimonials[data-direction="next"] { --testimonial-offset: 42px; }
  .testimonials[data-direction="previous"] { --testimonial-offset: -42px; }
}

@keyframes testimonial-enter {
  from { opacity: 0; transform: translateX(var(--testimonial-offset)); }
  to { opacity: 1; transform: translateX(0); }
}
