/* =========================================================================
   02 · Clientes y resultados (.s-clientes)
   Lámina 02: logos a color en baldosas blancas sobre carbón.
   Lámina 07: tarjetas de métricas oscuras con rótulo mono celeste, cifra
   grande en Inter 300 y bajada gris. Video Boom: hairlines con pulsos.
   Testimonios en tarjetas de vidrio con comilla lila y logo en blanco.
   ========================================================================= */

.s-clientes {
  --s-tile-r: 10px;
  --s-celeste: #b3e1ef;
  --s-pulse: rgba(201, 189, 230, 0.95);
}

/* ---------- Encabezado ---------- */
.s-clientes .s-clientes__head {
  display: grid;
  gap: 18px;
  margin-bottom: clamp(40px, 5vw, 64px);
}
.s-clientes .s-clientes__head .eyebrow { margin: 0; }
.s-clientes .s-clientes__title { max-width: 26ch; }

/* ---------- Baldosas de logos ---------- */
.s-clientes .s-clientes__logos {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: clamp(8px, 0.9vw, 14px);
}
.s-clientes .s-clientes__tile {
  position: relative;
  display: grid;
  place-items: center;
  aspect-ratio: 1.22 / 1;
  padding: 0 14%;
  border-radius: var(--s-tile-r);
  background: #f7f7f6;
  /* volumen de la baldosa de la presentación, con sombras en vez de degradé */
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.9),
    inset 0 -14px 24px -18px rgba(0, 0, 0, 0.14),
    0 18px 34px -22px rgba(0, 0, 0, 0.8);
  overflow: hidden;
  /* repite la transición de [data-reveal] para que el escalonado no se pierda */
  transition:
    box-shadow 0.35s var(--ease),
    opacity 0.8s var(--ease) var(--d, 0ms),
    transform 0.8s var(--ease) var(--d, 0ms);
}
.s-clientes .s-clientes__tile[data-reveal] { transform: translateY(14px) scale(0.985); }
.s-clientes .s-clientes__tile[data-reveal].is-in { transform: none; }

/* Brillo diagonal que cruza cada baldosa una vez, al entrar */
.s-clientes .s-clientes__tile::after {
  content: "";
  position: absolute;
  inset: -20% auto -20% -60%;
  width: 40%;
  background: linear-gradient(100deg, rgba(255, 255, 255, 0) 0%, rgba(255, 255, 255, 0.85) 50%, rgba(255, 255, 255, 0) 100%);
  transform: skewX(-18deg) translateX(0);
  opacity: 0;
  pointer-events: none;
}
.s-clientes.is-on .s-clientes__tile.is-in::after {
  animation: s-clientes-sheen 1.1s var(--ease) both;
  animation-delay: calc(500ms + var(--i, 0) * 55ms);
}
@keyframes s-clientes-sheen {
  0% { opacity: 0; transform: skewX(-18deg) translateX(0); }
  20% { opacity: 1; }
  100% { opacity: 0; transform: skewX(-18deg) translateX(420%); }
}

.s-clientes .s-clientes__logo {
  --h: 28px;
  width: auto;
  height: var(--h);
  max-width: 100%;
  object-fit: contain;
  transition: transform 0.5s var(--ease);
}
@media (hover: hover) {
  .s-clientes .s-clientes__tile:hover {
    box-shadow:
      inset 0 1px 0 rgba(255, 255, 255, 0.9),
      inset 0 -14px 24px -18px rgba(0, 0, 0, 0.14),
      0 0 0 1px rgba(201, 189, 230, 0.7),
      0 24px 44px -20px rgba(78, 66, 170, 0.75);
  }
  .s-clientes .s-clientes__tile:hover .s-clientes__logo { transform: scale(1.06); }
}

