/* ============================================================
   HERO «Del caos a la marca» (v6 · 2026-11)
   Puntos que se ensamblan en el logo de besual. El lienzo lo dibuja
   /assets/js/hero-brand.js; sin JS o con movimiento reducido se ve el SVG.
   ============================================================ */
.bx {
  --bx-pink: #ee2a7b;               /* color del logo oficial */
  position: relative;
  background: var(--dark, #0a0a0a);   /* 2026-12-03: sin resplandor rosa detrás del logo (regla anti-diseño IA 11) */
}
.bx-pin {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  min-height: 100svh;
  display: grid;
  grid-template-rows: 1fr auto;
  gap: clamp(24px, 4vh, 48px);
  padding: 104px clamp(16px, 5vw, 72px) clamp(28px, 5vh, 56px);
}

.bx-slot { position: relative; }

.bx-canvas {
  position: absolute;
  inset: 0;
  z-index: -1;
  width: 100%;
  height: 100%;
  pointer-events: none;
}

/* ---------- El logo ---------- */
.bx-stage {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 18px;
  min-height: 0;
}
.bx-slot { width: min(100%, 1120px); }
.bx-logo { display: block; width: 100%; height: auto; color: var(--bx-pink); }

/* Con el lienzo activo, el SVG queda como «molde» invisible (mismo tamaño y sitio) */
.bx.is-live .bx-logo { opacity: 0; }

.bx-hint {
  margin: 0;
  font-size: 12px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-dim, rgb(var(--ink, 255 255 255) / 0.55));
  opacity: 0;
  transition: opacity 0.6s ease-out;
}
.bx.is-live.is-formed .bx-hint { opacity: 1; }
.bx-hint--touch { display: none; }
@media (hover: none) {
  .bx-hint--hover { display: none; }
  .bx-hint--touch { display: inline; }
}

