/* ==========================================================================
   Syscorpion — Sistema de diseño
   --------------------------------------------------------------------------
   Implementa el manual de identidad v1.1 (syscorpion-branding/).
   Paleta: Ink · Quarry · Bone · Slate · Ámbar. La rampa Frost NO aparece
   aquí: por regla de marca vive solo dentro del ícono del alacrán.
   Tipografía: Unbounded (títulos), IBM Plex Sans (cuerpo e interfaz),
   IBM Plex Mono (etiquetas, datos y código).
   Mobile-first. Sin dependencias externas.
   ========================================================================== */

/* --------------------------------------------------------------------------
   0. Fuentes de marca
   Subconjunto latino en WOFF2 generado desde los originales OFL del kit.
   Las dos variables llevan el eje wght acotado a los pesos que usa el manual.
   -------------------------------------------------------------------------- */

@font-face {
  font-family: "Unbounded";
  src: url("/assets/fonts/unbounded-var.woff2") format("woff2-variations"),
    url("/assets/fonts/unbounded-var.woff2") format("woff2");
  font-weight: 600 800;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "IBM Plex Sans";
  src: url("/assets/fonts/ibm-plex-sans-var.woff2") format("woff2-variations"),
    url("/assets/fonts/ibm-plex-sans-var.woff2") format("woff2");
  font-weight: 400 600;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "IBM Plex Mono";
  src: url("/assets/fonts/ibm-plex-mono-400.woff2") format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "IBM Plex Mono";
  src: url("/assets/fonts/ibm-plex-mono-500.woff2") format("woff2");
  font-weight: 500;
  font-style: normal;
  font-display: swap;
}

/* --------------------------------------------------------------------------
   1. Tokens
   -------------------------------------------------------------------------- */

:root {
  /* Superficies — tema oscuro por defecto, base Ink #1B1712.
     Los escalones intermedios son derivados de interfaz, no colores de
     marca: aclaran la misma tinta cálida para separar planos. */
  --bg: #1b1712;
  --bg-alt: #211c16;
  --surface: #262019;
  --surface-2: #2e271f;
  --surface-3: #382f25;
  --border: #383026;
  --border-strong: #4a4034;

  /* Texto — Bone para títulos, Quarry para lectura, Slate para lo secundario */
  --text: #e4e0d4;
  --text-strong: #f6f3ea;
  --muted: #94a39c;
  --muted-2: #7a8a83;

  /* Ámbar (Veneno) — el tono oscuro del manual, 5.9:1 sobre Ink */
  --accent: #e07830;
  --accent-hi: #ee8c46;
  --accent-lo: #c4611c;
  --accent-soft: rgba(224, 120, 48, 0.12);
  --accent-line: rgba(224, 120, 48, 0.3);
  --accent-glow: rgba(224, 120, 48, 0.45);
  --on-accent: #1b1712;
  /* Relleno de los botones. En oscuro coincide con el acento porque el
     texto Ink encima ya da 5.9:1. */
  --accent-solid: #e07830;
  --accent-solid-hi: #ee8c46;

  /* Semánticos — funcionales, fuera de la paleta de marca */
  --ok: #86b394;
  --err: #e2796a;

  /* Efectos — sombras cálidas derivadas de Ink, no negro neutro */
  --shadow-sm: 0 1px 2px rgba(27, 23, 18, 0.5);
  --shadow: 0 18px 40px -22px rgba(0, 0, 0, 0.6),
    0 2px 8px -2px rgba(0, 0, 0, 0.4);
  --shadow-lg: 0 32px 64px -28px rgba(0, 0, 0, 0.7);
  --glow: 0 0 0 1px var(--accent-line), 0 18px 48px -20px rgba(224, 120, 48, 0.28);

  /* Ícono del alacrán — única superficie donde vive la rampa Frost */
  --mk-shield: #f6f3ea;
  --mk-f900: #3e5a66;
  --mk-f700: #5b7f8c;
  --mk-f500: #7fa4b1;
  --mk-f300: #abcbd3;
  --mk-f100: #e8f3f5;
  --mk-sting: #c4611c;

  /* Radios */
  --r-sm: 8px;
  --r: 14px;
  --r-lg: 20px;
  --r-full: 999px;

  /* Espaciado */
  --sp-1: 0.25rem;
  --sp-2: 0.5rem;
  --sp-3: 0.75rem;
  --sp-4: 1rem;
  --sp-5: 1.5rem;
  --sp-6: 2rem;
  --sp-7: 3rem;
  --sp-8: 4rem;
  --sp-9: 6rem;

  /* Layout */
  --container: 1200px;
  --gutter: clamp(1.25rem, 5vw, 2.5rem);
  --header-h: 68px;

  /* Tipografía de marca.
     Unbounded es exclusiva de títulos y wordmark: el manual prohíbe
     expresamente usarla en párrafos de cuerpo. */
  --font: "IBM Plex Sans", -apple-system, BlinkMacSystemFont, "Segoe UI",
    Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-display: "Unbounded", "IBM Plex Sans", -apple-system, "Segoe UI",
    sans-serif;
  --font-mono: "IBM Plex Mono", ui-monospace, "SF Mono", "Cascadia Code",
    Consolas, "Liberation Mono", monospace;

  --step--1: clamp(0.8125rem, 0.79rem + 0.11vw, 0.875rem);
  --step-0: clamp(0.9375rem, 0.9rem + 0.19vw, 1.0625rem);
  --step-1: clamp(1.125rem, 1.06rem + 0.32vw, 1.3125rem);
  --step-2: clamp(1.375rem, 1.24rem + 0.65vw, 1.75rem);
  --step-3: clamp(1.75rem, 1.5rem + 1.2vw, 2.5rem);
  --step-4: clamp(2.25rem, 1.7rem + 2.6vw, 3.75rem);

  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  --dur: 260ms;

  color-scheme: dark;
}

