.testimonials {
  padding: 48px 0 24px;
  scroll-margin-top: 100px;
}
.testimonials .header {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 28px;
}
.testimonials .heading {
  font-family: var(--font-serif), serif;
  font-size: clamp(36px, 3.6vw, 48px);
  font-weight: 400;
  line-height: 1.08;
  letter-spacing: -.025em;
}
.testimonials .heading span { color: inherit; }
.testimonials .intro {
  font-size: 16px;
  line-height: 1.55;
  color: var(--ink-2);
  padding-bottom: 4px;
}
.testimonials .cards {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 24px;
  margin-top: 40px;
}
.testimonials .cardSlot {
  --rx: 0deg;
  --ry: 0deg;
  --rz: 0deg;
  --tx: 0px;
  --ty: 0px;
  --scale: 1;
  --mx: 50%;
  --my: 50%;
  --shine: 0;
  min-width: 0;
  position: relative;
  isolation: isolate;
}
.testimonials .tilt {
  position: relative;
  transform: perspective(850px) translate3d(var(--tx), var(--ty), 0) rotateX(var(--rx)) rotateY(var(--ry)) rotateZ(var(--rz)) scale(var(--scale));
  transform-style: preserve-3d;
  transition: transform 220ms cubic-bezier(.2,.8,.2,1);
}
.testimonials .card {
  line-height: normal;
  width: 100%;
  height: auto;
  position: relative;
  display: block;
  text-align: left;
  border-radius: 14px;
  appearance: none;
  perspective: 1200px;
  transform-style: preserve-3d;
  -webkit-tap-highlight-color: transparent;
}
.testimonials .card:focus-visible { outline: 2px solid var(--ink); outline-offset: 6px; }
.testimonials .rotator {
  display: block;
  width: 100%;
  height: auto;
  position: relative;
  transform-style: preserve-3d;
  will-change: transform;
  transition: transform 720ms cubic-bezier(.22,.8,.25,1);
}
.testimonials .card[data-flipped="true"] .rotator { transform: rotateY(180deg); }
.testimonials .face {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  padding: 18px;
  border: 1px solid var(--img-line);
  border-radius: 14px;
  color: var(--ink);
  background: #FAFAFA;
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
  box-shadow: 0 5px 18px #00000006;
  overflow: hidden;
}
.testimonials .face > * { position: relative; z-index: 1; }
.testimonials .front { position: relative; transform: rotateY(0deg) translateZ(1px); }
.testimonials .cardTop {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  font-family: var(--font-geist-mono), monospace;
  text-transform: uppercase;
  font-size: 9px;
  line-height: 1.5;
  letter-spacing: .04em;
  color: var(--ink-2);
}
.testimonials .portrait {
  position: relative;
  display: block;
  width: 100%;
  aspect-ratio: 1;
  flex: none;
  background: #eee;
  border-radius: 7px;
  margin: 0 0 18px;
  overflow: hidden;
}
.testimonials .portrait img { object-fit: cover; object-position: center 35%; }
.testimonials .name {
  font-family: var(--font-serif), serif;
  font-size: 28px;
  line-height: 1.15;
}
.testimonials .role { font-size: 11px; line-height: 1.5; color: var(--ink-2); margin-top: 4px; }
.testimonials .cardFoot {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 16px;
  padding-top: 12px;
  border-top: 1px solid var(--img-line);
  font-size: 9px;
  text-transform: uppercase;
  letter-spacing: .05em;
}
.testimonials .back {
  transform: rotateY(180deg) translateZ(1px);
  background: #f3f4f5;
}
/* The reverse catches a moving pearlescent light, independent of the flip. */
.testimonials .back::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse at var(--mx) var(--my), #ffffffd9 0%, #ffffff00 65%),
    linear-gradient(125deg, #e5e7eb55, #f8f8f8 28%, #d8dde455 45%, #ffffff 59%, #dedee655 76%, #eceef0);
  background-size: 100% 100%, 230% 230%;
  background-position: center, var(--mx) var(--my);
  transition: background-position 120ms ease-out;
  pointer-events: none;
}
.testimonials .back::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(110deg, transparent 30%, #ffffff05 38%, #ffffffa6 48%, #ffffff10 58%, transparent 66%);
  background-size: 260% 100%;
  background-position: var(--mx) center;
  opacity: var(--shine);
  mix-blend-mode: soft-light;
  transition: opacity 250ms ease, background-position 120ms ease-out;
  pointer-events: none;
  z-index: 2;
}
.testimonials .quoteMark {
  font-family: var(--font-serif), serif;
  font-size: 40px;
  line-height: .8;
  margin: 12px 0 0;
}
.testimonials .quote { font-size: 14px; line-height: 1.55; }
.testimonials .signature {
  display: flex;
  flex-direction: column;
  font-size: 13px;
  gap: 3px;
  margin-top: auto;
  padding-top: 12px;
}
.testimonials .signature > span { font-size: 10px; line-height: 1.5; color: var(--ink-2); }
.testimonials .backFoot { border-top: 1px solid var(--img-line); margin-top: 12px; padding-top: 10px; font-size: 9px; color: var(--ink-2); }
.testimonials .hint {
  text-align: right;
  margin-top: 24px;
  color: var(--ink-2);
  font-family: var(--font-geist-mono), monospace;
  text-transform: uppercase;
  font-size: 9px;
  line-height: 1.6;
  letter-spacing: .04em;
}
@media (min-width: 1051px) and (max-width: 1399px) {
  .testimonials .cards { grid-template-columns: repeat(3, minmax(0, 320px)); justify-content: space-between; }
}
@media (max-width: 1050px) {
  .testimonials .tilt { transform: none; transform-style: flat; }
  .testimonials .cards {
    grid-template-columns: none;
    grid-auto-flow: column;
    grid-auto-columns: calc((100% - 72px) / 2);
    justify-content: start;
    gap: 20px;
    margin-inline: -8px;
    padding: 8px 8px 16px;
    overflow-x: auto;
    overflow-y: hidden;
    scroll-snap-type: x mandatory;
    scroll-padding-inline: 8px;
    overscroll-behavior-inline: contain;
    scrollbar-width: thin;
    scrollbar-color: #bbb transparent;
  }
  .testimonials .cardSlot { scroll-snap-align: start; }
  .testimonials .quote { font-size: 14px; }
}
@media (max-width: 599px) {
  .testimonials { padding-top: 24px; }
  .testimonials .header { flex-direction: column; align-items: flex-start; gap: 18px; }
  .testimonials .cards { margin-top: 28px; grid-auto-columns: calc(100% - 48px); gap: 16px; }
  .testimonials .hint { text-align: center; font-size: 8px; }
}
@media (prefers-reduced-motion: reduce) {
  .testimonials .tilt { transform: none; transition: none; }
  .testimonials .rotator { transition: none; }
  .testimonials .back::before, .testimonials .back::after { background-position: center; transition: none; }
}

