/* Home — video difuminado + ventisca / hielo (solo .page-home) */

.hero__video-wrap {
  position: absolute;
  inset: 0;
  z-index: 0;
  overflow: hidden;
  opacity: 0;
  transition: opacity 1.6s var(--ease-lich, cubic-bezier(0.22, 0.61, 0.36, 1));
  pointer-events: none;
}

.hero--ambient-ready .hero__video-wrap {
  opacity: 1;
}

.hero__video,
.hero__video--poster {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 108%;
  height: 108%;
  transform: translate(-50%, -50%);
  object-fit: cover;
  object-position: 8% top;
  filter: brightness(0.72);
  opacity: 0.62;
}

/* Premium: reglas propias en hero-premium.css — no heredar el centrado viejo */
.hero--premium .hero__video,
.hero--premium .hero__video--poster {
  top: 0;
  left: 50%;
  width: 100%;
  height: 100%;
  transform: translateX(-50%);
  object-position: 32% top;
  filter: brightness(0.74) saturate(0.95) contrast(1.05);
  opacity: 0;
}

.hero__video-scrim {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(180deg, rgba(4, 10, 22, 0.42) 0%, rgba(6, 14, 28, 0.16) 46%, rgba(4, 8, 16, 0.44) 100%),
    radial-gradient(ellipse 88% 70% at 36% 42%, transparent 12%, rgba(4, 8, 16, 0.32) 100%),
    linear-gradient(90deg, rgba(4, 8, 16, 0.18) 0%, transparent 58%, rgba(4, 8, 16, 0.28) 100%);
  mix-blend-mode: normal;
  pointer-events: none;
}

/* Con video activo: capas de hielo más suaves para dejar ver el fondo */
.page-home .hero--has-video .ambient-glow--tl {
  opacity: 0.18;
}

.page-home .hero--has-video .ambient-glow--br {
  opacity: 0.12;
}

.page-home .hero--has-video .frost-veil {
  opacity: 0.38;
}

.page-home .hero--has-video .ice-drift {
  opacity: 0.3;
}

.page-home .hero--has-video .hero__bg-layer--ice {
  opacity: 0.28;
}

.page-home .hero--has-video .hero__bg-layer--aurora {
  opacity: 0.18;
}

.page-home .hero--has-video .hero__bg-layer--frost {
  opacity: 0.22;
}

.page-home .hero--has-video .hero__rune {
  opacity: 0.08;
}

.page-home .hero--has-video .hero__fog {
  height: 44%;
  background: linear-gradient(to top, rgba(8, 11, 20, 0.78) 0%, rgba(8, 11, 20, 0.18) 62%, transparent 100%);
}

/* ponytail: premium ignora reglas globales del video */
.page-home .hero--premium .hero__video,
.page-home .hero--premium .hero__video--poster,
.page-home .hero--premium .hero__video-poster {
  filter: brightness(0.74) saturate(0.95) contrast(1.05) !important;
  top: 0 !important;
  left: 50% !important;
  width: 118% !important;
  height: 118% !important;
  min-width: 118% !important;
  min-height: 118% !important;
  transform: translateX(-50%) !important;
  transform-origin: 50% 0 !important;
  object-position: 36% 14% !important;
}

.page-home .hero--premium.hero--video-playing .hero__video--leviatan {
  opacity: 1 !important;
}

.page-home .hero--premium .hero__video-wrap {
  opacity: 1 !important;
}

.page-home .hero--premium.hero--has-video .hero__bg-layer--ice,
.page-home .hero--premium.hero--has-video .hero__bg-layer--frost,
.page-home .hero--premium.hero--has-video .hero__frost-ambient {
  display: none !important;
}

.page-home .hero--has-video .hero__frost-ambient {
  opacity: 0.34;
}

.page-home .hero--has-video.hero--ambient-ready .hero__frost-ambient {
  opacity: 0.38;
}

.page-home .hero--has-video .hero__particles--frost {
  opacity: 0.55;
}

.page-home .ambient-glow--tl {
  opacity: 0.34;
  animation: frostBreath 5s ease-in-out infinite alternate;
}

.page-home .ambient-glow--br {
  opacity: 0.22;
  animation: frostBreath 6s ease-in-out infinite alternate-reverse;
}

.page-home .frost-veil {
  background:
    linear-gradient(180deg, rgba(4, 12, 22, 0.48) 0%, transparent 22%, transparent 78%, rgba(4, 8, 16, 0.6) 100%),
    radial-gradient(ellipse 60% 40% at 50% 0%, rgba(76, 201, 240, 0.1), transparent);
}

.page-home .ice-drift {
  opacity: 0.88;
}

