/* MDP · Hero · scroll-driven LOGO BUILD over frame stack
 * Antes: 6 frases tipográficas. Ahora: el logo "cinturón" del brand book
 * se CONSTRUYE pieza a pieza mientras avanza el video de fondo.
 *
 * Stages controlados por hero-sequence.js:
 *   1 · 0-15%   · vacío (solo frames + grain)
 *   2 · 15-50%  · letras M D P entran staggered
 *   3 · 50-72%  · banda horizontal se dibuja
 *   4 · 72-90%  · descriptor fadeIn entre las hairlines
 *   5 · 90-100% · settled · scroll cue
 */

@import url("./tokens.css");
@import url("./logo.css");

.act-hero {
  position: relative;
  height: 480vh;
  background: var(--carbon);
  color: var(--paper-on-dark);
  overflow: clip;
}

.hero-stage {
  position: sticky;
  top: 0;
  height: 100vh;
  width: 100%;
  overflow: hidden;
  padding: 28px var(--pad-x);
}

/* ============ FRAMES STACK · 4K video-fake ============ */
.hero-frames-stack {
  position: absolute;
  inset: 0;
  z-index: 0;
  pointer-events: none;
}
.hero-frame {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  opacity: 0;
  transform: translateZ(0);
  will-change: opacity;
}
.hero-frame.is-active { opacity: 1; }

/* ============ OVERLAYS · grade + vignette + veil + grain ============ */
.hero-grade {
  position: absolute;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  background:
    linear-gradient(180deg,
      rgba(96, 142, 174, 0.06) 0%,
      rgba(0, 0, 0, 0) 35%,
      rgba(0, 0, 0, 0) 65%,
      rgba(180, 117, 74, 0.05) 100%);
}
.hero-vignette-cinema {
  position: absolute;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  background:
    radial-gradient(ellipse 100% 90% at 50% 50%,
      rgba(0, 0, 0, 0) 50%,
      rgba(0, 0, 0, 0.45) 100%);
}
.hero-backdrop-veil {
  position: absolute;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  background:
    linear-gradient(180deg,
      rgba(10, 10, 10, 0.30) 0%,
      rgba(10, 10, 10, 0.10) 25%,
      rgba(10, 10, 10, 0.20) 50%,
      rgba(10, 10, 10, 0.70) 78%,
      rgba(10, 10, 10, 0.88) 100%);
}
.hero-grain {
  position: absolute;
  inset: 0;
  z-index: 2;
  pointer-events: none;
  opacity: var(--grain);
  mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='200' height='200'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/><feColorMatrix values='0 0 0 0 0  0 0 0 0 0  0 0 0 0 0  0 0 0 0.55 0'/></filter><rect width='200' height='200' filter='url(%23n)'/></svg>");
  background-size: 200px 200px;
}

/* ============ TOP eyebrow row ============ */
.hero-top {
  position: relative;
  z-index: 10;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: var(--tr-mono);
  text-transform: uppercase;
  color: var(--dim-on-dark);
  padding: 24px 0;
  border-bottom: 1px solid var(--hair-on-dark);
}
.hero-top .left { display: inline-flex; align-items: center; gap: 12px; }
.hero-top .left .dot {
  width: 6px; height: 6px; border-radius: 50%;
  background: var(--cantera);
  animation: pulse 1.6s ease-in-out infinite;
}
@keyframes pulse {
  0%, 100% { opacity: 0.5; transform: scale(0.85); }
  50%      { opacity: 1; transform: scale(1.0); }
}

/* ============ CENTER · stage para el logo cinturón ============
   Full-bleed centrado matemático: el wrapper ocupa 100% del viewport,
   y centra el logo (con width intrinsic) horizontalmente. */
.hero-center {
  position: absolute;
  top: 50%;
  left: 0;
  right: 0;
  transform: translateY(-50%);
  z-index: 10;
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  pointer-events: none;
}
.hero-center > * { pointer-events: auto; }

