/* =============================================
   HERO — Museos San Lorenzo
   ============================================= */

.hero {
  position: relative;
  min-height: 100vh;
  display: flex;
  align-items: flex-end;
  overflow: hidden;
  background: var(--c-black);
}

/* ---- BACKGROUND IMAGE ---- */
.hero__bg {
  position: absolute;
  inset: 0;
  z-index: 0;
}

.hero__bg :is(img, video) {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 30%;
  display: block;
  opacity: 0.75;
}

/* Gradient overlay: dark bottom for legibility */
.hero__bg::after {
  content: '';
  position: absolute;
  inset: 0;
  z-index: 2;            /* arriba del canvas Three.js para preservar el dark-bottom */
  background:
    linear-gradient(to top,
      rgba(10,10,10,0.92) 0%,
      rgba(10,10,10,0.55) 45%,
      rgba(10,10,10,0.10) 100%);
  pointer-events: none;
}

/* Canvas Three.js — fade-in cuando hero-3d.js inicializa
   (clase .hero--3d-active en el <section>). */
.hero__bg-canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
  pointer-events: none;
  z-index: 1;
  opacity: 0;
  transition: opacity 0.8s ease;
}

.hero--3d-active .hero__bg-canvas {
  opacity: 1;
}

/* Cuando 3D está activo: paramos el breathing/entrance de la img
   y la fundimos a 0 (el canvas la reemplaza visualmente). */
.hero--3d-active .hero__bg :is(img, video) {
  animation: none;
  opacity: 0;
  filter: none;
  transform: none;
  transition: opacity 0.8s ease;
}

/* ---- CONTENT ---- */
.hero__content {
  position: relative;
  z-index: 2;
  width: 100%;
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 0 var(--s4) var(--s7);
  display: grid;
  grid-template-columns: 1fr 340px;
  align-items: flex-end;
  gap: var(--s5);
  padding-top: 72px; /* nav height */
}

/* Subo un poco el eyebrow + título: agregando margen abajo del título
   ensancho el contenido total, y con align-items:flex-end del .hero
   ese contenido se anchora al bottom, así el título sube ~3rem. */
.hero .hero__title {
  margin-bottom: var(--s6);  /* 5rem en vez del s4 (2rem) base */
}


.hero__eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--c-white);
  opacity: 0.7;
  margin-bottom: var(--s3);
}

.hero__eyebrow .dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--c-rojo);
  flex-shrink: 0;
  animation: pulse 2s infinite;
}

@keyframes pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50%       { opacity: 0.5; transform: scale(1.3); }
}

.hero__title {
  font-size: clamp(3rem, 7.5vw, 7rem);
  font-weight: 900;
  line-height: 0.95;
  letter-spacing: -0.03em;
  color: var(--c-white);
  margin-bottom: var(--s4);
}

.hero__title .highlight {
  color: var(--c-naranja);
  display: inline;
}

.hero__title .line-azul {
  color: var(--c-azul);
}

.hero__subtitle {
  font-size: 1.0625rem;
  color: rgba(255,255,255,0.65);
  line-height: 1.65;
  font-weight: 300;
  max-width: 520px;
  margin-bottom: var(--s4);
}

.hero__actions {
  display: flex;
  align-items: center;
  gap: var(--s2);
  flex-wrap: wrap;
}

.hero__scroll-hint {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 11px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: rgba(255,255,255,0.4);
  margin-top: var(--s5);
}

.hero__scroll-line {
  width: 50px;
  height: 1px;
  background: linear-gradient(to right, transparent, rgba(255,255,255,0.35));
}

/* ---- RIGHT: MUSEUM LIST ---- */
.hero__right {
  padding-bottom: 4px;
}

.hero__museum-list {
  display: flex;
  flex-direction: column;
  gap: 2px;
  border-left: 2px solid rgba(255,255,255,0.12);
  padding-left: var(--s3);
}

.hero__museum-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 0;
  border-bottom: 1px solid rgba(255,255,255,0.06);
  text-decoration: none;
  transition: padding-left var(--t-base);
  cursor: default;
}