.page-home .frost-streak {
  opacity: 0.72;
  animation-duration: 3.2s;
}

.page-home .hero__bg-layer--ice {
  opacity: 0.78;
  animation: heroIcePulse 14s ease-in-out infinite alternate;
}

.page-home .hero__bg-layer--aurora {
  opacity: 0.52;
  animation: auroraShift 12s ease-in-out infinite alternate;
}

.page-home .hero__bg-layer--frost {
  opacity: 0.62;
  animation: heroFrostNoise 10s ease-in-out infinite alternate;
}

.page-home .hero__rune {
  opacity: 0.22;
  border-color: rgba(125, 211, 252, 0.14);
}

.page-home .hero__fog {
  height: 52%;
  background: linear-gradient(to top, rgba(8, 11, 20, 0.94) 0%, rgba(8, 11, 20, 0.38) 55%, transparent 100%);
}

.page-home .hero__bg-layer--vignette {
  background:
    radial-gradient(ellipse at center, transparent 12%, rgba(8, 11, 20, 0.42) 68%, rgba(4, 8, 16, 0.9) 100%);
}

.hero__frost-ambient {
  position: absolute;
  inset: 0;
  z-index: 0;
  overflow: hidden;
  opacity: 0;
  transition: opacity 1.4s var(--ease-lich, cubic-bezier(0.22, 0.61, 0.36, 1));
  pointer-events: none;
}

.hero--ambient-ready .hero__frost-ambient {
  opacity: 1;
}

.hero__frost-canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

.hero__blizzard-gust {
  position: absolute;
  inset: -10% -30%;
  pointer-events: none;
  background: linear-gradient(
    100deg,
    transparent 0%,
    rgba(120, 158, 188, 0.02) 35%,
    rgba(168, 198, 220, 0.08) 50%,
    rgba(120, 158, 188, 0.02) 65%,
    transparent 100%
  );
  mix-blend-mode: soft-light;
  opacity: 0;
}

.hero__blizzard-gust--1 {
  animation: heroBlizzardGust 6s ease-in-out infinite;
}

.hero__blizzard-gust--2 {
  animation: heroBlizzardGust 8s ease-in-out infinite reverse;
  animation-delay: -2.5s;
  transform: skewY(-4deg);
}

.hero__blizzard-gust--3 {
  animation: heroBlizzardGust 7s ease-in-out infinite;
  animation-delay: -3.5s;
  transform: skewY(3deg) scaleY(0.85);
  opacity: 0.6;
}

.hero__snow-veil {
  display: none;
}

.hero__ice-sheen {
  position: absolute;
  inset: -25% -15%;
  background:
    linear-gradient(
      115deg,
      transparent 36%,
      rgba(186, 230, 253, 0.08) 44%,
      rgba(224, 242, 254, 0.18) 50%,
      rgba(186, 230, 253, 0.08) 56%,
      transparent 64%
    );
  animation: heroIceSheen 5s ease-in-out infinite;
  mix-blend-mode: screen;
  contain: strict;
}

.hero__ice-sheen--alt {
  animation: heroIceSheenAlt 7s ease-in-out infinite;
  opacity: 0.65;
  transform: skewX(-12deg);
}

.hero__frost-mist {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse 90% 55% at 15% 85%, rgba(125, 211, 252, 0.14), transparent 62%),
    radial-gradient(ellipse 70% 45% at 85% 25%, rgba(56, 189, 248, 0.1), transparent 58%),
    radial-gradient(ellipse 100% 35% at 50% 100%, rgba(14, 116, 144, 0.16), transparent 72%);
  animation: heroFrostMist 7s ease-in-out infinite alternate;
  contain: style;
}

.hero__particles--frost {
  z-index: 1;
  opacity: 0;
  transition: opacity 1s ease 0.25s;
}

.hero--ambient-ready .hero__particles--frost {
  opacity: 0.95;
}

@keyframes heroIceSheen {
  0%, 100% { transform: translateX(-14%) skewX(-8deg); opacity: 0.4; }
  50% { transform: translateX(14%) skewX(-8deg); opacity: 0.85; }
}

@keyframes heroIceSheenAlt {
  0%, 100% { transform: translateX(10%) skewX(-12deg); opacity: 0.25; }
  50% { transform: translateX(-12%) skewX(-12deg); opacity: 0.55; }
}

@keyframes heroFrostMist {
  0% { opacity: 0.5; transform: scale(1) translateX(0); }
  100% { opacity: 0.85; transform: scale(1.06) translateX(2%); }
}

@keyframes heroFrostNoise {
  0% { opacity: 0.45; transform: scale(1); }
  100% { opacity: 0.75; transform: scale(1.02); }
}

