/* ================================================================
   HERO VIDEO — Estilos específicos para hero con video de fondo
   Video oscurecido con overlays, texto superpuesto y efectos premium
   ================================================================ */

/* --- Hero base con video --- */
.hero {
  position: relative;
  min-height: 100vh;
  padding-top: var(--header-h);
  display: flex;
  align-items: center;
  overflow: hidden;
  background: var(--ink-0);
}

/* --- Video de fondo con ajustes de rendimiento --- */
.hero-video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  opacity: 0.65;
  z-index: 0;
  will-change: transform;
  -webkit-backface-visibility: hidden;
  backface-visibility: hidden;
}

/* Animación de fade-in suave al cargar la página */
@keyframes heroVideoFadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 0.65;
  }
}

.hero-video {
  animation: heroVideoFadeIn 1.2s ease-out forwards;
}

/* --- Overlay principal para oscurecer y crear atmósfera --- */
.hero-overlay {
  position: absolute;
  inset: 0;
  z-index: 1;
  background:
    /* Efecto spotlight desde arriba */
    radial-gradient(
      ellipse 120% 100% at 50% 0%,
      rgba(0, 0, 0, 0.1) 0%,
      rgba(0, 0, 0, 0.3) 40%,
      transparent 70%
    ),
    /* Gradiente principal de oscurecimiento */
    linear-gradient(
      180deg,
      rgba(13, 13, 13, 0.35) 0%,     /* Superior más transparente para el hero */
      rgba(13, 13, 13, 0.60) 50%,    /* Centro con transparencia moderada */
      rgba(13, 13, 13, 0.85) 100%    /* Inferior oscuro para contraste */
    ),
    /* Gradiente lateral sutil para dirección visual */
    linear-gradient(
      90deg,
      rgba(13, 13, 13, 0.20) 0%,
      transparent 30%,
      transparent 70%,
      rgba(13, 13, 13, 0.15) 100%
    );
  pointer-events: none;
  will-change: opacity;
}

/* --- Vignette para profundidad y foco visual --- */
.hero-vignette {
  position: absolute;
  inset: 0;
  z-index: 1;
  background:
    /* Vignette radial */
    radial-gradient(
      ellipse at 50% 40%,
      transparent 0%,
      rgba(0, 0, 0, 0.15) 30%,
      rgba(0, 0, 0, 0.45) 100%
    ),
    /* Grano/ruido sutil para textura realista */
    repeating-linear-gradient(
      0deg,
      rgba(0, 0, 0, 0.02) 0px,
      transparent 1px,
      transparent 2px,
      rgba(0, 0, 0, 0.02) 3px
    );
  pointer-events: none;
  mix-blend-mode: multiply;
}

/* --- Canvas con efecto laser (refuerza profundidad) --- */
.hero-canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  opacity: 0.3;
  pointer-events: none;
  z-index: 1;
  will-change: opacity;
}

/* --- Contenedor de contenido del hero --- */
.hero-inner {
  position: relative;
  z-index: 10;
  padding-block: var(--sp-2xl) var(--sp-xl);
  display: flex;
  flex-direction: column;
  justify-content: center;
  max-width: 900px;
}

/* --- Eyebrow con animación de entrada --- */
.hero .eyebrow {
  animation: slideInLeft 0.8s var(--ease-out) forwards;
  opacity: 0;
  animation-delay: 0.1s;
  background: transparent;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
  box-shadow: none;
  border: none;
  display: inline-flex;
  width: fit-content;
}

