/* ==================================================================
   06 — Testimonials ("Built for professionals like you.")
   Everything is scoped under #testimonials / .tm-*
   ================================================================== */
#testimonials {
  max-width: 100vw;
  padding: 219px 24px 230px;
  overflow-x: hidden;
}

#testimonials .tm-title { max-width: 400px; margin: 0 auto; }

/* ---------- carousel ---------- */
#testimonials .tm-carousel {
  max-width: 1204px;
  margin: 0 auto;
  padding: 101px 0 93px;
  -webkit-mask-image: linear-gradient(90deg, transparent 3%, #000 30%, #000 70%, transparent 97%);
          mask-image: linear-gradient(90deg, transparent 3%, #000 30%, #000 70%, transparent 97%);
}
#testimonials .tm-viewport {
  position: relative;
  outline: none;
  cursor: grab;
  touch-action: pan-y;
}
#testimonials .tm-viewport.is-dragging { cursor: grabbing; }
#testimonials .tm-track {
  display: flex;
  will-change: transform;
  transform: translate3d(0, 0, 0);
}
#testimonials .tm-track.is-animating {
  transition: transform 0.75s cubic-bezier(0.22, 0.8, 0.24, 1);
}

#testimonials .tm-card {
  flex: none;
  margin: 0 16px;
  display: grid;
  grid-template-areas: "avatar name" "avatar role";
  grid-template-columns: 48px auto;
  align-content: center;
  gap: 4px 24px;
  padding: 24px;
  border-radius: 16px;
  border: 1px solid transparent;
  border-bottom: 0;
  font-size: 16px;
  font-weight: 600;
  line-height: normal;
  letter-spacing: 0.3px;
  user-select: none;
  -webkit-user-select: none;
  cursor: pointer;
  transition: box-shadow 0.35s ease, background-color 0.35s ease, border-color 0.35s ease;
}
#testimonials .tm-card > * { white-space: nowrap; }
#testimonials .tm-card:hover {
  border-color: rgba(255, 255, 255, 0.06);
  box-shadow: inset 0 1px 1px rgba(255, 255, 255, 0.1);
}
#testimonials .tm-card.is-active {
  background: linear-gradient(137deg, #111214 4.87%, #0c0d0f 75.88%);
  border-color: rgba(255, 255, 255, 0.06);
  box-shadow:
    inset 0 1px 1px rgba(255, 255, 255, 0.1),
    0 2px 40px 10px rgba(154, 170, 255, 0.05),
    0 0 16px -7px rgba(154, 170, 255, 0.05);
}

#testimonials .tm-avatar {
  grid-area: avatar;
  align-self: center;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.1);
  display: grid;
  place-items: center;
  font-size: 15px;
  font-weight: 600;
  letter-spacing: 0.4px;
  color: rgba(255, 255, 255, 0.92);
  background: var(--tm-av, linear-gradient(135deg, #444, #222));
  position: relative;
  overflow: hidden;
  filter: grayscale(1);
  opacity: 0.5;
  transition: filter 0.45s ease, opacity 0.45s ease;
}
#testimonials .tm-avatar::after {
  /* soft top highlight, gives the flat gradient some volume */
  content: "";
  position: absolute;
  inset: 0;
  border-radius: 50%;
  background: radial-gradient(80% 60% at 30% 15%, rgba(255, 255, 255, 0.35), transparent 60%);
  mix-blend-mode: soft-light;
}
#testimonials .tm-card.is-active .tm-avatar { filter: grayscale(0); opacity: 1; }

#testimonials .tm-name {
  grid-area: name;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: #fff;
}
#testimonials .tm-handle { color: var(--grey-400); }
#testimonials .tm-role {
  grid-area: role;
  display: flex;
  align-items: center;
  color: var(--grey-300);
}

/* ---------- testimonial panel ---------- */
#testimonials .tm-panel {
  width: 1064px;
  max-width: 100%;
  margin: 0 auto;
  padding: 96px 0 0;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  position: relative;
  background: radial-gradient(49.41% 64.58% at 49.4% 0, rgba(255, 255, 255, 0.03) 0%, rgba(255, 255, 255, 0) 100%);
}
#testimonials .tm-panel::before {
  /* gradient hairline across the top */
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  top: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent 0%, rgba(255, 255, 255, 0.19) 30%, rgba(255, 255, 255, 0.19) 70%, transparent 100%);
}

