* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  background: #000;
  height: 100vh;
  overflow: hidden;
}

/* ============================================================
   ESCENA
============================================================ */
.scene {
  position: relative;
  width: 100vw;
  height: 100vh;
  overflow: hidden;
  background: #000;
  isolation: isolate;            /* stacking context propio para blend modes */
  display: flex;
  align-items: center;
  justify-content: center;
  animation: sceneIn 0.6s ease both;
}

@keyframes sceneIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}

/* Viñeta cinematográfica */
.scene::after {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse at center, transparent 30%, rgba(0,0,0,0.80) 100%);
  z-index: 15;
  pointer-events: none;
}

/* ============================================================
   BARRAS CINEMÁTICAS — LETTERBOX
============================================================ */
.letterbox {
  position: absolute;
  left: 0; right: 0;
  height: 72px;
  background: #000;
  z-index: 25;
}
.letterbox.top    { top: 0;    animation: dropIn 0.9s ease both; }
.letterbox.bottom { bottom: 0; animation: riseIn 0.9s ease both; }

@keyframes dropIn {
  from { transform: translateY(-100%); }
  to   { transform: translateY(0); }
}
@keyframes riseIn {
  from { transform: translateY(100%); }
  to   { transform: translateY(0); }
}

/* ============================================================
   CAPA 1 — SLIDESHOW
   @keyframes principal: en cada porcentaje se ubica la ruta
   de la imagen. 13 imágenes en 5 segundos = ~7.69% cada una.
   steps(1, end) hace el cambio instantáneo (snap).
   Ken Burns añade movimiento cinematográfico continuo.
   flashTransition (inyectado desde JS) simula corte de película.
============================================================ */
.slideshow {
  position: absolute;
  inset: 0;
  background-size: cover;
  background-position: center;
  z-index: 1;
  animation:
    slideshow  5s steps(1, end) infinite,
    kenburns   5s ease-in-out   infinite;
  /* flashTransition se añade dinámicamente desde script.js */
}

@keyframes slideshow {
  0%     { background-image: url('../../animacion/1.png');   }
  7.69%  { background-image: url('../../animacion/2.jpeg');  }
  15.38% { background-image: url('../../animacion/3.webp');  }
  23.08% { background-image: url('../../animacion/4.avif');  }
  30.77% { background-image: url('../../animacion/5.webp');  }
  38.46% { background-image: url('../../animacion/6.jpeg');  }
  46.15% { background-image: url('../../animacion/7.jpg');   }
  53.85% { background-image: url('../../animacion/8.jpeg');  }
  61.54% { background-image: url('../../animacion/9.webp');  }
  69.23% { background-image: url('../../animacion/10.jpg');  }
  76.92% { background-image: url('../../animacion/11.avif'); }
  84.62% { background-image: url('../../animacion/11.jpeg'); }
  92.31% { background-image: url('../../animacion/13.jpg');  }
  100%   { background-image: url('../../animacion/1.png');   }
}

/* Ken Burns: movimiento de "cámara" continuo y suave */
@keyframes kenburns {
  0%   { transform: scale(1)    translate(  0%,   0%); }
  33%  { transform: scale(1.08) translate(-1.5%, -0.8%); }
  66%  { transform: scale(1.05) translate( 1.2%,  0.6%); }
  100% { transform: scale(1)    translate(  0%,   0%); }
}

/* ============================================================
   CAPA 2 — MÁSCARA DE TEXTO
   mix-blend-mode: multiply:
     - píxeles BLANCOS (letras) × slideshow = color del slideshow  ← imagen visible
     - píxeles NEGROS (fondo)   × slideshow = negro               ← imagen oculta
   Resultado: las imágenes solo se ven DENTRO del relleno de las letras.
============================================================ */
.text-mask {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #000;
  mix-blend-mode: multiply;
  z-index: 2;
}

.text-mask h1 {
  font-family: 'Bebas Neue', Impact, sans-serif;
  font-size: clamp(64px, 13vw, 168px);
  color: #fff;
  letter-spacing: 0.08em;
  line-height: 0.88;
  text-align: center;
  user-select: none;
  animation: breathe 5s ease-in-out infinite;
}

.text-mask h1 span {
  display: block;
}

/* ============================================================
   CAPA 3 — CONTORNO DEL TEXTO
   Solo borde visible, relleno transparente.
   Se superpone sobre la máscara para delimitar las letras huecas.
============================================================ */
.text-stroke {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 5;
  pointer-events: none;
  animation: titleReveal 1.8s cubic-bezier(0.16, 1, 0.3, 1) both;
}

.text-stroke h1 {
  font-family: 'Bebas Neue', Impact, sans-serif;
  font-size: clamp(64px, 13vw, 168px);
  color: transparent;
  -webkit-text-stroke: 1.2px rgba(255, 255, 255, 0.70);
  letter-spacing: 0.08em;
  line-height: 0.88;
  text-align: center;
  user-select: none;
  animation: breathe 5s ease-in-out infinite;
}

.text-stroke h1 span {
  display: block;
}

/* Respiración sincronizada: ambas capas de h1 usan el mismo timing */
@keyframes breathe {
  0%   { letter-spacing: 0.08em; }
  50%  { letter-spacing: 0.11em; }
  100% { letter-spacing: 0.08em; }
}

/* Entrada cinematográfica del contorno */
@keyframes titleReveal {
  0%   { opacity: 0; transform: scale(1.30); filter: blur(16px); }
  50%  { filter: blur(0); }
  100% { opacity: 1; transform: scale(1); }
}
