/* Iberica Visual - PELICULA DE ANIMACION
   Senales integradas de los 5 agentes:
   - Luna (narrativa): copy + loading + actos
   - Vega (design): paleta, tokens, tipografia
   - Nova (coreografia): timeline de animaciones
   - Diego (estructura): actos como bloques semanticos
   - Tess (QA): accesibilidad, reduced motion
*/

/* ============================================ */
/* LOADING SCREEN (ACTO 0)                     */
/* ============================================ */
#loading-screen {
  position: fixed;
  inset: 0;
  background: #000;
  z-index: 100000;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  font-family: 'Inter', sans-serif;
  color: #fff;
  transition: opacity 0.8s ease, visibility 0.8s;
}
#loading-screen.fade-out {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}
.loading-particles {
  position: absolute;
  inset: 0;
  background-image:
    radial-gradient(2px 2px at 20% 30%, #00E5FF, transparent),
    radial-gradient(1.5px 1.5px at 60% 70%, #FF00E5, transparent),
    radial-gradient(2px 2px at 80% 20%, #FFE600, transparent),
    radial-gradient(1.5px 1.5px at 40% 80%, #00E5FF, transparent),
    radial-gradient(2px 2px at 90% 50%, #FF00E5, transparent);
  animation: loading-particles-move 8s linear infinite;
}
@keyframes loading-particles-move {
  from { transform: translateY(0); }
  to { transform: translateY(-100px); }
}
.loading-title {
  font-size: 3.5rem;
  font-weight: 800;
  letter-spacing: 6px;
  margin: 0;
  background: linear-gradient(90deg, #00E5FF, #FF00E5, #FFE600, #00E5FF);
  background-size: 300% 100%;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  animation: loading-gradient 3s linear infinite;
  position: relative;
  z-index: 2;
  text-align: center;
}
@keyframes loading-gradient {
  0% { background-position: 0% 50%; }
  100% { background-position: 300% 50%; }
}
.loading-subtitle {
  font-size: 1rem;
  margin-top: 1rem;
  color: rgba(255,255,255,0.7);
  letter-spacing: 2px;
  position: relative;
  z-index: 2;
}
.loading-progress {
  width: 300px;
  height: 3px;
  margin-top: 2rem;
  appearance: none;
  -webkit-appearance: none;
  border: none;
  position: relative;
  z-index: 2;
}
.loading-progress::-webkit-progress-bar {
  background: rgba(255,255,255,0.1);
  border-radius: 2px;
}
.loading-progress::-webkit-progress-value {
  background: linear-gradient(90deg, #00E5FF, #FF00E5, #FFE600);
  border-radius: 2px;
  box-shadow: 0 0 10px #00E5FF;
  transition: width 0.3s ease;
}
.loading-progress::-moz-progress-bar {
  background: linear-gradient(90deg, #00E5FF, #FF00E5, #FFE600);
}
.loading-message {
  margin-top: 1rem;
  font-size: 0.85rem;
  color: #00E5FF;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  min-height: 1.2em;
  position: relative;
  z-index: 2;
  text-shadow: 0 0 10px #00E5FF;
}

/* ============================================ */
/* TIMELINE NAV (indicador de actos)           */
/* ============================================ */
.timeline-nav {
  position: fixed;
  right: 24px;
  top: 50%;
  transform: translateY(-50%);
  z-index: 9998;
  display: flex;
  flex-direction: column;
  gap: 18px;
  opacity: 0;
  transition: opacity 0.6s 3.5s; /* aparece tras el loading */
}
body.loaded .timeline-nav { opacity: 1; }
.timeline-dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: rgba(255,255,255,0.2);
  border: 1px solid rgba(0, 229, 255, 0.3);
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.22, 1, 0.36, 1);
  position: relative;
}
.timeline-dot:hover {
  background: #00E5FF;
  transform: scale(1.4);
  box-shadow: 0 0 12px #00E5FF;
}
.timeline-dot.active {
  background: #FF00E5;
  border-color: #FF00E5;
  box-shadow: 0 0 16px #FF00E5;
  transform: scale(1.3);
}
.timeline-dot::before {
  content: attr(data-label);
  position: absolute;
  right: 20px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 0.7rem;
  letter-spacing: 2px;
  color: rgba(255,255,255,0.6);
  text-transform: uppercase;
  white-space: nowrap;
  opacity: 0;
  transition: opacity 0.3s;
  pointer-events: none;
}
.timeline-dot:hover::before { opacity: 1; }
.timeline-dot.active::before {
  color: #FF00E5;
  opacity: 1;
  text-shadow: 0 0 8px rgba(255, 0, 229, 0.6);
}

/* Progress bar vertical (linea de tiempo) */
.timeline-rail {
  position: absolute;
  left: 5px;
  top: 0;
  bottom: 0;
  width: 1px;
  background: rgba(255,255,255,0.1);
  z-index: -1;
}
.timeline-rail-fill {
  position: absolute;
  left: 0;
  top: 0;
  width: 100%;
  background: linear-gradient(180deg, #00E5FF, #FF00E5, #FFE600);
  box-shadow: 0 0 6px rgba(0, 229, 255, 0.6);
  height: 0;
  transition: height 0.3s ease-out;
}

/* ============================================ */
/* ACTOS (separacion visual entre secciones)   */
/* ============================================ */
section[id^="acto-"] {
  position: relative;
  opacity: 0;
  transform: translateY(40px);
  transition: opacity 0.8s ease, transform 0.8s ease;
}
section[id^="acto-"].acto-visible {
  opacity: 1;
  transform: translateY(0);
}

/* Acto titles (de Luna) */
.acto-label {
  position: absolute;
  top: 30px;
  left: 50%;
  transform: translateX(-50%);
  font-size: 0.7rem;
  letter-spacing: 4px;
  color: rgba(0, 229, 255, 0.6);
  text-transform: uppercase;
  font-weight: 600;
}

/* Cinematic titles (de Luna) */
.cinematic-title {
  font-size: 3.5rem;
  font-weight: 800;
  letter-spacing: 3px;
  text-transform: uppercase;
  background: linear-gradient(90deg, #00E5FF, #FF00E5);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  margin-bottom: 1rem;
  line-height: 1.1;
}
.cinematic-subtitle {
  font-size: 1.1rem;
  color: rgba(255,255,255,0.7);
  margin-bottom: 2rem;
  font-style: italic;
}

/* ============================================ */
/* CULMINATION (acto final - contacto)         */
/* ============================================ */
.culmination {
  text-align: center;
  padding: 5rem 0;
}
.culmination h2 {
  font-size: 2.5rem;
  font-weight: 800;
  letter-spacing: 3px;
  background: linear-gradient(90deg, #FFE600, #FF00E5, #00E5FF);
  background-size: 200% 100%;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  animation: culmination-shine 4s linear infinite;
  margin-bottom: 1.5rem;
}
@keyframes culmination-shine {
  0% { background-position: 0% 50%; }
  100% { background-position: 200% 50%; }
}

/* ============================================ */
/* SKIP LINK (accesibilidad de Tess)           */
/* ============================================ */
.skip-link {
  position: absolute;
  top: -100px;
  left: 0;
  background: #00E5FF;
  color: #000;
  padding: 12px 20px;
  font-weight: 700;
  z-index: 100001;
  text-decoration: none;
  letter-spacing: 1px;
}
.skip-link:focus {
  top: 0;
}

/* ============================================ */
/* REDUCED MOTION (Tess QA)                    */
/* ============================================ */
@media (prefers-reduced-motion: reduce) {
  #loading-screen { transition: none; }
  .loading-particles, .loading-title, .cinematic-title, .culmination h2 {
    animation: none !important;
  }
  section[id^="acto-"] { opacity: 1 !important; transform: none !important; }
  .timeline-nav { transition: none !important; opacity: 1 !important; }
}

/* ============================================ */
/* RESPONSIVE (Tess QA)                        */
/* ============================================ */
@media (max-width: 768px) {
  .loading-title { font-size: 2rem; letter-spacing: 4px; }
  .cinematic-title { font-size: 2.2rem; }
  .timeline-nav { right: 12px; gap: 12px; }
  .timeline-dot { width: 10px; height: 10px; }
  .timeline-dot::before { display: none; }
}
