/* ==========================================================================
   Testimonials section — matched to Backup (glass + light gradients)
   File: assets/css/14-testimonials.css
   FORCE LIGHT (no prefers-color-scheme)
   ========================================================================== */

.section-testimonials{
  padding-block: clamp(56px, 6vw, 96px) !important;

  position: relative;
  overflow: hidden;
  isolation: isolate;

  /* локальные цвета как в Backup */
  --t-ink: rgba(3, 7, 18, 0.92);
  --t-muted: rgba(3, 7, 18, 0.72);
  --t-muted2: rgba(3, 7, 18, 0.62);

  --t-bg-top: #f8fbff;
  --t-bg-mid: #eef7ff;
  --t-bg-bot: #f8fbff;

  --t-card-bg: rgba(255,255,255,0.74);

  /* ✅ было белое (0.70) — на светлой теме выглядит странно/«пластик».
     делаем как в backup/faq */
  --t-card-border: rgba(3,7,18,0.08);

  --t-divider: rgba(3, 7, 18, 0.08);

  --t-shadow:
    0 18px 50px rgba(3,7,18,0.12),
    0  2px 10px rgba(3,7,18,0.07);

  background-color: var(--t-bg-top);
  background-image:
    radial-gradient(circle 520px at 18% 18%, rgba(94, 234, 212, 0.16) 0%, rgba(94, 234, 212, 0.00) 72%),
    radial-gradient(circle 680px at 82% 36%, rgba(59, 130, 246, 0.18) 0%, rgba(59, 130, 246, 0.00) 74%),
    radial-gradient(circle 760px at 62% 110%, rgba(59, 130, 246, 0.12) 0%, rgba(59, 130, 246, 0.00) 72%),
    linear-gradient(180deg, var(--t-bg-top) 0%, var(--t-bg-mid) 55%, var(--t-bg-bot) 100%);

  background-repeat: no-repeat;
  background-size: cover;
  background-position: 0 0;
}

/* лёгкая вуаль/виньетка */
.section-testimonials::before{
  content:"";
  position:absolute;
  inset:0;
  z-index:0;
  pointer-events:none;
  background:
    radial-gradient(1100px 520px at 50% 10%, rgba(248, 252, 255, 0.86) 0%, rgba(248, 252, 255, 0.00) 72%),
    radial-gradient(1200px 560px at 50% 110%, rgba(248, 252, 255, 0.70) 0%, rgba(248, 252, 255, 0.00) 70%);
}

.section-testimonials .container{
  position: relative;
  z-index: 1;
}

.testimonials__head{
  text-align: center;
  max-width: 860px;
  margin: 0 auto;
}

.testimonials__title{
  margin: 0;
  font-family: var(--font-display);
  font-weight: 900;
  letter-spacing: -0.03em;
  line-height: 1.02;
  font-size: clamp(46px, 5.2vw, 74px);

  background: linear-gradient(
    90deg,
    var(--primary) 0%,
    rgba(94,234,212,0.98) 18%,
    rgba(59,130,246,0.92) 78%,
    var(--primary2) 100%
  );
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;

  filter: drop-shadow(0 10px 26px rgba(0,0,0,0.10));
}

.testimonials__sub{
  margin: 0 auto;
  max-width: 52ch;

  font-size: clamp(15px, 1.3vw, 18px);
  line-height: 1.4;
  font-weight: 650;
  letter-spacing: -0.012em;

  color: rgba(3, 7, 18, 0.76);
}

@supports (-webkit-background-clip: text){
  .testimonials__sub{
    background: linear-gradient(90deg, rgba(3,7,18,0.78), rgba(3,7,18,0.60));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
  }
}

/* =========================
   Carousel
========================= */

.tcarousel{
  --edge: clamp(14px, 4.4vw, 64px);
  position: relative;
  margin-top: clamp(26px, 3.4vw, 42px);
}

/* важно: чтобы стрелки всегда были кликабельны */
.tcarousel{ position: relative; }
.tcarousel__viewport{ position: relative; z-index: 1; }
.tcarousel__nav{ z-index: 5; pointer-events: auto; }

.tcarousel__viewport{
  overflow: hidden;
  padding-inline: var(--edge);
  padding-block: 10px 18px;
  outline: none;
  border-radius: var(--radius2);
  cursor: grab;
}

.tcarousel.is-dragging .tcarousel__viewport{ cursor: grabbing; }

.tcarousel__track{
  display: flex;
  gap: clamp(14px, 2.2vw, 22px);
  align-items: stretch;
  will-change: transform;
  transition: transform 620ms cubic-bezier(0.22, 1, 0.36, 1);
}

/* =========================
   Card
========================= */

