/* ==========================================================================
   Save21 — Design System
   Tokens, reset y estilos base. Cargar antes de main.css.
   ========================================================================== */

/* ---------- Tokens de diseño ---------- */
:root {
  /* Navy (base ampliada) */
  --navy-950: #051522;
  --navy-900: #071e2f;
  --navy-800: #0a2c45;
  --navy-700: #0d3a52;
  --navy-600: #1a4a6b;
  --navy-500: #23608a;
  --navy-400: #3a7ca5;

  /* Green (acento) */
  --green-300: #6bffad;
  --green-400: #00e676;
  --green-500: #2ecc71;
  --green-600: #27ae60;
  --green-700: #1e8449;

  /* Neutrales */
  --bg-base: #f0f4f7;
  --bg-subtle: #f5f7f9;
  --surface: #ffffff;
  --surface-raised: #ffffff;

  --text-strong: #0d1b26;
  --text-body: #3b4a5a;
  --text-muted: #6b7a8a;
  --text-on-dark: #ffffff;
  --text-on-dark-muted: rgba(255, 255, 255, 0.72);

  --border: rgba(13, 58, 82, 0.10);
  --border-strong: rgba(13, 58, 82, 0.18);
  --border-on-dark: rgba(255, 255, 255, 0.12);
  --border-on-dark-strong: rgba(255, 255, 255, 0.22);

  /* Terminal */
  --term-bg: #0b1020;
  --term-bg-bar: #131a2d;
  --term-fg: #7dd3a8;
  --term-cmd: #ffcc66;
  --term-desc: #88aacc;
  --term-muted: #5a6a80;
  --term-dot-red: #ff5f57;
  --term-dot-amber: #febc2e;
  --term-dot-green: #28c840;

  /* Gradientes */
  --grad-hero:
    radial-gradient(1100px 620px at 12% 8%, rgba(0, 230, 118, 0.14), transparent 55%),
    radial-gradient(900px 520px at 88% 18%, rgba(46, 204, 113, 0.10), transparent 60%),
    radial-gradient(1200px 800px at 50% 110%, rgba(26, 74, 107, 0.55), transparent 70%),
    linear-gradient(180deg, var(--navy-800) 0%, var(--navy-900) 100%);
  --grad-section-dark:
    radial-gradient(900px 500px at 80% 0%, rgba(0, 230, 118, 0.06), transparent 60%),
    linear-gradient(180deg, var(--navy-900) 0%, var(--navy-800) 100%);
  --grad-accent: linear-gradient(135deg, var(--green-400) 0%, var(--green-500) 100%);
  --grad-border: linear-gradient(135deg, rgba(0, 230, 118, 0.55), rgba(46, 204, 113, 0.08));
  --grad-glass: linear-gradient(135deg, rgba(255, 255, 255, 0.08), rgba(255, 255, 255, 0.02));

  /* Tipografía */
  --font-sans: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
               Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-mono: ui-monospace, "SF Mono", Menlo, Consolas, "Liberation Mono",
               "Courier New", monospace;

  --text-xs:   0.875rem;
  --text-sm:   1rem;
  --text-base: 1.125rem;
  --text-lg:   1.25rem;
  --text-xl:   1.5rem;
  --text-2xl:  1.75rem;
  --text-3xl:  2.125rem;
  --text-4xl:  2.75rem;
  --text-5xl:  3.5rem;
  --text-display: clamp(2.8rem, 4.5vw + 1.2rem, 5.2rem);
  --text-hero-sub: clamp(1.25rem, 1.2vw + 1rem, 1.75rem);
  --text-section-title: clamp(2rem, 2.2vw + 1.1rem, 2.85rem);

  --leading-tight:  1.08;
  --leading-snug:   1.25;
  --leading-normal: 1.6;

  --tracking-tight:  -0.02em;
  --tracking-normal: 0;
  --tracking-wide:   0.08em;
  --tracking-wider:  0.14em;

  /* Espaciado (escala 4px) */
  --space-1:  0.25rem;
  --space-2:  0.5rem;
  --space-3:  0.75rem;
  --space-4:  1rem;
  --space-5:  1.25rem;
  --space-6:  1.5rem;
  --space-8:  2rem;
  --space-10: 2.5rem;
  --space-12: 3rem;
  --space-16: 4rem;
  --space-20: 5rem;
  --space-24: 6rem;
  --space-32: 8rem;

  --section-y: clamp(4rem, 8vw, 7rem);

  /* Layout */
  --container-max: 1200px;
  --container-narrow: 960px;
  --container-pad: clamp(1rem, 4vw, 2rem);

  /* Radios */
  --radius-xs:  4px;
  --radius-sm:  8px;
  --radius-md:  12px;
  --radius-lg:  18px;
  --radius-xl:  24px;
  --radius-2xl: 32px;
  --radius-pill: 999px;

  /* Sombras */
  --shadow-xs: 0 1px 2px rgba(7, 30, 47, 0.06);
  --shadow-sm: 0 2px 8px rgba(7, 30, 47, 0.08);
  --shadow-md: 0 8px 24px rgba(13, 58, 82, 0.10);
  --shadow-lg: 0 20px 40px rgba(7, 30, 47, 0.18);
  --shadow-xl: 0 30px 60px rgba(0, 0, 0, 0.35);
  --shadow-glow-green: 0 0 40px rgba(0, 230, 118, 0.28);
  --shadow-glow-green-sm: 0 0 20px rgba(0, 230, 118, 0.18);

  /* Transiciones */
  --ease-out:    cubic-bezier(0.16, 1, 0.3, 1);
  --ease-in-out: cubic-bezier(0.65, 0, 0.35, 1);
  --duration-fast: 160ms;
  --duration-base: 280ms;
  --duration-slow: 520ms;

  /* Z-index */
  --z-nav: 100;
  --z-sticky-cta: 900;
  --z-modal: 1000;
}