/* Tema claro — activado por el conmutador o por preferencia del sistema */
[data-theme="light"] {
  /* Base Quarry #E4E0D4 con superficies en Bone #F6F3EA */
  --bg: #e4e0d4;
  --bg-alt: #dcd7c9;
  --surface: #f6f3ea;
  --surface-2: #efebdf;
  --surface-3: #e4e0d4;
  --border: #cfc9b8;
  --border-strong: #b8b1a0;

  --text: #2c261f;
  --text-strong: #1b1712;
  /* muted-2 repite Slate en vez de aclararse: cualquier tono más claro
     bajaría de 4.5:1 sobre Quarry. La jerarquía la da el tamaño. */
  --muted: #57645e;
  --muted-2: #57645e;

  /* Ámbar claro — 3.7:1 sobre Bone, por eso nunca toca texto pequeño */
  --accent: #c4611c;
  --accent-hi: #a94f13;
  --accent-lo: #8f4610;
  --accent-soft: rgba(196, 97, 28, 0.1);
  --accent-line: rgba(196, 97, 28, 0.28);
  --accent-glow: rgba(196, 97, 28, 0.35);
  --on-accent: #f6f3ea;
  /* El ámbar de marca sobre Bone se queda en 3.7:1, insuficiente para el
     texto de un botón pequeño. El relleno usa el tono oscurecido de la
     misma familia: 4.96:1 con Bone, y el ámbar puro sigue reservado para
     texto grande, iconos y anillos de foco. */
  --accent-solid: #a94f13;
  --accent-solid-hi: #8f4610;

  --ok: #2f6b45;
  --err: #a33224;

  --shadow-sm: 0 1px 2px rgba(27, 23, 18, 0.08);
  --shadow: 0 18px 40px -22px rgba(27, 23, 18, 0.35),
    0 2px 8px -2px rgba(27, 23, 18, 0.18);
  --shadow-lg: 0 32px 64px -28px rgba(27, 23, 18, 0.28);
  --glow: 0 0 0 1px var(--accent-line), 0 18px 48px -20px rgba(196, 97, 28, 0.22);

  --mk-shield: #1b1712;
  --mk-f900: #24343b;
  --mk-f700: #375561;
  --mk-f500: #4c7484;
  --mk-f300: #74a0ac;
  --mk-f100: #b7d6da;
  --mk-sting: #c4611c;

  color-scheme: light;
}

/* --------------------------------------------------------------------------
   2. Reset
   -------------------------------------------------------------------------- */

*,
*::before,
*::after {
  box-sizing: border-box;
}

* {
  margin: 0;
}

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--header-h) + 1rem);
}

body {
  font-family: var(--font);
  font-size: var(--step-0);
  line-height: 1.65;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}

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

img {
  height: auto;
}

button,
input,
select,
textarea {
  font: inherit;
  color: inherit;
}

/* Los enlaces en texto corrido no van en ámbar: a tamaño de cuerpo el tono
   claro (#C4611C) se queda en 3.7:1 sobre Bone. El subrayado hace el trabajo
   que hacía el color. */
a {
  color: var(--text-strong);
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
}

a:hover {
  text-decoration-thickness: 2px;
}

h1,
h2,
h3,
h4 {
  color: var(--text-strong);
  line-height: 1.15;
  letter-spacing: -0.02em;
  font-weight: 700;
  text-wrap: balance;
}

/* Unbounded solo en los títulos de escala display. En cuerpos pequeños
   resulta demasiado pesada, así que ahí se queda IBM Plex Sans. */
.hero__title,
.section-title,
.card__title,
.step__title,
.cta__title,
.center-page h1,
.prose h1,
.prose h2 {
  font-family: var(--font-display);
}

p {
  text-wrap: pretty;
}

ul {
  list-style: none;
  padding: 0;
}

:focus-visible {
  outline: 2px solid var(--accent-hi);
  outline-offset: 3px;
  border-radius: 4px;
}

::selection {
  background: var(--accent-solid);
  color: var(--on-accent);
}

/* --------------------------------------------------------------------------
   3. Utilidades de layout
   -------------------------------------------------------------------------- */

.container {
  width: 100%;
  max-width: var(--container);
  margin-inline: auto;
  padding-inline: var(--gutter);
}

.section {
  padding-block: clamp(3.5rem, 8vw, 7rem);
  position: relative;
}

.section--alt {
  background: var(--bg-alt);
  border-block: 1px solid var(--border);
}

