/* VOICE   savante et nocturne : une planche d'astronomie gravée
   IDEA    le Soleil, c'est l'origine ; il porte la longueur de la chaîne
           que l'on tape. Il dépasse en bas de l'accueil, glisse jusqu'au
           centre de la carte, puis le système se dévoile ; le défilement
           passe d'un livre à l'autre, le geste de côté d'une pièce à l'autre
   PICTURE une carte céleste dessinée en traits : cercle gradué au degré,
           douze maisons, rayons droits et ondulés, hachures, rose des vents ;
           un ciel étoilé sous toute la page ; une constellation par section
   COLOUR  nuit #0e0c0b, vélin #ebe4cf, or #c9a45c (le Soleil, la sélection)
   TYPE    IM Fell English (fontes de Fell, XVIIe siècle), petites capitales
           IM Fell English SC ; code JetBrains Mono
   SHAPE   cercles, arcs et coins arrondis (24 px) : pas d'angles droits
   LAYOUT  accueil centré sur la mesure ; puis une scène fixe (carte et
           fiche) pendant que la page défile ; puis les sections ; la planche
           en bannière ; le code s'ouvre dans un panneau */

[data-da="04"] { background: #0e0c0b; color: #ebe4cf; }
/* le fond reste sur html seul : le ciel fixe passe sous le reste de la page */
/* pas de barre de défilement à droite */
[data-da="04"] { scrollbar-width: none; }
[data-da="04"]::-webkit-scrollbar { display: none; }
[data-da="04"]:has(dialog.cv[open]) { overflow: hidden; }
.da04 {
	--night: #0e0c0b; --vellum: #ebe4cf; --gold: #c9a45c; --dim: #9d9584; --line: rgb(235 228 207 / .15);
	--radius: 24px;
	font: 400 19px/1.55 "IM Fell English", Georgia, serif;
	color: var(--vellum);
}
.da04 ::selection { background: var(--gold); color: var(--night); }
.da04 a { text-underline-offset: 4px; text-decoration-thickness: 1px; }

/* ---- Le ciel de toute la page ---- */
.d4-field-wrap { position: fixed; inset: 0 0 auto; height: 100lvh; z-index: -1; pointer-events: none; }
.d4-field { width: 100%; height: 100%; }
.d4-field .f-band { fill: rgb(235 228 207 / .22); }
.d4-field .f-faint { fill: rgb(235 228 207 / .38); }
.d4-field .f-mid { fill: rgb(235 228 207 / .7); }
.d4-field .f-big { fill: rgb(235 228 207 / .85); }

/* ---- 1. L'accueil ---- */
.d4-hero { --sun0: clamp(220px, 30vw, 360px); position: relative; display: grid; grid-template-rows: 1fr auto; justify-items: center; min-height: 100svh; padding: 6svh 16px calc(var(--sun0) * .36 + 6px); overflow: clip; }
.d4-hero-in { position: relative; align-self: center; display: grid; justify-items: center; gap: 10px; width: min(100%, 760px); text-align: center; }
.d4-h1 { font: 400 clamp(84px, 13vw, 176px)/.85 "IM Fell English", Georgia, serif; letter-spacing: -.015em; }
.d4-sub { font-size: clamp(19px, 1.8vw, 24px); font-style: italic; line-height: 1.4; max-width: 26em; color: #d9d1bd; }
.d4-measure { width: 100%; margin-top: clamp(20px, 4svh, 44px); }
.d4-hero .measure { justify-items: center; gap: 12px; }
.d4-hero .m-label { font-size: 18px; font-style: italic; color: var(--dim); }
.d4-hero .m-input { max-width: 620px; text-align: center; font: 400 clamp(32px, 4vw, 48px)/1.15 "IM Fell English", Georgia, serif; border-bottom-color: rgb(235 228 207 / .35); }
.d4-hero .m-input:focus { border-bottom-color: var(--gold); }
.d4-hero .m-out { justify-content: center; text-align: center; }
.d4-hero .m-num { font: 400 clamp(72px, 9vw, 112px)/.95 "IM Fell English", Georgia, serif; color: var(--gold); }
.d4-hero .m-unit { font-size: clamp(22px, 2.2vw, 28px); font-style: italic; }
.d4-hero .m-detail { flex-basis: 100%; font-size: 16px; font-style: italic; color: var(--dim); }
.d4-hero .m-track { width: 100%; }
/* une longue chaîne : le texte rapetisse, le champ s'arrête à quatre lignes */
.d4-measure.is-long .m-input { font-size: clamp(20px, 2.1vw, 26px); line-height: 1.35; }
.d4-hero .m-input { max-height: calc(4 * 1.35em + 14px); overflow-y: auto; overscroll-behavior: contain; scrollbar-width: none; overflow-wrap: anywhere; }
.d4-hero .m-input::-webkit-scrollbar { display: none; }
/* quand le texte dépasse, le bas s'efface au lieu d'une barre */
.d4-measure.is-long .m-input { -webkit-mask-image: linear-gradient(#000 calc(100% - 1.6em), transparent calc(100% - 4px), #000 calc(100% - 3px)); mask-image: linear-gradient(#000 calc(100% - 1.6em), transparent calc(100% - 4px), #000 calc(100% - 3px)); }
.d4-measure.is-long .m-input:focus { -webkit-mask-image: none; mask-image: none; }
/* sous « Falofi », un clin d'œil */
.d4-goat { margin: 8px 0 0; text-align: center; font: italic 400 clamp(15px, 1.4vw, 18px)/1.2 "IM Fell English", Georgia, serif; color: var(--gold); letter-spacing: .04em; opacity: 0; transform: translateY(-4px); transition: opacity .5s, transform .5s; pointer-events: none; }
.d4-goat.is-on { opacity: .9; transform: none; }
.d4-hero .m-cells { margin: 0 auto; }
.d4-down { position: relative; min-height: 44px; padding: 8px 12px; background: none; border: 0; font-size: 17px; font-style: italic; color: var(--dim); text-decoration: underline; text-underline-offset: 5px; text-decoration-thickness: 1px; }
.d4-down:hover { color: var(--vellum); }
/* la place du Soleil à l'accueil : son centre est juste sous le bas de l'écran */
.d4-sun-anchor { position: absolute; left: 50%; bottom: 0; width: var(--sun0); aspect-ratio: 1; transform: translate(-50%, 64%); visibility: hidden; pointer-events: none; }
/* le Soleil qui voyage, placé dans la page */
.d4-fly { position: absolute; left: 0; top: 0; z-index: 6; width: 0; height: 0; padding: 0; background: none; border: 0; border-radius: 50%; transform-origin: 50% 50%; will-change: transform; cursor: pointer; }
.d4-fly svg { width: 100%; height: 100%; overflow: visible; }
.d4-fly:focus-visible { outline: 1px solid var(--gold); outline-offset: 4px; }

/* les cases de la mesure */
.da04 .m-cell { min-width: 32px; padding: 4px 5px; border-left: 1px solid var(--line); border-radius: 6px; color: #5d574c; transition: color .25s; }
.da04 .m-cell b { font-size: 20px; line-height: 1.2; min-height: 1.2em; }
.da04 .m-cell i { font: 300 10px/1 "JetBrains Mono", monospace; }
.da04 .m-cell.is-past { color: var(--vellum); }
.da04 .m-cell.is-past i { color: var(--dim); }
.da04 .m-cell.is-nul { color: var(--gold); }
.da04 .m-cell.is-str { color: var(--night); background: var(--vellum); border-left-color: transparent; }
.da04 .m-cell.is-nul.is-str { background: var(--gold); }
.da04 .m-cell.is-str i { color: inherit; }

/* ---- 2. Le système : une scène fixe pendant le défilement ---- */
.d4-system { position: relative; height: calc(100svh + var(--units) * 50svh); }
/* au doigt, le système est plus court : moins de chemin entre deux livres */
@media (max-width: 899px) {
	.d4-system { height: calc(100svh + var(--units) * 34svh); }
}
.d4-stage { position: sticky; top: 0; height: 100svh; display: grid; align-content: start; justify-items: center; gap: 10px; padding: 8px 16px 12px; overflow: hidden; touch-action: pan-y; }
.d4-stage-chart { width: min(100%, calc(100svh - 430px)); min-width: min(100%, 230px); overflow: hidden; }
.d4-chart { position: relative; width: 100%; aspect-ratio: 1; border-radius: 50%; }
.d4-chart:focus-visible { outline: 1px solid var(--gold); outline-offset: 4px; }
.d4-chart > *, .d4-zoom > * { position: absolute; inset: 0; width: 100%; height: 100%; }
.d4-zoom, .d4-l-rot { transform-origin: 50% 50%; will-change: transform; }
.d4-svg { display: block; overflow: visible; -webkit-user-select: none; user-select: none; }
.d4-l-sky, .d4-l-lb, .d4-l-front, .d4-l-pl, .d4-l-sun { pointer-events: none; }
/* le ciel de la carte s'efface vers les coins : on ne voit plus le carré */
.d4-l-sky { -webkit-mask-image: radial-gradient(circle at 50% 50%, #000 66%, transparent 98%); mask-image: radial-gradient(circle at 50% 50%, #000 66%, transparent 98%); }
.d4-l-pl .pl, .d4-l-sun .sun { pointer-events: auto; }

.d4-card { width: 100%; max-width: 440px; display: grid; gap: 10px; align-content: start; }
.d4-card-book { display: flex; align-items: center; gap: 12px; }
.d4-tabs { display: flex; gap: 4px; flex: none; }
.d4-tab { width: 34px; height: 34px; padding: 0; background: none; border: 1px solid var(--line); border-radius: 50%; font: 400 14px/1 "IM Fell English SC", Georgia, serif; color: var(--dim); transition: border-color .2s, color .2s; }
.d4-tab:hover { color: var(--vellum); border-color: rgb(235 228 207 / .4); }
.d4-tab[aria-current="true"] { color: var(--gold); border-color: var(--gold); }
.d4-book-name { font: 400 17px/1.2 "IM Fell English SC", Georgia, serif; letter-spacing: .03em; }
.d4-book-desc { display: none; font-size: 15px; line-height: 1.3; font-style: italic; color: var(--dim); }
.d4-book-stat { display: none; margin-top: 2px; font: 300 12px/1.4 "JetBrains Mono", monospace; color: var(--dim); }
.d4-rail { display: flex; padding: 4px; border: 1px solid var(--line); border-radius: 999px; }
.d4-rail li { flex: 1 1 0; }
.d4-rail button { display: grid; justify-items: center; gap: 3px; width: 100%; min-height: 46px; padding: 6px 0 5px; background: none; border: 0; border-radius: 999px; font: 400 11px/1 "IM Fell English SC", Georgia, serif; color: var(--dim); transition: color .2s, background-color .2s; }
.d4-rail button:hover { color: var(--vellum); }
.d4-rail button[aria-current="true"] { color: var(--gold); background: rgb(201 164 92 / .12); }
.d4-rail .d4-glyph { width: 16px; height: 16px; }
.d4-card-piece { display: grid; gap: 4px; }
.d4-card-n { font: 400 15px/1.2 "IM Fell English SC", Georgia, serif; letter-spacing: .03em; color: var(--gold); }
.d4-card-t { font: 400 clamp(25px, 2.5vw, 36px)/1.05 "IM Fell English", Georgia, serif; }
.d4-card-a { margin-top: 2px; font-size: clamp(16px, 1.3vw, 19px); line-height: 1.4; color: #d6cfbb; display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 3; overflow: hidden; padding-bottom: 3px; }
.d4-card-f { font: 300 12px/1.5 "JetBrains Mono", monospace; color: var(--dim); overflow-wrap: anywhere; }
/* « Uniquement sous Linux » : un petit cartouche doré */
.d4-card-os { justify-self: start; padding: 2px 10px; border: 1px solid rgb(201 164 92 / .5); border-radius: 999px; font: italic 400 14px/1.4 "IM Fell English", Georgia, serif; color: var(--gold); }
.d4-card-os[hidden] { display: none; }
.d4-card-nav { display: flex; align-items: center; gap: 12px; }
.d4-step { flex: none; width: 44px; height: 44px; padding: 0; background: none; border: 1px solid rgb(235 228 207 / .35); border-radius: 50%; font-size: 18px; transition: border-color .2s, color .2s; }
.d4-step:hover:not(:disabled) { border-color: var(--gold); color: var(--gold); }
.d4-step:disabled { opacity: .3; cursor: default; }
.d4-read { min-height: 44px; padding: 0 20px; background: none; border: 1px solid rgb(235 228 207 / .35); border-radius: 999px; font-size: 18px; transition: border-color .2s, color .2s; }
.d4-read:hover { color: var(--gold); border-color: var(--gold); }
.d4-hint { display: none; margin-top: 6px; padding-top: 12px; border-top: 1px solid var(--line); font-size: 15px; line-height: 1.45; font-style: italic; color: var(--dim); }

/* au téléphone : la carte et la fiche, centrées dans l'écran, sous le bouton de langue */
@media (max-width: 899px) {
	/* la carte prend toute la largeur ; la fiche se resserre en dessous */
	.d4-stage { align-content: center; gap: 8px; padding: 6px 8px 10px; }
	.d4-stage-chart { width: min(100%, calc(100svh - 300px)); }
	.d4-card { max-width: 560px; gap: 7px; padding: 0 8px; }
	.d4-tab { width: 32px; height: 32px; }
	.d4-rail button { min-height: 40px; padding: 4px 0; }
	.d4-card-t { font-size: 25px; }
	.d4-card-a { font-size: 16px; -webkit-line-clamp: 2; }
	.d4-card-f { font-size: 11px; }
	.d4-card-os { font-size: 13px; padding: 1px 8px; }
	.d4-step { width: 40px; height: 40px; }
	.d4-read { min-height: 40px; font-size: 17px; }
}
@media (min-width: 900px) {
	.d4-stage { grid-template-columns: auto minmax(320px, 420px); align-content: center; align-items: center; justify-content: center; gap: 4vw; padding: 24px 4vw; }
	.d4-stage-chart { width: min(calc(100svh - 64px), calc(100vw - 8vw - 480px)); min-width: 380px; }
	.d4-card { gap: 14px; }
	.d4-book-desc, .d4-book-stat, .d4-hint { display: block; }
	.d4-card-a { -webkit-line-clamp: 5; }
}

/* ---- La carte ---- */
.d4-svg text { font-family: "IM Fell English SC", "IM Fell English", Georgia, serif; fill: var(--vellum); text-anchor: middle; dominant-baseline: central; }
.d4-svg .hl { stroke: var(--vellum); stroke-width: .7; }
.d4-svg .st { fill: rgb(235 228 207 / .7); }
.d4-svg .dust { fill: rgb(235 228 207 / .35); }
.d4-svg .cn { fill: none; stroke: rgb(235 228 207 / .35); stroke-width: .7; stroke-dasharray: 2 3; }
.d4-svg .cs { fill: var(--vellum); }
.d4-svg .rose .thin { fill: none; stroke: rgb(235 228 207 / .45); stroke-width: .7; }
.d4-svg .lit, .d4-glyph .lit { fill: var(--vellum); }
.d4-svg .hat, .d4-glyph .hat { fill: url(#d4-hatch); }
.d4-svg .rose .hat { stroke: var(--vellum); stroke-width: .6; }
.d4-svg .rose-n { font-size: 13px; fill: var(--dim); }
.d4-svg .ring { fill: none; stroke: var(--vellum); stroke-width: .7; }
.d4-svg .ring.is-bold { stroke-width: 1.4; }
.d4-svg .ring.is-thin { stroke-width: .4; stroke: rgb(235 228 207 / .5); }
.d4-svg .tick { fill: none; stroke: var(--vellum); stroke-width: .6; }
.d4-svg .house { fill: var(--dim); letter-spacing: .04em; }
.d4-svg .orb { fill: none; stroke: rgb(235 228 207 / .2); stroke-width: .6; }
.d4-svg .orb.is-dot { stroke: rgb(235 228 207 / .4); stroke-dasharray: 1 3; }
.d4-svg .orb.is-sel { stroke: var(--gold); stroke-width: .9; stroke-dasharray: none; }
.d4-svg .alid { stroke: var(--gold); stroke-width: .8; stroke-dasharray: 2 3; }
.d4-svg .alid-t { fill: var(--gold); }
.d4-svg .ray-s { fill: var(--gold); }
.d4-svg .ray-w { fill: none; stroke: var(--gold); stroke-width: .8; }
.d4-svg .sun-d { fill: var(--night); stroke: var(--gold); stroke-width: 1.4; }
.d4-svg .sun-i { fill: none; stroke: var(--gold); stroke-width: .5; }
.d4-svg .sun-n { font-family: "IM Fell English", Georgia, serif; fill: var(--gold); }
.d4-svg .sun.is-sel .sun-d { stroke-width: 2.4; }
.d4-svg .hit { fill: transparent; cursor: pointer; }
.d4-svg .sun, .d4-svg .pl { cursor: pointer; }
.d4-svg .edge, .d4-glyph .edge { fill: none; stroke: var(--vellum); stroke-width: .8; }
.d4-svg .ringp { fill: none; stroke: var(--vellum); stroke-width: .8; }
.d4-svg .halo { fill: var(--night); stroke: none; }
.d4-svg .pl-n { fill: var(--dim); }
.d4-svg .pl-n.is-sel { fill: var(--gold); }
.d4-svg .pl-n.is-off { opacity: .35; }
.d4-l-lb.is-small .pl-n.is-off { display: none; }
.d4-svg .pl.is-sel .halo { stroke: var(--gold); stroke-width: 1.2; }
.d4-svg .pl.is-off { opacity: .3; }
.d4-svg .pl.is-off:hover { opacity: .8; }
.d4-svg .pl:hover .edge { stroke: var(--gold); }
.d4-svg .arc { fill: none; stroke: rgb(235 228 207 / .4); stroke-width: .7; }
.d4-svg .byte { fill: var(--vellum); }
.d4-svg .nul { fill: var(--night); stroke: var(--gold); stroke-width: 1.2; }
.d4-svg .front { fill: none; stroke: var(--gold); stroke-width: 1; }

/* petits astres des listes */
.d4-glyph { width: 20px; height: 20px; overflow: visible; }
.d4-glyph .sun-g { fill: var(--night); stroke: var(--gold); stroke-width: 1.2; }
.d4-glyph .sun-r { fill: none; stroke: var(--gold); stroke-width: .9; }

/* ---- Sections : chacune sous sa constellation ---- */
.d4-sec { display: grid; gap: 26px 5vw; max-width: 1240px; margin: 0 auto; padding: 16vh max(16px, 5vw) 0; }
@media (min-width: 900px) { .d4-sec { grid-template-columns: minmax(0, 4fr) minmax(0, 8fr); } }
.d4-sec-head { display: grid; gap: 10px; align-content: start; }
/* la grande constellation : un calque sous les sections */
.d4-after { position: relative; }
.d4-after > .d4-sec { position: relative; z-index: 1; }
.d4-walk { position: absolute; left: 0; top: 0; z-index: 0; pointer-events: none; overflow: visible; }
.d4-walk .w-l { fill: none; stroke: rgb(235 228 207 / .4); stroke-width: .8; stroke-dasharray: 2 3; }
.d4-walk .w-s { fill: rgb(235 228 207 / .75); }
.d4-walk .w-m { fill: var(--vellum); }
.d4-walk .w-g { fill: var(--gold); }
.d4-walk .w-dust { fill: rgb(235 228 207 / .3); }
.d4-node { width: min(260px, 72%); height: 110px; margin-bottom: 6px; }
.d4-bookfig .fig-l { fill: none; stroke: rgb(235 228 207 / .42); stroke-width: .8; stroke-dasharray: 2 3; }
.d4-bookfig .fig-dust { fill: rgb(235 228 207 / .35); }
.d4-h2 { font: 400 clamp(32px, 3.6vw, 50px)/1.06 "IM Fell English", Georgia, serif; }
.d4-lead { font-size: clamp(20px, 1.7vw, 24px); line-height: 1.45; }
.d4-muted { color: var(--dim); }
.d4-kicker { font: 400 16px/1.2 "IM Fell English SC", Georgia, serif; letter-spacing: .05em; color: var(--gold); }
.d4-pill { justify-self: start; min-height: 46px; padding: 0 24px; background: none; border: 1px solid rgb(235 228 207 / .35); border-radius: 999px; font-size: 18px; transition: border-color .2s, color .2s; }
.d4-pill:hover { border-color: var(--gold); color: var(--gold); }

/* Présentation : le propos, puis les trois livres en médaillons */
.d4-about-body { display: grid; gap: 22px; align-content: start; }
.d4-about-text { display: grid; gap: 16px; font-size: clamp(20px, 1.7vw, 24px); line-height: 1.5; max-width: 36em; }
.d4-about-body .d4-kicker { margin-top: 16px; }
.d4-medals { display: grid; gap: 16px; }
@media (min-width: 640px) { .d4-medals { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
/* au téléphone, les trois livres tiennent sur une ligne : l'arche, le chiffre, le nom */
@media (max-width: 639px) {
	.d4-medals { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
	.d4-medal { gap: 4px; padding: 16px 4px 14px; }
	.d4-medal-r { width: 42px; height: 42px; font-size: 16px; }
	.d4-medal-t { font-size: 17px; }
	.d4-medal-d, .d4-medal-s { display: none; }
}
.d4-medal { display: grid; justify-items: center; align-content: start; gap: 8px; width: 100%; height: 100%; padding: 26px 18px 24px; text-align: center; background: rgb(235 228 207 / .025); border: 1px solid var(--line); border-radius: 999px 999px var(--radius) var(--radius); transition: border-color .25s, background-color .25s; }
.d4-medal:hover { border-color: rgb(201 164 92 / .7); background: rgb(201 164 92 / .06); }
.d4-medal-r { display: grid; place-items: center; width: 58px; height: 58px; margin-bottom: 4px; border: 1px solid var(--gold); border-radius: 50%; box-shadow: 0 0 0 4px var(--night), 0 0 0 5px rgb(201 164 92 / .45); font: 400 20px/1 "IM Fell English SC", Georgia, serif; color: var(--gold); }
.d4-medal-t { font-size: 24px; line-height: 1.15; }
.d4-medal-d { font-size: 16px; line-height: 1.4; font-style: italic; color: var(--dim); }
.d4-medal-s { margin-top: 4px; font: 300 12px/1.4 "JetBrains Mono", monospace; color: var(--dim); }

/* Le Soleil : le texte, les faits, le code sur une plaque ronde aux angles */
.d4-origin-body { display: grid; gap: 28px 4vw; align-items: start; }
.d4-origin { grid-template-columns: minmax(0, 1fr) !important; }
/* « Celui qui a tout commencé » au milieu : la constellation y fait un détour */
.d4-origin .d4-sec-head { justify-items: center; text-align: center; }
@media (min-width: 900px) {
	.d4-origin-body { grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); }
}
.d4-origin-text { display: grid; gap: 18px; align-content: start; }
.d4-facts { display: grid; }
.d4-facts div { display: grid; grid-template-columns: 8.5em minmax(0, 1fr); gap: 12px; align-items: baseline; padding: 9px 0; border-top: 1px solid var(--line); }
.d4-facts div:last-child { border-bottom: 1px solid var(--line); }
.d4-facts dt { font-size: 16px; font-style: italic; color: var(--dim); }
.d4-facts dd { font-size: 17px; }
.d4-facts .is-mono { font: 300 14px/1.4 "JetBrains Mono", monospace; overflow-wrap: anywhere; }
.d4-origin-plate {
	position: relative; overflow: hidden;
	padding: clamp(22px, 3vw, 40px) clamp(18px, 3vw, 40px);
	border: 1px solid rgb(235 228 207 / .22); border-radius: var(--radius);
	background:
		radial-gradient(circle at 100% 0, transparent 0 119px, rgb(201 164 92 / .22) 120px 121px, transparent 122px 179px, rgb(235 228 207 / .09) 180px 181px, transparent 182px 249px, rgb(235 228 207 / .06) 250px 251px, transparent 252px),
		rgb(10 9 8 / .72);
}
.d4-origin-code { margin: 0; overflow-x: auto; scrollbar-width: thin; scrollbar-color: #4a453c transparent; tab-size: 4; -moz-tab-size: 4; white-space: pre; font: 300 clamp(14px, 1.45vw, 18px)/1.8 "JetBrains Mono", monospace; font-variant-ligatures: none; color: #e2dac4; }
.d4-origin-code code { font: inherit; }
.d4-ln { display: inline-block; width: 2.4em; color: #5d574c; -webkit-user-select: none; user-select: none; }
.d4-line.is-gap { color: var(--gold); font-weight: 400; }
.d4-gapnote { display: block; padding: 2px 0 4px 3.4em; white-space: normal; font: italic 400 1.02em/1.3 "IM Fell English", Georgia, serif; color: var(--gold); }
.da04 .c-kw { color: #fff; font-weight: 400; }
.da04 .c-com { color: #857e6f; font-style: italic; }
.da04 .c-str { color: #d9c08a; }
.da04 .c-pre, .da04 .c-num { color: #b0a790; }

/* Le tour de magie : la pièce à part. Une étoile d'or au lieu d'une planète,
 * et un bout de papier qui annonce la longueur de la chaîne tapée en haut. */
@keyframes d4-twinkle { 0%, 100% { opacity: 1; transform: scale(1); } 50% { opacity: .55; transform: scale(.82); } }
.d4-svg .magic-s, .d4-glyph .magic-s, .d4-bookfig .bf-magic { fill: var(--gold); transform-box: fill-box; transform-origin: center; animation: d4-twinkle 3.2s ease-in-out infinite; }
.d4-svg .orb.is-magic { stroke: rgb(201 164 92 / .55); stroke-width: .7; stroke-dasharray: 1 4; }
.d4-svg .pl-n.is-magic { fill: var(--gold); }
.d4-svg .pl.is-magic.is-sel .halo { stroke: var(--gold); }
.d4-stage.is-magic .d4-card-t { color: var(--gold); font-style: italic; }
.d4-index button.is-magic .d4-i-t { color: var(--gold); font-style: italic; }
.cv.is-magic .cv-t { color: var(--gold); font-style: italic; }
.cv.is-magic .cv-note { padding: 4px 0 4px 18px; border-left: 2px solid rgb(201 164 92 / .6); font: italic 400 clamp(19px, 1.6vw, 22px)/1.55 "IM Fell English", Georgia, serif; color: #e8dfc6; }
.cv-links a[hidden] { display: none; }

.d4-magic { grid-template-columns: minmax(0, 1fr) !important; }
.d4-magic .d4-sec-head { justify-items: center; text-align: center; }
.d4-magic-body { display: grid; gap: 40px 5vw; align-items: center; }
@media (min-width: 900px) { .d4-magic-body { grid-template-columns: minmax(0, 7fr) minmax(0, 5fr); } }
.d4-magic-text { display: grid; gap: 18px; align-content: start; max-width: 38em; }
.d4-magic .d4-lead { color: var(--gold); }
.d4-magic-story { font: italic 400 clamp(19px, 1.6vw, 23px)/1.6 "IM Fell English", Georgia, serif; color: #e2dac4; }
.d4-paper { display: grid; justify-items: center; gap: 22px; margin: 0; }
.d4-paper-sheet {
	position: relative; display: grid; place-items: center;
	width: min(250px, 62vw); aspect-ratio: 4 / 3;
	background: linear-gradient(135deg, #efe6cc 0%, #e4d8b6 60%, #d9cba4 100%);
	border-radius: 3px 3px 3px 26px;
	box-shadow: 0 18px 40px rgb(0 0 0 / .55), 0 0 0 1px rgb(201 164 92 / .3), 0 0 60px rgb(201 164 92 / .16);
	transform: rotate(-5deg);
	transition: transform .5s;
}
.d4-paper-sheet::before { content: ""; position: absolute; inset: 14px 18px auto; height: 1px; background: rgb(60 50 30 / .18); box-shadow: 0 22px 0 rgb(60 50 30 / .12), 0 44px 0 rgb(60 50 30 / .12), 0 66px 0 rgb(60 50 30 / .12), 0 88px 0 rgb(60 50 30 / .12), 0 110px 0 rgb(60 50 30 / .12), 0 132px 0 rgb(60 50 30 / .12); }
.d4-paper-sheet::after { content: ""; position: absolute; left: 0; bottom: 0; width: 26px; height: 26px; background: linear-gradient(45deg, var(--night) 50%, #c9b98f 50%); border-radius: 0 0 0 26px; }
.d4-paper:hover .d4-paper-sheet { transform: rotate(-2deg) translateY(-4px); }
.d4-paper-n { position: relative; font: italic 400 clamp(64px, 7vw, 92px)/1 "IM Fell English", Georgia, serif; color: #2b2214; transform: rotate(3deg); }
.d4-paper-s { max-width: 22em; text-align: center; font: italic 400 17px/1.45 "IM Fell English", Georgia, serif; color: var(--dim); overflow-wrap: anywhere; }

/* Les vingt-cinq : trois constellations, et leur liste */
.d4-all { grid-template-columns: minmax(0, 1fr) !important; }
.d4-index { display: grid; gap: 22px; }
@media (min-width: 900px) { .d4-index { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.d4-book { display: grid; align-content: start; gap: 14px; padding: 18px clamp(14px, 1.6vw, 22px) 10px; background: rgb(235 228 207 / .022); border: 1px solid var(--line); border-radius: var(--radius); }
.d4-con { display: grid; gap: 4px; }
.d4-bookfig { width: 100%; height: auto; overflow: visible; }
.d4-bookfig .bf-s { fill: var(--vellum); transition: fill .2s; }
.d4-bookfig .bf-sun { fill: var(--night); stroke: var(--gold); stroke-width: 1.2; }
.d4-bookfig .bf-ray { fill: none; stroke: var(--gold); stroke-width: 1; }
.d4-bookfig .bf-n { font: 400 11px "IM Fell English SC", Georgia, serif; fill: var(--dim); text-anchor: middle; dominant-baseline: central; }
.d4-bookfig .hit { fill: transparent; }
.d4-bookfig .bf-star { cursor: pointer; outline: none; }
.d4-bookfig .bf-star:hover .bf-s, .d4-bookfig .bf-star:focus-visible .bf-s { fill: var(--gold); }
.d4-bookfig .bf-star:hover .bf-n, .d4-bookfig .bf-star:focus-visible .bf-n { fill: var(--vellum); }
.d4-bookfig .bf-star:focus-visible .hit { stroke: var(--gold); stroke-width: 1; }
.d4-con-cap { min-height: 2.9em; font-size: 15px; line-height: 1.4; font-style: italic; text-align: center; color: var(--dim); }
.d4-con-cap.is-on { color: var(--vellum); }
.d4-book-h { display: grid; gap: 2px; padding-bottom: 10px; border-bottom: 1px solid rgb(235 228 207 / .4); }
.d4-book-h span { font: 400 21px/1.2 "IM Fell English SC", Georgia, serif; letter-spacing: .03em; }
.d4-book-h small { font-size: 16px; font-style: italic; color: var(--dim); }
.d4-index li:last-child button { border-bottom: 0; }
.d4-index button[data-i] { display: grid; grid-template-columns: 20px 3.2em minmax(0, 1fr) auto; gap: 10px; align-items: center; width: 100%; min-height: 44px; padding: 8px 8px; text-align: left; background: none; border: 0; border-bottom: 1px solid var(--line); border-radius: 12px; transition: background-color .2s; }
.d4-index button[data-i]:hover { background: rgb(235 228 207 / .05); }
.d4-index button[data-i]:hover .d4-i-t { text-decoration: underline; text-underline-offset: 4px; text-decoration-thickness: 1px; }
.d4-i-n { font: 400 15px/1 "IM Fell English SC", Georgia, serif; color: var(--gold); }
.d4-i-t { font-size: 19px; line-height: 1.25; }
.d4-i-s { font: 300 12px/1 "JetBrains Mono", monospace; color: var(--dim); font-variant-numeric: tabular-nums; }

/* ---- Contact ---- */
.d4-contact-body { display: grid; gap: 24px; align-content: start; }
.d4-ideas { display: grid; gap: 10px; max-width: 40em; padding: 22px 26px 24px; border: 1px solid rgb(201 164 92 / .45); border-radius: var(--radius); background: radial-gradient(circle at 100% 0, rgb(201 164 92 / .12), transparent 60%), rgb(235 228 207 / .02); }
.d4-ideas-t { font: italic 400 clamp(19px, 1.6vw, 22px)/1.5 "IM Fell English", Georgia, serif; color: #e2dac4; }
.d4-ideas-go { display: inline-flex; align-items: center; margin-top: 6px; border-color: rgb(201 164 92 / .6); color: var(--gold); text-decoration: none; }
.d4-ideas-go:hover { background: rgb(201 164 92 / .1); }
.d4-ways { display: grid; gap: 12px; max-width: 40em; }
.d4-way { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 18px; min-height: 64px; padding: 10px 12px 10px 26px; background: rgb(235 228 207 / .025); border: 1px solid var(--line); border-radius: 999px; }
.d4-way-k { min-width: 5.5em; font: 400 15px/1.2 "IM Fell English SC", Georgia, serif; letter-spacing: .04em; color: var(--gold); }
.d4-way-v { flex: 1; font-size: clamp(20px, 2vw, 26px); line-height: 1.2; overflow-wrap: anywhere; }
a.d4-way-v:hover { color: var(--gold); }
.d4-way-act { min-height: 42px; padding: 0 18px; background: none; border: 1px solid rgb(235 228 207 / .3); border-radius: 999px; font-size: 15px; font-style: italic; color: var(--dim); transition: border-color .2s, color .2s; }
.d4-way-act:hover { color: var(--vellum); border-color: var(--gold); }
@media (max-width: 599px) { .d4-way { border-radius: var(--radius); padding: 14px 16px; } }

/* ---- Le bas de page ----
 * La planche entière, sur toute la largeur, tout à la fin. Les mentions
 * légales et le copyright sont ancrés en bas à droite, posés dessus. Les
 * mentions s'ouvrent dans un panneau qui monte au-dessus d'eux. */
.d4-end { position: relative; display: flex; flex-direction: column; margin-top: 16vh; }
.d4-end-img { display: block; width: 100%; height: auto; aspect-ratio: 735 / 160; pointer-events: none;
	-webkit-mask-image: linear-gradient(to bottom, transparent, #000 18%); mask-image: linear-gradient(to bottom, transparent, #000 18%); }
.d4-end-in { position: absolute; right: max(14px, 2.5vw); bottom: clamp(6px, 1.2vw, 16px); display: grid; justify-items: end; gap: 0; text-align: right; text-shadow: 0 1px 8px #000, 0 0 3px #000, 0 0 1px #000; }
.d4-end-in .d4-legal summary { margin-left: auto; min-height: 36px; }
.d4-end-in .d4-legal-body { position: absolute; right: 0; bottom: calc(100% + 10px); z-index: 10; width: min(760px, calc(100vw - 28px)); max-height: min(70vh, 560px); margin: 0; overflow-y: auto; overscroll-behavior: contain; scrollbar-width: none; text-align: left; text-shadow: none; background: rgb(14 12 11 / .97); box-shadow: 0 18px 60px rgb(0 0 0 / .6); }
.d4-end-in .d4-legal-body::-webkit-scrollbar { display: none; }
@media (max-width: 640px) {
	/* sur un téléphone la planche est trop basse pour porter le texte : il passe juste au-dessus */
	.d4-end-in { position: relative; right: auto; bottom: auto; order: -1; padding: 0 16px 10px; }
	.d4-end-in .d4-legal-body { right: 16px; width: calc(100vw - 32px); }
}
.d4-legal summary { display: flex; align-items: center; gap: 10px; min-height: 44px; width: max-content; cursor: pointer; font-size: 17px; color: var(--vellum); list-style: none; }
.d4-legal summary::-webkit-details-marker { display: none; }
.d4-legal summary::before { content: "+"; display: inline-grid; place-items: center; width: 22px; height: 22px; border: 1px solid rgb(235 228 207 / .35); border-radius: 50%; font: 400 14px/1 "JetBrains Mono", monospace; }
.d4-legal[open] summary::before { content: "\2212"; }
.d4-legal summary:hover { color: var(--gold); }
.d4-legal-body { display: grid; gap: 22px 5vw; margin-top: 10px; padding: 24px clamp(18px, 3vw, 36px); font-size: 16px; line-height: 1.55; color: #cdc5b1; background: rgb(10 9 8 / .7); border: 1px solid var(--line); border-radius: var(--radius); }
@media (min-width: 900px) { .d4-legal-body { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.d4-legal h3 { margin-bottom: 6px; font: 400 15px/1.3 "IM Fell English SC", Georgia, serif; letter-spacing: .04em; color: var(--vellum); }
.d4-legal p + p { margin-top: 6px; }
.d4-colophon { margin: 0; font-size: 14px; color: #c7bea9; }

/* ---- Le panneau du code ---- */
.cv { box-sizing: border-box; width: min(1200px, calc(100vw - 40px)); height: min(calc(100svh - 40px), 940px); max-width: none; max-height: none; margin: auto; padding: 0; overflow: hidden; background: var(--night); color: var(--vellum); border: 1px solid rgb(235 228 207 / .4); border-radius: var(--radius); }
.cv[open] { display: grid; grid-template-rows: auto minmax(0, 1fr) auto; }
.cv::backdrop { background: rgb(6 5 4 / .82); -webkit-backdrop-filter: blur(3px); backdrop-filter: blur(3px); }
.cv-head { display: flex; justify-content: space-between; align-items: start; gap: 16px; padding: 22px clamp(18px, 3vw, 36px) 16px; border-bottom: 1px solid var(--line); }
.cv-n { font: 400 15px/1.3 "IM Fell English SC", Georgia, serif; letter-spacing: .03em; color: var(--gold); }
.cv-t { margin-top: 4px; font: 400 clamp(28px, 3vw, 42px)/1.05 "IM Fell English", Georgia, serif; }
.cv-f { margin-top: 6px; font: 300 13px/1.5 "JetBrains Mono", monospace; color: var(--dim); overflow-wrap: anywhere; }
.cv-close { flex: none; width: 44px; height: 44px; padding: 0 0 3px; background: none; border: 1px solid rgb(235 228 207 / .35); border-radius: 50%; font: 400 26px/1 Georgia, serif; transition: border-color .2s, color .2s; }
.cv-close:hover { border-color: var(--gold); color: var(--gold); }
.cv-body { display: grid; align-content: start; min-height: 0; overflow: auto; overscroll-behavior: contain; }
.cv-text { display: grid; gap: 14px; align-content: start; padding: 22px clamp(18px, 3vw, 36px); }
.cv-a { font-size: clamp(19px, 1.6vw, 22px); line-height: 1.45; }
.cv-note { font-size: 18px; line-height: 1.6; color: #cdc5b1; }
.cv-out { font-size: 17px; font-style: italic; color: var(--dim); }
.cv-os { padding: 8px 14px; border: 1px solid rgb(201 164 92 / .45); border-radius: 14px; font-size: 16px; line-height: 1.45; color: #e3d2a6; }
.cv-os[hidden] { display: none; }
.cv-links { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 4px; }
.cv-links button, .cv-links a { display: inline-flex; align-items: center; min-height: 42px; padding: 0 18px; background: none; border: 1px solid rgb(235 228 207 / .3); border-radius: 999px; font-size: 16px; text-decoration: none; transition: border-color .2s, color .2s; }
.cv-links button:hover, .cv-links a:hover { color: var(--gold); border-color: var(--gold); }
.cv-src { min-height: 0; background: #0a0908; border-top: 1px solid var(--line); }
.cv-scroll { display: flex; align-items: flex-start; min-width: 0; overflow-x: auto; padding: 18px 0 22px; font: 300 14px/1.65 "JetBrains Mono", monospace; scrollbar-color: #4a453c #0a0908; }
.cv-gutter { position: sticky; left: 0; z-index: 1; flex: none; margin: 0; padding: 0 12px 0 clamp(12px, 2vw, 22px); font: inherit; text-align: right; color: #5d574c; background: #0a0908; border-right: 1px solid var(--line); -webkit-user-select: none; user-select: none; }
.cv-code { flex: 1 0 auto; margin: 0; padding: 0 clamp(16px, 2vw, 28px) 0 16px; font: inherit; white-space: pre; tab-size: 4; -moz-tab-size: 4; font-variant-ligatures: none; color: #e2dac4; }
.cv-code code { font: inherit; }
.cv-code:focus-visible { outline: 1px solid var(--gold); outline-offset: -1px; }
.cv-nav { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 16px; padding: 4px clamp(18px, 3vw, 36px); border-top: 1px solid var(--line); }
.cv-nav button { min-height: 50px; padding: 0; background: none; border: 0; text-align: left; font-size: 17px; color: var(--dim); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cv-nav button:hover { color: var(--vellum); }
.cv-nav .cv-next { text-align: right; }
@media (min-width: 1000px) {
	.cv-body { grid-template-columns: minmax(300px, 4fr) minmax(0, 8fr); align-content: stretch; overflow: hidden; }
	.cv-text { overflow: auto; overscroll-behavior: contain; }
	.cv-src { display: grid; border-top: 0; border-left: 1px solid var(--line); }
	.cv-scroll { overflow: auto; overscroll-behavior: contain; }
}
@media (max-width: 599px) {
	.cv { width: 100vw; height: 100svh; border: 0; border-radius: 0; }
	.cv-head { padding-top: 14px; }
	.cv-scroll { font-size: 13px; }
}
