/* Jetons du projet. La police des poèmes tient dans une seule variable. */
[hidden] { display: none !important; }
body { margin: 0; }
*, *::before, *::after { box-sizing: border-box; }
:root {
  --police-poeme: "Literata", Georgia, serif;
  --police-ui: "Atkinson Hyperlegible Next", system-ui, sans-serif;
  --papier: #ffffff;
  --encre: #1d1a17;
  --encre-douce: #6f6861;
  --filet: #e4dfd8;
  --surligneur: #f7e38a;
  /* Lisibilité dys : réglages communs à tous les poèmes */
  --corps-poeme: clamp(1.15rem, 0.9rem + 1vw, 1.45rem);
  --interligne: 1.7;
  --interlettre: 0.02em;
  --intermot: 0.08em;
}

/* Téléphone (classe posée par ui/telephone.js) et écrans tactiles : poème lisible, commandes faciles à toucher.
   L'appli y est rendue sur 1280 px puis réduite : les tailles ci-dessous compensent cette réduction. */
.telephone .bureau .poeme { --corps-poeme: 1.5rem !important; }
/* Téléphone : cartouches du diaporama et des pistes de lecture resserrés sur deux lignes de texte */
.telephone .dp-cartouche { height: calc(2 * 1.4 * var(--dp-corps) + 1.9rem); padding-top: .45rem; padding-bottom: .45rem; }
.telephone .dp-texte { line-height: 1.4; }
.telephone .dp-titre { margin-bottom: .2rem; }
.telephone .an-cartouche { min-height: calc(2 * 1.4 * 1.05rem + 1.9rem); padding-top: .4rem; padding-bottom: .4rem; }
.telephone .an-texte { line-height: 1.4; }
@media (pointer: coarse) {
  .dp-coin { opacity: .75; gap: .6rem; }
  .dp-coin button, .an-cmd button { padding: .55rem; }
  .dp-coin svg, .an-cmd svg { width: 34px; height: 34px; }
  .dp-bords svg, .dp-pause svg { width: 64px; height: 64px; }
  .outil { width: 3.1rem; height: 3.1rem; font-size: 1.35rem; }
  .outil svg { width: 30px; height: 30px; }
}

/* Poème : épigraphe et lignes hors vers (numéros de parties, points du manuscrit) */
.epigraphe { margin: 0 0 1em 2em; font-size: .8em; font-style: italic; color: var(--encre-douce); line-height: 1.5; }
.vers.hors { margin: .6em 0 .3em 2em; color: var(--encre-douce); }
.vers.points { max-width: 14em; overflow: hidden; white-space: nowrap; letter-spacing: .15em; }   /* ligne de points du manuscrit, raccourcie */
.vers.retrait .ligne { padding-left: 2.5em; }                                                   /* vers court en retrait */
.vers-avant { visibility: hidden; }                                                                  /* vers en escalier : place de la ligne précédente */

/* Rature manuscrite (ui/rature.js) : le mot est barré d'un trait à la main, la correction écrite au-dessus */
.rature { position: relative; display: inline-block; white-space: nowrap; }
.rature s { text-decoration: none; background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 100 10' preserveAspectRatio='none'%3E%3Cpath d='M1 6C20 4.2 40 6.8 60 4.6S88 5.4 99 3.8' fill='none' stroke='%23B8412F' stroke-width='2.2' stroke-linecap='round'/%3E%3C/svg%3E") 0 55% / 0 .6em no-repeat;
  animation: rature-trait .7s ease-out 1.2s forwards; }
