/**
 * BionicAdri — Futurista v1.0 (jul-19 2026)
 * Theme layer SOBRE reimagine.css (que va sobre styles.css).
 * Origen: plantilla chat-1847 + mejoras (CTA contraste, SVG-first, ritmo).
 *
 * Estrategia: solo tokens + overrides de componentes. CERO cambios de markup
 * → SEO, i18n (data-i18n) y accesibilidad quedan intactos.
 * Dark = look futurista completo (navy + cian/violeta + Orbitron).
 * Light = tipografía nueva y acentos, sin forzar el neon (legibilidad manda).
 *
 * NOTA jul-30 2026: enterprise.css (cargado después) calma neon/Orbitron
 * hacia un look B2B (Lexend + steel accents). No eliminar esta capa base.
 */

/* =========================================================
   1. TOKENS — paleta navy + cian/violeta (dark default)
   ========================================================= */
:root {
  /* Acentos: cian eléctrico primario, violeta secundario (antes iris/magenta) */
  --fx-cyan: oklch(83% 0.13 210);
  --fx-cyan-bright: oklch(88% 0.14 205);
  --fx-violet: oklch(66% 0.2 285);
  --fx-grad: linear-gradient(135deg, var(--fx-cyan) 0%, var(--fx-violet) 100%);

  /* Re-mapear tokens del design system al look futurista */
  --re-cyan: var(--fx-cyan);
  --re-iris: var(--fx-violet);
  --re-iris-bright: oklch(74% 0.2 285);
  --re-magenta: var(--fx-violet); /* los gradientes iris→magenta pasan a violeta puro */

  /* Superficies: navy profundo (más frío y oscuro que reimagine) */
  --re-bg-0: oklch(9% 0.02 255);
  --re-bg-1: oklch(12% 0.025 255);
  --re-bg-2: oklch(15% 0.03 255);
  --re-surface: oklch(14% 0.025 255 / 0.72);
  --re-surface-hover: oklch(18% 0.035 255 / 0.85);
  --re-border: oklch(70% 0.1 210 / 0.16);
  --re-border-strong: oklch(80% 0.13 210 / 0.42);

  /* Glow en cian (identidad futurista), no violeta */
  --re-shadow-glow: 0 0 34px oklch(83% 0.13 210 / 0.28), 0 0 90px oklch(66% 0.2 285 / 0.16);
  --re-shadow-glow-cyan: 0 0 40px oklch(83% 0.13 210 / 0.38);

  --fx-font-display: 'Orbitron', 'Space Grotesk', system-ui, sans-serif;
  --fx-font-mono: 'JetBrains Mono', ui-monospace, monospace;
}

/* Light theme: mantener superficies claras del sistema base (solo acentos) */
:root[data-theme="light"] {
  --re-bg-0: oklch(98% 0.005 255);
  --re-bg-1: oklch(96% 0.008 255);
  --re-bg-2: oklch(93% 0.012 255);
  --re-surface: oklch(100% 0 0 / 0.75);
  --re-surface-hover: oklch(100% 0 0 / 0.92);
  --re-border: oklch(45% 0.08 255 / 0.18);
  --re-border-strong: oklch(45% 0.1 255 / 0.4);
  --fx-cyan: oklch(58% 0.12 220);          /* cian oscurecido: AA sobre claro */
  --fx-cyan-bright: oklch(50% 0.13 220);
  --fx-violet: oklch(50% 0.19 285);
  --re-shadow-glow: 0 10px 30px oklch(50% 0.12 255 / 0.15);
}

/* =========================================================
   2. TIPOGRAFÍA — Orbitron display + JetBrains Mono labels
   ========================================================= */
.re-display,
.reimagine h1, .reimagine h2 {
  font-family: var(--fx-font-display);
  letter-spacing: 0.02em;
  font-weight: 700;
}

/* Wordmark/hero: gradient text animado (compositor-friendly: solo background-position) */
.re-hero h1.re-display, .re-hero .re-display {
  background: linear-gradient(120deg, var(--fx-cyan) 0%, var(--fx-violet) 45%, var(--fx-cyan) 90%);
  background-size: 200% 200%;
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  color: transparent;
  animation: fx-grad-shift 6s ease infinite;
}
@keyframes fx-grad-shift {
  0%, 100% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
}

/* =========================================================
   2b. WORDMARK HERO — momento marca de la plantilla chat-1847
   (el H1 SEO existente pasa a titular de apoyo debajo)
   ========================================================= */
