/* ==========================================================
   WoW Agencia Creativa · Inicio (hero)
   Letras WOW que se abren como un portal, teléfono con el
   Instagram de la agencia y redes sociales girando alrededor.
   Necesita tokens.css y base.css cargados antes.
   Lo mueve js/hero.js al hacer scroll.
   ========================================================== */

/* ---------- Estado base (sin animación): todo se ve apilado y completo ---------- */

.hero {
  position: relative;
  background: var(--navy-900);
  color: var(--white);
  --logo-letters: var(--white);
  --logo-ring: var(--blue-500);
  --logo-arrow: var(--blue-300);
}

.hero__stage {
  position: relative;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  padding-top: calc(60px + var(--space-6));
  padding-bottom: var(--space-7);
  overflow: hidden;
  isolation: isolate;
}
.hero__stage::before {              /* luz azul suave detrás de todo */
  content: "";
  position: absolute;
  inset: 8% -10% auto;
  height: 70%;
  background: radial-gradient(50% 55% at 50% 55%, rgba(47, 125, 250, 0.2), transparent 70%);
  z-index: -1;
  pointer-events: none;
}

/* Textos de arriba */
.hero__copy {
  position: relative;
  z-index: 6;
  display: grid;
  justify-items: center;
  gap: var(--space-3);
  padding-inline: max(var(--gutter), env(safe-area-inset-left, 0px));
  text-align: center;
}
.hero__copy h1 {
  font: 800 var(--text-3xl) / 1.05 var(--font-main);
  letter-spacing: -0.03em;
  max-width: 22ch;
}
.hero__copy h1 .hl { color: var(--blue-500); }
.hero__sub { color: var(--mist-300); max-width: 54ch; }
.hero__copy .btn-row { justify-content: center; margin-top: var(--space-2); }

/* Zona de escena: aquí viven las letras, el teléfono y las redes */
.hero__arena {
  position: relative;
  display: grid;
  justify-items: center;
  align-content: center;
  gap: var(--space-6);
  min-height: 0;
  padding-top: var(--space-6);
  padding-inline: max(var(--gutter), env(safe-area-inset-left, 0px));
}

.hero__letters { width: min(100%, 900px); }
.hero__letters svg { width: 100%; height: auto; overflow: visible; }
/* Las letras se mueven redibujándose como vector (lo hace hero.js), por eso no se pixelan al crecer */

.hero__phone-wrap { display: grid; place-items: center; }