.rature .ajout { position: absolute; left: 50%; bottom: 82%; transform: translateX(-50%) rotate(-2deg); font: 600 .95em/1 "Caveat", cursive; color: #B8412F; white-space: nowrap; opacity: 0; animation: rature-ajout .6s ease-out 1.9s forwards; }
@keyframes rature-trait { to { background-size: 100% .6em; } }
@keyframes rature-ajout { to { opacity: 1; } }

body { background: var(--papier); color: var(--encre); font: 1rem/1.5 var(--police-ui); padding-inline: 16px; }
.page { padding-block: 1rem 1.5rem; }
/* Accueil, lecture et couverture gardent une largeur de lecture ; le bureau prend tout l'écran */
#accueil, #lecture, #couverture, .entete { max-width: 76rem; margin-inline: auto; width: 100%; }
[data-ecran] { display: flex; flex-direction: column; gap: 1.5rem; }
[data-ecran][hidden] { display: none; }
.retour-accueil { align-self: flex-start; }

/* En-tête */
.entete { display: flex; justify-content: space-between; align-items: center; gap: 1rem; flex-wrap: wrap; font-size: .85rem; color: var(--encre-douce); }
.entete .marque-site { letter-spacing: .08em; text-transform: uppercase; }
.son { font: inherit; color: var(--encre-douce); background: none; border: 1px solid var(--filet); border-radius: 999px; padding: .15rem .6rem; }
.entete-actions { display: flex; gap: .5rem; align-items: center; flex-wrap: wrap; }
.remise-confirm { font-size: .85rem; color: var(--encre); }
.essai { display: flex; gap: .5rem; align-items: center; }
.essai select { font: inherit; color: var(--encre); background: var(--papier); border: 1px solid var(--filet); border-radius: 4px; padding: .2rem .4rem; }

/* Poème */
.poeme { font-family: var(--police-poeme); font-size: var(--corps-poeme); line-height: var(--interligne); letter-spacing: var(--interlettre); word-spacing: var(--intermot); max-width: 44rem; width: 100%; margin: 0 auto; text-align: left; }
.poeme .titre { font-size: 1.3em; font-weight: 600; line-height: 1.2; margin: 0 0 1.2em; display: inline-block; text-wrap: balance; }
.strophe { margin-bottom: 1.1em; }
.vers { margin: 0; display: grid; grid-template-columns: 2.2rem 1fr; align-items: baseline; }
.num { font: .7rem var(--police-ui); color: var(--encre-douce); opacity: .6; font-variant-numeric: tabular-nums; }
.source { max-width: 44rem; margin: -.5rem auto 0; width: 100%; font-size: .8rem; color: var(--encre-douce); padding-left: 2.2rem; }
.source a { color: inherit; }

/* Marques d'indices */
.marque { transition: background-color .4s, outline-color .4s, box-shadow .4s; border-radius: 3px; }
.m-encadre { outline: 2px solid var(--encre); outline-offset: 3px; }
.m-surligne { background: var(--surligneur); box-shadow: 0 0 0 .15em var(--surligneur); }
/* Apparition : trois clignotements pour attirer l'œil */
.apparait { animation: signal .5s ease-in-out 3; }
@keyframes signal { 50% { background-color: #f2c94c; outline-color: #B8412F; } }
.m-champ { text-decoration: underline wavy #B8412F; text-underline-offset: .25em; }

/* Question attachée à un indice : survol, focus clavier ou toucher */
[data-question] { position: relative; cursor: help; }
[data-question]:hover::after, [data-question]:focus::after {
  content: attr(data-question); position: absolute; left: 0; bottom: calc(100% + .5rem); z-index: 5;
  width: max-content; max-width: min(18rem, 80vw); padding: .45rem .7rem; border-radius: 4px;
  background: var(--encre); color: var(--papier); font: italic .95rem/1.35 var(--police-ui); letter-spacing: 0; word-spacing: 0;
}

/* Association */
.consigne { display: flex; flex-wrap: wrap; gap: .75rem 1rem; align-items: center; justify-content: space-between; }
.consigne p { margin: 0; color: var(--encre-douce); font-size: .9rem; flex: 1 1 16rem; }
.actions { display: flex; gap: .5rem; }
button { font: inherit; cursor: pointer; }
.bouton { background: var(--papier); color: var(--encre); border: 1px solid var(--encre); border-radius: 999px; padding: .35rem .9rem; }
.bouton:disabled { opacity: .4; cursor: default; }
.bouton.discret { border-color: var(--filet); color: var(--encre-douce); }
.etiquette { touch-action: none; cursor: grab; user-select: none; display: inline-flex; align-items: center; gap: .6rem; font-family: var(--police-poeme); background: var(--papier); color: var(--encre); padding: .5rem 1rem .5rem .6rem; border: 1px solid var(--encre); border-radius: 3px; box-shadow: 2px 3px 0 var(--encre); transform: rotate(-1.5deg); transition: transform .15s, box-shadow .15s; }
.etiquette:hover { transform: rotate(-1.5deg) translateY(-2px); box-shadow: 3px 5px 0 var(--encre); }
.etiquette:active { cursor: grabbing; }
.poignee { width: .7rem; height: 1.1rem; background: radial-gradient(circle, var(--encre) 1.2px, transparent 1.6px) 0 0 / .35rem .37rem; opacity: .7; }
.domaines .domaine { border-style: dashed; border-top-style: solid; }
.fantome { position: fixed; z-index: 10; pointer-events: none; transform: translate(-50%, -50%) rotate(-3deg); box-shadow: 0 8px 20px rgb(0 0 0 / .2); }

.domaines { display: grid; grid-template-columns: repeat(6, 1fr); gap: .5rem; }
.domaine { user-select: none; background: var(--papier); color: var(--encre); border: 1px solid var(--filet); border-top: 4px solid var(--c); border-radius: 4px; padding: .35rem .5rem; display: flex; flex-direction: row; justify-content: center; align-items: center; gap: .5rem; font-size: .85rem; transition: transform .15s, background-color .15s; }
.domaine .picto { flex: none; width: 1.8rem; height: 1.8rem; border-radius: 50%; background: var(--c); color: #fff; display: grid; place-items: center; }
.domaine .picto svg, .picto-mini svg { width: 72%; height: 72%; }
.domaine.survol, .domaine:hover { transform: translateY(-3px); background: color-mix(in srgb, var(--c) 8%, var(--papier)); }
.domaine.juste { outline: 2px solid var(--c); outline-offset: 2px; }
:focus-visible { outline: 2px solid var(--encre); outline-offset: 2px; }

.retour { border: 1px solid var(--c); border-radius: 4px; padding: .8rem 1rem; max-width: 44rem; display: flex; gap: .9rem; align-items: flex-start; }
.retour p { margin: 0; flex: 1; }
.visage { width: 2.4rem; height: 2.4rem; flex: none; color: var(--encre); }
.suite { color: var(--encre-douce); font-size: .9rem; margin: 0; }

@media (max-width: 640px) { .domaines { grid-template-columns: repeat(3, 1fr); } }
@media (prefers-reduced-motion: reduce) { * { transition: none !important; animation: none !important; } }

/* Fiche d'un domaine */
.brief { border: 0; border-radius: 6px; padding: 0; width: min(62rem, calc(100% - 32px)); max-height: calc(100% - 32px); color: var(--encre); background: var(--papier); box-shadow: 0 20px 60px rgb(0 0 0 / .25); }
.brief::backdrop { background: rgb(29 26 23 / .5); }
.brief-tete { display: flex; gap: 1.4rem; align-items: center; padding: 1.6rem 2rem; background: color-mix(in srgb, var(--c) 12%, var(--papier)); border-bottom: 4px solid var(--c); }
.brief-picto { width: 5.5rem; height: 5.5rem; flex: none; border-radius: 50%; background: var(--c); color: #fff; display: grid; place-items: center; }
.brief-picto svg { width: 62%; height: 62%; }
.brief-num { margin: 0; font-size: .75rem; letter-spacing: .1em; text-transform: uppercase; color: var(--encre-douce); }
.brief h2 { font: 600 clamp(1.4rem, 1.1rem + 1.2vw, 2rem)/1.15 var(--police-poeme); margin: .15rem 0 .5rem; text-wrap: balance; }
.brief-accroche { margin: 0; font: italic 1.05rem/1.45 var(--police-poeme); }
.brief-cols { display: grid; grid-template-columns: 1fr 1fr; gap: 2rem; padding: 1.6rem 2rem .4rem; }
.brief h3 { font-size: .75rem; letter-spacing: .1em; text-transform: uppercase; color: var(--c); margin: 0 0 .5rem; filter: brightness(.85); }
.brief p { line-height: 1.65; }
.brief-cols p { margin: 0; }
.brief-reperes { padding: 1rem 2rem 0; }
.brief-reperes ul { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: .5rem; }
.brief-reperes li { border: 1px solid var(--c); border-radius: 999px; padding: .3rem .8rem; font-size: .92rem; }
.brief form { padding: 1.2rem 2rem 1.6rem; text-align: right; }
@media (max-width: 700px) {
  .brief-tete { flex-direction: column; align-items: flex-start; padding: 1.2rem; gap: .8rem; }
  .brief-picto { width: 3.6rem; height: 3.6rem; }
  .brief-cols { grid-template-columns: 1fr; gap: 1.2rem; padding: 1.2rem 1.2rem .4rem; }
  .brief-reperes, .brief form { padding-inline: 1.2rem; }
}

.couv-entrer { align-self: center; }

/* Signaler un élément quelques secondes à son apparition (consigne, bouton de suite) */
.signaler { border-radius: 3px; animation: signaler 3.2s ease-in-out 1; }
@keyframes signaler { 0%, 100% { background-color: transparent; box-shadow: 0 0 0 0 transparent; } 12%, 75% { background-color: var(--surligneur); box-shadow: 0 0 0 .3em var(--surligneur); } }
.bouton.signaler { animation-duration: 3.2s; }
.remise-confirm { display: inline-flex; align-items: center; gap: .4rem; flex-wrap: wrap; }
.son.remise-oui { color: #fff; background: #B8412F; border-color: #B8412F; }

/* Écran de lecture sur ordinateur : le sonnet tient au-dessus de la barre des domaines */
@media (min-width: 901px) {
  #lecture { display: grid; grid-template-columns: minmax(0, 1fr) minmax(17rem, 23rem); column-gap: 3rem; row-gap: 1rem; align-items: start; align-content: start; }
  #lecture > .retour-accueil { grid-column: 1 / -1; }
  #lecture > .poeme { grid-column: 1; grid-row: 2 / span 5; margin: 0; --corps-poeme: clamp(.95rem, min(.9rem + 1vw, (100vh - 13rem) / 30), 1.45rem); }
  #lecture > .source { grid-column: 1; grid-row: 7; margin: 0; }
  #lecture > .consigne, #lecture > .retour, #lecture > .couv-entrer { grid-column: 2; }
  #lecture > .consigne { flex-direction: column; align-items: flex-start; }
  #lecture > .consigne p { flex: none; }
  #lecture > .couv-entrer { align-self: start; justify-self: start; }
}

/* Accueil */
.intro h1 { font: 600 clamp(1.8rem, 1.2rem + 2vw, 2.6rem)/1.1 var(--police-poeme); margin: 0 0 .4rem; }
.intro p { margin: 0; color: var(--encre-douce); }
.ensemble h2 { font-size: .8rem; letter-spacing: .08em; text-transform: uppercase; color: var(--encre-douce); font-weight: 600; margin: 0 0 .8rem; }
.vignettes { display: grid; grid-template-columns: repeat(auto-fill, minmax(15rem, 1fr)); gap: .75rem; }
.vignette { position: relative; background: var(--papier); border: 1px solid var(--filet); border-radius: 4px; padding: .8rem .9rem .9rem; cursor: grab; user-select: none; transition: transform .15s, box-shadow .15s; }
.vignette::before { content: ""; position: absolute; inset: -1px -1px auto; height: 5px; border-radius: 4px 4px 0 0; background: var(--filet-d, transparent); }
.vignette:hover { transform: translateY(-2px); box-shadow: 2px 4px 0 var(--encre); border-color: var(--encre); }
.vignette header { display: flex; align-items: baseline; gap: .5rem; margin-bottom: .45rem; }
.vignette .poignee { align-self: center; touch-action: none; flex: none; }
.vignette .rang { font-size: .75rem; color: var(--encre-douce); font-variant-numeric: tabular-nums; }
.vignette h3 { font: 600 1.05rem/1.25 var(--police-poeme); margin: 0; flex: 1; }
.vignette p { margin: 0; font: italic .92rem/1.5 var(--police-poeme); color: var(--encre-douce); }
.vignette.a-venir { opacity: .72; }
.picto-mini { width: 1.5rem; height: 1.5rem; border-radius: 50%; background: var(--c); color: #fff; display: grid; place-items: center; flex: none; align-self: center; }
/* L'accueil suit l'échelle HD (ui/echelle.js) ; le fantôme, hors de l'accueil, la reprend. */
#accueil, body:has(#accueil:not([hidden])) .entete { zoom: var(--e, 1); }
/* Au-dessus du HD, l'accueil prend toute la largeur pour tenir sans défiler (ui/echelle.js) */
#accueil[data-plein], body:has(#accueil[data-plein]:not([hidden])) .entete { max-width: 80rem; }
#accueil[data-plein] .vignettes { grid-template-columns: repeat(5, minmax(0, 1fr)); }
.fantome.vignette { position: fixed; margin: 0; width: 15rem; transform: translate(-50%, -50%) rotate(-3deg) scale(var(--e, 1)); }

/* Barre des domaines fixée en bas, message flottant au-dessus */
[data-ecran="accueil"] { padding-bottom: 5rem; }
[data-ecran="lecture"] { padding-bottom: 5.5rem; }
.domaines.barre { position: fixed; left: 0; right: 0; bottom: 0; z-index: 4; padding: .6rem 16px calc(.6rem + env(safe-area-inset-bottom, 0px)); background: rgb(255 255 255 / .94); backdrop-filter: blur(6px); border-top: 1px solid var(--filet); }
.retour.flottant { position: fixed; z-index: 5; left: 50%; transform: translateX(-50%); bottom: calc(6.5rem + env(safe-area-inset-bottom, 0px)); width: min(44rem, calc(100% - 32px)); background: var(--papier); box-shadow: 0 8px 24px rgb(0 0 0 / .12); }
.fermer { background: none; border: 0; font-size: 1.3rem; line-height: 1; color: var(--encre-douce); }
.lien { background: none; border: 0; padding: 0; color: var(--encre); text-decoration: underline; }
@media (max-width: 640px) { [data-ecran="accueil"] { padding-bottom: 12rem; } .retour.flottant { bottom: calc(9.5rem + env(safe-area-inset-bottom, 0px)); } }

/* Mode d'emploi (ui/aide.js) */
.aide { border: 0; border-radius: 6px; padding: 1.8rem 2rem 1.4rem; width: min(38rem, calc(100% - 32px)); color: var(--encre); background: var(--papier); border-top: 5px solid #B8412F; box-shadow: 0 20px 60px rgb(0 0 0 / .25); }
.aide::backdrop { background: rgb(29 26 23 / .5); }
.aide h2 { font: 600 1.8rem/1.1 var(--police-poeme); margin: 0 0 .6rem; }
.aide p { margin: 0 0 .8rem; line-height: 1.55; }
.aide ol { margin: 0 0 1rem; padding-left: 1.3rem; display: grid; gap: .45rem; line-height: 1.5; }
.aide .aide-fin { font-size: .9rem; color: var(--encre-douce); }
.aide form { display: flex; justify-content: space-between; align-items: center; gap: 1rem; flex-wrap: wrap; margin-top: .6rem; font-size: .9rem; color: var(--encre-douce); }

/* Mosaïque ajustée à l'écran (ordinateur) : vignettes plus compactes, incipit sur deux lignes */
#accueil[data-plein] { gap: 1rem; }
#accueil[data-plein] .vignettes { gap: .6rem; }
#accueil[data-plein] .vignette { padding: .6rem .8rem .7rem; }
#accueil[data-plein] .vignette header { margin-bottom: .3rem; }
#accueil[data-plein] .vignette p { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }

/* Signaler une erreur (ui/signaler.js) */
.signaler form { display: grid; gap: .6rem; color: var(--encre); font-size: 1rem; }
.signaler textarea, .signaler input[type=email] { width: 100%; font: inherit; padding: .5rem .6rem; border: 1px solid var(--filet); border-radius: 4px; background: #fff; }
.signaler label { display: grid; gap: .3rem; font-size: .9rem; color: var(--encre-douce); }
.signaler .sg-passage { font-style: italic; background: rgb(184 65 47 / .07); padding: .4rem .6rem; border-radius: 4px; margin: 0; }
.signaler .sg-piege { position: absolute; left: -9999px; width: 1px; height: 1px; opacity: 0; }
.signaler .sg-boutons { display: flex; justify-content: flex-end; gap: .6rem; }
.signaler .sg-etat:empty { display: none; }

/* Bureau d'un poème */
.bureau { display: grid; grid-template-columns: minmax(14rem, 36rem) minmax(min(50rem, 100% - 26rem), 58rem) 3.2rem; justify-content: center; grid-template-areas: "tete tete tete" "docs centre outils"; gap: 1.2rem; padding: 1.2rem max(1.6rem, (100% - 1800px) / 2); border-radius: 0; min-height: calc(100vh - 3.5rem); margin-inline: -16px; background: linear-gradient(var(--fond-voile), var(--fond-voile)), var(--fond-image) center / var(--fond-taille, cover), #2c4128; }
.bureau-tete { grid-area: tete; display: flex; align-items: center; gap: 1rem; }
.bureau-tete h1 { margin: 0; font: 600 1.4rem var(--police-poeme); color: #f4efe4; }
.bureau-tete .bouton { background: rgb(255 255 255 / .9); }
.bureau h2 { font-size: .72rem; letter-spacing: .1em; text-transform: uppercase; color: #efe9dc; margin: 0 0 .6rem; }
.bureau-docs { grid-area: docs; } .bureau-docs > div[data-r="docs"] { display: grid; grid-template-columns: repeat(auto-fill, minmax(8.5rem, 1fr)); gap: .9rem; align-items: start; }
.bureau-centre { grid-area: centre; min-width: 0; }
.bureau-outils { grid-area: outils; display: flex; flex-direction: column; gap: .5rem; }

/* La feuille du poème */
.bureau .feuille { max-width: none; margin: 0; }
.feuille { background: #fbf8f1; padding: 2rem 2rem 2.4rem; border-radius: 2px; box-shadow: 0 2px 0 rgb(0 0 0 / .08), 0 16px 32px rgb(0 0 0 / .28); max-width: none; }

/* Vignettes de documents */
.doc-vignette { position: relative; background: #fbf8f1; border-radius: 3px; padding: .5rem .6rem .6rem; cursor: pointer; box-shadow: 0 6px 14px rgb(0 0 0 / .25); transition: transform .15s; }
.doc-vignette:nth-child(odd) { transform: rotate(-1deg); } .doc-vignette:nth-child(even) { transform: rotate(.8deg); }
.doc-vignette:hover { transform: rotate(0) translateY(-2px); }
.doc-vignette img { display: block; width: 100%; aspect-ratio: 4 / 3; object-fit: cover; }
.doc-texte-apercu { display: -webkit-box; -webkit-line-clamp: 4; -webkit-box-orient: vertical; overflow: hidden; font: italic .85rem/1.4 var(--police-poeme); margin: .5rem 0 0; color: var(--encre-douce); }
.doc-vignette h3 { font: 600 .88rem/1.25 var(--police-poeme); margin: .2rem 1.6rem 0 0; }
.doc-statut { margin: .45rem 0 0; font-size: .66rem; letter-spacing: .08em; text-transform: uppercase; color: var(--encre-douce); }
.statut-archive .doc-statut { color: #7a5a2a; } .statut-ia .doc-statut { color: #B8412F; } .statut-2026 .doc-statut { color: #1F4E79; } .statut-schema .doc-statut { color: #3E7B5A; } .statut-posterite .doc-statut { color: #8a5a95; }
.doc-vignette.a-venir { opacity: .6; }
.etoile { position: absolute; right: .35rem; bottom: .35rem; background: none; border: 0; font-size: 1.15rem; color: #c9c1b3; line-height: 1; }
.etoile.on { color: #D9A21B; }

/* Document ouvert */
.doc-vue { background: #fbf8f1; padding: 1.4rem 1.8rem 1.8rem; box-shadow: 0 16px 32px rgb(0 0 0 / .28); }
.doc-vue header { display: flex; justify-content: space-between; align-items: center; }
.doc-vue .etoile { position: static; font-size: 1.5rem; }
.doc-vue h2 { font: 600 1.5rem/1.2 var(--police-poeme); color: var(--encre); letter-spacing: 0; text-transform: none; margin: .2rem 0 1rem; }
.doc-cadre { margin: 0; }
.statut-archive .doc-cadre { border: 1px solid #b9a98a; padding: .8rem; background: #fff; }
.doc-cadre img { display: block; width: 100%; height: auto; }
.doc-cadre blockquote { margin: 0; font: 1.12rem/1.7 var(--police-poeme); }
.doc-cadre blockquote p { margin: 0 0 1em; }
.cartel { margin-top: .7rem; font-size: .78rem; line-height: 1.45; color: var(--encre-douce); }
.cartel a { color: inherit; }
.doc-notice { line-height: 1.65; margin: 1rem 0; }
.doc-attente { color: var(--encre-douce); font-style: italic; }

/* Outils : barre d'icônes, bulle au survol, panneau flottant */
.bureau-outils { position: relative; align-items: center; padding-top: 1.8rem; }
.outil { position: relative; width: 2.6rem; height: 2.6rem; border-radius: 50%; border: 0; background: #fbf8f1; color: var(--encre); font-size: 1.1rem; box-shadow: 0 4px 10px rgb(0 0 0 / .25); display: grid; place-items: center; }
.outil:hover, .outil:focus-visible { background: #fff; transform: scale(1.06); }
.outil[data-bulle]:hover::after, .outil[data-bulle]:focus-visible::after { content: attr(data-bulle); position: absolute; right: calc(100% + .6rem); top: 50%; transform: translateY(-50%); white-space: nowrap; background: var(--encre); color: #fbf8f1; font-size: .82rem; padding: .3rem .6rem; border-radius: 4px; pointer-events: none; }
.outil-panneau { overscroll-behavior: contain; position: absolute; top: 1.8rem; right: calc(100% + .8rem); z-index: 6; width: min(22rem, 70vw); max-height: 70vh; overflow: auto; background: #fbf8f1; border-radius: 4px; padding: .9rem 1rem; font-size: .88rem; box-shadow: 0 16px 36px rgb(0 0 0 / .35); }
.outil-panneau h3 { margin: 0 0 .5rem; font: 600 1rem var(--police-poeme); }
.outil-panneau p { margin: 0; } .outil-panneau ul { margin: 0; padding-left: 1rem; }
.sources li { margin-bottom: .5rem; line-height: 1.4; }

@media (max-width: 900px) {
  .bureau { grid-template-columns: 1fr; grid-template-areas: "tete" "outils" "centre" "docs"; }
  .bureau-outils { flex-direction: row; justify-content: flex-end; padding-top: 0; }
  .outil-panneau { top: calc(100% + .5rem); right: 0; }
  .bureau-docs > div { display: grid; grid-template-columns: repeat(auto-fill, minmax(9rem, 1fr)); }
}
.doc-vue .ecouter { display: inline-block; margin: 0 .5rem .5rem 0; text-decoration: none; }
.doc-zoom { display: block; position: relative; width: 100%; padding: 0; border: 0; background: none; cursor: zoom-in; }
.doc-zoom-aide { position: absolute; right: .6rem; bottom: .6rem; background: rgb(29 26 23 / .8); color: #fff; font-size: .8rem; padding: .25rem .6rem; border-radius: 999px; }
.media { position: relative; aspect-ratio: 16 / 9; margin: 0 0 .6rem; background: #000; }
.media iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }

/* Visionneuse plein écran */
.visionneuse { width: 100vw; height: 100vh; max-width: none; max-height: none; margin: 0; padding: 0; border: 0; background: #111; color: #eee; }
.visionneuse::backdrop { background: #111; }
.vis-scene { position: absolute; inset: 0; overflow: hidden; display: grid; place-items: center; cursor: grab; touch-action: none; }
.vis-scene img { max-width: 100vw; max-height: 100vh; transform-origin: center; user-select: none; -webkit-user-drag: none; }
.vis-barre { position: absolute; top: 1rem; right: 1rem; display: flex; gap: .4rem; }
.vis-barre button { background: rgb(255 255 255 / .92); border: 0; border-radius: 999px; padding: .45rem .9rem; font-size: 1rem; }
.vis-legende { position: absolute; left: 0; right: 0; bottom: 0; margin: 0; padding: .6rem 1rem; font-size: .8rem; color: #ddd; background: rgb(0 0 0 / .7); pointer-events: none; }
.outil-panneau audio { width: 100%; margin: .2rem 0 .4rem; }
.audio-credit { font-size: .75rem; color: var(--encre-douce); }
.lectures { display: flex; flex-wrap: wrap; gap: .4rem; margin-bottom: .6rem; }
.bureau .feuille { padding: 2.4rem 3rem 3rem; }
/* Carte « En écoute » */
.ecoute { background: #1d1a17; color: #f3ead6; border-radius: 4px; padding: .7rem .8rem .8rem; margin-bottom: 1rem; box-shadow: 0 8px 20px rgb(0 0 0 / .35); }
.ecoute header { display: flex; justify-content: space-between; align-items: center; font-size: .72rem; letter-spacing: .1em; text-transform: uppercase; margin-bottom: .5rem; }
.ecoute .lien { color: #f3ead6; font-size: .8rem; text-transform: none; letter-spacing: 0; }
.ecoute .bouton { background: transparent; color: #f3ead6; border-color: #f3ead6; font-size: .85rem; padding: .25rem .7rem; }
.ecoute .bouton.discret { border-color: rgb(243 234 214 / .3); color: rgb(243 234 214 / .6); }
.ecoute .media { margin: .2rem 0 .3rem; pointer-events: none; border-radius: 3px; overflow: hidden; }
.ecoute .audio-credit { color: rgb(243 234 214 / .7); margin: .3rem 0 0; } .ecoute .audio-credit a { color: inherit; }
.onde { height: 2.2rem; margin: .3rem 0; background: repeating-linear-gradient(90deg, #B8412F 0 3px, transparent 3px 7px); mask: linear-gradient(90deg, transparent, #000 15%, #000 85%, transparent); animation: onde 1.2s ease-in-out infinite alternate; }
@keyframes onde { from { transform: scaleY(.35); } to { transform: scaleY(1); } }

/* Grand écran : le poème grandit un peu, jamais en dessous de sa taille normale */
/* le sonnet tient dans la hauteur de l'écran (≈ 30 lignes de texte + en-tête du bureau) */
@media (min-width: 900px) { .bureau .poeme { --corps-poeme: clamp(.95rem, min(.8rem + .5vw, (100vh - 11rem) / 30), 1.65rem); } }

/* Scène du poème (ui/scene-poeme.js) : icônes en haut à droite de la feuille ;
   en plein écran, fond blanc, poème à sa taille, placé à gauche, au centre ou à droite */
.scene-poeme { position: relative; }
.barre-scene { position: absolute; top: .7rem; right: .7rem; z-index: 2; display: flex; gap: .3rem; }
.icone-scene { display: grid; place-items: center; padding: .3rem; background: #fbf8f1; border: 1px solid var(--filet); border-radius: 4px; color: var(--encre-douce); }
.icone-scene:hover, .scene-poeme[data-place="gauche"] [data-place="gauche"], .scene-poeme[data-place="centre"] [data-place="centre"], .scene-poeme[data-place="droite"] [data-place="droite"] { color: var(--encre); border-color: var(--encre); }
.scene-poeme:not(:fullscreen, .plein-simule) [data-place] { display: none; }
.scene-poeme:is(:fullscreen, .plein-simule) { display: flex; align-items: safe center; justify-content: center; overflow: auto; padding: 4vh 5vw; background: #fff; }
.scene-poeme:is(:fullscreen, .plein-simule)::backdrop { background: #fff; }
.scene-poeme[data-place="gauche"]:is(:fullscreen, .plein-simule) { justify-content: flex-start; }
.scene-poeme[data-place="droite"]:is(:fullscreen, .plein-simule) { justify-content: flex-end; }
.scene-poeme:is(:fullscreen, .plein-simule) .feuille { width: fit-content; max-width: 58rem; background: none; box-shadow: none; }
.scene-poeme:is(:fullscreen, .plein-simule) .barre-scene { position: fixed; top: 1rem; right: 1rem; opacity: .35; transition: opacity .2s; }
.scene-poeme:is(:fullscreen, .plein-simule) .barre-scene:hover { opacity: 1; }

/* Sur ordinateur, le bureau occupe la fenêtre sous l'en-tête : documents et zone centrale défilent chacun
   de leur côté, le poème ne bouge plus quand on fait défiler les vignettes. */
.bureau { align-content: start; }
@media (min-width: 901px) {
  .bureau { position: fixed; top: 2.9rem; left: 0; right: 0; bottom: 0; z-index: 3; margin: 0; min-height: 0; grid-template-rows: auto minmax(0, 1fr); align-content: stretch; overflow: hidden; }
  .bureau-docs, .bureau-centre { min-height: 0; overflow: auto; overscroll-behavior: contain; }
  .bureau-docs { padding-right: .4rem; }
  .bureau-centre { padding: 0 2rem 2rem; margin: 0 -2rem; }
  .bureau-outils { align-self: start; }
}

/* Documents ouverts : l'image et les lecteurs se réduisent pour tenir en hauteur */
.doc-cadre img { width: auto; max-width: 100%; max-height: calc(100vh - 17rem); margin: 0 auto; object-fit: contain; }
.doc-vue .media { max-width: calc((100vh - 17rem) * 16 / 9); margin-inline: auto; }
@media (max-height: 800px) { .bureau { padding-block: .6rem; gap: .8rem; } .feuille { padding: 1.2rem 1.6rem 1.4rem; } }

.scene-poeme.plein-simule { position: fixed; inset: 0; z-index: 60; }

/* Document image : l'image à gauche, le titre et la notice à droite ; tout tient en hauteur */
@media (min-width: 901px) {
  .doc-vue.type-image { display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(14rem, 1fr); column-gap: 1.6rem; align-items: start; }
  .doc-vue.type-image > header { grid-column: 1 / -1; }
  .doc-vue.type-image > figure { grid-column: 1; grid-row: 2 / span 8; }
  .doc-vue.type-image > :not(header):not(figure) { grid-column: 2; }
  .doc-vue.type-image .doc-cadre img { max-height: calc(100vh - 15rem); }
}

/* Petit dico */
.dico { margin: 0; } .dico dt { margin-top: .55rem; } .dico dt .lien { font: 600 1rem var(--police-poeme); }
.dico dt small { color: var(--encre-douce); } .dico dd { margin: .1rem 0 0; line-height: 1.45; }
.dico-vu { animation: dico-vu 2.6s ease-out; border-radius: 2px; }
@keyframes dico-vu { 0%, 60% { background: var(--surligneur); } 100% { background: transparent; } }

/* Diaporama d'introduction (ui/diaporama.js) et cartons typographiques (ui/carton.js) */
.diaporama { position: fixed; inset: 0; z-index: 100; display: grid; grid-template-rows: minmax(0, 1fr) auto; background: #0f0e0d; color: #f3ede2; font-family: var(--police-ui); cursor: pointer; }
.dp-scene, .dp-pause, .dp-encart { grid-row: 1; grid-column: 1; }
.dp-scene { position: relative; overflow: hidden; }
.dp-plan { position: absolute; inset: 0; display: grid; place-items: center; opacity: 0; transition: opacity 1.4s cubic-bezier(.4, 0, .2, 1) .5s; }
.dp-plan.visible { opacity: 1; }
.dp-plan.sortie { opacity: 0; transition: opacity 1s cubic-bezier(.4, 0, .6, 1); }
.dp-seule .dp-tirage, .dp-plan.dp-table { animation: var(--kb-nom, kb0) var(--kb) linear forwards; }
.kb0 { --kb-nom: kb0; } .kb1 { --kb-nom: kb1; } .kb2 { --kb-nom: kb2; } .kb3 { --kb-nom: kb3; }
@keyframes kb0 { from { scale: 1; } to { scale: 1.06; } }
@keyframes kb1 { from { scale: 1.06; translate: -1% 0; } to { scale: 1; translate: 0 0; } }
@keyframes kb2 { from { scale: 1.01; translate: 1% .6%; } to { scale: 1.07; translate: -.6% -.6%; } }
@keyframes kb3 { from { scale: 1.07; translate: 0 -.8%; } to { scale: 1.01; translate: 0 .8%; } }
.en-pause .dp-tirage, .en-pause .dp-plan, .en-pause .carton, .en-pause .carton * { animation-play-state: paused; }

/* Tirages : l'image et sa légende accolée (ce que l'on voit) ; en table, plusieurs tirages posés de travers */
.dp-tirage { margin: 0; display: flex; flex-direction: column; align-items: center; rotate: var(--incl, 0deg); }
.dp-tirage img, .dp-tirage video { display: block; visibility: hidden; box-shadow: 0 18px 50px rgb(0 0 0 / .55); }
.dp-restaure { position: relative; }
.dp-restaure > img + img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; box-shadow: none; visibility: visible; opacity: 0; animation: restaure 2.5s ease-in-out 2.5s forwards; }
@keyframes restaure { to { opacity: 1; } }
.en-pause .dp-restaure > img + img { animation-play-state: paused; }
.dp-tirage figcaption { margin-top: .8rem; padding: .4rem .9rem; max-width: 34ch; background: #f3ede2; color: #1d1a17; font: italic 1.05rem/1.3 var(--police-poeme); text-align: center; box-shadow: 0 6px 16px rgb(0 0 0 / .4); }
.dp-plan.dp-table { display: grid; grid-template-rows: 100%; align-items: center; justify-items: center; padding: 0 3vw; }
.dp-pile > .dp-tirage { grid-area: 1 / 1; translate: calc(var(--i) * 14px) calc(var(--i) * -9px); opacity: 0; animation: pile-pose .9s cubic-bezier(.2, .7, .2, 1) calc(var(--i) * 1.1s) forwards; }
.dp-tirage figcaption:empty { display: none; }
@keyframes pile-pose { from { opacity: 0; transform: translateY(-24px); } to { opacity: 1; transform: none; } }
.en-pause .dp-pile > .dp-tirage { animation-play-state: paused; }
.dp-slot { display: grid; place-items: center; width: 100%; height: 100%; }
.dp-slot > .dp-tirage { grid-area: 1 / 1; transition: opacity 1.2s cubic-bezier(.4, 0, .2, 1); }
.dp-slot > .dp-tirage.entre, .dp-slot > .dp-tirage.sortie { opacity: 0; }
.dp-slot:nth-child(odd) { margin-bottom: 5vh; } .dp-slot:nth-child(even) { margin-top: 7vh; }


.dp-cartouche { height: calc(3 * 1.5 * var(--dp-corps) + 2.9rem); overflow: auto; padding: .8rem max(1.5rem, (100% - 64rem) / 2) .9rem; background: #171513; border-top: 1px solid rgb(243 237 226 / .08); cursor: auto; --dp-corps: clamp(1rem, .6rem + 1.1vh, 1.2rem); }
.dp-titre { margin: 0 0 .35rem; font-size: .72rem; font-weight: 600; letter-spacing: .16em; text-transform: uppercase; color: #d8553f; }
.dp-titre:empty { display: none; }
.dp-texte { margin: 0; font: var(--dp-corps)/1.5 var(--police-poeme); color: #f3ede2; }
.dp-texte span { transition: color .6s; }
.dp-texte .qui-C { font-style: italic; }

.dp-pause { z-index: 3; display: flex; align-items: center; justify-content: center; gap: min(12vw, 9rem); transition: opacity .6s; }
.dp-pause[hidden] { display: none; }
.dp-pause button { display: grid; place-items: center; padding: .9rem; border: 1px solid rgb(243 237 226 / .25); border-radius: 50%; background: rgb(15 14 13 / .3); color: rgb(243 237 226 / .75); cursor: pointer; }
.dp-pause [data-a="lire"] { padding: 1.5rem; }
.dp-pause button:hover { color: #fff; background: rgb(15 14 13 / .6); }
.diaporama.repos { cursor: none; }
.diaporama.repos .dp-pause { opacity: 0; }
/* Muet : lecture à son rythme, une flèche sur chaque bord, pas de bouton lecture */
.dp-bords { display: none; }
.diaporama.muet .dp-pause { display: none; }
.diaporama.muet .dp-bords { display: contents; }
.dp-bords button { position: fixed; top: 40%; z-index: 3; display: grid; place-items: center; padding: .8rem; border: 0; border-radius: 50%; background: rgb(15 14 13 / .3); color: rgb(243 237 226 / .7); cursor: pointer; transition: opacity .6s; }
.dp-bords [data-a="prec"] { left: 1.2vw; }
.dp-bords [data-a="suiv"] { right: 1.2vw; }
.dp-bords button:hover { color: #fff; background: rgb(15 14 13 / .6); }
.diaporama.repos .dp-bords button { opacity: 0; }

.dp-coin { position: fixed; top: .7rem; right: .7rem; z-index: 4; display: flex; gap: .3rem; opacity: .3; transition: opacity .3s; }
.dp-coin:hover, .dp-coin:focus-within { opacity: 1; }
.dp-coin button { display: grid; place-items: center; padding: .35rem; border: 0; background: none; color: #f3ede2; cursor: pointer; }

/* Cartons : fonds unis, grain de papier, typographie Literata */
.carton { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 6vh 8vw; text-align: center;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='220' height='220'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='3'/%3E%3CfeColorMatrix values='0 0 0 0 .12 0 0 0 0 .1 0 0 0 0 .08 0 0 0 .1 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  animation: carton-souffle 12s ease-out forwards; }
.carton > * { animation: carton-monte 1.3s cubic-bezier(.2, .7, .2, 1) both; }
.carton > :nth-child(2) { animation-delay: .15s; } .carton > :nth-child(3) { animation-delay: .35s; } .carton > :nth-child(4) { animation-delay: .5s; }
@keyframes carton-monte { from { opacity: 0; transform: translateY(1.2rem); } }
@keyframes carton-souffle { from { background-size: 220px; } to { background-size: 240px; } }
.c-filet { display: block; width: min(38vw, 20rem); height: 2px; background: #B8412F; }
.c-sous { margin: 3.5vh 0 0; font-size: clamp(.8rem, 1.9vh, 1.15rem); font-weight: 600; letter-spacing: .24em; text-transform: uppercase; opacity: .7; }

.carton-date { background-color: #f3ede2; color: #1d1a17; }
.c-date { display: flex; flex-direction: column; align-items: center; margin: 3.5vh 0; font-family: var(--police-poeme); line-height: .95; }
.c-jour { font-size: clamp(5rem, 17vh, 13rem); font-weight: 600; color: #B8412F; }
.c-jour sup { font-size: .32em; vertical-align: top; margin-left: .05em; }
.c-mois { font-size: clamp(2rem, 6.5vh, 5rem); font-style: italic; }
.c-mois.grand { font-size: clamp(3.4rem, 12vh, 9rem); color: #B8412F; }
.c-an { margin: 1.4vh -.5em 0 0; font-size: clamp(1.3rem, 3.6vh, 2.8rem); letter-spacing: .5em; }
.c-evt { margin: 0 0 3.5vh; font-size: clamp(.9rem, 2.3vh, 1.45rem); font-weight: 600; letter-spacing: .3em; text-transform: uppercase; }

.carton-citation { background-color: #1d1a17; color: #f3ede2; }
.carton-citation blockquote { display: block; margin: 0; max-width: 30ch; font: italic 400 clamp(1.8rem, 5.4vh, 3.8rem)/1.3 var(--police-poeme); text-wrap: balance; }
.carton-citation blockquote.vers { max-width: none; white-space: nowrap; text-align: left; font-size: min(4.6vh, 3.9vw); } /* un vers = une ligne */
.carton-citation .g { font-style: normal; font-size: 1.35em; line-height: 0; color: #d8553f; }

.carton-titre { background-color: #fbf8f1; color: #1d1a17; }
.carton-manuscrit img { width: min(70vw, 44rem); height: auto; margin-bottom: 3vh; clip-path: inset(0 100% 0 0); animation: trace 3.2s cubic-bezier(.45, .05, .35, 1) .6s forwards; }
@keyframes trace { to { clip-path: inset(0 0 0 0); } }
.carton-titre h2 { margin: 0 0 3vh; font: 600 clamp(2.6rem, 10vh, 7.5rem)/1.05 var(--police-poeme); }

/* Bureau : vignettes de l'introduction et galerie */
.statut-intro .doc-statut { color: #B8412F; }
.galerie-mosaique { display: grid; grid-template-columns: 1fr 1fr; gap: 2px; aspect-ratio: 4 / 3; overflow: hidden; }
.doc-vignette .galerie-mosaique img { width: 100%; height: 100%; aspect-ratio: auto; object-fit: cover; min-height: 0; }
.galerie-liste { list-style: none; margin: 0; padding: 0; display: grid; gap: 1rem; }
.galerie-liste li { display: grid; grid-template-columns: 8rem 1fr; gap: 1rem; align-items: start; padding-bottom: 1rem; border-bottom: 1px solid var(--filet); }
.galerie-img { padding: 0; border: 0; background: none; cursor: zoom-in; }
.galerie-img img { display: block; width: 8rem; height: 6rem; object-fit: cover; }
.galerie-liste p { margin: 0 0 .3rem; font-size: .92rem; line-height: 1.45; }
.galerie-liste .galerie-droits { font-size: .8rem; color: var(--encre-douce); }

.carton-liste { background-color: #f3ede2; color: #1d1a17; }
.c-tete { margin: 0 0 2.5vh; font-size: clamp(.9rem, 2.2vh, 1.4rem); font-weight: 600; letter-spacing: .25em; text-transform: uppercase; }
.c-tete .c-mois { font: italic 400 clamp(1.8rem, 5vh, 3.4rem) var(--police-poeme); letter-spacing: 0; text-transform: none; color: #B8412F; margin-right: .4em; }
.c-titres { margin: 3vh 0 0; padding: 0; list-style: none; font: italic clamp(.9rem, min(2.6vh, 1.35vw), 1.7rem)/1.45 var(--police-poeme); text-align: left; counter-reset: t; }
.c-titres.deux { columns: 2; column-gap: 2.5vw; }
.c-titres li { white-space: nowrap; }
.c-titres li { break-inside: avoid; animation: carton-monte .9s cubic-bezier(.2, .7, .2, 1) both; animation-delay: calc(var(--i) * .2s + .6s); }
.c-titres li::before { counter-increment: t; content: counter(t) ". "; font-style: normal; font-size: .75em; color: #B8412F; }
.c-titres li.actuel { color: #B8412F; font-weight: 600; }

.dp-encart { z-index: 2; align-self: start; justify-self: start; margin: 1rem; max-width: min(24rem, 38%); padding: .7rem .9rem; border-left: 3px solid #d8553f; background: rgb(23 21 19 / .85); color: rgb(243 237 226 / .92); font: italic .92rem/1.45 var(--police-poeme); cursor: default; }
.dp-encart:empty { display: none; }
@media (max-width: 700px) { .dp-encart { display: none; } }   /* sur téléphone, pas de notes */

/* Jauge de progression : trait très fin en haut de l'écran */
.dp-jauge { position: fixed; top: 0; left: 0; z-index: 4; height: 2px; width: 0; background: rgb(243 237 226 / .35); pointer-events: none; }

/* Épisode vidéo de la biographie (core/episode.js) : surtitre rouge, image emblème de l'épisode suivant. */
.c-sur { margin: 0 0 2.5vh; font-size: clamp(.9rem, 2.2vh, 1.3rem); font-weight: 600; letter-spacing: .24em; text-transform: uppercase; color: #B8412F; }
.carton-episode img { max-height: 34vh; max-width: 40vw; margin-bottom: 4vh; box-shadow: 0 .6rem 1.6rem rgb(0 0 0 / .18); }

/* Analyse linéaire dialoguée : poème sur papier au centre, fiches des relevés dans les marges, cartouche des voix en bas. */
.analyse { position: fixed; inset: 0; z-index: 70; display: grid; grid-template-rows: auto minmax(0, 1fr) auto; background: #f4efe6; color: var(--encre); font-family: var(--police-ui); }
.an-tete { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: .6rem 1.2rem; border-bottom: 1px solid var(--filet); }
.an-chapitre { margin: 0; font: 600 clamp(.95rem, .8rem + .4vw, 1.2rem)/1.3 var(--police-poeme); color: #B8412F; }
.an-cmd { display: flex; gap: .2rem; }
.an-cmd button { display: grid; place-items: center; padding: .35rem; border: 0; border-radius: 50%; background: none; color: var(--encre-douce); cursor: pointer; }
.an-cmd button:hover { color: var(--encre); background: rgb(0 0 0 / .06); }

/* Le cadre ne défile pas : le carton et la définition restent centrés sur la partie visible, même quand le poème défile. */
.an-cadre { position: relative; display: grid; grid-template: minmax(0, 1fr) / minmax(0, 1fr); min-height: 0; }
.an-scene { position: relative; min-height: 0; display: grid; place-items: center; overflow: auto; padding: 1rem 2rem; }
.an-poeme { --corps-poeme: clamp(.8rem, min(.8rem + .7vw, (100vh - 12rem) / 33), 1.5rem);
  background: var(--papier); padding: .8rem 2.2rem .9rem; box-shadow: 0 1px 3px rgb(0 0 0 / .08), 0 8px 30px rgb(0 0 0 / .06);
  font: var(--corps-poeme)/1.55 var(--police-poeme); letter-spacing: var(--interlettre); word-spacing: var(--intermot); }
.an-poeme .titre { margin: 0 0 .3em; font-size: 1.15em; }
.an-poeme .strophe { margin-bottom: .35em; }
.an-poeme .vers { position: relative; margin: 0; white-space: nowrap; grid-template-columns: auto 1fr; }   /* la colonne suit la largeur du numéro (100 et plus) */
.an-poeme .num { display: inline-block; box-sizing: border-box; width: calc(var(--chiffres, 2) * .62em + 1.1em); padding-right: .9em; text-align: right; font-size: .7em; color: var(--encre-douce); }

/* Annotations durables (système de Lutrin) : une couleur par relevé, partagée par le passage et sa fiche en marge.
   --c : encre ; --f : surligneur du relevé en cours ; --f2 : surligneur des relevés précédents. */
.c0 { --c: #2f6690; --f: rgb(150 196 235 / .75); --f2: rgb(150 196 235 / .35); }
.c1 { --c: #2f6b4a; --f: rgb(160 214 170 / .8); --f2: rgb(160 214 170 / .38); }
.c2 { --c: #7a4a88; --f: rgb(222 180 228 / .8); --f2: rgb(222 180 228 / .38); }
.c3 { --c: #9a7400; --f: rgb(247 222 110 / .9); --f2: rgb(247 222 110 / .42); }
.t-rouge { --c: #a3281b; --f: rgb(232 112 96 / .6); --f2: rgb(232 112 96 / .32); }
.an-sur, .an-relie { --h: .72em; --fond: var(--f2); background-image: linear-gradient(100deg, transparent .12em, var(--fond) .22em calc(100% - .2em), transparent calc(100% - .08em)); background-position: 0 82%; }
.an-sur.act, .an-relie.act { --fond: var(--f); }
.an-sous, .an-note { --h: .09em; background-image: linear-gradient(var(--c), var(--c)); background-position: 0 96%; opacity: 1; }
.an-sous.act, .an-note.act { --h: .14em; }
.an-sur, .an-relie, .an-sous, .an-note { background-repeat: no-repeat; background-size: 100% var(--h); -webkit-box-decoration-break: clone; box-decoration-break: clone; }
.an-mot { border-bottom: 2px dotted var(--encre-douce); }
.neuf { animation: an-trace .8s cubic-bezier(.4, 0, .2, 1) both; }
@keyframes an-trace { from { background-size: 0 var(--h); } }

/* Fiches en marge (src/ui/fiches.js) : procédé en capitales, interprétation dessous ; les précédentes en retrait */
.fiche { position: absolute; z-index: 3; box-sizing: border-box; padding: .55em .8em .65em 1em; border-left: 6px solid var(--c); background: #fff;
  opacity: .6; font: clamp(.85rem, .4rem + .95vw, 1.6rem)/1.35 var(--police-ui); color: var(--encre); animation: an-fondu .4s ease-out both; }
.fiche.act { opacity: 1; box-shadow: 0 4px 18px rgb(0 0 0 / .1); }
.fiche-proc { margin: 0 0 .25em; font-weight: 700; font-size: .78em; line-height: 1.2; color: var(--c); text-transform: uppercase; letter-spacing: .07em; }
.fiche-texte { margin: 0; }
.fiches-liens { position: absolute; left: 0; top: 0; z-index: 2; pointer-events: none; overflow: visible; }
.fiches-liens path { fill: none; stroke: var(--c); stroke-width: 2.5; }
.an-poeme .vers { line-height: 1.6; }

/* Mouvements : le mouvement en cours au premier plan, une coupe tracée à la main entre deux mouvements */
.an-poeme .vers { transition: opacity .6s; }
.an-poeme .vers.an-hors { opacity: .28; }
.an-coupe { display: block; width: 100%; height: .45em; margin: 0 0 .15em; fill: none; stroke: #B8412F; stroke-width: 2; stroke-linecap: round; opacity: .8; }
.an-chapitre.change { animation: an-change 1.4s ease-out; }
@keyframes an-change { 0% { opacity: 0; transform: translateX(-.6rem); } 30% { opacity: 1; transform: none; } }

/* Éphémères : carton, définition */
.an-carton { position: absolute; inset: 0; z-index: 5; display: flex; flex-direction: column; justify-content: center; align-items: center; gap: .6em; padding: 4vh 8vw;
  background: rgb(244 239 230 / .96); font: 500 clamp(1.1rem, .8rem + 1.2vw, 1.9rem)/1.4 var(--police-poeme); text-align: center; animation: an-fondu .6s ease-out both; }
.an-carton p { margin: 0; max-width: 40ch; }
.an-ref { white-space: nowrap; }
.an-def { position: absolute; z-index: 5; right: 1.2rem; top: 1rem; max-width: 22rem; padding: .7rem 1rem; background: #fff; border-left: 4px solid #1F4E79;
  box-shadow: 0 4px 16px rgb(0 0 0 / .08); font-size: .95rem; line-height: 1.4; animation: an-fondu .4s ease-out both; }
@keyframes an-fondu { from { opacity: 0; } }

/* Cartouche des voix : hauteur fixe, la réplique en cours seulement */
.an-cartouche { position: relative; min-height: calc(2 * 1.45 * 1.05rem + 2.4rem); max-height: 32vh; overflow: auto; padding: .6rem 1.4rem; background: #1d1a17; color: #f3ede2; overflow: hidden; }
.an-qui { margin: 0 0 .2rem; font: 700 .8rem/1 var(--police-ui); letter-spacing: .08em; text-transform: uppercase; }
.an-qui.qui-Y { color: #8fb8dd; } .an-qui.qui-C { color: #e59a8a; }
.an-texte { margin: 0; max-width: 125ch; padding-right: 7rem; font: clamp(.95rem, .75rem + .5vw, 1.1rem)/1.45 var(--police-poeme); }
.an-barre { position: absolute; right: 1.4rem; top: .7rem; margin: 0; padding: .3em .6em; border-radius: 1em; background: #B8412F; color: #fff; font: 600 .8rem/1 var(--police-ui); }

@media (max-width: 900px) { .an-poeme .vers { white-space: normal; } .an-def { left: 1rem; right: 1rem; max-width: none; } }
.an-extrait { margin: -.3rem 0 .8rem; font: italic .85rem var(--police-ui); color: #8a7f70; }

/* La vie de Rimbaud (ui/vie.js) : une galerie de musée, mur sombre, cartels, passe-partout et filets d'or. */
.vie { --or: #b8975a; --ivoire: #efe7d8; --mur: #13110f; position: fixed; inset: 0; z-index: 90; display: grid; grid-template-rows: auto minmax(0, 1fr) auto; overflow: hidden;
  background: radial-gradient(ellipse at 50% 35%, #221e1a 0%, var(--mur) 70%); color: var(--ivoire); font-family: var(--police-ui); animation: vie-entre .8s ease-out both; }
@keyframes vie-entre { from { opacity: 0; } }
.vie-fermer { position: absolute; top: 1rem; right: 1.2rem; z-index: 2; width: 2.6rem; height: 2.6rem; border: 1px solid rgb(184 151 90 / .5); border-radius: 50%; background: none; color: var(--or); font: 300 1.6rem/1 var(--police-poeme); cursor: pointer; transition: background .3s, color .3s; }
.vie-fermer:hover { background: var(--or); color: var(--mur); }

.vie-tete { text-align: center; padding: 4.5vh 2rem 1vh; }
.vie-sur { margin: 0 0 1.2vh; font-size: .72rem; letter-spacing: .38em; text-transform: uppercase; color: var(--or); }
.vie-tete h1 { margin: 0; font: 400 clamp(2.6rem, 2rem + 3.2vw, 5.2rem)/1 var(--police-poeme); letter-spacing: .06em; }
.vie-dates { margin: 1.2vh 0 0; font: italic 400 clamp(1.1rem, 1rem + .6vw, 1.6rem)/1 var(--police-poeme); color: var(--or); letter-spacing: .12em; }
.vie-sous { margin: 1.6vh auto 0; width: fit-content; padding-top: 1.2vh; border-top: 1px solid rgb(184 151 90 / .45); font-size: .78rem; letter-spacing: .3em; text-transform: uppercase; color: rgb(239 231 216 / .7); }

.vie-frise { position: relative; display: flex; gap: clamp(1.6rem, 2.4vw, 3rem); align-items: flex-start; overflow-x: auto; overflow-y: hidden; padding: 4vh max(3rem, 8vw) 3vh;
  scroll-snap-type: x proximity; scrollbar-width: thin; scrollbar-color: rgb(184 151 90 / .5) transparent; }
.vie-fil { position: absolute; left: 0; top: calc(4vh + 1.9rem); height: 1px; width: calc(9 * (min(17rem, 22vw) + clamp(1.6rem, 2.4vw, 3rem)) + 16vw); background: linear-gradient(90deg, transparent, rgb(184 151 90 / .6) 6%, rgb(184 151 90 / .6) 94%, transparent); pointer-events: none; }
.vie-salle { position: relative; flex: 0 0 min(17rem, 22vw); scroll-snap-align: center; cursor: pointer; outline: none; animation: vie-monte .9s cubic-bezier(.2, .7, .2, 1) both; }
.vie-salle { animation-delay: calc(var(--i, 0) * 80ms); }
@keyframes vie-monte { from { opacity: 0; transform: translateY(1.2rem); } }
.vie-num { position: relative; margin: 0 0 1.4rem; width: fit-content; padding: .25rem .7rem; background: var(--mur); border: 1px solid rgb(184 151 90 / .6); font: 400 .8rem/1 var(--police-poeme); letter-spacing: .2em; color: var(--or); }
.vie-cadre { margin: 0; aspect-ratio: 4 / 5; padding: .9rem; background: #f4efe4; box-shadow: 0 0 0 1px var(--or), 0 18px 40px rgb(0 0 0 / .55); transition: transform .5s cubic-bezier(.2, .7, .2, 1), box-shadow .5s; }
.vie-cadre img { width: 100%; height: 100%; object-fit: cover; object-position: 50% 30%; display: block; filter: sepia(.12) contrast(1.02); outline: 1px solid rgb(0 0 0 / .15); outline-offset: -1px; }
.vie-salle:hover .vie-cadre, .vie-salle:focus-visible .vie-cadre { transform: translateY(-6px); box-shadow: 0 0 0 1px #d9bd7f, 0 26px 50px rgb(0 0 0 / .7); }
.vie-annees { margin: 1.4rem 0 .3rem; font: italic 400 1rem/1 var(--police-poeme); color: var(--or); letter-spacing: .1em; }
.vie-salle h2 { margin: 0 0 .6rem; font: 400 clamp(1.3rem, 1.1rem + .6vw, 1.8rem)/1.15 var(--police-poeme); letter-spacing: .02em; }
.vie-accroche { margin: 0; font: 400 .92rem/1.5 var(--police-poeme); color: rgb(239 231 216 / .82); }
.vie-cartel { margin: .9rem 0 0; padding-top: .5rem; border-top: 1px solid rgb(239 231 216 / .15); font-size: .7rem; letter-spacing: .06em; color: rgb(239 231 216 / .5); }
.vie-bientot { margin: .5rem 0 0; font-size: .66rem; letter-spacing: .24em; text-transform: uppercase; color: rgb(184 151 90 / .75); }
.vie-salle.a-venir .vie-cadre img { filter: sepia(.35) grayscale(.4) brightness(.8); }
.vie-salle.secoue { animation: vie-secoue .4s; }
@keyframes vie-secoue { 25% { transform: translateX(-4px); } 75% { transform: translateX(4px); } }
.vie-credits { padding: 1rem max(3rem, 8vw) 1.4rem; font-size: .62rem; line-height: 1.5; color: rgb(239 231 216 / .35); }
.entete .vie-bouton { color: #B8412F; font-weight: 600; }

/* Fenêtre de transition entre deux salles (ui/rebours.js) */
.rebours { position: fixed; inset: 0; z-index: 300; display: grid; place-items: center; padding: 1rem; background: rgb(15 14 13 / .6); animation: rb-entre .4s ease both; }
.rb-fenetre { width: min(34rem, 100%); padding: 1.6rem 1.8rem; border: 1px solid rgb(200 170 110 / .5); border-radius: .8rem; background: #1d1a17; color: #f3ede2; box-shadow: 0 1rem 3rem rgb(0 0 0 / .5); }
.rb-fin { margin: 0 0 1rem; font: .8rem var(--police-texte, sans-serif); letter-spacing: .12em; text-transform: uppercase; color: #c8aa6e; }
.rb-corps { display: flex; align-items: center; gap: 1.3rem; }
.rb-annonce { margin: 0; font: 1.35rem/1.25 var(--police-poeme); }
.rb-annonce small { display: block; margin-top: .2rem; font-size: .95rem; color: #c8aa6e; }
.rb-detail { margin: .5rem 0 0; font: italic 1rem/1.35 var(--police-poeme); opacity: .8; }
.rb-aide { margin: .7rem 0 0; font: .85rem var(--police-texte, sans-serif); opacity: .7; }
.rb-cercle { position: relative; flex: none; width: 76px; height: 76px; }
.rb-cercle svg { width: 100%; height: 100%; rotate: -90deg; }
.rb-cercle circle { fill: none; stroke-width: 2.5; }
.rb-fond { stroke: rgb(243 237 226 / .15); }
.rb-plein { stroke: #c8aa6e; stroke-dasharray: 106.8; stroke-dashoffset: 106.8; animation: rb-plein var(--duree) linear forwards; }
.rb-n { position: absolute; inset: 0; display: grid; place-items: center; font: 1.7rem var(--police-poeme); }
.rb-boutons { display: flex; flex-wrap: wrap; gap: .7rem; margin-top: 1.4rem; }
.rb-boutons button { flex: 1; padding: .7rem 1rem; border-radius: 2rem; font: .95rem var(--police-texte, sans-serif); cursor: pointer; }
.rb-go { border: 1px solid #c8aa6e; background: #c8aa6e; color: #1d1a17; }
.rb-stop { border: 1px solid rgb(243 237 226 / .4); background: none; color: #f3ede2; }
.rb-boutons button:hover, .rb-boutons button:focus-visible { outline: 2px solid #f3ede2; outline-offset: 2px; }
@keyframes rb-plein { to { stroke-dashoffset: 0; } }
@keyframes rb-entre { from { opacity: 0; } }
.rb-boutons button small { display: block; margin-top: .15rem; font-size: .75rem; opacity: .75; }

/* Version texte (outils/prerendu.mjs) : sous l'application, ou seule avec le bouton « Version texte ». */
.prerendu { max-width: 46rem; margin: 3rem auto; padding: 1.5rem 1.2rem 4rem; font: 1.05rem/1.6 var(--police-ui); color: var(--encre); background: #fbf8f1; border-radius: 4px; }
.prerendu h1, .prerendu h2 { font-family: var(--police-poeme); line-height: 1.25; }
.prerendu h2 { margin-top: 2.2rem; border-bottom: 1px solid #d8cfbf; }
.prerendu h3 { margin-top: 1.6rem; font-size: 1.05rem; }
.prerendu a { color: #8f2f21; }
.prerendu ol { padding-left: 2rem; } .prerendu li { margin: .3rem 0; }
.pr-incipit, .pr-note, .pr-fil, .pr-date { color: var(--encre-douce); font-size: .9em; }
.pr-poeme { --corps-poeme: 1.15rem; margin: 1.5rem 0; }
.pr-date { font-style: italic; }
.pr-replique { margin: .5rem 0; }
.pr-carton { border-left: 3px solid #B8412F; padding: .2rem .9rem; margin: .6rem 0; font-weight: 600; }
.pr-carton p, .pr-releve, .pr-def, .pr-barre { margin: .25rem 0; }
.pr-releve, .pr-def, .pr-barre { padding-left: 1.2rem; font-size: .92em; color: var(--encre-douce); }
.pr-dico dt { font-weight: 600; margin-top: .5rem; } .pr-dico dd { margin: 0 0 0 1rem; }
.pr-doc { margin: 1rem 0; } .pr-doc img { max-width: 100%; height: auto; max-height: 20rem; display: block; }
.pr-voisins { display: flex; justify-content: space-between; gap: 1rem; margin-top: 2.5rem; flex-wrap: wrap; }
body.appli:not(.version-texte) .prerendu { display: none; }   /* sans JavaScript, la version texte reste visible */
body.version-texte .page > [data-ecran] { display: none !important; }   /* les écrans ont des règles d’affichage par id */
body.version-texte .prerendu { margin-top: 1rem; }
