/* 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 {
  position: absolute;
  top: 0;
  left: -2%;
  width: 128%;
  height: 115%;
  object-fit: cover;
  object-position: 8% top;
  transform: scale(1.14) translateX(3%);
  transform-origin: left top;
  filter: blur(5px) saturate(0.8) brightness(0.7) contrast(1.1);
  opacity: 0.7;
  will-change: transform;
}

.hero__video-scrim {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(180deg, rgba(4, 10, 22, 0.34) 0%, rgba(6, 14, 28, 0.1) 46%, rgba(4, 8, 16, 0.36) 100%),
    radial-gradient(ellipse 88% 70% at 36% 42%, transparent 18%, rgba(4, 8, 16, 0.22) 100%),
    linear-gradient(90deg, rgba(4, 8, 16, 0.12) 0%, transparent 58%, rgba(4, 8, 16, 0.22) 100%);
  mix-blend-mode: multiply;
  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%);
}

.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 10s ease-in-out infinite alternate;
}

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

.page-home .hero__bg-layer--frost {
  opacity: 0.62;
  animation: heroFrostNoise 6s 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(186, 230, 253, 0.03) 35%,
    rgba(224, 242, 254, 0.12) 50%,
    rgba(186, 230, 253, 0.03) 65%,
    transparent 100%
  );
  mix-blend-mode: screen;
  opacity: 0;
}

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

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

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

.hero__snow-veil {
  position: absolute;
  inset: 0;
  background:
    repeating-linear-gradient(
      112deg,
      transparent 0,
      transparent 42px,
      rgba(224, 242, 254, 0.025) 42px,
      rgba(224, 242, 254, 0.05) 48px,
      transparent 54px
    );
  animation: heroSnowVeil 6s linear infinite;
  mix-blend-mode: screen;
  opacity: 0.7;
}

.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 3.2s ease-in-out infinite;
  mix-blend-mode: screen;
}

.hero__ice-sheen--alt {
  animation: heroIceSheenAlt 4.8s 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 4.5s ease-in-out infinite alternate;
}

.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 {
    top: 0;
    left: 0;
    width: 130%;
    height: 110%;
    object-position: 6% top;
    transform: scale(1.16) translateX(4%);
    transform-origin: left top;
    filter: blur(4px) saturate(0.76) brightness(0.66) contrast(1.08);
    opacity: 0.6;
  }

  .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;
  }
}
