/* ============================================================================
   fAI — landing de descarga (fai.prodifylabs.io)
   Lenguaje visual: docs/design.md. Deep-space dark, teal + azul, acento escaso.
   Regla dura heredada: NADA de texto en gradiente. El gradiente es hairline.
   ========================================================================== */

:root {
  /* fondo / superficies */
  --bg-base:      #000019;
  --bg-card:      #060E1F;
  --bg-surface:   #0A1628;
  --bg-elevated:  #0D1D35;
  /* rampa de texto (blanco tintado frío) */
  --fg-primary:   #FFFFFF;
  --fg-secondary: #E2E8F5;
  --fg-soft:      #C8D5E8;
  --fg-muted:     #8A9BB5;
  --fg-ghost:     #7A8BA8;
  /* bordes */
  --bd-subtle:    #12213D;
  --bd-strong:    #1A2D4A;
  /* marca */
  --teal:         #02F4A8;
  --blue:         #428BF9;
  --grad-brand:   linear-gradient(135deg, var(--teal), var(--blue));
  --grad-hair:    linear-gradient(90deg, var(--teal), var(--blue), transparent);
  /* tipos */
  --font-sans:    'DM Sans', system-ui, sans-serif;
  --font-display: 'Outfit', 'DM Sans', system-ui, sans-serif;
  --font-mono:    'JetBrains Mono', ui-monospace, monospace;
  /* motion */
  --ease-soft:    cubic-bezier(.4, 0, .2, 1);
  --dur-fast:     .22s;
  --dur-base:     .3s;
  /* layout */
  --gutter:       clamp(20px, 5vw, 88px);
  --maxw:         1240px;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--bg-base);
  color: var(--fg-secondary);
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

h1, h2, h3, h4 {
  font-family: var(--font-display);
  color: var(--fg-primary);
  letter-spacing: -.035em;
  line-height: 1.05;
  margin: 0;
}

p { margin: 0; }

a { color: inherit; text-decoration: none; }

/* ── Atmósfera: grilla hairline + aurora ambiente ───────────────────────── */

.grid-field {
  position: fixed; inset: 0; z-index: 0; pointer-events: none;
  background-image:
    linear-gradient(to right,  var(--bd-subtle) 1px, transparent 1px),
    linear-gradient(to bottom, var(--bd-subtle) 1px, transparent 1px);
  background-size: 96px 96px;
  opacity: .5;
  mask-image: radial-gradient(120% 80% at 70% 0%, #000 0%, transparent 72%);
  -webkit-mask-image: radial-gradient(120% 80% at 70% 0%, #000 0%, transparent 72%);
}

.aurora {
  position: fixed; inset: 0; z-index: 0; pointer-events: none;
  background:
    radial-gradient(46rem 32rem at 78% -6%, rgba(2, 244, 168, .085), transparent 62%),
    radial-gradient(40rem 30rem at 12% 8%,  rgba(66, 139, 249, .075), transparent 60%),
    radial-gradient(52rem 30rem at 50% 108%, rgba(66, 139, 249, .05), transparent 60%);
  animation: breathe 14s var(--ease-soft) infinite;
}

@keyframes breathe {
  0%, 100% { opacity: .85; }
  50%      { opacity: 1; }
}

/* ── Header ─────────────────────────────────────────────────────────────── */

.site-head {
  position: sticky; top: 0; z-index: 40;
  display: flex; align-items: center; justify-content: space-between;
  padding: 18px var(--gutter);
  background: rgba(0, 0, 25, .72);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--bd-subtle);
}
.site-head::before {
  content: ''; position: absolute; inset: 0 0 auto 0; height: 1px;
  background: var(--grad-hair); opacity: .55;
}

.wordmark { display: flex; align-items: center; gap: 10px; }
.wordmark img { display: block; }
.wordmark span {
  font-family: var(--font-display); font-weight: 800; font-size: 19px;
  letter-spacing: -.04em; color: var(--fg-primary);
}

.head-nav { display: flex; align-items: center; gap: 28px; }
.head-nav a {
  font-size: 14px; font-weight: 500; color: var(--fg-muted);
  transition: color var(--dur-fast) var(--ease-soft);
}
.head-nav a:hover { color: var(--fg-secondary); }
.head-nav .umbrella {
  font-family: var(--font-mono); font-size: 11.5px; letter-spacing: .06em;
  text-transform: uppercase; color: var(--fg-ghost);
  padding-left: 28px; border-left: 1px solid var(--bd-strong);
}
.head-nav .umbrella:hover { color: var(--blue); }

/* ── Primitivas ─────────────────────────────────────────────────────────── */

.eyebrow {
  font-family: var(--font-mono); font-size: 11.5px; font-weight: 500;
  letter-spacing: .09em; text-transform: uppercase; color: var(--teal);
  margin-bottom: 22px;
}

.mono-tag {
  font-family: var(--font-mono); font-size: 10.5px; font-weight: 500;
  letter-spacing: .1em; text-transform: uppercase; color: var(--fg-ghost);
}

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  padding: 0 26px; height: 50px; border-radius: 10px; border: 1px solid transparent;
  font-family: var(--font-sans); font-size: 15px; font-weight: 600;
  cursor: pointer; white-space: nowrap;
  transition: transform var(--dur-fast) var(--ease-soft),
              box-shadow var(--dur-fast) var(--ease-soft),
              background var(--dur-fast) var(--ease-soft),
              border-color var(--dur-fast) var(--ease-soft),
              color var(--dur-fast) var(--ease-soft);
}

