/* ==========================================================================
   09 Testimonials — rating head, featured quote + metric, two-way review marquee
   ========================================================================== */
#testimonials { overflow: clip; }
#testimonials .tm-body { padding-bottom: clamp(48px, 5vw, 80px); }

/* glow behind the head (Qore planet light) */
#testimonials::before {
  content: ""; position: absolute; left: 50%; top: 44px; width: min(1100px, 120vw); height: 520px; transform: translateX(-50%);
  pointer-events: none;
  background: radial-gradient(ellipse 50% 60% at 50% 0%, rgba(255,255,255,.05), transparent 70%);
}

/* rating summary */
#testimonials .tm-rating {
  display: inline-flex; align-items: center; gap: 14px; height: 40px; padding: 0 16px 0 14px; border-radius: var(--r-pill);
  background: rgba(255,255,255,.025); box-shadow: inset 0 0 0 1px var(--line-2);
}
#testimonials .tm-stars { display: inline-flex; gap: 2px; color: var(--text); }
#testimonials .tm-stars svg { width: 14px; height: 14px; fill: currentColor; }
#testimonials .tm-rating-t { display: inline-flex; align-items: baseline; gap: 10px; }
#testimonials .tm-rating-t b { font-weight: 500; font-size: 15px; letter-spacing: -0.02em; color: var(--text); }

/* ---------- featured quote ---------- */
#testimonials .tm-feature {
  position: relative; margin: clamp(48px, 5.5vw, 80px) 0 0; display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 380px);
  gap: 1px; background: var(--line); border: 1px solid var(--line);
}
#testimonials .tm-feature > div { background: var(--bg); position: relative; min-width: 0; }
#testimonials .tm-feature-quote {
  padding: clamp(32px, 4vw, 64px); display: flex; flex-direction: column; gap: clamp(24px, 3vw, 40px);
  overflow: hidden;
}
#testimonials .tm-feature-quote::before {
  content: ""; position: absolute; left: -10%; bottom: -60%; width: 70%; height: 120%; pointer-events: none;
  background: radial-gradient(closest-side, rgba(255,255,255,.035), transparent); /* fades to 0 inside its box: no hard edge */
}
#testimonials .tm-qmark { width: 30px; height: 23px; color: var(--text-4); }
#testimonials .tm-quote p {
  font-size: clamp(24px, 2.6vw, 38px); font-weight: 450; line-height: 1.22; letter-spacing: -0.045em; color: var(--text);
  max-width: 28ch; text-wrap: balance; position: relative;
}
/* v4 two-tone emphasis: same Geist face in the secondary gray */
#testimonials .tm-quote em { font-style: normal; color: var(--text-2); }
#testimonials .tm-author { display: flex; align-items: center; gap: 14px; margin-top: auto; position: relative; }
#testimonials .tm-author-t { display: grid; gap: 1px; }
#testimonials .tm-author-t b { font-weight: 500; color: var(--text); }
#testimonials .tm-author-logo {
  margin-left: auto; display: inline-flex; align-items: center; gap: 8px; color: var(--text-3);
  padding-left: 18px; border-left: 1px solid var(--line-2); height: 28px;
}
#testimonials .tm-author-logo svg { width: 14px; height: 14px; }

