/* =====================================================================
   TESTIMONIALS v2 — spotlight card + avatar orbit + drifting 3D wall
   Loaded after site-sections.css. Behaviour: public/js/testimonials.js
   ===================================================================== */
.tst2 { overflow: hidden; padding-bottom: 1rem; }
.tst2__aurora {
    position: absolute;
    inset: 10% -20% auto;
    height: 70%;
    background:
        radial-gradient(40% 50% at 25% 50%, rgba(157, 134, 255, .22), transparent 70%),
        radial-gradient(35% 45% at 75% 40%, rgba(255, 181, 71, .12), transparent 70%);
    filter: blur(20px);
    animation: tstAurora 14s ease-in-out infinite alternate;
    pointer-events: none;
}
@keyframes tstAurora { to { transform: translateX(6%) scale(1.08); } }

/* headline numbers */
.tst2__stats {
    display: grid;
    grid-template-columns: repeat(3, auto);
    justify-content: center;
    margin: -1rem auto 2.6rem;
    width: fit-content;
    border-radius: 999px;
    background: rgba(255, 255, 255, .04);
    border: 1px solid var(--line-strong);
    backdrop-filter: blur(10px);
}
.tst2__stats > div { display: flex; flex-direction: column-reverse; align-items: center; padding: .7rem 1.6rem; border-inline-start: 1px solid var(--line); }
.tst2__stats > div:first-child { border-inline-start: 0; }
.tst2__stats dt { font-size: .78rem; color: var(--muted); }
.tst2__stats dd { display: flex; align-items: center; gap: .45rem; margin: 0; }
.tst2__stats dd b { font-family: var(--font-display); font-size: 1.45rem; font-weight: 800; }
.tst2__stars { display: inline-flex; gap: 1px; color: var(--volt); }
.tst2__stats .tst2__stars svg { width: 13px; height: 13px; }

.tst2__layout {
    position: relative;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: clamp(1.5rem, 4vw, 3.5rem);
    align-items: center;
}

/* ---------- spotlight stage ---------- */
.tst2__stage { position: relative; padding-top: 150px; }

/* avatar orbit — the active client rotates to the top */
.tst2__orbit {
    --R: 118px;
    position: absolute;
    top: 0;
    left: 50%;
    width: calc(var(--R) * 2);
    height: calc(var(--R) * 2);
    transform: translate(-50%, -38%);
    z-index: 2;
    pointer-events: none;
}
.tst2__orbit-ring { position: absolute; inset: 0; border-radius: 50%; border: 1px dashed rgba(185, 167, 255, .3); animation: spin 60s linear infinite; }
.tst2__orbit-spin {
    --rot: 0deg;
    position: absolute;
    inset: 0;
    transform: rotate(var(--rot));
    transition: transform 1.1s var(--ease-spring);
}
.tst2__planet {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 2.6rem;
    height: 2.6rem;
    margin: -1.3rem 0 0 -1.3rem;
    padding: 0;
    border: 0;
    border-radius: 50%;
    cursor: pointer;
    pointer-events: auto;
    background: none;
    /* placed on the ring, then counter-rotated so the letter stays upright */
    transform: rotate(var(--a)) translateY(calc(var(--R) * -1)) rotate(calc((var(--a) + var(--rot)) * -1));
    transition: transform 1.1s var(--ease-spring);
}
.tst2__planet span {
    display: grid;
    place-items: center;
    width: 100%;
    height: 100%;
    border-radius: 50%;
    font-family: var(--font-display);
    font-size: .82rem;
    font-weight: 800;
    font-variant-numeric: tabular-nums;
    color: #1a1033;
    background: var(--c);
    box-shadow: 0 0 0 3px var(--bg), 0 8px 20px -6px rgba(0, 0, 0, .8);
    opacity: .55;
    transform: scale(.78);
    transition: transform .6s var(--ease-spring), opacity .4s ease, box-shadow .4s ease;
}
.tst2__planet:hover span { opacity: .9; transform: scale(.9); }
.tst2__planet.is-active span { opacity: 1; transform: scale(1.22); box-shadow: 0 0 0 3px var(--bg), 0 0 0 6px var(--c), 0 0 30px var(--c); }
.tst2__core {
    position: absolute;
    top: 50%;
    left: 50%;
    display: grid;
    place-items: center;
    width: 5.2rem;
    height: 5.2rem;
    margin: -2.6rem 0 0 -2.6rem;
    border-radius: 50%;
    color: var(--accent-ink);
    background: var(--signal);
    box-shadow: 0 0 0 10px rgba(255, 181, 71, .08), 0 0 50px -6px rgba(255, 181, 71, .7);
    animation: corePulse 3.5s ease-in-out infinite;
}

