/* Desarrollo DEA — design tokens (source: DESIGN_PLAN.md) */

:root {
  /* Color — locked brand (D-05 to D-09) */
  --azul: #1d5b84;
  --gris: #4d4e50;
  --naranja: #e37b3a; /* non-text only: bars ≥4px, bullets, logo (D-08) */

  /* Color — derived */
  --blanco: #ffffff;
  --niebla: #f3f6f8;
  --bruma: #dde6ec;
  --hondo: #0f3a56;
  --perla: #c3cbd1;
  --alerta: #a8361b; /* form errors only, always with written text (D-09) */

  /* Logo fills (D-33). Overridden per context, e.g. the footer. */
  --logo-azul: var(--azul);
  --logo-gris: var(--gris);
  --logo-naranja: var(--naranja);

  /* Typography — Archivo, one family, width as the role variable (D-10, D-11) */
  --font: "Archivo", system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  --wdth-text: 100%;
  --wdth-head: 100%; /* 106% at ≥720, 112.5% at ≥1280 */

  --fs-h1: 2.25rem;   /* 36 */
  --fs-h2: 1.5rem;    /* 24 */
  --fs-h3: 1.3125rem; /* 21 */
  --fs-lead: 1.125rem;/* 18 */
  --fs-body: 1.125rem;/* 18 */
  --fs-small: 0.875rem;/* 14 */
  --fs-ui: 1rem;      /* 16: nav, buttons, captions */

  --lh-h1: 1.12; /* accent clearance minimum (D-12) */
  --lh-h2: 1.15;
  --lh-h3: 1.25;
  --lh-lead: 1.5;
  --lh-body: 1.6;
  --lh-small: 1.5;
  --lh-ui: 1.25;

  --measure-body: 66ch;
  --measure-lead: 56ch;

  /* Spacing */
  --space-1: 0.25rem; /* 4 */
  --space-2: 0.5rem;  /* 8 */
  --space-3: 1rem;    /* 16 */
  --space-4: 1.5rem;  /* 24 */
  --space-5: 2rem;    /* 32 */
  --space-6: 3rem;    /* 48 */
  --space-7: 4rem;    /* 64 */
  --space-8: 6rem;    /* 96 */

  /* Grid and frame (D-18) */
  --cols: 4;
  --gap: 16px;
  --margin: 16px;
  --frame-max: 1360px;

  /* Bleed rule (D-19): bleeds reach the viewport edge while the outer margin
     is ≤ 120px (every viewport ≤ 1600px) and stop 120px outside the frame beyond. */
  --bleed-max: 120px;

  /* Header (D-27, D-31). --header-h is overwritten by js/main.js with the
     rendered height; the fallback is the <720px header: 48 logo + 2×16 + 1 rule. */
  --logo-h-header: 48px;
  --logo-h-footer: 64px;
  --header-pad: 16px;
  --header-h: 81px;

  /* Focus (§9) */
  --focus-width: 3px;
  --focus-offset: 2px;
  --focus-color: var(--azul);

  /* Controls (D-17) */
  --control-h: 48px;
  --radius: 2px;

  /* Motion (§9, "Menú") */
  --dur-menu-in: 180ms;
  --dur-menu-out: 140ms;
  --ease-out: cubic-bezier(0.2, 0.7, 0.2, 1);
}

@media (min-width: 720px) {
  :root {
    --cols: 8;
    --gap: 24px;
    --margin: 32px;
    --wdth-head: 106%;
    --fs-h1: 3rem;      /* 48 */
    --fs-h2: 2.25rem;   /* 36 */
    --fs-h3: 1.5rem;    /* 24 */
    --fs-lead: 1.3125rem; /* 21 */
    --logo-h-header: 56px;
  }
}

@media (min-width: 1024px) {
  :root {
    --cols: 12;
    --gap: 32px;
    --margin: 48px;
  }
}

@media (min-width: 1280px) {
  :root {
    --margin: 64px;
    --wdth-head: 112.5%;
    --fs-h1: 3.75rem;   /* 60, capped here at every wider size (D-13) */
  }
}

@media (prefers-reduced-motion: reduce) {
  :root {
    --dur-menu-in: 0ms;
    --dur-menu-out: 0ms;
  }
}