/* ---------- Tarjetas de métricas (lámina 07) ---------- */
.s-clientes .s-clientes__metrics {
  list-style: none;
  margin: clamp(56px, 6vw, 88px) 0 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: clamp(10px, 1.2vw, 16px);
}
.s-clientes .s-clientes__metric {
  display: grid;
  grid-template-rows: auto auto 1fr auto;
  min-height: clamp(250px, 22vw, 290px);
  padding: clamp(20px, 2vw, 28px);
  /* luz suave arriba a la izquierda, como las tarjetas de la lámina 07 */
  background: linear-gradient(155deg, #262429 0%, #1c1b1d 58%);
  border-radius: var(--r-lg);
  box-shadow: 0 0 0 1px var(--line-2), inset 0 1px 0 rgba(255, 255, 255, 0.05), 0 30px 60px -36px rgba(0, 0, 0, 0.8);
  transition:
    box-shadow 0.35s var(--ease),
    opacity 0.8s var(--ease) var(--d, 0ms),
    transform 0.8s var(--ease) var(--d, 0ms);
}
/* Luz que sigue al puntero (la fija el JS en --mx/--my) */
.s-clientes .s-clientes__metric::before,
.s-clientes .s-clientes__quote::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: radial-gradient(320px circle at var(--mx, 50%) var(--my, -40%), rgba(169, 155, 216, 0.14), rgba(169, 155, 216, 0) 70%);
  opacity: 0;
  transition: opacity 0.4s var(--ease);
  pointer-events: none;
}
@media (hover: hover) {
  .s-clientes .s-clientes__metric:hover::before,
  .s-clientes .s-clientes__quote:hover::before { opacity: 1; }
  .s-clientes .s-clientes__metric:hover { box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.22), inset 0 1px 0 rgba(255, 255, 255, 0.05), 0 30px 60px -36px rgba(0, 0, 0, 0.8); }
}

/* El contenido va sobre la luz del puntero (::before) */
.s-clientes .s-clientes__metric > :not(.s-clientes__pulse),
.s-clientes .s-clientes__quote > * { position: relative; }

/* Pulso que recorre la hairline superior (video Boom) */
.s-clientes .s-clientes__pulse {
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 1px;
  overflow: hidden;
  pointer-events: none;
}
.s-clientes .s-clientes__pulse::after {
  content: "";
  position: absolute;
  top: 0; left: 0;
  width: 34%;
  height: 1px;
  background: linear-gradient(90deg, rgba(201, 189, 230, 0), var(--s-pulse), rgba(201, 189, 230, 0));
  transform: translateX(-110%);
  opacity: 0;
}
.s-clientes.is-on .s-clientes__pulse::after {
  animation: s-clientes-pulse 5.2s linear infinite;
  animation-delay: calc(900ms + var(--i, 0) * 1.3s);
}
@keyframes s-clientes-pulse {
  0% { transform: translateX(-110%); opacity: 0; }
  4% { opacity: 1; }
  26% { transform: translateX(300%); opacity: 1; }
  30%, 100% { transform: translateX(300%); opacity: 0; }
}