.fx-wordmark {
  display: flex;
  flex-direction: column;
  gap: 0.9rem;
  margin: 1.2rem 0 1.6rem;
}
.fx-wordmark__name {
  font-family: var(--fx-font-display);
  font-weight: 900;
  font-size: clamp(3.2rem, 2rem + 7.5vw, 7.5rem);
  line-height: 1.02;
  letter-spacing: 0.03em;
  background: linear-gradient(120deg, var(--fx-cyan) 0%, var(--fx-violet) 45%, var(--fx-cyan) 90%);
  background-size: 200% 200%;
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  color: transparent;
  animation: fx-grad-shift 6s ease infinite;
}
.fx-wordmark__sub {
  font-family: var(--fx-font-display);
  font-weight: 500;
  font-size: clamp(0.8rem, 0.6rem + 1.2vw, 1.35rem);
  letter-spacing: 0.55em;
  text-transform: uppercase;
  color: var(--re-ink-muted);
}

/* El H1 SEO baja a UNA línea de apoyo discreta (tag+i18n intactos → SEO ok).
   Feedback jul-19: "árbol de navidad" — el hero respira: wordmark + una línea. */
.re-hero h1.fx-hero-title, body.reimagine .re-hero h1.fx-hero-title {
  font-family: 'Space Grotesk', system-ui, sans-serif;
  font-size: clamp(1rem, 0.9rem + 0.7vw, 1.3rem);
  font-weight: 500;
  line-height: 1.5;
  letter-spacing: 0.01em;
  max-width: 52rem;
  background: none;
  -webkit-text-fill-color: currentColor;
  color: var(--re-ink-muted);
  animation: none;
  margin-bottom: 1.4rem;
}
.fx-hero-title br { display: none; }               /* 3 líneas → 1 frase fluida */
.fx-hero-title span { margin-right: 0.35em; }
.fx-hero-title .re-ink-gradient {                  /* sin gradiente chillón aquí */
  background: none;
  -webkit-text-fill-color: currentColor;
  color: var(--re-ink);
  font-weight: 700;
}

/* Eyebrow sin caja-pill: línea mono desnuda (menos ruido) */
.re-hero__eyebrow {
  background: none !important;
  border: none !important;
  padding: 0 !important;
  box-shadow: none !important;
}

/* Ticker: de 6 stats a 4 (modelos de datos y rutas API = jerga interna).
   El contenido sigue en el DOM/i18n; display:none en stats numéricas no
   afecta SEO. */
.re-hero__ticker .re-ticker__item:nth-child(2),
.re-hero__ticker .re-ticker__item:nth-child(6) { display: none; }

/* CTA terciario como link discreto (2 botones + 1 link, no 3 botones) */
.fx-link-quiet {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  font-family: var(--fx-font-mono);
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--re-ink-muted);
  text-decoration: none;
  border-bottom: 1px solid transparent;
  transition: color var(--re-dur-fast) ease, border-color var(--re-dur-fast) ease;
  align-self: center;
}
.fx-link-quiet:hover { color: var(--fx-cyan); border-bottom-color: var(--fx-cyan); }

/* Ticker de stats con look de la plantilla: números Orbitron cian */
.re-ticker__val {
  font-family: var(--fx-font-display);
  font-weight: 700;
  color: var(--fx-cyan);
}
.re-ticker__lbl {
  font-family: var(--fx-font-mono);
  text-transform: uppercase;
  letter-spacing: 0.2em;
  font-size: 0.68rem;
}

/* Kickers / eyebrows / tags → estilo terminal-mono con guión luminoso */
.re-section__kicker, .re-hero__eyebrow, .re-subhero__eyebrow,
.re-flow__tag, .re-legal__tag, .re-blog-card__tag {
  font-family: var(--fx-font-mono);
  text-transform: uppercase;
  letter-spacing: 0.32em;
  font-size: 0.72rem;
  color: var(--fx-cyan);
}
.re-section__kicker::before, .re-hero__eyebrow::before {
  content: "— ";
  color: var(--fx-cyan);
}

/* =========================================================
   2e. NAV FUTURISTA — la barra era el último resto del look viejo
   (jul-20). Cero markup: aplica a las 50 páginas.
   ========================================================= */
header {
  background: oklch(10% 0.025 255 / 0.82);
  backdrop-filter: blur(16px) saturate(1.2);
  -webkit-backdrop-filter: blur(16px) saturate(1.2);
  border-bottom: 1px solid oklch(80% 0.13 210 / 0.12);
}
/* línea de energía bajo el header: gradiente cian→violeta muy sutil */
header::after {
  content: "";
  position: absolute;
  left: 0; right: 0; bottom: -1px;
  height: 1px;
  background: linear-gradient(90deg, transparent 0%, oklch(83% 0.13 210 / 0.5) 30%, oklch(66% 0.2 285 / 0.5) 70%, transparent 100%);
  pointer-events: none;
}
header.header-scrolled {
  background: oklch(9% 0.02 255 / 0.94);
  box-shadow: 0 8px 30px oklch(0% 0 0 / 0.35);
}
:root[data-theme="light"] header {
  background: oklch(98% 0.005 255 / 0.85);
  border-bottom-color: oklch(45% 0.08 255 / 0.15);
}