.skip-link {
  position: absolute;
  top: -100px;
  left: var(--sp-4);
  z-index: 200;
  padding: var(--sp-3) var(--sp-5);
  background: var(--accent-solid);
  color: var(--on-accent);
  font-weight: 600;
  border-radius: 0 0 var(--r-sm) var(--r-sm);
  transition: top var(--dur) var(--ease);
}

.skip-link:focus {
  top: 0;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* --------------------------------------------------------------------------
   4. Componentes tipográficos
   -------------------------------------------------------------------------- */

/* Etiqueta según el manual: IBM Plex Mono 500, versalitas, tracking .12em.
   En Slate, no en ámbar — es estructura, no señal. */
.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: var(--sp-2);
  font-family: var(--font-mono);
  font-size: var(--step--1);
  font-weight: 500;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: var(--sp-4);
}

.eyebrow::before {
  content: "";
  width: 28px;
  height: 1px;
  background: var(--muted);
  opacity: 0.7;
}

.section-head {
  max-width: 62ch;
  margin-bottom: clamp(2.5rem, 5vw, 4rem);
}

.section-head--center {
  margin-inline: auto;
  text-align: center;
}

.section-head--center .eyebrow::before {
  display: none;
}

.section-title {
  font-size: var(--step-3);
  margin-bottom: var(--sp-4);
}

.section-lede {
  font-size: var(--step-1);
  color: var(--muted);
  line-height: 1.6;
}

.text-accent {
  color: var(--accent);
}

/* --------------------------------------------------------------------------
   5. Botones
   -------------------------------------------------------------------------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--sp-2);
  padding: 0.85rem 1.6rem;
  border: 1px solid transparent;
  border-radius: var(--r-full);
  font-size: var(--step-0);
  font-weight: 600;
  line-height: 1.2;
  text-decoration: none;
  cursor: pointer;
  white-space: nowrap;
  transition: transform var(--dur) var(--ease),
    background-color var(--dur) var(--ease), border-color var(--dur) var(--ease),
    box-shadow var(--dur) var(--ease), color var(--dur) var(--ease);
}

.btn:hover {
  transform: translateY(-2px);
}

.btn:active {
  transform: translateY(0);
}

.btn--primary {
  background: var(--accent-solid);
  color: var(--on-accent);
  box-shadow: 0 10px 30px -12px var(--accent-glow);
}

.btn--primary:hover {
  background: var(--accent-solid-hi);
  box-shadow: 0 16px 40px -14px var(--accent-glow);
}

.btn--ghost {
  background: transparent;
  border-color: var(--border-strong);
  color: var(--text-strong);
}

.btn--ghost:hover {
  border-color: var(--border-strong);
  background: var(--surface-2);
  color: var(--text-strong);
}

.btn--wa {
  background: #25d366;
  color: #05230f;
  box-shadow: 0 10px 30px -12px rgba(37, 211, 102, 0.6);
}

.btn--wa:hover {
  background: #22c55e;
}

.btn--lg {
  padding: 1rem 2rem;
  font-size: var(--step-1);
}

.btn--sm {
  padding: 0.55rem 1.1rem;
  font-size: var(--step--1);
}

.btn--block {
  width: 100%;
}

.btn[disabled],
.btn[aria-busy="true"] {
  opacity: 0.6;
  pointer-events: none;
}

/* --------------------------------------------------------------------------
   6. Encabezado y navegación
   -------------------------------------------------------------------------- */

.header {
  position: sticky;
  top: 0;
  z-index: 100;
  height: var(--header-h);
  display: flex;
  align-items: center;
  background: color-mix(in srgb, var(--bg) 82%, transparent);
  backdrop-filter: saturate(160%) blur(14px);
  -webkit-backdrop-filter: saturate(160%) blur(14px);
  border-bottom: 1px solid transparent;
  transition: border-color var(--dur) var(--ease),
    background-color var(--dur) var(--ease);
}

.header.is-scrolled {
  border-bottom-color: var(--border);
  background: color-mix(in srgb, var(--bg) 94%, transparent);
}

.header__inner {
  display: flex;
  align-items: center;
  gap: var(--sp-5);
  width: 100%;
  max-width: var(--container);
  margin-inline: auto;
  padding-inline: var(--gutter);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  text-decoration: none;
  color: var(--text-strong);
  font-weight: 700;
  font-size: 1.15rem;
  letter-spacing: -0.03em;
  flex-shrink: 0;
}

/* Proporciones tomadas del lockup del kit (logo/logotype-on-*.svg):
   ícono de 92x100 y wordmark a 62pt, con una separación de ~0.43 del alto
   del ícono. El wordmark va en Slate, como en el original. */
.brand__mark {
  width: 30px;
  height: 32px;
  flex-shrink: 0;
}

.brand__name {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 1.02rem;
  letter-spacing: -0.02em;
  text-transform: uppercase;
  color: var(--muted);
  transition: color var(--dur) var(--ease);
}

.brand:hover .brand__name {
  color: var(--text-strong);
}

.nav {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: var(--sp-2);
}

.nav__list {
  display: flex;
  align-items: center;
  gap: var(--sp-2);
}