/* ---------- El texto ---------- */
.bx-copy {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr);
  gap: clamp(24px, 4vw, 64px);
  align-items: end;
  padding-top: clamp(20px, 3vh, 32px);
  border-top: 1px solid var(--pink-border, rgba(237, 20, 91, 0.25));
}
.bx-h1 {
  margin: 0;
  font-size: clamp(2rem, 4.6vw, 4.4rem);
  font-weight: 800;
  line-height: 0.95;
  letter-spacing: -0.02em;
  text-transform: uppercase;
  color: var(--white, #fff);
}
.bx-h1 span, .bx-h1 em { display: block; }
.bx-h1 em { font-style: normal; color: var(--bx-pink); }

.bx-lead {
  margin: 0 0 22px;
  max-width: 52ch;
  font-size: clamp(15px, 1.15vw, 17px);
  line-height: 1.6;
  color: var(--text-muted, rgb(var(--ink, 255 255 255) / 0.68));
}
.bx-btns { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; }
.bx-wa {
  display: inline-flex;
  align-items: center;
  min-height: 48px;
  padding: 0 22px;
  border: 1px solid rgb(var(--ink, 255 255 255) / 0.22);
  color: var(--white, #fff);
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  text-decoration: none;
  transition: border-color 0.2s ease-out, color 0.2s ease-out;
}
.bx-wa:hover, .bx-wa:focus-visible { border-color: #25d366; color: #25d366; }
.bx-meta {
  margin: 18px 0 0;
  font-size: 12px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-dim, rgb(var(--ink, 255 255 255) / 0.55));
}

/* ---------- Entrada (solo si se permite movimiento) ----------
   El logo se arma primero; el texto sube después, en una sola pasada. */
@media (prefers-reduced-motion: no-preference) {
  .bx-h1 span, .bx-h1 em, .bx-side {
    animation: bx-rise 0.7s cubic-bezier(0.16, 1, 0.3, 1) both;
  }
  .bx-h1 span:nth-child(1) { animation-delay: 0.15s; }
  .bx-h1 span:nth-child(2) { animation-delay: 0.25s; }
  .bx-h1 em               { animation-delay: 0.35s; }
  .bx-side                { animation-delay: 0.5s; }
}
@keyframes bx-rise {
  from { opacity: 0; transform: translateY(28px); }
  to   { opacity: 1; transform: none; }
}

/* ---------- Móvil ---------- */
@media (max-width: 860px) {
  .bx-pin { padding-top: 92px; grid-template-rows: auto auto; align-content: center; }
  .bx-stage { padding: 4vh 0 1vh; }
  .bx-copy { grid-template-columns: minmax(0, 1fr); align-items: start; }
  .bx-btns > * { flex: 1 1 auto; justify-content: center; text-align: center; }
}

/* ============================================================
   CIERRE «A través de la marca»
   Por defecto (sin JS / movimiento reducido): logo con tinta + llamada debajo.
   Con .is-live (lo pone hero-brand.js): escena fija de ~2,6 pantallas de scroll.
   ============================================================ */
.bt { position: relative; background: var(--dark, #0a0a0a); }
.bt-sticky {
  position: relative; overflow: hidden;
  display: grid; place-items: center; gap: clamp(32px, 6vh, 64px);
  padding: clamp(64px, 12vh, 120px) clamp(16px, 5vw, 72px);
}
.bt-window {
  position: relative; overflow: hidden;
  width: min(92vw, 1200px); aspect-ratio: 2322 / 566;
  -webkit-mask: var(--logo-mask) center / 100% 100% no-repeat;
          mask: var(--logo-mask) center / 100% 100% no-repeat;
  transform-origin: var(--ox, 50%) var(--oy, 50%);
}
.bt-ink { position: absolute; inset: -40%; background: #b80d44; }
.bt-ink i { position: absolute; width: 60%; aspect-ratio: 1; border-radius: 50%; filter: blur(40px); }
.bt-ink i:nth-child(1) { background: #ee2a7b; left: 0;   top: 10%; }
.bt-ink i:nth-child(2) { background: #ff7ab0; left: 40%; top: 30%; }
.bt-ink i:nth-child(3) { background: #7a0a3a; left: 20%; top: 50%; }
.bt-ink i:nth-child(4) { background: #ffd1e3; left: 55%; top: 0; width: 30%; opacity: 0.8; }
@media (prefers-reduced-motion: no-preference) {
  .bt-ink i:nth-child(1) { animation: bt-a 9s ease-in-out infinite alternate; }
  .bt-ink i:nth-child(2) { animation: bt-b 11s ease-in-out infinite alternate; }
  .bt-ink i:nth-child(3) { animation: bt-c 13s ease-in-out infinite alternate; }
  .bt-ink i:nth-child(4) { animation: bt-b 7s ease-in-out infinite alternate-reverse; }
  .bt:not(.is-near) .bt-ink i { animation-play-state: paused; } /* quieta fuera de pantalla */
}
@keyframes bt-a { to { transform: translate(55%, 25%) scale(1.3); } }
@keyframes bt-b { to { transform: translate(-50%, 20%) scale(0.8); } }
@keyframes bt-c { to { transform: translate(40%, -35%) scale(1.2); } }

.bt-hint { display: none; }
.bt-after { text-align: center; max-width: 720px; }
.bt-title {
  margin: 0 0 14px; color: var(--white, #fff); text-transform: uppercase;
  font-size: clamp(2rem, 5vw, 4.2rem); font-weight: 800; line-height: 0.95; letter-spacing: -0.02em;
}
.bt-sub { margin: 0 auto 26px; max-width: 46ch; color: rgb(var(--ink, 255 255 255) / 0.78); font-size: clamp(15px, 1.2vw, 17px); line-height: 1.6; }
.bt-actions { display: flex; flex-wrap: wrap; gap: 12px; justify-content: center; }

/* Escena con scroll */
.bt.is-live { height: 160vh; } /* 2026-12-03: antes 260vh (casi 2 pantallas de letras antes de la llamada) */
.bt.is-live .bt-sticky { position: sticky; top: 0; height: 100svh; padding: 0 clamp(16px, 5vw, 72px); gap: 0; }
.bt.is-live .bt-window { grid-area: 1 / 1; will-change: transform, opacity; }
.bt.is-live .bt-hint {
  display: block; position: absolute; bottom: 28px; left: 0; right: 0; margin: 0; text-align: center;
  font-size: 12px; letter-spacing: 0.18em; text-transform: uppercase; color: var(--text-dim, rgb(255 255 255 / 0.55));
}
/* La llamada entra de una vez (por clase, no atada al scroll): nunca se queda a medio fundir */
.bt.is-live .bt-after {
  grid-area: 1 / 1; opacity: 0; transform: translateY(24px);
  transition: opacity 0.35s ease-out, transform 0.45s cubic-bezier(0.16, 1, 0.3, 1);
}
.bt.is-live.is-open .bt-after { opacity: 1; transform: none; }
.bt.is-live:not(.is-open) .bt-after { pointer-events: none; } /* invisibles durante la escena: sin clics accidentales */
/* Relevo a pantalla completa: el logo no se amplía más de ×40 (capas gigantes = memoria de GPU) */
.bt-fill { display: none; }
.bt.is-live .bt-fill {
  display: block; position: absolute; inset: 0; opacity: 0; pointer-events: none;
  background: radial-gradient(120% 90% at 40% 45%, #ee2a7b, #b80d44 55%, #5c0730);
}
