/* ==========================================================================
   Ctrl-Data, site v2 : SOCLE (base.css)
   « Le papier, l'encre et le tampon ». Lire site-v2/SOCLE.md avant d'écrire.
   Contenu : polices, jetons, remise à zéro, typographie, grain papier,
   sections .feuille / .encre, mise en page de base, focus, mouvement réduit.
   Règle : AUCUNE couleur en dur hors de :root. Composants : composants.css.
   ========================================================================== */

/* --------------------------------------------------------------------------
   1. Polices (auto-hébergées, OFL). latin = français complet ; latin-ext = reste.
   -------------------------------------------------------------------------- */
@font-face {
  font-family: "Bricolage Grotesque";
  font-style: normal; font-weight: 600; font-display: swap;
  src: url("../fonts/bricolage-grotesque-latin-600-normal.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "Bricolage Grotesque";
  font-style: normal; font-weight: 600; font-display: swap;
  src: url("../fonts/bricolage-grotesque-latin-ext-600-normal.woff2") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: "Bricolage Grotesque";
  font-style: normal; font-weight: 700; font-display: swap;
  src: url("../fonts/bricolage-grotesque-latin-700-normal.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "Bricolage Grotesque";
  font-style: normal; font-weight: 700; font-display: swap;
  src: url("../fonts/bricolage-grotesque-latin-ext-700-normal.woff2") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: "Inter";
  font-style: normal; font-weight: 400; font-display: swap;
  src: url("../fonts/inter-latin-400-normal.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "Inter";
  font-style: normal; font-weight: 400; font-display: swap;
  src: url("../fonts/inter-latin-ext-400-normal.woff2") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: "Inter";
  font-style: normal; font-weight: 500; font-display: swap;
  src: url("../fonts/inter-latin-500-normal.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "Inter";
  font-style: normal; font-weight: 500; font-display: swap;
  src: url("../fonts/inter-latin-ext-500-normal.woff2") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: "Inter";
  font-style: normal; font-weight: 600; font-display: swap;
  src: url("../fonts/inter-latin-600-normal.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "Inter";
  font-style: normal; font-weight: 600; font-display: swap;
  src: url("../fonts/inter-latin-ext-600-normal.woff2") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: "JetBrains Mono";
  font-style: normal; font-weight: 400; font-display: swap;
  src: url("../fonts/jetbrains-mono-latin-400-normal.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "JetBrains Mono";
  font-style: normal; font-weight: 400; font-display: swap;
  src: url("../fonts/jetbrains-mono-latin-ext-400-normal.woff2") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: "JetBrains Mono";
  font-style: normal; font-weight: 500; font-display: swap;
  src: url("../fonts/jetbrains-mono-latin-500-normal.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "JetBrains Mono";
  font-style: normal; font-weight: 500; font-display: swap;
  src: url("../fonts/jetbrains-mono-latin-ext-500-normal.woff2") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

/* --------------------------------------------------------------------------
   2. Jetons (BRIEF § 4). Les seules couleurs du site sont ici.
   -------------------------------------------------------------------------- */
:root {
  /* Matières */
  --encre: #0e0c0c;           /* fond sombre */
  --encre-2: #171414;         /* bloc sur fond sombre */
  --encre-3: #221e1e;
  --papier: #efe9df;          /* fond clair crème */
  --papier-2: #e4dccd;
  --graphite: #1d1919;        /* texte sur papier */
  --craie: #efe9df;           /* texte sur encre */
  --gris: #8f8784;            /* texte secondaire sur ENCRE (AA : 5,5:1 sur --encre, 4,7:1 sur --encre-3) */
  --gris-papier: #645d5a;     /* texte secondaire sur PAPIER (AA : 5,3:1 sur --papier, 4,7:1 sur --papier-2).
                                 --gris ne fait que 2,9:1 sur papier : jamais de --gris sur une feuille. */

  /* Tampon : l'unique couleur vive = le bordeaux du logiciel Ctrl-Data (--primary #aa525a, 16/11) */
  --tampon: #aa525a;          /* bordeaux exact du logiciel : tampons, repères, épingles */
  --tampon-fort: #aa525a;     /* fond des boutons principaux : texte blanc à 5,2:1 (AA), comme dans le logiciel */
  --tampon-texte: #96484f;    /* texte bordeaux sur PAPIER (5,2:1 ; 4,6:1 sur --papier-2) */
  --tampon-clair: #bb757b;    /* petit texte bordeaux sur ENCRE (5,5:1 ; 4,7:1 sur --encre-3). Jamais sur papier. */
  --sur-tampon: #ffffff;      /* texte posé sur le bordeaux (= --on-primary du logiciel) */

  /* Filets */
  --filet-encre: rgba(239, 233, 223, .12);
  --filet-papier: rgba(29, 25, 25, .14);
  --filet-encre-fort: rgba(239, 233, 223, .28);
  --filet-papier-fort: rgba(29, 25, 25, .32);

  /* Lumière rasante (sections encre) et ombre d'une feuille posée */
  --lumiere: rgba(239, 233, 223, .045);
  --ombre-feuille: rgba(0, 0, 0, .45);
  --voile-encre: rgba(14, 12, 12, .72);

  /* Polices */
  --police-titre: "Bricolage Grotesque", "Arial Narrow", system-ui, sans-serif;
  --police-texte: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --police-mono: "JetBrains Mono", ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace;

  /* Échelle typographique (fluide). Titres : interligne .9, interlettrage -0.03em */
  --t-geant: clamp(3.3rem, 0.6rem + 12.6vw, 14vw);    /* 52 px téléphone → ~190 px à 1440 */
  --t-1: clamp(2.6rem, 1rem + 6.8vw, 8.5rem);          /* h1 de page */
  --t-2: clamp(2.1rem, 0.9rem + 4.4vw, 5.6rem);        /* h2 de chapitre */
  --t-3: clamp(1.35rem, 1rem + 1.1vw, 2.1rem);         /* h3, noms de carte */
  --t-4: clamp(1.1rem, 1rem + .35vw, 1.3rem);
  --t-chapeau: clamp(1.2rem, 1rem + .75vw, 1.65rem);   /* paragraphe d'introduction */
  --t-texte: clamp(1.0625rem, 1rem + .18vw, 1.125rem); /* 17 → 18 px */
  --t-petit: .9375rem;                                  /* 15 px */
  --t-mono: .75rem;                                     /* 12 px étiquettes */
  --t-mono-petit: .6875rem;                             /* 11 px */
  --interligne-titre: .9;
  --interlettrage-titre: -.03em;
  --interligne-texte: 1.55;
  --interlettrage-mono: .08em;

  /* Espaces */
  --gouttiere: clamp(16px, 4.2vw, 64px);               /* marge latérale (16 px au téléphone) */
  --respiration: clamp(96px, 13vw, 224px);             /* haut/bas d'une section */
  --respiration-courte: clamp(64px, 8vw, 128px);
  --espace-1: 4px;
  --espace-2: 8px;
  --espace-3: 12px;
  --espace-4: 16px;
  --espace-5: 24px;
  --espace-6: 32px;
  --espace-7: 48px;
  --espace-8: 72px;
  --espace-9: 120px;
  --largeur-max: 1440px;
  --largeur-texte: 62ch;
  --entete-h: 60px;

  /* Formes : jamais de pilule */
  --rayon: 4px;
  --rayon-max: 6px;

  /* Mouvement (transform / opacity seulement) */
  --sortie: cubic-bezier(.16, 1, .3, 1);
  --sortie-douce: cubic-bezier(.22, .61, .36, 1);
  --duree-courte: .2s;
  --duree: .45s;
  --duree-longue: .8s;

  /* Plans (z-index) : une seule échelle */
  --z-dessus: 2;
  --z-entete: 50;
  --z-menu: 60;
  --z-evitement: 80;
  --z-grain: 100;

  /* Grain papier : bruit SVG en data URI (tuile 220 px, calculée une fois par le navigateur) */
  --grain: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='220' height='220'%3E%3Cfilter id='g'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.82' numOctaves='3' stitchTiles='stitch'/%3E%3CfeColorMatrix type='saturate' values='0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23g)'/%3E%3C/svg%3E");
  /* Masque d'encre du tampon (bruit seuillé : l'encre « manque » par endroits) */
  --grain-tampon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='t'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.6' numOctaves='2' seed='7'/%3E%3CfeColorMatrix values='0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 -4 3.25'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23t)'/%3E%3C/svg%3E");
}

/* --------------------------------------------------------------------------
   3. Thèmes de section : variables CONTEXTUELLES.
   Les composants n'utilisent que --fond, --fond-2, --texte, --texte-2,
   --filet, --filet-fort, --accent-texte : ils marchent sur papier ET encre.
   Le corps de page est « encre » (le bureau, la nuit) ; on y pose des .feuille.
   -------------------------------------------------------------------------- */
:root,
.encre {
  --fond: var(--encre);
  --fond-2: var(--encre-2);
  --fond-3: var(--encre-3);
  --texte: var(--craie);
  --texte-2: var(--gris);
  --filet: var(--filet-encre);
  --filet-fort: var(--filet-encre-fort);
  --accent-texte: var(--tampon-clair);
  --couleur-tampon: var(--tampon-clair);
  color-scheme: dark;
}
.feuille {
  --fond: var(--papier);
  --fond-2: var(--papier-2);
  --fond-3: var(--papier-2);
  --texte: var(--graphite);
  --texte-2: var(--gris-papier);
  --filet: var(--filet-papier);
  --filet-fort: var(--filet-papier-fort);
  --accent-texte: var(--tampon-texte);
  --couleur-tampon: var(--tampon);
  color-scheme: light;
}
.encre,
.feuille {
  background-color: var(--fond);
  color: var(--texte);
}
/* Lumière rasante, très douce, venue du haut (zrk) : à poser sur UNE section encre,
   pas sur deux sections encre qui se suivent (la reprise se verrait) */
.lumiere {
  background-image: radial-gradient(120% 60% at 50% 0%, var(--lumiere), transparent 70%);
}
/* Variante : la feuille est « posée » sur le bureau (marges sombres autour) */
.feuille--posee {
  margin-inline: clamp(8px, 1.6vw, 24px);
  border-radius: 2px;
  box-shadow: 0 30px 80px -30px var(--ombre-feuille), 0 2px 6px -2px var(--ombre-feuille);
}

/* --------------------------------------------------------------------------
   4. Remise à zéro légère
   -------------------------------------------------------------------------- */
*, *::before, *::after { box-sizing: border-box; }
* { margin: 0; }
html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  scroll-padding-top: calc(var(--entete-h) + 16px);
  background-color: var(--encre);
}
body {
  min-height: 100vh;
  min-height: 100svh;
  font-family: var(--police-texte);
  font-size: var(--t-texte);
  line-height: var(--interligne-texte);
  font-weight: 400;
  background-color: var(--fond);
  color: var(--texte);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  font-kerning: normal;
  overflow-x: clip;
}
/* Les décors qui débordent (tampons, épingles) ne doivent jamais élargir la page :
   clip ne crée pas de zone de défilement, le « collé à l'écran » (sticky) continue de marcher */
main { overflow-x: clip; }
img, picture, video, canvas { display: block; max-width: 100%; }
/* svg reste en ligne : une flèche dans du texte ne passe pas à la ligne (dans un bouton,
   une grille ou une boîte flexible, il devient un bloc tout seul) */
svg { max-width: 100%; }
img, video { height: auto; }
input, button, textarea, select { font: inherit; color: inherit; }
button { background: none; border: 0; padding: 0; cursor: pointer; }
a { color: inherit; text-decoration: none; }
ul[role="list"], ol[role="list"], .liste-nue { list-style: none; padding: 0; }
p, li, figcaption { overflow-wrap: break-word; }
table { border-collapse: collapse; border-spacing: 0; }
hr { border: 0; }
[hidden] { display: none !important; }
::selection { background: var(--tampon); color: var(--sur-tampon); }

/* --------------------------------------------------------------------------
   5. Grain papier global : une couche fixe, statique, composée par le GPU.
   Pas de mix-blend-mode (coûteux au défilement), pas d'animation.
   -------------------------------------------------------------------------- */
body::after {
  content: "";
  position: fixed;
  inset: 0;
  z-index: var(--z-grain);
  pointer-events: none;
  background-image: var(--grain);
  background-size: 220px 220px;
  opacity: .065;
  transform: translateZ(0);
  contain: strict;
}
@media print { body::after { display: none; } }

/* --------------------------------------------------------------------------
   6. Typographie
   -------------------------------------------------------------------------- */
h1, h2, h3, h4, h5, h6 {
  font-family: var(--police-titre);
  font-weight: 700;
  line-height: var(--interligne-titre);
  letter-spacing: var(--interlettrage-titre);
  text-wrap: balance;
  overflow-wrap: break-word;
}
h1 { font-size: var(--t-1); }
h2 { font-size: var(--t-2); }
h3 { font-size: var(--t-3); font-weight: 600; line-height: 1.05; letter-spacing: -.02em; }
h4 { font-size: var(--t-4); font-weight: 600; line-height: 1.15; letter-spacing: -.01em; }

/* Classes de taille, indépendantes de la balise (l'ordre h1 > h2 > h3 reste celui du sens) */
.titre-geant { font-size: var(--t-geant); line-height: .86; letter-spacing: -.04em; }
.titre-1 { font-size: var(--t-1); line-height: var(--interligne-titre); letter-spacing: -.035em; }
.titre-2 { font-size: var(--t-2); line-height: var(--interligne-titre); letter-spacing: var(--interlettrage-titre); }
.titre-3 { font-size: var(--t-3); line-height: 1.05; letter-spacing: -.02em; font-weight: 600; }
.titre-geant, .titre-1, .titre-2, .titre-3 { font-family: var(--police-titre); }
@media (max-width: 600px) {
  .titre-geant, .titre-1 { hyphens: auto; -webkit-hyphens: auto; }
}
/* Deuxième voix d'un titre : « 12 travaux. <em>1 logiciel.</em> » (pas d'italique : la police n'en a pas) */
h1 em, h2 em, h3 em, .titre-geant em, .titre-1 em, .titre-2 em {
  font-style: normal;
  color: var(--texte-2);
}

p { max-width: var(--largeur-texte); }
.chapeau {
  font-size: var(--t-chapeau);
  line-height: 1.38;
  letter-spacing: -.012em;
  font-weight: 400;
  max-width: 34ch;
  text-wrap: pretty;
}
.texte-2 { color: var(--texte-2); }
/* Garde un groupe de mots sur une ligne (« Ctrl-Data » ne se coupe pas au trait d'union) */
.insecable { white-space: nowrap; }
.accent { color: var(--accent-texte); }
.petit { font-size: var(--t-petit); line-height: 1.5; }
.mono {
  font-family: var(--police-mono);
  font-size: var(--t-mono);
  letter-spacing: var(--interlettrage-mono);
  text-transform: uppercase;
  font-weight: 500;
  line-height: 1.4;
}
strong, b { font-weight: 600; }

/* Lien dans le texte */
.lien,
.prose a {
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: .22em;
  text-decoration-color: var(--filet-fort);
  transition: text-decoration-color var(--duree-courte) ease;
}
.lien:hover,
.prose a:hover { text-decoration-color: var(--accent-texte); }

/* Texte long (mentions, confidentialité) */
.prose { max-width: var(--largeur-texte); }
.prose > * + * { margin-top: 1em; }
.prose h2 { font-size: var(--t-3); line-height: 1.1; margin-top: 2.2em; }
.prose h3 { font-size: var(--t-4); margin-top: 1.8em; }
.prose ul, .prose ol { padding-left: 1.2em; }
.prose li + li { margin-top: .35em; }

/* --------------------------------------------------------------------------
   7. Mise en page
   -------------------------------------------------------------------------- */
.cadre {
  width: 100%;
  max-width: calc(var(--largeur-max) + 2 * var(--gouttiere));
  margin-inline: auto;
  padding-inline: var(--gouttiere);
}
.cadre--etroit { max-width: calc(980px + 2 * var(--gouttiere)); }
.section { padding-block: var(--respiration); position: relative; }
.section--courte { padding-block: var(--respiration-courte); }
.section--sans-haut { padding-top: 0; }

/* Téléphone (17/11/2026) : beaucoup moins de défilement. Les sections respirent moins, les
   grands espaces se resserrent, le chapeau et les titres de chapitre baissent d'un cran. */
@media (max-width: 600px) {
  :root {
    --respiration: 44px;            /* 2e passe : 56 → 44 (le changement de fond marque déjà la section) */
    --respiration-courte: 32px;
    --espace-7: 32px;
    --espace-8: 44px;
    --espace-9: 64px;
    --t-chapeau: 1.125rem;
    --t-2: clamp(1.85rem, 1.1rem + 3.6vw, 2.15rem);
  }
}

/* Grille 12 colonnes (ordinateur) ; tout passe en 1 colonne sous 900 px */
.grille {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  column-gap: clamp(16px, 2vw, 32px);
  row-gap: var(--espace-7);
}
.grille > * { grid-column: 1 / -1; }
@media (min-width: 900px) {
  .col-1-6 { grid-column: 1 / 7; }
  .col-7-12 { grid-column: 7 / 13; }
  .col-1-5 { grid-column: 1 / 6; }
  .col-6-12 { grid-column: 6 / 13; }
  .col-1-4 { grid-column: 1 / 5; }
  .col-5-12 { grid-column: 5 / 13; }
  .col-1-8 { grid-column: 1 / 9; }
  .col-9-12 { grid-column: 9 / 13; }
  .col-3-12 { grid-column: 3 / 13; }
  .col-4-12 { grid-column: 4 / 13; }
  .col-1-10 { grid-column: 1 / 11; }
}
/* Grilles automatiques */
.grille-2, .grille-3, .grille-4 {
  display: grid;
  gap: clamp(24px, 3vw, 48px);
  grid-template-columns: repeat(auto-fit, minmax(min(100%, var(--colonne-min)), 1fr));
}
.grille-2 { --colonne-min: 22rem; }
.grille-3 { --colonne-min: 17rem; }
.grille-4 { --colonne-min: 13rem; }

/* Pile : espace régulier entre enfants */
.pile > * + * { margin-top: var(--pile, var(--espace-5)); }
.pile--serree { --pile: var(--espace-3); }
.pile--large { --pile: var(--espace-7); }

/* --------------------------------------------------------------------------
   8. Accessibilité
   -------------------------------------------------------------------------- */
:focus { outline: none; }
:focus-visible {
  outline: 2px solid var(--accent-texte);
  outline-offset: 3px;
  border-radius: 2px;
}
.sr-only {
  position: absolute !important;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}
/* Lien d'évitement « Aller au contenu » : visible seulement au clavier */
.evitement {
  position: fixed;
  top: 8px; left: 8px;
  z-index: var(--z-evitement);
  padding: 10px 14px;
  background: var(--papier);
  color: var(--graphite);
  font-family: var(--police-mono);
  font-size: var(--t-mono);
  font-weight: 500;
  letter-spacing: var(--interlettrage-mono);
  text-transform: uppercase;
  border-radius: var(--rayon);
  transform: translateY(-160%);
}
.evitement:focus-visible { transform: none; outline-color: var(--tampon); }

/* --------------------------------------------------------------------------
   9. Apparition au défilement ([data-apparition], piloté par commun.js)
   Sans JS : tout est visible (la classe .js est posée par le <head>).
   Si commun.js ne charge pas : animation de secours à 2,5 s.
   -------------------------------------------------------------------------- */
.js [data-apparition] {
  opacity: 0;
  transform: translateY(28px);
  animation: apparition-secours 0s linear 2.5s forwards;
}
.js [data-apparition="rideau"] {
  transform: none;
  clip-path: inset(0 0 100% 0);
}
.js.apparition-prete [data-apparition] { animation: none; }
.js [data-apparition].est-visible {
  opacity: 1;
  transform: none;
  clip-path: inset(0 0 0 0);
  transition:
    opacity var(--duree-longue) var(--sortie-douce),
    transform 1s var(--sortie),
    clip-path 1.1s var(--sortie);
  transition-delay: var(--apparition-retard, 0ms);
}
@keyframes apparition-secours {
  to { opacity: 1; transform: none; clip-path: inset(0 0 0 0); }
}

/* --------------------------------------------------------------------------
   10. Mouvement réduit : tout s'affiche directement, rien ne bouge
   -------------------------------------------------------------------------- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .001ms !important;
    animation-delay: 0s !important;
    animation-iteration-count: 1 !important;
    transition-duration: .001ms !important;
    transition-delay: 0s !important;
  }
  .js [data-apparition] { opacity: 1; transform: none; clip-path: none; }
}