.nav__link {
  display: block;
  padding: 0.5rem 0.85rem;
  border-radius: var(--r-full);
  color: var(--muted);
  font-size: var(--step--1);
  font-weight: 500;
  text-decoration: none;
  transition: color var(--dur) var(--ease),
    background-color var(--dur) var(--ease);
}

.nav__link:hover,
.nav__link.is-active {
  color: var(--text-strong);
  background: var(--surface-2);
}

.nav__actions {
  display: flex;
  align-items: center;
  gap: var(--sp-2);
  margin-left: var(--sp-3);
  padding-left: var(--sp-3);
  border-left: 1px solid var(--border);
}

.icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
  min-width: 38px;
  height: 38px;
  padding-inline: 0.6rem;
  background: transparent;
  border: 1px solid var(--border);
  border-radius: var(--r-full);
  color: var(--muted);
  font-size: var(--step--1);
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
  transition: color var(--dur) var(--ease), border-color var(--dur) var(--ease),
    background-color var(--dur) var(--ease);
}

.icon-btn:hover {
  color: var(--text-strong);
  border-color: var(--border-strong);
  background: var(--surface-2);
}

.icon-btn svg {
  width: 17px;
  height: 17px;
}

.theme-toggle .icon-moon {
  display: none;
}

[data-theme="light"] .theme-toggle .icon-moon {
  display: block;
}

[data-theme="light"] .theme-toggle .icon-sun {
  display: none;
}

.nav__toggle {
  display: none;
  margin-left: auto;
}

.nav__toggle svg {
  width: 20px;
  height: 20px;
}

.nav__toggle .icon-close {
  display: none;
}

.nav__toggle[aria-expanded="true"] .icon-close {
  display: block;
}

.nav__toggle[aria-expanded="true"] .icon-menu {
  display: none;
}

@media (max-width: 960px) {
  .nav__toggle {
    display: inline-flex;
  }

  .nav {
    position: fixed;
    inset: var(--header-h) 0 auto 0;
    margin: 0;
    flex-direction: column;
    align-items: stretch;
    gap: var(--sp-4);
    padding: var(--sp-5) var(--gutter) var(--sp-6);
    background: var(--surface);
    border-bottom: 1px solid var(--border);
    box-shadow: var(--shadow-lg);
    transform: translateY(-12px);
    opacity: 0;
    visibility: hidden;
    transition: opacity var(--dur) var(--ease),
      transform var(--dur) var(--ease), visibility var(--dur);
    max-height: calc(100dvh - var(--header-h));
    overflow-y: auto;
  }

  .nav.is-open {
    transform: translateY(0);
    opacity: 1;
    visibility: visible;
  }

  .nav__list {
    flex-direction: column;
    align-items: stretch;
    gap: var(--sp-1);
  }

  .nav__link {
    padding: 0.75rem 1rem;
    font-size: var(--step-0);
  }

  .nav__actions {
    margin: 0;
    padding: var(--sp-4) 0 0;
    border-left: 0;
    border-top: 1px solid var(--border);
    justify-content: space-between;
  }
}

/* --------------------------------------------------------------------------
   7. Hero
   -------------------------------------------------------------------------- */

.hero {
  position: relative;
  overflow: hidden;
  padding-block: clamp(3.5rem, 9vw, 7.5rem) clamp(3rem, 7vw, 6rem);
  isolation: isolate;
}

.hero__canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: -2;
  opacity: 0.55;
}

.hero::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background: radial-gradient(
      60% 55% at 78% 12%,
      var(--surface-2) 0%,
      transparent 62%
    ),
    linear-gradient(180deg, transparent 55%, var(--bg) 100%);
}

.hero__grid {
  display: grid;
  gap: clamp(2.5rem, 6vw, 4.5rem);
  align-items: center;
}

@media (min-width: 1000px) {
  .hero__grid {
    grid-template-columns: 1.05fr 0.95fr;
  }
}

.hero__badge {
  display: inline-flex;
  align-items: center;
  gap: var(--sp-2);
  padding: 0.4rem 0.9rem 0.4rem 0.5rem;
  margin-bottom: var(--sp-5);
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--r-full);
  font-size: var(--step--1);
  color: var(--muted);
}

.hero__badge b {
  color: var(--text-strong);
  font-weight: 600;
}

.pulse {
  position: relative;
  width: 8px;
  height: 8px;
  margin-inline: 0.35rem;
  border-radius: 50%;
  background: var(--ok);
  flex-shrink: 0;
}

.pulse::after {
  content: "";
  position: absolute;
  inset: -4px;
  border-radius: 50%;
  border: 1px solid var(--ok);
  animation: pulse 2.4s var(--ease) infinite;
}

@keyframes pulse {
  0% {
    transform: scale(0.6);
    opacity: 0.9;
  }
  70%,
  100% {
    transform: scale(1.5);
    opacity: 0;
  }
}

.hero__title {
  font-size: var(--step-4);
  letter-spacing: -0.035em;
  margin-bottom: var(--sp-5);
}

.hero__title em {
  font-style: normal;
  position: relative;
  color: var(--accent);
  white-space: nowrap;
}

