/* Étude d'un projet (projets.js), à la place de la phrase d'accueil : un article en une colonne centrée, les schémas dans le fil du texte.
   Pendant la lecture, l'accueil se tait : seuls restent le header et les dossiers. Même mise en page que la page Figma « Version finale ». */
.hero, .aside { transition: opacity .35s var(--out), filter .35s var(--out), visibility 0s; }
html.recit-on .hero, html.recit-on .aside { opacity: 0; filter: blur(6px); visibility: hidden; pointer-events: none; transition: opacity .25s var(--out), filter .25s var(--out), visibility 0s .25s; }
/* Rien ne parasite la lecture : personnage, bulles, contact, réglages */
html.recit-on body > canvas, html.recit-on .abub, html.recit-on .emotes, html.recit-on .dbg, html.recit-on .contact, html.recit-on .tip { opacity: 0 !important; visibility: hidden; pointer-events: none; }
/* Dossiers : le projet lu est à l'encre, les autres en retrait ; aucun ne s'ouvre */
html.recit-on .folder:not(.cur) { opacity: .6; transition: opacity .3s var(--out); }
html.recit-on .folder:not(.cur):hover { opacity: 1; }
.folder.cur .fmeta .y { color: var(--ink); }

/* Zone de lecture : entre le header et les dossiers, elle défile ; fondu discret en haut et en bas */
.recit { position: absolute; z-index: 3; top: 124px; bottom: 190px; left: 0; right: 0; overflow-y: auto; overscroll-behavior: contain; outline: none; scrollbar-width: none;
  mask-image: linear-gradient(transparent, #000 32px, #000 calc(100% - 56px), transparent);
  opacity: 0; visibility: hidden; transition: opacity .25s var(--out), visibility 0s .25s; }
.recit::-webkit-scrollbar { display: none; }
html.recit-on .recit { opacity: 1; visibility: visible; transition: opacity .45s var(--out) .15s, visibility 0s; }

/* Colonne de lecture : 640 px centrés, lignes de 65 à 75 caractères */
.rc-col { max-width: 640px; margin: 0 auto; padding: 28px 0 160px; }
.rc-col > * + * { margin-top: 20px; }
.rc-label { font-family: "Geist Mono", monospace; font-size: 11px; letter-spacing: .08em; text-transform: uppercase; color: var(--sub); }
.rc-col > .rc-label + .rc-lead { margin-top: 14px; }
/* Une seule sortie, toujours visible : « ← Projets » en haut de la colonne, hors de la zone qui défile ; le même lien ferme l'article */
.rc-up { position: absolute; z-index: 4; top: 100px; left: max(40px, calc(50% - 320px)); font-size: 13px; line-height: 1; color: var(--ink);
  opacity: 0; visibility: hidden; transition: opacity .25s var(--out), visibility 0s .25s; }
html.recit-on:not(.recit-cv) .rc-up { opacity: 1; visibility: visible; transition: opacity .45s var(--out) .15s, visibility 0s; }
.rc-up:hover, .rc-back:hover { opacity: .6 !important; }
.rc-up:focus-visible, .rc-back:focus-visible { outline: 1.5px solid var(--ink); outline-offset: 3px; border-radius: 2px; }
.rc-lead { font-family: "Geist", sans-serif; font-weight: 400; font-size: 32px; line-height: 1.18; letter-spacing: -0.032em; color: var(--ink); text-wrap: pretty; }
.rc-lead.long { font-size: 24px; line-height: 1.3; letter-spacing: -0.02em; } /* une ouverture longue ne garde pas la taille d'une phrase */
.rc-col > .rc-lead + * { margin-top: 32px; }
.rc-p { font-size: 16px; line-height: 1.62; color: var(--ink); text-wrap: pretty; }
.rc-h { margin-top: 56px !important; font-family: "Geist Mono", monospace; font-weight: 400; font-size: 11px; letter-spacing: .08em; text-transform: uppercase; color: var(--sub); }
.rc-h + * { margin-top: 16px !important; }
.rc-codewrap { position: relative; }
.rc-codewrap::after { content: ""; position: absolute; top: 0; right: 0; bottom: 0; width: 48px; border-radius: 0 6px 6px 0; pointer-events: none;
  background: linear-gradient(90deg, transparent, var(--empty)); opacity: 0; transition: opacity .2s; }
.rc-codewrap.more::after { opacity: 1; }
.rc-code:focus-visible { outline: 1.5px solid var(--ink); outline-offset: 2px; }
.rc-code { padding: 16px 20px; border-radius: 6px; background: var(--empty); overflow-x: auto; font-family: "Geist Mono", monospace; font-size: 12.5px; line-height: 1.6; color: var(--ink); white-space: pre; scrollbar-width: none; }

/* Schéma dans le fil : dessin centré, légende juste dessous */
.rc-fig { margin: 36px 0 !important; display: flex; flex-direction: column; align-items: center; }
.rc-fig canvas { width: 360px; max-width: 100%; aspect-ratio: 1; margin: -20px 0; } /* le cadre carré a du vide en haut et en bas : on le resserre */
.rc-fig img { display: block; max-width: 100%; height: auto; }
html[data-theme="nuit"] .rc-fig img { filter: invert(1); } /* schémas exportés de Figma : encre claire sur fond sombre */
.rc-fig figcaption { margin-top: 10px; max-width: 400px; text-align: center; font-size: 13px; line-height: 1.4; color: var(--sub); text-wrap: balance; }
.rc-back { display: inline-block; margin-top: 56px !important; font-size: 13px; color: var(--ink); transition: opacity .2s; }

/* Sommaire des chapitres, à droite : au repos, rien que des traits ; au survol, le panneau apparaît d'un bloc par-dessus (même papier et même liseré que le panneau Texte) */
.rc-toc { position: absolute; z-index: 4; right: 40px; top: calc(124px + (100% - 314px) / 2); transform: translateY(-50%); opacity: 0; visibility: hidden; transition: opacity .3s var(--out), visibility 0s .3s; }
.rc-toc { display: block; padding: 0; border-radius: 0; background: none; } /* ce n'est pas la pilule du header : on neutralise la règle générale de nav */
html.recit-on .rc-toc.on { opacity: 1; visibility: visible; transition: opacity .45s var(--out) .2s, visibility 0s; }
.rc-toc ul { list-style: none; margin: 0; padding: 0; }
.rc-bars { display: flex; flex-direction: column; align-items: flex-end; gap: 10px; padding: 12px 0 12px 24px; transition: opacity .15s; } /* marge à gauche : la zone de survol déborde des traits */
.rc-bars li { width: 12px; height: 2px; border-radius: 1px; background: var(--ink); opacity: .2; transition: width .3s var(--out), opacity .3s; }
.rc-bars li.on { width: 20px; opacity: 1; }
.rc-panel { position: absolute; right: -10px; top: 50%; width: 224px; padding: 6px; background: var(--paper); border: 1px solid var(--line); border-radius: 12px;
  transform: translate(6px, -50%); transform-origin: right center; opacity: 0; visibility: hidden; transition: opacity .15s, transform .2s var(--out), visibility 0s .2s; }
.rc-panel a { display: block; padding: 6px 10px; border-radius: 7px; font-size: 13px; line-height: 1.3; color: var(--sub); transition: color .15s, background-color .15s; }
.rc-panel a:hover { color: var(--ink); background: var(--empty); }
.rc-panel li.on a { color: var(--ink); }
.rc-toc:hover .rc-panel, .rc-toc:has(:focus-visible) .rc-panel { opacity: 1; visibility: visible; transform: translate(0, -50%); transition: opacity .2s var(--out), transform .25s var(--out), visibility 0s; }
.rc-toc:hover .rc-bars, .rc-toc:has(:focus-visible) .rc-bars { opacity: 0; }
@media (max-width: 860px), (max-height: 520px) { .rc-toc { display: none; } } /* au-dessus, la marge à droite de la colonne suffit aux traits */

/* CV : rubriques, intitulé mono à gauche, entrées à droite ; seulement le contenu */
.cv { padding-top: 8px; }
.cv-sec { display: grid; grid-template-columns: 160px 1fr; gap: 0 24px; }
.cv-sec + .cv-sec { margin-top: 48px; }
.cv-label { font-family: "Geist Mono", monospace; font-weight: 400; font-size: 11px; letter-spacing: .08em; text-transform: uppercase; color: var(--sub); padding-top: 3px; }
.cv-row + .cv-row { margin-top: 22px; }
.cv-top { display: flex; justify-content: space-between; gap: 16px; font-size: 14px; font-weight: 500; line-height: 1.4; color: var(--ink); }
.cv-meta { font-weight: 400; color: var(--sub); white-space: nowrap; }
.cv-text { margin-top: 4px; font-size: 14px; line-height: 1.6; color: var(--ink); text-wrap: pretty; }

@media (max-width: 820px), (max-height: 520px) {
  .cv-sec { grid-template-columns: 1fr; gap: 12px; }
  .recit { top: 96px; bottom: 0; }
  .rc-up { top: 72px; left: 16px; }
  .rc-col > .folders { margin-top: 48px !important; } /* mobile : les dossiers ferment l'article au lieu de rester fixés en bas (projets.js) */
  .rc-col { padding: 24px 16px 96px; }
  .rc-lead { font-size: 24px; } .rc-lead.long { font-size: 20px; }
  .rc-code { padding: 14px 16px; font-size: 12px; }
  .cv-top { flex-direction: column; gap: 2px; } /* l'intitulé et la période ne se disputent plus une ligne étroite */
}
@media (prefers-reduced-motion: reduce) { .recit, .hero, .aside { transition: none !important; } }
@media (pointer: coarse) { /* au doigt : zone de toucher agrandie, dessin inchangé */
  .rc-up::after, .rc-back::after { content: ""; position: absolute; inset: -12px -8px; }
}
