/*
 * Homepage "He Said, She Said": testimonial carousel + scrolling client logos.
 * The section keeps its original background (.testimonials) and heading.
 */
.tm {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: clamp(20px, 4vh, 44px);
  height: 100%;
  padding: clamp(90px, 13vh, 120px) 40px clamp(20px, 4vh, 40px);
}

/* ---------------------------------------------------------------- Testimonial */
.tm-quote {
  position: relative;
  width: 100%;
  max-width: 820px;
  margin: 0 auto;
  padding: clamp(26px, 4.5vh, 44px) clamp(26px, 4vw, 52px) clamp(22px, 3.5vh, 32px);
  border: 1px solid rgba(84, 39, 133, 0.12);
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.86);
  -webkit-backdrop-filter: blur(6px);
  backdrop-filter: blur(6px);
  box-shadow: 0 24px 48px -36px rgba(61, 28, 97, 0.45);
}

.tm-mark {
  position: absolute;
  top: clamp(-18px, -2vh, -10px);
  inset-inline-start: clamp(20px, 3vw, 44px);
  color: #fac400;
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(72px, 11vh, 110px);
  font-weight: 700;
  line-height: 1;
  pointer-events: none;
}

.tm-fig {
  margin: 0;
  animation: tm-in 0.45s ease both;
}

@keyframes tm-in {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

.tm-text {
  margin: 0;
  padding: 0;
  border: 0;
}

.tm-text p {
  margin: 0;
  color: #262236;
  font-size: clamp(15px, 2.15vh, 19px);
  font-weight: 600;
  line-height: 1.65;
  letter-spacing: 0.4px;
}

.tm-by {
  display: flex;
  flex-direction: column;
  gap: 2px;
  margin-top: clamp(14px, 2.4vh, 22px);
  padding-inline-start: 14px;
  border-inline-start: 3px solid #fac400;
}

.tm-name {
  color: #1e2333;
  font-size: clamp(16px, 2.2vh, 19px);
  font-weight: 700;
}

.tm-post {
  color: #6b6578;
  font-size: clamp(13px, 1.8vh, 15px);
  font-weight: 600;
}

.tm-controls {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: clamp(16px, 2.8vh, 26px);
}

.tm-btn {
  display: grid;
  width: 44px;
  height: 44px;
  place-items: center;
  border: 1px solid #ddd5ea;
  border-radius: 50%;
  background: #fff;
  color: #542785;
  font-size: 14px;
  cursor: pointer;
  transition: background-color 0.2s ease, border-color 0.2s ease, color 0.2s ease;
}

.tm-btn:hover {
  border-color: #542785;
  background: #542785;
  color: #fff;
}

.tm-btn:focus-visible,
.tm-pause:focus-visible {
  outline: 2px solid #542785;
  outline-offset: 3px;
}

.tm-count {
  margin-inline-start: 8px;
  color: #542785;
  font-size: 16px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  letter-spacing: 1px;
}

.tm-count span {
  color: #9a94a8;
  font-weight: 600;
}

.tm-progress {
  flex: 1;
  height: 3px;
  margin-inline-start: 8px;
  overflow: hidden;
  border-radius: 3px;
  background: #ebe6f2;
}

.tm-progress span {
  display: block;
  height: 100%;
  border-radius: 3px;
  background: #fac400;
  transition: width 0.35s ease;
}

/* ---------------------------------------------------------------- Client logos */
.tm-clients {
  width: 100%;
  max-width: 1120px;
  margin: 0 auto;
}

.tm-clients__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: clamp(8px, 1.6vh, 14px);
}

.tm-eyebrow {
  margin: 0;
  color: #6b6578;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 2px;
  text-transform: uppercase;
}

.tm-eyebrow::before {
  content: "";
  display: inline-block;
  width: 22px;
  height: 3px;
  margin-inline-end: 10px;
  vertical-align: middle;
  border-radius: 3px;
  background: #fac400;
}

.tm-pause {
  display: grid;
  width: 32px;
  height: 32px;
  place-items: center;
  border: 1px solid #ddd5ea;
  border-radius: 50%;
  background: #fff;
  color: #542785;
  font-size: 10px;
  cursor: pointer;
}

.tm-pause:hover {
  border-color: #542785;
}

.tm-marquee {
  /* The logo strip scrolls the same way in both languages (it carries no reading order) */
  direction: ltr;
  display: flex;
  overflow: hidden;
  border-top: 1px solid rgba(84, 39, 133, 0.1);
  border-bottom: 1px solid rgba(84, 39, 133, 0.1);
  background: rgba(255, 255, 255, 0.7);
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 6%, #000 94%, transparent);
  mask-image: linear-gradient(90deg, transparent, #000 6%, #000 94%, transparent);
}

.tm-track {
  display: flex;
  flex-shrink: 0;
  align-items: center;
  gap: clamp(28px, 3vw, 48px);
  margin: 0;
  padding: clamp(14px, 2.4vh, 22px) clamp(14px, 1.5vw, 24px);
  list-style: none;
  animation: tm-scroll 160s linear infinite;
}

.tm-marquee:hover .tm-track,
.tm-marquee:focus-within .tm-track,
.tm-marquee.is-paused .tm-track {
  animation-play-state: paused;
}

/* Exactly one track width: the second copy then sits where the first began, so the loop has
   no jump (each track carries its own padding, which doubles as the gap at the seam). */
@keyframes tm-scroll {
  to {
    transform: translateX(-100%);
  }
}

.tm-marquee {
  --s: 1; /* logo scale; sizes come from ClientMarquee (--w/--h) */
}

.tm-logo {
  display: flex;
  flex-shrink: 0;
  align-items: center;
  justify-content: center;
  height: calc(56px * var(--s));
}

.tm-logo img {
  display: block;
  width: calc(var(--w, 120px) * var(--s));
  height: calc(var(--h, 40px) * var(--s));
  max-width: none;
  object-fit: contain;
  filter: grayscale(1);
  opacity: 0.7;
  /* drops the white rectangle behind logos supplied on white */
  mix-blend-mode: multiply;
  transition: filter 0.3s ease, opacity 0.3s ease;
}

.tm-logo img:hover {
  filter: none;
  opacity: 1;
}

/* ---------------------------------------------------------------- Short desktop screens */
@media (min-width: 993px) and (max-height: 700px) {
  .tm {
    padding-top: 84px;
  }

  .tm-marquee {
    --s: 0.82;
  }

  .tm-text p {
    font-size: 14px;
    line-height: 1.55;
  }
}

/* ---------------------------------------------------------------- Tablet / mobile */
@media (max-width: 992px) {
  .tm {
    height: auto;
    padding: 0 20px 10px;
  }

  .tm-quote {
    padding: 30px 22px 22px;
  }

  .tm-text p {
    font-size: 16px;
  }
}

@media (max-width: 576px) {
  .tm {
    padding: 0 16px 6px;
  }

  .tm-text p {
    font-size: 15px;
    line-height: 1.6;
  }

  .tm-marquee {
    --s: 0.7;
  }
}

@media (prefers-reduced-motion: reduce) {
  .tm-fig {
    animation: none;
  }

  .tm-track {
    animation: none;
  }

  .tm-track[aria-hidden="true"],
  .tm-pause {
    display: none;
  }

  .tm-marquee {
    overflow-x: auto;
    -webkit-mask-image: none;
    mask-image: none;
  }

  .tm-btn,
  .tm-progress span,
  .tm-logo img {
    transition: none;
  }
}