/* Links: mono-tech uppercase con subrayado animado */
.nav-links a {
  font-family: var(--fx-font-mono);
  font-size: 0.74rem;
  text-transform: uppercase;
  letter-spacing: 0.09em;
  font-weight: 500;
  color: var(--re-ink-muted);
  position: relative;
  padding: 4px 0;
}
.nav-links a::after {
  content: "";
  position: absolute;
  left: 0; right: 0; bottom: -2px;
  height: 1px;
  background: var(--fx-grad);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform var(--re-dur-base) var(--re-ease-out-expo);
}
.nav-links a:hover {
  color: var(--fx-cyan);
}
.nav-links a:hover::after { transform: scaleX(1); }
/* Página activa (la marca futurista.js por pathname) */
.nav-links a.fx-nav-active {
  color: var(--fx-cyan-bright);
}
.nav-links a.fx-nav-active::after { transform: scaleX(1); }
:root[data-theme="light"] .nav-links a { color: oklch(30% 0.03 255); }
:root[data-theme="light"] .nav-links a:hover,
:root[data-theme="light"] .nav-links a.fx-nav-active { color: var(--fx-cyan); }

/* Toggle de tema: en dark era luna oscura sobre círculo oscuro (invisible).
   Superficie + borde + icono claro, y aro cian al hover. */
.theme-toggle {
  background: oklch(18% 0.035 255 / 0.9);
  border: 1px solid var(--re-border);
  color: var(--re-ink);
}
.theme-toggle svg { stroke: currentColor; }
:root[data-theme="light"] .theme-toggle {
  background: oklch(100% 0 0 / 0.9);
  color: oklch(30% 0.03 255);
}
.theme-toggle:hover, .menu-toggle:hover {
  box-shadow: 0 0 0 1px oklch(83% 0.13 210 / 0.5), var(--re-shadow-glow-cyan);
}

/* Panel móvil desplegable a juego (media query del sitio: <969px) */
@media (max-width: 968px) {
  .nav-links {
    background: oklch(10% 0.025 255 / 0.96);
    backdrop-filter: blur(18px);
    -webkit-backdrop-filter: blur(18px);
    border-bottom: 1px solid oklch(80% 0.13 210 / 0.15);
  }
  .nav-links a { font-size: 0.85rem; }
  :root[data-theme="light"] .nav-links { background: oklch(98% 0.005 255 / 0.97); }
}

