/* Feuille de style de la page « Site en construction ». Palette et polices de DESIGN_SYSTEM.md. */
/* Les animations viennent du template de Montess, refaites en CSS seul : aucun JavaScript. Elles s'arrêtent d'elles mêmes pour
   qui demande moins de mouvement, et par la case « Arrêter les animations » (WCAG 2.2.2). Polices servies par nous, licence SIL OFL. */

@font-face {
  font-family: "IBM Plex Sans";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("fonts/ibm-plex-sans-latin-400-normal.woff2") format("woff2");
}

@font-face {
  font-family: "IBM Plex Sans";
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url("fonts/ibm-plex-sans-latin-500-normal.woff2") format("woff2");
}

@font-face {
  font-family: "IBM Plex Mono";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("fonts/ibm-plex-mono-latin-400-normal.woff2") format("woff2");
}

:root {
  --blanc: #ffffff;
  --encre: #081941;
  --accent: #1b64f6;
  --accent-press: #1450cc;
  --gris: #5a678a;
  --code-mot: #1b64f6;
  --code-nom: #081941;
  --code-valeur: #10795c;
  --code-neutre: #3b4453;
  color-scheme: light;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--blanc);
  color: var(--encre);
  font-family: "IBM Plex Sans", system-ui, sans-serif;
  font-size: 1rem;
  line-height: 1.6;
}

/* Trois rangées : le logo, le message au centre, le pied de page. Le fond animé passe derrière, sur sa propre couche. */
.page {
  position: relative;
  display: grid;
  grid-template-rows: auto 1fr auto;
  min-height: 100vh;
  min-height: 100svh;
  gap: 8px;
  padding: 24px clamp(16px, 5vw, 64px) 32px;
}

header,
main,
footer {
  position: relative;
  z-index: 1;
}

/* Tout ce qui se lit repose sur un aplat blanc : le fond animé ne passe jamais derrière un texte (WCAG 1.4.3). */
/* Le logo à gauche, l'adresse de contact à droite ; sous 40 rem l'adresse passe sous le logo. Chacun porte son propre aplat blanc,
   la rangée entière n'en a pas : le fond animé ne disparaît pas derrière un bandeau plein. */
header {
  justify-self: stretch;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0 24px;
}

.contact {
  margin: 0;
  padding-block: 8px;
  background: var(--blanc);
}

/* LOGO.md demande 300 px de large au moins pour le logo horizontal ; Montess a demandé le 11 octobre 2026 un logo plus petit pour cette page. */
.logo {
  display: block;
  padding-block: 8px;
  background: var(--blanc);
  width: min(180px, 100%);
  height: auto;
}

main {
  align-self: center;
  justify-self: center;
  max-width: 100%;
}

.panneau {
  display: flex;
  flex-direction: column;
  align-items: center;
  max-width: 28rem;
  padding: 22px 44px 24px;
  background: var(--blanc);
  text-align: center;
}

h1 {
  margin: 16px 0 10px;
  font-size: clamp(1.5rem, 1.2rem + 1.2vw, 2rem);
  font-weight: 500;
  line-height: 1.1;
  letter-spacing: -0.02em;
  text-wrap: balance;
}

.lead {
  max-width: 24rem;
  margin: 0 0 16px;
  color: var(--gris);
  font-size: 1rem;
  text-wrap: pretty;
}

.langue {
  margin: 0 0 12px;
}

/* Le soulignement reste en permanence : la couleur ne doit pas être le seul signe d'un lien (WCAG 1.4.1). L'essai le garde. */
a {
  color: var(--accent);
  text-underline-offset: 0.2em;
}

a:hover {
  color: var(--accent-press);
}

a:focus-visible,
.pause-case:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}

/* Cible d'au moins 24 px de haut (WCAG 2.2, critère 2.5.8) : un lien en ligne n'a que la hauteur du texte, pas celle de la ligne. */
.langue a,
.contact a {
  display: inline-block;
}