/* the featured card */
.tst2__card {
    --c: var(--volt);
    --mx: 50%;
    --my: 0%;
    position: relative;
    z-index: 1;
    overflow: hidden;
    margin: 0;
    padding: clamp(4.2rem, 7vw, 5rem) clamp(1.4rem, 3vw, 2.4rem) 1.6rem;
    border-radius: 28px;
    background:
        radial-gradient(60% 70% at var(--mx) var(--my), color-mix(in srgb, var(--c) 18%, transparent), transparent 70%),
        linear-gradient(160deg, rgba(60, 42, 125, .55), rgba(20, 13, 44, .8));
    border: 1px solid color-mix(in srgb, var(--c) 35%, transparent);
    box-shadow: 0 40px 80px -40px color-mix(in srgb, var(--c) 60%, transparent), inset 0 1px 0 rgba(255, 255, 255, .08);
    transition: border-color .6s ease, box-shadow .6s ease;
    perspective: 900px;
    outline: none;
}
.tst2__card:focus-visible { box-shadow: 0 0 0 3px var(--c); }
.tst2__beam {
    position: absolute;
    top: 0;
    bottom: 0;
    left: -40%;
    width: 35%;
    background: linear-gradient(100deg, transparent, color-mix(in srgb, var(--c) 30%, transparent), transparent);
    transform: skewX(-16deg);
    opacity: 0;
    pointer-events: none;
}
.tst2__card.is-in .tst2__beam { animation: tstBeam 1.1s var(--ease-out); }
@keyframes tstBeam { 0% { left: -40%; opacity: 1; } 100% { left: 120%; opacity: 0; } }

.tst2__top { display: flex; align-items: center; justify-content: space-between; margin-bottom: 1.1rem; }
.tst2__count { font-size: .82rem; color: var(--muted); font-variant-numeric: tabular-nums; }
.tst2__count b { color: var(--ink); font-size: 1rem; }
.tst2__stars--fill svg { width: 18px; height: 18px; }
.tst2__stars--fill.is-fill svg { animation: tstStar .5s var(--ease-spring) both; }
.tst2__stars--fill.is-fill svg:nth-child(2) { animation-delay: .08s; }
.tst2__stars--fill.is-fill svg:nth-child(3) { animation-delay: .16s; }
.tst2__stars--fill.is-fill svg:nth-child(4) { animation-delay: .24s; }
.tst2__stars--fill.is-fill svg:nth-child(5) { animation-delay: .32s; }
@keyframes tstStar { from { transform: scale(0) rotate(-90deg); opacity: 0; } }

.tst2__card blockquote {
    min-height: 6.2em;
    margin: 0 0 1.5rem;
    font-family: var(--font-display);
    font-size: clamp(1.12rem, 1.9vw, 1.4rem);
    font-weight: 500;
    line-height: 1.75;
    color: var(--ink);
}
/* words arrive one by one, flipping up out of a blur */
.tst2__w { display: inline-block; }
.tst2__card.is-in .tst2__w { animation: tstWord .6s var(--ease-out) both; animation-delay: calc(var(--w) * 45ms + .1s); }
@keyframes tstWord { from { opacity: 0; transform: translateY(.6em) rotateX(-70deg); filter: blur(6px); } }

/* leaving: the text folds away in the travel direction */
.tst2__card blockquote,
.tst2__who { transition: opacity .38s ease, transform .4s var(--ease-out), filter .4s ease; }
.tst2__card.is-out blockquote,
.tst2__card.is-out .tst2__who { opacity: 0; filter: blur(8px); transform: translateX(-30px) rotateY(18deg); }
.tst2__card[data-dir="prev"].is-out blockquote,
.tst2__card[data-dir="prev"].is-out .tst2__who { transform: translateX(30px) rotateY(-18deg); }
.tst2__card.is-in .tst2__who { animation: tstWho .7s var(--ease-out) .25s both; }
@keyframes tstWho { from { opacity: 0; transform: translateY(12px); } }

.tst2__card figcaption { display: flex; align-items: center; gap: .85rem; padding-top: 1.1rem; border-top: 1px solid var(--line); }
.tst2__who { display: flex; align-items: center; gap: .85rem; min-width: 0; }
.tst2__card figcaption b { display: block; }
.tst2__card figcaption small { color: var(--muted); font-size: .85rem; }
.tst2__av {
    display: grid;
    place-items: center;
    flex: 0 0 auto;
    width: 2.8rem;
    height: 2.8rem;
    border-radius: 50%;
    font-weight: 800;
    color: #1a1033;
    background: var(--c);
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--c) 25%, transparent);
    transition: background .5s ease;
}
.tst2__controls { display: flex; align-items: center; gap: .4rem; margin-inline-start: auto; }
.tst2__controls button {
    position: relative;
    display: grid;
    place-items: center;
    width: 2.4rem;
    height: 2.4rem;
    padding: 0;
    border-radius: 50%;
    color: var(--ink);
    background: rgba(255, 255, 255, .06);
    border: 1px solid var(--line-strong);
    cursor: pointer;
    transition: background .25s ease, transform .3s var(--ease-spring);
}
.tst2__controls button:hover { background: rgba(255, 255, 255, .14); transform: scale(1.08); }
.tst2__controls .tst2__play { width: 2.8rem; height: 2.8rem; }
.tst2__ring { position: absolute; inset: -1px; width: calc(100% + 2px); height: calc(100% + 2px); transform: rotate(-90deg); }
.tst2__ring circle { fill: none; stroke: var(--c); stroke-width: 2.4; stroke-linecap: round; stroke-dasharray: 100; stroke-dashoffset: 100; }
.tst2__ring circle.is-run { animation: tstRing var(--tst-int, 7s) linear forwards; }
@keyframes tstRing { to { stroke-dashoffset: 0; } }
.tst2__play .i-play { display: none; }
.is-paused .tst2__play .i-play { display: block; }
.is-paused .tst2__play .i-pause { display: none; }
/* the clock stops while paused, hovered, or scrolled away */
.is-paused .tst2__ring circle,
.is-offscreen .tst2__ring circle,
.tst2__card:hover .tst2__ring circle { animation-play-state: paused; }

