/* =====================================================================
   Directline — 04 / testimonials, V2 «scroll storytelling»
   (?testimonials=v2). One featured client story beside its video, four
   stations under it. On large screens with normal motion the stage pins
   (CSS sticky) for a short range and scrolling moves through the four
   stories (testimonials-v2.js sets .tm2--pin). Everywhere else it is a
   normal section: click / swipe / previous-next. V1 is untouched; only one
   of the two is ever in the document.
   ===================================================================== */
.tm2 {
  --tm2-top: 91px;                       /* sticky header height (desktop) */
  --tm2-range: 120svh;                   /* extra scroll while pinned: 4 stories */
  --tm2-ease: cubic-bezier(.2,.7,.2,1);
  position: relative; color: #fff;
  background:
    var(--brand-grad);
  padding: 80px 0 72px;
}
.tm2-stage { position: relative; }
.tm2-grid {
  display: grid; grid-template-columns: minmax(0, .82fr) minmax(0, 1.18fr);
  column-gap: clamp(36px, 4.5vw, 72px); align-items: start;
}
.tm2-col-story { display: grid; gap: 22px; align-content: start; }
.tm2-col-media { display: grid; gap: 22px; align-content: start; }

/* heading */
.tm2-head .eyebrow { color: #d4c4e5; }
.tm2-head h2 { font-size: 50px; line-height: 1.35; letter-spacing: -1px; margin: 14px 0 0; }
.tm2-head h2 > span { color: var(--lime); }
.tm2-intro { margin: 12px 0 0; max-width: 430px; font-size: 15px; line-height: 1.9; color: #bba9cc; }

/* the story */
.tm2-story { position: relative; min-height: 132px; padding-top: 6px; }
.tm2-story > * { transition: opacity .28s var(--tm2-ease), transform .28s var(--tm2-ease); }
.tm2-story.is-out > * { opacity: 0; transform: translateY(8px); }
.tm2-mark { display: block; height: 40px; font: 700 76px/1 Georgia, 'Times New Roman', serif; color: #6c4d8c; margin-bottom: -6px; }
.tm2-quote { margin: 0; font-size: 22px; font-weight: 500; line-height: 1.75; color: #fff; max-width: 470px; }
.tm2-title { margin: 0; font-size: 26px; font-weight: 600; line-height: 1.5; }
.tm2-sub { margin: 6px 0 0; font-size: 15px; line-height: 1.8; color: #c8b8d8; max-width: 440px; }
.tm2-pending { margin: 8px 0 0; font-size: 12px; color: #a893bb; }

.tm2-client {
  display: flex; align-items: center; gap: 14px;
  padding-top: 16px; border-top: 1px solid #ffffff1c; max-width: 470px;
  transition: opacity .28s var(--tm2-ease);
}
.tm2-story.is-out ~ .tm2-client { opacity: 0; }
.tm2-badge {
  flex: 0 0 auto; width: 46px; height: 46px; border-radius: 50%; display: grid; place-items: center;
  border: 1px solid #f3ef3066; color: var(--lime); font-size: 14px; font-weight: 600; letter-spacing: .5px;
}
.tm2-who { display: grid; gap: 2px; min-width: 0; }
.tm2-who b { font-size: 15px; font-weight: 600; }
.tm2-who span { font-size: 12px; color: #b9a6ca; }

.tm2-ctrl { display: flex; gap: 12px; }
.tm2-btn {
  width: 52px; height: 52px; border-radius: 50%; display: grid; place-items: center;
  border: 1px solid #ffffff40; color: #fff; background: transparent; font-size: 20px;
  transition: background .2s, color .2s, border-color .2s, transform .2s;
}
.tm2-btn:hover { border-color: var(--lime); }
.tm2-btn.is-next { background: var(--lime); border-color: var(--lime); color: var(--deep); }
.tm2-btn.is-next:hover { background: #ffff64; }
.tm2-btn:focus-visible, .tm2-play:focus-visible, .tm2-station:focus-visible { outline: 2px solid var(--lime); outline-offset: 3px; }

/* the featured video */
.tm2-media { position: relative; margin: 0; }
.tm2-media::before { /* back plate: a second, offset frame */
  content: ''; position: absolute; inset: -14px 18px 18px -14px; border-radius: 22px;
  border: 1px solid #ffffff14; background: #ffffff05; pointer-events: none;
}
.tm2-frame {
  position: relative; aspect-ratio: 16 / 9; border-radius: 18px; overflow: hidden; isolation: isolate;
  border: 1px solid #8a6aa866; background: #1c0e35; box-shadow: 0 24px 60px #140a2a66;
}
.tm2-bg { /* the same frame, blurred, behind portrait footage */
  position: absolute; inset: -40px; z-index: -2; background-size: cover; background-position: center;
  filter: blur(26px) saturate(1.1) brightness(.55); transform: scale(1.1);
  transition: opacity .45s var(--tm2-ease);
}
.tm2-poster, .tm2-video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; }
.tm2-frame[data-shape="wide"] .tm2-poster, .tm2-frame[data-shape="wide"] .tm2-video { object-fit: cover; }
.tm2-poster { transition: opacity .45s var(--tm2-ease); }
.tm2-poster.is-off { opacity: 0; }
.tm2-video { z-index: 2; background: #000; opacity: 0; transition: opacity .35s var(--tm2-ease); }
.tm2-frame.is-playing .tm2-video { opacity: 1; }
.tm2-frame.is-playing .tm2-play, .tm2-frame.is-playing .tm2-tag { opacity: 0; pointer-events: none; }
.tm2-play {
  position: absolute; top: 66%; left: 50%; translate: -50% -50%; z-index: 3; /* below the faces in all four frames */
  width: 78px; height: 78px; border-radius: 50%; display: grid; place-items: center; color: #fff;
  background: #6c3fa0b3; border: 1.5px solid #ffffffcc; backdrop-filter: blur(6px);
  box-shadow: 0 8px 28px #140a2a66;
  transition: transform .3s var(--tm2-ease), background .25s, color .25s, opacity .25s;
}
.tm2-play svg { width: 26px; height: 26px; margin-left: 4px; fill: currentColor; }
.tm2-play:hover { background: var(--lime); color: var(--deep); transform: scale(1.06); }
.tm2-tag {
  position: absolute; top: 16px; z-index: 3; direction: ltr; font-size: 12px; font-weight: 500; line-height: 1;
  padding: 8px 12px; border-radius: 99px; color: #fff; font-variant-numeric: tabular-nums;
  background: color-mix(in srgb, var(--deep) 62%, transparent); backdrop-filter: blur(8px); transition: opacity .25s;
}
.tm2-count { left: 16px; }
.tm2-count b { font-weight: 600; }
.tm2-dur { right: 16px; }

/* four stations */
.tm2-nav { position: relative; }
.tm2-stations {
  list-style: none; margin: 0; padding: 0;
  display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px;
}
.tm2-station {
  display: grid; gap: 8px; width: 100%; padding: 0; text-align: center; color: #b9a6ca;
  background: transparent; cursor: pointer;
}
.tm2-thumb {
  position: relative; display: block; aspect-ratio: 16 / 10; border-radius: 10px; overflow: hidden;
  border: 1.5px solid #ffffff1f; background: #2a164d;
  transition: border-color .25s, transform .3s var(--tm2-ease), opacity .25s;
}
.tm2-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; opacity: .62; transition: opacity .25s; }
.tm2-thumb i {
  position: absolute; bottom: 6px; right: 8px; font-style: normal; font-size: 13px; font-weight: 600; color: #fff;
  text-shadow: 0 1px 6px #140a2ab3;
}
.tm2-label { font-size: 12px; line-height: 1.4; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tm2-station:hover .tm2-thumb { border-color: #ffffff59; }
.tm2-station:hover .tm2-thumb img { opacity: .85; }
.tm2-station[aria-current="true"] { color: #fff; }
.tm2-station[aria-current="true"] .tm2-thumb { border-color: var(--lime); transform: translateY(-3px); }
.tm2-station[aria-current="true"] .tm2-thumb img { opacity: 1; }
/* progress: a thin rail under the stations; the yellow part runs (RTL) from
   the first station to the active one. Subordinate to the page's main line. */
.tm2-track { /* own full-width row under both columns: the page line's branch runs here, never across text or controls */
  grid-column: 1 / -1; position: relative; height: 2px; margin-top: 22px; border-radius: 2px; background: #ffffff1f;
}
.tm2-fill {
  position: absolute; top: 0; right: 0; height: 100%; width: var(--tm2-fill, 12.5%); border-radius: 2px; background: var(--lime);
  transition: width .45s var(--tm2-ease);
}

/* ---------- pinned storytelling (set by JS, large screens, normal motion) ---------- */
.tm2.tm2--pin { padding: 0; height: calc(100svh - var(--tm2-top) + var(--tm2-range)); }
.tm2.tm2--pin .tm2-stage {
  position: sticky; top: var(--tm2-top); height: calc(100svh - var(--tm2-top));
  display: flex; align-items: center; padding: 26px 0 22px;
}
.tm2.tm2--pin .tm2-grid { width: min(1240px, calc(100% - 104px)); }
@media (min-width: 801px) { #testimonials.tm2 { scroll-margin-top: -14px; } }  /* land where the pin starts */

/* entrance (only for parts below the fold at load; never hides what is on screen) */
.motion-ok .tm2.tm2--pre .tm2-head, .motion-ok .tm2.tm2--pre .tm2-media, .motion-ok .tm2.tm2--pre .tm2-nav,
.motion-ok .tm2.tm2--pre .tm2-story, .motion-ok .tm2.tm2--pre .tm2-client, .motion-ok .tm2.tm2--pre .tm2-ctrl { opacity: 0; transform: translateY(18px); }
.motion-ok .tm2 .tm2-head, .motion-ok .tm2 .tm2-media, .motion-ok .tm2 .tm2-nav,
.motion-ok .tm2 .tm2-col-story > .tm2-ctrl { transition: opacity .7s var(--tm2-ease), transform .7s var(--tm2-ease); }
.motion-ok .tm2 .tm2-media { transition-delay: .08s; }
.motion-ok .tm2 .tm2-nav { transition-delay: .16s; }

@media (max-width: 1150px) {
  .tm2-head h2 { font-size: 44px; }
  .tm2-quote { font-size: 20px; }
}
/* ---------- tablets / phones: its own composition, normal scrolling ---------- */
@media (max-width: 1023px) {
  .tm2 { padding: 64px 0 56px; }
  .tm2-grid { display: grid; grid-template-columns: minmax(0, 1fr); row-gap: 22px; }
  .tm2-col-story, .tm2-col-media { display: contents; }
  .tm2-head { order: 1; } .tm2-story { order: 2; min-height: 0; } .tm2-media { order: 3; }
  .tm2-client { order: 4; max-width: none; } .tm2-ctrl { order: 5; } .tm2-nav { order: 6; } .tm2-track { order: 7; margin-top: 0; }
  .tm2-head h2 { font-size: 40px; }
  .tm2-head h2 br { display: none; }
  .tm2-media::before { display: none; }
  .tm2-frame { touch-action: pan-y; }
  .tm2-ctrl { justify-content: flex-start; }
  .tm2-stations {
    display: flex; overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: none;
    margin-inline: -20px; padding: 4px 20px 2px; scroll-padding-inline: 20px; gap: 10px;
  }
  .tm2-stations::-webkit-scrollbar { display: none; }
  .tm2-stations > li { flex: 0 0 132px; scroll-snap-align: start; }
}
@media (max-width: 800px) { .tm2-grid { width: calc(100% - 40px); } }
@media (max-width: 520px) {
  .tm2-head h2 { font-size: 36px; }
  .tm2-quote { font-size: 19px; }
  .tm2-title { font-size: 23px; }
  .tm2-frame { aspect-ratio: 4 / 5; }               /* phones: portrait footage gets the room */
  .tm2-frame[data-shape="wide"] { aspect-ratio: 16 / 9; }
  .tm2-play { width: 68px; height: 68px; }
}
@media (prefers-reduced-motion: reduce) {
  .tm2 *, .tm2 *::before { transition: none !important; }
}