.s-clientes .s-clientes__label {
  font-family: var(--font-mono);
  font-size: var(--t-eyebrow);
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--s-celeste);
}
.s-clientes .s-clientes__fig {
  margin-top: clamp(14px, 1.6vw, 22px);
  font-family: var(--font-display);
  font-weight: 300;
  font-size: clamp(38px, 3.9vw, 58px);
  line-height: 1;
  letter-spacing: -0.035em;
  color: var(--ink);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.s-clientes .s-clientes__pre {
  font-size: 0.42em;
  letter-spacing: -0.01em;
  color: var(--muted);
  vertical-align: 0.42em;
  margin-right: 0.12em;
}
.s-clientes .s-clientes__metric--uso .s-clientes__pre { margin: 0 0.04em; }
.s-clientes .s-clientes__desc {
  align-self: end;
  margin-top: 18px;
  max-width: 24ch;
  font-size: 15px;
  line-height: 1.45;
  color: rgba(255, 255, 255, 0.7);
}

/* ---------- Mini visuales al pie de cada métrica ---------- */
.s-clientes .s-clientes__viz {
  display: flex;
  align-items: center;
  height: 18px;
  margin-top: 18px;
}
/* Pedidos: 24 marcas finas por las que viaja una onda */
.s-clientes .s-clientes__viz--flow { gap: 0; justify-content: space-between; }
.s-clientes .s-clientes__viz--flow i {
  width: 1px;
  height: 8px;
  background: rgba(255, 255, 255, 0.22);
  transform-origin: 50% 100%;
}
.s-clientes.is-on .s-clientes__viz--flow i {
  animation: s-clientes-tick 2.6s var(--ease) infinite;
}
.s-clientes .s-clientes__viz--flow i:nth-child(1) { animation-delay: 0ms; }
.s-clientes .s-clientes__viz--flow i:nth-child(2) { animation-delay: 60ms; }
.s-clientes .s-clientes__viz--flow i:nth-child(3) { animation-delay: 120ms; }
.s-clientes .s-clientes__viz--flow i:nth-child(4) { animation-delay: 180ms; }
.s-clientes .s-clientes__viz--flow i:nth-child(5) { animation-delay: 240ms; }
.s-clientes .s-clientes__viz--flow i:nth-child(6) { animation-delay: 300ms; }
.s-clientes .s-clientes__viz--flow i:nth-child(7) { animation-delay: 360ms; }
.s-clientes .s-clientes__viz--flow i:nth-child(8) { animation-delay: 420ms; }
.s-clientes .s-clientes__viz--flow i:nth-child(9) { animation-delay: 480ms; }
.s-clientes .s-clientes__viz--flow i:nth-child(10) { animation-delay: 540ms; }
.s-clientes .s-clientes__viz--flow i:nth-child(11) { animation-delay: 600ms; }
.s-clientes .s-clientes__viz--flow i:nth-child(12) { animation-delay: 660ms; }
.s-clientes .s-clientes__viz--flow i:nth-child(13) { animation-delay: 720ms; }
.s-clientes .s-clientes__viz--flow i:nth-child(14) { animation-delay: 780ms; }
.s-clientes .s-clientes__viz--flow i:nth-child(15) { animation-delay: 840ms; }
.s-clientes .s-clientes__viz--flow i:nth-child(16) { animation-delay: 900ms; }
.s-clientes .s-clientes__viz--flow i:nth-child(17) { animation-delay: 960ms; }
.s-clientes .s-clientes__viz--flow i:nth-child(18) { animation-delay: 1020ms; }
.s-clientes .s-clientes__viz--flow i:nth-child(19) { animation-delay: 1080ms; }
.s-clientes .s-clientes__viz--flow i:nth-child(20) { animation-delay: 1140ms; }
.s-clientes .s-clientes__viz--flow i:nth-child(21) { animation-delay: 1200ms; }
.s-clientes .s-clientes__viz--flow i:nth-child(22) { animation-delay: 1260ms; }
.s-clientes .s-clientes__viz--flow i:nth-child(23) { animation-delay: 1320ms; }
.s-clientes .s-clientes__viz--flow i:nth-child(24) { animation-delay: 1380ms; }
@keyframes s-clientes-tick {
  0%, 100% { transform: scaleY(1); background: rgba(255, 255, 255, 0.22); }
  18% { transform: scaleY(2.1); background: var(--lila-claro); }
  40% { transform: scaleY(1); background: rgba(255, 255, 255, 0.22); }
}

/* Despacho: barra fina que se llena a 98% */
.s-clientes .s-clientes__viz--bar,
.s-clientes .s-clientes__viz--bars { flex-direction: column; justify-content: center; align-items: stretch; gap: 6px; }
.s-clientes .s-clientes__viz--bar b,
.s-clientes .s-clientes__viz--bars b {
  position: relative;
  display: block;
  height: 3px;
  border-radius: 3px;
  background: rgba(255, 255, 255, 0.1);
  overflow: hidden;
}
.s-clientes .s-clientes__viz--bar b::after,
.s-clientes .s-clientes__viz--bars b::after {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: var(--to);
  border-radius: inherit;
  background: var(--lila-claro);
  transform: scaleX(0);
  transform-origin: 0 50%;
  transition: transform 1.4s var(--ease) 0.5s;
}
.s-clientes .s-clientes__viz--bars b:first-child::after { background: rgba(255, 255, 255, 0.42); }
.s-clientes .s-clientes__viz--bars b:last-child::after { transition-delay: 0.85s; }
.s-clientes.is-on .s-clientes__viz--bar b::after,
.s-clientes.is-on .s-clientes__viz--bars b::after { transform: scaleX(1); }

/* Uso: 10 puntos, 9 se encienden en cascada */
.s-clientes .s-clientes__viz--dots { gap: 7px; }
.s-clientes .s-clientes__viz--dots i {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.3);
  background: transparent;
  transition: background 0.4s var(--ease), box-shadow 0.4s var(--ease);
}
.s-clientes.is-on .s-clientes__viz--dots i:not(.is-off) {
  background: var(--lila-claro);
  box-shadow: inset 0 0 0 1px var(--lila-claro), 0 0 10px rgba(201, 189, 230, 0.45);
}
.s-clientes .s-clientes__viz--dots i:nth-child(1) { transition-delay: 0.5s; }
.s-clientes .s-clientes__viz--dots i:nth-child(2) { transition-delay: 0.58s; }
.s-clientes .s-clientes__viz--dots i:nth-child(3) { transition-delay: 0.66s; }
.s-clientes .s-clientes__viz--dots i:nth-child(4) { transition-delay: 0.74s; }
.s-clientes .s-clientes__viz--dots i:nth-child(5) { transition-delay: 0.82s; }
.s-clientes .s-clientes__viz--dots i:nth-child(6) { transition-delay: 0.9s; }
.s-clientes .s-clientes__viz--dots i:nth-child(7) { transition-delay: 0.98s; }
.s-clientes .s-clientes__viz--dots i:nth-child(8) { transition-delay: 1.06s; }
.s-clientes .s-clientes__viz--dots i:nth-child(9) { transition-delay: 1.14s; }