.hero__lede {
  font-size: var(--step-1);
  color: var(--muted);
  max-width: 56ch;
  margin-bottom: var(--sp-6);
}

.hero__actions {
  display: flex;
  flex-wrap: wrap;
  gap: var(--sp-3);
  margin-bottom: var(--sp-6);
}

.hero__note {
  display: flex;
  align-items: center;
  gap: var(--sp-2);
  font-size: var(--step--1);
  color: var(--muted-2);
}

.hero__note svg {
  width: 16px;
  height: 16px;
  color: var(--ok);
  flex-shrink: 0;
}

/* Panel de código del hero */
.code-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-lg);
  overflow: hidden;
}

.code-card__bar {
  display: flex;
  align-items: center;
  gap: var(--sp-2);
  padding: 0.75rem 1rem;
  background: var(--surface-2);
  border-bottom: 1px solid var(--border);
}

.code-card__dots {
  display: flex;
  gap: 6px;
}

.code-card__dots i {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--border-strong);
}

.code-card__dots i:first-child {
  background: var(--muted);
}

.code-card__file {
  margin-left: auto;
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--muted-2);
}

.code-card__body {
  margin: 0;
  padding: 1.25rem 1.35rem;
  font-family: var(--font-mono);
  font-size: clamp(0.72rem, 0.62rem + 0.28vw, 0.84rem);
  line-height: 1.85;
  color: var(--muted);
  overflow-x: auto;
  tab-size: 2;
}

.code-card__body code {
  display: block;
  white-space: pre;
}

/* El panel de código se resuelve dentro de la paleta: el manual reserva
   IBM Plex Mono para lo que debe leerse sin ambigüedad, y no contempla
   colores de resaltado de sintaxis. La jerarquía la dan peso y tono. */
.tok-key {
  color: var(--text-strong);
  font-weight: 500;
}
.tok-fn {
  color: var(--text-strong);
}
.tok-str {
  color: var(--muted);
}
.tok-num {
  color: var(--muted);
}
.tok-com {
  color: var(--muted-2);
  font-style: italic;
}

.code-card__foot {
  display: flex;
  flex-wrap: wrap;
  gap: var(--sp-4);
  padding: 0.9rem 1.35rem;
  background: var(--surface-2);
  border-top: 1px solid var(--border);
  font-size: var(--step--1);
  color: var(--muted-2);
}

.code-card__foot span {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
}

.code-card__foot b {
  color: var(--text-strong);
  font-weight: 600;
}

/* --------------------------------------------------------------------------
   8. Barra de confianza
   -------------------------------------------------------------------------- */

.trust {
  border-block: 1px solid var(--border);
  background: var(--bg-alt);
  padding-block: clamp(2rem, 4vw, 3rem);
}

.trust__grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: var(--sp-5) var(--sp-4);
}

@media (min-width: 768px) {
  .trust__grid {
    grid-template-columns: repeat(4, 1fr);
  }
}

.stat {
  text-align: center;
  padding-inline: var(--sp-2);
}

.stat__num {
  display: block;
  font-family: var(--font-mono);
  font-size: var(--step-3);
  font-weight: 500;
  letter-spacing: -0.03em;
  color: var(--text-strong);
  line-height: 1;
  margin-bottom: var(--sp-2);
}

.stat__num i {
  font-style: normal;
  color: var(--accent);
}

.stat__label {
  font-size: var(--step--1);
  color: var(--muted);
  line-height: 1.4;
}

/* --------------------------------------------------------------------------
   9. Servicios
   -------------------------------------------------------------------------- */

.cards {
  display: grid;
  gap: var(--sp-5);
  grid-template-columns: 1fr;
}

@media (min-width: 640px) {
  .cards {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (min-width: 1024px) {
  .cards {
    grid-template-columns: repeat(3, 1fr);
  }
}

.card {
  position: relative;
  display: flex;
  flex-direction: column;
  padding: clamp(1.5rem, 3vw, 2rem);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  overflow: hidden;
  transition: transform var(--dur) var(--ease),
    border-color var(--dur) var(--ease), box-shadow var(--dur) var(--ease);
}

.card::before {
  content: "";
  position: absolute;
  inset: 0 0 auto 0;
  height: 2px;
  background: linear-gradient(
    90deg,
    transparent,
    var(--border-strong),
    transparent
  );
  opacity: 0;
  transition: opacity var(--dur) var(--ease);
}

.card:hover {
  transform: translateY(-4px);
  border-color: var(--border-strong);
  box-shadow: var(--shadow);
}

.card:hover::before {
  opacity: 1;
}

.card__icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 48px;
  height: 48px;
  margin-bottom: var(--sp-5);
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--r);
  color: var(--muted);
  flex-shrink: 0;
}

.card__icon svg {
  width: 24px;
  height: 24px;
}

.card__title {
  font-size: var(--step-2);
  margin-bottom: var(--sp-3);
}

.card__text {
  color: var(--muted);
  margin-bottom: var(--sp-5);
}

.card__list {
  display: flex;
  flex-direction: column;
  gap: var(--sp-2);
  margin-top: auto;
  padding-top: var(--sp-4);
  border-top: 1px solid var(--border);
}