/* Logo del header en Orbitron */
header .logo span {
  font-family: var(--fx-font-display);
  letter-spacing: 0.08em;
  font-weight: 700;
  background: var(--fx-grad);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

/* Stats / números grandes en Orbitron cian */
.re-stat-card__val {
  font-family: var(--fx-font-display);
  color: var(--fx-cyan);
  font-weight: 700;
}
.re-stat-card__lbl {
  font-family: var(--fx-font-mono);
  text-transform: uppercase;
  letter-spacing: 0.25em;
  font-size: 0.7rem;
}

/* =========================================================
   3. COMPONENTES
   ========================================================= */

/* CTA primario: gradient cian→violeta con TEXTO OSCURO (fix contraste chat-1847:
   el botón claro-sobre-claro parecía deshabilitado). AA garantizado. */
.re-btn--primary {
  background: var(--fx-grad);
  color: oklch(14% 0.02 255);
  font-weight: 700;
  font-family: var(--fx-font-mono);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  font-size: 0.8rem;
}
.re-btn--primary:hover { color: oklch(10% 0.02 255); }
:root[data-theme="light"] .re-btn--primary { color: oklch(99% 0 0); }

.re-btn--ghost {
  border: 1px solid var(--re-border-strong);
  font-family: var(--fx-font-mono);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  font-size: 0.8rem;
}
.re-btn--ghost:hover {
  border-color: var(--fx-cyan);
  box-shadow: var(--re-shadow-glow-cyan);
}

/* Cards: borde fino cian + esquina "tech" + hover con lift y glow */
.re-bento__cell, .re-stat-card, .re-blog-card, .re-agent-deep__card,
.re-contact-aside__card, .re-pillar {
  border: 1px solid var(--re-border);
  background:
    linear-gradient(var(--re-surface), var(--re-surface)) padding-box;
  position: relative;
  transition: transform var(--re-dur-base) var(--re-ease-out-expo),
              border-color var(--re-dur-base) ease,
              box-shadow var(--re-dur-base) ease;
}
.re-bento__cell:hover, .re-stat-card:hover, .re-blog-card:hover,
.re-agent-deep__card:hover {
  border-color: var(--re-border-strong);
  box-shadow: var(--re-shadow-glow-cyan);
  transform: translateY(-3px);
}

/* Formularios estilo terminal (progressive enhancement, sin tocar semántica) */
.re-field__input, .re-form input, .re-form textarea, .re-form select {
  font-family: var(--fx-font-mono);
  background: oklch(10% 0.02 255 / 0.8);
  border: 1px solid var(--re-border);
  caret-color: var(--fx-cyan);
}
.re-field__input:focus, .re-form input:focus, .re-form textarea:focus {
  border-color: var(--fx-cyan);
  box-shadow: 0 0 0 2px oklch(83% 0.13 210 / 0.2);
  outline: none;
}
:root[data-theme="light"] .re-field__input,
:root[data-theme="light"] .re-form input,
:root[data-theme="light"] .re-form textarea,
:root[data-theme="light"] .re-form select {
  background: oklch(100% 0 0 / 0.9);
}

/* =========================================================
   2c. TERMINAL FORM (contacto) — jul-19 2026
   Restyling del formulario existente al look "terminal futurista":
   prompts de shell decorativos (aria-hidden) antes de cada campo,
   inputs casi negros + caret cian, botón submit tipo "▸ EJECUTAR".
   Semántica intacta: mismos name=/for=, action/method sin tocar,
   los <label> reales pasan a .sr-only (el prompt los sustituye
   visualmente, el texto accesible sigue siendo el i18n real).
   Scoped a data-page="contact" — el resto de formularios no cambian.
   ========================================================= */
body[data-page="contact"] .fx-term-line {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  flex-wrap: wrap;
}
body[data-page="contact"] .fx-term-line--block {
  flex-direction: column;
  align-items: stretch;
  gap: 0.4rem;
}
body[data-page="contact"] .fx-term-prompt {
  font-family: var(--fx-font-mono);
  font-size: 0.76rem;
  color: var(--fx-cyan);
  white-space: nowrap;
  opacity: 0.92;
  user-select: none;
}
body[data-page="contact"] .fx-term-line > .re-field__input,
body[data-page="contact"] .fx-term-line > .re-field__select {
  flex: 1;
  min-width: 0;
}

body[data-page="contact"] .re-field__input,
body[data-page="contact"] .re-field__select,
body[data-page="contact"] .re-field__textarea {
  background: oklch(7% 0.015 255 / 0.92);
  border: 1px solid var(--re-border);
  caret-color: var(--fx-cyan);
  font-family: var(--fx-font-mono);
  font-size: 0.85rem;
}
body[data-page="contact"] .re-field__input:focus,
body[data-page="contact"] .re-field__select:focus,
body[data-page="contact"] .re-field__textarea:focus {
  border-color: var(--fx-cyan);
  box-shadow: 0 0 0 2px oklch(83% 0.13 210 / 0.22);
  background: oklch(5% 0.015 255 / 0.95);
}
body[data-page="contact"] .re-field__input::placeholder,
body[data-page="contact"] .re-field__textarea::placeholder {
  color: var(--re-ink-dim);
  opacity: 0.7;
}
:root[data-theme="light"] body[data-page="contact"] .re-field__input,
:root[data-theme="light"] body[data-page="contact"] .re-field__select,
:root[data-theme="light"] body[data-page="contact"] .re-field__textarea {
  background: oklch(100% 0 0 / 0.92);
}

/* Botón submit → "▸ EJECUTAR" (texto i18n intacto; ▸ decorativo aria-hidden) */
body[data-page="contact"] .re-btn--terminal {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  background: oklch(8% 0.02 255 / 0.9);
  color: var(--fx-cyan);
  border: 1px solid var(--fx-cyan);
}
body[data-page="contact"] .re-btn--terminal:hover {
  background: var(--fx-cyan);
  color: oklch(10% 0.02 255);
  box-shadow: var(--re-shadow-glow-cyan);
}
body[data-page="contact"] .re-btn--terminal .fx-term-caret {
  font-weight: 700;
}
:root[data-theme="light"] body[data-page="contact"] .re-btn--terminal {
  background: oklch(100% 0 0 / 0.9);
  color: var(--fx-cyan);
  border-color: var(--fx-cyan);
}
:root[data-theme="light"] body[data-page="contact"] .re-btn--terminal:hover {
  color: oklch(99% 0 0);
}

@media (max-width: 480px) {
  body[data-page="contact"] .fx-term-prompt { font-size: 0.66rem; }
}

/* =========================================================
   2d. LANGUAGE BANNER — barra discreta primera visita (jul-19 2026)
   Sustituye al popup a pantalla completa (fricción de conversión) por
   una barra fija inferior, no bloqueante. Se cierra al elegir idioma
   o con el botón X; persiste en localStorage (js/i18n.js).
   Cuando coincide con el cookie banner (.bio-cookie, z-index:9000,
   bottom:20px) esta barra se sitúa POR ENCIMA (z-index mayor + se
   eleva vía .fx-lang-banner--lifted) para no solaparlo.
   ========================================================= */
.fx-lang-banner {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 9400;
  transform: translateY(100%);
  opacity: 0;
  transition: transform 0.32s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.28s ease;
  background: oklch(10% 0.02 255 / 0.97);
  -webkit-backdrop-filter: blur(14px);
  backdrop-filter: blur(14px);
  border-top: 1px solid var(--re-border-strong);
  padding: 12px calc(16px + env(safe-area-inset-right, 0px)) calc(12px + env(safe-area-inset-bottom, 0px)) calc(16px + env(safe-area-inset-left, 0px));
}
.fx-lang-banner.active { transform: translateY(0); opacity: 1; }

/* Se eleva cuando el cookie banner también está visible (primera visita) */
.fx-lang-banner--lifted { bottom: 104px; }
@media (max-width: 560px) {
  .fx-lang-banner--lifted { bottom: 148px; }
}

.fx-lang-banner__inner {
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  gap: 14px;
}
.fx-lang-banner__text {
  font-family: var(--fx-font-mono);
  font-size: 0.78rem;
  letter-spacing: 0.01em;
  color: var(--re-ink-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  flex: 0 1 auto;
}
.fx-lang-banner__list {
  display: flex;
  align-items: center;
  gap: 8px;
  overflow-x: auto;
  flex: 1;
  min-width: 0;
  padding: 3px 2px;
  scrollbar-width: thin;
}
.fx-lang-banner__list::-webkit-scrollbar { height: 4px; }
.fx-lang-banner__list::-webkit-scrollbar-thumb { background: var(--re-border-strong); border-radius: 2px; }
.fx-lang-banner__opt {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
  padding: 6px 11px;
  border-radius: 999px;
  border: 1px solid var(--re-border);
  background: var(--re-bg-1);
  color: var(--re-ink);
  font-family: var(--fx-font-mono);
  font-size: 0.75rem;
  cursor: pointer;
  transition: border-color 0.2s ease, transform 0.2s ease;
  white-space: nowrap;
}
.fx-lang-banner__opt:hover { border-color: var(--fx-cyan); transform: translateY(-1px); }
.fx-lang-banner__opt:focus-visible {
  outline: 2px solid var(--fx-cyan);
  outline-offset: 2px;
}
/* Preselección visual del idioma detectado por el navegador (no aplica solo) */
.fx-lang-banner__opt--suggested {
  border-color: var(--fx-cyan);
  box-shadow: 0 0 0 1px oklch(83% 0.13 210 / 0.35);
}
.fx-lang-banner__flag { font-size: 1rem; line-height: 1; }
.fx-lang-banner__code { font-weight: 600; letter-spacing: 0.03em; }
.fx-lang-banner__close {
  flex-shrink: 0;
  width: 28px;
  height: 28px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  border: 1px solid var(--re-border);
  background: transparent;
  color: var(--re-ink-muted);
  font-size: 1.05rem;
  line-height: 1;
  cursor: pointer;
  transition: border-color 0.2s ease, color 0.2s ease;
}
.fx-lang-banner__close:hover { border-color: var(--fx-cyan); color: var(--fx-cyan); }

:root[data-theme="light"] .fx-lang-banner {
  background: oklch(99% 0.005 255 / 0.97);
}
:root[data-theme="light"] .fx-lang-banner__opt {
  background: oklch(100% 0 0 / 0.92);
}

@media (max-width: 480px) {
  .fx-lang-banner__inner { gap: 8px; }
  .fx-lang-banner__text { max-width: 34%; font-size: 0.7rem; }
  .fx-lang-banner__opt { padding: 5px 9px; font-size: 0.7rem; }
}

@media (prefers-reduced-motion: reduce) {
  .fx-lang-banner { transition: none; }
}

/* Cookie banner: mismo criterio de contraste que el CTA (texto oscuro) */
.bio-cookie__accept {
  background: var(--fx-grad);
  color: oklch(14% 0.02 255);
  font-weight: 700;
}
:root[data-theme="light"] .bio-cookie__accept { color: oklch(99% 0 0); }

/* =========================================================
   4. STARFIELD — canvas fijo detrás de todo (lo pinta futurista.js)
   ========================================================= */
.fx-starfield {
  position: fixed;
  inset: 0;
  /* CRÍTICO: canvas es replaced element — sin width/height explícitos,
     inset:0 NO lo estira y se muestra al tamaño del backing (CSS×dpr)
     recortado: con dpr>1 todo se corre y la esfera cae fuera de pantalla.
     (Bug jul-19: visible en headless dpr=1, invisible en pantallas reales.) */
  width: 100%;
  height: 100%;
  z-index: -1;
  pointer-events: none;
  opacity: 0.85;
}
:root[data-theme="light"] .fx-starfield { display: none; }

/* Mesh del hero: fuera el blob magenta/ámbar — navy con acentos cian/violeta
   contenidos, para que la red neuronal del canvas sea la protagonista */
.re-hero__mesh {
  opacity: 0.35;
  background:
    radial-gradient(circle at 20% 25%, oklch(66% 0.2 285 / 0.4), transparent 42%),
    radial-gradient(circle at 78% 18%, oklch(83% 0.13 210 / 0.3), transparent 48%),
    radial-gradient(circle at 55% 85%, oklch(60% 0.15 250 / 0.35), transparent 55%);
}

/* Sutil grid perspectiva al pie del hero (puro CSS, coste 0) */
.re-hero {
  position: relative;
}
.re-hero::after {
  content: "";
  position: absolute;
  inset: auto 0 0 0;
  height: 120px;
  pointer-events: none;
  background:
    repeating-linear-gradient(90deg, oklch(83% 0.13 210 / 0.06) 0 1px, transparent 1px 60px),
    linear-gradient(to top, oklch(83% 0.13 210 / 0.05), transparent);
  -webkit-mask-image: linear-gradient(to top, black, transparent);
  mask-image: linear-gradient(to top, black, transparent);
}
:root[data-theme="light"] .re-hero::after { display: none; }

/* =========================================================
   4b. DETALLES HUD — esquinas tech + líneas de datos
   ========================================================= */

/* Esquinas "bracket" en cards destacadas (puro CSS, coste 0) */
.re-bento__cell::before, .re-agent-deep__card::before {
  content: "";
  position: absolute;
  top: -1px; left: -1px;
  width: 18px; height: 18px;
  border-top: 2px solid var(--fx-cyan);
  border-left: 2px solid var(--fx-cyan);
  border-top-left-radius: 6px;
  opacity: 0;
  transition: opacity var(--re-dur-base) ease;
  pointer-events: none;
}
.re-bento__cell::after, .re-agent-deep__card::after {
  content: "";
  position: absolute;
  bottom: -1px; right: -1px;
  width: 18px; height: 18px;
  border-bottom: 2px solid var(--fx-violet);
  border-right: 2px solid var(--fx-violet);
  border-bottom-right-radius: 6px;
  opacity: 0;
  transition: opacity var(--re-dur-base) ease;
  pointer-events: none;
}
.re-bento__cell:hover::before, .re-bento__cell:hover::after,
.re-agent-deep__card:hover::before, .re-agent-deep__card:hover::after {
  opacity: 1;
}

/* Título de sección con línea de datos que "corre" (solo dark) */
.re-section__title {
  position: relative;
}
.re-section__title::after {
  content: "";
  display: block;
  margin-top: 0.6rem;
  height: 1px;
  width: 120px;
  background: linear-gradient(90deg, var(--fx-cyan), transparent);
}
:root[data-theme="light"] .re-section__title::after {
  background: linear-gradient(90deg, var(--fx-violet), transparent);
}

/* Feed de agentes (re-ag-feed) como terminal en vivo */
.re-ag-feed {
  font-family: var(--fx-font-mono);
  border: 1px solid var(--re-border);
  background: oklch(9% 0.02 255 / 0.85);
}
.re-ag-feed__header {
  border-bottom: 1px solid var(--re-border);
  font-family: var(--fx-font-mono);
  text-transform: uppercase;
  letter-spacing: 0.2em;
  font-size: 0.7rem;
}
.re-ag-feed__time { color: var(--fx-cyan); }

/* =========================================================
   4d. HERO: llenar el 100vh con intención
   El hero limpio dejaba un vacío enorme bajo las stats en móviles altos
   (min-height:100vh heredado). Desktop: contenido centrado + cue SCROLL.
   Móvil: el hero se ajusta al contenido — sin vacío.
   ========================================================= */
.re-hero {
  display: flex;
  align-items: center;
  justify-content: center;
}
/* OJO: nada de width:100% en el container — pisaba su ancho natural (1280
   centrado) y el hero de index quedaba pegado a la izquierda a >1280px
   mientras las subpáginas seguían centradas (bug jul-20). El container
   conserva su ancho base; el flex de arriba lo centra. */

.fx-scroll-cue {
  position: absolute;
  left: 50%;
  bottom: 22px;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  font-family: var(--fx-font-mono);
  font-size: 0.62rem;
  letter-spacing: 0.4em;
  color: var(--re-ink-dim);
  pointer-events: none;
}
.fx-scroll-cue svg { animation: fx-cue-bob 2.2s ease-in-out infinite; color: var(--fx-cyan); }
@keyframes fx-cue-bob {
  0%, 100% { transform: translateY(0); opacity: 0.5; }
  50% { transform: translateY(6px); opacity: 1; }
}

@media (max-width: 820px) {
  .re-hero {
    min-height: auto !important;
    /* header fijo ~92px en móvil: sin este margen el eyebrow queda debajo */
    padding-top: clamp(7rem, 22vw, 9rem);
    padding-bottom: 3.2rem;
  }
  .fx-scroll-cue { display: none; }
}

/* =========================================================
   4c. RESPONSIVE — Orbitron es ~20% más ancha que Space Grotesk:
   sin este ajuste, palabras largas ("Automatizamos") se cortan en móvil
   ========================================================= */
@media (max-width: 768px) {
  /* "BionicAdri" = 10 glifos Orbitron ≈ 0.72em/glifo → 11vw cabe con padding */
  .fx-wordmark__name {
    font-size: clamp(2.2rem, 11vw, 3.2rem);
    letter-spacing: 0.02em;
  }
  .fx-wordmark__sub { letter-spacing: 0.35em; }
  .re-hero h1.re-display, body.reimagine .re-hero h1 {
    font-size: clamp(1.85rem, 8vw, 2.6rem);
    letter-spacing: 0.01em;
    overflow-wrap: break-word;
  }
  .re-section__title, body.reimagine .re-section__title {
    font-size: clamp(1.5rem, 6.5vw, 2.1rem);
    overflow-wrap: break-word;
  }
}

/* =========================================================
   5. MOTION SAFETY
   ========================================================= */
@media (prefers-reduced-motion: reduce) {
  .re-hero h1.re-display, .re-hero .re-display { animation: none; }
  .re-bento__cell:hover, .re-stat-card:hover, .re-blog-card:hover,
  .re-agent-deep__card:hover { transform: none; }
}

/* =========================================================
   6. P0-1 FIX (jul-26) — `header` a secas en styles.min.css:276
   (position:fixed) y aquí mismo en 2e. (fondo glass + ::after) pegan
   también a <header class="article-header"> de las 11 guías + 21 posts,
   dejando el título clavado al viewport y tapando la nav (z-index 1000).
   El header del sitio SÍ debe ser fijo; el de un artículo NO.
   Override aditivo — NO se toca styles.min.css (legacy compartido).
   ========================================================= */
.article-header {
  position: static;
  z-index: auto;
  background: none;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
  border-bottom: 0;
  padding: 0;
}
.article-header::after { content: none; }

/* =========================================================
   7. P0-3 FIX (jul-26) — canvas.fx-starfield con opacity:0.85 fijo en
   TODAS las páginas. En el hero de index funciona (protagonista); en
   páginas de texto largo (guías/posts, data-page="guide-article" /
   "blog-article") la esfera 3D cruza párrafos y listas y daña el
   contraste. Se baja la opacidad SOLO ahí — NO se toca "home".
   Máscara radial adicional: despeja el centro (columna de lectura,
   ~820px) dejando el efecto visible en los márgenes.
   ========================================================= */
body[data-page="guide-article"] .fx-starfield,
body[data-page="blog-article"] .fx-starfield {
  opacity: 0.35;
  -webkit-mask-image: radial-gradient(ellipse 480px 100% at 50% 50%, transparent 55%, #000 100%);
  mask-image: radial-gradient(ellipse 480px 100% at 50% 50%, transparent 55%, #000 100%);
}

/* =========================================================
   8. CINEMÁTICA DE ENTRADA (jul-26) — solo home.
   CSS PURO, sin gate de JavaScript: la animación arranca al parsear,
   no al ejecutar. Dos razones:
     · LCP — un elemento con opacity:0 NO cuenta como pintado. El wordmark
       es el bloque de texto mayor (candidato a LCP), así que arranca a
       0.15s y está completo a 0.65s; los retrasos largos son solo para
       elementos que no compiten por la métrica.
     · Sin JS la página se ve igual (no hace falta guarda html.no-js).
   Solo se animan transform / opacity / filter — nunca layout.
   ========================================================= */
@keyframes fxCineUp {
  from { opacity: 0; transform: translate3d(0, 14px, 0); }
  to   { opacity: 1; transform: translate3d(0, 0, 0); }
}
@keyframes fxCineWordmark {
  from { opacity: 0; filter: blur(10px); transform: scale(0.96); }
  to   { opacity: 1; filter: blur(0);    transform: scale(1); }
}
@keyframes fxCinePop {
  from { opacity: 0; transform: translate3d(0, 10px, 0) scale(0.98); }
  to   { opacity: 1; transform: translate3d(0, 0, 0) scale(1); }
}
@keyframes fxCineCanvas { from { opacity: 0; } to { opacity: 0.85; } }

body[data-page="home"] .re-hero__eyebrow {
  animation: fxCineUp 0.55s cubic-bezier(0.16, 1, 0.3, 1) 0.05s both;
}
body[data-page="home"] .fx-wordmark__name {
  animation: fxCineWordmark 0.5s cubic-bezier(0.16, 1, 0.3, 1) 0.15s both;
}
body[data-page="home"] .fx-wordmark__sub {
  animation: fxCineUp 0.6s cubic-bezier(0.16, 1, 0.3, 1) 0.55s both;
}
/* La esfera entra cuando la marca ya está asentada. Se anima el canvas
   entero, no el bucle de dibujo: tocar el render sería arriesgado y aquí
   el efecto ("aparece") es el mismo. */
body[data-page="home"] canvas.fx-starfield {
  animation: fxCineCanvas 0.9s ease-out 0.7s both;
}
/* Especificidad deliberada: la regla de :120 (`body.reimagine .re-hero
   h1.fx-hero-title`) trae `animation: none` y es (0,3,2). Con el selector
   corto `body[data-page=home] .fx-hero-title` (0,2,1) ganaba ella y el H1
   se quedaba sin entrar. Aquí se sube a (0,4,2). */
body.reimagine[data-page="home"] .re-hero h1.fx-hero-title {
  animation: fxCineUp 0.6s cubic-bezier(0.16, 1, 0.3, 1) 1s both;
}
body[data-page="home"] .re-hero__ctas > * {
  animation: fxCinePop 0.5s cubic-bezier(0.16, 1, 0.3, 1) both;
}
body[data-page="home"] .re-hero__ctas > *:nth-child(1) { animation-delay: 1.15s; }
body[data-page="home"] .re-hero__ctas > *:nth-child(2) { animation-delay: 1.23s; }
body[data-page="home"] .re-hero__ctas > *:nth-child(3) { animation-delay: 1.31s; }
body[data-page="home"] .re-hero__ticker {
  animation: fxCineUp 0.6s cubic-bezier(0.16, 1, 0.3, 1) 1.35s both;
}

/* =========================================================
   9. ESCALONADO DE INTERRUPCIONES (jul-26) — solo home.
   Las tres cajas (idioma, cookies, WhatsApp) se pintaban a la vez sobre
   la secuencia. Aquí solo se retrasa CUÁNDO se ven, nunca SI aparecen:
   el consentimiento se sigue pidiendo solo y sigue bloqueando las cookies
   no esenciales. RGPD intacto.
   ========================================================= */
body[data-page="home"] .bio-cookie {
  animation: fxCineUp 0.5s cubic-bezier(0.16, 1, 0.3, 1) 2.2s both;
}
body[data-page="home"] #langPopup {
  animation: fxCineUp 0.5s cubic-bezier(0.16, 1, 0.3, 1) 2.6s both;
}
body[data-page="home"] .whatsapp-float {
  animation: fxCinePop 0.45s cubic-bezier(0.16, 1, 0.3, 1) 3s both;
}

/* =========================================================
   10. REVEAL DE COBERTURA (jul-26) — las 24 páginas que se quedaron sin
   animación. futurista.js etiqueta con .fx-reveal las secciones que no
   tienen ya reveal propio (.re-reveal de reimagine.js o .reveal de
   main.js) y las observa con SU PROPIO IntersectionObserver: futurista.js
   es defer, así que corre después de initReveal() de reimagine.js y no
   puede inyectarse en el suyo.
   INVARIANTE i18n: solo se etiquetan CONTENEDORES. Nunca un nodo con
   data-i18n — i18n.js reescribe su contenido después del parseo y animar
   el propio nodo deja texto invisible o en el idioma equivocado.
   ========================================================= */
.fx-reveal {
  opacity: 0;
  transform: translate3d(0, 18px, 0);
  transition: opacity 0.6s cubic-bezier(0.16, 1, 0.3, 1),
              transform 0.6s cubic-bezier(0.16, 1, 0.3, 1);
  will-change: opacity, transform;
}
.fx-reveal.is-visible {
  opacity: 1;
  transform: translate3d(0, 0, 0);
  will-change: auto;
}
/* Sin JS no hay observer: el contenido debe verse igual. */
html.no-js .fx-reveal { opacity: 1; transform: none; transition: none; }

/* =========================================================
   11. DEGRADACIÓN — reduced-motion apaga TODO lo de arriba.
   ========================================================= */
@media (prefers-reduced-motion: reduce) {
  body[data-page="home"] .re-hero__eyebrow,
  body[data-page="home"] .fx-wordmark__name,
  body[data-page="home"] .fx-wordmark__sub,
  body[data-page="home"] canvas.fx-starfield,
  body[data-page="home"] .fx-hero-title,
  body[data-page="home"] .re-hero__ctas > *,
  body[data-page="home"] .re-hero__ticker,
  body[data-page="home"] .bio-cookie,
  body[data-page="home"] #langPopup,
  body[data-page="home"] .whatsapp-float {
    animation: none !important;
    opacity: 1;
    transform: none;
    filter: none;
  }
  .fx-reveal, .fx-reveal.is-visible {
    opacity: 1; transform: none; transition: none;
  }
  .fx-parallax { transform: none !important; }
}