#testimonials .tm-feature-metric {
  padding: clamp(28px, 3vw, 44px); display: flex; flex-direction: column; gap: 14px;
  background: linear-gradient(180deg, var(--bg-2), var(--bg)) !important;
}
#testimonials .tm-metric {
  font-size: clamp(64px, 7vw, 104px); font-weight: 400; letter-spacing: -0.07em; line-height: .95;
  background: linear-gradient(180deg, #fff 30%, rgba(237,237,237,.45));
  -webkit-background-clip: text; background-clip: text; color: transparent;
  padding-bottom: 4px;
}
#testimonials .tm-bars { display: grid; gap: 10px; margin-top: 6px; }
#testimonials .tm-bar { display: grid; grid-template-columns: 52px minmax(0, 1fr) 64px; align-items: center; gap: 10px; }
#testimonials .tm-bar i {
  display: block; height: 6px; border-radius: var(--r-xs); transform-origin: left center; transform: scaleX(var(--w));
  background: rgba(255,255,255,.14);
}
#testimonials .tm-bar.is-after i { background: #ededed; }
#testimonials .tm-bar .num { text-align: right; color: var(--text-2); }
#testimonials .tm-bar.is-after .num { color: var(--text); }
/* 12-week trend sparkline (fills the metric column between the bars and the facts) */
#testimonials .tm-spark { display: grid; gap: 10px; margin-top: 18px; }
#testimonials .tm-spark-h { display: flex; justify-content: space-between; gap: 12px; }
#testimonials .tm-spark-plot { position: relative; height: 56px; }
#testimonials .tm-spark-plot svg { display: block; width: 100%; height: 100%; overflow: visible; }
#testimonials .tm-spark-grid { fill: none; stroke: var(--line); stroke-dasharray: 2 4; vector-effect: non-scaling-stroke; }
#testimonials .tm-spark-area { fill: url(#tmSparkFill); }
#testimonials .tm-spark-line {
  fill: none; stroke: #ededed; stroke-width: 1.5; stroke-linejoin: round; stroke-linecap: round;
  vector-effect: non-scaling-stroke;
}
/* the one red signal in this component: the latest data point */
#testimonials .tm-spark-dot {
  position: absolute; left: 100%; top: 82.7%; width: 7px; height: 7px; margin: -3.5px 0 0 -3.5px; border-radius: 50%;
  background: var(--accent); box-shadow: 0 0 0 3px var(--bg), 0 0 0 4px var(--accent-soft);
}
#testimonials .tm-facts { display: grid; grid-template-columns: 1fr 1fr; gap: 1px; margin-top: auto; padding-top: 18px; border-top: 1px solid var(--line); }
#testimonials .tm-facts li { display: grid; gap: 2px; }
#testimonials .tm-facts li + li { padding-left: 16px; border-left: 1px solid var(--line); }
#testimonials .tm-facts b { font-size: 22px; font-weight: 450; letter-spacing: -0.04em; color: var(--text); }

/* avatars: neutral initials chips, no photos */
#testimonials .tm-av {
  width: 36px; height: 36px; border-radius: 50%; flex: none; display: grid; place-items: center;
  font-size: 12px; font-weight: 500; letter-spacing: -0.01em; color: var(--text);
  background: linear-gradient(180deg, #232326, var(--bg-3));
  box-shadow: inset 0 0 0 1px var(--line-2), inset 0 1px 0 rgba(255,255,255,.06);
}
#testimonials .tm-av--lg { width: 46px; height: 46px; font-size: 14px; color: #0a0a0a; background: #ededed; box-shadow: 0 0 0 3px var(--bg), 0 0 0 4px var(--line-2); }