/* ---------- Testimonios (vidrio) ---------- */
.s-clientes .s-clientes__quotes {
  margin-top: clamp(16px, 1.6vw, 22px);
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: clamp(10px, 1.2vw, 16px);
}
.s-clientes .s-clientes__quote {
  position: relative;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 22px;
  padding: clamp(22px, 2.2vw, 30px);
  border-radius: var(--r-lg);
  background: rgba(255, 255, 255, 0.035);
  box-shadow: 0 0 0 1px var(--line-2), inset 0 1px 0 rgba(255, 255, 255, 0.06);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  overflow: hidden;
}
.s-clientes .s-clientes__mark {
  width: 26px;
  height: auto;
  fill: var(--lila-claro);
  opacity: 0.9;
}
.s-clientes .s-clientes__text { margin: 0; flex: 1; }
.s-clientes .s-clientes__text p {
  margin: 0;
  font-size: clamp(15px, 1.15vw, 17px);
  font-weight: 300;
  line-height: 1.6;
  color: var(--ink-2);
}
.s-clientes .s-clientes__cite {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding-top: 18px;
  border-top: 1px solid var(--line);
}
.s-clientes .s-clientes__person { display: grid; gap: 2px; min-width: 0; }
.s-clientes .s-clientes__name { font-size: 14px; font-weight: 500; color: var(--ink); }
.s-clientes .s-clientes__role {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  line-height: 1.45;
  color: var(--muted);
}
/* Logo del cliente en blanco (monocromo) */
.s-clientes .s-clientes__qlogo {
  --h: 18px;
  flex: none;
  width: auto;
  height: var(--h);
  max-width: 96px;
  object-fit: contain;
  filter: brightness(0) invert(1);
  opacity: 0.86;
}

/* ---------- Nota al pie ---------- */
.s-clientes .s-clientes__note {
  margin: clamp(20px, 2.4vw, 32px) 0 0;
  font-family: var(--font-mono);
  font-size: 11.5px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}

/* ---------- Tablet ---------- */
@media (max-width: 1080px) {
  .s-clientes .s-clientes__metrics { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .s-clientes .s-clientes__metric { min-height: 230px; }
  .s-clientes .s-clientes__fig { font-size: clamp(40px, 6vw, 58px); }
}
@media (max-width: 900px) {
  .s-clientes .s-clientes__quotes { grid-template-columns: minmax(0, 1fr); }
  .s-clientes .s-clientes__text p { max-width: 62ch; }
  .s-clientes .s-clientes__logos { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .s-clientes .s-clientes__tile { aspect-ratio: 1.45 / 1; }
}

/* ---------- Mobile ---------- */
@media (max-width: 600px) {
  .s-clientes .s-clientes__tile { aspect-ratio: 1.15 / 1; padding: 0 12%; }
  .s-clientes .s-clientes__logo { height: calc(var(--h) * 0.7); }
  .s-clientes .s-clientes__metrics { grid-template-columns: minmax(0, 1fr); }
  .s-clientes .s-clientes__metric { min-height: 0; grid-template-rows: auto auto auto auto; }
  .s-clientes .s-clientes__fig { font-size: 46px; }
  .s-clientes .s-clientes__cite { flex-wrap: wrap; }
}

/* ---------- Movimiento reducido: estado final, sin bucles ---------- */
@media (prefers-reduced-motion: reduce) {
  .s-clientes .s-clientes__tile,
  .s-clientes .s-clientes__tile[data-reveal],
  .s-clientes .s-clientes__metric { transform: none; transition: none; }
  .s-clientes .s-clientes__tile::after,
  .s-clientes .s-clientes__pulse::after { animation: none !important; opacity: 0; }
  .s-clientes .s-clientes__viz--flow i { animation: none !important; }
  .s-clientes .s-clientes__viz--bar b::after,
  .s-clientes .s-clientes__viz--bars b::after { transform: none; transition: none; }
  .s-clientes .s-clientes__viz--dots i { transition: none; }
  .s-clientes .s-clientes__viz--dots i:not(.is-off) {
    background: var(--lila-claro);
    box-shadow: inset 0 0 0 1px var(--lila-claro);
  }
  .s-clientes .s-clientes__logo { transition: none; }
}

/* Fuera de pantalla los bucles quedan en pausa (el JS quita .is-live) */
.s-clientes:not(.is-live) .s-clientes__pulse::after,
.s-clientes:not(.is-live) .s-clientes__viz--flow i { animation-play-state: paused; }