.btn-primary {
  background: var(--teal); color: #00160E;
  box-shadow: 0 0 0 0 rgba(2, 244, 168, .35);
}
.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 30px -8px rgba(2, 244, 168, .45);
}
.btn-primary:active { transform: translateY(0); }

.btn-ghost {
  background: transparent; color: var(--fg-soft);
  border-color: var(--bd-strong);
}
.btn-ghost:hover { border-color: rgba(2, 244, 168, .4); color: var(--fg-primary); }

.btn:focus-visible { outline: 2px solid var(--blue); outline-offset: 3px; }

/* ── Reveal orquestado ──────────────────────────────────────────────────── */

.reveal {
  opacity: 0; transform: translateY(14px);
  animation: rise .62s var(--ease-soft) forwards;
  animation-delay: var(--d, 0ms);
}
@keyframes rise { to { opacity: 1; transform: none; } }

/* ── HERO ───────────────────────────────────────────────────────────────── */

main { position: relative; z-index: 1; }

.hero {
  max-width: var(--maxw); margin: 0 auto;
  padding: clamp(44px, 6.5vw, 84px) var(--gutter) clamp(52px, 6vw, 80px);
  display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, .8fr);
  gap: clamp(32px, 5vw, 72px); align-items: center;
}
/* el atributo `hidden` pierde contra `display:grid` — hay que reafirmarlo */
.hero[hidden] { display: none; }

.hero h1 {
  /* Titular largo (8 palabras): tipo más chica que la versión de 4+4, si no
     el bloque empuja el CTA debajo del pliegue en pantallas de 768px. */
  font-size: clamp(33px, 3.7vw, 50px);
  font-weight: 900; letter-spacing: -.04em; line-height: 1.06;
  margin-bottom: 22px;
}
.hero h1 .l1 { display: block; color: var(--fg-primary); }
/* única instancia de texto en gradiente del sitio — el tratamiento de hero que
   la marca de la casa reserva para la landing (ver nota en README). */
.hero h1 .l2 {
  display: block;
  background: linear-gradient(90deg, var(--teal), var(--blue), var(--teal));
  background-size: 200% 200%;
  -webkit-background-clip: text; background-clip: text;
  -webkit-text-fill-color: transparent; color: transparent;
  animation: gradShift 7s var(--ease-soft) infinite;
}
@keyframes gradShift {
  0%, 100% { background-position: 0% 50%; }
  50%      { background-position: 100% 50%; }
}

.lead {
  font-size: clamp(16.5px, 1.35vw, 19px);
  color: var(--fg-soft); max-width: 30em; line-height: 1.6;
}

