/* Ki — Testimonials.
   Two layouts:
     · grid       — N-up cards on a cream section (Home design)
     · cinematic  — full-bleed quote + video split (legacy)
   Both branches share the `.ki-testimonials` root; layout is switched via
   the `data-layout` attribute. */

/* ════════════════════════════════════════════════════════════════
   Grid layout — N-up testimonial cards (Home)
   Source: Ki Home.html lines 481–509 + 1133–1190.
   ════════════════════════════════════════════════════════════════ */
.ki-scope .ki-testimonials[data-layout="grid"] {
  background: var(--ki-cream);
  padding: 88px 0;            /* more compact than the 140px block default */
}

.ki-scope .ki-testimonials[data-layout="grid"] .ki-test-head {
  text-align: center;
  margin-bottom: 48px;
}
.ki-scope .ki-testimonials[data-layout="grid"] .ki-test-head .catchline {
  display: block;
  font-family: var(--ki-sans);
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--ki-ink-soft);
  margin-bottom: 18px;
}
.ki-scope .ki-testimonials[data-layout="grid"] .ki-test-head h2 {
  font-family: var(--ki-serif);
  font-size: clamp(36px, 4.6vw, 56px);
  font-weight: 400;
  color: var(--ki-ink-soft);
  line-height: 1.1;
  margin: 0 auto 16px;
  max-width: 24ch;
}

/* ── Single-row scrollable carousel ── */
.ki-scope .ki-testimonials[data-layout="grid"] .ki-test-carousel {
  position: relative;
}
.ki-scope .ki-testimonials[data-layout="grid"] .ki-test-track {
  display: flex;
  gap: 24px;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  scroll-behavior: smooth;
  -webkit-overflow-scrolling: touch;
  padding: 4px 2px 16px;
  scrollbar-width: thin;
  scrollbar-color: var(--ki-rule) transparent;
  cursor: grab;               /* affordance: the row can be grabbed + dragged */
}
.ki-scope .ki-testimonials[data-layout="grid"] .ki-test-track::-webkit-scrollbar { height: 6px; }
.ki-scope .ki-testimonials[data-layout="grid"] .ki-test-track::-webkit-scrollbar-thumb {
  background: var(--ki-rule); border-radius: 999px;
}
/* While a click-drag is in progress (mouse / pen): pull freely, no snap fight,
   no smooth-scroll lag, and don't select the quote text or ghost-drag images. */
.ki-scope .ki-testimonials[data-layout="grid"] .ki-test-track.is-dragging {
  cursor: grabbing;
  scroll-snap-type: none;     /* snap re-engages on release */
  scroll-behavior: auto;      /* 1:1 tracking with the pointer */
  user-select: none;
  -webkit-user-select: none;
}
.ki-scope .ki-testimonials[data-layout="grid"] .ki-test-track.is-dragging img {
  pointer-events: none;
}
/* Exactly two cards per view — each fills half the row (minus half the gap),
   matching the previous 2-column card width. Remaining cards scroll/auto-advance. */
.ki-scope .ki-testimonials[data-layout="grid"] .ki-test-track .ki-test-card {
  flex: 0 0 auto;
  width: calc(50% - 12px);
  scroll-snap-align: start;
}

