/* Préalo, vitrine : la feuille de service. Polices OFL hébergées ici (voir polices/). */
@font-face { font-family: "Anybody"; src: url("polices/anybody-variable.woff2") format("woff2"); font-weight: 100 900; font-stretch: 50% 150%; font-display: swap; }
@font-face { font-family: "Atkinson"; src: url("polices/atkinson-variable.woff2") format("woff2"); font-weight: 200 800; font-display: swap; }
@font-face { font-family: "Martian Mono"; src: url("polices/martian-mono-variable.woff2") format("woff2"); font-weight: 100 800; font-stretch: 75% 112.5%; font-display: swap; }

:root {
  color-scheme: light;
  --papier: #ffffff;
  --encre: #101a3c;        /* bleu-noir des feuilles imprimées */
  --gris: #4f5670;
  --trait: #d6d9e3;
  --vert: #05633b;         /* acceptée (4,9:1 sur le rose, 7,4:1 sur blanc) */
  --rouge: #a3122a;        /* rejetée */
  --surligneur: #ffc2e0;   /* rose : réservé à « corrigé avant l'envoi » */
  --marge: clamp(1rem, 4vw, 3rem);
  --large: 90rem;
  --titre: "Anybody", "Arial Narrow", sans-serif;
  --texte: "Atkinson", "Helvetica Neue", Arial, sans-serif;
  --mono: "Martian Mono", ui-monospace, monospace;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--papier); color: var(--encre); font-family: var(--texte); font-size: 1.0625rem; line-height: 1.55; }
a { color: inherit; }
:focus-visible { outline: 3px solid var(--encre); outline-offset: 3px; }
h1, h2, h3 { margin: 0; }
.insecable { white-space: nowrap; }
.cache { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }

.evitement { position: absolute; left: var(--marge); top: -4rem; padding: 0.6rem 1rem; background: var(--encre); color: var(--papier); z-index: 2; }
.evitement:focus { top: 0.5rem; }

.entete, .tete, .feuille, .fonctions, .pour-qui, .contact, .pied { max-width: var(--large); margin-inline: auto; padding-inline: var(--marge); }

.entete { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding-block: 1rem; }
.logo { font-family: var(--titre); font-stretch: 62%; font-weight: 850; font-size: 2rem; line-height: 1; letter-spacing: 0.01em; text-decoration: none; }
.entete__liens { display: flex; align-items: center; gap: 1.5rem; }
.lien { min-height: 44px; display: inline-flex; align-items: center; font-weight: 700; text-underline-offset: 0.22em; white-space: nowrap; }
.lien:hover { text-decoration-thickness: 2px; }

.bouton {
  display: inline-flex; align-items: center; justify-content: center; min-height: 50px; padding: 0 1.5rem;
  background: var(--encre); color: var(--papier); font-weight: 700; text-decoration: none; white-space: nowrap;
}
.bouton:hover { background: var(--vert); }
.bouton--entete { min-height: 44px; padding: 0 1rem; }
@media (forced-colors: active) { .bouton { border: 1px solid ButtonText; } }

/* L'ouverture : le titre et ce que fait Préalo, puis la feuille pleine largeur. */
.tete {
  display: grid; grid-template-columns: minmax(0, 1.7fr) minmax(0, 1fr); gap: clamp(1.5rem, 4vw, 4rem);
  align-items: end; padding-block: clamp(0.5rem, 2vw, 1.5rem) clamp(1.5rem, 3vw, 2.5rem);
}
h1 {
  font-family: var(--titre); font-stretch: 60%; font-weight: 850;
  font-size: clamp(3rem, 8vw, 8rem); line-height: 0.98; letter-spacing: 0.012em; text-wrap: balance;
}
.chapo { margin: 0; max-width: 30rem; font-size: 1.25rem; line-height: 1.5; }

