/* ==========================================================================
   TasksToDo — Blog Design System M3 Expressive
   Tokens (Couleurs, Formes, Ombres, Typo) + Reset + Utilitaires
   ========================================================================== */

:root {
  /* Typographie */
  --font-family: 'Plus Jakarta Sans', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-code: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;

  /* Rôles de couleurs M3 — Mode Clair */
  --m-p: #0F69F8;
  --m-op: #FFFFFF;
  --m-pc: #DBE3FF;
  --m-opc: #001945;

  --m-s: #009270;
  --m-os: #FFFFFF;
  --m-sc: #B6F2DE;
  --m-osc: #00382A;

  --m-t: #F89E0F;
  --m-ot: #3A2400;
  --m-tc: #FFE1B5;
  --m-otc: #4A2800;

  --m-err: #DC3545;
  --m-oerr: #FFFFFF;
  --m-errc: #FFDAD9;
  --m-oerrc: #410007;

  --m-succ: #2AA952;

  --m-sf: #F8F2F5;
  --m-osf: #1A1B21;
  --m-osv: #494A52;

  --m-scl: #FFFFFF;
  --m-sclo: #F3EDF1;
  --m-sc1: #EDE7EC;
  --m-sch: #E7E1E6;
  --m-schh: #E1DBE0;

  --m-out: #8A8B95;
  --m-outv: #D4D3DB;
  --m-shadow: rgba(24, 22, 50, 0.08);
  --m-nav-bg: rgba(255, 255, 255, 0.86);
  --m-player-bg: #1A1B21;
  --m-player-fg: #FFFFFF;

  /* Formes & Rayons M3 Expressive */
  --radius-xs: 8px;
  --radius-sm: 12px;
  --radius-md: 16px;
  --radius-lg: 20px;
  --radius-xl: 28px;
  --radius-2xl: 32px;
  --radius-pill: 999px;

  /* Rythme & Espacement */
  --container-max: 1200px;
  --article-max: 820px;
  --section-padding-top: 100px;
  --ease-expressive: cubic-bezier(0.2, 0.8, 0.2, 1);
}

:root[data-theme="dark"] {
  /* Rôles de couleurs M3 — Mode Sombre */
  --m-p: #B0C6FF;
  --m-op: #002E6B;
  --m-pc: #164FC0;
  --m-opc: #DBE3FF;

  --m-s: #68F8CF;
  --m-os: #00382A;
  --m-sc: #009270;
  --m-osc: #CFFAEC;

  --m-t: #FFB95E;
  --m-ot: #472A00;
  --m-tc: #7A4E00;
  --m-otc: #FFE1B5;

  --m-err: #FFB3B3;
  --m-oerr: #67000A;
  --m-errc: #B3202E;
  --m-oerrc: #FFDAD9;

  --m-succ: #7BD99A;

  --m-sf: #131318;
  --m-osf: #E5E1E6;
  --m-osv: #C7C6CF;

  --m-scl: #1D1D24;
  --m-sclo: #1B1B21;
  --m-sc1: #26262E;
  --m-sch: #282932;
  --m-schh: #33343C;

  --m-out: #8F909A;
  --m-outv: #45464E;
  --m-shadow: rgba(0, 0, 0, 0.48);
  --m-nav-bg: rgba(29, 29, 36, 0.86);
  --m-player-bg: #26262E;
  --m-player-fg: #E5E1E6;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]):not([data-theme="dark"]) {
    --m-p: #B0C6FF;
    --m-op: #002E6B;
    --m-pc: #164FC0;
    --m-opc: #DBE3FF;
    --m-s: #68F8CF;
    --m-os: #00382A;
    --m-sc: #009270;
    --m-osc: #CFFAEC;
    --m-t: #FFB95E;
    --m-ot: #472A00;
    --m-tc: #7A4E00;
    --m-otc: #FFE1B5;
    --m-err: #FFB3B3;
    --m-oerr: #67000A;
    --m-errc: #B3202E;
    --m-oerrc: #FFDAD9;
    --m-succ: #7BD99A;
    --m-sf: #131318;
    --m-osf: #E5E1E6;
    --m-osv: #C7C6CF;
    --m-scl: #1D1D24;
    --m-sclo: #1B1B21;
    --m-sc1: #26262E;
    --m-sch: #282932;
    --m-schh: #33343C;
    --m-out: #8F909A;
    --m-outv: #45464E;
    --m-shadow: rgba(0, 0, 0, 0.48);
    --m-nav-bg: rgba(29, 29, 36, 0.86);
    --m-player-bg: #26262E;
    --m-player-fg: #E5E1E6;
  }
}

/* ------------------------------ Reset & Base ------------------------------ */
*,
*::before,
*::after {
  box-sizing: border-box;
}

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

body {
  margin: 0;
  background: var(--m-sf);
  color: var(--m-osf);
  font-family: var(--font-family);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  transition: background-color 0.25s ease, color 0.25s ease;
  overflow-x: hidden;
}

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

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

button {
  font-family: inherit;
}

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

h1,
h2,
h3,
h4,
h5,
h6,
p {
  margin: 0;
}

::selection {
  background: var(--m-pc);
  color: var(--m-opc);
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
    scroll-behavior: auto !important;
  }
}

:focus-visible {
  outline: 2.5px solid var(--m-p);
  outline-offset: 3px;
  border-radius: var(--radius-xs);
}

[id] {
  scroll-margin-top: 100px;
}

.container {
  max-width: var(--container-max);
  margin: 0 auto;
  padding: 0 28px;
}

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

.skip-link {
  position: absolute;
  left: 16px;
  top: -70px;
  z-index: 200;
  background: var(--m-p);
  color: var(--m-op);
  font-weight: 700;
  padding: 12px 20px;
  border-radius: var(--radius-md);
  transition: top 0.2s ease;
}

.skip-link:focus {
  top: 16px;
}

/* ------------------------------ Keyframe Animations ------------------------------ */
@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(12px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes pulseGlow {

  0%,
  100% {
    opacity: 0.8;
    transform: scale(1);
  }

  50% {
    opacity: 0.35;
    transform: scale(0.92);
  }
}

@keyframes toastIn {
  from {
    opacity: 0;
    transform: translate(-50%, 20px) scale(0.96);
  }

  to {
    opacity: 1;
    transform: translate(-50%, 0) scale(1);
  }
}