/* #hero — medio a sangre, texto centrado. Sin video queda el SVG de arcos. */
#hero {
  display: grid; place-items: center;
  min-height: 100vh; min-height: 100svh;
  padding: calc(var(--nav-h) + 16px) 0 48px;
  overflow: hidden; overflow: clip;
  background: var(--marfil);
}
#hero .hero__marco {
  position: absolute; inset: 0;
  overflow: hidden;
  background: var(--marfil-2);
  transform-origin: 50% 42%;
  box-shadow: 0 0 0 1px var(--hilo);
  will-change: transform;
}
#hero .hero__capa { position: absolute; inset: 0; will-change: transform; }
#hero .hero__arcos,
#hero .hero__video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }

#hero.hero--video .hero__arcos { display: none; }

/* Velo marfil: garantiza AA del texto sobre cualquier cuadro del video */
#hero .hero__velo {
  position: absolute; inset: 0;
  background:
    radial-gradient(62% 56% at 50% 46%, rgba(252, 251, 248, .94) 0, rgba(252, 251, 248, .86) 46%, rgba(252, 251, 248, 0) 100%),
    linear-gradient(180deg, rgba(252, 251, 248, .72) 0, rgba(252, 251, 248, 0) 26%);
}

/* El viajero recorre el riel central */
#hero .hero__viajero {
  stroke-dasharray: .12 1;
  stroke-dashoffset: .12;
  animation: hero-viaje 5.4s cubic-bezier(.45, 0, .2, 1) infinite;
}
@keyframes hero-viaje {
  0% { stroke-dashoffset: .12; opacity: 0; }
  12% { opacity: 1; }
  78% { opacity: 1; }
  100% { stroke-dashoffset: -1; opacity: 0; }
}
@media (prefers-reduced-motion: reduce) {
  #hero .hero__viajero { animation: none; opacity: 0; }
}

#hero .hero__texto {
  position: relative; z-index: 2;
  display: flex; flex-direction: column; align-items: center;
  text-align: center;
}
#hero .hero__ceja { margin-bottom: clamp(16px, 2.6vh, 28px); }
#hero .hero__ceja::before { display: none; }
#hero .titular--display { font-size: min(var(--t-display), 16.5vh); }
#hero .titular .linea { padding-inline: .08em; margin-inline: -.08em; }
#hero .hero__lead { max-width: 26em; margin-top: clamp(20px, 3.2vh, 32px); text-wrap: balance; }
#hero .hero__alcance {
  max-width: 34em; margin: clamp(10px, 1.6vh, 16px) 0 0;
  font-size: var(--t-desc, 1.0625rem); line-height: var(--lh-desc, 1.47); color: var(--texto-2); text-wrap: balance;
}
#hero .hero__ctas {
  display: flex; flex-wrap: wrap; justify-content: center; gap: 12px;
  margin-top: clamp(24px, 4vh, 40px);
}
#hero .boton--sec { background: rgba(255, 254, 251, .7); }

@media (max-width: 899px) {
  /* El poster es el fondo desde el primer pintado: nunca se pasa por marfil ni por los
     arcos SVG. Si no carga, hero.js pone .hero--sin-poster y vuelven los arcos. */
  #hero {
    place-items: start center;
    padding-top: calc(var(--nav-h) + clamp(32px, 10.4vh, 88px));
    background: var(--marfil-2) url("../../assets/img/hero-poster-movil.webp") 62% 50% / cover no-repeat;
  }
  #hero.hero--montado { background-image: none; }
  #hero .hero__capa { background: url("../../assets/img/hero-poster-movil.webp") 62% 50% / cover no-repeat; }
  #hero .hero__arcos { visibility: hidden; }
  #hero.hero--sin-poster { background-image: none; }
  #hero.hero--sin-poster .hero__capa { background: none; }
  #hero.hero--sin-poster .hero__arcos { visibility: visible; }
  #hero .hero__video { object-position: 62% 50%; }
  /* Misma curva de tono que hero-poster-movil.webp: pasar del poster al video no se nota */
  #hero.hero--video .hero__video { filter: brightness(.828) contrast(1.6); }
  #hero .hero__velo {
    background:
      radial-gradient(96% 40% at 50% 37%, rgba(252, 251, 248, .94) 0, rgba(252, 251, 248, .88) 62%, rgba(252, 251, 248, 0) 100%),
      linear-gradient(180deg, rgba(252, 251, 248, .72) 0, rgba(252, 251, 248, 0) 26%);
  }
  #hero .titular--display { font-size: min(var(--t-display), calc((100vw - 32px) / 7.2)); }
  #hero .hero__ctas { width: 100%; max-width: 340px; flex-direction: column; }
  #hero .hero__ctas .boton { width: 100%; }
}

/* Pantallas muy bajas (móvil apaisado): titular contenido y ambos CTA en fila */
@media (max-height: 480px) {
  #hero { padding-block: calc(var(--nav-h) + 4px) 16px; }
  #hero .hero__ceja { display: none; }
  #hero .titular--display { font-size: min(var(--t-display), 14vh); }
  #hero .hero__lead { max-width: none; margin-top: 8px; }
  #hero .hero__alcance { max-width: none; margin-top: 4px; }
  #hero .hero__ctas { width: auto; max-width: none; flex-direction: row; flex-wrap: nowrap; margin-top: 12px; }
  #hero .hero__ctas .boton { width: auto; }
}