/* Ce que vérifie AnalytiCode : cinq phrases qui se relaient. Sans animation, la première reste affichée. */
.etat {
  position: relative;
  width: 100%;
  height: 22px;
  margin: 6px 0 0;
  color: var(--gris);
  font-size: 0.8125rem;
}

.etat span {
  position: absolute;
  inset: 0;
  opacity: 0;
  animation: statut 15s ease both infinite;
}

.etat span:first-child {
  opacity: 1;
}

.etat span:nth-child(2) { animation-delay: 3s; }
.etat span:nth-child(3) { animation-delay: 6s; }
.etat span:nth-child(4) { animation-delay: 9s; }
.etat span:nth-child(5) { animation-delay: 12s; }

.sr-seulement {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: 0;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

footer {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px 16px;
  color: var(--gris);
  font-size: 0.875rem;
}

footer p,
.pause {
  margin: 0;
  padding-block: 4px;
  background: var(--blanc);
}

.pause {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 24px;
  cursor: pointer;
}

.pause-case {
  width: 1.125rem;
  height: 1.125rem;
  margin: 0;
  accent-color: var(--accent);
  cursor: pointer;
}

/* Entrée de la page : chaque bloc monte en fondu une fois, au chargement. */
.entree {
  animation: crise 0.9s ease both;
}

.e1 { animation-duration: 0.8s; }
.e2 { animation-delay: 0.1s; }
.e3 { animation-delay: 0.25s; }
.e4 { animation-delay: 0.4s; }
.e5 { animation-delay: 0.55s; }

/* ---------- Loupe : elle parcourt une pile de lignes de code, dont un extrait défile dans la lentille ---------- */

.repere {
  display: flex;
  justify-content: center;
}

.mark {
  --mark: min(108px, 92vw);
  --travel: 24.17%;
  position: relative;
  flex: none;
  width: var(--mark);
  max-width: 100%;
  aspect-ratio: 272 / 242;
}

.mark svg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

.glass,
.glass-in {
  position: absolute;
  inset: 0;
  will-change: transform;
}

.glass {
  animation: desc-probe 3s linear infinite;
}

/* La descente porte la loupe du premier au dernier trait de la pile ; la secousse latérale vit sur une couche interne. */
.glass-in {
  transform-origin: 61.03% 32.23%;
  animation: lat-probe 3s ease-out infinite;
}

.lens {
  position: absolute;
  top: 9.09%;
  left: 40.44%;
  width: 41.18%;
  height: 46.28%;
  overflow: hidden;
  border-radius: 50%;
  background: var(--blanc);
  font-family: "IBM Plex Mono", monospace;
  font-size: calc(var(--mark) * 0.0301);
  font-weight: 400;
}

.clip {
  position: absolute;
  inset: 0;
  -webkit-mask-image: radial-gradient(circle at 50% 50%, #000 62%, rgba(0, 0, 0, 0.5) 86%, transparent 99%);
  mask-image: radial-gradient(circle at 50% 50%, #000 62%, rgba(0, 0, 0, 0.5) 86%, transparent 99%);
}

/* Cinq lignes par extrait, 1,95 em chacune : 9,75 em par extrait, et 1,97 em pour centrer le premier dans la lentille. */
.flow {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  transform: translateY(1.97em);
  animation: flux 12.64s linear infinite;
  will-change: transform;
}

.ln {
  display: block;
  height: 1.95em;
  padding-right: 11%;
  padding-left: 17%;
  color: var(--code-neutre);
  line-height: 1.95;
  white-space: pre;
}

.t.k { color: var(--code-mot); }
.t.f { color: var(--code-nom); }
.t.s { color: var(--code-valeur); }
.t.c { color: #9aa3b0; }
.t.p { color: var(--code-neutre); }

.ln.hl .lc {
  margin-left: -4px;
  padding: 0.1em 4px;
  border-radius: 2px;
  background: var(--accent);
}

.ln.hl .t {
  color: var(--blanc);
}

.rule {
  position: absolute;
  top: 31%;
  left: 6.5%;
  width: 2px;
  height: 38%;
  border-radius: 1px;
  background: var(--accent);
}

/* ---------- Fond : vingt lignes de code, de fichiers et de requêtes qui traversent l'écran, sans jamais passer sur un texte ---------- */

.fond {
  position: fixed;
  inset: 0;
  z-index: 0;
  overflow: hidden;
  pointer-events: none;
}

.vol {
  position: absolute;
  left: 0;
  animation: vol-droite linear infinite;
}

.vol.retour {
  animation-name: vol-gauche;
}

.derive {
  display: flex;
  align-items: center;
  gap: 7px;
  font-family: "IBM Plex Mono", monospace;
  white-space: nowrap;
  animation: derive ease-in-out infinite;
}

.petit { font-size: 12px; opacity: 0.42; }
.grand { font-size: 14px; opacity: 0.6; }
.commande { color: #a3afc8; }
.fichier { color: #6c7a9c; }

/* Valeurs de position, de durée et de décalage tirées une fois du générateur du template, puis figées ici. */
.v1 { top: 3.0%; animation-duration: 61.6s; animation-delay: -27.3s; }
.v1 .derive { --dy: -14px; animation-duration: 7.5s; }
.v2 { top: 7.6%; animation-duration: 41.3s; animation-delay: -17.0s; }
.v2 .derive { --dy: 14px; animation-duration: 9.5s; }
.v3 { top: 12.2%; animation-duration: 70.8s; animation-delay: -35.3s; }
.v3 .derive { --dy: 6px; animation-duration: 6.5s; }
.v4 { top: 16.8%; animation-duration: 66.2s; animation-delay: -32.3s; }
.v4 .derive { --dy: -12px; animation-duration: 9.4s; }
.v5 { top: 21.4%; animation-duration: 40.1s; animation-delay: -4.8s; }
.v5 .derive { --dy: 16px; animation-duration: 11.8s; }
.v6 { top: 26.0%; animation-duration: 78.1s; animation-delay: -43.0s; }
.v6 .derive { --dy: -11px; animation-duration: 8.5s; }
.v7 { top: 30.6%; animation-duration: 49.8s; animation-delay: -22.2s; }
.v7 .derive { --dy: -12px; animation-duration: 11.9s; }
.v8 { top: 35.2%; animation-duration: 61.0s; animation-delay: -47.1s; }
.v8 .derive { --dy: -6px; animation-duration: 6.9s; }
.v9 { top: 39.8%; animation-duration: 52.7s; animation-delay: -12.6s; }
.v9 .derive { --dy: -15px; animation-duration: 11.6s; }
.v10 { top: 44.4%; animation-duration: 57.8s; animation-delay: -23.2s; }
.v10 .derive { --dy: -10px; animation-duration: 9.6s; }
.v11 { top: 49.0%; animation-duration: 65.4s; animation-delay: -29.5s; }
.v11 .derive { --dy: -13px; animation-duration: 7.3s; }
.v12 { top: 53.6%; animation-duration: 40.0s; animation-delay: -25.9s; }
.v12 .derive { --dy: -3px; animation-duration: 10.1s; }
.v13 { top: 58.2%; animation-duration: 51.6s; animation-delay: -22.7s; }
.v13 .derive { --dy: -2px; animation-duration: 9.0s; }
.v14 { top: 62.8%; animation-duration: 56.9s; animation-delay: -13.5s; }
.v14 .derive { --dy: -2px; animation-duration: 7.6s; }
.v15 { top: 67.4%; animation-duration: 43.5s; animation-delay: -37.4s; }
.v15 .derive { --dy: -8px; animation-duration: 10.6s; }
.v16 { top: 72.0%; animation-duration: 76.9s; animation-delay: -49.3s; }
.v16 .derive { --dy: 13px; animation-duration: 10.5s; }
.v17 { top: 76.6%; animation-duration: 39.0s; animation-delay: -8.4s; }
.v17 .derive { --dy: -6px; animation-duration: 8.1s; }
.v18 { top: 81.2%; animation-duration: 66.8s; animation-delay: -63.9s; }
.v18 .derive { --dy: 9px; animation-duration: 7.6s; }
.v19 { top: 85.8%; animation-duration: 53.1s; animation-delay: -4.7s; }
.v19 .derive { --dy: 3px; animation-duration: 8.6s; }
.v20 { top: 90.4%; animation-duration: 57.2s; animation-delay: -26.8s; }
.v20 .derive { --dy: 13px; animation-duration: 9.5s; }

@keyframes vol-droite { from { transform: translateX(-30vw); } to { transform: translateX(105vw); } }
@keyframes vol-gauche { from { transform: translateX(105vw); } to { transform: translateX(-30vw); } }
@keyframes derive { 0%, 100% { transform: translate(0, 0); } 50% { transform: translate(0, var(--dy)); } }
@keyframes crise { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: translateY(0); } }
@keyframes statut {
  0% { opacity: 0; transform: translateY(6px); }
  3%, 17% { opacity: 1; transform: translateY(0); }
  20%, 100% { opacity: 0; transform: translateY(-6px); }
}

@keyframes desc-probe {
  0%, 7% { transform: translateY(0); }
  11%, 25% { transform: translateY(calc(var(--travel) * 0.2)); }
  29%, 43% { transform: translateY(calc(var(--travel) * 0.4)); }
  47%, 61% { transform: translateY(calc(var(--travel) * 0.6)); }
  65%, 79% { transform: translateY(calc(var(--travel) * 0.8)); }
  83%, 93% { transform: translateY(var(--travel)); }
  100% { transform: translateY(0); }
}

@keyframes lat-probe {
  0%, 9%, 27%, 45%, 63%, 81%, 97%, 100% { transform: rotate(0deg) translateX(0); }
  13%, 31%, 49%, 67%, 85% { transform: rotate(-1.5deg) translateX(-0.7%); }
}

/* Défilement par blocs : 820 ms d'arrêt sur un extrait, 760 ms pour passer au suivant. Le premier extrait est répété à la fin
   pour que la boucle n'ait aucun saut. */
@keyframes flux {
  0.000%, 6.487% { transform: translateY(calc(1.97em - 0.00em)); }
  12.500%, 18.987% { transform: translateY(calc(1.97em - 9.75em)); }
  25.000%, 31.487% { transform: translateY(calc(1.97em - 19.50em)); }
  37.500%, 43.987% { transform: translateY(calc(1.97em - 29.25em)); }
  50.000%, 56.487% { transform: translateY(calc(1.97em - 39.00em)); }
  62.500%, 68.987% { transform: translateY(calc(1.97em - 48.75em)); }
  75.000%, 81.487% { transform: translateY(calc(1.97em - 58.50em)); }
  87.500%, 93.987% { transform: translateY(calc(1.97em - 68.25em)); }
  100% { transform: translateY(calc(1.97em - 78.00em)); }
}

/* Moins de mouvement, ou case cochée : plus aucune animation et plus de fond, la page reste complète et lisible. */
@media (prefers-reduced-motion: reduce) {
  .page *,
  .page *::before,
  .page *::after {
    animation: none !important;
  }

  .fond {
    display: none;
  }
}

.page:has(.pause-case:checked) *,
.page:has(.pause-case:checked) *::before,
.page:has(.pause-case:checked) *::after {
  animation: none !important;
}

.page:has(.pause-case:checked) .fond {
  display: none;
}

@media (max-width: 40rem) {
  .panneau {
    padding: 20px 16px;
  }
}
