/***********************************************************/
/* EXPERIENCIA MUSICAL INTERACTIVA                         */
/***********************************************************/
/*
    Versión........: 06.16 (Espaciadores reales en carrusel)
    Fecha..........: 2026-06-24
    Descripción....: Hoja de estilos principal de la experiencia visual interactiva de Alicexora.
    Funcionalidades:
     - Hoja de estilos con variables de capas normalizadas y diseño base.
     - Fondo principal declarado desde CSS.
     - CSS como fuente única de valores visuales principales.
     - Barra superior transparente en la escena inicial.
     - Oscurecimiento progresivo de la barra superior durante la evaporación.
     - Barra inferior desplegable tras finalizar la escena inicial.
     - Primera sección de fase 2 con carrusel horizontal de canciones.
     - Footer con altura fija.
     - Viewport útil de fase 2 calculado entre navegación superior y footer.
     - Transform inicial del personaje conservado comentado por seguridad histórica.
     - Línea inferior animada en la barra superior, expandida desde el centro hacia ambos lados.
     - Lower-navbar transparente con glow violeta aplicado a sus enlaces y opción inicial activa.
     - Halo luminoso trasero ampliado en los enlaces de la lower-navbar para cubrir todo el texto.
     - Refuerzo del halo luminoso en enlaces inactivos de la lower-navbar.
     - Halos activo e inactivos igualados en tamaño, opacidad, blur y posición, sin efecto hover.
     - Carátulas reales ajustadas al tamaño de tarjeta del carrusel mediante object-fit.
     - Tarjeta central del carrusel destacada visualmente y tarjetas laterales desplazadas sin usar hover.
     - Espaciadores reales al inicio y final del carrusel para permitir centrar primera y última tarjeta.
*/

:root {
  /* Variables de Capas */
  --z-idx-fondo: 500;
  --z-idx-person: 1000;
  --z-idx-atmosf: 2000;
  --z-idx-fase-dos: 3000;
  --z-idx-footer: 4000;
  --z-idx-navbar: 6000;

  /* Variables de Diseño */
  --imagen-central-ancho: 55vh;
  --niebla-altura: 25vh;
  --niebla-opacidad: 0.8;
  --evaporar-duration: 2s;

  /* Variables de Navegación */
  --top-navbar-altura: 40px;
  --lower-navbar-altura: 32px;
  --navbar-despliegue-duration: 450ms;
  --navbar-linea-duration: 360ms;
  --navbar-linea-delay: 0ms;
  --navbar-lower-delay: 260ms;
  --navbar-linea-ancho: min(65vw, 1140px);

  /* Variables de Glow */
  --glow-violeta-activo: rgba(120, 75, 255, 0.95);
  --glow-violeta-suave: rgba(120, 75, 255, 0.42);
  --glow-negro-legibilidad: rgba(0, 0, 0, 0.95);

  /* Variables de Footer */
  --footer-altura: 30px;

  /* Variables de Carrusel */
  --song-card-width: 220px;
  --song-card-height: 250px;
  --song-cover-size: 200px;
  --song-carousel-gap: 32px;
  --song-card-active-scale: 1.15;
  --song-card-active-offset: 26px;
  --song-card-focus-duration: 450ms;
  --song-carousel-side-space: 0px;
}

/* 1. RESET Y BASE - Control de scroll y suavizado de fuentes */
html, body {
  margin: 0;
  padding: 0;
  overflow: hidden;
  height: 100%;
  background: black;
  -webkit-font-smoothing: antialiased;
}

/* 2. NAVEGACIÓN SUPERIOR - Barra principal y barra desplegable */
.site-navbar {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: calc(var(--top-navbar-altura) + var(--lower-navbar-altura));
  z-index: var(--z-idx-navbar);
  pointer-events: none;
}

.top-navbar {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: var(--top-navbar-altura);
  box-sizing: border-box;
  padding: 5px 0;
  background-color: rgba(0, 0, 0, 0);
  z-index: 2;
  pointer-events: auto;
  transition: background-color var(--evaporar-duration) ease-in-out;
}

