/* =========================================================
   Testimonials — "Loops broken live, in the room."
   ========================================================= */
.testi {
  position: relative;
  overflow: hidden;
  isolation: isolate;
  background:
    radial-gradient(45% 55% at 50% 55%, rgba(110, 30, 210, .26), transparent 70%),
    radial-gradient(25% 40% at 8% 80%, rgba(90, 20, 170, .2), transparent 70%),
    radial-gradient(25% 40% at 92% 20%, rgba(90, 20, 170, .2), transparent 70%),
    #050307;
}
.testi::before, .testi::after {          /* seamless joins */
  content: "";
  position: absolute;
  left: 0; right: 0;
  height: 120px;
  z-index: 0;
  pointer-events: none;
}
.testi::before { top: 0; background: linear-gradient(to bottom, #050307, rgba(5, 3, 7, 0)); }
.testi::after { bottom: 0; background: linear-gradient(to top, #050307, rgba(5, 3, 7, 0)); }

.testi__inner {
  position: relative;
  z-index: 1;
  max-width: 1280px;
  margin: 0 auto;
  padding: clamp(8px, 1vw, 16px) clamp(16px, 3vw, 40px) clamp(20px, 2.5vw, 36px);
  text-align: center;
}
.testi__title {
  margin: 0;
  font-family: "Crimson Text", Georgia, serif;
  font-weight: 400;
  font-size: clamp(28px, 3vw, 42px);
  color: #f7f3fb;
  opacity: 0;
  transform: translateY(18px);
  transition: opacity 1s var(--ease, ease), transform 1s var(--ease, ease);
}
.testi.is-in .testi__title { opacity: 1; transform: none; }

/* ---------- carousel ---------- */
.testi__carousel {
  position: relative;
  display: flex;
  align-items: center;
  gap: clamp(8px, 1.5vw, 20px);
  margin-top: clamp(28px, 3vw, 44px);
}
.testi__viewport {
  position: relative;
  flex: 1;
  height: 250px;
  perspective: 1200px;
  touch-action: pan-y;
  cursor: grab;
  outline: none;
  opacity: 0;
  transition: opacity 1s .3s;
}
.testi.is-in .testi__viewport { opacity: 1; }
.testi__viewport.is-dragging { cursor: grabbing; }

.tcard {
  --x: 0%;
  --s: 1;
  --o: 1;
  position: absolute;
  top: 50%; left: 50%;
  width: calc((100% - 2 * 22px) / 3);
  margin: 0;
  padding: 26px 26px 22px;
  border-radius: 16px;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  background: linear-gradient(160deg, rgba(150, 80, 255, .18), rgba(255, 255, 255, .03) 60%);
  border: 1px solid rgba(200, 160, 255, .22);
  box-shadow: 0 20px 50px -26px rgba(120, 50, 230, .9), inset 0 0 30px rgba(150, 80, 255, .08);
  backdrop-filter: blur(8px);
  transform: translate(-50%, -50%) translateX(var(--x)) scale(var(--s)) rotateY(var(--ry, 0deg)) rotateX(var(--rx, 0deg));
  opacity: var(--o);
  transition: transform .8s var(--ease, cubic-bezier(.22,1,.36,1)), opacity .6s, border-color .5s, box-shadow .5s, filter .6s;
  will-change: transform;
}
.tcard.no-anim { transition: none; }
.tcard.is-center {
  border-color: rgba(220, 180, 255, .55);
  box-shadow: 0 26px 60px -24px rgba(150, 80, 255, 1), 0 0 0 1px rgba(247, 196, 124, .15), inset 0 0 36px rgba(150, 80, 255, .16);
  z-index: 3;
}
.tcard.is-side { filter: saturate(.85) brightness(.85); z-index: 2; }
.tcard.is-off { pointer-events: none; z-index: 1; }

.tcard__mark {
  font-family: "Crimson Text", Georgia, serif;
  font-size: 46px;
  line-height: .6;
  height: 22px;
  color: #c58cff;
  text-shadow: 0 0 16px rgba(190, 120, 255, .9);
  transition: color .5s, text-shadow .5s, transform .6s var(--ease, ease);
}
.tcard.is-center .tcard__mark { color: #e2c4ff; animation: tqGlow 3.2s ease-in-out infinite; }
.tcard__quote {
  margin: 14px 0 18px;
  font-size: 15.5px;
  line-height: 1.55;
  color: #ece6f3;
  min-height: 3.1em;
}
.tcard.is-center .tcard__quote { animation: tqIn .7s var(--ease, ease) both; }
.tcard__who { display: flex; align-items: center; gap: 12px; margin-top: auto; }
.tcard__avatar {
  display: grid;
  place-items: center;
  width: 40px; height: 40px;
  border-radius: 50%;
  font-family: "Crimson Text", Georgia, serif;
  font-size: 18px;
  color: #fff3dc;
  background: radial-gradient(circle at 35% 30%, #c58cff, #6a2fc4 60%, #2a0d5a);
  box-shadow: 0 0 0 2px rgba(247, 196, 124, .45), 0 0 16px rgba(150, 80, 255, .7);
  overflow: hidden;
}
.tcard__avatar img { width: 100%; height: 100%; object-fit: cover; }
.tcard__name { font-size: 15px; font-weight: 500; color: #f7f3fb; }

/* arrows */
.testi__arrow {
  flex: none;
  display: grid;
  place-items: center;
  width: 46px; height: 46px;
  border-radius: 50%;
  border: 1px solid rgba(200, 160, 255, .35);
  background: rgba(255, 255, 255, .05);
  color: #f1ecf7;
  cursor: pointer;
  z-index: 5;
  transition: background .3s, border-color .3s, box-shadow .3s, transform .4s var(--ease, ease);
}
.testi__arrow svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; transition: transform .4s var(--ease, ease); }
.testi__arrow:hover, .testi__arrow:focus-visible {
  outline: none;
  background: rgba(150, 80, 255, .25);
  border-color: rgba(220, 180, 255, .7);
  box-shadow: 0 0 22px rgba(150, 80, 255, .7);
  transform: scale(1.08);
}
.testi__arrow--prev:hover svg { transform: translateX(-3px); }
.testi__arrow--next:hover svg { transform: translateX(3px); }
.testi__arrow:active { transform: scale(.94); }

/* dots + autoplay progress */
.testi__dots { display: flex; justify-content: center; gap: 10px; margin-top: 26px; }
.testi__dot {
  position: relative;
  width: 8px; height: 8px;
  padding: 0;
  border: 0;
  border-radius: 999px;
  background: rgba(255, 255, 255, .25);
  cursor: pointer;
  overflow: hidden;
  transition: width .5s var(--ease, ease), background .3s;
}
.testi__dot:hover { background: rgba(255, 255, 255, .5); }
.testi__dot.is-active { width: 30px; background: rgba(150, 80, 255, .4); }
.testi__dot.is-active::after {         /* fills over the autoplay interval */
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: linear-gradient(90deg, #a873ff, #e2c4ff);
  transform-origin: left;
  animation: tqFill var(--dur, 5s) linear forwards;
}
.testi.is-paused .testi__dot.is-active::after { animation-play-state: paused; }
.testi__dot:focus-visible { outline: 2px solid rgba(220, 180, 255, .8); outline-offset: 3px; }

@keyframes tqGlow { 0%, 100% { text-shadow: 0 0 14px rgba(190, 120, 255, .8); } 50% { text-shadow: 0 0 26px rgba(220, 170, 255, 1); } }
@keyframes tqIn   { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
@keyframes tqFill { from { transform: scaleX(0); } to { transform: scaleX(1); } }

/* ---------- responsive ---------- */
@media (max-width: 900px) {
  .tcard { width: 58%; }
}
@media (max-width: 560px) {
  .testi__arrow { display: none; }          /* swipe, dots or tap a side card on phones */
  .testi__carousel { margin-left: -16px; margin-right: -16px; }
  .tcard { width: 84%; padding: 22px 18px 18px; }
  .testi__viewport { height: 240px; }
}

@media (prefers-reduced-motion: reduce) {
  .testi__title, .testi__viewport { opacity: 1 !important; transform: none !important; }
  .tcard { transition: none !important; }
}