.ki-scope .ki-testimonials[data-layout="grid"] .ki-test-card {
  padding: 36px 32px 28px;
  background: var(--ki-paper);
  border: 1px solid var(--ki-rule);
  display: flex;
  flex-direction: column;
}
.ki-scope .ki-testimonials[data-layout="grid"] .ki-test-card .ki-qmark {
  font-family: var(--ki-serif);
  font-size: 80px;
  line-height: 1;
  height: 0.5em;            /* clip the glyph's lower half so it sits cleanly above the quote */
  color: var(--ki-blue);
  display: block;
  overflow: hidden;
  margin-bottom: 16px;
}
.ki-scope .ki-testimonials[data-layout="grid"] .ki-test-card blockquote {
  margin: 0 0 24px;
  font-family: var(--ki-serif);
  font-size: 19px;
  line-height: 1.5;
  color: var(--ki-ink-soft);
  font-weight: 400;
  flex: 1;
}
.ki-scope .ki-testimonials[data-layout="grid"] .ki-test-who {
  display: flex;
  align-items: center;
  gap: 14px;
  padding-top: 18px;
  border-top: 1px solid var(--ki-rule);
}
.ki-scope .ki-testimonials[data-layout="grid"] .ki-test-portrait {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: var(--ki-cream);
  border: 1px solid var(--ki-rule);
  display: grid;
  place-items: center;
  font-family: var(--ki-serif);
  font-size: 16px;
  color: var(--ki-ink-soft);
  flex: none;
  overflow: hidden;
}
.ki-scope .ki-testimonials[data-layout="grid"] .ki-test-portrait img {
  width: 100%; height: 100%;
  object-fit: cover;
}
.ki-scope .ki-testimonials[data-layout="grid"] .ki-test-name {
  font-family: var(--ki-serif);
  font-size: 18px;
  line-height: 1.1;
  color: var(--ki-ink-soft);
}
.ki-scope .ki-testimonials[data-layout="grid"] .ki-test-role {
  font-family: var(--ki-sans);
  font-size: 12px;
  color: var(--ki-ink-mute);
  margin-top: 2px;
  line-height: 1.3;
}

.ki-scope .ki-testimonials[data-layout="grid"] .ki-test-cta {
  text-align: center;
  margin-top: 56px;
}
.ki-scope .ki-testimonials[data-layout="grid"] .ki-btn-dark {
  display: inline-flex;
  align-items: center;
  gap: 14px;
  height: 54px;
  padding: 0 32px;
  background: var(--ki-ink-soft);
  color: var(--ki-cream);
  font-family: var(--ki-sans);
  font-size: 12px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  font-weight: 600;
  border-radius: 2px;
  border: 1px solid var(--ki-ink-soft);
  transition: background 220ms ease, color 220ms ease, transform 220ms ease;
}
.ki-scope .ki-testimonials[data-layout="grid"] .ki-btn-dark:hover {
  background: transparent;
  color: var(--ki-ink-soft);
  transform: translateY(-1px);
}
.ki-scope .ki-testimonials[data-layout="grid"] .ki-btn-dark::after {
  content: "→";
  font-family: var(--ki-serif);
  font-size: 18px;
}

/* Tablet: one-and-a-bit cards so it reads as a swipeable row. */
@media (max-width: 900px) {
  .ki-scope .ki-testimonials[data-layout="grid"] .ki-test-track .ki-test-card {
    width: calc(70% - 12px);
  }
}
@media (max-width: 700px) {
  /* On phones, one card per view — swipe / auto-advance through them. */
  .ki-scope .ki-testimonials[data-layout="grid"] .ki-test-track .ki-test-card {
    width: 86%;
  }
}

/* ════════════════════════════════════════════════════════════════
   Cinematic Split layout (legacy)
   Full-bleed 2-column section: cream quote side + dark video panel.
   ════════════════════════════════════════════════════════════════ */
.ki-scope .ki-cine { position: relative; }

.ki-scope .ki-cine .ki-cine-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  width: 100%;
  min-height: 720px;
}

/* ═══════════ LEFT — quote + navigation ═══════════ */
.ki-scope .ki-cine .ki-cine-left {
  background: var(--ki-cream);
  padding: clamp(48px, 5vw, 84px) clamp(32px, 4.6vw, 88px);
  display: flex;
  flex-direction: column;
  min-width: 0;
}

