/* ==========================================================================
   Socle — remise à zéro, échelle typographique, conteneur.
   Ne contient aucun composant : uniquement les éléments HTML nus.
   ========================================================================== */

/* ---------- Remise à zéro ---------- */

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

html {
  scroll-behavior: smooth;
  /* Compense l'en-tête collant lors des ancres. */
  scroll-padding-top: calc(var(--hauteur-entete) + var(--e-4));
  -webkit-text-size-adjust: 100%;
}

body {
  min-height: 100vh;
  background: var(--fond);
  color: var(--texte);
  font-family: var(--police-texte);
  font-size: var(--t-base);
  font-weight: var(--graisse-normale);
  line-height: var(--interligne);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

img,
picture,
video,
canvas,
svg {
  display: block;
  max-width: 100%;
}

img {
  height: auto;
}

input,
button,
textarea,
select {
  font: inherit;
  color: inherit;
}

button {
  background: none;
  border: 0;
  cursor: pointer;
}

ul,
ol {
  list-style: none;
}

a {
  color: inherit;
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
}

table {
  border-collapse: collapse;
}

/* ---------- Échelle typographique ---------- */

h1,
h2,
h3,
h4,
h5,
h6 {
  font-family: var(--police-titre);
  letter-spacing: var(--chasse-titre);
  line-height: var(--interligne-serre);
  text-wrap: balance;
}

h1 {
  font-size: var(--t-4xl);
  font-weight: var(--graisse-noire);
  letter-spacing: var(--chasse-titre-serree);
  line-height: 0.98;
}

h2 {
  font-size: var(--t-3xl);
  font-weight: var(--graisse-noire);
}

h3 {
  font-size: var(--t-2xl);
  font-weight: var(--graisse-demi);
  letter-spacing: -0.02em;
}

h4 {
  font-size: var(--t-xl);
  font-weight: var(--graisse-demi);
  letter-spacing: -0.02em;
  line-height: 1.25;
}

h5,
h6 {
  font-size: var(--t-m);
  font-weight: var(--graisse-demi);
}

p {
  text-wrap: pretty;
}

strong,
b {
  font-weight: var(--graisse-forte);
}

/* Libellé en capitales, chiffres, durées : la voix « donnée » du site. */
.mono {
  font-family: var(--police-donnee);
  font-size: var(--t-xs);
  letter-spacing: var(--chasse-donnee);
  line-height: 1.4;
  text-transform: uppercase;
}

.chapo {
  font-size: var(--t-l);
  color: var(--texte-doux);
  max-width: 46ch;
}

/* ---------- Conteneur ---------- */

.page {
  width: 100%;
  max-width: var(--largeur-page);
  margin-inline: auto;
  padding-inline: var(--gouttiere);
}

.section {
  padding-block: var(--section-y);
}

.section--sombre {
  background: var(--fond-sombre);
  color: var(--texte-inverse);
}

.section--sombre h1,
.section--sombre h2,
.section--sombre h3,
.section--sombre h4 {
  color: var(--texte-inverse);
}

.section--sombre p {
  color: var(--texte-inverse-gris);
}

/* ---------- Accessibilité ---------- */

/* Focus visible partout, y compris sur fond sombre. */
:focus-visible {
  outline: 2px solid var(--focus);
  outline-offset: 2px;
  border-radius: var(--r-s);
}

.section--sombre :focus-visible,
.pied :focus-visible,
.entete :focus-visible {
  outline-color: var(--or);
}

/* Lien d'évitement, premier élément focalisable de la page. */
.evitement {
  position: absolute;
  left: var(--e-4);
  top: var(--e-2);
  z-index: calc(var(--z-menu) + 1);
  padding: var(--e-3) var(--e-5);
  background: var(--laterite);
  color: #fff;
  border-radius: var(--r-pilule);
  font-weight: var(--graisse-forte);
  text-decoration: none;
  transform: translateY(-200%);
  transition: transform var(--transition);
}

/* L'anneau par défaut est latérite : invisible sur la pastille latérite. */
.evitement:focus-visible {
  transform: translateY(0);
  outline-color: var(--or);
}

/* Bandeau de maintenance, visible de la seule équipe connectée. Il se place
   au-dessus de l'en-tête et pousse la page : on ne doit pas pouvoir l'ignorer. */
.bandeau-maintenance {
  padding: var(--e-3) var(--e-5);
  background: var(--or);
  color: var(--encre);
  font-size: var(--t-m);
  text-align: center;
}

.bandeau-maintenance a {
  color: var(--encre);
  font-weight: var(--graisse-forte);
}

.lecture-seule {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}

/* ---------- Moins d'animations ----------
   Demande explicite de l'utilisateur : on coupe le mouvement partout.
   Les variantes animées de la barre rythmique se figent dans components.css. */
@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;
    scroll-behavior: auto !important;
  }
}