.hero__museum-item:last-child {
  border-bottom: none;
}

.hero__museum-item:hover {
  padding-left: 8px;
}

.hero__museum-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
  transition: transform var(--t-base);
}

.hero__museum-item:hover .hero__museum-dot {
  transform: scale(1.4);
}

.hero__museum-dot--azul    { background: var(--c-azul); }
.hero__museum-dot--rojo    { background: var(--c-rojo); }
.hero__museum-dot--naranja { background: var(--c-naranja); }
.hero__museum-dot--verde   { background: var(--c-verde); }

.hero__museum-name {
  font-size: 13.5px;
  font-weight: 500;
  color: rgba(255,255,255,0.75);
  line-height: 1.3;
  transition: color var(--t-fast);
}

.hero__museum-item:hover .hero__museum-name {
  color: var(--c-white);
}

/* ---- STATS BAR ---- */
.hero__stats {
  position: relative;
  z-index: 3;
  background: var(--c-azul);
  padding: 0;
}

.hero__stats-inner {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 0 var(--s4);
  display: grid;
  grid-template-columns: repeat(4, 1fr);
}

.hero__stat {
  padding: var(--s4) var(--s3);
  border-right: 1px solid rgba(255,255,255,0.15);
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.hero__stat:last-child {
  border-right: none;
}

.hero__stat-num {
  font-size: 2rem;
  font-weight: 800;
  color: var(--c-white);
  line-height: 1;
  letter-spacing: -0.02em;
}

.hero__stat-label {
  font-size: 12px;
  color: rgba(255,255,255,0.65);
  font-weight: 400;
  line-height: 1.4;
}

/* ---- TICKER STRIP ---- */
.hero__ticker {
  position: relative;
  z-index: 3;
  background: var(--c-rojo);
  padding: 10px 0;
  overflow: hidden;
}

.hero__ticker-track {
  display: flex;
  white-space: nowrap;
  animation: ticker 30s linear infinite;
  will-change: transform;
}

.hero__ticker-track:hover {
  animation-play-state: paused;
}

@keyframes ticker {
  from { transform: translateX(0); }
  to   { transform: translateX(-50%); }
}

.hero__ticker-item {
  display: inline-flex;
  align-items: center;
  gap: 24px;
  padding: 0 24px;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--c-white);
}

.hero__ticker-item .sep {
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: rgba(255,255,255,0.5);
  flex-shrink: 0;
}

/* ---- RESPONSIVE ---- */
@media (max-width: 1024px) {
  .hero__content {
    grid-template-columns: 1fr;
    padding-bottom: var(--s6);
  }
  .hero__right {
    display: none;
  }
  .hero__stats-inner {
    grid-template-columns: repeat(2, 1fr);
  }
  .hero__stat:nth-child(2) {
    border-right: none;
  }
  .hero__stat:nth-child(3) {
    border-right: 1px solid rgba(255,255,255,0.15);
  }
}

@media (max-width: 600px) {
  .hero__title {
    font-size: clamp(3rem, 15vw, 5rem);
  }
  .hero__stats-inner {
    grid-template-columns: repeat(2, 1fr);
  }
  .hero__stat { padding: var(--s3) var(--s2); }
  .hero__stat-num { font-size: 1.5rem; }
  .hero__actions { flex-direction: column; align-items: flex-start; }
}

/* =============================================
   ETAPA 1A — HERO CINEMATIC
   Entrance + breathing + mouse parallax + scroll parallax
   + light leak + scroll hint pulse
   ============================================= */

/* @property: habilita interpolación de custom properties en keyframes.
   Sin esto los keyframes saltan en vez de tweening.
   Browsers sin soporte: degradan a "instant appear" (graceful). */
@property --hero-scale   { syntax: '<number>'; inherits: false; initial-value: 1; }
@property --hero-blur    { syntax: '<length>'; inherits: false; initial-value: 0px; }
@property --hero-opacity { syntax: '<number>'; inherits: false; initial-value: 1; }

/* Imagen del collage: transform compuesto que combina
   entrance (scale/blur/opacity), breathing (scale loop),
   mouse parallax (rotateX/Y) y scroll parallax (translateY).
   Cada animación toca su propia custom property → no se pisan. */