/* top row: eyebrow + story counter */
.ki-scope .ki-cine .ki-cine-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}
.ki-scope .ki-cine .ki-cine-eyebrow {
  font-family: var(--ki-mono);
  font-size: 11px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--ki-ink-mute);
}
.ki-scope .ki-cine .ki-slider-count {
  font-family: var(--ki-mono);
  font-size: 11px;
  letter-spacing: 0.14em;
  color: var(--ki-ink-mute);
  display: inline-flex;
  align-items: baseline;
}
.ki-scope .ki-cine .ki-slider-count .cur { color: var(--ki-ink); }
.ki-scope .ki-cine .ki-slider-count .sep { opacity: 0.5; }

/* heading + subhead */
.ki-scope .ki-cine .ki-cine-intro { margin-top: clamp(28px, 4vw, 52px); }
.ki-scope .ki-cine .ki-cine-title {
  font-family: var(--ki-serif);
  font-weight: 300;
  font-size: clamp(38px, 4.2vw, 56px);
  line-height: 1.04;
  letter-spacing: -0.015em;
  color: var(--ki-ink);
  margin: 0;
}
.ki-scope .ki-cine .ki-cine-title em { font-weight: 400; }
.ki-scope .ki-cine .ki-cine-sub {
  font-family: var(--ki-sans);
  font-size: 15px;
  line-height: 1.6;
  color: var(--ki-ink-mute);
  margin: 18px 0 0;
  max-width: 40ch;
}

/* quote area — slides crossfade in place */
.ki-scope .ki-cine .ki-cine-quotes {
  flex: 1;
  position: relative;
  margin: clamp(32px, 4vw, 56px) 0 clamp(28px, 3vw, 40px);
  min-height: 230px;
}
.ki-scope .ki-cine .ki-cine-quote {
  position: absolute;
  inset: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  opacity: 0;
  visibility: hidden;
  transform: translateY(10px);
  transition: opacity 520ms ease, transform 520ms cubic-bezier(0.2,0.7,0.2,1), visibility 0s linear 520ms;
}
.ki-scope .ki-cine .ki-cine-quote.is-active {
  opacity: 1;
  visibility: visible;
  transform: none;
  transition: opacity 520ms ease, transform 520ms cubic-bezier(0.2,0.7,0.2,1);
}
.ki-scope .ki-cine .ki-quote-mark {
  color: var(--ki-blue);
  margin-bottom: 22px;
  flex: none;
}
.ki-scope .ki-cine .ki-cine-quote blockquote {
  margin: 0;
  font-family: var(--ki-serif);
  font-weight: 300;
  font-size: clamp(20px, 1.55vw, 27px);
  line-height: 1.42;
  letter-spacing: -0.01em;
  color: var(--ki-ink);
}
.ki-scope .ki-cine .ki-cine-quote figcaption {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-top: 30px;
  padding-top: 26px;
  border-top: 1px solid var(--ki-rule);
}
.ki-scope .ki-cine .ki-cine-avatar {
  width: 48px; height: 48px;
  flex: none;
  border-radius: 50%;
  overflow: hidden;
  background: #fff;
  border: 1px solid var(--ki-rule);
  display: grid;
  place-items: center;
  font-family: var(--ki-serif);
  font-size: 16px;
  color: var(--ki-ink-soft);
}
.ki-scope .ki-cine .ki-cine-avatar img {
  width: 100%; height: 100%; object-fit: cover;
}
.ki-scope .ki-cine .ki-cine-person { display: flex; flex-direction: column; gap: 3px; }
.ki-scope .ki-cine .ki-cine-name {
  font-family: var(--ki-serif);
  font-size: 19px;
  line-height: 1.1;
  color: var(--ki-ink);
}
.ki-scope .ki-cine .ki-cine-role {
  font-family: var(--ki-mono);
  font-size: 10.5px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ki-ink-mute);
}

