/* ─────────────────────────────────────────────────────────────────
   IMMAC — SECCIÓN 2 · VIDEO DEL LABORATORIO ("Rendija")
   Inicio, entre el hero y "De la mezcla a la vía".
   Entra fundida sobre el final del hero (mismo degradado de 240 px que
   obra-scroll). Sobre blanco aparece el título; una línea fina se dibuja y se
   abre hacia arriba y abajo hasta dejar el video a pantalla completa, que
   empieza a reproducirse. Controles discretos que aparecen al mover el mouse.
   Video: assets/video/laboratorio.mp4 · lógica: js/video-lab.js
───────────────────────────────────────────────────────────────── */
.vl {
  --vl-feather: 240px;
  --vl-ease: cubic-bezier(0.23, 1, 0.32, 1);
  position: relative;
  z-index: 14;
  height: 320vh;
  margin-top: calc(-1 * var(--vl-feather));
  background: transparent;
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}
.vl-sticky {
  position: sticky;
  top: 0;
  height: 100vh;
  height: 100svh;
  height: 100lvh;
  overflow: hidden;
  background: #fff;
}

/* Tramo en que el video cubre la pantalla: el menú vuelve a su versión clara (header.js) */
.vl-dark { position: absolute; left: 0; right: 0; top: 75vh; bottom: var(--vl-feather); pointer-events: none; }

/* ── Título sobre blanco ── */
.vl-head {
  position: absolute;
  inset: 0;
  z-index: 0;
  display: grid;
  place-content: center;
  padding: 0 24px;
  text-align: center;
  pointer-events: none;
  opacity: var(--vl-ho, 1);
  transform: scale(calc(1 - (1 - var(--vl-ho, 1)) * 0.04));
}
.vl-eyebrow {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--accent-on-light, #0A5F9A);
}
.vl-title {
  margin: 14px 0 0;
  font-size: clamp(34px, 5.6vw, 80px);
  font-weight: 900;
  line-height: 0.98;
  letter-spacing: -0.04em;
  color: #101828;
}
.vl-title span { color: #8E9AA9; }

/* ── Línea que se convierte en la rendija ── */
.vl-line {
  position: absolute;
  left: 0;
  right: 0;
  top: 50%;
  height: 1px;
  background: #101828;
  transform: scaleX(var(--vl-lx, 0));
  opacity: var(--vl-lo, 1);
  pointer-events: none;
}
.vl-frame {
  position: absolute;
  inset: 0;
  z-index: 1;
  background: #000;
  clip-path: inset(var(--vl-iy, 49.6%) 0 var(--vl-iy, 49.6%) 0);
  will-change: clip-path;
}
.vl-video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  background: #000;
}
/* Celular vertical: se ve el cuadro completo (los subtítulos del video no se recortan) */
@media (max-aspect-ratio: 4/5) { .vl-video { object-fit: contain; } }

/* Velo: bordes apenas oscurecidos para que los controles se lean */
.vl-veil {
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: linear-gradient(180deg, rgba(0, 0, 0, 0.28) 0%, rgba(0, 0, 0, 0) 18%, rgba(0, 0, 0, 0) 72%, rgba(0, 0, 0, 0.45) 100%);
  opacity: 0;
  transition: opacity 0.5s var(--vl-ease);
}
.vl.ui-on .vl-veil, .vl.is-paused .vl-veil { opacity: 1; }