.hero__bg :is(img, video) {
  --hero-scale:   1;
  --hero-blur:    0px;
  --hero-opacity: 1;
  --hero-rx:      0deg;
  --hero-ry:      0deg;
  --hero-ty:      0px;

  transform:
    perspective(1200px)
    translate3d(0, var(--hero-ty), 0)
    rotateX(var(--hero-rx))
    rotateY(var(--hero-ry))
    scale(var(--hero-scale));
  filter:  blur(var(--hero-blur));
  opacity: var(--hero-opacity);

  will-change: transform, filter, opacity;
  backface-visibility: hidden;

  animation:
    heroEnter   1.5s var(--ease-out-expo) forwards,
    heroBreathe 8s   ease-in-out          infinite 1.5s;
}

@keyframes heroEnter {
  from { --hero-scale: 1.05; --hero-blur: 20px; --hero-opacity: 0; }
  to   { --hero-scale: 1;    --hero-blur: 0px;  --hero-opacity: 1; }
}

@keyframes heroBreathe {
  0%, 100% { --hero-scale: 1; }
  50%      { --hero-scale: 1.02; }
}

/* Eyebrow: no tenía fade-up, lo animo aparte con CSS puro
   para mantener la cadena del stagger sin tocar HTML. */
.hero__eyebrow {
  opacity: 0;
  transform: translateY(20px);
  animation: heroEyebrowEnter 0.7s var(--ease-out-expo) 0.7s forwards;
}
@keyframes heroEyebrowEnter {
  to { opacity: 1; transform: translateY(0); }
}

/* Override de transition-delay para los .fade-up dentro del hero.
   Específicidad 0,3,0 > la genérica 0,2,0 de variables.css.
   Stagger: 0.85 → 1.05 → 1.25 → 1.45 (post-entrance del collage). */
.hero .fade-up               { transition-delay: 0.85s; }
.hero .fade-up.delay-1       { transition-delay: 1.05s; }
.hero .fade-up.delay-2       { transition-delay: 1.25s; }
.hero .fade-up.delay-3       { transition-delay: 1.45s; }

/* Light leak: pasada de dorado granadero cada 12s.
   Usa el ::before del .hero__bg porque ::after ya está
   ocupado por el gradient oscuro de legibilidad. */
.hero__bg::before {
  content: '';
  position: absolute;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  background: linear-gradient(
    115deg,
    transparent 30%,
    rgba(212, 160, 23, 0.10) 50%,
    transparent 70%
  );
  mix-blend-mode: overlay;
  transform: translateX(-100%);
  animation: heroLightLeak 12s linear infinite;
  will-change: transform, opacity;
}

@keyframes heroLightLeak {
  0%   { transform: translateX(-100%); opacity: 0; }
  20%  { opacity: 0.40; }
  50%  { opacity: 0.55; }
  80%  { opacity: 0.40; }
  100% { transform: translateX(100%);  opacity: 0; }
}

/* Scroll hint: la línea pulsa cada 2.2s. */
.hero__scroll-line {
  transform-origin: left center;
  animation: heroScrollLinePulse 2.2s ease-in-out infinite 1.8s;
}
@keyframes heroScrollLinePulse {
  0%, 100% { opacity: 0.45; transform: scaleX(0.55); }
  50%      { opacity: 1;    transform: scaleX(1); }
}

/* ──────────── REDUCED MOTION ────────────
   Reemplaza todo por fade puro 0.4s. Sin scale, blur,
   parallax, breathing, light leak ni pulse. */
@media (prefers-reduced-motion: reduce) {
  .hero__bg :is(img, video) {
    animation: heroEnterReduced 0.4s ease-out forwards;
    transform: none !important;
    filter:    none !important;
  }
  @keyframes heroEnterReduced {
    from { opacity: 0; }
    to   { opacity: 1; }
  }
  .hero__eyebrow {
    opacity: 1;
    transform: none;
    animation: none;
  }
  .hero__bg::before,
  .hero__scroll-line { animation: none; }
}