#testimonials .tm-highlight {
  display: grid;
  grid-template-columns: auto 1fr;
  align-items: center;
  gap: 16px 24px;
}
#testimonials .tm-label {
  font-family: var(--mono-geist);
  color: var(--grey-300);
  font-size: 14px;
  font-weight: 500;
  line-height: 160%;
  letter-spacing: 0.3px;
}
#testimonials .tm-badge {
  justify-self: flex-start;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: 26px;
  padding: 0 6px;
  border-radius: 6px;
  background: var(--grey-600);
  color: #fff;
  font-size: 14px;
  font-weight: 500;
  letter-spacing: 0.2px;
  white-space: nowrap;
}
#testimonials .tm-badge-icon {
  width: 16px;
  height: 16px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: none;
}
#testimonials .tm-badge-icon svg { width: 16px; height: 16px; }
#testimonials .tm-desc {
  grid-column: 2 / span 1;
  max-width: 320px;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
}
#testimonials .tm-desc:not(:last-child) { margin-bottom: 45px; }
#testimonials .tm-desc p {
  color: var(--grey-200);
  font-size: 14px;
  font-weight: 500;
  line-height: 24px;
  letter-spacing: 0.2px;
}

#testimonials .tm-divider { padding: 0 48px; }
#testimonials .tm-divider::after {
  content: "";
  display: block;
  width: 2px;
  height: 100%;
  background: var(--grey-600);
}

#testimonials .tm-quote {
  justify-self: center;
  width: 100%;
  max-width: 490px;
  display: flex;
  align-items: center;
  text-wrap: balance;
}
#testimonials .tm-quote > p {
  position: relative;
  z-index: 0;
  color: var(--grey-300);
  font-size: 20px;
  font-weight: 500;
  line-height: 160%;
}
#testimonials .tm-quote > p > span { color: #fff; }
#testimonials .tm-quote > p::before,
#testimonials .tm-quote > p::after {
  position: absolute;
  z-index: -1;
  font-family: var(--mono-geist);
  font-size: 56px;
  font-weight: 700;
  line-height: normal;
  color: var(--grey-500);
  opacity: 0.8;
}
#testimonials .tm-quote > p::before { content: "\201C"; top: -26px; left: -34px; }
#testimonials .tm-quote > p::after { content: "\201D"; bottom: -45px; left: 0; }

/* crossfade of the panel content when the person changes */
#testimonials .tm-swap {
  transition: opacity 0.28s ease, transform 0.28s ease, filter 0.28s ease;
}
#testimonials .tm-panel.is-out .tm-swap {
  opacity: 0;
  transform: translateY(4px);
  filter: blur(2px);
}

/* ---------- responsive ---------- */
@media (max-width: 1100px) {
  #testimonials .tm-panel { width: 100%; }
  #testimonials .tm-divider { padding: 0 32px; }
}
@media (max-width: 860px) {
  #testimonials { padding: 168px 20px; }
  #testimonials .tm-carousel { padding: 64px 0; }
  #testimonials .tm-panel {
    grid-template-columns: 1fr;
    padding-top: 48px;
    gap: 0;
  }
  #testimonials .tm-quote { grid-row: 1; justify-self: stretch; max-width: none; padding: 0 0 44px 34px; }
  #testimonials .tm-divider { grid-row: 2; padding: 32px 0; }
  #testimonials .tm-highlight { grid-row: 3; }
  #testimonials .tm-divider::after { width: 100%; height: 1px; }
  #testimonials .tm-quote > p { font-size: 18px; }
}
@media (max-width: 520px) {
  #testimonials .tm-card { margin: 0 8px; padding: 12px 16px 12px 12px; gap: 2px 16px; font-size: 14px; border-radius: 12px; }
  #testimonials .tm-card .tm-handle { display: none; }
  #testimonials .tm-carousel {
    -webkit-mask-image: linear-gradient(90deg, transparent 0%, #000 22%, #000 78%, transparent 100%);
            mask-image: linear-gradient(90deg, transparent 0%, #000 22%, #000 78%, transparent 100%);
  }
  #testimonials .tm-highlight { grid-template-columns: 1fr; gap: 10px; }
  #testimonials .tm-desc { grid-column: 1; }
  #testimonials .tm-desc:not(:last-child) { margin-bottom: 24px; }
}

@media (prefers-reduced-motion: reduce) {
  #testimonials .tm-track.is-animating { transition: none; }
  #testimonials .tm-swap { transition: none; }
}
