/* =====================================================================
   DigiSoft — Design tokens v1.0 (Nov 2026)
   Fuente de verdad para web. Importar una vez en el layout raíz.
   Fuentes: <link href="https://fonts.googleapis.com/css2?family=Archivo:ital,wdth,wght@0,62..125,100..900;1,62..125,100..900&family=JetBrains+Mono:wght@400;500;700&display=swap" rel="stylesheet">
   ===================================================================== */

:root {
  /* ---------- Color: protagonistas ---------- */
  --ds-blue-500:   #1238E0; /* Azul Núcleo: fondos de sección, botón secundario, enlaces en claro, serie base */
  --ds-blue-600:   #0E2DB8; /* hover del azul */
  --ds-orange-500: #FF5B14; /* Naranja Señal: CTA, énfasis, cifra clave, núcleo del logo */
  --ds-orange-600: #E64E0C; /* hover del naranja */
  --ds-orange-text:#B83A08; /* naranja para TEXTO sobre fondos claros (5.0:1 sobre crema) */

  /* ---------- Color: profundos ---------- */
  --ds-ink:        #050816; /* Tinta: fondo oscuro base y texto sobre claro */
  --ds-blue-900:   #07123A; /* Azul Profundo: paneles, tarjetas sobre tinta, footer */
  --ds-blue-800:   #0B1B52; /* superficie elevada en oscuro */

  /* ---------- Color: detalles ---------- */
  --ds-cream:      #F5EEE2; /* fondo claro principal */
  --ds-bone:       #FBFAF7; /* texto sobre oscuro, tarjetas claras */
  --ds-ice:        #BFD3FF; /* Azul Hielo: detalles y texto 2.º sobre azul/oscuro */
  --ds-ice-soft:   #DCE6FF; /* fondos de chip, foco de input */
  --ds-peach:      #FFD2B8; /* Melocotón: resaltes, enlaces sobre azul */
  --ds-peach-soft: #FFE7D9; /* hover claro, fondos de chip naranja */

  /* ---------- Color: funcionales ---------- */
  --ds-fog:        #8A93AD; /* texto secundario sobre oscuro (6.5:1 sobre tinta) */
  --ds-slate:      #4A5270; /* texto secundario sobre claro */
  --ds-slate-700:  #3A4160; /* cuerpo sobre claro */
  --ds-line-light: #E4DED2; /* bordes sobre claro */
  --ds-line-dark:  rgba(255,255,255,0.12); /* bordes sobre oscuro */
  --ds-success:    #138A5E; /* operativo / online */
  --ds-error:      #D62F2F; /* solo UI de error */

  /* ---------- Tipografía ---------- */
  --ds-font-sans: "Archivo", "Helvetica Neue", Arial, sans-serif;
  --ds-font-mono: "JetBrains Mono", ui-monospace, "SF Mono", Menlo, monospace;

  /* Escala web (fluida). Video 1920: display 160 · h1 96 · h2 64 · h3 40 · body 28 · label 18 */
  --ds-text-display: clamp(56px, 8vw, 128px);  /* 800 · stretch 112% · lh .90 · ls -0.045em */
  --ds-text-h1:      clamp(40px, 5.5vw, 88px); /* 800 · stretch 112% · lh .95 · ls -0.04em  */
  --ds-text-h2:      clamp(32px, 3.6vw, 56px); /* 700 · stretch 108% · lh 1.0 · ls -0.03em  */
  --ds-text-h3:      clamp(22px, 2.2vw, 32px); /* 700 · stretch 104% · lh 1.1 · ls -0.02em  */
  --ds-text-body-lg: 20px;
  --ds-text-body:    18px;                      /* 400 · stretch 100% · lh 1.55 · máx 68ch */
  --ds-text-small:   15px;
  --ds-text-label:   13px;                      /* mono 500 · uppercase · ls 0.16em */
  --ds-text-number:  clamp(64px, 9vw, 160px);   /* 900 · stretch 125% · tabular-nums · ls -0.06em */

  /* ---------- Espacio (base 4) ---------- */
  --ds-space-1: 4px;  --ds-space-2: 8px;  --ds-space-3: 12px; --ds-space-4: 16px;
  --ds-space-5: 24px; --ds-space-6: 32px; --ds-space-7: 48px; --ds-space-8: 64px;
  --ds-space-9: 96px; --ds-space-10: 128px;
  --ds-section-y: clamp(80px, 10vw, 128px);

  /* ---------- Retícula ---------- */
  --ds-container: 1440px;
  --ds-container-text: 720px;
  --ds-gutter: 24px;           /* sm: 16px */
  --ds-margin: clamp(20px, 6.25vw, 120px);

  /* ---------- Forma ---------- */
  --ds-radius-xs: 2px;   /* swatches, cajas de énfasis */
  --ds-radius-sm: 4px;   /* paneles de fondo */
  --ds-radius-md: 8px;   /* inputs */
  --ds-radius-lg: 12px;  /* tarjetas */
  --ds-radius-pill: 999px; /* botones, chips */
  --ds-shadow-glass: 0 20px 40px rgba(18,56,224,0.18);
  --ds-shadow-glow:  0 0 40px rgba(255,91,20,0.45);
  --ds-focus-ring: 0 0 0 3px var(--ds-ink), 0 0 0 5px var(--ds-orange-500);

  /* ---------- Movimiento ---------- */
  --ds-ease-out:    cubic-bezier(0.16, 1, 0.3, 1);    /* entradas */
  --ds-ease-in:     cubic-bezier(0.7, 0, 0.84, 0);    /* salidas */
  --ds-ease-inout:  cubic-bezier(0.65, 0, 0.35, 1);   /* cámara y transiciones */
  --ds-ease-drift:  cubic-bezier(0.45, 0, 0.55, 1);   /* empuje lento / fondos */
  --ds-ease-spring: cubic-bezier(0.34, 1.56, 0.64, 1);/* solo UI pequeña ≤48px */

  --ds-dur-micro: 120ms;  /* hover, foco */
  --ds-dur-fast:  200ms;  /* botones, chips */
  --ds-dur-base:  320ms;  /* UI, salidas */
  --ds-dur-slow:  560ms;  /* texto, tarjetas */
  --ds-dur-scene: 900ms;  /* gráficos, transiciones */
  --ds-dur-camera:1200ms; /* cámara, count-up */

  --ds-stagger-letter: 30ms;
  --ds-stagger-word:   60ms;
  --ds-stagger-card:   80ms;
  --ds-stagger-line:   120ms;

  /* ---------- Fondos (recetas) ---------- */
  --ds-bg-aura:
    radial-gradient(40% 55% at 72% 62%, rgba(255,91,20,.95) 0%, rgba(255,91,20,0) 100%),
    radial-gradient(55% 70% at 60% 50%, rgba(18,56,224,.9) 0%, rgba(18,56,224,0) 100%),
    #050816;
  --ds-bg-ondas: repeating-radial-gradient(circle at 70% 50%, #FF5B14 0 18px, #1238E0 18px 22px, #FF5B14 22px 40px);
  --ds-bg-franjas:
    repeating-linear-gradient(90deg, rgba(5,8,22,.55) 0 4px, transparent 4px 40px),
    linear-gradient(180deg, #FF5B14 0%, #1238E0 60%, #07123A 100%);
  --ds-bg-circuito:
    linear-gradient(rgba(91,123,255,.18) 1px, transparent 1px) 0 0 / 24px 24px,
    linear-gradient(90deg, rgba(91,123,255,.18) 1px, transparent 1px) 0 0 / 24px 24px,
    #050816;
  --ds-bg-crema-tecnica: radial-gradient(rgba(18,56,224,.28) 1.2px, transparent 1.2px) 0 0 / 20px 20px, #F5EEE2;
  --ds-bg-hielo: linear-gradient(160deg, #FBFAF7 0%, #DCE6FF 45%, #BFD3FF 100%);
}

/* ---------- Base ---------- */
html { font-family: var(--ds-font-sans); color: var(--ds-ink); background: var(--ds-cream); -webkit-font-smoothing: antialiased; }
:focus-visible { outline: 2px solid var(--ds-orange-500); outline-offset: 3px; }
.ds-num { font-weight: 900; font-stretch: 125%; font-variant-numeric: tabular-nums; letter-spacing: -0.06em; line-height: .85; }
.ds-num sup, .ds-unit { font-family: var(--ds-font-mono); font-weight: 500; font-size: .38em; letter-spacing: 0; vertical-align: top; color: var(--ds-orange-500); }
.ds-label { font-family: var(--ds-font-mono); font-weight: 500; font-size: var(--ds-text-label); letter-spacing: .16em; text-transform: uppercase; }
.ds-outline { color: transparent; -webkit-text-stroke: 2px currentColor; }
.ds-emph-box { background: var(--ds-orange-500); color: var(--ds-ink); padding: 0 .2em; }

/* ---------- Animaciones de entrada (añadir .is-in con IntersectionObserver, threshold .25, una sola vez) ---------- */
@keyframes ds-rise   { from { opacity: 0; transform: translateY(.45em); filter: blur(8px); } to { opacity: 1; transform: none; filter: blur(0); } }
@keyframes ds-mask   { from { transform: translateY(105%); } to { transform: translateY(0); } }
@keyframes ds-fade-out { to { opacity: 0; transform: translateY(-.25em); filter: blur(4px); } }
.ds-reveal-word { display: inline-block; opacity: 0; }
.is-in .ds-reveal-word { animation: ds-rise var(--ds-dur-slow) var(--ds-ease-out) both; animation-delay: calc(var(--i, 0) * var(--ds-stagger-word)); }
.ds-reveal-line { display: block; overflow: hidden; }
.ds-reveal-line > span { display: block; transform: translateY(105%); }
.is-in .ds-reveal-line > span { animation: ds-mask 700ms var(--ds-ease-out) both; animation-delay: calc(var(--i, 0) * var(--ds-stagger-line)); }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 1ms !important; animation-iteration-count: 1 !important; transition-duration: 200ms !important; scroll-behavior: auto !important; }
  .ds-reveal-word, .ds-reveal-line > span { opacity: 1; transform: none; filter: none; }
}
