/* Hero póster: TOBDEV gigante detrás, figura recortada delante, copy a la izquierda.
   --hp (0..1) lo maneja hero.js con el scroll de la intro; --mx/--my es el parallax del mouse. */

/* ---------- hero ---------- */
.hero{--hp:0;--mx:0;--my:0;
  position:relative;height:100vh;height:100svh;min-height:600px;overflow:hidden;isolation:isolate;
  background:linear-gradient(to bottom,rgba(10,14,26,0) 0%,rgba(10,14,26,.35) 10%,rgba(10,14,26,.7) 20%,rgba(10,14,26,.92) 32%,var(--bg) 46%)}

/* progreso de cada capa a partir de --hp (lineal) y su versión suavizada (smoothstep) */
.hero__word, .hero__figure, .hero__glow, .reveal{
  --e:calc(var(--t)*var(--t)*(3 - 2*var(--t)))}

/* glow detrás de la figura */
.hero__glow{--t:clamp(0,(var(--hp) - .3)/.45,1);
  position:absolute;z-index:0;left:68.5%;bottom:-18vh;width:min(110vh,1100px);aspect-ratio:1;
  transform:translateX(-50%) translate(calc(var(--mx)*6px),calc(var(--my)*4px));
  background:radial-gradient(closest-side,rgba(91,111,228,.26),rgba(43,74,138,.18) 45%,rgba(18,42,77,.08) 68%,rgba(10,14,26,0));
  opacity:var(--e);pointer-events:none}

/* palabra gigante: cruza por detrás de la figura a la altura de hombros/pecho.
   --wy = posición vertical (top) y --ws = tamaño; se ajustan por breakpoint. */
.hero__word{--t:1;--wy:27%;--ws:26vw;
  position:absolute;z-index:1;left:50%;top:var(--wy);
  transform:translateX(-50%) translate(calc(var(--mx)*-16px),calc(var(--my)*-8px));
  font-family:var(--display);font-weight:900;font-size:var(--ws);line-height:.78;letter-spacing:-.055em;
  white-space:nowrap;user-select:none;pointer-events:none}
