/*
  HERO V3 DUAL (?hero=dual) — video izquierdo | franja central tipográfica | video derecho. Se carga junto con hero3.css (reglas del encabezado transparente).
  Los videos ocupan toda la altura útil; el texto vive solo en la franja central (carbón/grafito), nunca sobre los videos. Sin bordes ni tarjetas.
  Con prefers-reduced-motion: sin videos (póster), sin rotación automática y sin animaciones.
*/
.hd {
  --hd-dur: 7000ms; --hd-ease: cubic-bezier(0.22, 1, 0.36, 1); --hd-carbon: #0d0d11;
  position: relative; isolation: isolate; overflow: hidden; color: #fff; background: var(--hd-carbon);
  display: grid; grid-template-columns: minmax(0, 30fr) minmax(0, 40fr) minmax(0, 30fr);
  height: clamp(600px, 100svh, 1000px);
}
/* ---- videos laterales ---- */
.hd-lado { position: relative; overflow: hidden; background: #101015; }
.hd-slide { position: absolute; inset: 0; opacity: 0; transition: opacity 1s var(--hd-ease); }
.hd-slide.activo { opacity: 1; }
.hd-poster, .hd-video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.hd-slide.activo .hd-poster { animation: hd-zoom 10s linear forwards; }
.hd-video { opacity: 0; transition: opacity 1.1s ease; }
.hd-slide.listo .hd-video { opacity: 1; }
@keyframes hd-zoom { from { transform: scale(1.02); } to { transform: scale(1.07); } }
/* velo sutil: oscurece el borde de cada video hacia la franja central y el borde superior (encabezado transparente); los videos siguen siendo protagonistas */
.hd-slide[data-estado="propio"]::after { content: ''; position: absolute; inset: 0; background: rgba(13, 13, 17, 0.44); pointer-events: none; } /* las pantallas claras no deslumbran */
.hd-velo { position: absolute; inset: 0; pointer-events: none; background: linear-gradient(180deg, rgba(13, 13, 17, 0.72) 0%, rgba(13, 13, 17, 0) 24%), linear-gradient(0deg, rgba(13, 13, 17, 0.35) 0%, rgba(13, 13, 17, 0) 30%); }
.hd-izq .hd-velo { background: linear-gradient(180deg, rgba(13, 13, 17, 0.72) 0%, rgba(13, 13, 17, 0) 24%), linear-gradient(90deg, rgba(13, 13, 17, 0) 55%, rgba(13, 13, 17, 0.6) 100%), linear-gradient(0deg, rgba(13, 13, 17, 0.3) 0%, rgba(13, 13, 17, 0) 30%); }
.hd-der .hd-velo { background: linear-gradient(180deg, rgba(13, 13, 17, 0.72) 0%, rgba(13, 13, 17, 0) 24%), linear-gradient(270deg, rgba(13, 13, 17, 0) 55%, rgba(13, 13, 17, 0.6) 100%), linear-gradient(0deg, rgba(13, 13, 17, 0.3) 0%, rgba(13, 13, 17, 0) 30%); }

/* ---- franja central ---- */
.hd-centro { position: relative; z-index: 1; display: flex; container-type: inline-size; background: radial-gradient(80% 50% at 50% 0%, rgba(145, 54, 255, 0.2), transparent 70%), linear-gradient(180deg, #181820, var(--hd-carbon) 75%); }
.hd-in { width: 100%; box-sizing: border-box; display: flex; flex-direction: column; justify-content: space-between; gap: clamp(12px, 2.2svh, 24px); padding: calc(78px + clamp(8px, 2svh, 26px)) clamp(20px, 5cqw, 52px) clamp(16px, 3svh, 32px); }
.hd-h1 { margin: 0; font-family: var(--display); font-size: 0.7rem; font-weight: 800; letter-spacing: 0.16em; text-transform: uppercase; line-height: 1.5; color: rgba(247, 246, 251, 0.82); }
.hd-msgs { position: relative; flex: 1; display: grid; align-content: center; min-height: 0; }
/* las 4 escenas ocupan siempre la misma celda (la más alta fija el alto): al cambiar de escena nada se mueve (CLS ≈ 0); las inactivas solo se ocultan */
.hd-msg { grid-area: 1 / 1; display: flex; visibility: hidden; flex-direction: column; align-items: flex-start; gap: clamp(8px, 1.8svh, 18px); min-width: 0; }
.hd-msg.activo, .hd-msg.saliendo { visibility: visible; }
.hd-msg.saliendo { pointer-events: none; }
.hd-pilar { display: inline-flex; align-items: center; gap: 10px; margin: 0; font-size: 0.76rem; font-weight: 800; letter-spacing: 0.14em; text-transform: uppercase; color: var(--lima); }
.hd-num { display: inline-grid; place-items: center; min-width: 2.4em; padding: 0.28em 0.5em; border: 1px solid rgba(201, 162, 255, 0.55); border-radius: 999px; font-variant-numeric: tabular-nums; }
.hd-titulo { margin: 0; max-width: 100%; font-family: var(--display); font-weight: 800; font-stretch: 78%; font-size: clamp(2.6rem, min(15.4cqw, 10.2svh), 7.4rem); line-height: 0.9; letter-spacing: -0.035em; color: #fff; overflow-wrap: break-word; hyphens: manual; text-wrap: balance; }
.hd-w { display: inline-block; max-width: 100%; overflow: hidden; vertical-align: top; padding-bottom: 0.08em; margin-bottom: -0.08em; }
.hd-w > span { display: inline-block; transform: translateY(108%); will-change: transform; }
.hd-ac > span { background: linear-gradient(100deg, #E3CCFF, #B07CFF 55%, #9136FF); -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent; }
.hd-sub { margin: 0; max-width: 40ch; font-size: clamp(0.98rem, 1.5cqw + 0.5rem, 1.2rem); line-height: 1.45; color: rgba(247, 246, 251, 0.86); }
.hd-mas { display: inline-flex; align-items: center; gap: 8px; font-weight: 800; font-size: 0.88rem; color: #fff; padding-bottom: 3px; border-bottom: 2px solid var(--violeta); transition: gap 0.3s var(--hd-ease), border-color 0.3s; }
.hd-mas:hover { gap: 13px; border-color: var(--lima); }
/* palabras: suben desde una máscara una tras otra; la escena anterior sale hacia arriba. Hasta que la tipografía esté lista no se muestra (sin saltos) */
.hd:not(.hd-lista) .hd-msg.activo { visibility: hidden; animation: hd-mostrar 0.01s 2.6s forwards; }
.hd:not(.hd-lista) .hd-w > span { animation: hd-sube 0.01s 2.6s both; }
@keyframes hd-mostrar { to { visibility: visible; } }
.hd.hd-lista .hd-msg.activo .hd-w > span { animation: hd-sube 0.95s var(--hd-ease) both; animation-delay: calc(var(--i) * 85ms + 120ms); }
.hd.hd-lista .hd-msg.activo .hd-pilar, .hd.hd-lista .hd-msg.activo .hd-sub, .hd.hd-lista .hd-msg.activo .hd-mas { animation: hd-aparece 0.8s var(--hd-ease) both; }
.hd.hd-lista .hd-msg.activo .hd-sub { animation-delay: 520ms; }
.hd.hd-lista .hd-msg.activo .hd-mas { animation-delay: 640ms; }
.hd-msg.saliendo .hd-w > span { animation: hd-baja 0.55s cubic-bezier(0.55, 0, 0.8, 0.4) both; animation-delay: calc(var(--i) * 35ms); }
.hd-msg.saliendo .hd-pilar, .hd-msg.saliendo .hd-sub, .hd-msg.saliendo .hd-mas { animation: hd-sale 0.4s ease both; }
@keyframes hd-sube { from { transform: translateY(108%) rotate(3deg); } to { transform: none; } }
@keyframes hd-baja { from { transform: none; } to { transform: translateY(-108%) rotate(-2deg); } }
@keyframes hd-aparece { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }
@keyframes hd-sale { to { opacity: 0; transform: translateY(-10px); } }

/* ---- botones permanentes y controles ---- */
.hd-acciones { display: flex; flex-wrap: wrap; gap: 10px; }
.hd-acciones .btn { padding: 15px 22px; font-size: 0.9rem; flex: 1 1 auto; text-align: center; }
.hd .btn-violeta { box-shadow: 0 14px 34px -12px rgba(145, 54, 255, 0.75); }
.hd .btn-linea { color: #fff; border-color: rgba(247, 246, 251, 0.55); background: rgba(13, 13, 17, 0.35); }
.hd .btn-linea:hover { color: var(--tinta); border-color: #fff; }
.hd .btn-linea::before { background: #fff; }
.hd-ctrl { display: flex; align-items: center; justify-content: space-between; gap: 14px; padding-top: 12px; border-top: 1px solid rgba(247, 246, 251, 0.14); }
.hd-prog { display: flex; flex: 1; gap: 8px; margin: 0; padding: 0; list-style: none; }
.hd-prog li { flex: 1; min-width: 0; }
.hd-pg { position: relative; display: block; width: 100%; height: 22px; padding: 0; }
.hd-pg i { position: absolute; top: 9px; left: 0; right: 0; height: 3px; border-radius: 3px; background: rgba(247, 246, 251, 0.22); overflow: hidden; }
.hd-pg i::after { content: ''; position: absolute; inset: 0; background: var(--lima); transform: scaleX(0); transform-origin: left; }
.hd-pg.hecho i::after { transform: scaleX(1); }
.hd-pg.activo i::after { animation: hd-llena var(--hd-dur) linear forwards; }
.hd.pausa .hd-pg.activo i::after { animation-play-state: paused; }
.hd.sin-auto .hd-pg.activo i::after { animation: none; transform: scaleX(1); }
@keyframes hd-llena { to { transform: scaleX(1); } }
.hd-botones { display: flex; align-items: center; gap: 6px; }
.hd-cont { margin-right: 6px; font-size: 0.78rem; font-weight: 700; letter-spacing: 0.08em; color: rgba(247, 246, 251, 0.75); font-variant-numeric: tabular-nums; }
.hd-cont b { color: #fff; }
.hd-b { display: grid; place-items: center; width: 42px; height: 42px; border: 1px solid rgba(247, 246, 251, 0.4); border-radius: 50%; background: rgba(13, 13, 17, 0.4); color: #fff; transition: background-color 0.25s, color 0.25s, transform 0.25s var(--hd-ease); }
.hd-b:hover { background: #fff; color: var(--tinta); border-color: #fff; }
.hd-b:active { transform: scale(0.94); }
.hd-b .ic { width: 17px; height: 17px; fill: currentColor; }
.hd-ic-play { display: none; }
.hd.pausa-usuario .hd-ic-pausa { display: none; }
.hd.pausa-usuario .hd-ic-play { display: block; }
.hd :focus-visible { outline: 3px solid var(--lima); outline-offset: 3px; }

/* ---- pantallas medianas: franja central algo más ancha para que la tipografía respire ---- */
@media (max-width: 1100px) { .hd { grid-template-columns: minmax(0, 26fr) minmax(0, 48fr) minmax(0, 26fr); } }

/* ---- móvil (mobile-first): los dos videos ARRIBA, lado a lado y completos (cada uno en su proporción vertical 9:16, sin recorte); el texto va debajo, más pequeño ----
   Rediseño de la Fase 11: más video, menos texto dominante. En 360×640, 390×844 y 430×932 los videos se ven enteros; en tabletas (820×1180) el tope de alto recorta muy poco. */
@media (max-width: 820px) {
  .hd { grid-template-columns: 1fr 1fr; grid-template-rows: auto auto; column-gap: 2px; height: auto; min-height: 0; } /* compacto: la altura del hero es la de su contenido (antes min-height: 100svh + 1fr repartían el sobrante como espacio vacío) */
  .hd-izq { grid-area: 1 / 1; } .hd-der { grid-area: 1 / 2; } .hd-centro { grid-area: 2 / 1 / 3 / 3; }
  /* Fase 11 · corrección de recortes: el 100 % del encuadre de cada video (object-fit: contain, sin zoom). Marcos IGUALES y estables (3:5, igual altura en las 4 escenas);
     el espacio que sobra queda con un fondo discreto de CSS puro (no duplica ni descarga nada). Los clips miden 0,81 / 0,72 (escena 1) y 0,48 (escenas 2 a 4). */
  .hd-lado { width: 100%; aspect-ratio: 3 / 5; max-height: 56svh; background: radial-gradient(120% 70% at 50% 38%, #1d1631 0%, #121218 58%, #0d0d11 100%); }
  .hd-poster, .hd-video { object-fit: contain; object-position: 50% 50%; }
  .hd-slide.activo .hd-poster { animation: none; transform: none; } /* sin zoom: ningún video se amplía */
  /* velo: solo detrás del logo y del botón de menú (arriba) y un fundido suave hacia la zona de texto (abajo); nada oscurece el centro de los videos */
  .hd-izq .hd-velo, .hd-der .hd-velo { background: linear-gradient(0deg, rgba(13, 13, 17, 0.6) 0%, rgba(13, 13, 17, 0) 22%); }
  .hd-lado .hd-velo::before { content: ''; position: absolute; left: 0; right: 0; top: 0; height: 112px; background: linear-gradient(180deg, rgba(13, 13, 17, 0.86) 0%, rgba(13, 13, 17, 0.55) 48%, rgba(13, 13, 17, 0) 100%); }
  .hd-centro { background: linear-gradient(180deg, #14141a, var(--hd-carbon) 60%); }
  /* Fase 11 · espacios: la causa eran .hd-in { justify-content: space-between } y .hd-msgs { flex: 1; align-content: center } (+ min-height 100svh / fila 1fr), que repartían el alto sobrante
     entre videos–etiqueta y descripción–botones. En móvil el contenido se apila desde arriba con separaciones fijas y NO se justifica para llenar la pantalla. */
  .hd-in { position: relative; justify-content: flex-start; gap: 0; padding: 20px 20px 18px; }
  .hd-msgs { flex: none; align-content: start; margin-bottom: 24px; }
  .hd-acciones { margin-bottom: 20px; }
  .hd-msg { gap: 8px; }
  .hd-pilar { font-size: 0.68rem; }
  .hd-titulo { font-size: clamp(1.45rem, 7.2cqw, 2.2rem); line-height: 0.98; letter-spacing: -0.025em; } /* ≈ 26 px en 390: antes 44 px */
  .hd-sub { font-size: 0.9rem; line-height: 1.42; max-width: 36ch; }
  .hd-acciones { flex-wrap: nowrap; gap: 8px; }
  .hd-acciones .btn { flex: 1 1 0; min-width: 0; padding: 14px 10px; font-size: 0.8rem; gap: 7px; }
  .hd-cont, .hd-mas { display: none; }
  /* el h1 sigue en la página (lectores de pantalla y buscadores) pero se oculta visualmente para dar altura a los videos */
  .hd-h1 { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
}
@media (max-width: 820px) and (max-height: 700px) { .hd-lado { max-height: 50svh; } .hd-in { padding-top: 16px; } .hd-msgs { margin-bottom: 20px; } .hd-acciones { margin-bottom: 16px; } .hd-sub { font-size: 0.85rem; line-height: 1.38; } .hd-msg { gap: 6px; } }
@media (max-width: 460px) { .hd-acciones .btn { font-size: 0.76rem; padding: 14px 6px; letter-spacing: 0.04em; } .hd-acciones .btn .ic { display: none; } }
@media (min-width: 560px) and (max-width: 820px) { .hd-lado { max-height: 62svh; } .hd-titulo { font-size: clamp(2rem, 6.2cqw, 3rem); } .hd-sub { font-size: 1.02rem; } .hd-in { padding: 24px 40px 20px; } .hd-msgs { margin-bottom: 28px; } .hd-acciones { margin-bottom: 24px; } }
@media (min-width: 821px) and (max-height: 760px) { .hd-mas { display: none; } .hd-sub { font-size: 0.95rem; } }

/* ---- sin movimiento: póster fijo, sin rotación ni animaciones ---- */
@media (prefers-reduced-motion: reduce) {
  .hd-slide, .hd-video { transition: none; }
  .hd-slide.activo .hd-poster { animation: none; }
  .hd-video { display: none; }
  .hd-w > span { transform: none !important; }
  .hd .hd-msg.activo .hd-w > span, .hd .hd-msg.activo .hd-pilar, .hd .hd-msg.activo .hd-sub, .hd .hd-msg.activo .hd-mas, .hd .hd-msg.saliendo * { animation: none !important; }
  .hd-pg.activo i::after { animation: none; transform: scaleX(1); }
}
@media print { .hd-lado, .hd-ctrl { display: none; } .hd { display: block; height: auto; background: #fff; color: #000; } .hd-centro { background: #fff; } .hd-titulo, .hd-sub { color: #000; } .hd-ac > span { -webkit-text-fill-color: #000; } }