/* ---------- the drifting wall ---------- */
.tst2__wall { position: relative; }
.tst2__hint { margin: 0 0 .8rem; text-align: center; font-size: .82rem; color: var(--muted); }
.tst2__cols {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
    height: 560px;
    overflow: hidden;
    -webkit-mask-image: linear-gradient(180deg, transparent, #000 14%, #000 86%, transparent);
    mask-image: linear-gradient(180deg, transparent, #000 14%, #000 86%, transparent);
    /* flat on purpose: 3D transforms combined with a mask can stop the wall painting in some Chrome/GPU setups */
}
.tst2__col { overflow: hidden; padding: 4px; }
.tst2__track {
    display: grid;
    gap: 1rem;
    margin: 0;
    padding: 0;
    list-style: none;
    animation: tstUp var(--dur, 30s) linear infinite;
}
.tst2__col--down .tst2__track { animation-name: tstDown; }
.tst2__col:hover .tst2__track,
.is-offscreen .tst2__track { animation-play-state: paused; }
/* the list is rendered twice, so -50% (minus half a gap) lands on an identical frame */
@keyframes tstUp { from { transform: translateY(0); } to { transform: translateY(calc(-50% - .5rem)); } }
@keyframes tstDown { from { transform: translateY(calc(-50% - .5rem)); } to { transform: translateY(0); } }

.tst2__mini {
    --c: var(--volt);
    display: grid;
    gap: .7rem;
    width: 100%;
    padding: 1.1rem 1.1rem 1rem;
    border-radius: 18px;
    text-align: start;
    font: inherit;
    color: var(--ink-2);
    background: rgba(255, 255, 255, .035);
    border: 1px solid var(--line);
    cursor: pointer;
    transition: transform .4s var(--ease-spring), border-color .3s ease, background .3s ease, box-shadow .3s ease;
}
.tst2__mini:hover { transform: scale(1.03); background: rgba(255, 255, 255, .06); border-color: color-mix(in srgb, var(--c) 45%, transparent); }
.tst2__mini.is-active {
    border-color: var(--c);
    background: color-mix(in srgb, var(--c) 10%, rgba(20, 13, 44, .8));
    box-shadow: 0 0 0 1px var(--c), 0 14px 34px -14px var(--c);
}
.tst2__mini .tst2__stars svg { width: 12px; height: 12px; }
.tst2__mini-q { font-size: .88rem; line-height: 1.7; display: -webkit-box; -webkit-line-clamp: 4; -webkit-box-orient: vertical; overflow: hidden; }
.tst2__mini-who { display: flex; align-items: center; gap: .55rem; }
.tst2__mini-who .tst2__av { width: 2rem; height: 2rem; font-size: .85rem; box-shadow: none; }
.tst2__mini-who b { display: block; font-size: .85rem; color: var(--ink); }
.tst2__mini-who small { font-size: .74rem; color: var(--muted); }

@media (max-width: 1180px) {
    .tst2__layout { grid-template-columns: 1fr; max-width: 760px; margin-inline: auto; }
    .tst2__stage { margin-top: 6rem; }
    .tst2__cols { height: 440px; }
}
@media (max-width: 560px) {
    .tst2__stats { grid-template-columns: repeat(3, 1fr); width: 100%; border-radius: 20px; }
    .tst2__stats > div { padding: .7rem .4rem; }
    .tst2__stats dd b { font-size: 1.15rem; }
    .tst2__stats dd .tst2__stars { display: none; }
    .tst2__orbit { --R: 96px; }
    .tst2__stage { margin-top: 5.5rem; padding-top: 120px; }
    .tst2__cols { grid-template-columns: 1fr; height: 380px; }
    .tst2__col--down { display: none; }
    .tst2__card figcaption { flex-wrap: wrap; }
    .tst2__controls { width: 100%; justify-content: center; margin: .4rem 0 0; }
}
@media (prefers-reduced-motion: reduce) {
    .tst2__aurora, .tst2__orbit-ring, .tst2__core, .tst2__track { animation: none; }
    .tst2__cols, [dir="rtl"] .tst2__cols { height: auto; max-height: 560px; overflow-y: auto; transform: none; }
    .tst2__orbit-spin, .tst2__planet { transition: none; }
}