.hero__word .wl{display:inline-block;overflow:hidden;vertical-align:bottom;padding:.14em .02em .04em;margin-top:-.14em}
.hero__word .ch{--t:clamp(0,(var(--hp) - .26 - var(--i)*.035)/.28,1);
  --e:calc(var(--t)*var(--t)*(3 - 2*var(--t)));
  display:inline-block;transform:translateY(calc((1 - var(--e))*108%));
  background:linear-gradient(180deg,#2A5193 0%,#1C3D73 48%,#132B54 100%);
  -webkit-background-clip:text;background-clip:text;color:transparent;
  -webkit-text-stroke:1px rgba(140,160,240,.30)}

/* velo detrás del copy: baja el contraste de las letras solo en esa zona */
.hero__scrim{position:absolute;z-index:1;left:0;top:0;bottom:0;width:62%;pointer-events:none;
  background:radial-gradient(70% 62% at 32% 50%,rgba(10,14,26,.82),rgba(10,14,26,.6) 55%,rgba(10,14,26,0) 100%)}

/* figura */
.hero__figure{--t:clamp(0,(var(--hp) - .34)/.34,1);
  position:absolute;z-index:2;left:68.5%;bottom:0;height:min(84%,960px);
  transform:translateX(-50%) translate(calc(var(--mx)*10px),calc(var(--my)*5px + (1 - var(--e))*48px));
  opacity:var(--e)}
.hero__figure picture,.hero__figure img{height:100%;width:auto;max-width:none}
.hero__figure img{filter:contrast(1.06) saturate(.9) brightness(.97)}
/* grading frío solo sobre la silueta (máscara = el mismo recorte) */
.hero__figure::after{content:"";position:absolute;inset:0;pointer-events:none;
  background:linear-gradient(180deg,rgba(91,111,228,.22),rgba(18,42,77,.45) 70%,rgba(10,14,26,.6));
  mix-blend-mode:soft-light;
  -webkit-mask:url(../img/tob-800.webp) center / 100% 100% no-repeat;mask:url(../img/tob-800.webp) center / 100% 100% no-repeat}

/* sombra de contacto + fundido inferior (oculta el corte de la foto) */
.hero__floor{position:absolute;z-index:3;left:0;right:0;bottom:0;height:34%;pointer-events:none;
  background:linear-gradient(to top,var(--bg) 0%,rgba(10,14,26,.92) 14%,rgba(10,14,26,.55) 42%,rgba(10,14,26,0) 100%)}
.hero__floor::before{content:"";position:absolute;left:68.5%;bottom:2%;width:min(70vh,680px);height:90px;
  transform:translateX(-50%);border-radius:50%;
  background:radial-gradient(closest-side,rgba(4,6,12,.85),rgba(4,6,12,0))}

/* copy */
.hero__copy{position:absolute;z-index:4;left:var(--pad-x);top:calc(50% + 20px);transform:translateY(-54%);
  width:min(600px,44vw)}
.reveal{--t:clamp(0,(var(--hp) - .32 - var(--i)*.03)/.22,1);
  opacity:var(--e);transform:translateY(calc((1 - var(--e))*22px))}
.hero__copy .eyebrow{margin-bottom:clamp(14px,2.4vh,22px)}
.hero__title{text-wrap:balance;font-size:clamp(34px,min(4.3vw,7.4vh),70px);font-weight:800;letter-spacing:-.025em;line-height:1.04}
.hero__lead{margin-top:clamp(14px,2.6vh,24px);max-width:31em;font-size:clamp(15px,1.25vw,18px);line-height:1.55;color:var(--text-soft)}
.hero__ctas{margin-top:clamp(20px,3.6vh,34px);display:flex;flex-wrap:wrap;gap:12px}
.hero__meta{margin-top:clamp(18px,3.2vh,30px);display:flex;flex-wrap:wrap;gap:8px 22px;align-items:center}
.status{display:inline-flex;align-items:center;gap:10px;color:var(--text-soft)}
.status__dot{position:relative;width:8px;height:8px;border-radius:50%;background:var(--ok);box-shadow:0 0 10px rgba(33,208,122,.6)}
.status__dot::after{content:"";position:absolute;inset:0;border-radius:50%;border:1px solid var(--ok);
  animation:pulse 2.2s var(--ease) infinite}
@keyframes pulse{0%{transform:scale(1);opacity:.9}80%,100%{transform:scale(3.2);opacity:0}}

/* ---------- tablet ---------- */
@media (max-width:1100px){
  .hero__copy{width:min(480px,44vw)}
  .hero__title{font-size:clamp(34px,4.4vw,48px)}
  .hero__figure{left:76%;height:min(78%,900px)}
  .hero__glow,.hero__floor::before{left:76%}
  .hero__word{--wy:33%;--ws:25vw;margin-left:-3vw}
}

/* escenario de la figura: sin caja fuera de móvil (los hijos se posicionan contra .hero, como siempre) */
.hero__stage{display:contents}

/* ---------- móvil ----------
   El hero pasa a columna: arriba el copy en el flujo, abajo el escenario (figura + palabra) con lo que
   sobre de alto. Como son dos cajas una debajo de la otra, el texto y la palabra no se pueden pisar
   aunque cambie la fuente o el h1 parta en más líneas: si no entra, el hero crece en vez de encimarse. */
@media (max-width:720px){
  .hero{height:auto;min-height:max(640px,100vh);min-height:max(640px,100svh);display:flex;flex-direction:column}
  .hero__copy{position:relative;order:-1;left:auto;top:auto;transform:none;width:auto;
    padding:76px var(--pad-x) 0}
  .hero__copy .eyebrow{margin-bottom:14px;font-size:11px}
  .hero__title{font-size:clamp(27px,7.7vw,38px)}
  .hero__lead{margin-top:12px;font-size:14px;line-height:1.5}
  .hero__ctas{margin-top:18px;gap:10px}
  .hero__ctas .btn{height:46px;padding:0 16px;font-size:14px}
  .hero__meta{display:none}
  .hero__stage{display:block;position:relative;flex:1 0 auto;min-height:clamp(300px,46vh,520px);margin-top:12px}
  .hero__figure{left:50%;height:min(94%,112vw)}
  .hero__glow{left:50%;width:120vw;bottom:-14vh}
  .hero__floor{height:20%}
  .hero__floor::before{left:50%;width:90vw}
  /* la palabra en una línea, más ancha que la figura, a la altura de la cintura (mitad inferior del escenario):
     la figura tapa el centro y se leen los extremos, como en desktop */
  .hero__word{--ws:22.5vw;top:auto;bottom:11%;margin-left:0;line-height:.8;text-align:center}
  .hero__scrim{display:none}
  /* capas propias para lo que entra animado mientras corre la dispersión: el recorte con filter, máscara y
     soft-light se rasteriza una vez y después solo se mueve/funde en el compositor (sin repintar por frame) */
  .hero__figure,.hero__glow{will-change:transform,opacity}
  .hero__word .ch,.hero__copy .reveal{will-change:transform,opacity}
}

/* ---------- desktop: la palabra baja a la zona pecho-cintura (ronda 4) ---------- */
@media (min-width:1101px){
  .hero__word{--wy:56%;--ws:22vw}
  /* el velo acompaña: cubre más la zona de la bajada y los botones, que ahora tienen letras detrás */
  .hero__scrim{width:66%;
    background:radial-gradient(72% 60% at 30% 64%,rgba(10,14,26,.92),rgba(10,14,26,.72) 55%,rgba(10,14,26,0) 100%)}
}

/* reduced motion: todo en su lugar, sin parallax */
@media (prefers-reduced-motion: reduce){
  .hero{--hp:1 !important;--mx:0 !important;--my:0 !important}
}