/* Línea de filtro: declara quién es el lector. Más chica y fría que el lead. */
.filter {
  margin-top: 20px; padding-left: 15px;
  border-left: 2px solid color-mix(in srgb, var(--teal) 45%, transparent);
  font-size: clamp(14px, 1.05vw, 15.5px);
  color: var(--fg-muted); max-width: 30em; line-height: 1.6;
}
.filter b { color: var(--fg-soft); font-weight: 600; }

.hero-cta { display: flex; flex-wrap: wrap; gap: 14px; margin-top: 38px; }

.g { flex: none; }

/* ── La mascota ─────────────────────────────────────────────────────────── */

/* SIN `isolation: isolate`: el video tiene que mezclarse contra el fondo REAL
   de la página. Aislado, el blend no tiene contra qué mezclar y el rectángulo
   negro del video queda opaco y visible. */
.hero-figure {
  position: relative; display: grid; place-items: center;
  min-height: clamp(300px, 34vw, 440px);
}

/* El video viene con fondo NEGRO PURO (medido: rgb(1,1,1)). `screen` sería
   la vía natural, PERO el video se compone en su propia capa de GPU y el
   compositor lo ignora → quedaba un rectángulo visible. La MÁSCARA radial
   funde los bordes de forma determinista, sin depender del compositor.
   Se deja `screen` igual: donde sí aplica, suma. */