.top-navbar::after {
  content: "";
  position: absolute;
  left: 50%;
  bottom: 0;
  width: var(--navbar-linea-ancho);
  height: 1px;
  pointer-events: none;
  background: linear-gradient(
    90deg,
    transparent 0%,
    rgba(95, 130, 255, 0.25) 14%,
    rgba(120, 75, 255, 0.65) 32%,
    rgba(255, 255, 255, 1) 50%,
    rgba(120, 75, 255, 0.65) 68%,
    rgba(95, 130, 255, 0.25) 86%,
    transparent 100%
  );
  box-shadow:
    0 1px 5px rgba(120, 75, 255, 0.55),
    0 2px 12px rgba(95, 130, 255, 0.28);
  transform: translateX(-50%) scaleX(0);
  transform-origin: center center;
  opacity: 0;
}

.escena-transicion .top-navbar,
.escena-secundaria .top-navbar {
  background-color: rgba(0, 0, 0, 1);
}

.escena-secundaria .top-navbar::after {
  animation: lineaNavbarExpandir var(--navbar-linea-duration) ease-out var(--navbar-linea-delay) forwards;
}

@keyframes lineaNavbarExpandir {
  0% {
    opacity: 0;
    transform: translateX(-50%) scaleX(0);
  }

  20% {
    opacity: 1;
  }

  100% {
    opacity: 1;
    transform: translateX(-50%) scaleX(1);
  }
}

.top-navbar h1 {
  margin: 0;
  height: 30px;
  line-height: 30px;
  font-family: Arial, sans-serif;
  font-size: 30px;
  color: white;
  text-align: center;
  letter-spacing: 4px;
  text-transform: uppercase;
  opacity: 0.8;
}

.lower-navbar {
  position: absolute;
  top: var(--top-navbar-altura);
  left: 0;
  width: 100%;
  height: var(--lower-navbar-altura);
  box-sizing: border-box;
  padding: 3px 0;
  background: transparent;
  backdrop-filter: none;
  z-index: 1;
  pointer-events: none;
  visibility: hidden;
  transform: translateY(calc(-1 * var(--lower-navbar-altura)));
  transition:
    transform var(--navbar-despliegue-duration) ease-out,
    visibility 0s linear var(--navbar-despliegue-duration);
}

.escena-secundaria .lower-navbar {
  visibility: visible;
  pointer-events: auto;
  transform: translateY(0);
  transition:
    transform var(--navbar-despliegue-duration) ease-out var(--navbar-lower-delay),
    visibility 0s linear var(--navbar-lower-delay);
}

.lower-navbar {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: clamp(12px, 15vw, 60px);
  white-space: nowrap;
  overflow: visible;
}

.lower-navbar-link {
  position: relative;
  z-index: 0;
  isolation: isolate;
  display: inline-block;
  margin: 0;
  padding: 0 4px;
  height: 26px;
  line-height: 26px;
  font-family: Arial, sans-serif;
  font-size: 13px;
  color: rgba(255, 255, 255, 0.82);
  text-decoration: none;
  text-transform: uppercase;
  letter-spacing: 1.2px;
  white-space: nowrap;
  text-shadow:
    0 1px 2px var(--glow-negro-legibilidad),
    0 0 5px var(--glow-negro-legibilidad),
    0 0 8px var(--glow-violeta-suave);
  transition: none;
}

/* Halo inactivo: rojo */
.lower-navbar-link::after {
  content: "";
  position: absolute;
  left: 50%;
  bottom: -2px;
  width: calc(100% + 40px);
  height: 30px;
  z-index: -1;
  pointer-events: none;
  background: radial-gradient(
    ellipse at center,
    rgba(255, 0, 0, 0.78) 0%,
    rgba(255, 0, 0, 0.36) 44%,
    transparent 76%
  );
  transform: translateX(-50%) scaleX(1);
  opacity: 0.92;
  filter: blur(9px);
  transition: none;
}

