/* Base : polices, remise à zéro, éléments nus, grain, focus, sélection. */

/* Polices locales. Les repli à métriques ajustées évitent tout saut de mise en page au chargement
   (Switzer a la largeur d'Arial à ±2 % ; Geist Mono est 9 % plus large que Consolas). */
@font-face { font-family: "Switzer"; src: url("../fonts/Switzer-300.woff2") format("woff2"); font-weight: 300; font-style: normal; font-display: swap; }
@font-face { font-family: "Switzer"; src: url("../fonts/Switzer-400.woff2") format("woff2"); font-weight: 400; font-style: normal; font-display: swap; }
@font-face { font-family: "Switzer"; src: url("../fonts/Switzer-500.woff2") format("woff2"); font-weight: 500; font-style: normal; font-display: swap; }
@font-face { font-family: "Switzer"; src: url("../fonts/Switzer-600.woff2") format("woff2"); font-weight: 600; font-style: normal; font-display: swap; }
@font-face { font-family: "Geist Mono"; src: url("../fonts/GeistMono-latin-var.woff2") format("woff2"); font-weight: 100 900; font-style: normal; font-display: swap; }
/* écriture à la main (annotations et signature seulement) : SIL OFL, voir fonts/NothingYouCouldDo-OFL.txt */
@font-face { font-family: "Main"; src: url("../fonts/NothingYouCouldDo-Regular.woff2") format("woff2"); font-weight: 400; font-style: normal; font-display: block; }

@font-face { font-family: "Switzer Repli"; src: local("Arial"), local("Helvetica Neue"), local("Liberation Sans"); size-adjust: 101%; ascent-override: 97%; descent-override: 25%; line-gap-override: 9%; }
@font-face { font-family: "Geist Mono Repli"; src: local("Consolas"); size-adjust: 109%; ascent-override: 92%; descent-override: 27%; line-gap-override: 0%; }

*, *::before, *::after { box-sizing: border-box; }

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  background: var(--ivoire);
  color: var(--encre);
  font-family: var(--sans);
  font-size: 100%;
  font-kerning: normal;
  text-rendering: geometricPrecision;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  -webkit-tap-highlight-color: transparent;
}

body {
  margin: 0;
  background: var(--ivoire);
  color: var(--encre);
  font-size: var(--t-texte);
  font-weight: 400;
  line-height: 1.55;
  letter-spacing: -.005em;
  overflow-x: clip;
  min-height: 100svh;
}

h1, h2, h3, h4, p, figure, ul, ol, dl, dd, blockquote { margin: 0; padding: 0; }
ul, ol { list-style: none; }
img, svg, video { display: block; max-width: 100%; }
img, video { height: auto; }
button, input, select, textarea { font: inherit; color: inherit; letter-spacing: inherit; }
button { background: none; border: 0; padding: 0; cursor: pointer; text-align: inherit; }
summary { cursor: pointer; }
strong, b { font-weight: 600; }
em, i { font-style: normal; }
abbr[title] { text-decoration: none; }

a { color: inherit; text-decoration: none; }
p a, .lien {
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: .28em;
}

::selection { background: var(--encre); color: var(--ivoire); }

/* focus visible partout : anneau 2 px encre + halo ivoire, jamais supprimé, jamais rouge */
:focus-visible {
  outline: 2px solid var(--encre);
  outline-offset: 4px;
  box-shadow: 0 0 0 2px var(--ivoire);
  border-radius: 1px;
}
.sur-encre :focus-visible { outline-color: var(--ivoire); box-shadow: 0 0 0 2px var(--encre); }
main:focus, [tabindex="-1"]:focus { outline: none; box-shadow: none; }

/* grain de papier : statique, jamais animé */
.grain {
  position: fixed;
  inset: 0;
  z-index: 60;
  pointer-events: none;
  mix-blend-mode: overlay;
  opacity: .5;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='260' height='260'><filter id='n' x='0' y='0' width='100%25' height='100%25' color-interpolation-filters='sRGB'><feTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='3' stitchTiles='stitch' seed='5'/><feColorMatrix values='.33 .33 .33 0 0  .33 .33 .33 0 0  .33 .33 .33 0 0  0 0 0 0 1'/><feComponentTransfer><feFuncR type='linear' slope='2.4' intercept='-.7'/><feFuncG type='linear' slope='2.4' intercept='-.7'/><feFuncB type='linear' slope='2.4' intercept='-.7'/></feComponentTransfer></filter><rect width='260' height='260' filter='url(%23n)'/></svg>");
  background-size: 260px 260px;
}

/* l'attribut hidden l'emporte toujours (remise à zéro) */
[hidden] { display: none !important; }
.insec { white-space: nowrap; }

/* texte réservé aux lecteurs d'écran */
.sr-only {
  position: absolute;
  width: 1px; height: 1px;
  margin: -1px; padding: 0;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}

/* lien d'évitement */
.skip {
  position: fixed;
  left: var(--marge);
  top: 12px;
  z-index: 100;
  padding: .7em 1.1em;
  background: var(--encre);
  color: var(--ivoire);
  font-weight: 500;
  transform: translateY(-200%);
}
.skip:focus-visible { transform: none; outline-color: var(--ivoire); box-shadow: none; }

/* légendes en mono : numéros, étiquettes, heure */
.mono, .legende, .etiquette, .mono-petit {
  font-family: var(--mono);
  font-size: var(--t-mono);
  font-weight: 500;
  line-height: 1.45;
  letter-spacing: .07em;
  text-transform: uppercase;
  hyphens: none;
  overflow-wrap: anywhere;
}

/* défilement : marges d'ancre sous l'en-tête fixe */
html { scroll-padding-top: 84px; }
[id] { scroll-margin-top: 84px; }
#haut { scroll-margin-top: 0; }

@media (prefers-reduced-motion: no-preference) {
  html:not(.static):not(.demo) { scroll-behavior: auto; }
}