/* navigation row */
.ki-scope .ki-cine .ki-cine-nav {
  display: flex;
  align-items: center;
  gap: 20px;
}
.ki-scope .ki-cine .ki-cine-arrows { display: inline-flex; gap: 8px; flex: none; }
.ki-scope .ki-cine .ki-slider-prev,
.ki-scope .ki-cine .ki-slider-next {
  width: 40px; height: 40px;
  border-radius: 50%;
  border: 1px solid var(--ki-rule);
  background: transparent;
  color: var(--ki-ink-soft);
  display: grid; place-items: center;
  cursor: pointer;
  padding: 0;
  transition: background 200ms ease, color 200ms ease, border-color 200ms ease, transform 200ms ease;
}
.ki-scope .ki-cine .ki-slider-prev:hover,
.ki-scope .ki-cine .ki-slider-next:hover {
  background: var(--ki-ink);
  color: var(--ki-paper);
  border-color: var(--ki-ink);
  transform: translateY(-2px);
}
.ki-scope .ki-cine .ki-cine-rule {
  flex: 1;
  height: 1px;
  background: var(--ki-rule);
}
.ki-scope .ki-cine .ki-cine-all {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  flex: none;
  font-family: var(--ki-mono);
  font-size: 11px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--ki-ink);
  transition: color 200ms ease, gap 200ms ease;
}
.ki-scope .ki-cine .ki-cine-all:hover {
  color: var(--ki-blue);
  gap: 12px;
}

/* ═══════════ RIGHT — video panel ═══════════ */
.ki-scope .ki-cine .ki-cine-right {
  background: #2A2A30;
  position: relative;
  overflow: hidden;
  min-width: 0;
}
.ki-scope .ki-cine .ki-cine-video {
  position: absolute;
  inset: 0;
  opacity: 0;
  visibility: hidden;
  transition: opacity 560ms ease, visibility 0s linear 560ms;
}
.ki-scope .ki-cine .ki-cine-video.is-active {
  opacity: 1;
  visibility: visible;
  transition: opacity 560ms ease;
}
.ki-scope .ki-cine .ki-video-thumb {
  position: absolute;
  inset: 0;
  width: 100%; height: 100%;
  display: block;
  border: 0; padding: 0; margin: 0;
  cursor: pointer;
  background: #2A2A30;
  overflow: hidden;
}
.ki-scope .ki-cine .ki-video-thumb.ki-video-still { cursor: default; }
.ki-scope .ki-cine .ki-cine-video-img {
  position: absolute;
  inset: 0;
  width: 100%; height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 7s ease;
}
.ki-scope .ki-cine .ki-cine-video.is-active .ki-cine-video-img {
  transform: scale(1.06);
}
.ki-scope .ki-cine .ki-video-shade {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(58% 48% at 50% 44%, rgba(10,16,22,0) 0%, rgba(10,16,22,0.32) 100%),
    linear-gradient(180deg, rgba(10,16,22,0.42) 0%, rgba(10,16,22,0) 32%, rgba(10,16,22,0.62) 100%);
  pointer-events: none;
}
.ki-scope .ki-cine .ki-play-btn {
  position: absolute;
  left: 50%; top: 50%;
  transform: translate(-50%,-50%);
  width: 78px; height: 78px;
  border-radius: 50%;
  background: var(--ki-blue);
  color: #fff;
  display: grid; place-items: center;
  box-shadow: 0 14px 40px rgba(0,0,0,0.45), 0 0 0 1px rgba(255,255,255,0.16), 0 0 0 11px rgba(255,255,255,0.08);
  transition: transform 300ms cubic-bezier(0.2,0.7,0.2,1), box-shadow 300ms ease;
  pointer-events: none;
}
.ki-scope .ki-cine .ki-play-btn svg { margin-left: 4px; }
.ki-scope .ki-cine .ki-video-thumb:hover .ki-play-btn {
  transform: translate(-50%,-50%) scale(1.1);
  box-shadow: 0 18px 52px rgba(0,0,0,0.55), 0 0 0 1px rgba(255,255,255,0.22), 0 0 0 15px rgba(255,255,255,0.1);
}