/* El teléfono */
.phone {
  height: 480px;
  aspect-ratio: 0.49;
  padding: 8px;
  border-radius: 38px;
  background: linear-gradient(160deg, #1d2a47, #0b1222);
  box-shadow: 0 0 0 1px var(--navy-600), 0 40px 90px rgba(47, 125, 250, 0.28),
              inset 0 0 0 2px rgba(255, 255, 255, 0.04);
}
.phone__screen {
  position: relative;
  width: 100%;
  height: 100%;
  border-radius: 31px;
  overflow: hidden;
  background: #000;
}
.phone__screen video,
.phone__screen img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.phone__island {
  position: absolute;
  top: 10px;
  left: 50%;
  width: 30%;
  height: 22px;
  border-radius: var(--radius-full);
  background: #000;
  transform: translateX(-50%);
  z-index: 2;
}
.phone__glare {
  position: absolute;
  inset: 0;
  background: linear-gradient(115deg, rgba(255, 255, 255, 0.1), transparent 30%);
  pointer-events: none;
  z-index: 3;
}

/* Redes sociales que giran: en el estado base no se muestran */
.orbit { display: none; }

.orbit__chip {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 54px;
  height: 54px;
  margin: -27px 0 0 -27px;
  display: grid;
  place-items: center;
  border-radius: 16px;
  background: var(--navy-700);
  border: 1px solid var(--navy-600);
  box-shadow: var(--shadow-card);
  color: var(--white);
}
.orbit__chip svg { width: 26px; height: 26px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.orbit__chip svg .solid { fill: currentColor; stroke: none; }

/* Etiqueta con el usuario de Instagram */
.hero__tag {
  display: inline-flex;
  align-items: center;
  gap: var(--space-3);
  padding: 0.6rem 1.1rem;
  border: 1px solid var(--navy-600);
  border-radius: var(--radius-full);
  background: rgba(19, 28, 48, 0.92);
  box-shadow: var(--shadow-card);
  font-size: var(--text-sm);
  color: var(--mist-300);
  white-space: nowrap;
  text-decoration: none;
}
.hero__tag b { color: var(--white); font-size: var(--text-base); font-weight: 700; }
.hero__tag svg { width: 20px; height: 20px; fill: none; stroke: var(--blue-300); stroke-width: 1.8; stroke-linecap: round; }

.hero__hint { display: none; }


/* ==========================================================
   MODO ANIMADO  (lo activa hero.js poniendo la clase "is-live")
   El inicio se queda fijo en pantalla mientras haces scroll
   y las piezas se mueven según cuánto hayas bajado.
   ========================================================== */

.hero.is-live {
  --stage-h: max(100svh, 640px);
  --hero-scroll: 140vh;                       /* cuánto hay que bajar para completar la animación */
  height: calc(var(--stage-h) + var(--hero-scroll));
}
.hero.is-live .hero__stage {
  position: sticky;
  top: 0;
  height: var(--stage-h);
  padding-block: calc(60px + env(safe-area-inset-top, 0px) + var(--space-5)) 0;
}
.hero.is-live .hero__arena {
  display: block;
  container-type: size;                       /* permite medir el alto real de la escena */
  padding: 0;
}

.hero.is-live .hero__letters,
.hero.is-live .hero__phone-wrap,
.hero.is-live .orbit {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
}
.hero.is-live .hero__letters { width: auto; padding-inline: max(var(--gutter), env(safe-area-inset-left, 0px)); }
.hero.is-live .hero__letters svg { width: min(92cqw, 900px, 200cqh); }
.hero.is-live .hero__phone-wrap { z-index: 2; pointer-events: none; }
.hero.is-live .phone {
  height: min(94cqh, 560px);
  opacity: 0;
}
.hero.is-live .orbit { display: block; pointer-events: none; }   /* sin z-index: cada red decide si va delante o detrás del teléfono */
.hero.is-live .orbit__chip { opacity: 0; }

.hero.is-live .hero__tag {
  position: absolute;
  left: 50%;
  bottom: 3%;
  z-index: 4;
  opacity: 0;
}

/* Las letras caen una por una al cargar la página */
.hero.is-live .hero__letters svg .wl-1,
.hero.is-live .hero__letters svg .wl-o,
.hero.is-live .hero__letters svg .wl-2 {
  animation: hero-drop 0.9s var(--ease-out) backwards;
}
.hero.is-live .hero__letters svg .wl-o  { animation-delay: 0.12s; }
.hero.is-live .hero__letters svg .wl-2  { animation-delay: 0.24s; }
@keyframes hero-drop {
  from { opacity: 0; transform: translateY(-40px); }
}

/* Aviso "Baja" que invita a hacer scroll */
.hero.is-live .hero__hint {
  position: absolute;
  left: 50%;
  bottom: 14px;
  z-index: 5;
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  transform: translateX(-50%);
  font: 500 var(--text-xs) var(--font-mono);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--mist-300);
}
.hero.is-live .hero__hint svg {
  width: 14px; height: 14px;
  fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round;
  animation: hero-nudge 1.4s ease-in-out infinite;
}
@keyframes hero-nudge { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(5px); } }

/* Pantallas bajitas: se quita el texto de apoyo para que todo quepa */
@media (max-height: 720px) {
  .hero.is-live .hero__sub { display: none; }
}
@media (max-width: 560px) {
  .hero__copy h1 { font-size: 1.85rem; }
  .orbit__chip { width: 46px; height: 46px; margin: -23px 0 0 -23px; border-radius: 14px; }
  .orbit__chip svg { width: 22px; height: 22px; }
}