.mascot-video {
  position: relative; z-index: 3;
  width: 132%; max-width: none; height: auto;
  mix-blend-mode: screen;
  pointer-events: none;
  -webkit-mask-image: radial-gradient(ellipse 60% 58% at 50% 47%,
    #000 52%, rgba(0, 0, 0, .35) 72%, transparent 86%);
  mask-image: radial-gradient(ellipse 60% 58% at 50% 47%,
    #000 52%, rgba(0, 0, 0, .35) 72%, transparent 86%);
}

.v-aura {
  position: absolute; z-index: 2;
  width: 74%; aspect-ratio: 1; border-radius: 50%;
  background: radial-gradient(circle,
    rgba(2, 244, 168, .2) 0%,
    rgba(66, 139, 249, .07) 42%,
    transparent 66%);
  filter: blur(24px);
  animation: pulse 6s var(--ease-soft) infinite;
}
@keyframes pulse {
  0%, 100% { transform: scale(1);    opacity: .85; }
  50%      { transform: scale(1.06); opacity: 1; }
}

/* ── ESTADO LOGUEADO: la llave ──────────────────────────────────────────── */

.access {
  max-width: var(--maxw); margin: 0 auto;
  padding: clamp(48px, 7vw, 92px) var(--gutter);
}
.access[hidden] { display: none; }

.access-inner { max-width: 720px; }

.access h2 {
  font-size: clamp(32px, 4.4vw, 54px); font-weight: 800; margin-bottom: 16px;
}
.access-lead { color: var(--fg-soft); font-size: 16.5px; max-width: 36em; }

.key-slab {
  position: relative; margin: 38px 0 30px;
  background: linear-gradient(180deg, var(--bg-surface), var(--bg-card));
  border: 1px solid var(--bd-strong); border-radius: 14px;
  padding: 22px 26px 20px;
  overflow: hidden;
}
/* la "glow bar": firma de la casa */
.key-slab::before {
  content: ''; position: absolute; inset: 0 0 auto 0; height: 2px;
  background: var(--grad-hair);
}

.key-slab-head {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 14px;
}

.copy {
  background: none; border: 1px solid var(--bd-strong); border-radius: 7px;
  color: var(--fg-muted); font-family: var(--font-mono); font-size: 11px;
  letter-spacing: .06em; text-transform: uppercase; padding: 5px 12px;
  cursor: pointer;
  transition: color var(--dur-fast) var(--ease-soft),
              border-color var(--dur-fast) var(--ease-soft);
}
.copy:hover { color: var(--teal); border-color: rgba(2, 244, 168, .45); }

.key-value {
  display: block;
  font-family: var(--font-mono); font-weight: 600;
  font-size: clamp(22px, 3.4vw, 34px);
  letter-spacing: .12em; color: var(--fg-primary);
  margin-bottom: 18px;
}

.dl-row { display: flex; flex-wrap: wrap; align-items: center; gap: 20px 26px; }
.btn-dl { flex-direction: column; gap: 2px; height: auto; padding: 15px 30px; }
.dl-meta {
  font-family: var(--font-mono); font-size: 10.5px; font-weight: 500;
  letter-spacing: .08em; opacity: .62;
}

.link-back {
  margin-top: 40px; background: none; border: none; padding: 0;
  color: var(--fg-ghost); font-family: var(--font-sans); font-size: 13.5px;
  cursor: pointer; transition: color var(--dur-fast) var(--ease-soft);
}
.link-back:hover { color: var(--fg-soft); }

/* estado de verificación / carga de botón */
.btn.is-checking { pointer-events: none; opacity: .78; }
.btn-dl.is-loading { pointer-events: none; opacity: .78; }

/* ── Aviso de auth: error / sin invitación ──────────────────────────────── */

/* Panel bajo el CTA del hero, inyectado por app.js cuando el acceso no puede
   completarse. Mismo lenguaje que el resto: superficie oscura, hairline azul. */
.auth-note {
  margin-top: 26px; max-width: 30em;
  display: flex; flex-direction: column; align-items: flex-start; gap: 14px;
  padding: 16px 18px;
  background: var(--bg-card);
  border: 1px solid var(--bd-strong);
  border-left: 2px solid color-mix(in srgb, var(--blue) 55%, transparent);
  border-radius: 10px;
}
.auth-note[hidden] { display: none; }
.auth-note-msg { font-size: 14.5px; line-height: 1.55; color: var(--fg-soft); }
.auth-note-action { height: 42px; padding: 0 20px; font-size: 14px; }

/* ── Secciones ──────────────────────────────────────────────────────────── */

.sec-head { max-width: 640px; margin-bottom: clamp(38px, 5vw, 60px); }
.sec-head h2 {
  font-size: clamp(30px, 4.1vw, 50px); font-weight: 800; line-height: 1.08;
}
.sec-lead { margin-top: 18px; color: var(--fg-muted); font-size: 16px; }

/* ── Manifiesto: índice editorial, no grilla de cards ───────────────────── */

.manifesto {
  max-width: var(--maxw); margin: 0 auto;
  padding: clamp(64px, 9vw, 128px) var(--gutter);
  border-top: 1px solid var(--bd-subtle);
}

.ledger { list-style: none; margin: 0; padding: 0; }

.ledger > li {
  display: grid; grid-template-columns: 86px minmax(0, 1fr);
  gap: clamp(16px, 3vw, 44px);
  padding: clamp(24px, 3vw, 34px) 0;
  border-top: 1px solid var(--bd-subtle);
  transition: border-color var(--dur-base) var(--ease-soft);
}
.ledger > li:last-child { border-bottom: 1px solid var(--bd-subtle); }
.ledger > li:hover { border-top-color: rgba(2, 244, 168, .35); }

.num {
  font-family: var(--font-mono); font-size: 13px; font-weight: 500;
  letter-spacing: .08em; color: var(--fg-ghost);
  padding-top: 5px;
  transition: color var(--dur-base) var(--ease-soft);
}
.ledger > li:hover .num { color: var(--teal); }

.ledger h3 {
  font-size: clamp(20px, 2.2vw, 27px); font-weight: 600;
  letter-spacing: -.03em; margin-bottom: 10px;
}
.ledger p { color: var(--fg-muted); font-size: 15.5px; max-width: 42em; }

/* Sub-lista dentro de un punto del manifiesto: mismo tono que el párrafo, con
   un guión teal como viñeta (evita el bullet nativo, que rompe la tipografía). */
.m-list {
  list-style: none; margin: 10px 0 0; padding: 0;
  color: var(--fg-muted); font-size: 15.5px; max-width: 42em;
}
.m-list li { position: relative; padding-left: 20px; margin-top: 7px; }
.m-list li::before {
  content: "—"; position: absolute; left: 0;
  color: var(--teal); opacity: .7;
}

/* ── Índice de capacidades: columnas densas, no grilla de cards ─────────── */

.index {
  max-width: var(--maxw); margin: 0 auto;
  padding: clamp(64px, 9vw, 120px) var(--gutter);
  border-top: 1px solid var(--bd-subtle);
}

.fams {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(290px, 1fr));
  gap: clamp(28px, 3.4vw, 52px) clamp(28px, 4vw, 64px);
}

.fam h3 {
  display: flex; align-items: baseline; gap: 12px;
  font-size: 19px; font-weight: 600; letter-spacing: -.02em;
  padding-bottom: 13px; margin-bottom: 16px;
  border-bottom: 1px solid var(--bd-strong);
}
.fam h3 .mono-tag { color: var(--teal); }

.fam ul { list-style: none; margin: 0; padding: 0; }
.fam li {
  position: relative;
  padding: 0 0 12px 15px;
  font-size: 14.5px; line-height: 1.55; color: var(--fg-muted);
}
.fam li::before {
  content: ''; position: absolute; left: 0; top: 9px;
  width: 5px; height: 1px; background: var(--fg-ghost);
}
.fam li b { color: var(--fg-secondary); font-weight: 600; }

/* ── Requisitos ─────────────────────────────────────────────────────────── */

.reqs {
  max-width: var(--maxw); margin: 0 auto;
  padding: clamp(56px, 8vw, 108px) var(--gutter);
  border-top: 1px solid var(--bd-subtle);
}

.req-rows {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: 1px; background: var(--bd-subtle);
  border: 1px solid var(--bd-subtle); border-radius: 12px; overflow: hidden;
}
.req {
  background: var(--bg-base); padding: 26px 24px 28px;
  transition: background var(--dur-base) var(--ease-soft);
}
.req:hover { background: var(--bg-card); }
.req h4 {
  font-size: 18px; font-weight: 600; letter-spacing: -.025em;
  margin: 14px 0 8px;
}
.req p { color: var(--fg-muted); font-size: 14.5px; }

/* ── Cierre ─────────────────────────────────────────────────────────────── */

.closer {
  border-top: 1px solid var(--bd-subtle);
  padding: clamp(64px, 9vw, 120px) var(--gutter);
}
.closer-inner { max-width: var(--maxw); margin: 0 auto; max-width: 560px; }
.closer img { margin-bottom: 24px; opacity: .95; }
.closer h2 { font-size: clamp(28px, 3.6vw, 42px); font-weight: 800; margin-bottom: 14px; }
.closer p { color: var(--fg-muted); margin-bottom: 30px; font-size: 16.5px; }

/* ── Footer ─────────────────────────────────────────────────────────────── */

.site-foot {
  border-top: 1px solid var(--bd-subtle);
  padding: 34px var(--gutter) 46px;
  display: flex; flex-wrap: wrap; gap: 24px 40px;
  align-items: flex-start; justify-content: space-between;
}
.foot-left p {
  margin-top: 10px; font-size: 13px; color: var(--fg-ghost); max-width: 42em;
}
.foot-nav { display: flex; gap: 24px; }
.foot-nav a {
  font-size: 13.5px; color: var(--fg-muted);
  transition: color var(--dur-fast) var(--ease-soft);
}
.foot-nav a:hover { color: var(--teal); }

/* ── Responsive ─────────────────────────────────────────────────────────── */

@media (max-width: 900px) {
  .hero { grid-template-columns: 1fr; padding-top: 40px; }
  .hero-figure { order: -1; min-height: 220px; }
  /* sin columna al lado, el video ya no puede desbordar el ancho de página */
  .mascot-video { width: 100%; }
  .ledger > li { grid-template-columns: 52px minmax(0, 1fr); }
  .head-nav { gap: 18px; }
  .head-nav a[href="#requisitos"] { display: none; }
}

@media (max-width: 560px) {
  .head-nav a[href="#manifiesto"] { display: none; }
  .btn { width: 100%; }
  .hero-cta { flex-direction: column; align-items: stretch; }
}

/* ── Accesibilidad de movimiento ────────────────────────────────────────── */

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .01ms !important;
  }
  .reveal, .arm-tags span { opacity: 1; transform: none; }
  html { scroll-behavior: auto; }
}