/* ---------- Reset mínimo ---------- */
*,
*::before,
*::after {
  box-sizing: border-box;
}

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

body {
  margin: 0;
  font-family: var(--font-sans);
  font-size: var(--text-base);
  line-height: var(--leading-normal);
  color: var(--text-body);
  background: var(--bg-base);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

img,
svg,
video {
  display: block;
  max-width: 100%;
  height: auto;
}

picture {
  display: block;
}

button {
  font: inherit;
  color: inherit;
  background: none;
  border: none;
  padding: 0;
  cursor: pointer;
}

a {
  color: inherit;
  text-decoration: none;
}

ul,
ol {
  list-style: none;
  margin: 0;
  padding: 0;
}

/* ---------- Tipografía base ---------- */
h1, h2, h3, h4, h5, h6 {
  margin: 0 0 var(--space-4);
  font-family: var(--font-sans);
  font-weight: 700;
  line-height: var(--leading-tight);
  color: var(--text-strong);
  letter-spacing: var(--tracking-tight);
}

h1 { font-size: var(--text-4xl); }
h2 { font-size: var(--text-section-title); font-weight: 700; }
h3 { font-size: var(--text-xl); font-weight: 600; }
h4 { font-size: var(--text-lg); font-weight: 600; }

p {
  margin: 0 0 var(--space-4);
}

strong { font-weight: 700; color: inherit; }

/* Eyebrow / kicker */
.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  font-size: var(--text-xs);
  font-weight: 600;
  letter-spacing: var(--tracking-wider);
  text-transform: uppercase;
  color: var(--green-400);
}

.eyebrow::before {
  content: "";
  width: 24px;
  height: 2px;
  background: var(--grad-accent);
  border-radius: var(--radius-pill);
}

/* ---------- Utilidades ---------- */
.container {
  width: 100%;
  max-width: var(--container-max);
  margin-inline: auto;
  padding-inline: var(--container-pad);
}

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

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

.stack > * + * {
  margin-top: var(--space-4);
}

.stack-lg > * + * {
  margin-top: var(--space-6);
}

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

.text-gradient {
  background: var(--grad-accent);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

/* Scroll reveal (aplica animation-delay vía style inline si se quiere escalonar) */
@keyframes fadeUp {
  from {
    opacity: 0;
    transform: translateY(24px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes fadeIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}

@keyframes blink {
  0%, 49%   { opacity: 1; }
  50%, 100% { opacity: 0; }
}

@keyframes pulseGlow {
  0%, 100% { box-shadow: 0 0 0 0 rgba(0, 230, 118, 0.35); }
  50%      { box-shadow: 0 0 0 14px rgba(0, 230, 118, 0); }
}

.reveal {
  animation: fadeUp 800ms var(--ease-out) both;
}

/* Preferencias de movimiento */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
    scroll-behavior: auto !important;
  }
}