.card__list li {
  position: relative;
  padding-left: 1.4rem;
  font-size: var(--step--1);
  color: var(--muted);
  line-height: 1.5;
}

.card__list li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.55em;
  width: 6px;
  height: 6px;
  border-radius: 2px;
  background: var(--muted);
  transform: rotate(45deg);
}

/* --------------------------------------------------------------------------
   10. Stack tecnológico
   -------------------------------------------------------------------------- */

.stack {
  display: grid;
  gap: var(--sp-5);
  grid-template-columns: 1fr;
}

@media (min-width: 700px) {
  .stack {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (min-width: 1080px) {
  .stack {
    grid-template-columns: repeat(3, 1fr);
  }
}

.stack__group {
  padding: var(--sp-5);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r);
}

.stack__title {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  font-size: var(--step-0);
  font-weight: 700;
  color: var(--text-strong);
  margin-bottom: var(--sp-4);
}

.stack__title svg {
  width: 18px;
  height: 18px;
  color: var(--muted);
  flex-shrink: 0;
}

.tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
}

.tag {
  padding: 0.3rem 0.7rem;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--r-sm);
  font-family: var(--font-mono);
  font-size: 0.76rem;
  color: var(--muted);
  transition: color var(--dur) var(--ease), border-color var(--dur) var(--ease);
}

.tag:hover {
  color: var(--text-strong);
  border-color: var(--border-strong);
}

/* --------------------------------------------------------------------------
   11. Proceso
   -------------------------------------------------------------------------- */

.steps {
  display: grid;
  gap: var(--sp-5);
  counter-reset: step;
}

@media (min-width: 768px) {
  .steps {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (min-width: 1080px) {
  .steps {
    grid-template-columns: repeat(4, 1fr);
  }
}

.step {
  position: relative;
  padding-top: var(--sp-6);
}

.step::before {
  counter-increment: step;
  content: "0" counter(step);
  position: absolute;
  top: 0;
  left: 0;
  font-family: var(--font-mono);
  font-size: var(--step-2);
  font-weight: 700;
  color: var(--accent);
  opacity: 0.9;
}

.step::after {
  content: "";
  position: absolute;
  top: 0.6em;
  left: 3.4rem;
  right: -1.5rem;
  height: 1px;
  background: linear-gradient(90deg, var(--border-strong), transparent);
}

@media (max-width: 1079px) {
  .step::after {
    display: none;
  }
}

@media (min-width: 1080px) {
  .step:last-child::after {
    display: none;
  }
}

.step__title {
  font-size: var(--step-1);
  margin-bottom: var(--sp-3);
}

.step__text {
  color: var(--muted);
  font-size: var(--step--1);
  line-height: 1.65;
}

/* --------------------------------------------------------------------------
   12. Diferenciadores
   -------------------------------------------------------------------------- */

.why {
  display: grid;
  gap: clamp(2.5rem, 5vw, 4rem);
  align-items: start;
}

@media (min-width: 1000px) {
  .why {
    grid-template-columns: 0.9fr 1.1fr;
  }
}

.feature-list {
  display: grid;
  gap: var(--sp-5);
}

@media (min-width: 640px) {
  .feature-list {
    grid-template-columns: repeat(2, 1fr);
  }
}

.feature {
  display: flex;
  gap: var(--sp-4);
}

.feature__icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  flex-shrink: 0;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--r-sm);
  color: var(--muted);
}

.feature__icon svg {
  width: 20px;
  height: 20px;
}

.feature__title {
  font-size: var(--step-0);
  font-weight: 700;
  margin-bottom: var(--sp-2);
}

.feature__text {
  font-size: var(--step--1);
  color: var(--muted);
  line-height: 1.6;
}

/* --------------------------------------------------------------------------
   13. Contacto
   -------------------------------------------------------------------------- */

.contact {
  display: grid;
  gap: clamp(2rem, 5vw, 3.5rem);
  align-items: start;
}

@media (min-width: 1000px) {
  .contact {
    grid-template-columns: 0.85fr 1.15fr;
  }
}

.contact__aside {
  display: flex;
  flex-direction: column;
  gap: var(--sp-4);
}

.contact-card {
  display: flex;
  align-items: flex-start;
  gap: var(--sp-4);
  padding: var(--sp-5);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r);
  text-decoration: none;
  color: inherit;
  transition: border-color var(--dur) var(--ease),
    transform var(--dur) var(--ease);
}

.contact-card:hover {
  border-color: var(--border-strong);
  transform: translateX(3px);
}

.contact-card__icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  flex-shrink: 0;
  border-radius: var(--r-sm);
  background: var(--surface-2);
  color: var(--muted);
}

.contact-card__icon svg {
  width: 20px;
  height: 20px;
}

.contact-card--wa .contact-card__icon {
  background: rgba(37, 211, 102, 0.12);
  color: #25d366;
}

.contact-card__label {
  font-size: var(--step--1);
  color: var(--muted-2);
  margin-bottom: 0.15rem;
}

.contact-card__value {
  font-weight: 600;
  color: var(--text-strong);
  word-break: break-word;
}

