/* Feuille unique, écrite à la main : aucune dépendance, aucune police distante. */

:root {
  --encre: #33283a;
  --encre-douce: #5d5262;
  --fond: #fff9ef;
  --fond-froid: #f6ebd8;
  --carte: #ffffff;
  --accent: #a8472a;
  --accent-vif: #c8643c;
  --filet: #e6d6bd;
  --cadre: 62rem;
  --colonne: 40rem;
  --marge: clamp(1.25rem, 4vw, 3rem);
  --police: ui-rounded, "SF Pro Rounded", "Nunito", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}

@media (prefers-color-scheme: dark) {
  :root {
    --encre: #f4ece0;
    --encre-douce: #c5b9c9;
    --fond: #231c29;
    --fond-froid: #2e2535;
    --carte: #2a2231;
    --accent: #f2a283;
    --accent-vif: #f2a283;
    --filet: #473a50;
  }
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; scroll-padding-top: 4.5rem; }

body {
  margin: 0;
  background: var(--fond);
  color: var(--encre);
  font: 1.0625rem/1.7 var(--police);
}

.cadre { max-width: var(--cadre); margin: 0 auto; padding: 0 var(--marge); }

a { color: var(--accent); }

/* En-tête */
.entete {
  position: sticky;
  top: 0;
  background: var(--fond);
  border-bottom: 2px solid var(--filet);
  z-index: 3;
}
.entete .cadre {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.25rem 1.5rem;
  padding-top: 0.75rem;
  padding-bottom: 0.75rem;
}
.marque { font-weight: 800; font-size: 1.2rem; color: var(--accent); text-decoration: none; letter-spacing: 0.01em; }
nav { display: flex; flex-wrap: wrap; gap: 0.25rem 1.25rem; font-size: 0.9375rem; margin-right: 4.5rem; }
nav a { color: var(--encre-douce); text-decoration: none; font-weight: 600; }
nav a:hover, nav a:focus-visible { color: var(--accent); text-decoration: underline; }

/* Sections */
main section {
  position: relative;
  padding: 3rem 0;
  border-bottom: 2px dashed var(--filet);
}
main section:last-child { border-bottom: 0; }
main ul, main ol { padding-left: 1.25rem; }
main p, main li { max-width: var(--colonne); }
.tableau { max-width: none; }
main li + li { margin-top: 0.5rem; }

h1 { font-size: clamp(2.5rem, 7vw, 3.75rem); line-height: 1.05; margin: 1rem 0; color: var(--accent); }
h2 { font-size: 1.6rem; line-height: 1.25; margin: 0 0 1rem; }
.chapeau { font-size: 1.3rem; line-height: 1.55; color: var(--encre-douce); max-width: 34rem; }

.intro { padding-top: 4rem; padding-bottom: 7.5rem; }
.chiffre { font-size: 1.125rem; line-height: 1.55; font-weight: 700; max-width: 34rem; }
.enonces { display: block; margin-top: 0.25rem; font-size: 0.875rem; color: var(--encre-douce); }

/* Tableau */
.tableau { overflow-x: auto; margin: 1.5rem 0; border: 2px solid var(--filet); border-radius: 0.75rem; background: var(--carte); }
.tableau table { border-collapse: collapse; width: 100%; min-width: 44rem; font-size: 0.9375rem; line-height: 1.5; }
.tableau th, .tableau td { padding: 0.65rem 0.8rem; text-align: left; vertical-align: top; border-bottom: 1px solid var(--filet); }
.tableau thead th { background: var(--fond-froid); }
.tableau tbody tr:last-child th, .tableau tbody tr:last-child td { border-bottom: 0; }
.tableau tbody th { font-weight: 700; }

/* Figures */
figure { margin: 0; }
figure img, figure svg { max-width: 100%; height: auto; }
figcaption { margin-top: 0.5rem; font-size: 0.9375rem; color: var(--encre-douce); }
figure .schema { display: block; background: #fff; border: 2px solid var(--filet); border-radius: 0.75rem; padding: 0.5rem; position: relative; z-index: 1; }
.avec-chat { position: relative; margin-top: 4rem; }
.emplacement {
  display: grid;
  place-items: center;
  min-height: 12rem;
  background: var(--fond-froid);
  border: 2px dashed var(--filet);
  color: var(--encre-douce);
}

/* Pied de page */
.pied { position: relative; margin-top: 5rem; background: var(--fond-froid); border-top: 2px solid var(--filet); font-size: 0.875rem; color: var(--encre-douce); }
.pied h2 { font-size: 1rem; margin: 0 0 0.5rem; }
.pied p { max-width: var(--colonne); }
.pied .cadre { padding-top: 1.75rem; padding-bottom: 1.75rem; }

/* Les chattes : décor, jamais porteur de sens (aria-hidden, alt vide) */
.chat { position: absolute; display: block; pointer-events: none; }
.chat img { display: block; width: 100%; height: auto; }

.chat--lamiaou { right: var(--marge); bottom: 0; width: 3.6rem; height: 2.3rem; overflow: hidden; }
.chat--hatiku { left: 0; bottom: 0; width: 7.5rem; }
.chat--miaoustral { right: 0; bottom: 0; width: 9.5rem; }
.chat--sonnette { right: 0; top: -2.5rem; width: 8.5rem; }
.chat--gemiaou { right: 3rem; top: -5.8rem; width: 8rem; z-index: 0; }
.chat--jaspithe { right: 0; top: -2.5rem; width: 9rem; }
.chat--quenotte { right: 0; top: 2rem; width: 8.5rem; }
.chat--opurr { right: var(--marge); bottom: 100%; width: 10.5rem; margin-bottom: -1.2rem; }
.chat--perdue { position: static; width: 9rem; margin: 0 0 1rem; }

@media (max-width: 44rem) {
  .chat:not(.chat--perdue) { display: none; }
  nav { margin-right: 0; }
}

/* Page d'essai des chattes */
.troupe { display: grid; grid-template-columns: repeat(auto-fit, minmax(11rem, 1fr)); gap: 2rem 1.5rem; margin-top: 2rem; }
.mascotte { text-align: center; }
.mascotte svg { max-width: 100%; height: auto; }
.mascotte figcaption { max-width: 16rem; margin: 0.5rem auto 0; }

@media print {
  .entete { position: static; }
  nav { display: none; }
  .chat { display: none; }
  main section { break-inside: avoid; }
}