@keyframes slideInLeft {
  from {
    opacity: 0;
    transform: translateX(-20px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

/* --- Título del hero: grande, prominente, con énfasis en rojo --- */
.hero-title {
  margin-top: var(--sp-md);
  font-size: clamp(2.6rem, 7vw, 5.6rem);
  max-width: 16ch;
  line-height: 1.08;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--text-hi);
  text-shadow:
    /* Sombra profunda para legibilidad */
    0 4px 20px rgba(0, 0, 0, 0.6),
    /* Glow sutil rojo para dramatismo */
    0 0 30px rgba(230, 57, 70, 0.1);
}

/* Palabras de énfasis en rojo */
.hero-title .snap-accent {
  color: var(--laser);
  text-shadow:
    0 4px 20px rgba(0, 0, 0, 0.6),
    0 0 20px rgba(230, 57, 70, 0.25);
}

/* --- Lede (descripción) del hero --- */
.hero-lede {
  margin-top: var(--sp-md);
  max-width: 46ch;
  font-size: clamp(1.02rem, 1.4vw, 1.2rem);
  line-height: 1.5;
  color: var(--text-md);
  text-shadow:
    0 2px 10px rgba(0, 0, 0, 0.5);
  animation: fadeInUp 0.8s var(--ease-out) forwards;
  opacity: 0;
  animation-delay: 0.3s;
}

@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(15px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* --- Botones de acción del hero --- */
.hero-actions {
  margin-top: var(--sp-lg);
  display: flex;
  flex-wrap: wrap;
  gap: var(--sp-sm);
  animation: fadeInUp 0.8s var(--ease-out) forwards;
  opacity: 0;
  animation-delay: 0.5s;
}

.hero-actions .btn {
  box-shadow:
    0 12px 32px rgba(0, 0, 0, 0.4),
    0 0 20px rgba(230, 57, 70, 0.15);
  letter-spacing: 0.2px;
  transition:
    transform var(--dur-fast) var(--ease-out),
    box-shadow var(--dur-fast) var(--ease-out),
    background var(--dur-fast) var(--ease-out);
}

.hero-actions .btn:hover {
  transform: translateY(-4px);
  box-shadow:
    0 16px 40px rgba(0, 0, 0, 0.5),
    0 0 30px rgba(230, 57, 70, 0.25);
}

.hero-actions .btn-ghost {
  border-color: rgba(191, 196, 201, 0.3);
  color: var(--text-hi);
}

.hero-actions .btn-ghost:hover {
  border-color: var(--laser);
  color: var(--laser);
  background: rgba(230, 57, 70, 0.1);
  box-shadow:
    0 0 0 1px rgba(230, 57, 70, 0.3),
    0 0 20px rgba(230, 57, 70, 0.2);
}

/* --- Scroll hint (indicador de scroll) --- */
.scroll-hint {
  position: absolute;
  left: 50%;
  bottom: var(--sp-lg);
  transform: translateX(-50%);
  z-index: 10;
  width: 26px;
  height: 42px;
  border: 1.5px solid var(--line-2);
  border-radius: 99px;
  animation: fadeInDown 0.8s var(--ease-out) forwards;
  opacity: 0;
  animation-delay: 0.8s;
}

@keyframes fadeInDown {
  from {
    opacity: 0;
    transform: translateX(-50%) translateY(-10px);
  }
  to {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
  }
}

.scroll-hint span {
  position: absolute;
  top: 8px;
  left: 50%;
  width: 4px;
  height: 8px;
  margin-left: -2px;
  border-radius: 99px;
  background: var(--laser);
  animation: scrollDot 1.8s var(--ease-out) infinite;
  box-shadow: 0 0 8px rgba(230, 57, 70, 0.5);
}

/* --- Efecto de parallax suave en video (mobile-safe) --- */
@media (min-width: 1024px) and (prefers-reduced-motion: no-preference) {
  .hero-video {
    animation: parallaxShift 20s ease-in-out infinite;
  }

  @keyframes parallaxShift {
    0%, 100% {
      transform: scale(1) translateZ(0);
    }
    50% {
      transform: scale(1.05) translateZ(0);
    }
  }
}

/* --- Estados y variaciones --- */

/* Hero cuando se ha hecho scroll */
.site-header.is-scrolled ~ main .hero {
  /* Mantener estilos consistentes */
}

/* --- Responsive: Tablet --- */
@media (max-width: 960px) {
  .hero {
    min-height: 90vh;
  }

  .hero-title {
    font-size: clamp(2.2rem, 6vw, 4.5rem);
  }

  .hero-lede {
    font-size: clamp(0.95rem, 1.2vw, 1.1rem);
  }

  .scroll-hint {
    display: none; /* Ocultar en tablets y móviles */
  }
}

/* --- Responsive: Mobile --- */
@media (max-width: 640px) {
  .hero {
    min-height: 85vh;
    padding-top: var(--header-h);
  }

  .hero-overlay {
    background:
      radial-gradient(
        ellipse 120% 100% at 50% 0%,
        rgba(0, 0, 0, 0.15) 0%,
        rgba(0, 0, 0, 0.4) 50%,
        transparent 80%
      ),
      linear-gradient(
        180deg,
        rgba(13, 13, 13, 0.45) 0%,
        rgba(13, 13, 13, 0.70) 100%
      );
  }

  .hero-video {
    opacity: 0.5; /* Más oscuro en móvil para mejor legibilidad */
  }

  .hero-inner {
    padding-block: var(--sp-xl) var(--sp-lg);
  }

  .hero-title {
    font-size: clamp(1.8rem, 5vw, 3.2rem);
    max-width: none;
  }

  .hero-lede {
    font-size: clamp(0.92rem, 1.1vw, 1.02rem);
    max-width: 35ch;
  }

  .hero-actions {
    flex-direction: column;
    width: 100%;
  }

  .hero-actions .btn {
    width: 100%;
  }

  .scroll-hint {
    display: none;
  }

  /* Animaciones más simples en móvil */
  @media (prefers-reduced-motion: reduce) {
    .hero-video,
    .hero .eyebrow,
    .hero-lede,
    .hero-actions,
    .scroll-hint {
      animation: none !important;
      opacity: 1;
      transform: none !important;
    }
  }
}

/* --- Prefers reduced motion --- */
@media (prefers-reduced-motion: reduce) {
  .hero-video,
  .hero .eyebrow,
  .hero-lede,
  .hero-actions,
  .scroll-hint {
    animation: none !important;
    opacity: 1;
    transform: none !important;
  }

  .scroll-hint span {
    animation: none !important;
  }
}

/* --- Dark mode (ya es dark mode por defecto, pero reforzamos) --- */
@media (prefers-color-scheme: dark) {
  .hero {
    background: var(--ink-0);
  }

  .hero-title {
    color: var(--text-hi);
  }

  .hero-lede {
    color: var(--text-md);
  }
}
