/* ============================================================
   Base — reset léger, typographie, utilitaires, accessibilité
   ============================================================ */

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

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

body {
  font-family: var(--font-sans);
  background: var(--bg);
  color: var(--ink);
  line-height: 1.5;
  letter-spacing: -0.006em;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}

/* Les titres portent le caractère : Bricolage Grotesque, resserré. */
h1,
h2,
h3 {
  font-family: var(--font-display);
  line-height: 1.1;
  font-weight: 700;
  letter-spacing: -0.03em;
  text-wrap: balance; /* évite le mot orphelin en fin de titre */
}

h1 {
  font-size: var(--text-3xl);
  font-weight: 800;
}

h2 {
  font-size: var(--text-xl);
}

h3 {
  font-size: var(--text-lg);
}

p {
  margin: 0;
}

button {
  font-family: inherit;
  letter-spacing: inherit;
}

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

::selection {
  background: var(--accent-soft);
}

/* L'attribut hidden gagne toujours, même sur les éléments
   dont une classe définit display (ex. les boutons en inline-flex). */
[hidden] {
  display: none !important;
}

/* Focus visible cohérent partout */
:focus-visible {
  outline: none;
  box-shadow: var(--focus-ring);
  border-radius: var(--radius-sm);
}

/* Cibles de focus programmatique (titres annoncés aux lecteurs d'écran
   après un changement de vue) : le focus est utile, l'anneau non. */
[tabindex="-1"]:focus,
[tabindex="-1"]:focus-visible {
  box-shadow: none;
}

/* Lien d'évitement clavier */
.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  background: var(--accent);
  color: var(--accent-ink);
  padding: 10px 16px;
  border-radius: 0 0 var(--radius-sm) 0;
  z-index: 100;
  text-decoration: none;
  font-weight: 600;
}

.skip-link:focus {
  left: 0;
}

/* Masqué visuellement mais lu par les lecteurs d'écran */
.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;
}

/* Piège à robots : jamais visible pour un humain */
.honeypot {
  position: absolute !important;
  left: -9999px !important;
  height: 1px;
  overflow: hidden;
  opacity: 0;
  pointer-events: none;
}

.container {
  max-width: 720px; /* colonne resserrée : lecture confortable, respiration */
  margin: 0 auto;
  padding: 28px 16px 56px;
}

.muted {
  color: var(--muted);
}

.text-center {
  text-align: center;
}

.justify-center {
  justify-content: center;
}

noscript .noscript-banner {
  display: block;
  padding: 16px;
  background: var(--danger-bg);
  color: var(--danger);
  text-align: center;
  font-weight: 600;
}

/* Animations douces — désactivées si l'utilisateur le demande */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
