@font-face {
  font-family: "Exo 2";
  src: url("/assets/fonts-exo-2.4a259dde.woff2") format("woff2");
  font-weight: 100 900;
  font-display: swap;
}

@view-transition { navigation: auto; }

:root {
  --fond: #07080f;
  --texte: #f4f2ee;
  --doux: #b9bccb;
  --carte: rgba(255, 255, 255, 0.05);
  --bord: rgba(255, 255, 255, 0.13);
  --accent: #f0a93b;
  --sur-accent: #0b0b10;
  --titres: "Exo 2", system-ui, sans-serif;
  --corps: "Exo 2", system-ui, sans-serif;
  --courbe: cubic-bezier(0.2, 0.8, 0.2, 1);
  --marge: clamp(1.1rem, 5vw, 4rem);
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body { background: var(--fond); color: var(--texte); font: 400 1.0625rem/1.65 var(--corps); overflow-x: clip; }
img { display: block; max-width: 100%; height: auto; }
a { color: inherit; }
ul, ol { list-style: none; }
button { font: inherit; color: inherit; cursor: pointer; background: none; border: 0; }
h1, h2, h3 { font-family: var(--titres); line-height: 1.08; text-wrap: balance; }
em { font-style: normal; }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 3px; border-radius: 4px; }
[hidden] { display: none !important; }

.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.saut { position: absolute; left: 1rem; top: -5rem; z-index: 90; background: var(--accent); color: var(--sur-accent); padding: .6rem 1rem; border-radius: .5rem; }
.saut:focus { top: 1rem; }
.ico { width: 1.15em; height: 1.15em; flex: none; transition: transform .3s var(--courbe); }
.petit { font-size: 1rem; color: var(--doux); }
.surtitre { display: block; font-size: 1rem; font-weight: 600; letter-spacing: .16em; text-transform: uppercase; color: var(--accent); margin-bottom: .9rem; }
.section { padding: clamp(4rem, 10vw, 8rem) var(--marge); max-width: 1240px; margin-inline: auto; }
.titre-section { font-size: clamp(2rem, 5.2vw, 3.6rem); font-weight: 800; margin-bottom: 2.5rem; max-width: 20ch; }