/* Formulario */
.form {
  padding: clamp(1.5rem, 3.5vw, 2.5rem);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow);
}

.form__grid {
  display: grid;
  gap: var(--sp-4);
  grid-template-columns: 1fr;
}

@media (min-width: 640px) {
  .form__grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .field--full {
    grid-column: 1 / -1;
  }
}

.field {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.field__label {
  font-size: var(--step--1);
  font-weight: 600;
  color: var(--text);
}

.field__label .req {
  color: var(--muted);
}

.field__hint {
  font-size: 0.78rem;
  color: var(--muted-2);
}

.input,
.select,
.textarea {
  width: 100%;
  padding: 0.75rem 0.9rem;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--r-sm);
  color: var(--text-strong);
  font-size: var(--step-0);
  transition: border-color var(--dur) var(--ease),
    box-shadow var(--dur) var(--ease);
}

[data-theme="light"] .input,
[data-theme="light"] .select,
[data-theme="light"] .textarea {
  background: var(--surface-2);
}

.input::placeholder,
.textarea::placeholder {
  color: var(--muted-2);
}

.input:focus,
.select:focus,
.textarea:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}

.input[aria-invalid="true"],
.textarea[aria-invalid="true"],
.select[aria-invalid="true"] {
  border-color: var(--err);
}

.textarea {
  min-height: 130px;
  resize: vertical;
}

.select {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%2397a3b6' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.75rem center;
  background-size: 18px;
  padding-right: 2.5rem;
}

.field__error {
  font-size: 0.78rem;
  color: var(--err);
  min-height: 1em;
}

.honeypot {
  position: absolute;
  left: -9999px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

.form__consent {
  display: flex;
  align-items: flex-start;
  gap: var(--sp-3);
  font-size: var(--step--1);
  color: var(--muted);
  line-height: 1.5;
}

.form__consent input {
  width: 18px;
  height: 18px;
  margin-top: 0.2em;
  accent-color: var(--accent);
  flex-shrink: 0;
}

.form__footer {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--sp-4);
  margin-top: var(--sp-5);
}

.form__footer .btn {
  min-width: 200px;
}

.form__status {
  flex: 1 1 220px;
  font-size: var(--step--1);
  line-height: 1.5;
}

.form__status:empty {
  display: none;
}

.form__status[data-state="ok"] {
  color: var(--ok);
}

.form__status[data-state="error"] {
  color: var(--err);
}

.form__status[data-state="loading"] {
  color: var(--muted);
}

.spinner {
  display: inline-block;
  width: 15px;
  height: 15px;
  border: 2px solid currentColor;
  border-right-color: transparent;
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
  vertical-align: -2px;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

/* --------------------------------------------------------------------------
   14. CTA final
   -------------------------------------------------------------------------- */

.cta {
  position: relative;
  padding: clamp(2.5rem, 6vw, 4.5rem);
  text-align: center;
  background: linear-gradient(
    145deg,
    var(--surface-2),
    var(--surface)
  );
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  overflow: hidden;
}

.cta::before {
  content: "";
  position: absolute;
  inset: -50% 30% auto -10%;
  height: 200%;
  background: radial-gradient(
    40% 30% at 50% 50%,
    var(--surface-3),
    transparent 70%
  );
  pointer-events: none;
}

.cta__title {
  position: relative;
  font-size: var(--step-3);
  margin-bottom: var(--sp-4);
}

.cta__text {
  position: relative;
  max-width: 56ch;
  margin: 0 auto var(--sp-6);
  color: var(--muted);
  font-size: var(--step-1);
}

.cta__actions {
  position: relative;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: var(--sp-3);
}

/* --------------------------------------------------------------------------
   15. Pie de página
   -------------------------------------------------------------------------- */

.footer {
  background: var(--bg-alt);
  border-top: 1px solid var(--border);
  padding-block: clamp(3rem, 6vw, 4.5rem) var(--sp-6);
}

.footer__grid {
  display: grid;
  gap: var(--sp-6);
  grid-template-columns: 1fr;
  margin-bottom: var(--sp-7);
}

@media (min-width: 640px) {
  .footer__grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (min-width: 1000px) {
  .footer__grid {
    grid-template-columns: 1.6fr repeat(3, 1fr);
  }
}

.footer__about p {
  margin-top: var(--sp-4);
  color: var(--muted);
  font-size: var(--step--1);
  max-width: 42ch;
}

.footer__title {
  font-family: var(--font-mono);
  font-size: var(--step--1);
  font-weight: 500;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-strong);
  margin-bottom: var(--sp-4);
}

.footer__list {
  display: flex;
  flex-direction: column;
  gap: var(--sp-3);
}

.footer__list a,
.footer__list span {
  color: var(--muted);
  font-size: var(--step--1);
  text-decoration: none;
  transition: color var(--dur) var(--ease);
}

.footer__list a:hover {
  color: var(--text-strong);
}

/* Enlaces de redes sociales: icono y texto alineados */
.footer__social {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
}

.footer__social svg {
  flex-shrink: 0;
  opacity: 0.75;
  transition: opacity var(--dur) var(--ease);
}

.footer__social:hover svg {
  opacity: 1;
}

.footer__bottom {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: var(--sp-4);
  padding-top: var(--sp-5);
  border-top: 1px solid var(--border);
  font-size: 0.82rem;
  color: var(--muted-2);
}

.footer__legal {
  display: flex;
  flex-wrap: wrap;
  gap: var(--sp-4);
}

.footer__legal a {
  color: var(--muted-2);
  text-decoration: none;
}

.footer__legal a:hover {
  color: var(--text-strong);
}

/* --------------------------------------------------------------------------
   16. Botón flotante de WhatsApp
   -------------------------------------------------------------------------- */

.wa-fab {
  position: fixed;
  right: clamp(1rem, 3vw, 1.75rem);
  bottom: clamp(1rem, 3vw, 1.75rem);
  z-index: 90;
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.85rem 1.25rem 0.85rem 1rem;
  background: #25d366;
  color: #05230f;
  font-weight: 700;
  font-size: var(--step--1);
  text-decoration: none;
  border-radius: var(--r-full);
  box-shadow: 0 14px 34px -10px rgba(37, 211, 102, 0.55),
    0 0 0 1px rgba(5, 35, 15, 0.08);
  transition: transform var(--dur) var(--ease),
    box-shadow var(--dur) var(--ease);
}

.wa-fab:hover {
  transform: translateY(-3px) scale(1.02);
  box-shadow: 0 20px 44px -12px rgba(37, 211, 102, 0.7);
}

.wa-fab svg {
  width: 22px;
  height: 22px;
  flex-shrink: 0;
}

.wa-fab__label {
  white-space: nowrap;
}

@media (max-width: 560px) {
  .wa-fab {
    padding: 0.9rem;
  }

  .wa-fab__label {
    display: none;
  }
}

/* --------------------------------------------------------------------------
   17. Página de agradecimiento y 404
   -------------------------------------------------------------------------- */

.center-page {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: calc(100dvh - var(--header-h));
  padding-block: var(--sp-8);
  text-align: center;
}

.center-page__icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 76px;
  height: 76px;
  margin-bottom: var(--sp-5);
  border-radius: 50%;
  background: var(--accent-soft);
  border: 1px solid var(--accent-line);
  color: var(--accent);
}

