/* SAGIP — tokens CSS (refonte 2026-06 — palette enrichie + variantes) */
:root {
  /* ─── Couleurs marque (ramp bleu enrichie) ─── */
  --c-brand-night:  #07123A;   /* nouveau — bleu nuit profond */
  --c-brand-deep:   #0B1F5C;
  --c-brand:        #1F4FBF;
  --c-brand-bright: #2FA9E5;
  --c-brand-glow:   #5CC6F5;   /* nouveau — cyan lumineux */
  --c-accent:       #F2B400;
  --c-accent-soft:  #FFD45C;

  /* ─── Neutres (légèrement réchauffés) ─── */
  --c-ink:        #0A1024;
  --c-ink-soft:   #3A4262;
  --c-muted:      #8A93AE;
  --c-line:       #E5E8F0;
  --c-line-soft:  #EEF1F7;
  --c-surface:    #FFFFFF;
  --c-canvas:     #F5F7FC;
  --c-canvas-2:   #EBF0FA;

  /* ─── Sémantiques ─── */
  --c-success: #1D9A6C;
  --c-warning: #E08A00;
  --c-danger:  #D14343;

  /* ─── Chapitres (accents harmonisés marque) ─── */
  --c-chap-auto:    #2552C8;   /* Automatique */
  --c-chap-stp:     #1FA8DE;   /* Productique / Génie Industriel */
  --c-chap-ifac:    #6E57D6;   /* Mixte / transverse / IFAC */
  --c-chap-mixte:   linear-gradient(90deg, #2552C8, #1FA8DE);

  /* ─── Dégradés (nouveaux — profondeur) ─── */
  --grad-hero:
    radial-gradient(120% 90% at 82% 8%, rgba(92,198,245,0.30), transparent 55%),
    radial-gradient(90% 70% at 12% 95%, rgba(110,87,214,0.22), transparent 60%),
    linear-gradient(150deg, #07123A 0%, #0B1F5C 38%, #1F4FBF 80%, #2569D6 100%);
  --grad-deep:
    linear-gradient(150deg, #07123A 0%, #0B1F5C 55%, #143A8C 100%);
  --grad-accent: linear-gradient(120deg, #F2B400 0%, #FFD45C 100%);
  --grad-sheen:  linear-gradient(180deg, rgba(255,255,255,0.10), rgba(255,255,255,0));

  /* ─── Typographie ─── */
  --ff-display: "Manrope", "Inter", system-ui, sans-serif;
  --ff-text:    "Inter", system-ui, sans-serif;
  --ff-mono:    "JetBrains Mono", ui-monospace, monospace;

  --fs-1: 2.75rem;
  --fs-2: 2rem;
  --fs-3: 1.5rem;
  --fs-4: 1.25rem;
  --fs-5: 1rem;
  --fs-6: 0.875rem;
  --fs-7: 0.75rem;

  /* ─── Espacements (échelle 4px) ─── */
  --s-1:  4px;  --s-2:  8px;  --s-3:  12px; --s-4:  16px;
  --s-5:  20px; --s-6:  24px; --s-7:  32px; --s-8:  40px;
  --s-9:  48px; --s-10: 64px; --s-11: 80px; --s-12: 96px;

  /* ─── Rayons ─── */
  --r-sm: 6px; --r-md: 8px; --r-lg: 12px; --r-xl: 18px; --r-pill: 999px;

  /* ─── Élévations ─── */
  --sh-1: 0 1px 2px rgba(11,31,92,0.05);
  --sh-2: 0 1px 3px rgba(11,31,92,0.06), 0 8px 24px -12px rgba(11,31,92,0.10);
  --sh-3: 0 1px 3px rgba(11,31,92,0.08), 0 18px 48px -18px rgba(11,31,92,0.22);
  --sh-focus: 0 0 0 3px rgba(242,180,0,0.45);

  /* ─── Conteneur ─── */
  --container: 1280px;
  --container-pad: clamp(1rem, 4vw, 2.5rem);

  /* ─── Transitions ─── */
  --t-fast: 120ms ease-out;
  --t-med:  200ms ease-out;
  --t-slow: 320ms cubic-bezier(.2,.7,.2,1);
}

/* ═══════════ VARIANTES DE PALETTE (basculables via Tweaks) ═══════════ */

/* B — Duo : bleu + second accent froid (violet IFAC) pour rythmer */
:root[data-palette="duo"] {
  --c-brand:        #1E46B0;
  --c-accent:       #F2B400;
  --c-accent-soft:  #FFD45C;
  --grad-hero:
    radial-gradient(120% 90% at 85% 5%, rgba(110,87,214,0.34), transparent 55%),
    radial-gradient(90% 70% at 8% 95%, rgba(47,169,229,0.22), transparent 60%),
    linear-gradient(150deg, #0A1336 0%, #16215E 40%, #2A3E9E 82%, #3B53C2 100%);
  --c-chap-stp:     #25B0C8;
  --c-chap-ifac:    #7E5BE6;
}

/* C — Clair : fonds crème/ardoise, bleu en accent, plus respirant */
:root[data-palette="clair"] {
  --c-ink:        #141A2E;
  --c-ink-soft:   #424A66;
  --c-canvas:     #F1ECE3;   /* crème chaud */
  --c-canvas-2:   #E7E0D2;
  --c-surface:    #FBF9F5;
  --c-line:       #E2DACB;
  --c-line-soft:  #EDE7DB;
  --grad-hero:
    radial-gradient(120% 90% at 82% 8%, rgba(92,198,245,0.26), transparent 55%),
    radial-gradient(90% 70% at 12% 95%, rgba(31,79,191,0.18), transparent 60%),
    linear-gradient(150deg, #0B1F5C 0%, #143A8C 55%, #1F4FBF 100%);
}

/* Reset doux */
*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
html { -webkit-text-size-adjust: 100%; }
body {
  font-family: var(--ff-text);
  font-size: var(--fs-5);
  line-height: 1.6;
  color: var(--c-ink);
  background: var(--c-canvas);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
h1, h2, h3, h4, h5 {
  font-family: var(--ff-display);
  color: var(--c-brand-deep);
  margin: 0;
  letter-spacing: -0.01em;
  text-wrap: balance;
}
h1 { font-size: var(--fs-1); font-weight: 800; line-height: 1.1; letter-spacing: -0.025em; }
h2 { font-size: var(--fs-2); font-weight: 700; line-height: 1.2; letter-spacing: -0.02em; }
h3 { font-size: var(--fs-3); font-weight: 700; line-height: 1.25; }
h4 { font-size: var(--fs-4); font-weight: 600; line-height: 1.3; }
p { margin: 0; text-wrap: pretty; }
a { color: var(--c-brand); text-decoration: none; transition: color var(--t-fast); }
a:hover { color: var(--c-brand-bright); }
a:focus-visible, button:focus-visible, [tabindex]:focus-visible {
  outline: 2px solid var(--c-accent);
  outline-offset: 2px;
  border-radius: 4px;
}
img, svg { display: block; max-width: 100%; }
button { font: inherit; cursor: pointer; }
ul, ol { margin: 0; padding: 0; list-style: none; }

::selection { background: var(--c-accent); color: var(--c-brand-deep); }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
}
