/* L Katta : une vitrine courte et calme. Couleurs tirées du dessin du maki : l'encre de son contour épais,
   le gris de son pelage, l'orange de ses yeux. Un seul motif : le rebord épais où il s'assoit, comme le bord de
   l'écran où il vit. Un seul personnage animé : le lémurien qui se promène en bas de la fenêtre, une fois l'accueil
   dépassé. */

:root {
  color-scheme: light dark;
  --fond: #fafaf8;
  --surface: #efeeeb;        /* gris clair du masque */
  --trait: #d9d6d1;
  --encre: #2b2624;          /* contour du maki ; sur fond : 14,6:1 */
  --texte: #2b2624;
  --doux: #5b5450;           /* sur fond : 7,2:1 */
  --oeil: #f0901c;           /* orange des yeux ; encre dessus : 6,6:1 */
  --oeil-fort: #f7a748;
  --sur-oeil: #2b2624;
  --lien: #8a4500;           /* orange brûlé, texte sur fond : 6,4:1 */
  --rebord: #2b2624;
  --contour: #2b2624;        /* le trait du dessin : sombre dans les deux thèmes */
  --taille-lemurien: 88px;
  --colonne: 84rem;
  --marge: clamp(16px, 4.5vw, 72px);
  --sans: system-ui, -apple-system, "Segoe UI", "Noto Sans", Ubuntu, Cantarell, sans-serif;
  --mono: ui-monospace, "JetBrains Mono", "DejaVu Sans Mono", Menlo, Consolas, monospace;
}
@media (prefers-color-scheme: dark) {
  :root {
    --fond: #1c1a19;
    --surface: #282523;
    --trait: #3f3a37;
    --encre: #f2efea;
    --texte: #ece8e2;        /* sur fond : 14,8:1 */
    --doux: #bdb5ad;         /* sur fond : 8,6:1 */
    --oeil: #f29a2e;         /* fond sombre dessus : 8,1:1 */
    --oeil-fort: #f7b462;
    --sur-oeil: #1c1a19;
    --lien: #f5ad5b;         /* sur fond : 9,3:1 */
    --rebord: #6b625c;
  }
}

*, *::before, *::after { box-sizing: border-box; }
/* Le texte grandit un peu avec l'écran : 16 px sur téléphone, 18 px sur un grand écran. */
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; font-size: clamp(100%, .85rem + .25vw, 112.5%); }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

body {
  margin: 0;
  font: 400 1.0625rem/1.6 var(--sans);
  color: var(--texte);
  background: var(--fond);
  overflow-x: clip;     /* le rebord et la bande vont d'un bord à l'autre de la fenêtre */
  /* La place du lémurien : il ne cache jamais la fin de la page. */
  padding-bottom: calc(var(--taille-lemurien) + 16px);
}
@media (max-width: 640px) { :root { --taille-lemurien: 68px; } body { font-size: 1rem; } }

a { color: var(--lien); text-decoration-thickness: 1.5px; text-underline-offset: 3px; }
a:hover { color: var(--texte); text-decoration-color: var(--oeil); }
:focus-visible { outline: 3px solid var(--encre); outline-offset: 3px; border-radius: 4px; }
p { margin: 0 0 1rem; max-width: 64ch; }
h1, h2, h3 { color: var(--encre); line-height: 1.15; margin: 0; }
h2 { font-size: clamp(1.45rem, 1.1rem + 1.2vw, 1.9rem); font-weight: 800; letter-spacing: -.015em; margin-bottom: 1.25rem; }
h3 { font-size: 1.08rem; font-weight: 700; margin-bottom: .35rem; }
code { font-family: var(--mono); font-size: .88em; background: var(--surface); padding: .1em .35em; border-radius: 4px; overflow-wrap: anywhere; }
kbd { font-family: var(--mono); font-size: .85em; background: var(--fond); border: 1.5px solid var(--encre); border-bottom-width: 3px; padding: .05em .45em; border-radius: 6px; }

