/* 1. La base : polices, couleurs, durées, textes, focus. */
@font-face { font-family: "Besley"; src: url("../polices/besley-latin-wght-normal.woff2") format("woff2"); font-weight: 400 900; font-style: normal; font-display: swap; }
@font-face { font-family: "Besley"; src: url("../polices/besley-latin-wght-italic.woff2") format("woff2"); font-weight: 400 900; font-style: italic; font-display: swap; }
@font-face { font-family: "Alegreya Sans"; src: url("../polices/alegreya-sans-latin-400-normal.woff2") format("woff2"); font-weight: 400; font-display: swap; }
@font-face { font-family: "Alegreya Sans"; src: url("../polices/alegreya-sans-latin-400-italic.woff2") format("woff2"); font-weight: 400; font-style: italic; font-display: swap; }
@font-face { font-family: "Alegreya Sans"; src: url("../polices/alegreya-sans-latin-500-normal.woff2") format("woff2"); font-weight: 500; font-display: swap; }
@font-face { font-family: "Alegreya Sans"; src: url("../polices/alegreya-sans-latin-700-normal.woff2") format("woff2"); font-weight: 700; font-display: swap; }
@font-face { font-family: "Alegreya Sans"; src: url("../polices/alegreya-sans-latin-800-normal.woff2") format("woff2"); font-weight: 800; font-display: swap; }

:root {
  /* nos trois durées */
  --courte: 150ms;
  --moyenne: 250ms;
  --longue: 400ms;

  --nuit: #141b3c;        /* l'encre */
  --nuit-haute: #222c5c;
  --nuit-basse: #0c1129;
  --ivoire: #f1e7c9;      /* le carton du disque */
  --papier: #faf4e2;      /* le papier des bandes */
  --vermillon: #cf3419;
  --vermillon-fonce: #a92710; /* pour écrire sur le papier */
  --lampe: #ffcb75;
  --laiton: #b98a3a;
  --titre: "Besley", "Clarendon", Georgia, serif;
  --texte: "Alegreya Sans", "Gill Sans", "Trebuchet MS", sans-serif;
  --marge: clamp(16px, 4.4vw, 88px);
  --entete: 60px;
}
*, *::before, *::after { box-sizing: border-box; }
html { scroll-padding-top: calc(var(--entete) + 12px); background: var(--nuit-basse); -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body { margin: 0; font: 400 1.1875rem/1.5 var(--texte); color: var(--nuit); background: var(--ivoire); overflow-x: clip; hanging-punctuation: first; }
h1, h2, h3, h4, h5, p, ol, ul { margin: 0; }
p, li { text-wrap: pretty; }
ol, ul { padding: 0; list-style: none; }
h1, h2, h3 { font-family: var(--titre); font-weight: 800; line-height: 1.04; text-wrap: balance; letter-spacing: -.015em; }
a { color: inherit; }
button, input, select { font: inherit; color: inherit; }
button, summary { cursor: pointer; }
svg { display: block; }
img { max-width: 100%; height: auto; display: block; }
.reserve { position: absolute; }
.lu-seul { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
[hidden] { display: none !important; }

/* Le contour de focus : un pointillé comme les fentes du disque */
:focus-visible { outline: 3px dashed var(--vermillon-fonce); outline-offset: 4px; border-radius: 3px; }
.entete :focus-visible, .ouverture :focus-visible, .fond--nuit :focus-visible, .pied :focus-visible { outline-color: var(--lampe); }
[tabindex="-1"]:focus { outline: none; }

/* Un bouton qu'on presse s'enfonce. La propriété « scale » n'appartient qu'à cela :
   GSAP anime toujours une enveloppe, jamais le bouton. */
.s-enfonce { transition: scale 100ms ease-out, background-color var(--courte), color var(--courte); }
html[data-motion="full"] .s-enfonce:active, html[data-motion="full"] .s-enfonce[data-appui] { scale: .97; }

.evitement { position: fixed; left: 12px; top: -80px; z-index: 50; background: var(--vermillon); color: #fff; padding: 10px 16px; }
.evitement:focus { top: 8px; }

/* Le bouton de mouvement est le premier au clavier, et le dernier à droite à l'œil */
.entete { position: sticky; top: 0; z-index: 30; height: var(--entete); display: flex; align-items: center; gap: 28px; padding: 0 var(--marge); background: var(--nuit-basse); color: var(--ivoire); }
.entete-nom { display: flex; align-items: center; gap: 12px; font: 800 1.125rem/1 var(--titre); text-decoration: none; white-space: nowrap; }
.entete-nav { display: flex; gap: 24px; margin-left: auto; }
.entete-nav a { padding: 8px 2px; text-underline-offset: 6px; text-decoration-thickness: 1px; white-space: nowrap; }
.entete-nav a:hover { text-decoration-thickness: 3px; }
.entete-mouvement { display: flex; align-items: center; gap: 14px; order: 3; }
.entete button { min-height: 40px; padding: 0 14px; background: transparent; border: 2px solid var(--ivoire); border-radius: 3px; font-weight: 700; white-space: nowrap; }
.entete button:hover { background: var(--ivoire); color: var(--nuit); }
.entete button.lien { border: 0; padding: 0 2px; font-weight: 400; text-decoration: underline; text-underline-offset: 5px; }
.entete button.lien:hover { background: none; color: var(--lampe); }

.bouton-lampe { min-height: 48px; padding: 0 22px; border: 0; border-radius: 3px; background: var(--lampe); color: var(--nuit-basse); font-weight: 800; }
.bouton-lampe:hover { background: #ffdd9f; }

.pied a { text-underline-offset: 3px; }
.pied p { max-width: 110ch; }
.pied { background: var(--nuit-basse); color: #cfd2e2; padding: 40px var(--marge); display: grid; gap: 8px; font-size: 1rem; }

@media (max-width: 1020px) {
  .entete { gap: 12px; }
  .entete-nav { display: none; }
  .entete-table { margin-left: auto; }
}
@media (max-width: 560px) {
  body { font-size: 1.125rem; }
  .entete-nom { gap: 0; }
  .entete-nom span { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
  /* au téléphone, les boutons de l'en-tête tiennent sur deux lignes */
  .entete { gap: 8px; }
  .entete :is(button, .entete-table), .entete button.lien { padding: 0 8px; font-size: 1rem; line-height: 1.05; white-space: normal; text-align: center; max-width: 7.6em; }
  .entete button.lien { padding: 0; font-size: .9375rem; max-width: 5.4em; }
  .entete-mouvement { gap: 8px; }
}

/* Filet de sécurité. Le vrai travail est fait animation par animation, dans js/animations. */
html[data-motion="reduce"] *, html[data-motion="reduce"] *::before, html[data-motion="reduce"] *::after {
  animation-duration: .01ms !important; animation-iteration-count: 1 !important;
  transition-duration: .15s !important; transition-property: opacity, color, background-color !important;
}
