/* ==========================================================================
   TasksToDo — Design System
   Tokens (couleurs, formes, ombres) + reset + typographie de base.
   ========================================================================== */

:root {
  /* Typographie */
  --font-family: 'Plus Jakarta Sans', system-ui, -apple-system, sans-serif;

  /* Rôles de couleurs — 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.09);
  --m-nav-bg: rgba(255, 255, 255, 0.85);
  --m-player-bg: #1A1B21;
  --m-player-fg: #FFFFFF;

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

  /* Rythme */
  --section-padding-top: 110px;
  --container-max: 1100px;
  --page-gutter: 20px;
  --ease-expressive: cubic-bezier(0.2, 0.8, 0.2, 1);
}

:root[data-theme="dark"] {
  /* Rôles de couleurs — 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.45);
  --m-nav-bg: rgba(29, 29, 36, 0.85);
  --m-player-bg: #26262E;
  --m-player-fg: #E5E1E6;
}

/* Sans préférence stockée : suit prefers-color-scheme */
@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.45);
    --m-nav-bg: rgba(29, 29, 36, 0.85);
    --m-player-bg: #26262E;
    --m-player-fg: #E5E1E6;
  }
}

/* ------------------------------ Reset ------------------------------ */
*,
*::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;
}

img {
  max-width: 100%;
  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);
}

/* Respecte les préférences de réduction de mouvement */
@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: 2px;
  border-radius: var(--radius-xs);
}

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

.container {
  max-width: var(--container-max);
  margin: 0 auto;
  padding: 0;
  width: 100%;
  box-sizing: border-box;
}

.section {
  max-width: var(--container-max);
  margin: 0 auto;
  padding: var(--section-padding-top) 0 0;
  width: 100%;
  box-sizing: border-box;
}

@media (max-width: 1140px) {
  .container,
  .section {
    padding-left: var(--page-gutter);
    padding-right: var(--page-gutter);
  }
}

@media (max-width: 480px) {
  .container,
  .section {
    padding-left: 16px;
    padding-right: 16px;
  }
}

.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: -60px;
  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;
}

/* ------------------------------ Keyframes ------------------------------ */
@keyframes gaugeIn {
  from {
    stroke-dashoffset: 264;
  }
}

@keyframes popIn {
  0% {
    transform: scale(1);
  }

  35% {
    transform: scale(1.06);
  }

  70% {
    transform: scale(0.985);
  }

  100% {
    transform: scale(1);
  }
}

@keyframes livePulse {

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

  50% {
    opacity: 0.45;
    transform: scale(0.82);
  }
}

@keyframes floatY {

  0%,
  100% {
    transform: translateY(0);
  }

  50% {
    transform: translateY(-8px);
  }
}

@keyframes barBounce {

  0%,
  100% {
    transform: scaleY(0.4);
  }

  50% {
    transform: scaleY(1);
  }
}

@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(18px);
  }

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

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}