/* ============================================================
   ECLIPSES 2026 — Animaciones y Transiciones
   GSAP gestiona los scroll triggers; este archivo contiene
   keyframes CSS y estados base para las revelaciones.
   ============================================================ */

/* ── Keyframes ───────────────────────────────────────────────── */
@keyframes ec-bounce {
  0%, 100% { transform: translateX(-50%) translateY(0); }
  50%       { transform: translateX(-50%) translateY(8px); }
}

@keyframes ec-fade-in {
  from { opacity: 0; }
  to   { opacity: 1; }
}

@keyframes ec-rise {
  from { opacity: 0; transform: translateY(32px); }
  to   { opacity: 1; transform: translateY(0); }
}

@keyframes ec-corona-pulse {
  0%, 100% { opacity: 0.4; transform: scale(1); }
  50%       { opacity: 0.7; transform: scale(1.05); }
}

@keyframes ec-orbit {
  from { transform: rotate(0deg) translateX(60px) rotate(0deg); }
  to   { transform: rotate(360deg) translateX(60px) rotate(-360deg); }
}

@keyframes ec-blink {
  0%, 100% { opacity: 1; }
  50%       { opacity: 0; }
}

/* ── Estados GSAP base (precarga) ────────────────────────────── */
.eclipse-reveal {
  opacity: 0;
  transform: translateY(40px);
  /* GSAP anima a opacity:1, translateY:0 */
}

.eclipse-reveal--left {
  opacity: 0;
  transform: translateX(-40px);
}

.eclipse-reveal--right {
  opacity: 0;
  transform: translateX(40px);
}

.eclipse-reveal--scale {
  opacity: 0;
  transform: scale(0.92);
}

.eclipse-reveal--stagger > * {
  opacity: 0;
  transform: translateY(30px);
}

/* Una vez animado por GSAP */
.eclipse-revealed {
  opacity: 1 !important;
  transform: none !important;
}

/* ── Intro de vídeo overlay ──────────────────────────────────── */
#eclipse-intro-overlay {
  position: fixed;
  inset: 0;
  z-index: 99999;
  background: #000;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: default;
  transition: opacity 0.8s var(--ease-eclipse, cubic-bezier(0.22, 0.61, 0.36, 1));
}

#eclipse-intro-overlay.is-fading {
  opacity: 0;
  pointer-events: none;
}

#eclipse-intro-video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

#eclipse-intro-skip {
  position: absolute;
  bottom: 2rem;
  right: 2rem;
  background: transparent;
  border: 1px solid rgba(255,255,255,0.3);
  color: rgba(255,255,255,0.7);
  font-family: 'IBM Plex Mono', monospace;
  font-size: 0.6875rem;
  font-weight: 400;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  padding: 0.625rem 1.25rem;
  cursor: pointer;
  transition: all 0.3s ease;
  z-index: 100000;
}

#eclipse-intro-skip:hover {
  border-color: rgba(198,160,82,0.6);
  color: #C6A052;
  background: rgba(198,160,82,0.05);
}

#eclipse-intro-play-btn {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: rgba(5,7,11,0.6);
  z-index: 99998;
  cursor: pointer;
}

#eclipse-intro-play-btn svg {
  width: 72px;
  height: 72px;
  opacity: 0.8;
  transition: opacity 0.2s, transform 0.2s;
}

#eclipse-intro-play-btn:hover svg {
  opacity: 1;
  transform: scale(1.1);
}

#eclipse-intro-play-btn p {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 0.625rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: rgba(255,255,255,0.5);
  margin-top: 1.5rem;
}

/* ── Corona glow hover sobre imágenes ────────────────────────── */
.eclipse-has-corona-hover {
  position: relative;
}

.eclipse-has-corona-hover::before {
  content: '';
  position: absolute;
  inset: -20%;
  border-radius: 50%;
  background: radial-gradient(ellipse at center, rgba(198,160,82,0.2) 0%, transparent 70%);
  opacity: 0;
  transition: opacity var(--dur-cinema, 900ms) ease;
  pointer-events: none;
  z-index: 0;
}

.eclipse-has-corona-hover:hover::before { opacity: 1; }

/* ── Línea temporal (ScrollTrigger) ──────────────────────────── */
.eclipse-progress-line {
  position: fixed;
  top: 0;
  left: 0;
  height: 2px;
  background: linear-gradient(to right, var(--ec-corona, #C6A052), transparent);
  z-index: 9999;
  width: 0%;
  transition: width 0.1s linear;
  pointer-events: none;
}

/* ── Parallax wrapper (GSAP mueve este elemento) ─────────────── */
.eclipse-parallax {
  will-change: transform;
}

/* ── Animación de texto carácter por carácter (stagger) ──────── */
.eclipse-char {
  display: inline-block;
  opacity: 0;
  transform: translateY(100%);
}

/* ── Tarjeta hover con reflection ────────────────────────────── */
.eclipse-card-tilt {
  transform-style: preserve-3d;
  perspective: 1000px;
  transition: transform 0.1s linear;
}

/* ── Efecto de scan line (decorativo) ────────────────────────── */
.eclipse-scanlines {
  position: absolute;
  inset: 0;
  background-image: repeating-linear-gradient(
    0deg,
    transparent,
    transparent 2px,
    rgba(0,0,0,0.03) 2px,
    rgba(0,0,0,0.03) 4px
  );
  pointer-events: none;
  z-index: 1;
}

/* ── Círculo de corona animado ────────────────────────────────── */
.eclipse-corona-anim {
  animation: ec-corona-pulse 4s ease-in-out infinite;
}

/* ── Link con subrayado corona ───────────────────────────────── */
.eclipse-link-corona {
  text-decoration: none;
  position: relative;
  color: var(--ec-corona, #C6A052);
}

.eclipse-link-corona::after {
  content: '';
  position: absolute;
  bottom: -2px;
  left: 0;
  right: 0;
  height: 1px;
  background: var(--ec-corona, #C6A052);
  transform: scaleX(0);
  transform-origin: right;
  transition: transform 0.3s var(--ease-eclipse, cubic-bezier(0.22, 0.61, 0.36, 1));
}

.eclipse-link-corona:hover::after {
  transform: scaleX(1);
  transform-origin: left;
}

/* ── Carga inicial del body ──────────────────────────────────── */
.eclipse-page-enter {
  animation: ec-fade-in 0.6s ease both;
}

/* ── Mobile: desactivar algunas animaciones pesadas ─────────── */
@media (max-width: 768px) {
  .eclipse-card-tilt { perspective: none; }
  .eclipse-parallax  { will-change: auto; }
}

/* ── Preferencia de movimiento reducido ──────────────────────── */
@media (prefers-reduced-motion: reduce) {
  .eclipse-corona-anim { animation: none; }
  .eclipse-reveal,
  .eclipse-reveal--left,
  .eclipse-reveal--right,
  .eclipse-reveal--scale,
  .eclipse-reveal--stagger > * {
    opacity: 1 !important;
    transform: none !important;
  }
  #eclipse-intro-overlay { transition: none; }
}