/* ---------- Thèmes ---------- */
.theme-papier {
  --fond: #f6f0e4; --texte: #14233b; --doux: #4a566b; --carte: #fffdf8; --bord: rgba(20, 35, 59, 0.14);
  --accent: #8a5408; --bouton: #e7a132; --sur-accent: #14233b; --titres: Georgia, "Iowan Old Style", "Times New Roman", serif;
}
.theme-iceberg { --fond: #030304; --sur-accent: #0a0203; }

/* ---------- En-tête et pied ---------- */
.entete { position: sticky; top: 0; z-index: 50; display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: .8rem var(--marge); background: color-mix(in srgb, var(--fond) 78%, transparent); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); border-bottom: 1px solid var(--bord); }
.marque { display: flex; align-items: center; gap: .7rem; font-weight: 800; font-size: 1.15rem; text-decoration: none; }
.marque-livres { display: flex; align-items: flex-end; gap: 3px; height: 24px; }
.marque-livres i { width: 6px; border-radius: 2px; transition: height .35s var(--courbe); }
.marque-livres i:nth-child(1) { height: 18px; background: #f0a93b; }
.marque-livres i:nth-child(2) { height: 24px; background: #ff2a32; }
.marque-livres i:nth-child(3) { height: 15px; background: #ff6a2b; }
.marque:hover i:nth-child(1) { height: 24px; }
.marque:hover i:nth-child(2) { height: 15px; }
.marque:hover i:nth-child(3) { height: 21px; }
.menu { display: flex; gap: .3rem; }
.menu a { padding: .5rem .85rem; border-radius: 999px; text-decoration: none; font-weight: 500; font-size: 1rem; transition: background .25s; }
.menu a:hover, .menu a[aria-current="page"] { background: color-mix(in srgb, var(--texte) 10%, transparent); }
.menu-bouton { display: none; width: 44px; height: 44px; position: relative; }
.menu-bouton span:not(.sr) { position: absolute; left: 10px; width: 24px; height: 2px; background: var(--texte); transition: transform .3s var(--courbe), top .3s var(--courbe); }
.menu-bouton span:nth-child(1) { top: 17px; }
.menu-bouton span:nth-child(2) { top: 25px; }
.menu-bouton[aria-expanded="true"] span:nth-child(1) { top: 21px; transform: rotate(45deg); }
.menu-bouton[aria-expanded="true"] span:nth-child(2) { top: 21px; transform: rotate(-45deg); }
@media (max-width: 1040px) {
  .js .menu-bouton { display: block; }
  .js .menu { position: absolute; top: 100%; left: 0; right: 0; flex-direction: column; padding: .8rem var(--marge) 1.4rem; background: var(--fond); border-bottom: 1px solid var(--bord); display: none; }
  .js .menu.ouvert { display: flex; }
  html:not(.js) .entete { flex-wrap: wrap; position: static; }
  html:not(.js) .menu { flex-wrap: wrap; }
}
.pied { border-top: 1px solid var(--bord); padding: 3rem var(--marge) 7rem; display: grid; gap: 1.2rem; text-align: center; color: var(--doux); font-size: 1rem; }
.pied-marque { font-weight: 800; font-size: 1.3rem; color: var(--texte); }
.pied nav { display: flex; flex-wrap: wrap; justify-content: center; gap: .6rem 1.6rem; }

/* ---------- Boutons ---------- */
.actions { display: flex; flex-wrap: wrap; gap: .8rem; margin-top: 1.8rem; }
.bouton { display: inline-flex; align-items: center; justify-content: center; gap: .6rem; min-height: 3.1rem; padding: .75rem 1.5rem; border-radius: 999px; background: var(--bouton, var(--accent)); color: var(--sur-accent); font-weight: 700; text-decoration: none; border: 2px solid transparent; position: relative; overflow: hidden; transition: transform .3s var(--courbe), box-shadow .3s; }
.bouton::after { content: ""; position: absolute; inset: 0; background: linear-gradient(110deg, transparent 30%, rgba(255, 255, 255, .55) 50%, transparent 70%); transform: translateX(-120%); transition: transform .7s var(--courbe); pointer-events: none; }
.bouton:hover { transform: translateY(-3px); box-shadow: 0 14px 34px -12px var(--bouton, var(--accent)); }
.bouton:hover::after { transform: translateX(120%); }
.bouton:hover .ico, a:hover .carte-lien .ico { transform: translateX(5px); }
.bouton-contour { background: transparent; color: var(--texte); border-color: color-mix(in srgb, var(--texte) 34%, transparent); }
.bouton-contour:hover { box-shadow: none; border-color: var(--texte); }

/* ---------- Livre en volume ---------- */
.livre { --l: 240px; --h: calc(var(--l) * var(--ratio)); --e: calc(var(--l) * var(--epais, .12)); --ry: 26deg; --rx: 3deg; width: var(--l); height: var(--h); perspective: 1600px; position: relative; flex: none; }
.volume { position: absolute; inset: 0; transform-style: preserve-3d; transform: rotateX(var(--rx)) rotateY(var(--ry)); transition: transform .7s var(--courbe); }
.face { position: absolute; backface-visibility: hidden; -webkit-backface-visibility: hidden; }
.devant, .derriere { inset: 0; overflow: hidden; border-radius: 2px 5px 5px 2px; background: var(--tranche); }
.devant { transform: translateZ(calc(var(--e) / 2)); }
.derriere { transform: rotateY(180deg) translateZ(calc(var(--e) / 2)); }
.devant img, .derriere img { width: 100%; height: 100%; object-fit: cover; user-select: none; }
.devant::after { content: ""; position: absolute; inset: 0; background: linear-gradient(90deg, rgba(0,0,0,.35) 0, rgba(255,255,255,.22) 2.5%, transparent 7%), linear-gradient(115deg, transparent 38%, rgba(255,255,255,.16) 50%, transparent 62%); background-size: 100% 100%, 260% 100%; background-position: 0 0, var(--reflet, 100%) 0; transition: background-position .9s var(--courbe); }
.dos { top: 0; height: 100%; width: var(--e); left: calc(var(--e) / -2); transform: rotateY(-90deg); background: linear-gradient(90deg, rgba(0,0,0,.35), transparent 35%, rgba(255,255,255,.12) 65%, rgba(0,0,0,.25)), var(--tranche); display: grid; place-items: center; overflow: hidden; }
.dos img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: fill; user-select: none; }
.dos::after { content: ""; position: absolute; inset: 0; background: linear-gradient(90deg, rgba(0,0,0,.4), transparent 35%, rgba(255,255,255,.1) 65%, rgba(0,0,0,.28)); }
.dos span { writing-mode: vertical-rl; font: 800 calc(var(--e) * .42)/1 "Exo 2", sans-serif; text-transform: uppercase; letter-spacing: .06em; color: #fff; white-space: nowrap; max-height: 92%; overflow: hidden; }
.feuilles { top: 1%; height: 98%; width: calc(var(--e) - 4px); left: calc(100% - var(--e) / 2 - 2px); transform: rotateY(90deg); background: repeating-linear-gradient(90deg, #f7f2e6 0 2px, #d8cfbc 2px 3px); }
.haut, .bas { left: 0; width: 98.5%; height: calc(var(--e) - 4px); top: calc(var(--e) / -2 + 3px); transform: rotateX(90deg); background: repeating-linear-gradient(0deg, #f7f2e6 0 2px, #d8cfbc 2px 3px); }
.bas { top: calc(100% - var(--e) / 2 + 1px); transform: rotateX(-90deg); }
.dos-texte { display: flex; flex-direction: column; justify-content: space-between; height: 100%; padding: 14% 11%; color: #fff; background: linear-gradient(160deg, #000 10%, var(--tranche)); font-size: calc(var(--l) * .055); line-height: 1.4; }
.dos-texte b { font-size: 1.6em; line-height: 1.1; text-transform: uppercase; }
.ombre { position: absolute; left: 4%; right: -6%; bottom: -9%; height: 9%; border-radius: 50%; background: rgba(0, 0, 0, .55); filter: blur(18px); z-index: -1; }
.theme-papier .ombre { background: rgba(60, 40, 10, .35); }
.flotte .volume { animation: flotte 7s ease-in-out infinite; }
@keyframes flotte { 50% { translate: 0 -14px; } }
a:hover > .livre, a:hover .carte-livre .livre, a:hover .autre-livre .livre { --ry: 10deg; --rx: 0deg; --reflet: 0%; }

/* ---------- Accueil : scène ---------- */
.scene { position: relative; isolation: isolate; min-height: calc(100svh - 70px); display: flex; flex-direction: column; justify-content: center; padding: 2.5rem var(--marge) 1.5rem; overflow: hidden; }
.scene-fonds, .scene-fond, .poussiere { position: absolute; inset: 0; z-index: -1; }
.scene-fond { opacity: 0; transition: opacity 1.1s; background: radial-gradient(60% 70% at 74% 46%, color-mix(in srgb, var(--c2) 38%, transparent), transparent 70%), radial-gradient(90% 80% at 15% 100%, var(--c1), transparent 70%); }
.scene-fond.actif { opacity: 1; }
.poussiere { width: 100%; height: 100%; pointer-events: none; }
.scene-grille { display: grid; gap: 2rem; align-items: center; width: 100%; max-width: 1240px; margin: 0 auto; }
.titre-geant { display: block; font-size: clamp(2.5rem, min(5.5vw, 10vh), 5.2rem); font-weight: 900; letter-spacing: -.025em; line-height: .98; text-transform: uppercase; }
.titre-geant em { color: transparent; background: linear-gradient(100deg, #ffd27a, #ff5a3c 45%, #ff2a32 60%, #ffd27a); background-size: 220% 100%; -webkit-background-clip: text; background-clip: text; animation: braise 8s linear infinite; }
@keyframes braise { to { background-position: -220% 0; } }
.panneaux { display: grid; margin-top: 2rem; }
.panneau { grid-area: 1 / 1; opacity: 0; transform: translateY(26px); transition: opacity .5s, transform .7s var(--courbe); pointer-events: none; }
.panneau.actif { opacity: 1; transform: none; pointer-events: auto; }
.panneau h2 { font-size: clamp(1.35rem, 2.6vw, 1.9rem); margin: .35rem 0 .6rem; }
.genre { font-size: 1rem; text-transform: uppercase; letter-spacing: .14em; color: var(--accent); font-weight: 700; }
.accroche { font-size: 1.2rem; color: var(--doux); }
.carrousel { position: relative; height: clamp(330px, 58vw, 540px); }
.place { --x: 0; --z: 0; position: absolute; left: 50%; top: 50%; transition: transform .9s var(--courbe), opacity .6s, filter .6s; border-radius: 6px; }
.place .livre { --l: clamp(170px, 24vw, 300px); }
.place[data-pos="0"] { transform: translate(-50%, -50%) scale(1); z-index: 3; }
.place[data-pos="1"] { transform: translate(calc(-50% + 56%), -54%) scale(.68); z-index: 2; opacity: .75; filter: brightness(.6); }
.place[data-pos="2"] { transform: translate(calc(-50% - 56%), -54%) scale(.68); z-index: 1; opacity: .75; filter: brightness(.6); }
.place[data-pos="1"] .livre { --ry: -24deg; }
.place[data-pos="2"] .livre { --ry: 38deg; }
.place[data-pos="1"]:hover, .place[data-pos="2"]:hover { opacity: 1; filter: none; }
.onglets { display: flex; justify-content: center; gap: .7rem; margin: 1.2rem auto 0; width: 100%; max-width: 900px; }
@media (min-width: 900px) and (max-height: 860px) {
  .scene { padding-top: 1.4rem; padding-bottom: .8rem; }
  .panneaux { margin-top: 1.1rem; }
  .panneau .actions { margin-top: 1rem; }
  .carrousel { height: min(540px, 62vh); }
  .place .livre { --l: min(24vw, 36vh); }
}
.onglet { flex: 1; text-align: left; padding: .5rem 0; font-weight: 600; font-size: 1rem; line-height: 1.3; color: var(--doux); transition: color .3s; }
.onglet i { display: block; height: 4px; margin-top: .7rem; border-radius: 4px; background: var(--bord); overflow: hidden; position: relative; }
.onglet i::after { content: ""; position: absolute; inset: 0; background: var(--accent); transform: scaleX(0); transform-origin: left; }
.onglet.actif { color: var(--texte); }
.onglet.actif i::after { transform: scaleX(1); }
.scene.defile .onglet.actif i::after { animation: remplir 7s linear forwards; }
@keyframes remplir { from { transform: scaleX(0); } to { transform: scaleX(1); } }
.pause { width: 44px; height: 44px; border-radius: 50%; border: 1px solid var(--bord); align-self: center; position: relative; flex: none; }
.pause::before { content: ""; position: absolute; inset: 14px 15px; border-inline: 4px solid var(--texte); }
.pause[aria-pressed="true"]::before { inset: 13px 13px 13px 17px; border: 0; background: var(--texte); clip-path: polygon(0 0, 100% 50%, 0 100%); }
html:not(.js) .pause { display: none; }
@media (min-width: 900px) { .scene-grille { grid-template-columns: 1.1fr 1fr; } }
@media (max-width: 899px) {
  .scene { padding-top: 1.5rem; }
  .scene-grille { display: flex; flex-direction: column; }
  .scene-texte { display: contents; }
  .scene h1 { order: 0; text-align: center; }
  .carrousel { order: 1; width: 100%; height: clamp(300px, 70vw, 480px); }
  .panneaux { order: 2; margin-top: 0; text-align: center; }
  .panneau .actions { justify-content: center; }
  .onglet span { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
}

/* ---------- Ruban défilant ---------- */
.ruban { overflow: hidden; border-block: 1px solid var(--bord); padding: 1.1rem 0; background: rgba(255, 255, 255, .025); }
.ruban > div { display: flex; width: max-content; animation: defile 38s linear infinite; }
.ruban span { font-size: clamp(1.3rem, 3vw, 2.1rem); font-weight: 800; text-transform: uppercase; white-space: nowrap; padding-right: 2.4rem; display: flex; align-items: center; gap: 2.4rem; }
.ruban span::after { content: "◆"; font-size: .55em; color: var(--accent); }
.ruban span:nth-child(even) { color: transparent; -webkit-text-stroke: 1px var(--doux); }
@keyframes defile { to { transform: translateX(-50%); } }

/* ---------- Lueur qui suit la souris ---------- */
[data-lueur] { position: relative; overflow: hidden; isolation: isolate; }
[data-lueur]::before { content: ""; position: absolute; inset: 0; z-index: -1; background: radial-gradient(320px circle at var(--mx, 50%) var(--my, 50%), color-mix(in srgb, var(--accent) 26%, transparent), transparent 70%); opacity: 0; transition: opacity .4s; }
[data-lueur]:hover::before, [data-lueur]:focus-visible::before { opacity: 1; }

/* ---------- Accueil : cartes et auteur ---------- */
.cartes { display: grid; gap: 1.4rem; grid-template-columns: repeat(auto-fit, minmax(min(100%, 300px), 1fr)); }
.carte { display: flex; flex-direction: column; gap: .8rem; padding: 2rem 1.7rem; border-radius: 1.6rem; text-decoration: none; border: 1px solid var(--bord); background: linear-gradient(165deg, var(--fond), #0a0b12 70%); transition: border-color .35s, translate .45s var(--courbe); }
.carte:hover { border-color: var(--accent); translate: 0 -8px; }
.carte-livre { display: grid; place-items: center; padding: 1rem 0 2.6rem; }
.carte .livre { --l: 190px; }
.carte h3 { font-size: 1.5rem; }
.carte p:not(.genre) { color: var(--doux); }
.carte-lien { display: inline-flex; align-items: center; gap: .5rem; margin-top: auto; padding-top: .6rem; font-weight: 700; color: var(--accent); }
.auteur { display: grid; gap: 3rem; align-items: center; }
.auteur-photo { max-width: 360px; justify-self: center; position: relative; isolation: isolate; }
.auteur-photo::before { content: ""; position: absolute; inset: -14px; border-radius: 2.2rem; background: conic-gradient(from var(--tour, 0deg), #f0a93b, #ff2a32, #ff6a2b, #f0a93b); filter: blur(22px); opacity: .55; z-index: -1; animation: tour 9s linear infinite; }
@property --tour { syntax: "<angle>"; inherits: false; initial-value: 0deg; }
@keyframes tour { to { --tour: 360deg; } }
.auteur-photo img { border-radius: 1.6rem; aspect-ratio: 4 / 5; object-fit: cover; object-position: top; width: 100%; }
.auteur-texte h2 { font-size: clamp(2.2rem, 5vw, 3.6rem); font-weight: 800; margin-bottom: 1.2rem; }
.auteur-texte p + p { margin-top: .9rem; }
.manque { display: inline-block; padding: .5rem 1rem; border: 2px dashed var(--accent); border-radius: .7rem; }
@media (min-width: 860px) { .auteur { grid-template-columns: 360px 1fr; gap: 5rem; } }

/* ---------- Pages livre : héros ---------- */
.heros { position: relative; overflow: hidden; }
.heros-grille { display: grid; gap: 2.5rem; align-items: center; max-width: 1240px; margin: 0 auto; padding: clamp(2.5rem, 6vw, 5.5rem) var(--marge); }
.heros h1 { font-size: clamp(2.3rem, 5.6vw, 4.4rem); font-weight: 800; margin-bottom: 1.4rem; }
.heros h1 em { display: block; color: var(--accent); }
.heros-intro { font-size: 1.22rem; max-width: 36ch; color: var(--doux); }
.heros-livre { display: flex; flex-direction: column; align-items: center; gap: 2.8rem; }
.tournant { touch-action: pan-y; cursor: grab; border-radius: 8px; padding: .5rem; }
.tournant.saisi { cursor: grabbing; }
.tournant.saisi .volume { transition: none; }
.grand { --l: clamp(210px, 28vw, 340px); }
.indice { display: flex; align-items: center; gap: .6rem; font-size: 1rem; color: var(--doux); }
.indice::before { content: "⟲"; font-size: 1.5rem; color: var(--accent); }
html:not(.js) .indice { display: none; }
@media (min-width: 900px) { .heros-grille { grid-template-columns: 1.15fr 1fr; min-height: calc(100svh - 70px); } }

.heros-savoir { background: radial-gradient(55% 70% at 78% 45%, rgba(231, 161, 50, .3), transparent 70%); }
.heros-savoir h1 { line-height: 1.12; }
.heros-savoir h1 em { font-style: italic; }

/* ---------- Savoir : test ---------- */
.test-grille { display: grid; gap: 1.6rem; }
.test-liste { display: grid; gap: .7rem; }
.test-liste label { display: flex; align-items: center; gap: 1rem; padding: 1rem 1.2rem; background: var(--carte); border: 1.5px solid var(--bord); border-radius: 1rem; cursor: pointer; font-size: 1.12rem; transition: border-color .25s, translate .3s var(--courbe), background .25s; }
.test-liste label:hover { translate: 6px 0; border-color: #e7a132; }
.test-liste input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.coche { width: 1.7rem; height: 1.7rem; border-radius: .5rem; border: 2px solid var(--texte); flex: none; display: grid; place-items: center; transition: background .25s, border-color .25s; }
.coche::after { content: ""; width: .45rem; height: .85rem; border: solid var(--texte); border-width: 0 3px 3px 0; rotate: 45deg; translate: 0 -2px; scale: 0; transition: scale .35s cubic-bezier(.3, 1.8, .5, 1); }
.test-liste input:checked + .coche { background: #e7a132; border-color: #e7a132; }
.test-liste input:checked + .coche::after { scale: 1; }
.test-liste input:checked ~ span:last-child { color: var(--doux); }
.test-liste label:has(input:checked) { border-color: #e7a132; background: #fdf1da; }
.test-liste label:has(input:focus-visible) { outline: 3px solid var(--accent); outline-offset: 3px; }
.test-resultat { background: #14233b; color: #f6f0e4; border-radius: 1.6rem; padding: 2.4rem 1.8rem; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 1.4rem; text-align: center; --doux: #bcc6da; --accent: #e7a132; }
.jauge { width: 180px; aspect-ratio: 1; border-radius: 50%; display: grid; place-items: center; background: radial-gradient(closest-side, #14233b 79%, transparent 80%), conic-gradient(#e7a132 calc(var(--part) * 1%), rgba(255,255,255,.14) 0); transition: --part .8s var(--courbe); }
@property --part { syntax: "<number>"; inherits: false; initial-value: 0; }
.jauge strong { font: 800 2.8rem var(--titres); }
.test-resultat [data-message] { font-size: 1.18rem; min-height: 3.9em; max-width: 30ch; }
@media (min-width: 900px) { .test-grille { grid-template-columns: 1.4fr 1fr; align-items: stretch; } }

/* ---------- Savoir : avant / après ---------- */
.interrupteur { display: inline-flex; flex-wrap: wrap; gap: .3rem; padding: .35rem; border-radius: 999px; background: var(--carte); border: 1.5px solid var(--bord); margin-bottom: 3rem; }
.interrupteur button { padding: .75rem 1.4rem; border-radius: 999px; font-weight: 700; transition: background .35s, color .35s; }
.interrupteur button[aria-pressed="true"] { background: #14233b; color: #fff; }
html:not(.js) .interrupteur { display: none; }
@media (max-width: 480px) {
  .interrupteur { display: flex; }
  .interrupteur button { flex: 1; padding: .65rem .5rem; font-size: 1rem; line-height: 1.25; }
}
.fiches { display: grid; gap: 1.1rem; grid-template-columns: repeat(auto-fit, minmax(min(100%, 200px), 1fr)); }
.fiche { background: var(--carte); border: 1.5px solid var(--bord); border-top: 7px solid #b3392f; border-radius: 1rem; padding: 1.5rem 1.2rem; box-shadow: 0 18px 30px -22px rgba(60, 40, 10, .5); transition: rotate .7s var(--courbe), translate .7s var(--courbe), border-color .5s, opacity .6s, transform .6s var(--courbe); }
.fiche h3 { font-size: 1.4rem; margin-bottom: .7rem; }
.faces { display: grid; }
.faces p { grid-area: 1 / 1; transition: opacity .45s; }
.js .bascule[data-etat="sans"] .avec, .js .bascule[data-etat="avec"] .sans { opacity: 0; visibility: hidden; }
html:not(.js) .faces { display: block; }
html:not(.js) .faces .avec { margin-top: .8rem; font-weight: 600; }
.js .bascule[data-etat="sans"] .fiche:nth-child(1) { rotate: -5deg; translate: 0 14px; }
.js .bascule[data-etat="sans"] .fiche:nth-child(2) { rotate: 4deg; translate: 0 -10px; }
.js .bascule[data-etat="sans"] .fiche:nth-child(3) { rotate: -2.5deg; translate: 0 22px; }
.js .bascule[data-etat="sans"] .fiche:nth-child(4) { rotate: 6deg; translate: 0 4px; }
.js .bascule[data-etat="sans"] .fiche:nth-child(5) { rotate: -4.5deg; translate: 0 -14px; }
.bascule[data-etat="avec"] .fiche { border-top-color: #2f7d4f; }

/* ---------- Savoir : galerie, récit, avis ---------- */
.galerie-grille { display: grid; gap: 1.2rem; }
.vignette { position: relative; border-radius: 1.4rem; overflow: hidden; padding: 0; background: var(--carte); cursor: zoom-in; }
.vignette img { width: 100%; height: 100%; object-fit: cover; aspect-ratio: 4 / 3; transition: scale .8s var(--courbe); }
.vignette.large img { aspect-ratio: 16 / 9; }
.vignette:hover img { scale: 1.05; }
.loupe { position: absolute; right: 1rem; bottom: 1rem; padding: .45rem 1rem; border-radius: 999px; background: rgba(20, 35, 59, .88); color: #fff; font-weight: 600; font-size: 1rem; }
@media (min-width: 860px) { .galerie-grille { grid-template-columns: 1fr 1fr; } .vignette.large { grid-column: 1 / -1; } }
.loupe-fenetre { margin: auto; border: 0; background: transparent; max-width: min(96vw, 1400px); max-height: 94vh; text-align: center; overflow: visible; }
.loupe-fenetre[open] { animation: apparait .4s var(--courbe); }
.loupe-fenetre img { max-height: 80vh; width: auto; margin: 0 auto 1rem; border-radius: 1rem; }
.loupe-fenetre::backdrop { background: rgba(8, 12, 22, .9); }
@keyframes apparait { from { opacity: 0; scale: .94; } }
.recit { max-width: 860px; }
.recit-texte p:not(.surtitre) { margin-bottom: 1.1rem; font-size: 1.2rem; }
.recit-texte p.signature { font-size: 1rem; color: var(--doux); border-top: 1px solid var(--bord); padding-top: 1.2rem; margin-top: 2rem; }
.avis ul { display: grid; gap: 1.1rem; grid-template-columns: repeat(auto-fit, minmax(min(100%, 300px), 1fr)); margin-bottom: 1.6rem; }
.avis li a { display: flex; flex-direction: column; justify-content: space-between; gap: 1.2rem; height: 100%; padding: 1.7rem; border-radius: 1.2rem; background: var(--carte); border: 1.5px solid var(--bord); text-decoration: none; transition: translate .4s var(--courbe); }
.avis li a:hover { translate: 0 -6px; }
.avis q { font: italic 1.35rem/1.4 var(--titres); }
.avis a span { font-weight: 700; color: var(--accent); font-size: 1rem; }

/* ---------- Formats et autres livres ---------- */
.formats-grille { display: grid; gap: 1.1rem; grid-template-columns: repeat(auto-fit, minmax(min(100%, 280px), 1fr)); }
.format { display: flex; flex-direction: column; gap: .7rem; padding: 2rem; border-radius: 1.4rem; background: var(--carte); border: 1.5px solid var(--bord); text-decoration: none; transition: translate .4s var(--courbe), border-color .3s; }
.format:hover { translate: 0 -6px; border-color: var(--accent); }
.format h3 { font-size: 1.8rem; }
.format p { color: var(--doux); }
.autres-grille { display: grid; gap: 1.2rem; grid-template-columns: repeat(auto-fit, minmax(min(100%, 420px), 1fr)); }
.autre { display: flex; align-items: center; gap: 2rem; padding: 2rem 1.8rem; border-radius: 1.4rem; text-decoration: none; background: linear-gradient(130deg, var(--fond), #08090f); color: #f4f2ee; --doux: #c3c5d2; border: 1px solid rgba(255,255,255,.12); }
.autre .livre { --l: 110px; }
.autre h3 { font-size: 1.35rem; margin-bottom: .4rem; }
.autre p { color: var(--doux); margin-bottom: .4rem; }
@media (max-width: 480px) { .autre { flex-direction: column; text-align: center; } }
.achat-flottant { position: fixed; z-index: 40; left: 50%; bottom: max(1rem, env(safe-area-inset-bottom)); translate: -50% 160%; padding: .85rem 1.7rem; border-radius: 999px; background: var(--bouton, var(--accent)); color: var(--sur-accent); font-weight: 800; text-decoration: none; white-space: nowrap; box-shadow: 0 16px 40px -10px rgba(0,0,0,.6); transition: translate .5s var(--courbe), visibility .5s; visibility: hidden; }
.achat-flottant.visible { translate: -50% 0; visibility: visible; }

/* ---------- Icebergs ---------- */
.heros-iceberg { background: radial-gradient(60% 65% at 76% 40%, color-mix(in srgb, var(--accent) 30%, transparent), transparent 72%), #000; }
.heros-iceberg h1 { text-transform: uppercase; font-weight: 900; line-height: .98; font-size: clamp(2.8rem, 7.4vw, 5.8rem); }
.heros-iceberg h1 em { color: #fff; }
.heros-iceberg h1 { color: var(--accent); }
.eau { height: 60px; overflow: hidden; position: relative; }
.eau svg { position: absolute; left: 0; top: 0; width: 200%; height: 100%; animation: defile 14s linear infinite; }
.eau path { fill: none; stroke: var(--accent); stroke-width: 3; vector-effect: non-scaling-stroke; }
.eau path + path { stroke-width: 1.2; opacity: .6; }
.ruban-metiers { border-color: color-mix(in srgb, var(--accent) 40%, transparent); }
.plongee { position: relative; background: linear-gradient(#17262f 0, #1c0a10 35%, #120205 65%, #000 100%); }
.plongee > .section { position: relative; max-width: 920px; }
.bulles { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; }
.niveaux { display: grid; gap: clamp(1.5rem, 5vw, 3.5rem); }
.niveau { display: flex; gap: 1.4rem; align-items: flex-start; padding: 1.8rem; border-radius: 1.4rem; background: rgba(0, 0, 0, .46); border: 1px solid color-mix(in srgb, var(--accent) calc(var(--p) * 75% + 12%), transparent); box-shadow: 0 0 calc(var(--p) * 60px) calc(var(--p) * -14px) var(--accent); }
.niveau:nth-child(even) { margin-left: clamp(0px, 6vw, 5rem); }
.niveau:nth-child(odd) { margin-right: clamp(0px, 6vw, 5rem); }
.numero { font: 900 clamp(2.6rem, 7vw, 4.6rem)/.9 var(--titres); color: transparent; -webkit-text-stroke: 2px var(--accent); flex: none; min-width: 1.2ch; }
.niveau h3 { font-size: clamp(1.4rem, 3vw, 2rem); text-transform: uppercase; margin-bottom: .5rem; }
.niveau p { color: #d6d3d6; }
.profondimetre { position: sticky; top: calc(50vh - 130px); height: 0; margin-left: clamp(.5rem, 2.5vw, 2.5rem); z-index: 2; }
.profondimetre .trait { width: 4px; height: 220px; background: rgba(255,255,255,.16); border-radius: 4px; overflow: hidden; }
.profondimetre i { display: block; width: 100%; height: 100%; background: var(--accent); transform-origin: top; transform: scaleY(var(--descente, 0)); }
.profondimetre p { margin-top: .6rem; font-weight: 800; font-size: 1rem; translate: -6px 0; }
@media (max-width: 1080px) { .profondimetre { display: none; } }
.dossier-cadre { max-width: 780px; margin: 0 auto; padding: clamp(1.8rem, 5vw, 3.5rem); border-radius: 1.8rem; border: 1px solid color-mix(in srgb, var(--accent) 45%, transparent); background: #0c0a0d; }
.dossier-cadre h2 { font-size: clamp(1.8rem, 4.5vw, 3rem); text-transform: uppercase; margin-bottom: 1.2rem; }
.date { font: 900 clamp(2.4rem, 7vw, 4.5rem)/1 var(--titres); color: var(--accent); margin-bottom: .6rem; }
.dossier-cadre .bouton { margin-top: 1.6rem; }
.preuves { margin-top: 1.4rem; padding-left: 1.2rem; border-left: 4px solid var(--accent); animation: apparait .5s var(--courbe); }
.tirage .dossier-cadre { text-align: center; }
.poste { min-height: 3.2em; display: grid; place-items: center; font: 900 clamp(1.7rem, 5vw, 3rem)/1.15 var(--titres); color: var(--accent); text-transform: uppercase; }
.tirage .petit { margin-top: 1.2rem; }
.pour-qui { max-width: 920px; }
.pour-qui li { padding: 1.2rem 0 1.2rem 2.6rem; border-top: 1px solid var(--bord); position: relative; font-size: 1.2rem; }
.pour-qui li::before { content: "▼"; position: absolute; left: 0; color: var(--accent); }

/* ---------- Pages de texte ---------- */
.texte { max-width: 760px; min-height: 60vh; }
.texte h1 { font-size: clamp(2.2rem, 6vw, 3.4rem); margin-bottom: 1.5rem; }
.texte h2 { font-size: 1.4rem; margin: 2.2rem 0 .6rem; color: var(--accent); }
.texte p + p { margin-top: 1rem; }

/* ---------- Apparitions au défilement ---------- */
.js .reveler { opacity: 0; transform: translateY(34px); transition: opacity .7s, transform .9s var(--courbe), translate .4s var(--courbe), rotate .7s var(--courbe), border-color .3s; }
.js .reveler.vu { opacity: 1; transform: none; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation: none !important; transition-duration: .01ms !important; }
  .js .reveler { opacity: 1; transform: none; }
  .poussiere, .bulles, .pause { display: none; }
  @view-transition { navigation: none; }
}

/* ============ Effets ajoutés ============ */

/* Barre de lecture */
.lecture { position: fixed; z-index: 60; top: 0; left: 0; right: 0; height: 3px; background: linear-gradient(90deg, #f0a93b, #ff2a32, #ff6a2b); transform-origin: left; transform: scaleX(0); pointer-events: none; }
/* Halo qui suit la souris (pages sombres) */
.halo { position: fixed; z-index: 45; left: 0; top: 0; width: 460px; height: 460px; margin: -230px 0 0 -230px; border-radius: 50%; background: radial-gradient(closest-side, color-mix(in srgb, var(--accent) 16%, transparent), transparent); pointer-events: none; mix-blend-mode: screen; }

/* Entrée des livres et du titre sur l'accueil */
.js .place .livre { animation: entree 1.4s var(--courbe) both; }
.js .place:nth-child(2) .livre { animation-delay: .18s; }
.js .place:nth-child(3) .livre { animation-delay: .34s; }
@keyframes entree { from { opacity: 0; transform: translateY(120px) rotateY(-300deg) scale(.55); } }
.mot { display: inline-block; animation: monte 1s var(--courbe) both; animation-delay: calc(var(--i) * .13s + .15s); }
@keyframes monte { from { opacity: 0; transform: translateY(.7em) rotateX(-85deg); filter: blur(8px); } }
.titre-geant { perspective: 700px; }
.titre-geant em { animation: none; background: none; }
.titre-geant em .mot { color: transparent; background: linear-gradient(100deg, #ffd27a, #ff5a3c 45%, #ff2a32 60%, #ffd27a); background-size: 220% 100%; -webkit-background-clip: text; background-clip: text; animation: monte 1s var(--courbe) both, braise 8s linear infinite; animation-delay: calc(var(--i) * .13s + .15s), 0s; }

/* Cartes qui s'inclinent */
.js [data-tilt] { transform-style: preserve-3d; transition: transform .35s var(--courbe), translate .4s var(--courbe), border-color .3s, opacity .7s; }
.js .reveler.vu[data-tilt].penche { transform: perspective(900px) rotateX(var(--tx, 0deg)) rotateY(var(--ty, 0deg)); transition-duration: .08s, .4s, .3s, .7s; }

/* Choix d'un livre */
.envies { display: flex; flex-wrap: wrap; gap: .8rem; }
.envie { padding: 1rem 1.6rem; border-radius: 999px; border: 2px solid var(--bord); font-weight: 700; font-size: 1.12rem; transition: border-color .3s, background .3s, translate .3s var(--courbe), box-shadow .3s; }
.envie:hover { border-color: var(--accent); translate: 0 -4px; }
.envie[aria-pressed="true"] { background: var(--accent); border-color: var(--accent); color: #0b0b10; box-shadow: 0 16px 40px -14px var(--accent); }
.reponse { display: grid; gap: 2.5rem; align-items: center; margin-top: 2.5rem; padding: clamp(1.8rem, 5vw, 3rem); border-radius: 1.8rem; border: 1px solid color-mix(in srgb, var(--accent) 55%, transparent); background: radial-gradient(80% 120% at 0% 50%, color-mix(in srgb, var(--accent) 24%, transparent), transparent 70%); animation: apparait .55s var(--courbe); }
.reponse h3 { font-size: clamp(1.5rem, 3.5vw, 2.3rem); margin: .3rem 0 .8rem; }
.reponse-livre { justify-self: center; }
.reponse-livre .livre { --l: 180px; animation: pirouette 1.2s var(--courbe); }
@keyframes pirouette { from { opacity: 0; transform: rotateY(-360deg) scale(.4); } }
@media (min-width: 760px) { .reponse { grid-template-columns: 240px 1fr; } }
html:not(.js) .choix { display: none; }

/* ---------- Chaos puis ordre ---------- */
.chaos { --p: 0; --f: 0; position: relative; height: 340vh; }
.chaos-scene { position: sticky; top: 68px; height: calc(100svh - 68px); min-height: 540px; overflow: hidden; display: flex; flex-direction: column; align-items: center; padding: 1.4rem var(--marge) 1.2rem; background: color-mix(in srgb, #f6f0e4 calc(var(--f) * 100%), #190b0d); color: #fff; transition: color .3s; }
.chaos-scene::before { content: ""; position: absolute; inset: 0; background: radial-gradient(60% 60% at 50% 55%, rgba(216, 52, 40, .55), transparent 70%); opacity: calc(1 - var(--f)); animation: pouls 2.2s ease-in-out infinite; }
@keyframes pouls { 50% { scale: 1.14; } }
.chaos.range .chaos-scene { color: #14233b; }
.chaos-titres { display: grid; text-align: center; position: relative; z-index: 3; }
.chaos-titres p { grid-area: 1 / 1; font: 800 clamp(2rem, min(6.4vw, 8.5vh), 4.8rem)/1.06 var(--titres); transition: opacity .5s, transform .7s var(--courbe), filter .5s; }
.chaos-titres span { display: block; font: 700 1rem var(--corps); letter-spacing: .18em; text-transform: uppercase; margin-bottom: .5rem; color: #ffb4a8; }
.titre-apres span { color: #8a5408; }
.titre-apres, .chaos.range .titre-avant { opacity: 0; transform: translateY(26px); filter: blur(8px); }
.chaos.range .titre-apres { opacity: 1; transform: none; filter: none; }
.chaos:not(.range) .titre-avant { animation: secousse .45s steps(2) infinite; }
@keyframes secousse { 25% { translate: -2px 1px; } 50% { translate: 2px -1px; } 75% { translate: -1px -2px; } }
.chaos-plateau { position: relative; flex: 1; width: 100%; max-width: 1100px; }
.chaos-livre { position: absolute; left: 50%; top: 50%; translate: -50% -50%; scale: calc(.4 + var(--p) * .6); opacity: calc(var(--p) * 1.6 - .5); z-index: 1; }
.chaos-livre .livre { --l: clamp(130px, min(20vw, 28vh), 240px); --ry: 18deg; }
.note { position: absolute; left: 0; top: 0; z-index: 2; display: grid; place-items: center; width: max-content; max-width: 46%; padding: .7rem 1.15rem; border-radius: .7rem; font-weight: 700; font-size: 1.08rem; line-height: 1.25; text-align: center; background: #fffaf0; color: #3a0d0a; box-shadow: 0 18px 30px -14px rgba(0, 0, 0, .65); will-change: transform; }
.note > span { grid-area: 1 / 1; transition: opacity .3s; }
.note .rubrique { opacity: 0; color: #14233b; }
.note b { color: #2f7d4f; }
.note:nth-child(3n) { background: #ffd9d0; }
.note:nth-child(4n) { background: #ffeaa6; }
.note.rangee { background: #fff; box-shadow: 0 10px 22px -14px rgba(60, 40, 10, .6), inset 0 0 0 2px #2f7d4f; }
.note.rangee .question { opacity: 0; }
.note.rangee .rubrique { opacity: 1; }
.chaos-commandes { position: relative; z-index: 3; display: flex; flex-direction: column; align-items: center; gap: .8rem; }
.chaos-barre { width: min(320px, 70vw); height: 8px; border-radius: 8px; background: rgba(128, 100, 90, .35); overflow: hidden; }
.chaos-barre i { display: block; height: 100%; background: linear-gradient(90deg, #e0492f, #e7a132, #2f7d4f); transform-origin: left; transform: scaleX(var(--p)); }
.chaos.etroit .note { width: calc(50% - 4px); max-width: none; min-height: 3.2rem; padding: .35rem .3rem; font-size: 1rem; line-height: 1.15; }
.chaos.etroit .chaos-livre .livre { --l: var(--taille, 100px); }
/* Sans script ou sans animation : la scène est montrée rangée, en liste. */
html:not(.js) .chaos, .chaos.fixe { height: auto; }
html:not(.js) .chaos-scene, .chaos.fixe .chaos-scene { position: static; height: auto; background: transparent; color: var(--texte); }
html:not(.js) .chaos-scene::before, .chaos.fixe .chaos-scene::before, html:not(.js) .chaos-commandes, .chaos.fixe .chaos-commandes, html:not(.js) .titre-avant, .chaos.fixe .titre-avant, html:not(.js) .chaos-livre, .chaos.fixe .chaos-livre { display: none; }
html:not(.js) .titre-apres, .chaos.fixe .titre-apres { opacity: 1; transform: none; filter: none; }
html:not(.js) .notes, .chaos.fixe .notes { display: flex; flex-wrap: wrap; justify-content: center; gap: .8rem; margin-top: 2rem; }
html:not(.js) .note, .chaos.fixe .note { position: static; max-width: none; }
html:not(.js) .note .question { display: none; }
html:not(.js) .note .rubrique { opacity: 1; }

/* ---------- Mois gagnés ---------- */
.mois { background: #14233b; color: #f6f0e4; --doux: #bcc6da; --accent: #f0b04a; }
.mois .section { text-align: center; }
.mois-titre { font-size: clamp(1.7rem, 4vw, 2.8rem); font-weight: 800; }
.mois-chiffre { display: block; font-size: clamp(4.6rem, 17vw, 12rem); line-height: 1; color: #f0b04a; font-variant-numeric: tabular-nums; margin-bottom: .6rem; }
.calendrier { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1rem; max-width: 760px; margin: 3rem auto 2.5rem; perspective: 900px; }
@media (min-width: 760px) { .calendrier { grid-template-columns: repeat(6, 1fr); } }
.feuillet { display: grid; gap: .1rem; padding: .9rem .4rem 1rem; border-radius: .9rem; background: #fffaf0; color: #14233b; border-top: 12px solid #b3392f; box-shadow: 0 20px 30px -18px #000; }
.feuillet span, .feuillet em { font-size: 1rem; font-weight: 700; text-transform: uppercase; letter-spacing: .08em; }
.feuillet strong { font: 800 2.8rem/1.1 var(--titres); }
.feuillet em { color: #2f7d4f; }
.js .calendrier .feuillet { transform-origin: top; transform: rotateX(-100deg); opacity: 0; }
.js .mois.lance .feuillet { animation: feuillet .8s cubic-bezier(.3, 1.5, .5, 1) forwards; animation-delay: calc(var(--i) * .22s); }
@keyframes feuillet { to { transform: rotateX(0); opacity: 1; } }
.mois-texte { max-width: 54ch; margin: 0 auto 1rem; font-size: 1.25rem; }
.mois-texte strong { color: #f0b04a; }
.mois .actions { justify-content: center; }
.mois .bouton { --bouton: #e7a132; color: #14233b; }

/* ---------- Lampe torche ---------- */
.torche { --lx: 50%; --ly: 50%; --rayon: clamp(130px, 18vw, 230px); position: relative; min-height: 92svh; overflow: hidden; background: #000; cursor: crosshair; touch-action: pan-y; isolation: isolate; }
.torche-fond { position: absolute; inset: 0; background: radial-gradient(70% 70% at 50% 50%, #2b070b, #050203); }
.torche-fond img { position: absolute; left: 50%; top: 50%; translate: -50% -50%; height: 94%; width: auto; max-width: none; border-radius: 10px; }
.torche-fond li { position: absolute; font: 900 clamp(1.05rem, 2.6vw, 2.2rem)/1.15 var(--titres); text-transform: uppercase; max-width: 11em; color: #fff; text-shadow: 0 0 18px var(--accent), 0 2px 4px #000; rotate: -6deg; }
.torche-fond li:nth-child(even) { rotate: 5deg; color: var(--accent); text-shadow: 0 2px 8px #000; }
.torche-fond li:nth-child(1) { left: 4%; top: 8%; } .torche-fond li:nth-child(2) { right: 5%; top: 12%; }
.torche-fond li:nth-child(3) { left: 12%; top: 27%; } .torche-fond li:nth-child(4) { right: 9%; top: 32%; }
.torche-fond li:nth-child(5) { left: 3%; top: 46%; } .torche-fond li:nth-child(6) { right: 3%; top: 52%; }
.torche-fond li:nth-child(7) { left: 10%; top: 65%; } .torche-fond li:nth-child(8) { right: 12%; top: 70%; }
.torche-fond li:nth-child(9) { left: 5%; top: 83%; } .torche-fond li:nth-child(10) { right: 5%; top: 86%; }
.torche-voile { position: absolute; inset: 0; background: radial-gradient(circle var(--rayon) at var(--lx) var(--ly), transparent 0, rgba(0, 0, 0, .28) 55%, rgba(0, 0, 0, .965) 100%); transition: opacity .8s; pointer-events: none; }
.torche-texte { position: absolute; left: 50%; bottom: 5.5rem; translate: -50% 0; width: min(92%, 520px); text-align: center; padding: 1.3rem 1.2rem; border-radius: 1.4rem; background: rgba(0, 0, 0, .82); border: 1px solid color-mix(in srgb, var(--accent) 45%, transparent); transition: opacity .4s; }
.torche-texte h2 { font-size: clamp(1.6rem, 4vw, 2.5rem); text-transform: uppercase; margin-bottom: .4rem; }
.torche-texte .bouton { margin-top: .9rem; }
.torche.allumee .torche-voile { opacity: 0; }
html:not(.js) .torche { display: none; }

@media (max-width: 760px) {
  .torche-fond img { height: auto; width: 82%; top: 36%; }
  .torche-texte { bottom: 1.2rem; padding: 1rem; }
}

/* ---------- Bureau d'embauche ---------- */
.contrat { position: relative; margin: 1.6rem 0 .4rem; padding: 1.8rem 1.2rem 4.8rem; border-radius: 1.2rem; border: 2px dashed color-mix(in srgb, var(--accent) 55%, transparent); background: radial-gradient(90% 70% at 50% 100%, rgba(122, 84, 24, .35), transparent 70%); min-height: 20rem; display: flex; flex-direction: column; justify-content: center; align-items: center; }
.niveau-poste { font-weight: 700; letter-spacing: .12em; text-transform: uppercase; font-size: 1rem; color: var(--doux); }
.contrat .poste { margin: .5rem 0; }
.mission { max-width: 36ch; font-size: 1.22rem; min-height: 3.4em; }
.contrat.melange .poste { filter: blur(1.5px); opacity: .8; }
.contrat.melange { animation: secousse .18s steps(2) infinite; }
.tampon { position: absolute; right: 1rem; bottom: 1rem; padding: .35rem .9rem; border: 4px double var(--accent); border-radius: .5rem; font: 900 1.4rem var(--titres); text-transform: uppercase; color: var(--accent); rotate: -12deg; opacity: 0; scale: 3; }
.contrat.signe .tampon { animation: tampon .45s cubic-bezier(.2, 1.6, .4, 1) .15s forwards; }
@keyframes tampon { to { opacity: 1; scale: 1; } }
.mouches i { position: absolute; width: 7px; height: 5px; border-radius: 50%; background: #d9d4c7; box-shadow: 0 0 6px #d9d4c7; left: 8%; top: 16%; opacity: 0; }
.contrat.signe .mouches i { opacity: .8; animation: mouche 4.2s ease-in-out infinite; }
.contrat.signe .mouches i:nth-child(2) { left: 88%; top: 22%; animation-duration: 3.4s; animation-delay: -1.1s; }
.contrat.signe .mouches i:nth-child(3) { left: 14%; top: 80%; animation-duration: 5s; animation-delay: -2s; }
.contrat.signe .mouches i:nth-child(4) { left: 64%; top: 8%; animation-duration: 3.8s; animation-delay: -.5s; }
@keyframes mouche { 20% { translate: 34px -18px; } 40% { translate: -12px 26px; } 60% { translate: 40px 16px; } 80% { translate: -30px -22px; } }
html:not(.js) .registre[hidden] { display: grid !important; gap: 1rem; margin-top: 1.5rem; text-align: left; }
html:not(.js) .registre li span, html:not(.js) .registre li i { display: block; }
html:not(.js) .contrat, html:not(.js) [data-tirer] { display: none; }

/* Coordonnées affichées au clic */
.lien-masque { padding: 0; font-weight: 700; text-decoration: underline; text-underline-offset: .2em; color: var(--accent); }
html:not(.js) .lien-masque { cursor: default; text-decoration: none; }

/* ---------- Bouton du son ---------- */
.son { position: fixed; z-index: 46; right: max(.8rem, env(safe-area-inset-right)); bottom: max(1rem, env(safe-area-inset-bottom)); display: flex; align-items: center; gap: .7rem; min-width: 52px; min-height: 52px; justify-content: center; padding: 0 1.1rem; border-radius: 999px; background: rgba(10, 10, 18, .86); color: #fff; border: 1.5px solid color-mix(in srgb, var(--accent) 70%, #fff 10%); box-shadow: 0 12px 30px -10px rgba(0, 0, 0, .7); font-weight: 700; font-size: 1rem; transition: translate .3s var(--courbe); }
.son:hover { translate: 0 -3px; }
.son:not(.joue) { animation: appel 2.6s ease-out 1.5s 3; }
@keyframes appel { 0% { outline: 2px solid rgba(240, 169, 59, .9); outline-offset: 0; } 60%, 100% { outline: 2px solid rgba(240, 169, 59, 0); outline-offset: 14px; } }
.barres { display: flex; align-items: center; gap: 3px; height: 18px; }
.barres i { width: 3px; height: 5px; border-radius: 3px; background: #f0a93b; }
.son.joue .barres i { animation: vumetre .9s ease-in-out infinite alternate; }
.son.joue .barres i:nth-child(2) { animation-duration: .6s; }
.son.joue .barres i:nth-child(3) { animation-duration: 1.15s; }
.son.joue .barres i:nth-child(4) { animation-duration: .75s; }
@keyframes vumetre { to { height: 18px; } }
@media (max-width: 760px) { .son { width: 52px; padding: 0; } .son-texte { display: none; } }

/* Empreintes de pattes (page des chats) */
.patte { position: fixed; z-index: 44; width: 30px; height: 30px; margin: -15px 0 0 -15px; pointer-events: none; color: var(--accent); animation: patte 1.6s ease-out forwards; }
@keyframes patte { from { opacity: .75; scale: .6; } 20% { scale: 1; } to { opacity: 0; scale: 1; } }

@media (prefers-reduced-motion: reduce) {
  .halo, .patte, .lecture { display: none; }
  .js .calendrier .feuillet { transform: none; opacity: 1; }
  .torche-voile { opacity: 0; }
  .torche-texte p:not(.surtitre), .torche [data-eclairer] { display: none; }
}

/* ============ « Tout ce qu'il faut savoir » : bureau en cuir, papier, kraft et cire ============ */

body.theme-papier {
  --fond: #2a170f; --texte: #fbefd9; --doux: #e3cfae; --carte: rgba(255, 236, 205, .07); --bord: rgba(240, 205, 150, .24);
  --accent: #eab762; --bouton: #93222a; --sur-accent: #fff3dc;
  --titres: Georgia, "Iowan Old Style", "Times New Roman", serif;
  background: #2a170f url("/assets/img-cuir.1ec8e685.webp") repeat;
}
.theme-papier .entete { background: rgba(32, 17, 10, .9); box-shadow: 0 1px 0 rgba(240, 205, 150, .2), 0 10px 26px -18px #000; }
.theme-papier .bouton { box-shadow: inset 0 1px 0 rgba(255, 255, 255, .18), 0 10px 22px -14px #000; }
.theme-papier .bouton:hover { box-shadow: inset 0 1px 0 rgba(255, 255, 255, .25), 0 16px 30px -12px #000; }
.theme-papier .bouton-contour { background: transparent; color: var(--texte); border-color: color-mix(in srgb, var(--texte) 45%, transparent); box-shadow: none; }
.theme-papier .pied { background: rgba(20, 10, 6, .55); }
.theme-papier .achat-flottant { border: 1px solid rgba(255, 225, 180, .35); }

/* Surpiqûre de maroquinerie entre les grandes parties */
.theme-papier .heros-savoir, .theme-papier .lettre, .theme-papier .mois { position: relative; }
.theme-papier .heros-savoir::after, .theme-papier .lettre::after, .theme-papier .mois::after { content: ""; position: absolute; left: 4%; right: 4%; bottom: 8px; border-bottom: 2px dashed rgba(224, 180, 118, .38); pointer-events: none; }

/* Lumière de lampe sur le bureau */
.theme-papier .heros-savoir { background: radial-gradient(58% 75% at 76% 42%, rgba(255, 190, 105, .34), transparent 70%), radial-gradient(120% 100% at 50% 40%, transparent 45%, rgba(10, 4, 1, .62)); }
.theme-papier .heros-savoir h1 em { color: #eab762; }
.theme-papier .heros-savoir h1 { text-shadow: 0 2px 18px rgba(0, 0, 0, .45); }
.theme-papier .ombre { background: rgba(0, 0, 0, .6); }
/* Petite enveloppe cachetée, sous le bouton de commande : elle mène à la lettre */
.heros-savoir .actions { flex-direction: column; align-items: flex-start; gap: 1.8rem; }
.mini-pli { display: flex; align-items: center; gap: 1.4rem; text-decoration: none; }
.mini-env { position: relative; flex: none; width: 150px; aspect-ratio: 1.55; border-radius: 5px; background: url("/assets/img-kraft.62d12873.webp"); box-shadow: 0 18px 22px -12px #000, inset 0 0 22px rgba(80, 45, 15, .35); rotate: -5deg; transition: rotate .4s var(--courbe), translate .4s var(--courbe); }
.mini-env::before { content: ""; position: absolute; inset: 0; clip-path: polygon(0 0, 100% 0, 50% 62%); border-radius: inherit; background: linear-gradient(rgba(255, 232, 195, .22), rgba(80, 45, 15, .3) 62%), url("/assets/img-kraft.62d12873.webp"); filter: drop-shadow(0 3px 3px rgba(45, 22, 6, .4)); }
.mini-env i { position: absolute; left: 50%; top: 58%; width: 34%; aspect-ratio: 1; translate: -50% -50%; background: url("/assets/img-sceau.117e4675.webp") center / contain no-repeat; filter: drop-shadow(0 4px 4px rgba(0, 0, 0, .5)); transition: scale .35s cubic-bezier(.3, 1.7, .5, 1); }
.mini-texte { font-weight: 700; text-decoration: underline; text-underline-offset: .3em; text-decoration-color: rgba(234, 183, 98, .7); }
.mini-texte b { display: block; font: italic 400 1.3rem/1.3 var(--titres); color: #eab762; }
.mini-pli:hover .mini-env { rotate: 0deg; translate: 0 -6px; }
.mini-pli:hover .mini-env i { scale: 1.18; }
@media (max-width: 420px) { .mini-env { width: 112px; } .mini-pli { gap: 1rem; } }
/* Écrans peu hauts : tout le haut de page, enveloppe comprise, tient à l'écran. */
@media (min-width: 900px) and (max-height: 960px) {
  .heros-savoir .heros-grille { padding-block: 1.4rem; }
  .heros-savoir h1 { font-size: min(4.4rem, 7.2vh); margin-bottom: .8rem; }
  .heros-savoir .heros-intro { font-size: 1.1rem; line-height: 1.5; max-width: 44ch; }
  .heros-savoir .surtitre { margin-bottom: .5rem; }
  .heros-savoir .actions { margin-top: 1.1rem; gap: 1.1rem; }
  .heros-savoir .mini-env { width: 118px; }
}

/* ---------- Feuilles de papier posées sur le cuir ---------- */
.theme-papier .test, .theme-papier .bascule, .theme-papier .galerie, .theme-papier .recit, .theme-papier .avis, .theme-papier .formats {
  --texte: #2a1b12; --doux: #5c483a; --carte: #fffaf0; --bord: rgba(92, 58, 30, .2); --accent: #8a1c22;
  position: relative; color: var(--texte); max-width: min(1180px, calc(100% - 2 * clamp(.6rem, 3vw, 2rem)));
  margin: clamp(2rem, 5vw, 4.5rem) auto; padding: clamp(2.6rem, 6vw, 5rem) clamp(1.1rem, 4.5vw, 4rem);
  background: radial-gradient(110% 100% at 50% 30%, transparent 55%, rgba(150, 105, 50, .2)), url("/assets/img-papier.036c1727.webp");
  border-radius: 5px; box-shadow: 0 2px 0 #cdb58e, 0 5px 0 #b89c74, 0 34px 50px -22px rgba(0, 0, 0, .85);
}
.theme-papier .recit { max-width: min(900px, calc(100% - 1.2rem)); rotate: -.5deg; }
.theme-papier .recit-texte p.signature { padding-right: 90px; }
.theme-papier .recit::after { content: ""; position: absolute; right: -6px; bottom: -22px; width: clamp(90px, 12vw, 140px); aspect-ratio: 1; background: url("/assets/img-sceau.117e4675.webp") center / contain no-repeat; filter: drop-shadow(0 8px 8px rgba(0, 0, 0, .45)); rotate: -14deg; }
.theme-papier .surtitre { color: var(--accent); }
.theme-papier .titre-section { text-wrap: balance; }

@media (max-width: 760px) {
  /* Sur téléphone, la lettre et son sceau restent dans la largeur de l'écran. */
  .theme-papier .recit { rotate: none; }
  .theme-papier .recit::after { right: .5rem; }
}

/* Test : cases cachetées à la cire */
.theme-papier .test-liste label { background: var(--carte); }
.theme-papier .test-liste label:hover { border-color: #a9753d; }
.theme-papier .test-liste label:has(input:checked) { background: #f6e6c8; border-color: #a9753d; }
.theme-papier .coche { border-radius: 50%; width: 2rem; height: 2rem; }
.theme-papier .test-liste input:checked + .coche { background: url("/assets/img-sceau.117e4675.webp") center / 118% no-repeat; border-color: transparent; }
.theme-papier .test-liste input:checked + .coche::after { display: none; }
.theme-papier .test-liste input:checked + .coche { animation: cachet .4s cubic-bezier(.3, 1.8, .5, 1); }
@keyframes cachet { from { scale: 2.2; opacity: 0; } }
.theme-papier .test-resultat { background: url("/assets/img-cuir.1ec8e685.webp"); box-shadow: inset 0 0 0 7px rgba(0, 0, 0, .18), inset 0 0 0 9px rgba(224, 180, 118, .45), 0 20px 30px -20px #000; border-radius: 1rem; --doux: #e3cfae; --accent: #eab762; --texte: #fbefd9; color: #fbefd9; }
.theme-papier .jauge { background: radial-gradient(closest-side, #2f1a10 79%, transparent 80%), conic-gradient(#eab762 calc(var(--part) * 1%), rgba(255, 236, 205, .16) 0); }

/* Avant, après */
.theme-papier .interrupteur button[aria-pressed="true"] { background: #4a2a1a; color: #fbefd9; }
.theme-papier .fiche { background: url("/assets/img-papier.036c1727.webp"), #fffaf0; border-radius: .5rem; border-top-color: #8a1c22; }
.theme-papier .bascule[data-etat="avec"] .fiche { border-top-color: #b78433; }

/* Photos tirées sur papier */
.theme-papier .vignette { background: #fffdf7; padding: 10px; border-radius: 6px; box-shadow: 0 20px 28px -20px rgba(40, 20, 5, .8); }
.theme-papier .vignette img { border-radius: 2px; }
.theme-papier .vignette:nth-child(2) { rotate: -.8deg; }
.theme-papier .vignette:nth-child(3) { rotate: .8deg; }
.theme-papier .loupe { background: rgba(60, 32, 18, .92); }
.theme-papier .loupe-fenetre::backdrop { background: rgba(22, 10, 4, .92); }

/* Avis et formats sur kraft */
.theme-papier .avis li a, .theme-papier .format { background: url("/assets/img-kraft.62d12873.webp"); border-color: rgba(80, 45, 15, .3); border-radius: .6rem; box-shadow: inset 0 0 34px rgba(95, 55, 20, .28), 0 18px 26px -20px rgba(40, 20, 5, .9); --accent: #5e1015; --doux: #34200f; color: #24150b; }
.theme-papier .avis a span, .theme-papier .format .carte-lien { color: #4f0c11; }
.theme-papier .format { position: relative; padding-right: 2.4rem; }
.theme-papier .format::after { content: ""; position: absolute; top: -16px; right: -12px; width: 66px; aspect-ratio: 1; background: url("/assets/img-sceau.117e4675.webp") center / contain no-repeat; filter: drop-shadow(0 5px 5px rgba(0, 0, 0, .4)); scale: 0; rotate: -50deg; transition: scale .45s cubic-bezier(.3, 1.7, .5, 1), rotate .45s; }
.theme-papier .format:hover::after, .theme-papier .format:focus-visible::after { scale: 1; rotate: 8deg; }
.theme-papier .format:hover { border-color: #8a1c22; }
.theme-papier .formats .carte-lien { margin-top: auto; }

/* ---------- L'enveloppe à décacheter ---------- */
.lettre { text-align: center; padding: clamp(3.5rem, 8vw, 6rem) var(--marge) clamp(4rem, 8vw, 6rem); background: radial-gradient(55% 60% at 50% 62%, rgba(255, 190, 105, .24), transparent 72%); }
.lettre .titre-section { margin-inline: auto; margin-bottom: .8rem; }
.lettre-consigne { color: var(--doux); font-size: 1.18rem; }
.pli { position: relative; width: min(100%, 580px); margin: 3rem auto 0; perspective: 1400px; }
.enveloppe { position: relative; aspect-ratio: 1.55; filter: drop-shadow(0 34px 28px rgba(0, 0, 0, .6)); }
.enveloppe > span { position: absolute; inset: 0; background: url("/assets/img-kraft.62d12873.webp"); }
.env-dos { border-radius: 8px; filter: brightness(.68); }
.env-poche { z-index: 3; border-radius: 8px; clip-path: polygon(0 0, 50% 54%, 100% 0, 100% 100%, 0 100%); }
.env-poche::before { content: ""; position: absolute; inset: 0; background: linear-gradient(to top right, transparent 49.7%, rgba(255, 233, 200, .35) 50%, rgba(80, 45, 15, .22) 50.8%, transparent 58%) left bottom / 50% 100% no-repeat, linear-gradient(to top left, transparent 49.7%, rgba(255, 233, 200, .35) 50%, rgba(80, 45, 15, .22) 50.8%, transparent 58%) right bottom / 50% 100% no-repeat; box-shadow: inset 0 0 50px rgba(90, 50, 18, .4); }
.env-rabat { z-index: 5; transform-origin: top; transition: transform .8s var(--courbe), z-index 0s .35s; }
.enveloppe > .env-rabat { background: none; }
.env-rabat::before { content: ""; position: absolute; inset: 0; clip-path: polygon(0 0, 100% 0, 53% 59%, 50% 61%, 47% 59%); background: linear-gradient(180deg, rgba(255, 232, 195, .16), rgba(80, 45, 15, .28) 62%), url("/assets/img-kraft.62d12873.webp"); }
.env-rabat { filter: drop-shadow(0 5px 5px rgba(45, 22, 6, .45)); }
.sceau { position: absolute; z-index: 6; left: 50%; top: 59%; translate: -50% -50%; width: 25%; aspect-ratio: 1; padding: 0; border-radius: 50%; filter: drop-shadow(0 9px 9px rgba(0, 0, 0, .5)); transition: scale .3s var(--courbe); }
.sceau:hover { scale: 1.08; }
.sceau i { position: absolute; inset: 0; background: url("/assets/img-sceau.117e4675.webp") center / contain no-repeat; transition: translate .8s var(--courbe), rotate .8s var(--courbe), opacity .6s .35s; }
.sceau i:nth-of-type(1) { clip-path: polygon(0 0, 54% 0, 45% 30%, 56% 52%, 44% 74%, 50% 100%, 0 100%); }
.sceau i:nth-of-type(2) { clip-path: polygon(54% 0, 100% 0, 100% 100%, 50% 100%, 44% 74%, 56% 52%, 45% 30%); }
.sceau:not([disabled])::after { content: ""; position: absolute; inset: 4%; border-radius: 50%; animation: appel-sceau 2.4s ease-out infinite; }
@keyframes appel-sceau { 0% { box-shadow: 0 0 0 0 rgba(234, 183, 98, .85); } 80%, 100% { box-shadow: 0 0 0 26px rgba(234, 183, 98, 0); } }
/* La « fente » coupe tout ce qui passerait sous l'enveloppe ; la lettre ne sort que par le haut.
   Son bas, vide, reste glissé dans la poche (66 % de sa largeur = la hauteur de l'enveloppe). */
.fente { position: absolute; z-index: 2; left: 6%; right: 6%; bottom: 4%; top: -300%; display: flex; flex-direction: column; justify-content: flex-end; overflow: hidden; pointer-events: none; }
.billet { flex: none; pointer-events: auto; scroll-margin-top: 90px; padding: clamp(1.1rem, 4vw, 2.2rem) clamp(1.1rem, 4vw, 2.4rem) 66%; display: flex; flex-direction: column; gap: .8rem; text-align: left; color: #2a1b12; background: url("/assets/img-papier.036c1727.webp"); border-radius: 4px 4px 0 0; box-shadow: 0 0 20px rgba(40, 20, 5, .45); visibility: hidden; }
.billet p { font: italic clamp(1.02rem, 2.4vw, 1.3rem)/1.55 var(--titres); }
.billet .billet-fin { text-align: right; }
.billet .bouton { align-self: center; margin-top: .6rem; font-style: normal; }
.ouverte .sceau { pointer-events: none; }
.ouverte .sceau::after { display: none; }
.ouverte .sceau i:nth-of-type(1) { translate: -46% 22%; rotate: -34deg; opacity: 0; }
.ouverte .sceau i:nth-of-type(2) { translate: 46% 28%; rotate: 30deg; opacity: 0; }
.ouverte .env-rabat { transform: rotateX(178deg); z-index: 1; transition: transform .9s var(--courbe) .35s, z-index 0s .8s; }
.ouverte .billet { visibility: visible; animation: sortir 1.5s var(--courbe) 1s both; }
@keyframes sortir { from { transform: translateY(var(--sortie, 300px)); } to { transform: none; } }
/* La place se libère au-dessus de l'enveloppe pendant que la lettre monte. */
.pli { transition: margin 1.5s var(--courbe) 1s; }
.pli.ouverte { margin-top: calc(var(--sortie, 300px) + .5rem); }
html:not(.js) .fente { position: static; overflow: visible; margin-top: 1.5rem; }
html:not(.js) .billet { visibility: visible; padding-bottom: 1.5rem; }
html:not(.js) .sceau, html:not(.js) .lettre-consigne { display: none; }

/* ---------- Chaos sur le cuir, ordre sur la feuille ---------- */
.theme-papier .chaos-scene { background: url("/assets/img-cuir.1ec8e685.webp"); color: #fbefd9; }
.theme-papier .chaos-scene::before { background: radial-gradient(60% 60% at 50% 55%, rgba(158, 30, 28, .6), transparent 70%), rgba(10, 3, 1, .45); }
.theme-papier .chaos-scene::after { content: ""; position: absolute; inset: .7rem clamp(.5rem, 3vw, 2.5rem); border-radius: 6px; background: radial-gradient(110% 100% at 50% 35%, transparent 55%, rgba(150, 105, 50, .24)), url("/assets/img-papier.036c1727.webp"); box-shadow: 0 5px 0 #b89c74, 0 30px 46px -18px rgba(0, 0, 0, .85); opacity: var(--f); transform: translateY(calc((1 - var(--f)) * 40px)) rotate(calc((1 - var(--f)) * -2deg)); }
.theme-papier .chaos-titres, .theme-papier .chaos-plateau, .theme-papier .chaos-commandes { z-index: 3; }
.theme-papier .chaos.range .chaos-scene { color: #2a1b12; }
.theme-papier .titre-avant span { color: #ffc0a8; }
.theme-papier .titre-apres span { color: #8a1c22; }
.theme-papier .note { background: url("/assets/img-papier.036c1727.webp"), #fffaf0; font-family: var(--titres); font-style: italic; color: #4a130d; border-radius: 3px; }
.theme-papier .note:nth-child(3n) { background: url("/assets/img-kraft.62d12873.webp"); color: #24150b; }
.theme-papier .note .rubrique { color: #2a1b12; font-style: normal; font-family: var(--corps); }
.theme-papier .note b { display: inline-block; width: 1.35em; height: 1.35em; margin-right: .25em; vertical-align: -.3em; background: url("/assets/img-sceau.117e4675.webp") center / contain no-repeat; font-size: 1rem; color: transparent; }
.theme-papier .note.rangee { background: #fffdf6; box-shadow: 0 8px 18px -12px rgba(60, 35, 10, .75), inset 0 0 0 1.5px #b78433; }
.theme-papier .chaos-barre i { background: linear-gradient(90deg, #9d2a24, #c9822f, #dcae52); }
.theme-papier .chaos.fixe .chaos-scene { background: url("/assets/img-papier.036c1727.webp"); color: #2a1b12; }
html:not(.js) .theme-papier .chaos-scene { color: #2a1b12; }
.theme-papier .chaos.fixe .chaos-scene::before, .theme-papier .chaos.fixe .chaos-scene::after { display: none; }

/* ---------- Six mois gagnés ---------- */
.theme-papier .mois { background: radial-gradient(60% 55% at 50% 22%, rgba(255, 190, 105, .22), transparent 70%), linear-gradient(rgba(10, 4, 1, .35), rgba(10, 4, 1, .35)), url("/assets/img-cuir.1ec8e685.webp"); color: #fbefd9; --doux: #e3cfae; --accent: #eab762; --texte: #fbefd9; }
.theme-papier .mois-chiffre { color: #eab762; text-shadow: 0 8px 30px rgba(0, 0, 0, .55); }
.theme-papier .mois-texte strong { color: #eab762; }
.theme-papier .feuillet { background: url("/assets/img-papier.036c1727.webp"), #fffaf0; color: #2a1b12; border-top-color: #8a1c22; border-radius: .4rem; }
.theme-papier .feuillet em { color: #8a1c22; }
.theme-papier .mois .bouton { --bouton: #93222a; color: #fff3dc; }

@media (prefers-reduced-motion: reduce) {
  .ouverte .billet { animation: none; }
}