/* live badge — top-left, frosted, pulsing dot */
.ki-scope .ki-cine .ki-live-badge {
  position: absolute;
  top: 26px; left: 26px;
  z-index: 3;
  display: inline-flex;
  align-items: center;
  gap: 9px;
  padding: 8px 14px;
  border-radius: 999px;
  background: rgba(10,16,22,0.5);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border: 1px solid rgba(255,255,255,0.14);
  font-family: var(--ki-mono);
  font-size: 10px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: rgba(255,255,255,0.92);
  pointer-events: none;
}
.ki-scope .ki-cine .ki-live-badge .dot {
  width: 7px; height: 7px;
  border-radius: 50%;
  background: var(--ki-blue);
  animation: ki-live-pulse 1.8s ease-in-out infinite;
}
@keyframes ki-live-pulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(0,153,204,0.55); }
  50%      { box-shadow: 0 0 0 6px rgba(0,153,204,0); }
}

/* per-story caption — bottom-left */
.ki-scope .ki-cine .ki-cine-caption {
  position: absolute;
  left: 28px; bottom: 26px;
  z-index: 3;
  font-family: var(--ki-mono);
  font-size: 11px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: rgba(255,255,255,0.82);
  pointer-events: none;
}

/* placeholder fill when no thumbnail */
.ki-scope .ki-cine .ki-video-thumb .ph-stripes { inset: 0; }

/* ═══════════ Responsive ═══════════ */
@media (max-width: 1024px) {
  .ki-scope .ki-cine .ki-cine-grid {
    grid-template-columns: 1fr;
    min-height: 0;
  }
  .ki-scope .ki-cine .ki-cine-right {
    min-height: 440px;
    order: -1; /* video on top when stacked */
  }
  .ki-scope .ki-cine .ki-cine-quotes { min-height: 200px; }
}
@media (max-width: 600px) {
  .ki-scope .ki-cine .ki-cine-right { min-height: 320px; }
  .ki-scope .ki-cine .ki-play-btn { width: 62px; height: 62px; }
  .ki-scope .ki-cine .ki-cine-nav { flex-wrap: wrap; gap: 14px; }
  .ki-scope .ki-cine .ki-cine-rule { display: none; }
}

/* ═══════════ Lightbox modal (appended to <body>) ═══════════ */
body > .ki-lightbox-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(10, 16, 22, 0.84);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  display: grid;
  place-items: center;
  z-index: 99999;
  animation: ki-lightbox-in 240ms ease;
}
@keyframes ki-lightbox-in { from { opacity: 0; } to { opacity: 1; } }
body > .ki-lightbox-backdrop .ki-lightbox-frame {
  position: relative;
  width: min(980px, 92vw);
  aspect-ratio: 16 / 9;
  background: #000;
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 40px 100px rgba(0,0,0,0.6);
  animation: ki-lightbox-pop 320ms cubic-bezier(0.2,0.7,0.2,1);
}
@keyframes ki-lightbox-pop {
  from { transform: scale(0.94); opacity: 0; }
  to   { transform: scale(1); opacity: 1; }
}
body > .ki-lightbox-backdrop .ki-lightbox-frame iframe,
body > .ki-lightbox-backdrop .ki-lightbox-frame video {
  width: 100%; height: 100%;
  border: 0;
  display: block;
}
body > .ki-lightbox-backdrop .ki-lightbox-close {
  position: absolute;
  top: -46px; right: 0;
  width: 38px; height: 38px;
  border: 0;
  border-radius: 50%;
  background: rgba(255,255,255,0.14);
  color: #fff;
  font-size: 22px;
  cursor: pointer;
  display: grid; place-items: center;
  transition: background 200ms ease;
}
body > .ki-lightbox-backdrop .ki-lightbox-close:hover {
  background: rgba(255,255,255,0.26);
}
