/* =====================================================================
   BASE - couleurs, typographie, fond animé
   ---------------------------------------------------------------------
   Les couleurs sont regroupées en variables : modifier les valeurs
   de :root (nuit) et [data-theme="jour"] suffit à changer l'ambiance.
   ===================================================================== */

/* ---------- Couleurs : nuit (par défaut) ---------- */
:root {
  --fond: #0b0e1a;
  --texte: #d9deea;
  --texte-doux: #99a2b8;
  --accent: #a9b6e4;          /* lavande douce */
  --accent-2: #8fbfc3;        /* bleu-vert doux */
  --carte: rgba(22, 28, 50, 0.72);
  --carte-survol: rgba(30, 38, 66, 0.85);
  --bordure: rgba(169, 182, 228, 0.15);
  --bordure-forte: rgba(169, 182, 228, 0.35);
  --curseur: #f4f6fb;
  --ombre: 0 10px 40px rgba(0, 0, 0, 0.35);
  --dispo: #8fcfa6;

  --police-titre: "Space Grotesk", system-ui, sans-serif;
  --police-texte: "Inter", system-ui, sans-serif;
  --rayon: 16px;
  --transition-theme: 0.9s ease;
  color-scheme: dark;
}

/* ---------- Couleurs : jour ---------- */
[data-theme="jour"] {
  --fond: #dce8f1;
  --texte: #1f2a38;
  --texte-doux: #4f5d70;
  --accent: #4d6890;
  --accent-2: #467f84;
  --carte: rgba(255, 255, 255, 0.68);
  --carte-survol: rgba(255, 255, 255, 0.85);
  --bordure: rgba(77, 104, 144, 0.18);
  --bordure-forte: rgba(77, 104, 144, 0.4);
  --curseur: #27344b;
  --ombre: 0 10px 40px rgba(60, 90, 130, 0.15);
  --dispo: #3f8f5c;
  color-scheme: light;
}

/* ---------- Bases ---------- */
*, *::before, *::after { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--fond);
  color: var(--texte);
  font-family: var(--police-texte);
  font-size: 1rem;
  line-height: 1.6;
  overflow-x: hidden;
  transition: background-color var(--transition-theme), color var(--transition-theme);
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; }
img { max-width: 100%; display: block; }
button { font: inherit; color: inherit; }

::selection { background: var(--accent); color: var(--fond); }

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
  border-radius: 6px;
}

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

.noscript { text-align: center; padding: 2rem; }

/* ---------- Fond animé ---------- */
#ciel {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: -1;
  pointer-events: none;
}

/* ---------- Animations réduites (réglage d'accessibilité du système) ---------- */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
