/* =============================================================================
   variables.css — Sistema de diseño
   -----------------------------------------------------------------------------
   El sitio alterna superficies oscuras y claras. En lugar de duplicar reglas,
   cada sección declara .surface-dark o .surface-light y redefine un puñado de
   tokens semánticos (--bg, --fg, --line, --accent...). Los componentes solo
   usan esos tokens, así que se adaptan solos a la superficie donde estén.
   ========================================================================== */

:root {
  /* --- Paleta base (valores fijos, no usar directo en componentes) ------- */
  --ink-900: #0B111A;   /* Azul noche  */
  --ink-800: #111B29;   /* Azul carbón */
  --ink-700: #17324D;   /* Azul tinta  */
  --paper-100: #FAF9F6; /* Blanco suave */
  --paper-200: #F3EFE7; /* Marfil cálido */
  --paper-300: #E8E2D6; /* Marfil sombreado */
  --green-500: #23C77A; /* Verde acento (sobre oscuro) */
  --green-700: #16885A; /* Verde profundo */
  --green-800: #11704A; /* Verde texto sobre claro (contraste AA) */
  --green-900: #0D5B3C;
  --gray-400: #AEB8C5;  /* Gris texto */
  --gray-line: #263445; /* Gris línea */

  /* --- Tokens semánticos: superficie oscura por defecto ------------------ */
  --bg: var(--ink-900);
  --bg-alt: var(--ink-800);
  --bg-inset: rgba(255, 255, 255, 0.035);
  --fg: var(--paper-200);
  --fg-soft: var(--gray-400);
  --fg-muted: #7E8B9B;
  --line: var(--gray-line);
  --line-soft: rgba(174, 184, 197, 0.16);
  --accent: var(--green-500);
  --accent-strong: #1FB36D;
  --accent-ink: var(--ink-900);   /* texto sobre un botón de acento */
  --shadow: 0 18px 40px rgba(0, 0, 0, 0.45);

  /* --- Tipografía -------------------------------------------------------- */
  --font-heading: 'Newsreader', 'Iowan Old Style', Georgia, 'Times New Roman', serif;
  --font-body: 'Inter', system-ui, -apple-system, 'Segoe UI', sans-serif;

  --text-xs:   0.8125rem;
  --text-sm:   0.9375rem;
  --text-base: 1rem;
  --text-lg:   1.125rem;
  --text-xl:   1.3125rem;

  /* Escala fluida para títulos */
  --title-xl: clamp(2.25rem, 1.35rem + 3.4vw, 3.75rem);
  --title-lg: clamp(1.9rem, 1.35rem + 2.1vw, 2.85rem);
  --title-md: clamp(1.5rem, 1.2rem + 1.1vw, 2rem);
  --title-sm: clamp(1.2rem, 1.08rem + 0.5vw, 1.4rem);

  --leading-body: 1.65;
  --measure: 68ch;

  /* --- Espaciado --------------------------------------------------------- */
  --space-1: 0.25rem;
  --space-2: 0.5rem;
  --space-3: 0.75rem;
  --space-4: 1rem;
  --space-5: 1.5rem;
  --space-6: 2rem;
  --space-7: 2.75rem;
  --space-8: 3.5rem;
  --space-9: 4.5rem;
  --space-10: 6rem;

  /* --- Layout ------------------------------------------------------------ */
  --container: 1200px;
  --container-narrow: 760px;
  --container-pad: 2rem;
  --section-pad: 6rem;
  --header-h: 76px;

  /* --- Formas ------------------------------------------------------------ */
  --radius-sm: 4px;
  --radius-md: 10px;
  --radius-lg: 18px;

  /* --- Movimiento (corto y con propósito: 150–350 ms) -------------------- */
  --t-fast: 150ms cubic-bezier(0.4, 0, 0.2, 1);
  --t-base: 240ms cubic-bezier(0.4, 0, 0.2, 1);
  --t-slow: 340ms cubic-bezier(0.16, 1, 0.3, 1);
}

/* --- Superficie oscura (explícita) --------------------------------------- */
.surface-dark {
  --bg: var(--ink-900);
  --bg-alt: var(--ink-800);
  --bg-inset: rgba(255, 255, 255, 0.035);
  --fg: var(--paper-200);
  --fg-soft: var(--gray-400);
  --fg-muted: #7E8B9B;
  --line: var(--gray-line);
  --line-soft: rgba(174, 184, 197, 0.16);
  --accent: var(--green-500);
  --accent-strong: #1FB36D;
  --accent-ink: var(--ink-900);
  --shadow: 0 18px 40px rgba(0, 0, 0, 0.45);
  background-color: var(--bg);
  color: var(--fg);
}

/* Variante oscura un tono más alta, para alternar sin saltar a claro */
.surface-dark-alt {
  --bg: var(--ink-800);
  background-color: var(--ink-800);
}

/* --- Superficie clara ----------------------------------------------------- */
.surface-light {
  --bg: var(--paper-200);
  --bg-alt: var(--paper-100);
  --bg-inset: rgba(11, 17, 26, 0.035);
  --fg: #12202F;
  --fg-soft: #4E5D6E;
  --fg-muted: #6B7887;
  --line: var(--paper-300);
  --line-soft: rgba(18, 32, 47, 0.12);
  --accent: var(--green-800);
  --accent-strong: var(--green-900);
  --accent-ink: var(--paper-100);
  --shadow: 0 14px 34px rgba(23, 50, 77, 0.10);
  background-color: var(--bg);
  color: var(--fg);
}

.surface-light-alt {
  --bg: var(--paper-100);
  background-color: var(--paper-100);
}

/* --- Breakpoints --------------------------------------------------------- */
@media (max-width: 1200px) {
  :root { --section-pad: 5.5rem; }
}

@media (max-width: 992px) {
  :root {
    --container-pad: 1.75rem;
    --section-pad: 4.5rem;
    --header-h: 68px;
  }
}

@media (max-width: 768px) {
  :root {
    --container-pad: 1.25rem;
    --section-pad: 3.75rem;
  }
}

@media (max-width: 480px) {
  :root {
    --container-pad: 1.125rem;
    --section-pad: 3.25rem;
  }
}