/* logo cinturón hero · banda GLASS BLUR cinematográfico, deja pasar el render */
.hero-center .mdp-logo {
  --logo-size: clamp(120px, 18vw, 280px);
  --logo-fg: var(--paper-on-dark);
  --logo-bg: transparent;
  --logo-hair: rgba(255, 255, 255, 0.55);
  filter: drop-shadow(0 12px 48px rgba(0, 0, 0, 0.55));
  /* width: auto · intrinsic content size del MDP. NO forzar 100%. */
}
/* GLASS BAND · backdrop-filter blur + tint sutil para legibilidad del descriptor */
.hero-center .mdp-logo .mdp-band {
  background: rgba(10, 10, 10, 0.18);        /* tinte sutil carbón */
  backdrop-filter: blur(14px) saturate(1.05);
  -webkit-backdrop-filter: blur(14px) saturate(1.05);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.10),
    inset 0 -1px 0 rgba(0, 0, 0, 0.18);
}
/* descriptor sobre el glass · text-shadow leve para crispness */
.hero-center .mdp-logo .mdp-descriptor {
  text-shadow:
    0 1px 4px rgba(0, 0, 0, 0.65),
    0 1px 2px rgba(0, 0, 0, 0.45);
  font-weight: 900;
}
/* letras MDP grandes · text-shadow para definirse sobre cualquier cielo */
.hero-center .mdp-logo .mdp-letters {
  text-shadow:
    0 4px 24px rgba(0, 0, 0, 0.55),
    0 2px 8px rgba(0, 0, 0, 0.35);
}
/* fallback · browsers sin backdrop-filter (Firefox <103) usan tinte más opaco */
@supports not ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
  .hero-center .mdp-logo .mdp-band {
    background: rgba(10, 10, 10, 0.55);
  }
}

/* ============ BOTTOM ============ */
.hero-bottom {
  position: absolute;
  bottom: 28px;
  left: var(--pad-x);
  right: var(--pad-x);
  z-index: 10;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: var(--tr-mono);
  text-transform: uppercase;
  color: var(--dim-on-dark);
  padding-top: 18px;
  border-top: 1px solid var(--hair-on-dark);
  flex-wrap: wrap;
  gap: 16px;
}
.hero-bottom .pos {
  color: var(--paper-on-dark);
  font-weight: 500;
  font-variant-numeric: tabular-nums;
}
.hero-bottom .pos .total { color: var(--dim-on-dark); }

.hero-scroll-cue {
  position: absolute;
  bottom: 90px; left: 50%;
  transform: translateX(-50%);
  z-index: 11;
  font-family: var(--mono);
  font-size: 9px;
  letter-spacing: 0.4em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.42);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  opacity: 0;
  transition: opacity 600ms var(--ease-out-expo) 1500ms;
  pointer-events: none;
}
.hero-stage.is-ready .hero-scroll-cue { opacity: 1; }
.hero-stage.scroll-started .hero-scroll-cue { opacity: 0; }
.hero-scroll-cue .line {
  width: 1px; height: 28px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.45), transparent);
}

@media (max-width: 767px) {
  .act-hero { height: 280vh; }
  .hero-stage { padding: 18px var(--pad-x); }

  .hero-center .mdp-logo {
    --logo-size: clamp(112px, 32vw, 220px);
    --logo-band-h: calc(var(--logo-size) * 0.22);
    --logo-band-w: 145%;
  }
  .hero-center .mdp-logo .mdp-descriptor {
    font-size: calc(var(--logo-size) * 0.085);
    letter-spacing: 0.38em;
    text-indent: 0.38em;
    font-weight: 800;
  }
  .hero-top, .hero-bottom { font-size: 9px; letter-spacing: 0.24em; padding: 14px 0; }
  .hero-bottom { flex-direction: column; align-items: flex-start; gap: 6px; }
  .hero-scroll-cue { bottom: 64px; }
}
