/* Design tokens: spec §10. Contrast-checked values, do not change without
   re-checking WCAG 2.1 AA (text ≥ 4.5:1, pastilles and focus ≥ 3:1). */

@font-face {
  font-family: "Figtree";
  font-style: normal;
  font-display: swap;
  font-weight: 300 900;
  src: url("../fonts/figtree/figtree-latin-ext-wght-normal.eca8d8b337ff.woff2") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308,
    U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113,
    U+2C60-2C7F, U+A720-A7FF;
}

@font-face {
  font-family: "Figtree";
  font-style: normal;
  font-display: swap;
  font-weight: 300 900;
  src: url("../fonts/figtree/figtree-latin-wght-normal.202cfb54d4e6.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304,
    U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

:root {
  color-scheme: light;

  --color-bg: #F2F2F7;
  --color-card: #FFFFFF;
  --color-text: #1C1C1E;
  --color-text-muted: #636370;
  --color-primary: #0070D9;
  --color-on-primary: #FFFFFF;
  --color-secondary: #7243E1;
  --color-line: #E4E4EA;
  --color-field: #F6F6FA;
  --color-danger: #B91C1C;
  --color-danger-line: #DC2626;
  --shadow-tile: 0 1px 2px rgb(20 20 40 / 4%), 0 4px 16px rgb(20 20 40 / 6%);

  /* Theme-independent */
  --gradient-tutos: linear-gradient(125deg, #C026D3, #E11D48);
  --gradient-tests: linear-gradient(125deg, #854D0E, #A16207);
  --gradient-guide: linear-gradient(125deg, #0070D9, #7243E1);
  --gradient-sons: linear-gradient(125deg, #0F766E, #15803D);
  --gradient-entraide: linear-gradient(125deg, #C2410C, #BE185D);
  --gradient-actualite: linear-gradient(125deg, #334155, #475569);
  --color-success: #16A34A;
  --color-new: #EA580C;
  --color-info: #0082FA;
  --color-warning: #EAB308;

  --radius-tile: 20px;
  --radius-field: 12px;
  --radius-pill: 999px;

  --space-1: 4px;
  --space-2: 8px;
  --space-3: 12px;
  --space-4: 16px;
  --space-5: 20px;
  --space-6: 24px;
  --space-7: 28px;
  --space-8: 32px;
  --space-9: 36px;
  --space-10: 40px;
  --space-11: 44px;
  --space-12: 48px;

  --font-sans: "Figtree", system-ui, -apple-system, "Segoe UI", sans-serif;
}

/* Dark: explicit choice, or system preference when no choice is stored. */
[data-theme="dark"] {
  color-scheme: dark;

  --color-bg: #16161A;
  --color-card: #232329;
  --color-text: #F2F2F7;
  --color-text-muted: #A1A1AA;
  --color-primary: #4DA3FF;
  --color-on-primary: #0B1220;
  --color-line: #33333B;
  --color-field: #1B1B20;
  --color-danger: #F87171;
  --color-danger-line: #F87171;
  --shadow-tile: none;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;

    --color-bg: #16161A;
    --color-card: #232329;
    --color-text: #F2F2F7;
    --color-text-muted: #A1A1AA;
    --color-primary: #4DA3FF;
    --color-on-primary: #0B1220;
    --color-line: #33333B;
    --color-field: #1B1B20;
    --color-danger: #F87171;
    --color-danger-line: #F87171;
    --shadow-tile: none;
  }
}