.lien-evitement { position: absolute; left: 12px; top: -80px; background: var(--encre); color: var(--fond); padding: .5rem 1rem; z-index: 20; border-radius: 0 0 8px 8px; }
.lien-evitement:focus { top: 0; }
.visuellement-cache { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; margin: -1px; }

/* Une colonne large, qui suit la fenêtre ; sur très grand écran, le lémurien se promène dans les marges. */
.entete, main, .pied { max-width: calc(var(--colonne) + 2 * var(--marge)); margin-left: auto; margin-right: auto; padding-left: var(--marge); padding-right: var(--marge); }

/* En-tête : le nom, deux liens, la langue. */
.entete { display: flex; align-items: center; gap: .5rem 1.25rem; padding-top: .9rem; padding-bottom: .9rem; }
.logo { display: inline-flex; align-items: center; gap: .5rem; color: var(--encre); text-decoration: none; font-weight: 800; font-size: 1.2rem; letter-spacing: -.01em; }
/* Le maki de la planche « assis » (image 1), recadré sur sa tête et son buste. */
.logo-maki { width: 40px; height: 40px; background: url("img/lemuriens/catta-assis.png") no-repeat -27px -36px / 160px 80px; }
.entete ul { display: flex; align-items: center; gap: 0 1.25rem; list-style: none; margin: 0; padding: 0; }
.principale { margin-left: auto; }
.entete nav a { display: inline-block; padding: .5rem 0; color: var(--texte); text-decoration: none; }
.entete nav a:hover { text-decoration: underline; text-decoration-color: var(--oeil); text-decoration-thickness: 2px; }
.entete .nav-bouton { padding: .45rem 1rem; border: 2px solid var(--encre); border-radius: 999px; font-weight: 700; }
.entete .nav-bouton:hover { background: var(--encre); color: var(--fond); text-decoration: none; }
.langues ul { gap: 0; }
.langues li + li::before { content: "/"; content: "/" / ""; padding: 0 .3rem; color: var(--doux); }
.langues a { font-size: .9rem; font-weight: 700; color: var(--doux); padding: .5rem .15rem; }
.langues a[aria-current="page"] { color: var(--encre); text-decoration: underline; text-decoration-color: var(--oeil); text-decoration-thickness: 2px; }
@media (max-width: 520px) { .secondaire { display: none; } .entete { gap: .5rem .75rem; } }