/* Etiqueta arriba a la izquierda */
.vl-tag {
  position: absolute;
  top: calc(clamp(20px, 4vh, 40px) + 64px);
  left: clamp(20px, 4vw, 56px);
  color: var(--accent-on-dark, #3FB4E6);
  opacity: 0;
  transition: opacity 0.4s var(--vl-ease);
}
.vl.ui-on .vl-tag, .vl.is-paused .vl-tag { opacity: 1; }

/* ── Botón central (activar sonido / reproducir / ver de nuevo) ── */
.vl-cta {
  position: absolute;
  left: 50%;
  top: 50%;
  display: grid;
  justify-items: center;
  gap: 18px;
  padding: 0;
  border: 0;
  background: none;
  color: #fff;
  font: inherit;
  text-align: center;
  cursor: pointer;
  transform: translate(-50%, -50%);
  transition: opacity 0.5s var(--vl-ease), transform 0.5s var(--vl-ease);
}
.vl-cta[hidden] { display: grid; opacity: 0; pointer-events: none; transform: translate(-50%, -50%) scale(0.96); }
.vl-ring {
  position: relative;
  display: grid;
  place-items: center;
  width: 96px;
  height: 96px;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.55);
  background: rgba(16, 24, 40, 0.38);   /* se lee también sobre las tomas claras del video */
  -webkit-backdrop-filter: blur(14px);
  backdrop-filter: blur(14px);
  transition: transform 0.3s var(--vl-ease), background 0.3s var(--vl-ease);
}
.vl-cta:hover .vl-ring { transform: scale(1.06); background: rgba(16, 24, 40, 0.5); }
.vl-cta:active .vl-ring { transform: scale(0.97); }
.vl-ring::after {
  content: '';
  position: absolute;
  inset: -1px;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.5);
  animation: vl-ping 2.4s var(--vl-ease) infinite;
}
@keyframes vl-ping { from { transform: scale(1); opacity: 0.8; } to { transform: scale(1.6); opacity: 0; } }
.vl-ring svg { width: 28px; height: 28px; }
.vl-cta-label {
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.04em;
  padding: 6px 14px;
  border-radius: 999px;
  background: rgba(16, 24, 40, 0.38);
  -webkit-backdrop-filter: blur(14px);
  backdrop-filter: blur(14px);
}
.vl-cta:focus-visible { outline: none; }
.vl-cta:focus-visible .vl-ring { outline: 2px solid #fff; outline-offset: 4px; }

/* ── Barra de control (cristal) ── */
.vl-ctrl {
  position: absolute;
  left: clamp(16px, 3vw, 40px);
  right: calc(clamp(16px, 3vw, 40px) + 72px);   /* deja libre el botón del asistente */
  bottom: calc(clamp(16px, 3vw, 32px) + var(--tb, 0px));
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 10px 14px;
  border-radius: 16px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(15, 20, 28, 0.5);
  -webkit-backdrop-filter: blur(18px);
  backdrop-filter: blur(18px);
  color: #fff;
  opacity: 0;
  visibility: hidden;
  transform: translateY(8px);
  transition: opacity 0.35s var(--vl-ease), transform 0.35s var(--vl-ease), visibility 0s linear 0.35s;
}
.vl.is-live.ui-on .vl-ctrl, .vl.is-live.is-paused .vl-ctrl {
  opacity: 1;
  visibility: visible;
  transform: none;
  transition: opacity 0.35s var(--vl-ease), transform 0.35s var(--vl-ease), visibility 0s;
}
.vl-btn {
  display: grid;
  place-items: center;
  flex: none;
  width: 36px;
  height: 36px;
  padding: 0;
  border: 0;
  border-radius: 10px;
  background: none;
  color: #fff;
  cursor: pointer;
  transition: background 0.2s;
}
.vl-btn:hover { background: rgba(255, 255, 255, 0.12); }
.vl-btn:focus-visible { outline: 2px solid #fff; outline-offset: 1px; }
.vl-btn svg { width: 18px; height: 18px; }
.vl-btn .ico-play, .vl.is-paused .vl-btn .ico-pause,
.vl-btn .ico-muted, .vl.is-muted .vl-btn .ico-sound { display: none; }
.vl.is-paused .vl-btn .ico-play, .vl.is-muted .vl-btn .ico-muted { display: block; }
.vl-time {
  flex: none;
  min-width: 36px;
  font: 400 12px var(--font-mono, ui-monospace, Consolas, monospace);
  font-variant-numeric: tabular-nums;
  color: rgba(255, 255, 255, 0.75);
}
.vl-track {
  position: relative;
  flex: 1;
  height: 24px;
  cursor: pointer;
  touch-action: none;
}
.vl-track::before, .vl-track i {
  content: '';
  position: absolute;
  left: 0;
  top: 50%;
  height: 4px;
  margin-top: -2px;
  border-radius: 4px;
}
.vl-track::before { right: 0; background: rgba(255, 255, 255, 0.2); }
.vl-track i { width: 100%; background: #fff; transform: scaleX(0); transform-origin: left center; }
.vl-track:focus-visible { outline: 2px solid #fff; outline-offset: 2px; border-radius: 6px; }

.vl-sticky:fullscreen { background: #000; }
.vl-sticky:fullscreen .vl-video { object-fit: contain; }
.vl:not(.ui-on).is-live:not(.is-paused) .vl-sticky { cursor: none; }

@media (max-width: 640px) {
  .vl-ctrl { gap: 8px; padding: 8px 10px; }
  .vl-time--total { display: none; }
  .vl-ring { width: 80px; height: 80px; }
}
@media (prefers-reduced-motion: reduce) {
  .vl-ring::after { animation: none; }
}