.tcard{
  width: clamp(290px, 30vw, 420px);
  flex: 0 0 auto;
  opacity: 0.92;
  transform: translateY(0);
  transition:
    transform 520ms cubic-bezier(0.22, 1, 0.36, 1),
    opacity 520ms cubic-bezier(0.22, 1, 0.36, 1),
    filter 520ms cubic-bezier(0.22, 1, 0.36, 1);
}

.tcard.is-near{
  opacity: 0.97;
  transform: translateY(-3px);
}

.tcard.is-active{
  opacity: 1;
  transform: translateY(-8px);
  filter: drop-shadow(0 18px 36px rgba(3,7,18,0.10));
}

.tcard__inner{
  height: 100%;
  margin: 0;
  border-radius: var(--radius2);
  overflow: hidden;

  border: 1px solid var(--t-card-border);
  background: var(--t-card-bg);
  box-shadow: var(--t-shadow);

  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);

  display: grid;
  grid-template-rows: auto 1fr auto;
}

@supports not ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))){
  .tcard__inner{ background: rgba(255,255,255,0.88); }
}

.tcard__media{
  aspect-ratio: 3 / 2;
  background: linear-gradient(180deg, rgba(3,7,18,0.03), rgba(3,7,18,0.015));
  border-bottom: 1px solid var(--t-divider);
}

.tcard__media img{
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
  object-position: center;
}

.tcard__quote{
  margin: 0;
  padding: clamp(18px, 2.2vw, 26px);
  font-size: clamp(18px, 2.0vw, 24px);
  line-height: 1.45;
  color: var(--t-ink);
  font-weight: 650;
}

.tcard__who{
  margin: 0;
  padding: 0 clamp(18px, 2.2vw, 26px) clamp(18px, 2.2vw, 22px);
  color: rgba(3,7,18,0.55);
  font-size: 14px;
  font-weight: 500;
}

/* =========================
   Nav buttons
========================= */

.tcarousel__nav{
  position: absolute;
  top: 56%;
  transform: translateY(-50%);
  width: 46px;
  height: 46px;
  border-radius: 999px;

  border: 1px solid rgba(3,7,18,0.12);
  background: rgba(255,255,255,0.92);

  display: grid;
  place-items: center;
  color: rgba(3,7,18,0.80);
  box-shadow: 0 14px 36px rgba(3,7,18,0.12);

  cursor: pointer;
  transition: transform 180ms ease, background 180ms ease, border-color 180ms ease, box-shadow 180ms ease;
  user-select: none;
}

.tcarousel__nav svg{ width: 22px; height: 22px; }

.tcarousel__nav--prev{ left: 10px; }
.tcarousel__nav--next{ right: 10px; }

.tcarousel__nav:hover{
  background: rgba(255,255,255,0.98);
  border-color: rgba(3,7,18,0.18);
  transform: translateY(-50%) scale(1.04);
  box-shadow: 0 18px 46px rgba(3,7,18,0.14);
}

.tcarousel__nav:focus-visible{
  outline: 2px solid rgba(94,234,212,0.6);
  outline-offset: 3px;
}

/* =========================
   Dots
========================= */

.tcarousel__dots{
  margin-top: 18px;
  display: flex;
  justify-content: center;
  gap: 10px;
}

.tcarousel__dot{
  width: 9px;
  height: 9px;
  border-radius: 999px;
  border: 0;
  background: rgba(3,7,18,0.18);
  cursor: pointer;
  transition: transform 200ms ease, background 200ms ease, width 200ms ease;
}

.tcarousel__dot.is-active{
  width: 28px;
  background: linear-gradient(90deg, var(--primary2), var(--primary));
  transform: scale(1.02);
}

.tcarousel__dot:focus-visible{
  outline: 2px solid rgba(94,234,212,0.6);
  outline-offset: 3px;
}

/* =========================
   Reveal (как в Backup: .js + data-anim)
========================= */

.js .section-testimonials .testimonials__head,
.js .section-testimonials .tcarousel,
.js .section-testimonials .tcarousel__dots{
  opacity: 0;
  transform: translateY(14px);
  transition: opacity 650ms ease, transform 850ms cubic-bezier(.2,.9,.2,1);
}

.section-testimonials[data-anim="on"] .testimonials__head{
  opacity: 1;
  transform: none;
}

.section-testimonials[data-anim="on"] .tcarousel{
  opacity: 1;
  transform: none;
  transition-delay: 80ms;
}

.section-testimonials[data-anim="on"] .tcarousel__dots{
  opacity: 1;
  transform: none;
  transition-delay: 140ms;
}

@media (prefers-reduced-motion: reduce){
  .section-testimonials::before,
  .tcarousel__track,
  .tcard,
  .js .section-testimonials .testimonials__head,
  .js .section-testimonials .tcarousel,
  .js .section-testimonials .tcarousel__dots{
    transition: none !important;
    transform: none !important;
    opacity: 1 !important;
  }
}