/* Accueil : le texte à gauche, le maki assis sur son rebord à droite. Le rebord est le seul ornement du site. */
.accueil {
  position: relative; display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: end; gap: 1rem 2.5rem;
  padding-top: clamp(1.5rem, 4vh, 4rem);
  --s: 1.6;   /* agrandissement du maki (cadre de 240 px) */
}
/* Le rebord : d'un bord à l'autre de la fenêtre, sous les pieds du maki. */
.accueil::after { content: ""; position: absolute; left: 50%; bottom: 0; width: 100vw; height: 6px; margin-left: -50vw; background: var(--rebord); }
@media (min-width: 900px) {
  /* Sur ordinateur, l'accueil occupe le premier écran. */
  .accueil { min-height: min(52rem, calc(100svh - 5.5rem)); }
}
/* Grand maki seulement si l'écran est assez haut pour le montrer en entier avec le texte. */
@media (min-width: 1200px) and (min-height: 900px) { .accueil { --s: 2.3; } }
.accueil-texte { padding-bottom: clamp(1.5rem, 5vw, 4.5rem); align-self: center; }
h1 {
  font-size: clamp(2.1rem, min(1rem + 4.4vw, 9vh), 5.75rem); font-weight: 850; letter-spacing: -.03em; line-height: 1.02;
  max-width: 15ch; margin-bottom: 1.1rem; text-wrap: balance;
}
.chapo { font-size: clamp(1.1rem, .95rem + .5vw, 1.45rem); line-height: 1.5; color: var(--doux); max-width: 40ch; margin-bottom: 1.8rem; }
.bouton {
  display: inline-flex; align-items: center; gap: .6rem; padding: .85rem 1.5rem; border-radius: 999px;
  background: var(--oeil); color: var(--sur-oeil); border: 2.5px solid var(--contour); font-weight: 800; font-size: 1.1rem;
  text-decoration: none; box-shadow: 0 4px 0 var(--contour);
}
.bouton svg { width: 1.2em; height: 1.2em; }
.bouton:hover { background: var(--oeil-fort); color: var(--sur-oeil); }
.bouton:active { transform: translateY(3px); box-shadow: 0 1px 0 var(--contour); }
@media (prefers-reduced-motion: reduce) { .bouton:active { transform: none; } }
.sous-bouton { margin-top: 1.1rem; margin-bottom: 0; font-size: .92rem; color: var(--doux); }
/* Image 1 de la planche « assis » (cadre 240 px, maki assis en bas), recadrée et agrandie : ses pieds touchent le rebord. */
.perche { width: calc(180px * var(--s)); height: calc(210px * var(--s)); overflow: hidden; }
.maki-accueil {
  display: block; width: 100%; height: 100%; background-repeat: no-repeat;
  background-size: calc(480px * var(--s)) calc(240px * var(--s)); background-position: calc(-30px * var(--s)) calc(-30px * var(--s));
}
/* Sur téléphone, le maki s'assoit à côté des infos de version, sous le bouton. */
@media (max-width: 640px) {
  .accueil { gap: 0 .75rem; }
  .accueil-texte { display: contents; }
  .accueil h1, .chapo, .bouton { grid-column: 1 / -1; }
  .bouton { justify-self: start; }
  .sous-bouton { grid-column: 1; grid-row: 4; align-self: end; padding-bottom: 1.25rem; }
  .accueil { --s: .5; }
  .accueil-texte { padding-bottom: 0; }
  .perche { grid-column: 2; grid-row: 4; }
}

/* Sections */
.bloc { padding-top: clamp(2.5rem, 7vw, 4rem); scroll-margin-top: 1rem; }
.intro { color: var(--doux); margin-top: -.5rem; }