/* ---------- marquee rows ---------- */
#testimonials .tm-rows { display: grid; grid-template-columns: minmax(0, 1fr); gap: 16px; padding-bottom: var(--sec-y); position: relative; }
#testimonials .tm-marquee {
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 14%, #000 86%, transparent);
          mask-image: linear-gradient(90deg, transparent, #000 14%, #000 86%, transparent);
}
#testimonials .tm-marquee .marquee-track { gap: 16px; padding-right: 16px; }
#testimonials .tm-card {
  width: 360px; flex: none; display: flex; flex-direction: column; gap: 16px; padding: 22px 22px 18px;
  border-radius: var(--r); background: var(--bg-2);
  box-shadow: inset 0 0 0 1px var(--line);
  transition: box-shadow .3s, background .3s, transform .5s var(--ease-out);
}
#testimonials .tm-card:hover { background: #0f0f11; box-shadow: inset 0 0 0 1px var(--line-3), 0 20px 50px -24px rgba(0,0,0,.9); transform: translateY(-3px); }
#testimonials .tm-card-h { display: flex; align-items: center; gap: 12px; }
#testimonials .tm-card-who { display: grid; gap: 0; min-width: 0; }
#testimonials .tm-card-who b { font-weight: 500; color: var(--text); font-size: 14.5px; letter-spacing: -0.015em; }
#testimonials .tm-card-who .mono { font-size: 11.5px; }
#testimonials .tm-card-stars { margin-left: auto; font-size: 11px; letter-spacing: 1px; color: var(--text-2); }
#testimonials .tm-card p { font-size: 14.5px; line-height: 1.55; color: var(--text-2); flex: 1; }
#testimonials .tm-card-f { display: flex; justify-content: space-between; gap: 12px; padding-top: 14px; border-top: 1px solid var(--line); }
#testimonials .tm-card-f .mono { font-size: 10px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
#testimonials .tm-card-f .mono:last-child { flex: none; }

/* ---------- responsive ---------- */
@media (max-width: 991px) {
  /* tablet keeps quote | metric side by side so neither column strands empty space */
  #testimonials .tm-feature { grid-template-columns: minmax(0, 3fr) minmax(0, 2fr); }
  #testimonials .tm-quote p { max-width: none; font-size: clamp(22px, 2.7vw, 28px); }
  #testimonials .tm-metric { font-size: clamp(56px, 7.4vw, 72px); }
}
@media (max-width: 767px) {
  #testimonials .tm-feature { grid-template-columns: minmax(0, 1fr); }
  #testimonials .tm-rating { height: auto; padding: 10px 14px; flex-direction: column; gap: 8px; border-radius: var(--r); }
  #testimonials .tm-rating-t { flex-direction: column; align-items: center; gap: 2px; }
  #testimonials .tm-feature-quote { padding: 28px 22px; }
  #testimonials .tm-feature-metric { padding: 26px 22px; }
  #testimonials .tm-author-logo { display: none; }
  #testimonials .tm-card { width: 290px; padding: 18px 18px 16px; }
  #testimonials .tm-card p { font-size: 14px; }
  /* attribution stacks and wraps instead of truncating */
  #testimonials .tm-card-f { flex-direction: column; gap: 4px; }
  #testimonials .tm-card-f .mono { font-size: 11px; white-space: normal; overflow: visible; }
  #testimonials .tm-card-f .mono:first-child { color: var(--text-2); }
  #testimonials .tm-marquee {
    -webkit-mask-image: linear-gradient(90deg, transparent, #000 6%, #000 94%, transparent);
            mask-image: linear-gradient(90deg, transparent, #000 6%, #000 94%, transparent);
  }
}
@media (prefers-reduced-motion: reduce) {
  /* no loop (base.css freezes it, JS skips the clones): lay the reviews out as a grid inside the shell */
  #testimonials .tm-marquee { width: var(--shell); margin-inline: auto; -webkit-mask-image: none; mask-image: none; }
  #testimonials .tm-marquee .marquee-track { width: auto; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); padding-right: 0; }
  #testimonials .tm-card { width: auto; }
}
@media (prefers-reduced-motion: reduce) and (max-width: 991px) {
  #testimonials .tm-marquee .marquee-track { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (prefers-reduced-motion: reduce) and (max-width: 767px) {
  /* phones: a swipeable snap row with a visible scrollbar */
  #testimonials .tm-marquee { width: auto; margin-inline: 0; overflow-x: auto; scroll-snap-type: x mandatory; scroll-padding-inline: 16px; padding-bottom: 10px; scrollbar-width: thin; scrollbar-color: var(--line-3) transparent; }
  #testimonials .tm-marquee .marquee-track { display: flex; width: max-content; padding-inline: 16px; }
  #testimonials .tm-card { width: 290px; scroll-snap-align: start; }
}
