/* alphateklab · sistema visual. Paleta versátil del 6-oct-2026 (antes: la marca v1 de Jonathan del 3-oct, ámbar y verde
   petróleo): base neutra fría, índigo #4F46E5 para la acción (botones; texto blanco encima, y en oscuro índigo claro
   #8B93F8 con texto oscuro) y verde azulado #0F766E para números, palomitas y antetítulos. Todo color sale de los
   tokens de abajo (claro y oscuro). Manrope para títulos e Inter para texto, autoalojadas. Los nombres de los tokens se
   mantienen (senal = la acción; petroleo-hondo = la superficie oscura de marca). */

@font-face {
  font-family: "Manrope";
  font-style: normal;
  font-weight: 400 800;
  font-display: swap;
  src: url("fuentes/manrope-latin.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "Manrope";
  font-style: normal;
  font-weight: 400 800;
  font-display: swap;
  src: url("fuentes/manrope-latin-ext.woff2") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: "Inter";
  font-style: normal;
  font-weight: 400 800;
  font-display: swap;
  src: url("fuentes/inter-latin.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "Inter";
  font-style: normal;
  font-weight: 400 800;
  font-display: swap;
  src: url("fuentes/inter-latin-ext.woff2") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

:root {
  /* Paleta versátil (6-oct-2026): base neutra fría, una acción (índigo) y un acento (verde azulado). Todo sale de
     estos tokens: para cambiar de paleta basta con cambiarlos aquí (y su versión oscura abajo). Contrastes revisados:
     texto ≥ 4.5:1, bordes de control y foco ≥ 3:1, en claro y en oscuro. */
  --papel: #f6f7f9;
  --papel-2: #eef0f4;
  --papel-3: #e3e7ee;
  --tinta: #141922;
  --tinta-2: #343c4a;
  --tinta-3: #535d6c;
  --linea: #dde2ea;
  --linea-fuerte: #9aa3b2;
  --senal: #4f46e5; /* la acción: botones, «Agregar a mi lista»; encima va --sobre-senal */
  --senal-fuerte: #4338ca;
  --senal-suave: #e7e6fd;
  --sobre-senal: #ffffff;
  --acento: #0f766e; /* números, palomitas, antetítulos */
  --petroleo-hondo: #151a30; /* superficie de marca oscura (el héroe de la portada) */
  --apoyo: #e2f3f0;
  --foco: #4f46e5;
  --enlace: #4338ca;
  --ok: #157a3c;
  --aviso: #9a5a0a;
  --peligro: #b42318;
  --ok-fondo: #e3f2e7;
  --aviso-fondo: #fbeedd;
  --peligro-fondo: #fbe6e3;

  --f-texto: "Inter", "Helvetica Neue", Arial, sans-serif;
  --f-titulo: "Manrope", "Inter", "Helvetica Neue", Arial, sans-serif;
  --f-mono: ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace; /* solo para código */

  /* escala 1.25 sobre 16 px */
  --t-xs: 0.8125rem;
  --t-s: 0.9375rem;
  --t-m: 1.0625rem;
  --t-l: 1.25rem;
  --t-xl: 1.5625rem;
  --t-2xl: 2rem;
  --t-3xl: clamp(1.875rem, 3.2vw, 2.5rem); /* títulos de sección: 30 → 40 px */
  --t-sub: clamp(1.25rem, 1.8vw, 1.625rem); /* subtítulos y h3 de bloque: 20 → 26 px */
  --t-4xl: clamp(2.5rem, 4.1vw, 3.3rem); /* titular de portada: 40 → 53 px (los títulos de sección llegan a 40) */

  /* espacio base 4 px */
  --e-1: 4px;
  --e-2: 8px;
  --e-3: 12px;
  --e-4: 16px;
  --e-5: 24px;
  --e-6: 32px;
  --e-7: 48px;
  --e-8: 72px;
  --e-9: 112px;
  /* aire entre secciones: 112 px en pantalla grande, 72 en el teléfono (ahí 112 era casi un cuarto de pantalla vacío) */
  --e-seccion: var(--e-9);

  --radio: 3px;
  --ancho: 1240px;
  --medida: 64ch;
  /* movimiento (guía sin slop §6.3): responder, estado, vista; salida más rápida que la entrada */
  --dur-respuesta: 120ms;
  --dur-estado: 220ms;
  --dur-vista: 340ms;
  --ease-salida: cubic-bezier(0.16, 1, 0.3, 1);
  --ease-mover: cubic-bezier(0.65, 0, 0.35, 1);
  --ease-irse: cubic-bezier(0.4, 0, 1, 1);
  --mov-dist: 10px;
  --mov: var(--dur-estado) var(--ease-salida);
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --papel: #0f1218;
    --papel-2: #161a22;
    --papel-3: #1f2430;
    --tinta: #eef1f6;
    --tinta-2: #c7cdd8;
    --tinta-3: #9aa3b2;
    --linea: #282e3a;
    --linea-fuerte: #4a5263;
    --senal: #8b93f8; /* en oscuro, la acción más clara, con texto oscuro encima */
    --senal-fuerte: #a5abff;
    --senal-suave: #23264a;
    --sobre-senal: #0f1218;
    --acento: #3fc9b8;
    --apoyo: #12302d;
    --foco: #a5abff;
    --enlace: #a9b0ff;
    --ok: #5fcf8a;
    --aviso: #f0a35a;
    --peligro: #ff8a7a;
    --ok-fondo: #12301f;
    --aviso-fondo: #33240f;
    --peligro-fondo: #3a1714;
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --papel: #0f1218;
  --papel-2: #161a22;
  --papel-3: #1f2430;
  --tinta: #eef1f6;
  --tinta-2: #c7cdd8;
  --tinta-3: #9aa3b2;
  --linea: #282e3a;
  --linea-fuerte: #4a5263;
  --senal: #8b93f8; /* en oscuro, la acción más clara, con texto oscuro encima */
  --senal-fuerte: #a5abff;
  --senal-suave: #23264a;
  --sobre-senal: #0f1218;
  --acento: #3fc9b8;
  --apoyo: #12302d;
  --foco: #a5abff;
  --enlace: #a9b0ff;
  --ok: #5fcf8a;
  --aviso: #f0a35a;
  --peligro: #ff8a7a;
  --ok-fondo: #12301f;
  --aviso-fondo: #33240f;
  --peligro-fondo: #3a1714;
  color-scheme: dark;
}

[hidden] {
  display: none !important;
}
*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

body {
  margin: 0;
  background: var(--papel);
  color: var(--tinta);
  font-family: var(--f-texto);
  font-size: var(--t-m);
  line-height: 1.6;
}

img,
svg,
video,
canvas {
  max-width: 100%;
}

h1,
h2,
h3,
h4 {
  margin: 0;
  font-family: var(--f-titulo);
  line-height: 1.12;
  text-wrap: balance;
  font-weight: 700;
  letter-spacing: -0.01em;
  /* Manrope deja poco aire entre palabras («Mapa demesas» a 17 px): un poco más */
  word-spacing: 0.06em;
}
h3,
h4 {
  letter-spacing: 0;
}

/* Manrope 700 como pide la marca (600-700 para títulos); con 800 todo el sitio se leía en negrita */
.display {
  font-family: var(--f-titulo);
  font-weight: 700;
  letter-spacing: -0.025em;
  line-height: 1.04;
  word-spacing: 0.04em;
}

p {
  margin: 0;
  text-wrap: pretty;
}

a {
  color: var(--enlace);
  text-underline-offset: 0.18em;
  text-decoration-thickness: 1px;
}
a:hover {
  text-decoration-thickness: 2px;
}

:focus-visible {
  outline: 2px solid var(--foco);
  outline-offset: 2px;
}

.mono,
code,
kbd {
  font-family: var(--f-mono);
  font-size: 0.86em;
  letter-spacing: 0;
}

.num {
  font-variant-numeric: tabular-nums;
}

.envoltura {
  width: 100%;
  max-width: var(--ancho);
  margin-inline: auto;
  /* con viewport-fit=cover, en un iPhone de lado el contenido no debe quedar bajo la muesca */
  padding-inline: max(16px, 4vw, env(safe-area-inset-left, 0px)) max(16px, 4vw, env(safe-area-inset-right, 0px));
}

.saltar {
  position: absolute;
  left: 8px;
  top: -60px;
  z-index: 100;
  background: var(--senal);
  color: var(--sobre-senal);
  padding: var(--e-2) var(--e-3);
  font-weight: 700;
}
.saltar:focus {
  top: 8px;
}

/* ── etiqueta de cable: rectángulo amarillo con su ojal ── */
.etiqueta {
  display: inline-flex;
  align-items: center;
  gap: 0.5em;
  background: var(--senal);
  color: var(--sobre-senal);
  font-size: var(--t-xs);
  font-weight: 650;
  letter-spacing: 0.01em;
  line-height: 1;
  padding: 0.4em 0.6em 0.4em 0.5em;
  border-radius: 2px;
  white-space: nowrap;
}
.etiqueta::before {
  content: "";
  width: 0.5em;
  height: 0.5em;
  border-radius: 50%;
  background: var(--papel);
  box-shadow: inset 0 0 0 1px rgb(0 0 0 / 0.25);
}
.etiqueta--hueca {
  background: transparent;
  color: var(--tinta-2);
  box-shadow: inset 0 0 0 1px var(--linea-fuerte);
}
.etiqueta--hueca::before {
  background: var(--linea-fuerte);
  box-shadow: none;
}

/* ── botones ── */
.boton {
  --b-fondo: var(--tinta);
  --b-texto: var(--papel);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5em;
  min-height: 46px;
  padding: 0.7em 1.15em;
  border: 1px solid var(--b-fondo);
  border-radius: var(--r-control, 8px);
  background: var(--b-fondo);
  color: var(--b-texto);
  font: inherit;
  font-weight: 600;
  font-size: var(--t-s);
  line-height: 1.1;
  text-decoration: none;
  cursor: pointer;
  transition:
    background-color var(--mov),
    color var(--mov),
    border-color var(--mov),
    transform var(--dur-respuesta) var(--ease-salida);
}
@media (hover: hover) and (pointer: fine) {
  .boton:hover {
    --b-fondo: var(--senal);
    --b-texto: var(--sobre-senal);
    border-color: var(--tinta);
  }
  .boton--senal:hover {
    --b-fondo: var(--senal-fuerte);
    --b-texto: var(--sobre-senal);
  }
  .boton--linea:hover {
    --b-fondo: var(--papel-2);
    --b-texto: var(--tinta);
    border-color: var(--tinta);
  }
}
.boton:active {
  transform: scale(0.97);
  transition-duration: var(--dur-respuesta);
}
.boton--senal {
  --b-fondo: var(--senal);
  --b-texto: var(--sobre-senal);
  border-color: var(--tinta);
}
.boton--linea {
  --b-fondo: transparent;
  --b-texto: var(--tinta);
  border-color: var(--linea-fuerte);
}
.boton[disabled],
.boton[aria-disabled="true"] {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
}

/* ── cabecera común ── */
.cabecera {
  position: sticky;
  top: env(safe-area-inset-top, 0px);
  z-index: 40;
  background: var(--papel);
  border-bottom: 1px solid var(--linea);
}
.cabecera__fila {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--e-4);
  min-height: 60px;
}
.marca {
  display: inline-flex;
  align-items: center;
  color: var(--tinta);
  text-decoration: none;
  font-family: var(--f-titulo);
  font-weight: 800;
  font-size: 1.15rem;
  letter-spacing: -0.02em;
}
.marca:has(img) {
  line-height: 0;
}
.marca img {
  height: 30px;
  width: auto;
  display: block;
}
.marca__lab {
  background: var(--senal);
  color: var(--sobre-senal);
  padding: 0.05em 0.28em 0.08em;
  border-radius: 2px;
  margin-left: 1px;
}
.marca:hover {
  text-decoration: none;
}
.nav {
  display: flex;
  flex-wrap: wrap;
  gap: var(--e-1) var(--e-4);
  font-size: var(--t-s);
}
.nav a {
  color: var(--tinta-2);
  text-decoration: none;
  padding: var(--e-2) 0;
  border-bottom: 2px solid transparent;
  /* objetivo táctil de 44 px en las cabeceras de las demos */
  display: inline-flex;
  align-items: center;
  min-height: 44px;
}
@media (max-width: 600px) {
  .nav {
    gap: var(--e-1) var(--e-3);
    font-size: 0.875rem;
  }
  .nav .nav__opcional {
    display: none;
  }
  .marca img {
    height: 26px;
  }
}
.nav a:hover,
.nav a[aria-current="page"] {
  color: var(--tinta);
  border-bottom-color: var(--senal);
}

/* ── migas del laboratorio ── */
.migas {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4em;
  font-size: var(--t-xs);
  color: var(--tinta-3);
}
.migas a {
  color: var(--tinta-2);
}

/* ── aviso de demostración ── */
.aviso-demo {
  display: flex;
  gap: var(--e-3);
  align-items: flex-start;
  padding: var(--e-3) var(--e-4);
  background: var(--senal-suave);
  border: 1px solid var(--linea-fuerte);
  border-radius: var(--r-control, 8px);
  font-size: var(--t-s);
  color: var(--tinta);
}

/* ── pie ── */
.pie {
  margin-top: var(--e-seccion);
  border-top: 1px solid var(--linea);
  padding-block: var(--e-6) var(--e-7);
  font-size: var(--t-s);
  color: var(--tinta-2);
}
.pie__fila {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: var(--e-5);
}

.sr {
  position: absolute !important;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

@media (prefers-reduced-motion: reduce) {
  :root {
    --mov-dist: 0px;
  }
  .boton:active {
    transform: none;
  }
}

::selection {
  background: var(--senal);
  color: var(--sobre-senal);
}

/* migas y enlaces chicos de las demos: 44 px de toque en pantallas táctiles */
@media (pointer: coarse) {
  .migas a {
    display: inline-block;
    padding-block: 12px;
  }
  .pie a {
    display: inline-flex;
    align-items: center;
    min-height: 44px;
  }
}

.migas {
  align-items: center;
}

@media (max-width: 640px) {
  :root {
    --e-seccion: var(--e-8);
  }
}
