/* Système fonctionnel — base. À charger APRÈS jetons/jetons.css.

   Volontairement léger, pour entrer dans un projet existant sans le casser :
   il ne restyle ni h1–h6, ni p, ni les listes. Les titres et les textes
   passent par des classes (.ds-hero, .ds-title, .ds-lead…). Seuls le fond, la
   police, le focus et le mouvement réduit s'appliquent à toute la page. */

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

/* `hidden` doit gagner : sans ça, un composant en `display: flex` (fenêtre,
   menu) reste visible malgré l'attribut. */
[hidden] { display: none !important; }

/* Un fond, plein, porté par <html> (le canevas) : la zone révélée par le rebond
   de défilement et les zones sûres des téléphones reçoit la même couleur, sans
   jointure. Pas de grille, pas de halo, pas de dégradé. */
html {
  background-color: var(--ds-bg);
  color: var(--ds-text);
  font-family: var(--ds-font-sans);
  -webkit-text-size-adjust: 100%;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  /* `clip` et non `hidden` : `hidden` ferait de html un conteneur de
     défilement et annulerait tous les `position: sticky` de la page. */
  overflow-x: clip;
}

body {
  margin: 0;
  min-height: 100dvh;
  font-size: var(--ds-font-size-md);
  line-height: var(--ds-line-height-body);
  background: transparent;
}

/* Un îlot (data-theme sur un élément) reprend la couleur de texte de SON
   mode : `color` s'hérite déjà calculé depuis le parent. */
[data-theme] { color: var(--ds-text); }

/* ── Focus — un seul anneau, bleu info, 2 px, décalé : visible sur tout fond
   (WCAG 2.4.7, 2.4.11). `:where()` = spécificité nulle : un composant peut le
   remplacer sans se battre. Le contour suit les coins de l'élément (une
   pilule reste une pilule). */
:where(a, button, input, select, textarea, summary, [role='button'], [role='menuitem'], [role='tab'], [role='switch'], [tabindex]):focus-visible {
  outline: 2px solid var(--ds-info);
  outline-offset: 2px;
}
:where(input, select, textarea):focus-visible { outline-offset: 1px; }

/* ── Textes ──────────────────────────────────────────────────────────────────
   Sept tailles, trois graisses (700 pour le seul hero), aucune majuscule
   décorative, aucune monospace hors raccourcis clavier. */

/* Titre principal d'une page de présentation : 32 → 44 px. Un par page. */
.ds-hero { margin: 0; font-size: var(--ds-font-size-hero); font-weight: var(--ds-font-weight-bold); letter-spacing: var(--ds-letter-spacing-hero); line-height: var(--ds-line-height-tight); text-wrap: balance; }
/* Titre de page ou de section : 24 → 32 px. */
.ds-title { margin: 0; font-size: var(--ds-font-size-title); font-weight: var(--ds-font-weight-semibold); letter-spacing: var(--ds-letter-spacing-title); line-height: var(--ds-line-height-heading); text-wrap: balance; }
/* Titre de bloc dans une page : 20 px. */
.ds-heading { margin: 0; font-size: var(--ds-font-size-lg); font-weight: var(--ds-font-weight-semibold); letter-spacing: var(--ds-letter-spacing-heading); line-height: var(--ds-line-height-heading); }
/* Titre de carte, de ligne : 16 px. */
.ds-subheading { margin: 0; font-size: var(--ds-font-size-md); font-weight: var(--ds-font-weight-semibold); letter-spacing: var(--ds-letter-spacing-tight); line-height: var(--ds-line-height-heading); }
/* Chapô sous un titre. */
.ds-lead { margin: 0; max-width: 60ch; font-size: var(--ds-font-size-md); line-height: var(--ds-line-height-prose); color: var(--ds-text-2); }
/* Texte d'application (14 px). */
.ds-body { font-size: var(--ds-font-size-sm); line-height: var(--ds-line-height-body); }
/* Étiquette sobre au-dessus d'un bloc, quand elle aide à se repérer : en
   phrase normale, jamais « // 03 · EN MAJUSCULES ». */
.ds-label { margin: 0; font-size: var(--ds-font-size-sm); font-weight: var(--ds-font-weight-semibold); color: var(--ds-text-2); }
/* Légende, note, mention : 12 px, discret. */
.ds-small { font-size: var(--ds-font-size-xs); line-height: var(--ds-line-height-body); color: var(--ds-text-3); }
.ds-secondary { color: var(--ds-text-2); }
.ds-muted { color: var(--ds-text-3); }
/* Chiffres qui changent (prix, compteurs) : ils ne dansent pas. */
.ds-num { font-variant-numeric: tabular-nums; }

/* Lien : le bleu info, souligné au survol seulement. */
.ds-link { color: var(--ds-info); font-weight: var(--ds-font-weight-medium); text-decoration: none; }
.ds-link:hover { color: var(--ds-info-strong); text-decoration: underline; text-underline-offset: 3px; }
/* Lien dans une phrase, discret (mentions légales, notes). */
.ds-link-quiet { color: inherit; text-decoration: underline; text-underline-offset: 2px; }

/* Raccourci clavier : la seule monospace de l'interface. Masqué au doigt, où
   un raccourci clavier ne veut rien dire. */
.ds-kbd { display: inline-flex; align-items: center; height: 20px; padding: 0 6px; border: 1px solid var(--ds-border); border-radius: var(--ds-radius-sm); background: var(--ds-surface); color: var(--ds-text-3); font-family: var(--ds-font-mono); font-size: var(--ds-font-size-xs); line-height: 1; }
@media (pointer: coarse) { .ds-kbd { display: none; } }

/* ── Mise en page ────────────────────────────────────────────────────────── */
/* Largeur du contenu (alignée sur la barre) et colonne de lecture. */
.ds-frame { width: 100%; max-width: calc(var(--ds-layout-frame) + 2 * var(--ds-layout-gutter)); margin-inline: auto; padding-inline: var(--ds-layout-gutter); }
.ds-read { width: 100%; max-width: calc(var(--ds-layout-read) + 2 * var(--ds-layout-gutter)); margin-inline: auto; padding-inline: var(--ds-layout-gutter); }
/* Section de page : elle respire (64 px), ses cartes non. */
.ds-section { padding-block: var(--ds-space-16); }
/* En-tête de page : titre, chapô, et c'est tout. */
.ds-page-head { padding-block: var(--ds-space-4) var(--ds-space-7); }
.ds-page-head .ds-lead { margin-top: var(--ds-space-2); }
/* En-tête de section : titre à gauche, action éventuelle à droite. */
.ds-section-head { display: flex; align-items: flex-end; justify-content: space-between; gap: var(--ds-space-4); flex-wrap: wrap; margin-bottom: var(--ds-space-7); }
.ds-section-head p { margin: 6px 0 0; font-size: var(--ds-font-size-sm); color: var(--ds-text-2); }

/* ── Mouvement réduit : on coupe tout, sans exception. */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}