.atouts { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1.6rem 2.75rem; }
.atouts li { padding-left: 1rem; border-left: 4px solid var(--oeil); }
.atouts p { margin: 0; color: var(--doux); }
@media (max-width: 640px) { .atouts { grid-template-columns: 1fr; } }
@media (min-width: 1100px) { .atouts { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
.raccourci { margin-top: 1.75rem; margin-bottom: 0; }

/* Les six lémuriens, assis côte à côte sur une branche (le même rebord épais), dans une bande d'un bord à l'autre. */
.bande { position: relative; margin-top: clamp(2.5rem, 7vw, 4rem); padding-bottom: clamp(2rem, 5vw, 3.5rem); }
.bande::before { content: ""; position: absolute; z-index: -1; top: 0; bottom: 0; left: 50%; width: 100vw; margin-left: -50vw; background: var(--surface); }
.bande .intro code { background: var(--fond); }
.especes { border: 0; margin: 0; padding: 0; min-width: 0; }
.branche {
  list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 0 .75rem;
  --f: 150px;   /* taille d'une image de la planche */
  background: linear-gradient(var(--rebord), var(--rebord)) no-repeat 0 calc(var(--f) * .8125) / 100% 5px;
}
@media (min-width: 1200px) { .branche { --f: 210px; } }
.branche label { display: flex; flex-direction: column; align-items: center; text-align: center; cursor: pointer; border-radius: 12px; padding-bottom: .5rem; height: 100%; }
.branche input { position: absolute; opacity: 0; width: 1px; height: 1px; }
/* Image 1 de la planche « assis », recadrée : le maki et sa queue, sans le vide au-dessus. */
.apercu {
  display: block; width: calc(var(--f) * .7667); height: calc(var(--f) * .8125); background-repeat: no-repeat;
  background-size: calc(var(--f) * 2) var(--f); background-position: calc(var(--f) * -.0667) calc(var(--f) * -.1875);
}
.branche .nom { margin-top: .9rem; font-weight: 700; color: var(--encre); padding: 0 .35rem; border-radius: 999px; }
.branche .desc { font-size: .88rem; line-height: 1.4; color: var(--doux); margin-top: .25rem; }
.branche label:hover .nom { text-decoration: underline; text-decoration-color: var(--oeil); text-decoration-thickness: 2px; }
.branche input:checked ~ .nom { background: var(--oeil); color: var(--sur-oeil); box-shadow: 0 0 0 2px var(--contour); }
.branche label:has(input:focus-visible) { outline: 3px solid var(--encre); outline-offset: 2px; }
@media (max-width: 900px) {
  .branche { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1.25rem .75rem; background: none; }
  .apercu { border-bottom: 5px solid var(--rebord); }
}
@media (max-width: 420px) {
  .branche { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .branche { --f: 130px; }
}
.promenade { margin-top: 1.25rem; font-size: .95rem; color: var(--doux); }
.promenade input { width: 1.1rem; height: 1.1rem; accent-color: var(--oeil); vertical-align: -.15rem; margin: 0 .35rem 0 0; }

/* Installer : trois commandes, vraiment dans l'ordre. */
.commandes { list-style: none; counter-reset: etape; margin: 0 0 1.25rem; padding: 0; display: grid; gap: .75rem; max-width: 46rem; }
.commandes li { counter-increment: etape; display: grid; grid-template-columns: 2.25rem minmax(0, 1fr); column-gap: .75rem; align-items: center; }
.commandes li::before {
  content: counter(etape); grid-row: span 2; width: 2.25rem; height: 2.25rem; display: grid; place-items: center;
  border: 2.5px solid var(--encre); border-radius: 50%; font-weight: 800; color: var(--encre);
}
.commandes .etape { font-size: .92rem; color: var(--doux); }
.commandes code { display: block; padding: .55rem .8rem; font-size: .92rem; border-radius: 8px; background: var(--surface); }
.verifier { margin-top: .5rem; max-width: 46rem; }
.verifier summary { cursor: pointer; font-weight: 700; color: var(--encre); padding: .35rem 0; width: max-content; max-width: 100%; }
.verifier[open] summary { margin-bottom: .5rem; }
.empreinte { font-family: var(--mono); font-size: .85rem; overflow-wrap: anywhere; }
.copier {
  font: 700 .85rem var(--sans); color: var(--encre); background: var(--fond); border: 2px solid var(--encre);
  border-radius: 999px; padding: .2rem .8rem; margin-left: .35rem; cursor: pointer; vertical-align: .05rem;
}
.copier:hover { background: var(--encre); color: var(--fond); }

@media (min-width: 1000px) {
  .installer { display: grid; grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr); column-gap: clamp(2rem, 5vw, 5rem); align-items: start; }
  .installer > h2 { grid-column: 1 / -1; }
  .installer .commandes { max-width: none; }
  .installer-a-cote { padding-top: 2.6rem; }
}

/* Nouveautés et auteur, côte à côte sur grand écran. */
.duo { display: grid; grid-template-columns: minmax(0, 1fr); column-gap: clamp(2rem, 5vw, 5rem); }
@media (min-width: 1000px) { .duo { grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr); } }

/* Nouveautés : la dernière version seulement, en quelques lignes. */
.nouveautes { list-style: none; margin: 0 0 1rem; padding: 0; display: grid; gap: .6rem; max-width: 46rem; }
.nouveautes li { padding-left: 1rem; border-left: 4px solid var(--trait); }
.nouveautes strong { color: var(--encre); }
.nouveautes ul { margin: .35rem 0 0; padding-left: 1.1rem; display: grid; gap: .3rem; color: var(--doux); }
.toutes { font-size: .95rem; }

/* Auteur et pied de page */
.auteur address { font-style: normal; }
.auteur ul { list-style: none; margin: 0; padding: 0; display: grid; gap: .5rem; }
.auteur li span:first-child { display: block; color: var(--doux); font-size: .9rem; }
.auteur ul { gap: .9rem; }
.auteur a { overflow-wrap: anywhere; }
.pied { margin-top: clamp(2.5rem, 7vw, 4rem); padding-top: 1.5rem; padding-bottom: 1rem; border-top: 1px solid var(--trait); font-size: .92rem; color: var(--doux); }
.pied ul { list-style: none; margin: 0 0 .75rem; padding: 0; display: flex; flex-wrap: wrap; gap: .25rem 1.5rem; }
.pied a { color: var(--texte); }

/* Le lémurien : fixé en bas de la fenêtre, décoratif. Seul lui reçoit la souris, jamais la scène entière.
   Il n'arrive qu'une fois l'accueil dépassé (.loin), pour ne jamais faire doublon avec le maki du haut. */
.lemurien-scene { position: fixed; left: 0; right: 0; bottom: 0; height: 0; z-index: 10; pointer-events: none; }
.lemurien-scene[hidden] { display: none; }
.lemurien {
  position: absolute; left: 0; bottom: 0; width: var(--taille-lemurien); height: var(--taille-lemurien);
  background-repeat: no-repeat; pointer-events: auto; cursor: pointer; will-change: transform;
  opacity: 0; transition: opacity .5s;
}
.lemurien-scene.loin .lemurien.pret { opacity: 1; }
.lemurien-scene:not(.loin) .lemurien { pointer-events: none; }
.lemurien-scene:not(.loin) .bulle-lemurien { visibility: hidden; }
.zzz { position: absolute; top: 18%; left: 58%; font: italic 700 .9rem/1 var(--sans); color: var(--doux); display: none; }
.zzz span { position: relative; font-size: .85em; }
.zzz span:first-child { top: -.6em; }
.zzz span:last-child { top: -1.2em; font-size: .7em; }
.lemurien.dort .zzz { display: block; animation: zzz 3s ease-in-out infinite; }
@keyframes zzz { 50% { transform: translateY(-4px); opacity: .6; } }
.bulle-lemurien {
  position: absolute; left: 0; bottom: calc(var(--taille-lemurien) * .8); max-width: min(16rem, calc(100vw - 24px));
  padding: .5rem .8rem; background: var(--fond); color: var(--texte); border: 2px solid var(--encre);
  border-radius: 14px; font-size: .9rem; line-height: 1.4;
  opacity: 0; transform: translateY(6px); transition: opacity .25s, transform .25s; pointer-events: none;
}
.bulle-lemurien.visible { opacity: 1; transform: none; }
.bulle-lemurien::after {
  content: ""; position: absolute; bottom: -8px; left: var(--queue, 50%); width: 13px; height: 13px; margin-left: -6.5px;
  background: var(--fond); border-right: 2px solid var(--encre); border-bottom: 2px solid var(--encre); transform: rotate(45deg);
}
@media (prefers-reduced-motion: reduce) {
  .lemurien, .bulle-lemurien { transition: none; }
  .lemurien.dort .zzz { animation: none; }
}
/* Sur petit écran, pas de marges où marcher : il reste chez lui, dans l'accueil. */
@media (max-width: 700px) { .lemurien-scene, .promenade { display: none; } body { padding-bottom: 0; } }
@media print { .lemurien-scene, .promenade { display: none; } body { padding-bottom: 0; } }

/* Vidéo de présentation */
.film { display: block; width: 100%; height: auto; aspect-ratio: 16 / 9; margin-top: 1.25rem; border-radius: 14px; background: #141a24; box-shadow: 0 10px 30px rgb(0 0 0 / .18); }
.note-film { margin-top: .8rem; font-size: .92rem; color: var(--doux); }