/* Halo activo inicial: violeta */
.lower-navbar-link:first-child {
  text-shadow:
    0 1px 2px var(--glow-negro-legibilidad),
    0 0 6px var(--glow-negro-legibilidad),
    0 0 8px var(--glow-violeta-activo),
    0 0 16px rgba(120, 75, 255, 0.62);
}

.lower-navbar-link:first-child::after {
  background: radial-gradient(
    ellipse at center,
    rgba(120, 75, 255, 0.78) 0%,
    rgba(120, 75, 255, 0.36) 44%,
    transparent 76%
  );
}

/* 3. ESCENARIO (FONDO) - Imagen principal preparada para parallax */
#fondo {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background-image: url("../img/backgrounds/alicexora-stage-background.webp");
  background-size: cover;
  background-position: center center;
  z-index: var(--z-idx-fondo);
  will-change: transform;
}

/* 4. CONTENEDOR PRINCIPAL - Área de visualización del personaje */
.container {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  display: flex;
  align-items: flex-end;
  justify-content: flex-start;
  pointer-events: none;
  z-index: var(--z-idx-person);
}

/* 5. ENVOLTORIO IMAGEN - Contenedor relativo del personaje */
.imgWrapper {
  position: relative;
  display: inline-block;
}

/* 6. PERSONAJE - Definición visual y estado inicial invisible */
.miImagen {
  position: absolute;
  bottom: 0;
  left: 0;

  /*
    Línea conservada por seguridad histórica.
    Si el posicionamiento del personaje falla tras esta limpieza,
    se puede descomentar para recuperar el comportamiento anterior.
  */
  /* transform: translateX(-50%); */

  width: var(--imagen-central-ancho);
  display: block;
  cursor: pointer;
  pointer-events: auto;
  will-change: transform, opacity, filter;
  opacity: 0;
  filter: blur(20px);

  -webkit-tap-highlight-color: transparent;
  -webkit-touch-callout: none;
  -webkit-user-select: none;
  -moz-user-select: none;
  -ms-user-select: none;
  user-select: none;
}

/* 7. ANIMACIONES SIMÉTRICAS - Control de visibilidad progresiva */
.aparecer {
  animation: materializar 3s forwards ease-out;
}

@keyframes materializar {
  0% {
    opacity: 0;
    filter: blur(20px);
  }

  100% {
    opacity: 1;
    filter: blur(0px);
  }
}

.evaporar {
  animation: desmaterializar var(--evaporar-duration) forwards ease-in;
}

@keyframes desmaterializar {
  0% {
    opacity: 1;
    filter: blur(0px);
  }

  100% {
    opacity: 0;
    filter: blur(20px);
  }
}

/* 8. ATMÓSFERA - Graduación de niebla inferior */
.niebla-basica {
  position: fixed;
  bottom: 0;
  left: 0;
  width: 100%;
  height: var(--niebla-altura);
  background: linear-gradient(
    0deg,
    rgba(255,255,255,var(--niebla-opacidad)) 0%,
    rgba(255,255,255,calc(var(--niebla-opacidad) * 0.3)) 60%,
    transparent 100%
  );
  filter: blur(8px);
  pointer-events: none;
  z-index: var(--z-idx-atmosf);
  will-change: opacity;
}

.niebla-evaporar {
  animation: nieblaDesaparecer var(--evaporar-duration) forwards ease-in;
}

@keyframes nieblaDesaparecer {
  0% {
    opacity: 1;
    filter: blur(8px);
  }

  100% {
    opacity: 0;
    filter: blur(20px);
  }
}

/* 9. FASE 2 - Contenido musical */
.fase-dos-contenido {
  position: fixed;
  top: calc(var(--top-navbar-altura) + var(--lower-navbar-altura));
  bottom: var(--footer-altura);
  left: 0;
  width: 100%;
  height: auto;
  z-index: var(--z-idx-fase-dos);
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition:
    opacity 600ms ease,
    visibility 0s linear 600ms;
}

