/* ============================================================
   EAJ · Preloader "Abre el telón"
   Cortinas teatrales en Rojo Rosa con pliegues, máscara EAJ,
   indicador de carga tipo ecualizador musical.
   ============================================================ */

.telon {
  position: fixed;
  inset: 0;
  z-index: var(--z-telon);
  background: var(--negro-teatral);
  display: grid;
  place-items: center;
  overflow: hidden;
}

.telon-escena {
  position: relative;
  width: 100%;
  height: 100%;
  display: grid;
  place-items: center;
}

/* --- Travesaño superior (palco) --- */
.telon-palco {
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 7vh;
  min-height: 48px;
  background: linear-gradient(180deg, #6a0613 0%, #8a0a1d 40%, #5a0510 100%);
  border-bottom: 4px solid #3a020c;
  z-index: 4;
  box-shadow: 0 12px 30px rgba(0,0,0,0.6);
}
.telon-palco::after {
  content: "";
  position: absolute;
  left: 0; right: 0; bottom: -10px;
  height: 10px;
  background:
    repeating-linear-gradient(90deg,
      #b8762d 0 12px, #8a5a20 12px 24px);
  border-radius: 0 0 6px 6px;
}

/* --- Cortinas (plisado con gradientes) --- */
.telon-cortina {
  position: absolute;
  top: 0; bottom: 0;
  width: 50%;
  background:
    repeating-linear-gradient(90deg,
      #8a0a1d 0 14px,
      #c8102e 14px 30px,
      #a00a20 30px 46px,
      #e21a30 46px 62px,
      #8a0a1d 62px 78px),
    linear-gradient(180deg, #c8102e 0%, #8a0a1d 100%);
  background-blend-mode: multiply;
  box-shadow: inset 0 -40px 80px rgba(0,0,0,0.55), inset 0 0 30px rgba(0,0,0,0.4);
  z-index: 3;
  will-change: transform;
  transition: transform 1.6s var(--ease-teatro);
}
.telon-cortina--izq {
  left: 0;
  transform-origin: left center;
  border-right: 2px solid rgba(0,0,0,0.4);
}
.telon-cortina--der {
  right: 0;
  transform-origin: right center;
  border-left: 2px solid rgba(0,0,0,0.4);
}

/* Borde inferior fleco dorado */
.telon-cortina::after {
  content: "";
  position: absolute;
  left: 0; right: 0; bottom: 0;
  height: 18px;
  background: repeating-linear-gradient(90deg,
    #b8762d 0 10px,
    #6a4520 10px 20px);
  clip-path: polygon(0 0, 100% 0, 100% 70%, 90% 100%, 80% 70%, 70% 100%, 60% 70%, 50% 100%, 40% 70%, 30% 100%, 20% 70%, 10% 100%, 0 70%);
}

/* --- Centro: máscara + nombre + ecualizador --- */
.telon-centro {
  position: relative;
  z-index: 5;
  text-align: center;
  color: var(--blanco-escenico);
  padding: var(--sp-6);
  transition: opacity 0.6s ease;
}
.telon.inicia .telon-centro { opacity: 1; }
.telon.abriendo .telon-centro { opacity: 0; transform: translateY(-10px); }

.telon-mascara {
  width: clamp(64px, 14vw, 120px);
  height: clamp(64px, 14vw, 120px);
  color: #e21a30;
  margin: 0 auto var(--sp-4);
  overflow: hidden; border-radius: 50%;
  filter: drop-shadow(0 0 18px rgba(200,16,46,0.7));
  animation: float-mask 3s ease-in-out infinite;
}
.telon-mascara svg, .telon-mascara img { width: 100%; height: 100%; display: block; object-fit: cover; border-radius: 50%; }
.telon-mascara img { transform: scale(1.45); }

@keyframes float-mask {
  0%, 100% { transform: translateY(0) rotate(0deg); }
  50% { transform: translateY(-6px) rotate(-2deg); }
}

.telon-titulo {
  font-family: var(--font-display);
  font-size: clamp(1.6rem, 4vw, 2.6rem);
  font-weight: 800;
  letter-spacing: 0.04em;
  margin: 0 0 var(--sp-2);
  text-shadow: 0 4px 24px rgba(0,0,0,0.7);
}
.telon-titulo em {
  font-style: normal;
  color: #e21a30;
}

.telon-sub {
  font-family: var(--font-body);
  font-size: var(--fs-eyebrow);
  letter-spacing: 0.3em;
  text-transform: uppercase;
  color: rgba(245,240,232,0.7);
  margin-bottom: var(--sp-6);
}

/* Ecualizador musical = carga */
.telon-eq {
  display: flex;
  justify-content: center;
  align-items: flex-end;
  gap: 6px;
  height: 36px;
}
.telon-eq span {
  width: 6px;
  background: linear-gradient(180deg, #e21a30, #8a0a1d);
  border-radius: 3px 3px 0 0;
  animation: eq 1.1s ease-in-out infinite;
}
.telon-eq span:nth-child(1) { height: 40%; animation-delay: 0s; }
.telon-eq span:nth-child(2) { height: 80%; animation-delay: 0.15s; }
.telon-eq span:nth-child(3) { height: 55%; animation-delay: 0.3s; }
.telon-eq span:nth-child(4) { height: 90%; animation-delay: 0.45s; }
.telon-eq span:nth-child(5) { height: 65%; animation-delay: 0.6s; }
.telon-eq span:nth-child(6) { height: 35%; animation-delay: 0.75s; }
.telon-eq span:nth-child(7) { height: 70%; animation-delay: 0.9s; }

@keyframes eq {
  0%, 100% { transform: scaleY(0.4); }
  50% { transform: scaleY(1); }
}

/* --- Estados de apertura --- */
.telon.abriendo .telon-cortina--izq { transform: translateX(-101%); }
.telon.abriendo .telon-cortina--der { transform: translateX(101%); }
.telon.abriendo { background: transparent; transition: background 0.3s 1.2s; }

.telon.cerrado { opacity: 0; pointer-events: none; }
.telon.cerrado { transition: opacity 0.5s ease; }

/* Botón saltar */
.telon-saltar {
  position: absolute;
  right: var(--sp-6);
  bottom: var(--sp-6);
  z-index: 6;
  color: rgba(245,240,232,0.6);
  font-size: var(--fs-small);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  background: rgba(0,0,0,0.4);
  border: 1px solid rgba(245,240,232,0.25);
  padding: var(--sp-2) var(--sp-4);
  border-radius: var(--radio);
  cursor: pointer;
  transition: color 0.2s ease, border-color 0.2s ease;
}
.telon-saltar:hover { color: var(--blanco-escenico); border-color: var(--rojo-rosa); }

/* --- Reduced motion: telón ya abierto --- */
@media (prefers-reduced-motion: reduce) {
  .telon { display: none; }
}