/* La feuille de service : la seule partie en chasse fixe. Tailles en em, relatives à la feuille. */
.feuille { margin-bottom: clamp(4rem, 8vw, 6.5rem); font-family: var(--mono); font-stretch: 87.5%; font-size: 0.95rem; }
.fictif { display: flex; flex-wrap: wrap; align-items: baseline; gap: 0.25rem 0.6rem; margin-bottom: 0.75rem; font-family: var(--texte); font-size: 1rem; }
.fictif__marque { padding: 0.05rem 0.45rem; border: 2px solid var(--encre); font-weight: 700; }
.feuille__haut {
  display: grid; grid-template-columns: 7.25rem 34% minmax(0, 1fr) 15.75rem; align-items: baseline;
  padding: 0.75em 0; border-top: 6px solid var(--encre); border-bottom: 2px solid var(--encre); font-size: 0.9em;
}
.feuille__haut p { margin: 0; padding-right: 0.75rem; }
.feuille__nom { grid-column: 1 / 3; }
.feuille__compte { color: var(--vert); font-weight: 700; }
table { width: 100%; border-collapse: collapse; table-layout: fixed; }
th { text-align: left; font-weight: 400; font-size: 0.82em; color: var(--gris); padding: 0.6rem 0.75rem 0.4rem 0; }
td { padding: 0.55rem 0.75rem 0.55rem 0; border-top: 1px solid var(--trait); vertical-align: top; }
th:first-child, td:first-child { width: 7.25rem; }
th:nth-child(2), td:nth-child(2) { width: 34%; }
th:last-child, td:last-child { width: 15.75rem; }
td:first-child { font-weight: 700; font-variant-numeric: tabular-nums; }
.ok { color: var(--vert); font-weight: 700; }
.num { margin-left: 0.4rem; white-space: nowrap; }
.corrigee td { background: var(--surligneur); }
.corrigee--note td { border-top: 0; padding-top: 0; padding-left: 7.25rem; font-size: 0.85em; font-weight: 600; }

/* Du fichier au numéro de dossier : des lignes de feuille, pas des cartes. */
.section-titre {
  font-family: var(--titre); font-stretch: 60%; font-weight: 850;
  font-size: clamp(2.2rem, 4.6vw, 4rem); line-height: 1; letter-spacing: 0.012em;
  padding-bottom: 1.25rem; border-bottom: 6px solid var(--encre);
}
.fonction {
  display: grid; grid-template-columns: minmax(0, 0.85fr) minmax(0, 1.15fr) minmax(0, 0.9fr); gap: 1rem 3rem;
  align-items: start; padding: 2rem 0; border-bottom: 2px solid var(--encre);
}
.fonction h3 { font-family: var(--titre); font-stretch: 70%; font-weight: 800; font-size: clamp(1.6rem, 2.4vw, 2.2rem); line-height: 1.05; letter-spacing: 0.012em; }
.fonction > p { margin: 0; max-width: 34rem; font-size: 1.125rem; }
/* Un extrait de feuille : mêmes filets, même chasse fixe. */
.extrait { font-family: var(--mono); font-stretch: 87.5%; font-size: 0.85rem; line-height: 1.5; }
.extrait p { margin: 0; padding: 0.4rem 0; color: var(--encre); }
.extrait p + p { border-top: 1px solid var(--trait); }
.extrait b { color: var(--encre); }
.extrait--corrige p:last-child { background: var(--surligneur); color: var(--encre); padding-inline: 0.4rem; }
.extrait--rejet b { color: var(--rouge); }

.pour-qui { padding-block: clamp(4rem, 8vw, 6.5rem); }
.pour-qui__corps { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr); gap: 1.5rem 3rem; padding-top: 2rem; align-items: start; }
.pour-qui__texte { margin: 0; max-width: 26ch; font-size: clamp(1.5rem, 2.6vw, 2.25rem); line-height: 1.25; }
.secteurs { list-style: none; margin: 0; padding: 0; font-family: var(--mono); font-stretch: 87.5%; font-size: 1rem; border-top: 2px solid var(--encre); }
.secteurs li { padding: 0.7rem 0; border-bottom: 1px solid var(--trait); }