.testimonials .mouseHint { display: none; }
.testimonials .touchHint { display: inline; }
@media (min-width: 1051px) and (hover: hover) and (pointer: fine) {
  .testimonials .cardSlot:hover { z-index: 2; }
  .testimonials .mouseHint { display: inline; }
  .testimonials .touchHint { display: none; }
}
/* Keep the original cards comfortably sized beside the new left navigation. */
.testimonials .portrait { padding: 0; }
.testimonials .portrait img { width:100%; height:100%; border-radius:0; filter:none; }
.testimonials .cards { grid-template-columns:none;grid-auto-flow:column;grid-auto-columns:calc((100% - 88px)/3);justify-content:start;gap:20px;overflow-x:auto;overflow-y:hidden;padding:12px 8px 20px;margin-inline:-8px;scroll-snap-type:x mandatory;scroll-padding-inline:8px;overscroll-behavior-inline:contain;scrollbar-width:thin;scrollbar-color:#ccc transparent; }
.testimonials .cardSlot { scroll-snap-align:start; }
.testimonials .section-head h2 { font-family:var(--font-heading); }
.testimonials .hint { text-transform:none;letter-spacing:0;font-family:Inter,sans-serif;font-size:10px;text-align:left;margin-top:12px; }
@media (min-width: 1051px) {
  .testimonials .cards {
    grid-template-columns: repeat(5, minmax(0, 1fr));
    grid-auto-flow: row;
    grid-auto-columns: auto;
    gap: 16px;
    overflow: visible;
    scroll-snap-type: none;
    scrollbar-width: none;
  }
  .testimonials .tilt,
  .testimonials .card,
  .testimonials .rotator,
  .testimonials .front { height: 100%; }
  .testimonials .face { padding: 14px; }
  .testimonials .cardTop,
  .testimonials .quoteMark,
  .testimonials .signature,
  .testimonials .backFoot { flex-shrink: 0; }
  .testimonials .quote { min-height: 0; overflow-y: auto; scrollbar-width: thin; }
  .testimonials .signature { margin-top: auto; }
}
@media(max-width:1050px){.testimonials .cards{grid-auto-columns:calc((100% - 64px)/2);gap:16px}}
@media(max-width:599px){.testimonials .cards{grid-auto-columns:calc(100% - 48px);gap:16px;margin-top:20px}.testimonials .hint{font-size:9px}}
@media(max-width:359px){.testimonials .quoteMark{margin-top:10px}.testimonials .backFoot{margin-top:10px;padding-top:8px}}