@keyframes heroIcePulse {
  0% { filter: brightness(0.95); }
  100% { filter: brightness(1.08); }
}

@keyframes heroBlizzardGust {
  0% { transform: translateX(-28%) skewY(2deg); opacity: 0; }
  12% { opacity: 0.9; }
  50% { transform: translateX(32%) skewY(2deg); opacity: 0.5; }
  100% { transform: translateX(52%) skewY(2deg); opacity: 0; }
}

@keyframes heroSnowVeil {
  0% { transform: translateX(-6%) translateY(0); }
  100% { transform: translateX(6%) translateY(3%); }
}

@media (max-width: 768px) {
  .page-home .hero--launcher {
    min-height: 100dvh;
  }

  .page-home .hero__rune {
    display: none;
  }

  .hero__video,
  .hero__video--poster {
    top: 50%;
    left: 50%;
    width: 110%;
    height: 110%;
    transform: translate(-50%, -50%);
    object-position: 6% top;
    filter: brightness(0.64);
    opacity: 0.55;
  }

  .hero__particles--frost {
    opacity: 0.72;
  }
}

@media (prefers-reduced-motion: reduce) {
  .hero__video-wrap {
    display: none !important;
  }

  .hero__frost-ambient,
  .hero__particles--frost,
  .hero__ice-sheen,
  .hero__frost-mist,
  .hero__blizzard-gust,
  .page-home .hero__bg-layer--frost,
  .page-home .hero__bg-layer--ice,
  .page-home .hero__bg-layer--aurora,
  .page-home .ambient-glow--tl,
  .page-home .ambient-glow--br {
    animation: none !important;
  }

  .hero__frost-ambient,
  .hero__particles--frost {
    display: none !important;
  }
}

/* ═══════════════════════════════════════════════════════════════
   Mobile — eliminar todo lo que causa parpadeo/repaint
   ponytail: mix-blend-mode:screen en mobile = software compositing
   = GPU thrash = parpadeo. Upgrade path: opacity-only layers.
   ═══════════════════════════════════════════════════════════════ */
@media (max-width: 768px) {
  /* mix-blend-mode: screen fuerza software compositing en mobile
     → eliminar por completo en todos los elementos del hero */
  .hero__blizzard-gust,
  .hero__snow-veil,
  .hero__ice-sheen,
  .hero__ice-sheen--alt {
    mix-blend-mode: normal !important;
  }

  /* Desactivar animaciones CSS costosas — solo dejar opacidad estática */
  .hero__blizzard-gust,
  .hero__blizzard-gust--1,
  .hero__blizzard-gust--2,
  .hero__blizzard-gust--3 {
    animation: none !important;
    opacity: 0 !important;
  }

  .hero__snow-veil {
    animation: none !important;
    will-change: auto !important;
    opacity: 0 !important;
  }

  .hero__ice-sheen,
  .hero__ice-sheen--alt {
    animation: none !important;
    opacity: 0 !important;
  }

  .hero__frost-mist {
    animation: none !important;
    opacity: 0.35;   /* estático, sin repaint */
  }

  /* Canvas nieve: reducir a < 30% opacidad; el JS ya lo corre a 12fps */
  .hero--premium .hero__frost-canvas {
    opacity: 0.48 !important;
    mix-blend-mode: soft-light !important;
  }

  /* Scroll-pause: transición suave vía opacity en lugar de visibility */
  .hero__frost-canvas,
  #hero-particles {
    transition: opacity 0.18s ease !important;
  }

  /* Aurora — sin animación en mobile */
  .page-home .hero__bg-layer--aurora {
    animation: none !important;
    opacity: 0.25 !important;
  }

  /* Frost streaks CSS — innecesarios en mobile */
  .frost-streak {
    display: none !important;
  }

  .page-home .ambient-glow--tl,
  .page-home .ambient-glow--br {
    animation: none !important;
  }

  .page-home .hero__bg-layer--ice,
  .page-home .hero__bg-layer--frost,
  .page-home .hero__bg-layer--aurora {
    animation: none !important;
  }

  .page-home .ice-drift {
    display: none !important;
  }

  .hero--mobile-static .hero__frost-ambient,
  .hero--mobile-static #hero-particles,
  .hero--mobile-static .hero__frost-canvas {
    display: none !important;
  }

  .page-home .hero__live-dot {
    animation: none !important;
  }

  .page-home .live-ticker__track {
    animation: none !important;
    will-change: auto !important;
  }

  .page-home .section__header::after {
    animation: none !important;
  }

  .page-home .hero-promo-card:not(.hero-aside-card) {
    animation: none !important;
  }
}