/* Contact : la dernière ligne de la feuille, épaisse. */
.contact { padding-block: 2.5rem clamp(3.5rem, 7vw, 5rem); }
.contact h2 {
  padding-top: 2rem; border-top: 6px solid var(--encre);
  font-family: var(--titre); font-stretch: 62%; font-weight: 850;
  font-size: clamp(2.2rem, 4.8vw, 4.4rem); line-height: 1.02; letter-spacing: 0.012em; text-wrap: balance;
}
.contact__actions { display: flex; flex-wrap: wrap; align-items: center; gap: 0.75rem 2rem; margin: 2rem 0 0; }
.contact__adresse { font-family: var(--mono); font-size: 0.95rem; }

.pied {
  display: flex; flex-wrap: wrap; align-items: center; gap: 0.25rem 2rem;
  padding-block: 1.25rem 2.5rem; border-top: 2px solid var(--encre); font-size: 0.95rem; color: var(--gris);
}
.pied p { margin: 0; }
.pied .pied__logo { margin-right: auto; font-family: var(--titre); font-stretch: 62%; font-weight: 850; font-size: 1.4rem; color: var(--encre); }
.pied a { color: var(--encre); font-weight: 700; text-underline-offset: 0.22em; display: inline-flex; min-height: 44px; align-items: center; }
.pied a[aria-current] { text-decoration: none; }

/* Mentions légales */
.texte-legal { max-width: 46rem; margin: 0 auto; padding: 1rem var(--marge) 4rem; }
.texte-legal h1 { font-size: clamp(2.6rem, 6vw, 4.5rem); margin-bottom: 2rem; }
.texte-legal h2 { font-family: var(--titre); font-stretch: 70%; font-weight: 800; font-size: 1.7rem; margin: 2.25rem 0 0.6rem; padding-top: 1rem; border-top: 2px solid var(--encre); }
.texte-legal p, .texte-legal li { max-width: 40rem; }

/* L'animation de la feuille : seulement si le visiteur l'accepte (classe posée par anime.js). */
@media (prefers-reduced-motion: no-preference) {
  .anime:not(.pret) [data-dpae], .anime:not(.pret) [data-compte] { visibility: hidden; }
  .anime [data-dpae] { color: var(--gris); }
  .anime [data-dpae] + .num { visibility: hidden; }
  .anime [data-dpae].fait { color: var(--vert); }
  .anime [data-dpae].fait + .num { visibility: visible; }
  .anime [data-compte]:not(.fini) { color: var(--gris); }
  .anime .corrigee td { background-color: transparent; transition: background-color 0.45s ease-out; }
  .anime .corrigee.surligne td { background-color: var(--surligneur); }
}

@media (max-width: 960px) {
  .tete { grid-template-columns: 1fr; }
  .feuille__haut { grid-template-columns: 1fr; }
  .feuille__nom { grid-column: auto; }
  .col-contrat { display: none; }
  .fonction { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
  .fonction h3 { grid-column: 1 / -1; }
  .pour-qui__corps { grid-template-columns: 1fr; }
}
@media (max-width: 640px) {
  .entete__liens { gap: 0.9rem; }
  .entete__liens a { font-size: 0.95rem; }
  .logo { font-size: 1.7rem; }
  h1 { font-size: clamp(2.5rem, 12.2vw, 4.2rem); }
  h1 { font-size: clamp(2.4rem, 11.4vw, 4rem); }
  .chapo { font-size: 1rem; }
  .fictif { font-size: 0.85rem; }
  .feuille { font-size: 0.8rem; margin-bottom: 4rem; }
  td { padding-block: 0.45rem; }
  th:first-child, td:first-child { width: 3.6rem; }
  th:nth-child(2), td:nth-child(2) { width: auto; }
  th:last-child, td:last-child { width: 8.4rem; }
  .num { display: block; margin-left: 0; }
  .corrigee--note td { padding-left: 3.6rem; }
  .fonction { grid-template-columns: 1fr; padding: 1.6rem 0; gap: 0.9rem; }
  .fonction > p { font-size: 1.0625rem; }
  .pied .pied__logo { width: 100%; }
}
@media (max-width: 374px) {
  .lien--connexion { display: none; }  /* l'accueil la garde dans le bloc de contact */
}