.escena-secundaria .fase-dos-contenido {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  transition:
    opacity 600ms ease 180ms,
    visibility 0s linear 0s;
}

.songs-section {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
}

.song-carousel {
  position: relative;
  width: 100%;
  max-width: 760px;
  height: 310px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.song-carousel-viewport {
  width: 100%;
  overflow-x: auto;
  overflow-y: hidden;
  scroll-behavior: smooth;
  scroll-snap-type: x mandatory;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
}

.song-carousel-viewport::-webkit-scrollbar {
  display: none;
}

.song-carousel-track {
  display: flex;
  align-items: center;
  gap: var(--song-carousel-gap);
  width: max-content;
  min-width: 100%;
  padding: 30px 0;
  box-sizing: border-box;
}

.song-carousel-track::before,
.song-carousel-track::after {
  content: "";
  flex: 0 0 var(--song-carousel-side-space);
  width: var(--song-carousel-side-space);
  height: 1px;
  pointer-events: none;
}

.song-card {
  position: relative;
  z-index: 1;
  flex: 0 0 var(--song-card-width);
  width: var(--song-card-width);
  height: var(--song-card-height);
  box-sizing: border-box;
  padding: 10px;
  background: transparent;
  border-radius: 16px;
  box-shadow:
    0 18px 45px rgba(0, 0, 0, 0.55),
    0 4px 10px rgba(0, 0, 0, 0.35);
  scroll-snap-align: center;
  user-select: none;
  transform: translateX(0) scale(1);
  transform-origin: center center;
  transition:
    transform var(--song-card-focus-duration) ease,
    box-shadow var(--song-card-focus-duration) ease;
  will-change: transform;
}

.song-card-before-active {
  transform: translateX(calc(-1 * var(--song-card-active-offset))) scale(1);
}

.song-card-after-active {
  transform: translateX(var(--song-card-active-offset)) scale(1);
}

.song-card-active {
  z-index: 3;
  transform: translateX(0) scale(var(--song-card-active-scale));
  box-shadow:
    0 26px 65px rgba(0, 0, 0, 0.68),
    0 8px 22px rgba(0, 0, 0, 0.48);
}

.song-cover-image {
  width: var(--song-cover-size);
  height: var(--song-cover-size);
  display: block;
  object-fit: cover;
  object-position: center center;
  border: 0;
}

.song-title {
  margin: 8px 0 0 0;
  width: 100%;
  height: 22px;
  line-height: 22px;
  font-family: Arial, sans-serif;
  font-size: 14px;
  font-weight: 700;
  color: black;
  text-align: center;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.carousel-arrow {
  position: absolute;
  top: 50%;
  width: 44px;
  height: 44px;
  border: none;
  border-radius: 50%;
  background: white;
  color: black;
  font-size: 34px;
  line-height: 40px;
  text-align: center;
  cursor: pointer;
  z-index: 4;
  transform: translateY(-50%);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.45);
  transition:
    transform 180ms ease,
    opacity 180ms ease,
    visibility 0s linear 0s;
}

.carousel-arrow-hidden {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.carousel-arrow:hover,
.carousel-arrow:focus {
  transform: translateY(-50%) scale(1.06);
}

.carousel-arrow-left {
  left: 8px;
}

.carousel-arrow-right {
  right: 8px;
}

/* 10. FOOTER - Barra de créditos y enlaces legales */
.footer-fixed {
  position: fixed;
  bottom: 0;
  left: 0;
  width: 100%;
  height: var(--footer-altura);
  box-sizing: border-box;
  background: rgba(0, 0, 0, 0.8);
  color: #ccc;
  font-size: 11px;
  line-height: 20px;
  text-align: center;
  padding: 5px 0;
  z-index: var(--z-idx-footer);
  font-family: Arial, sans-serif;
  backdrop-filter: blur(5px);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.footer-fixed a {
  color: #aaa;
  text-decoration: none;
  margin: 0 10px;
  white-space: nowrap;
}