/* =====================================================================
   HENET Ingenieros — landing (henet.kontrolia.net)
   Dirección C: "Claro con sala de máquinas".
   Sistema visual derivado de la identidad oficial HENET (navy → cian,
   Segoe UI + Consolas). Sin frameworks, sin Google Fonts.
   ===================================================================== */

/* ---------- Tokens ---------- */
:root {
  /* Color — identidad oficial HENET */
  --bg: #ffffff;
  --surface: #eef2f6;          /* Niebla */
  --surface-2: #e4eaf1;
  --ink: #1e2733;              /* Carbón — cuerpo */
  --muted: #5b6876;            /* Gris — secundario */
  --line: #d7dee6;             /* Borde hairline */
  --primary: #2b3a5e;          /* Navy */
  --primary-700: #233150;
  --secondary: #2d6ca0;        /* Azul */
  --accent: #1ca0be;           /* Cian */
  --accent-ink: #15788e;       /* Cian oscurecido — legible como texto en claro */

  /* Sala de máquinas (banda oscura) */
  --machine: #161d27;
  --machine-2: #1e2733;
  --machine-3: #28323f;
  --on-machine: #eef2f6;
  --on-machine-muted: #9aa7b4;

  /* Severidad (artefactos de peritaje) */
  --sev-crit: #c0392b;
  --sev-high: #e67e22;
  --sev-med: #e1b12c;
  --sev-low: #2e9e6b;

  --brand-gradient: linear-gradient(100deg, #2b3a5e 0%, #2d6ca0 55%, #1ca0be 100%);

  /* Tipografía */
  --font-sans: "Segoe UI Variable Text", "Segoe UI", system-ui, -apple-system, "Helvetica Neue", Arial, sans-serif;
  --font-display: "Segoe UI Variable Display", "Segoe UI Semibold", "Segoe UI", system-ui, -apple-system, Arial, sans-serif;
  --font-mono: "Consolas", "SFMono-Regular", ui-monospace, "Cascadia Mono", "Courier New", monospace;

  /* Escala de espacio (4pt) */
  --s1: 4px;  --s2: 8px;  --s3: 12px; --s4: 16px; --s5: 24px;
  --s6: 32px; --s7: 48px; --s8: 64px; --s9: 96px; --s10: 128px;

  --radius: 12px;
  --radius-sm: 8px;
  --radius-lg: 18px;

  --shadow-sm: 0 1px 2px rgba(30, 39, 51, .06), 0 1px 3px rgba(30, 39, 51, .05);
  --shadow-md: 0 8px 24px rgba(30, 39, 51, .08), 0 2px 6px rgba(30, 39, 51, .05);
  --shadow-lg: 0 24px 60px rgba(22, 29, 39, .16);

  --ease-out-quart: cubic-bezier(.25, 1, .5, 1);
  --ease-out-quint: cubic-bezier(.22, 1, .36, 1);
  --ease-out-expo: cubic-bezier(.16, 1, .3, 1);

  /* z-index semántico */
  --z-nav: 100;
  --z-dropdown: 200;
  --z-overlay: 900;
  --z-modal: 1000;

  --maxw: 1200px;
  --pad: clamp(20px, 5vw, 40px);
}

/* ---------- Reset ---------- */
*, *::before, *::after { box-sizing: border-box; }
* { margin: 0; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; scroll-padding-top: 80px; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

body {
  font-family: var(--font-sans);
  font-size: 1.0625rem;          /* 17px */
  line-height: 1.6;
  color: var(--ink);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  font-kerning: normal;
  overflow-x: hidden;
}

img, svg { display: block; max-width: 100%; }
a { color: var(--secondary); text-decoration: none; }
a:hover { color: var(--primary); }
::selection { background: var(--accent); color: #fff; }

:where(a, button, input, select, textarea):focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  border-radius: 4px;
}

/* ---------- Tipografía ---------- */
h1, h2, h3 {
  font-family: var(--font-display);
  color: var(--primary);
  line-height: 1.08;
  letter-spacing: -.018em;
  font-weight: 700;
  text-wrap: balance;
}
h1 { font-size: clamp(2.4rem, 1.4rem + 4.6vw, 4.6rem); }
h2 { font-size: clamp(1.85rem, 1.2rem + 2.6vw, 3rem); letter-spacing: -.02em; }
h3 { font-size: clamp(1.2rem, 1.05rem + .7vw, 1.5rem); line-height: 1.18; letter-spacing: -.01em; }
p { text-wrap: pretty; }

.lead { font-size: clamp(1.1rem, 1rem + .6vw, 1.35rem); color: var(--ink); line-height: 1.5; }

/* etiqueta mono — "el código es la voz" */
.mono-tag {
  font-family: var(--font-mono);
  font-size: .78rem;
  letter-spacing: .02em;
  color: var(--accent-ink);
  display: inline-block;
}
.band--machine .mono-tag { color: var(--accent); }

/* ---------- Layout helpers ---------- */
.container { width: 100%; max-width: var(--maxw); margin-inline: auto; padding-inline: var(--pad); }
.section { padding-block: clamp(64px, 9vw, 120px); }
.section--tight { padding-block: clamp(48px, 6vw, 80px); }
.band--mist { background: var(--surface); }
.measure { max-width: 62ch; }

.section-head { max-width: 60ch; margin-bottom: var(--s7); }
.section-head p { color: var(--muted); margin-top: var(--s3); font-size: 1.12rem; }

.skip-link {
  position: absolute; left: var(--s4); top: -60px;
  background: var(--primary); color: #fff; padding: 10px 16px;
  border-radius: 8px; z-index: var(--z-modal); transition: top .2s var(--ease-out-quart);
}
.skip-link:focus { top: var(--s4); color: #fff; }

/* ---------- Botones ---------- */
.btn {
  --btn-bg: var(--primary);
  --btn-fg: #fff;
  display: inline-flex; align-items: center; gap: 10px;
  font-family: var(--font-sans); font-size: 1rem; font-weight: 600;
  line-height: 1; padding: 14px 22px; border-radius: 10px;
  background: var(--btn-bg); color: var(--btn-fg);
  border: 1px solid transparent; cursor: pointer;
  transition: transform .18s var(--ease-out-quart), background-color .2s, border-color .2s, color .2s;
  white-space: nowrap;
}
.btn:hover { background: var(--primary-700); color: #fff; transform: translateY(-1px); }
.btn:active { transform: translateY(0); }
.btn svg { width: 18px; height: 18px; }

.btn--ghost { --btn-bg: transparent; --btn-fg: var(--primary); border-color: var(--line); }
.btn--ghost:hover { background: var(--surface); color: var(--primary); border-color: var(--muted); transform: translateY(-1px); }
.band--machine .btn--ghost { --btn-fg: var(--on-machine); border-color: rgba(238,242,246,.28); }
.band--machine .btn--ghost:hover { background: rgba(238,242,246,.08); color: #fff; border-color: rgba(238,242,246,.5); }

.btn--wa { --btn-bg: transparent; --btn-fg: var(--primary); border-color: var(--line); }
.btn--wa:hover { background: var(--surface); color: var(--primary); border-color: var(--accent); transform: translateY(-1px); }
.band--machine .btn--wa { --btn-fg: var(--on-machine); border-color: rgba(28,160,190,.5); }
.band--machine .btn--wa:hover { background: rgba(28,160,190,.12); color:#fff; border-color: var(--accent); }

.btn--lg { padding: 16px 26px; font-size: 1.06rem; }
.btn--block { width: 100%; justify-content: center; }

.text-link {
  display: inline-flex; align-items: center; gap: 6px; font-weight: 600;
  color: var(--secondary);
}
.text-link svg { width: 16px; height: 16px; transition: transform .2s var(--ease-out-quart); }
.text-link:hover svg { transform: translateX(3px); }

/* =====================================================================
   NAV
   ===================================================================== */
.site-nav {
  position: fixed; inset: 0 0 auto 0; z-index: var(--z-nav);
  transition: background-color .3s var(--ease-out-quart), box-shadow .3s, border-color .3s;
  border-bottom: 1px solid transparent;
}
.site-nav__inner {
  max-width: var(--maxw); margin-inline: auto; padding: 14px var(--pad);
  display: flex; align-items: center; justify-content: space-between; gap: var(--s5);
}
.brand { display: inline-flex; align-items: center; gap: 11px; }
.brand__mark { width: 34px; height: 34px; flex: none; }
.brand__name {
  font-family: var(--font-display); font-weight: 700; font-size: 1.12rem;
  letter-spacing: .06em; color: var(--primary); line-height: 1;
}
.brand__name b { font-weight: 700; }
.brand__sub {
  display: block; font-family: var(--font-mono); font-size: .58rem;
  letter-spacing: .26em; color: var(--accent-ink); margin-top: 3px; font-weight: 400;
}
/* Sobre el hero oscuro (estado por defecto, arriba) */
.site-nav:not(.is-solid) .brand__name { color: #fff; }
.site-nav:not(.is-solid) .nav-links > li > a { color: var(--on-machine); }
.site-nav:not(.is-solid) .nav-toggle span { background: #fff; }

.site-nav.is-solid {
  background: rgba(255,255,255,.92);
  backdrop-filter: saturate(180%) blur(8px);
  border-bottom-color: var(--line);
  box-shadow: var(--shadow-sm);
}

.nav-links { list-style: none; display: flex; align-items: center; gap: var(--s5); padding: 0; }
.nav-links > li > a {
  font-size: .96rem; font-weight: 500; color: var(--ink); padding: 6px 2px;
  position: relative; transition: color .2s;
}
.nav-links > li > a::after {
  content: ""; position: absolute; left: 0; right: 100%; bottom: -2px; height: 2px;
  background: var(--accent); transition: right .25s var(--ease-out-quart);
}
.nav-links > li > a:hover::after, .nav-links > li > a.is-active::after { right: 0; }
.nav-links > li > a:hover { color: var(--primary); }
.site-nav:not(.is-solid) .nav-links > li > a:hover { color: #fff; }

.nav-menu { display: flex; align-items: center; gap: var(--s6); }
.nav-cta { display: inline-flex; }

.nav-toggle {
  display: none; width: 44px; height: 44px; background: none; border: 0; cursor: pointer;
  flex-direction: column; justify-content: center; align-items: center; gap: 5px;
}
.nav-toggle span { width: 24px; height: 2px; background: var(--ink); border-radius: 2px; transition: transform .25s var(--ease-out-quart), opacity .2s; }
.nav-toggle[aria-expanded="true"] span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.nav-toggle[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
.nav-toggle[aria-expanded="true"] span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

@media (max-width: 880px) {
  .nav-toggle { display: flex; }
  .nav-menu {
    position: fixed; inset: 64px 0 auto 0;
    background: rgba(255,255,255,.98); backdrop-filter: blur(8px);
    border-bottom: 1px solid var(--line); box-shadow: var(--shadow-md);
    flex-direction: column; align-items: stretch; gap: 0;
    padding: var(--s3) var(--pad) var(--s5);
    clip-path: inset(0 0 100% 0); transition: clip-path .3s var(--ease-out-quart);
    pointer-events: none;
  }
  .nav-menu.is-open { clip-path: inset(0 0 0 0); pointer-events: auto; }
  .nav-links { flex-direction: column; align-items: stretch; gap: 0; width: 100%; }
  .nav-links > li > a { display: block; padding: 14px 4px; color: var(--ink); border-bottom: 1px solid var(--line); }
  .site-nav:not(.is-solid) .nav-menu .nav-links > li > a { color: var(--ink); }
  .nav-links > li > a::after { display: none; }
  .nav-cta { margin-top: var(--s4); }
  .nav-cta .btn { width: 100%; justify-content: center; }
}

/* =====================================================================
   HERO — sala de máquinas (banda oscura)
   ===================================================================== */
.hero {
  position: relative; background: var(--machine); color: var(--on-machine);
  padding-top: clamp(120px, 16vh, 180px); padding-bottom: clamp(72px, 10vw, 120px);
  overflow: hidden;
}
.hero::before { /* trama de circuito muy tenue */
  content: ""; position: absolute; inset: 0; pointer-events: none; opacity: .5;
  background:
    radial-gradient(1100px 520px at 78% -8%, rgba(28,160,190,.16), transparent 60%),
    radial-gradient(900px 600px at 8% 110%, rgba(45,108,160,.18), transparent 55%);
}
.hero::after { /* rejilla fina */
  content: ""; position: absolute; inset: 0; pointer-events: none; opacity: .35;
  background-image: linear-gradient(rgba(154,167,180,.06) 1px, transparent 1px),
                    linear-gradient(90deg, rgba(154,167,180,.06) 1px, transparent 1px);
  background-size: 56px 56px; -webkit-mask-image: radial-gradient(1200px 700px at 70% 20%, #000, transparent 80%); mask-image: radial-gradient(1200px 700px at 70% 20%, #000, transparent 80%);
}
.hero__grid {
  position: relative; max-width: var(--maxw); margin-inline: auto; padding-inline: var(--pad);
  display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, .95fr);
  gap: clamp(32px, 5vw, 72px); align-items: center;
}
.hero__eyebrow {
  font-family: var(--font-mono); font-size: .82rem; letter-spacing: .04em;
  color: var(--accent); display: inline-flex; align-items: center; gap: 10px; margin-bottom: var(--s5);
}
.hero__eyebrow .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--sev-low); box-shadow: 0 0 0 4px rgba(46,158,107,.18); }
.hero h1 { color: #fff; max-width: 16ch; }
.hero h1 .grad { color: var(--accent); }
.hero__sub { margin-top: var(--s5); font-size: clamp(1.08rem, 1rem + .5vw, 1.3rem); line-height: 1.55; color: #cfd8e2; max-width: 46ch; }
.hero__cta { display: flex; flex-wrap: wrap; gap: var(--s3); margin-top: var(--s6); }
/* CTA primario del hero: blanco sobre la banda oscura para destacar */
.hero__cta > .btn:not(.btn--wa) { background: #fff; color: var(--primary); border-color: #fff; }
.hero__cta > .btn:not(.btn--wa):hover { background: #e6ecf2; color: var(--primary-700); border-color: #e6ecf2; }
.hero__trust {
  margin-top: var(--s6); display: flex; flex-wrap: wrap; gap: var(--s2) var(--s5);
  font-family: var(--font-mono); font-size: .8rem; color: var(--on-machine-muted);
}
.hero__trust span { display: inline-flex; align-items: center; gap: 8px; }
.hero__trust span::before { content: "›"; color: var(--accent); }

/* Terminal — artefacto técnico real */
.terminal {
  background: linear-gradient(180deg, #11161e, #0f141b);
  border: 1px solid #28323f; border-radius: 14px; box-shadow: var(--shadow-lg);
  overflow: hidden; font-family: var(--font-mono); font-size: .82rem; line-height: 1.75;
}
.terminal__bar { display: flex; align-items: center; gap: 8px; padding: 11px 14px; background: #0c1118; border-bottom: 1px solid #28323f; }
.terminal__dot { width: 11px; height: 11px; border-radius: 50%; background: #3a4654; }
.terminal__dot:nth-child(1) { background: #e5564e; }
.terminal__dot:nth-child(2) { background: #e1b12c; }
.terminal__dot:nth-child(3) { background: #2e9e6b; }
.terminal__title { margin-left: 8px; color: #6f7d8c; font-size: .76rem; }
.terminal__body { padding: 16px 18px 18px; color: #c6d0db; min-height: 264px; }
.terminal__body .ln { display: block; white-space: pre-wrap; word-break: break-word; }
.t-prompt { color: var(--accent); }
.t-user { color: #7fb2d6; }
.t-ok { color: var(--sev-low); }
.t-warn { color: var(--sev-med); }
.t-crit { color: #e5746a; }
.t-dim { color: #6f7d8c; }
.t-key { color: #d7dee6; }
.cursor { display: inline-block; width: 9px; height: 1.05em; background: var(--accent); translate: 0 2px; animation: blink 1.1s steps(1) infinite; }

@keyframes blink { 50% { opacity: 0; } }

@media (max-width: 900px) {
  .hero__grid { grid-template-columns: 1fr; }
  .hero__art { order: 2; }
  .hero h1 { max-width: 20ch; }
}

/* =====================================================================
   TESIS
   ===================================================================== */
.thesis { padding-block: clamp(56px, 7vw, 96px); }
.thesis__rule { height: 3px; width: 64px; background: var(--brand-gradient); border-radius: 3px; margin-bottom: var(--s5); }
.thesis p {
  font-family: var(--font-display); font-weight: 600; color: var(--primary);
  font-size: clamp(1.5rem, 1.1rem + 1.8vw, 2.3rem); line-height: 1.25; letter-spacing: -.015em;
  max-width: 22ch; text-wrap: balance;
}
.thesis p b { color: var(--accent-ink); font-weight: 600; }
.thesis .measure { margin-top: var(--s5); color: var(--muted); font-size: 1.1rem; max-width: 56ch; }

/* =====================================================================
   TRONCO — 3 pilares (asimétrico, no tarjetas clon)
   ===================================================================== */
.pillars { display: grid; grid-template-columns: repeat(12, 1fr); gap: var(--s5); }
.pillar {
  grid-column: span 4; padding: var(--s6) var(--s5);
  background: var(--bg); border: 1px solid var(--line); border-radius: var(--radius);
  transition: transform .25s var(--ease-out-quart), box-shadow .25s, border-color .25s;
  display: flex; flex-direction: column; gap: var(--s3);
}
.pillar:hover { transform: translateY(-3px); box-shadow: var(--shadow-md); border-color: var(--surface-2); }
.pillar--w7 { grid-column: span 7; }
.pillar--w5 { grid-column: span 5; }
.pillar--lead {
  grid-column: span 12; background: var(--machine); color: var(--on-machine);
  border-color: var(--machine-3);
  display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr); gap: var(--s6); align-items: center;
  padding: var(--s7) var(--s6);
}
.pillar--lead:hover { transform: none; box-shadow: var(--shadow-lg); }
.pillar--lead > div:first-child { display: flex; flex-direction: column; align-items: flex-start; gap: var(--s4); }
.pillar--lead h3 { color: #fff; font-size: clamp(1.5rem, 1.2rem + 1.2vw, 2rem); }
.pillar--lead p { color: #cfd8e2; margin: 0; }
.pillar__num { font-family: var(--font-mono); font-size: .8rem; color: var(--muted); }
.pillar h3 { color: var(--primary); }
.pillar p { color: var(--muted); font-size: 1rem; }
.pillar--lead .pillar__num { color: var(--accent); }
.pillar__proof {
  margin-top: var(--s2); font-family: var(--font-mono); font-size: .82rem; color: var(--accent-ink);
  display: inline-flex; align-items: center; gap: 8px;
}
.pillar--lead .pillar__proof { color: var(--accent); }
.pillar__proof::before { content: "▹"; }
.pillar__art { /* mini consola del pilar líder */
  background: #11161e; border: 1px solid #28323f; border-radius: 10px; padding: 14px 16px;
  font-family: var(--font-mono); font-size: .78rem; line-height: 1.7; color: #c6d0db;
}
.pillar__art .ln { display: block; }

@media (max-width: 860px) {
  .pillar, .pillar--w7, .pillar--w5 { grid-column: span 12; }
  .pillar--lead { grid-column: span 12; grid-template-columns: 1fr; }
}

/* =====================================================================
   PROCESO — medir → asegurar → automatizar (secuencia real)
   ===================================================================== */
.steps { display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--s5); counter-reset: step; }
.step {
  position: relative; padding-top: var(--s6); border-top: 2px solid var(--line);
}
.step::before {
  counter-increment: step; content: "0" counter(step);
  font-family: var(--font-mono); font-size: .9rem; color: var(--accent-ink);
  position: absolute; top: -2px; left: 0;
  border-top: 2px solid var(--accent); padding-top: var(--s4); padding-right: 18px;
}
.step h3 { margin-top: var(--s2); }
.step p { color: var(--muted); margin-top: var(--s3); }
.step__meta { margin-top: var(--s4); display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
  display: inline-flex; align-items: center; gap: 6px; font-family: var(--font-mono);
  font-size: .72rem; padding: 3px 9px; border-radius: 999px; border: 1px solid var(--line);
  color: var(--ink); background: var(--bg);
}
.chip .lvl { width: 7px; height: 7px; border-radius: 50%; }
.chip .crit { background: var(--sev-crit); } .chip .high { background: var(--sev-high); }
.chip .med { background: var(--sev-med); } .chip .low { background: var(--sev-low); }
@media (max-width: 760px) { .steps { grid-template-columns: 1fr; gap: var(--s6); } }

/* =====================================================================
   EL SISTEMA — "Operación Gestionada": la empresa se arma por capas.
   Plano técnico (SVG) pegado al scroll + las seis capas en orden.
   Estado por defecto = TODO ARMADO (sin JS, sin soporte, o con
   prefers-reduced-motion). La clase .js habilita el estado fantasma
   y el armado progresivo.
   ===================================================================== */
.band--plan {
  background-color: var(--surface);
  background-image:
    linear-gradient(to right, rgba(43, 58, 94, .05) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(43, 58, 94, .05) 1px, transparent 1px);
  background-size: 32px 32px;
}
.assembly h2 .grad { color: var(--accent-ink); }
.assembly .section-head { max-width: 66ch; margin-bottom: var(--s5); }
.assembly .section-head .mono-tag { margin-bottom: var(--s2); }

.assembly__hint {
  display: flex; align-items: flex-start; gap: 8px;
  font-family: var(--font-mono); font-size: .82rem; color: var(--muted);
}
.assembly__hint svg { width: 14px; height: 14px; margin-top: 3px; color: var(--accent-ink); flex: none; }
.js .assembly__hint svg { animation: asm-nudge 2.6s var(--ease-out-quart) infinite; }
@keyframes asm-nudge { 0%, 62%, 100% { transform: none; } 78% { transform: translateY(4px); } }

.assembly__grid {
  margin-top: clamp(28px, 4vw, 52px);
  display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: clamp(28px, 4vw, 64px); align-items: start;
}
.assembly__sheet { position: sticky; top: 84px; }
.asm-sheet {
  background: var(--bg); border: 1px solid var(--line);
  border-radius: var(--radius-lg); box-shadow: var(--shadow-md); padding: 10px;
}
.asm-plan { width: 100%; height: auto; aspect-ratio: 620 / 600; }

/* ---- tipografía y trazos del plano ---- */
.asm-hdr, .asm-readout, .asm-ground__t, .asm-roof__t, .asm-area__c {
  font-family: var(--font-mono); fill: var(--muted); font-size: 11px;
}
.asm-hdr { fill: var(--accent-ink); }
.asm-readout { font-size: 10.5px; }
.asm-roof__t { font-size: 10.5px; }
.asm-area__c { font-size: 10.5px; }
.asm-rule { stroke: var(--line); }
.asm-ground { stroke: var(--primary); stroke-opacity: .5; }
.asm-hatch path { stroke: var(--primary); stroke-opacity: .28; fill: none; }

.asm-ghost {
  fill: none; stroke: var(--primary); stroke-opacity: .34;
  stroke-width: 1; stroke-dasharray: 5 5;
}
.asm-slab__r, .asm-area__r { fill: var(--bg); stroke: var(--primary); stroke-width: 1.25; }
.asm-roof__r { fill: url(#asmSeal); }
.asm-slab__e, .asm-area__e { fill: var(--secondary); }
.asm-slab__n, .asm-area__n {
  font-family: var(--font-display); font-weight: 600; fill: var(--primary);
}
.asm-slab__n { font-size: 16px; }
.asm-area__n { font-size: 13.5px; }
.asm-slab__a { font-family: var(--font-mono); font-size: 10.5px; fill: var(--muted); }
.asm-wire { fill: none; stroke: var(--primary); stroke-opacity: .3; stroke-width: 1.1; }

/* ---- armado progresivo (sólo con JS) ---- */
.asm-ghost { opacity: 0; }
.js .asm-slab .asm-ghost,
.js .asm-area .asm-ghost,
.js .asm-roof .asm-ghost { opacity: 1; transition: opacity .35s var(--ease-out-quart); }
.js .asm-solid {
  opacity: 0; transform: translateY(7px);
  transition: opacity .45s var(--ease-out-expo), transform .45s var(--ease-out-expo);
}
.js .is-built > .asm-ghost { opacity: 0; }
.js .is-built > .asm-solid { opacity: 1; transform: none; }
.js .asm-roof__t { opacity: .35; transition: opacity .35s; }
.js .asm-roof.is-built .asm-roof__t { opacity: 1; }

.js .asm-wire {
  stroke-dasharray: 100; stroke-dashoffset: 100; opacity: 0;
  transition: stroke-dashoffset .75s var(--ease-out-quart), opacity .35s, stroke .25s;
}
.js .asm-wire.is-built { stroke-dashoffset: 0; opacity: .3; }
.js .asm-wire.is-active { opacity: 1; stroke: var(--accent); stroke-width: 1.7; }

/* la capa que se está leyendo se marca en cian */
.asm-slab.is-active .asm-slab__r,
.asm-area.is-active .asm-area__r { stroke: var(--accent); stroke-width: 1.9; }
.asm-slab.is-active .asm-slab__e,
.asm-area.is-active .asm-area__e { fill: var(--accent); }

/* ---- los pasos ---- */
.assembly__steps { display: grid; gap: clamp(28px, 3.4vw, 48px); }
.asm-step { display: grid; grid-template-columns: 14px minmax(0, 1fr); gap: var(--s5); }
.asm-step__rail { position: relative; }
.asm-step__rail::before {
  content: ""; position: absolute; left: 6px; top: 6px; bottom: 0; width: 1px;
  background: var(--line);
}
.asm-step__rail::after {
  content: ""; position: absolute; left: 0; top: 4px; width: 13px; height: 13px;
  border-radius: 50%; border: 2px solid var(--line); background: var(--bg);
  transition: border-color .3s, background-color .3s;
}
.asm-step.is-active .asm-step__rail::after { border-color: var(--accent); background: var(--accent); }
.asm-step:last-of-type .asm-step__rail::before { bottom: 12px; }

.asm-step__body > .mono-tag { margin-bottom: 2px; }
.asm-step__body > p { color: var(--muted); margin-top: var(--s3); max-width: 56ch; }
.asm-parts { list-style: none; padding: 0; margin: var(--s4) 0 0; display: grid; gap: 7px; }
.asm-parts li { position: relative; padding-left: 20px; font-size: .97rem; }
.asm-parts li::before {
  content: ""; position: absolute; left: 0; top: .72em; width: 10px; height: 1px;
  background: var(--accent-ink);
}
.asm-where { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: var(--s5); }
.asm-where__label {
  font-family: var(--font-mono); font-size: .72rem; color: var(--muted);
  padding-right: 4px; border-right: 1px solid var(--line);
}
.asm-step__proof { font-family: var(--font-mono); font-size: .8rem; color: var(--accent-ink); margin-top: var(--s4); }

.asm-close {
  margin-top: var(--s4); padding: var(--s5) var(--s6);
  background: var(--bg); border: 1px solid var(--line); border-top: 2px solid var(--accent);
  border-radius: var(--radius);
}
.asm-close p { color: var(--ink); max-width: 58ch; }
.asm-close b { color: var(--primary); }
.asm-close__cta { display: flex; flex-wrap: wrap; align-items: center; gap: var(--s5); margin-top: var(--s5); }

/* ---- responsivo: sin sticky, y en teléfono el plano se recorta a la torre ---- */
@media (max-width: 960px) {
  .assembly__grid { grid-template-columns: 1fr; }
  .assembly__sheet { position: static; max-width: 640px; }
}
@media (max-width: 600px) {
  /* la proporción angosta hace que el "slice" del SVG deje sólo el plato
     izquierdo; el cableado y las áreas viven en el texto de cada capa */
  .asm-plan { aspect-ratio: 366 / 600; }
  .asm-side { display: none; }
}
@media (max-height: 700px) and (min-width: 961px) {
  .assembly__sheet { position: static; }
}
@media (max-width: 520px) {
  .asm-step { grid-template-columns: 1fr; gap: var(--s3); }
  .asm-step__rail { display: none; }
}

/* accesibilidad: quien pide menos movimiento ve el sistema ya armado */
@media (prefers-reduced-motion: reduce) {
  .js .asm-ghost { opacity: 0 !important; }
  .js .asm-solid { opacity: 1 !important; transform: none !important; }
  .js .asm-roof__t { opacity: 1 !important; }
  .js .asm-wire { stroke-dashoffset: 0 !important; opacity: .3 !important; }
  .js .assembly__hint svg { animation: none !important; }
}

/* =====================================================================
   KONTROLIA — buque insignia
   ===================================================================== */
.flagship__grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.05fr); gap: clamp(32px, 5vw, 72px); align-items: center; }
.flagship h2 .grad { color: var(--accent-ink); }
.flagship .lead { color: var(--muted); margin-top: var(--s4); }
.flagship__features { list-style: none; padding: 0; margin: var(--s5) 0 var(--s6); display: grid; gap: var(--s3); }
.flagship__features li { display: flex; align-items: flex-start; gap: 12px; color: var(--ink); }
.flagship__features svg { width: 20px; height: 20px; color: var(--accent-ink); flex: none; margin-top: 2px; }
.flagship__proof { font-family: var(--font-mono); font-size: .86rem; color: var(--muted); margin-top: var(--s4); }

.product {
  background: var(--machine); border: 1px solid var(--machine-3); border-radius: 16px;
  box-shadow: var(--shadow-lg); overflow: hidden;
}
.product__bar { display: flex; align-items: center; gap: 8px; padding: 11px 14px; background: #0c1118; border-bottom: 1px solid var(--machine-3); }
.product__bar .terminal__dot { width: 10px; height: 10px; }
.product__url { margin-left: 8px; font-family: var(--font-mono); font-size: .74rem; color: #6f7d8c; }
.product__topline { display: flex; align-items: center; justify-content: space-between; padding: 16px 18px; border-bottom: 1px solid var(--machine-3); }
.product__logo { font-family: var(--font-display); font-weight: 700; color: #fff; font-size: 1.05rem; letter-spacing: -.01em; }
.product__logo span { color: var(--accent); }
.product__pill { font-family: var(--font-mono); font-size: .68rem; color: var(--on-machine-muted); border: 1px solid var(--machine-3); border-radius: 999px; padding: 4px 10px; }
.product__panels { display: grid; grid-template-columns: 1.3fr 1fr; gap: 14px; padding: 18px; }
.pcard { background: #131922; border: 1px solid var(--machine-3); border-radius: 10px; padding: 14px; }
.pcard h4, .pcard__label { font-family: var(--font-sans); font-size: .8rem; font-weight: 600; color: var(--on-machine-muted); margin-bottom: 10px; letter-spacing: .01em; }
.pbars { display: grid; gap: 8px; align-content: end; height: 118px; grid-auto-flow: column; align-items: end; }
.pbar { width: 100%; background: linear-gradient(180deg, var(--accent), var(--secondary)); border-radius: 4px 4px 0 0; min-height: 8px; }
.pcaption { font-family: var(--font-mono); font-size: .72rem; color: var(--on-machine-muted); margin-top: 12px; }
.pcaption b { color: var(--sev-low); font-weight: 400; }
.prow { display: flex; align-items: center; justify-content: space-between; font-family: var(--font-mono); font-size: .76rem; color: #c6d0db; padding: 6px 0; border-bottom: 1px solid rgba(40,50,63,.7); }
.prow:last-child { border-bottom: 0; }
.prow .ok { color: var(--sev-low); }
.product__assistant { margin: 0 18px 18px; background: #0f141b; border: 1px solid var(--machine-3); border-radius: 10px; padding: 12px 14px; font-family: var(--font-mono); font-size: .78rem; color: #c6d0db; }
.product__assistant .q { color: var(--on-machine-muted); }
.product__assistant .a { color: var(--accent); margin-top: 6px; }

@media (max-width: 900px) {
  .flagship__grid { grid-template-columns: 1fr; }
  .flagship__art { order: 2; }
  .product__panels { grid-template-columns: 1fr; }
}

/* =====================================================================
   CAPACIDADES — los 6 (lista integrada, no grid de clones)
   ===================================================================== */
.caps { border-top: 1px solid var(--line); }
.cap {
  display: grid; grid-template-columns: minmax(0, .8fr) minmax(0, 1.5fr);
  gap: var(--s3) var(--s6); align-items: baseline;
  padding: var(--s5) var(--s4); margin-inline: calc(var(--s4) * -1);
  border-bottom: 1px solid var(--line); border-radius: var(--radius-sm);
  transition: background-color .2s;
}
.cap:hover { background: var(--surface); }
.cap h3 { font-size: 1.18rem; color: var(--primary); }
.cap p { color: var(--muted); font-size: 1rem; }
@media (max-width: 720px) {
  .cap { grid-template-columns: 1fr; gap: 6px; }
}

/* =====================================================================
   CONTACTO
   ===================================================================== */
.contact__grid { display: grid; grid-template-columns: minmax(0, .9fr) minmax(0, 1.1fr); gap: clamp(32px, 5vw, 64px); align-items: start; }
.contact__info { display: grid; gap: var(--s4); }
.cinfo { display: flex; gap: 14px; align-items: flex-start; }
.cinfo__icon { width: 42px; height: 42px; flex: none; display: grid; place-items: center; border-radius: 10px; background: var(--surface); color: var(--primary); }
.cinfo__icon svg { width: 20px; height: 20px; }
.cinfo h3 { font-size: 1rem; color: var(--primary); font-family: var(--font-sans); font-weight: 600; }
.cinfo p, .cinfo a { color: var(--muted); font-size: .98rem; line-height: 1.45; }
.cinfo a:hover { color: var(--primary); }
.social { display: flex; gap: 10px; margin-top: var(--s3); }
.social a { width: 42px; height: 42px; display: grid; place-items: center; border-radius: 10px; border: 1px solid var(--line); color: var(--muted); transition: color .2s, border-color .2s, transform .2s; }
.social a:hover { color: var(--primary); border-color: var(--accent); transform: translateY(-2px); }
.social svg { width: 19px; height: 19px; }

.form-card { background: var(--bg); border: 1px solid var(--line); border-radius: var(--radius-lg); padding: clamp(20px, 3vw, 34px); box-shadow: var(--shadow-md); }
.form-card > h3 { color: var(--primary); }
.form-card__sub { color: var(--muted); margin-top: 4px; margin-bottom: var(--s5); }
.field { margin-bottom: var(--s4); }
.field label { display: block; font-size: .88rem; font-weight: 600; color: var(--ink); margin-bottom: 7px; }
.field input, .field select, .field textarea {
  width: 100%; font-family: var(--font-sans); font-size: 1rem; color: var(--ink);
  padding: 12px 14px; border: 1px solid var(--line); border-radius: 10px; background: var(--bg);
  transition: border-color .2s, box-shadow .2s;
}
.field input::placeholder, .field textarea::placeholder { color: var(--muted); }
.field input:focus, .field select:focus, .field textarea:focus {
  outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px rgba(28,160,190,.16);
}
.field select { appearance: none; cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%235b6876' stroke-width='2'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 14px center; padding-right: 40px;
}
.field textarea { resize: vertical; min-height: 110px; }
.field .err { display: none; color: var(--sev-crit); font-size: .82rem; margin-top: 6px; }
.field.invalid input, .field.invalid select { border-color: var(--sev-crit); }
.field.invalid .err { display: block; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: var(--s4); }
.form-actions { display: grid; gap: var(--s3); margin-top: var(--s5); }
.form-or { text-align: center; font-family: var(--font-mono); font-size: .76rem; color: var(--muted); }
.form-privacy { font-size: .8rem; color: var(--muted); margin-top: var(--s3); text-align: center; }
.form-success { display: none; text-align: center; padding: var(--s6) var(--s4); }
.form-success.show { display: block; }
.form-success svg { width: 54px; height: 54px; color: var(--sev-low); margin: 0 auto var(--s4); }
.form-success h3 { color: var(--primary); }
.form-success p { color: var(--muted); margin-top: var(--s2); }
@media (max-width: 920px) { .contact__grid { grid-template-columns: 1fr; } }
@media (max-width: 480px) { .form-row { grid-template-columns: 1fr; } }

/* =====================================================================
   FOOTER
   ===================================================================== */
.footer { background: var(--machine); color: var(--on-machine-muted); padding-block: var(--s8) var(--s6); }
.footer__top { display: flex; flex-wrap: wrap; justify-content: space-between; gap: var(--s6); align-items: flex-start; }
.footer__brand { display: flex; align-items: center; gap: 12px; }
.footer__brand .brand__mark { width: 40px; height: 40px; }
.footer__brand strong { color: #fff; font-family: var(--font-display); letter-spacing: .04em; }
.footer__brand p { color: var(--on-machine-muted); font-size: .9rem; margin-top: 2px; }
.footer__links { display: flex; flex-wrap: wrap; gap: var(--s5); }
.footer__links a { color: var(--on-machine-muted); font-size: .92rem; }
.footer__links a:hover { color: #fff; }
.footer__bottom {
  margin-top: var(--s7); padding-top: var(--s5); border-top: 1px solid var(--machine-3);
  display: flex; flex-wrap: wrap; justify-content: space-between; gap: var(--s3);
  font-size: .85rem;
}
.footer__bottom .mono { font-family: var(--font-mono); font-size: .76rem; color: #828d9b; }

/* ---------- Family kit: tira de ecosistema (componente conector) ---------- */
.ecosystem { margin-top: var(--s7); padding-top: var(--s5); border-top: 1px solid var(--machine-3); display: flex; flex-wrap: wrap; align-items: baseline; gap: var(--s3) var(--s6); }
.ecosystem__label { font-family: var(--font-mono); font-size: .72rem; letter-spacing: .1em; text-transform: uppercase; color: var(--on-machine-muted); }
.ecosystem__list { list-style: none; display: flex; flex-wrap: wrap; gap: var(--s3) var(--s5); padding: 0; }
.ecosystem__list a { display: inline-flex; align-items: center; gap: 8px; color: var(--on-machine); font-size: .94rem; font-weight: 600; }
.ecosystem__list a:hover { color: #fff; }
.ecosystem__list .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--c, var(--accent)); flex: none; }
.ecosystem__role { font-family: var(--font-mono); font-size: .72rem; font-weight: 400; color: var(--on-machine-muted); }

/* ---------- Family kit: cross-link contextual (venta cruzada) ---------- */
.cross-link { display: inline-flex; align-items: center; gap: 8px; margin-top: var(--s4); font-size: .92rem; color: var(--muted); line-height: 1.4; }
.cross-link::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: #7a0230; flex: none; }
.cross-link b { color: var(--secondary); font-weight: 600; }
.cross-link:hover b { color: var(--primary); }
.cross-link svg { width: 15px; height: 15px; transition: transform .2s var(--ease-out-quart); }
.cross-link:hover svg { transform: translateX(3px); }

/* =====================================================================
   MOTION — revelado aditivo (visible por defecto)
   ===================================================================== */
/* Revelado al hacer scroll — CSS puro, VISIBLE por defecto (sin gating por JS/IO).
   Sin soporte de scroll-timeline (Safari/Firefox) o con reduced-motion: contenido visible. */
@media (prefers-reduced-motion: no-preference) {
  @supports (animation-timeline: view()) {
    .reveal {
      opacity: 0; transform: translateY(16px);
      animation: reveal-in linear both;
      animation-timeline: view();
      animation-range: entry 0% entry 55%;
    }
  }
}
html.reveal-all .reveal { opacity: 1 !important; transform: none !important; animation: none !important; }

/* hero choreography */
.js .hero h1, .js .hero__sub, .js .hero__cta, .js .hero__eyebrow, .js .hero__trust {
  opacity: 0; transform: translateY(16px);
  animation: rise .8s var(--ease-out-expo) forwards;
}
.js .hero__eyebrow { animation-delay: .05s; }
.js .hero h1 { animation-delay: .12s; }
.js .hero__sub { animation-delay: .24s; }
.js .hero__cta { animation-delay: .34s; }
.js .hero__trust { animation-delay: .44s; }
.js .hero__art { opacity: 0; animation: rise .9s var(--ease-out-expo) .3s forwards; }
.js .terminal .ln { opacity: 0; animation: fadeline .45s var(--ease-out-quart) forwards; animation-delay: calc(.6s + var(--l, 0) * .28s); }

@keyframes rise { to { opacity: 1; transform: none; } }
@keyframes fadeline { to { opacity: 1; } }
@keyframes reveal-in { to { opacity: 1; transform: none; } }

@media (prefers-reduced-motion: reduce) {
  .reveal,
  .js .hero h1, .js .hero__sub, .js .hero__cta, .js .hero__eyebrow, .js .hero__trust,
  .js .hero__art, .js .terminal .ln {
    opacity: 1 !important; transform: none !important; animation: none !important; transition: none !important;
  }
  .cursor { animation: none; }
  * { animation-duration: .001ms !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important; }
}

/* =====================================================================
   LEGAL — páginas de cumplimiento (aviso, términos, cookies, ARCO),
   hub legal del footer y consentimiento del formulario.
   ===================================================================== */
.legal-top { position: sticky; top: 0; z-index: var(--z-nav); background: rgba(255,255,255,.92); backdrop-filter: blur(8px); border-bottom: 1px solid var(--line); }
.legal-top__inner { max-width: var(--maxw); margin: 0 auto; padding: 14px var(--pad); display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.legal-top .brand { display: flex; align-items: center; gap: 10px; color: var(--ink); }
.legal-top .brand__name { font-family: var(--font-display); font-weight: 700; letter-spacing: .02em; }
.legal-top .brand__sub { font-family: var(--font-mono); font-size: .62rem; letter-spacing: .18em; color: var(--muted); display: block; margin-top: -2px; }
.legal-back { font-family: var(--font-mono); font-size: .9rem; color: var(--accent-ink); }
.legal-back:hover { color: var(--primary); }

.legal { padding: clamp(32px, 6vw, 72px) 0 80px; }
.legal .container { max-width: 780px; }
.legal__head { margin-bottom: 28px; padding-bottom: 22px; border-bottom: 1px solid var(--line); }
.legal__head h1 { font-family: var(--font-display); font-size: clamp(1.7rem, 4vw, 2.4rem); line-height: 1.15; color: var(--primary); letter-spacing: -.02em; }
.legal__meta { margin-top: 12px; font-family: var(--font-mono); font-size: .82rem; color: var(--muted); display: flex; flex-wrap: wrap; gap: 6px 18px; }
.legal__summary { margin: 0 0 30px; padding: 18px 22px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); }
.legal__summary h2 { font-family: var(--font-display); font-size: 1rem; margin-bottom: 8px; color: var(--primary); }
.legal__summary p { font-size: .95rem; color: var(--muted); margin: 0 0 8px; }
.legal__summary p:last-child { margin-bottom: 0; }
.legal__body { color: var(--ink); }
.legal__body h2 { font-family: var(--font-display); font-size: 1.32rem; margin: 38px 0 12px; color: var(--primary); scroll-margin-top: 80px; }
.legal__body h3 { font-size: 1.06rem; margin: 22px 0 8px; color: var(--ink); }
.legal__body p { margin: 0 0 14px; }
.legal__body ul, .legal__body ol { margin: 0 0 16px; padding-left: 22px; }
.legal__body li { margin-bottom: 6px; }
.legal__body strong, .legal__body b { color: var(--ink); font-weight: 650; }
.legal__body code { font-family: var(--font-mono); font-size: .9em; background: var(--surface); padding: 1px 5px; border-radius: 4px; color: var(--accent-ink); }
.legal__body table { width: 100%; border-collapse: collapse; margin: 8px 0 22px; font-size: .9rem; }
.legal__body th, .legal__body td { border: 1px solid var(--line); padding: 8px 10px; text-align: left; vertical-align: top; }
.legal__body th { background: var(--surface); font-weight: 600; color: var(--primary); }
.legal__body hr { border: 0; border-top: 1px solid var(--line); margin: 26px 0; }
.legal__sign { margin-top: 34px; padding-top: 20px; border-top: 1px solid var(--line); font-family: var(--font-mono); font-size: .8rem; color: var(--muted); line-height: 1.7; }

/* Hub legal del footer (footer oscuro) */
.footer__legal { display: flex; flex-wrap: wrap; gap: 8px 22px; padding-top: 18px; margin-top: 18px; border-top: 1px solid rgba(255,255,255,.08); }
.footer__legal a { font-size: .86rem; color: var(--on-machine-muted); }
.footer__legal a:hover { color: var(--on-machine); }

/* Consentimiento del formulario */
.consent { display: flex; gap: 10px; align-items: flex-start; margin: 2px 0 14px; font-size: .9rem; color: var(--muted); line-height: 1.5; }
.consent input[type="checkbox"] { margin-top: 3px; width: 17px; height: 17px; flex: 0 0 auto; accent-color: var(--accent); cursor: pointer; }
.consent a { color: var(--accent-ink); text-decoration: underline; }
.consent a:hover { color: var(--primary); }
.field--check.invalid .consent { color: var(--sev-crit); }
.field--check.invalid .consent input { outline: 2px solid var(--sev-crit); outline-offset: 2px; }
.hp { position: absolute !important; left: -9999px !important; width: 1px; height: 1px; overflow: hidden; }
.form-error { color: var(--sev-crit); font-size: .9rem; margin-top: 10px; display: none; }
.form-error.show { display: block; }