.center-page__icon svg {
  width: 36px;
  height: 36px;
}

.center-page h1 {
  font-size: var(--step-3);
  margin-bottom: var(--sp-4);
}

.center-page p {
  max-width: 52ch;
  margin: 0 auto var(--sp-6);
  color: var(--muted);
  font-size: var(--step-1);
}

.center-page__actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: var(--sp-3);
}

.error-code {
  font-family: var(--font-mono);
  font-size: clamp(4rem, 18vw, 9rem);
  font-weight: 800;
  line-height: 1;
  color: var(--accent);
  letter-spacing: -0.05em;
  margin-bottom: var(--sp-4);
}

/* --------------------------------------------------------------------------
   17b. Páginas de texto largo (aviso de privacidad, términos)
   -------------------------------------------------------------------------- */

.prose {
  max-width: 72ch;
  margin-inline: auto;
  padding-block: clamp(3rem, 7vw, 5rem);
}

.prose h1 {
  font-size: var(--step-3);
  margin-bottom: var(--sp-4);
}

.prose h2 {
  font-size: var(--step-2);
  margin-top: var(--sp-7);
  margin-bottom: var(--sp-4);
  padding-top: var(--sp-5);
  border-top: 1px solid var(--border);
}

.prose p,
.prose li {
  color: var(--muted);
  margin-bottom: var(--sp-4);
}

.prose ul {
  list-style: disc;
  padding-left: 1.35rem;
  margin-bottom: var(--sp-5);
}

.prose li {
  margin-bottom: var(--sp-2);
}

.prose strong {
  color: var(--text-strong);
}

.prose__meta {
  display: inline-block;
  margin-bottom: var(--sp-6);
  padding: 0.3rem 0.8rem;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--r-full);
  font-size: var(--step--1);
  color: var(--muted-2);
}

.prose__notice {
  padding: var(--sp-5);
  margin-bottom: var(--sp-6);
  background: var(--accent-soft);
  border: 1px solid var(--accent-line);
  border-radius: var(--r);
  font-size: var(--step--1);
}

.prose__notice p {
  color: var(--text);
  margin: 0;
}

/* --------------------------------------------------------------------------
   18. Animaciones de entrada
   -------------------------------------------------------------------------- */

.reveal {
  opacity: 0;
  transform: translateY(18px);
  transition: opacity 600ms var(--ease), transform 600ms var(--ease);
  transition-delay: var(--delay, 0ms);
}

.reveal.is-visible {
  opacity: 1;
  transform: none;
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }

  .reveal {
    opacity: 1;
    transform: none;
  }

  .hero__canvas {
    display: none;
  }
}

/* --------------------------------------------------------------------------
   19. Impresión
   -------------------------------------------------------------------------- */

@media print {
  .header,
  .wa-fab,
  .hero__canvas,
  .form,
  .cta {
    display: none !important;
  }

  body {
    background: #fff;
    color: #000;
  }
}
