/* ===================================================================
   Zyrex Labs — Landing
   Hero: video de fondo full-screen controlado por scroll (scrubbing).
   El video se reproduce a medida que se hace scroll y el contenido
   (textos, CTAs, comunidad) se revela progresivamente.
   Tipografía: Inter
   =================================================================== */
:root {
  --bg:       #07060f;
  --ink:      #ffffff;
  --muted:    #c4c4cf;
  --muted-2:  rgba(255,255,255,.55);
  --violet:   #7c5cff;
  --violet-2: #a78bfa;
  --teal:     #36e0c8;
  --cyan:     #1fb8d4;
  --pad-x:    clamp(20px, 4vw, 60px);
  --maxw:     1340px;
  --radius:   999px;
  --scroll-len: 240vh;            /* longitud del recorrido de scroll */
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
html { scroll-behavior: auto; }

body {
  font-family: 'Inter', system-ui, -apple-system, Segoe UI, Roboto, sans-serif;
  background: #050409;
  color: var(--ink);
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

.bg-layer {
  position: fixed; inset: 0; z-index: -1;
  background: #050409;   /* negro sólido: header/footer (transparentes) sin barras moradas */
}

/* ===================== Loader ===================== */
.loader {
  position: fixed; inset: 0; z-index: 100;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 22px;
  background: #050409;
  transition: opacity .6s ease, visibility .6s ease;
}
.loader.hidden { opacity: 0; visibility: hidden; }
.loader-mark img { height: 34px; opacity: .92; animation: pulse 1.8s ease-in-out infinite; }
.loader-bar { width: 180px; height: 3px; border-radius: 3px; background: rgba(255,255,255,.12); overflow: hidden; }
.loader-bar span { display: block; height: 100%; width: 0%; border-radius: 3px;
  background: linear-gradient(90deg, var(--teal), var(--cyan)); transition: width .2s ease; }
@keyframes pulse { 0%,100%{opacity:.5} 50%{opacity:1} }

/* ===================== Header (fijo) ===================== */
.site-header {
  position: fixed; top: 0; left: 0; right: 0; z-index: 30;
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  max-width: var(--maxw); margin: 0 auto;
  padding: 26px var(--pad-x);
}
.brand img { height: 30px; width: auto; display: block; }

.lang { position: relative; }
.lang-btn {
  display: inline-flex; align-items: center; gap: 9px;
  padding: 9px 14px; background: rgba(255,255,255,.04);
  border: 1px solid rgba(255,255,255,.18); border-radius: var(--radius);
  color: var(--ink); font: 600 13px/1 'Inter', sans-serif; letter-spacing: .03em;
  cursor: pointer; backdrop-filter: blur(6px);
  transition: border-color .2s, background .2s;
}
.lang-btn:hover { border-color: rgba(255,255,255,.36); background: rgba(255,255,255,.07); }
.lang-btn .flag { display: inline-flex; align-items: center; }
.lang-btn .flag-img { width: 20px; height: auto; border-radius: 3px; display: block; }
.lang-btn .flag-emoji { font-size: 16px; line-height: 1; }
.lang-btn .chev { color: rgba(255,255,255,.7); transition: transform .2s; }
.lang-btn[aria-expanded="true"] .chev { transform: rotate(180deg); }

.lang-menu {
  position: absolute; right: 0; top: calc(100% + 8px);
  list-style: none; margin: 0; padding: 6px; min-width: 178px;
  background: #12101f; border: 1px solid rgba(255,255,255,.12);
  border-radius: 14px; box-shadow: 0 18px 50px rgba(0,0,0,.55);
  opacity: 0; visibility: hidden; transform: translateY(-6px);
  transition: opacity .18s, transform .18s, visibility .18s; z-index: 40;
}
.lang.open .lang-menu { opacity: 1; visibility: visible; transform: translateY(0); }
.lang-menu li { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: 9px;
  font: 500 13px/1 'Inter', sans-serif; color: var(--muted); cursor: pointer; }
.lang-menu li:hover { background: rgba(255,255,255,.06); color: #fff; }
.lang-menu .flag-img { width: 20px; border-radius: 3px; }
.lang-menu .flag-emoji { font-size: 16px; }

/* ===================== Layout estático (sin scroll) ===================== */
/* La página es una columna a pantalla completa; el video es un fondo FIJO. */
.bg-layer { z-index: -3; }

body { min-height: 100vh; min-height: 100dvh; display: flex; flex-direction: column; }

/* Header en flujo (ya no fijo) */
.site-header { position: relative; width: 100%; z-index: 3; }

/* Hero: contenedor del video (full-bleed) + contenido encima */
.hero {
  position: relative; flex: 1 1 auto; width: 100%;
  display: flex; align-items: center;
  overflow: hidden;
}

/* Video de fondo dentro del hero: cubre el área sin distorsión (object-fit cover) */
.bg-video {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  object-fit: cover; object-position: center;
  z-index: 0; pointer-events: none;
  background: #050409;
}
.bg-video--mobile { display: none; }

/* Teléfono inline: solo en móvil (en desktop lo provee el video de fondo) */
.hero-phone { display: none; }

/* Scrim para legibilidad del texto sobre el video */
.scrim {
  position: absolute; inset: 0; z-index: 1; pointer-events: none;
  background:
    linear-gradient(90deg, rgba(5,4,9,.78) 0%, rgba(5,4,9,.38) 36%, rgba(5,4,9,0) 60%),
    linear-gradient(0deg, rgba(5,4,9,.55) 0%, rgba(5,4,9,0) 24%);
}

/* Contenido del hero, centrado en un contenedor de ancho máximo */
.hero-inner {
  position: relative; z-index: 2;
  width: 100%; max-width: var(--maxw); margin: 0 auto;
  padding: clamp(8px, 2vh, 28px) var(--pad-x) clamp(20px, 4vh, 48px);
}

.eyebrow {
  font-weight: 300;
  font-size: clamp(11px, 1.05vw, 15px); letter-spacing: .42em; text-transform: uppercase;
  color: var(--muted-2); margin: 0 0 clamp(14px, 2vw, 22px); padding-left: .42em;
}

.hero-copy { max-width: clamp(320px, 50vw, 720px); display: flex; flex-direction: column; }

.headline {
  margin: 0 0 clamp(18px, 2.2vw, 28px);
  font-weight: 600; line-height: 1.12; letter-spacing: -.03em;
  font-size: clamp(34px, 4.2vw, 60px);
}
.headline .line { display: block; padding-bottom: .04em; }
.headline .line-1 {
  background: linear-gradient(96deg, #6f6f7a 0%, #d9d9e2 60%, #f3f3f7 100%);
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.headline .line-2 { color: #f4f4f8; }
.headline em {
  font-style: normal;
  background: linear-gradient(92deg, var(--teal) 0%, var(--cyan) 95%);
  -webkit-background-clip: text; background-clip: text; color: transparent;
}

.lede {
  margin: 0 0 clamp(22px, 2.6vw, 32px);
  font-weight: 500; font-size: clamp(14px, 1.35vw, 18px);
  line-height: 1.6; color: var(--muted); max-width: 30em;
}
.lede strong { color: #fff; font-weight: 700; }

.cta-row { display: flex; gap: 15px; flex-wrap: wrap; margin-bottom: clamp(22px, 2.6vw, 32px); }
.btn {
  position: relative; overflow: hidden;
  display: inline-flex; align-items: center; justify-content: center;
  padding: 15px 36px; border-radius: var(--radius);
  font-weight: 700; font-size: clamp(14px, 1.05vw, 16px); letter-spacing: .02em;
  text-decoration: none; cursor: pointer;
  transition: transform .2s ease, box-shadow .28s ease, background .25s ease, border-color .25s ease, color .2s ease;
}
.btn:active { transform: translateY(1px); }

/* Primario — blanco sólido (como antes) */
.btn-primary { background: #fff; color: #0a0a12; box-shadow: 0 8px 30px rgba(255,255,255,.14); }
.btn-primary:hover { box-shadow: 0 10px 40px rgba(255,255,255,.28); transform: translateY(-2px); }

/* Secundario — vidrio negro estilo liquid glass (blur + transparencia + luz interior) */
.btn-ghost {
  isolation: isolate;
  color: #fff;
  background: rgba(9,9,14,.42);
  border: 1px solid rgba(255,255,255,.16);
  -webkit-backdrop-filter: blur(16px) saturate(165%);
  backdrop-filter: blur(16px) saturate(165%);
  box-shadow:
    inset 0 1px 1px rgba(255,255,255,.40),
    inset 0 -10px 22px rgba(255,255,255,.04),
    inset 0 3px 16px rgba(255,255,255,.08),
    0 10px 30px rgba(0,0,0,.40);
  text-shadow: 0 1px 2px rgba(0,0,0,.45);
}
/* Luz interior — debajo del texto */
.btn-ghost::before {
  content: ""; position: absolute; inset: 0; z-index: -1; border-radius: inherit; pointer-events: none;
  background:
    radial-gradient(135% 95% at 50% -25%, rgba(255,255,255,.26), rgba(255,255,255,0) 56%),
    radial-gradient(90% 70% at 50% 130%, rgba(255,255,255,.05), rgba(255,255,255,0) 60%);
}
/* Reflejo especular sutil en el borde superior */
.btn-ghost::after {
  content: ""; position: absolute; left: 12%; right: 12%; top: 2px; height: 42%; z-index: -1;
  border-radius: 999px; pointer-events: none;
  background: linear-gradient(180deg, rgba(255,255,255,.3), rgba(255,255,255,0));
  filter: blur(2px); opacity: .5;
}
.btn-ghost:hover {
  background: rgba(18,18,26,.52); border-color: rgba(255,255,255,.30); transform: translateY(-2px);
  box-shadow:
    inset 0 1px 1px rgba(255,255,255,.40),
    inset 0 3px 16px rgba(255,255,255,.08),
    0 14px 42px rgba(0,0,0,.50);
}

.notice {
  margin: clamp(20px, 2.4vw, 30px) 0 0;
  font-weight: 400; font-size: clamp(11.5px, .95vw, 13px);
  line-height: 1.6; color: rgba(255,255,255,.46); max-width: 33em;
}
.notice strong { color: rgba(255,255,255,.82); font-weight: 700; }

.community { margin-top: clamp(22px, 2.6vw, 32px); }
.community-title { margin: 0 0 14px; font-weight: 600; font-size: clamp(15px, 1.25vw, 18px); color: #fff; }
.socials { list-style: none; display: flex; gap: 14px; margin: 0; padding: 0; }
.socials a {
  display: grid; place-items: center; width: 46px; height: 46px;
  border-radius: 12px; background: rgba(255,255,255,.04);
  border: 1px solid rgba(255,255,255,.10);
  transition: transform .18s, border-color .2s, background .2s;
}
.socials a:hover { transform: translateY(-3px); border-color: rgba(124,92,255,.5); background: rgba(124,92,255,.10); }
.socials img { width: 22px; height: 22px; object-fit: contain; }

/* ===================== Footer (en flujo, al pie) ===================== */
.site-footer {
  position: relative; z-index: 20;
  max-width: var(--maxw); margin: 0 auto; width: 100%;
  padding: 18px var(--pad-x) clamp(18px, 3vh, 26px);
}
.footer-links { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 12px clamp(20px, 4vw, 60px); }
.footer-links a {
  color: rgba(255,255,255,.62); text-decoration: none;
  font-weight: 400; font-size: clamp(11px, 1vw, 13px);
  letter-spacing: .12em; text-transform: uppercase; transition: color .2s;
}
.footer-links a:hover { color: #fff; }

/* ===================== Responsive ===================== */
@media (max-width: 920px) {
  .site-header { justify-content: center; padding: 18px var(--pad-x); }
  .lang { position: absolute; right: var(--pad-x); top: 14px; }
  .lang-btn { padding: 7px 11px; gap: 7px; font-size: 12px; }
  .brand img { height: 24px; }

  .site-header { z-index: 5; }
  .bg-video--desktop { display: none; }
  /* Video vertical como FONDO, anclado ARRIBA y recortado ABAJO. */
  .bg-video--mobile {
    display: block; top: 0; bottom: auto; height: var(--vidH);
    object-fit: cover; object-position: center top;
  }
  /* Oscurece solo la parte superior para que el texto sobrepuesto sea legible. */
  .scrim {
    top: 0; bottom: auto; height: var(--vidH);
    background: linear-gradient(180deg, rgba(5,4,9,.74) 0%, rgba(5,4,9,.30) 16%, rgba(5,4,9,0) 36%);
  }

  /* Texto arriba (sobre la zona oscura); comunidad/aviso ABAJO del video.
     --vidH = altura visible del video vertical (recortado abajo), escala con el ancho. */
  .hero { --vidH: calc(100vw * 1.58); align-items: stretch; min-height: calc(var(--vidH) + 210px); }
  .hero-inner {
    display: flex; flex-direction: column; text-align: center;
    min-height: calc(var(--vidH) + 210px);
    padding-top: clamp(10px, 2.4vh, 22px);
  }
  .hero-copy { flex: 1 1 auto; width: 100%; max-width: 620px; margin: 0 auto; text-align: center; align-items: center; }
  .eyebrow { padding-left: 0; text-align: center; font-size: clamp(9.5px, 2.6vw, 12px); letter-spacing: .26em; margin-bottom: 12px; }
  .headline { font-size: clamp(27px, 7vw, 46px); letter-spacing: -.02em; margin-bottom: 14px; }
  .lede { max-width: 40ch; font-size: clamp(13px, 3.4vw, 16px); margin-bottom: 18px; }
  .cta-row { justify-content: center; }

  /* Comunidad + redes y aviso anclados ABAJO (debajo del video, sobre negro) */
  .community { display: flex; flex-direction: column; align-items: center; margin-top: auto; }
  .community-title { font-size: 14px; margin-bottom: 10px; }
  .socials { justify-content: center; gap: 12px; }
  .socials a { width: 42px; height: 42px; border-radius: 11px; }
  .socials img { width: 19px; height: 19px; }
  .notice { max-width: 38ch; margin: 12px auto 0; font-size: clamp(10.5px, 2.8vw, 12px); }

  .footer-links { justify-content: center; text-align: center; }
}

@media (max-width: 480px) {
  .headline { font-size: clamp(30px, 9.4vw, 44px); }
  .btn { flex: 1 1 auto; }
  .cta-row { gap: 12px; width: 100%; }
  .footer-links { gap: 10px 18px; font-size: 10px; }
}

/* ===================== Accesibilidad: sin movimiento ===================== */
@media (prefers-reduced-motion: reduce) {
  .cue-dot { animation: none; }
}
