/* Le livre — on le feuillette pour de vrai */

.atelier { position: fixed; inset: 0; display: grid; grid-template-columns: 1fr min(420px, 34vw); }
.etabli { position: relative; display: grid; place-items: center; padding: 110px var(--g) 130px; overflow: hidden; touch-action: none; cursor: grab; }
.etabli:active { cursor: grabbing; }
.etabli::before { content: ""; position: absolute; inset: 0; background: url("../assets/lin.svg"); opacity: .25; mix-blend-mode: multiply; pointer-events: none; }
.etabli__lumiere { position: absolute; width: 90vmax; height: 90vmax; left: 10%; top: -40%; border-radius: 50%; background: radial-gradient(closest-side, rgba(255,214,170,.5), transparent 70%); pointer-events: none; mix-blend-mode: soft-light; }

/* ── le livre ── */
.livre { --pw: 300px; --ph: 400px; position: relative; width: calc(var(--pw) * 2); height: var(--ph); perspective: 2600px; transform: translateX(var(--decal, 0)); transition: transform .9s var(--doux); }
.livre__ombre { position: absolute; inset: 3% 2% -4%; background: rgba(36,21,16,.38); filter: blur(28px); border-radius: 4px; transition: inset .9s var(--doux), opacity .6s; z-index: -1; }
.livre[data-etat="ferme"] .livre__ombre { inset: 3% 2% -4% 52%; }
.livre[data-etat="fini"] .livre__ombre { inset: 3% 52% -4% 2%; }
/* l'épaisseur des pages restantes, à droite / tournées, à gauche */
.livre__tranche { position: absolute; top: 4px; bottom: -4px; width: 10px; z-index: 0; border-radius: 0 3px 3px 0;
  background: repeating-linear-gradient(90deg, #f6f0e7 0 1px, #ddd2c4 1px 2px); box-shadow: 0 2px 6px rgba(36,21,16,.25); transition: width .6s var(--doux); }
.livre__tranche--d { left: calc(100% - 2px); width: var(--ep-d, 10px); }
.livre__tranche--g { right: calc(100% - 2px); width: var(--ep-g, 0px); border-radius: 3px 0 0 3px; }

.feuille { position: absolute; top: 0; left: 50%; width: var(--pw); height: 100%; transform-style: preserve-3d; transform-origin: left center;
  transition: transform .95s cubic-bezier(.45, .05, .2, 1); will-change: transform; }
.feuille.tournee { transform: rotateY(-180deg); }
.feuille.vite { transition-duration: .55s; }
.cote { position: absolute; inset: 0; backface-visibility: hidden; -webkit-backface-visibility: hidden; overflow: hidden; background: var(--papier-clair); }
.cote--verso { transform: rotateY(180deg); }
.cote::after { content: ""; position: absolute; inset: 0; pointer-events: none; }
.cote--recto::after { background: linear-gradient(90deg, rgba(36,21,16,.28), rgba(36,21,16,.06) 5%, transparent 14%, transparent 92%, rgba(255,255,255,.08)); }
.cote--verso::after { background: linear-gradient(270deg, rgba(36,21,16,.28), rgba(36,21,16,.06) 5%, transparent 14%); }
.cote img { width: 100%; height: 100%; object-fit: cover; }
.cote img.moitie { position: absolute; top: 0; width: 200%; max-width: none; }
.cote--recto img.moitie { left: -100%; }
.cote--verso img.moitie { left: 0; }
.cote--blanc { background: var(--papier-clair) url("../assets/papier.svg"); }
.cote--garde { background: var(--lin) url("../assets/lin.svg"); }
/* la lumière qui glisse sur la feuille pendant qu'elle tourne */
.feuille .reflet { position: absolute; inset: 0; z-index: 3; pointer-events: none; opacity: 0; background: linear-gradient(90deg, transparent, rgba(255,255,255,.35) 50%, transparent); transition: opacity .5s; }
.feuille.en-vol .reflet { opacity: 1; }

/* couverture */
.couv { background: var(--lin); color: var(--brique); }
.couv::before { content: ""; position: absolute; inset: 0; background: url("../assets/lin.svg"); opacity: .75; mix-blend-mode: multiply; }
.couv__titre { position: absolute; left: 6.8%; top: 7%; font-family: var(--f-titre); text-transform: uppercase; line-height: .82; }
.couv__titre b { display: block; font-weight: 400; font-size: calc(var(--pw) * .4); text-shadow: 0 1px 0 rgba(255,255,255,.25), 0 -1px 0 rgba(60,10,0,.25); }
.couv__titre .n2 { padding-left: .43em; position: relative; }
.couv__titre .n2 .arche { position: absolute; left: .03em; width: .36em; height: .66em; top: .13em; }
.couv__titre .n2 .arche path:first-child { fill: var(--lin); }
.couv__titre .n2 .arche .soleil { stroke: var(--brique); }
.couv__titre .n3 { font-size: calc(var(--pw) * .21) !important; margin-top: .12em; }
.couv__auteur { position: absolute; bottom: 5%; width: 100%; text-align: center; font: 400 calc(var(--pw) * .034) var(--f-titre); letter-spacing: .08em; }
.couv__invite { position: absolute; right: 8%; bottom: 14%; font: 400 calc(var(--pw) * .085)/1 var(--f-main); color: var(--brique); transform: rotate(-6deg); animation: invite 2.6s var(--doux) infinite; }
@keyframes invite { 50% { transform: rotate(-6deg) translateX(8px); } }
.quatrieme { background: var(--lin); display: grid; place-items: center; }
.quatrieme::before { content: ""; position: absolute; inset: 0; background: url("../assets/lin.svg"); opacity: .75; mix-blend-mode: multiply; }
.quatrieme .arche { position: relative; width: calc(var(--pw) * .1); height: calc(var(--pw) * .17); color: var(--brique); }

/* page 1 : le statement */
.statement { background: var(--papier-clair) url("../assets/papier.svg"); display: grid; place-items: center; text-align: center; padding: 14%; color: var(--brique); font: 400 calc(var(--pw) * .052)/1.05 var(--f-main); }
.statement .arche { width: calc(var(--pw) * .06); height: calc(var(--pw) * .1); margin: 0 auto calc(var(--pw) * .04); display: block; }

/* la page des remerciements : là où ton prénom s'écrit */
.merci-page { background: var(--papier-clair) url("../assets/papier.svg"); padding: 13% 12%; display: flex; flex-direction: column; color: var(--brique); }
.merci-page__titre { font: 400 calc(var(--pw) * .085)/.9 var(--f-titre); text-transform: uppercase; letter-spacing: -.02em; }
.merci-page__sous { font: 400 calc(var(--pw) * .042)/1.2 var(--f-texte); font-style: italic; margin: 4% 0 7%; color: var(--sepia); }
.merci-page__noms { font: 400 calc(var(--pw) * .055)/1.1 var(--f-main); color: var(--sepia); display: flex; flex-wrap: wrap; gap: 2% 7%; }
.merci-page__toi { margin-top: auto; position: relative; min-height: 26%; display: grid; align-items: end; }
.merci-page__toi svg { width: 100%; height: calc(var(--pw) * .22); overflow: visible; }
.merci-page__toi text { font-family: var(--f-main); font-size: calc(var(--pw) * .16); fill: var(--brique); fill-opacity: 0; stroke: var(--brique); stroke-width: .7; stroke-dasharray: 900; stroke-dashoffset: 900; }
.merci-page__toi text.ecrit { animation: plume 2.2s var(--doux) forwards; }
@keyframes plume { 70% { fill-opacity: 0; } to { stroke-dashoffset: 0; fill-opacity: 1; } }
.merci-page__ligne { border-bottom: 1px dashed color-mix(in srgb, var(--brique) 45%, transparent); }
.merci-page__fantome { font: 400 calc(var(--pw) * .06)/1 var(--f-main); color: color-mix(in srgb, var(--brique) 40%, transparent); padding-bottom: 4%; }
.merci-page__fonds { position: absolute; top: 10%; right: 9%; padding: 4px 8px; border: 1.5px solid var(--flash); color: var(--flash); font: 400 calc(var(--pw) * .026) var(--f-mono); letter-spacing: .08em; text-transform: uppercase; transform: rotate(7deg) scale(1.6); opacity: 0; transition: transform .5s cubic-bezier(.3, 1.6, .4, 1), opacity .3s; }
.merci-page__fonds.tamponne { transform: rotate(7deg) scale(1); opacity: 1; }
.folio { position: absolute; bottom: 3.2%; font: 400 calc(var(--pw) * .024) var(--f-mono); color: color-mix(in srgb, var(--encre) 50%, transparent); z-index: 2; }
.cote--recto .folio { right: 6%; } .cote--verso .folio { left: 6%; }

/* ── sous le livre : la pellicule des planches ── */
.navigation { position: absolute; left: var(--g); right: var(--g); bottom: 26px; display: grid; grid-template-columns: auto 1fr auto; gap: 18px; align-items: center; }
.navigation .rond { height: 34px; min-width: 34px; padding: 0; }
.bande { position: relative; height: 54px; overflow: hidden; -webkit-mask: linear-gradient(90deg, transparent, #000 8%, #000 92%, transparent); mask: linear-gradient(90deg, transparent, #000 8%, #000 92%, transparent); }
.bande__piste { position: absolute; left: 0; top: 0; display: flex; gap: 4px; height: 100%; transition: transform .8s var(--doux); }
.bande button { flex: none; height: 100%; aspect-ratio: 470/311; display: grid; grid-template-columns: 1fr 1fr; gap: 0; background: var(--papier-clair); opacity: .45; transition: opacity .3s, transform .4s var(--doux); padding: 0; border-radius: 1px; overflow: hidden; }
.bande button:hover { opacity: .85; transform: translateY(-3px); }
.bande button.ici { opacity: 1; box-shadow: 0 0 0 1.5px var(--flash); }
.bande button span { background-size: cover; background-position: center; }
.bande button span.d1 { grid-column: 1 / -1; }
.bande button.special { background: var(--lin); }
.navigation__folio { min-width: 120px; text-align: right; }

/* ── le comptoir : choisir son prix ── */
.comptoir { position: relative; z-index: 2; height: 100%; padding: 108px 28px 26px; display: flex; flex-direction: column; gap: 14px; background: var(--papier-clair); box-shadow: -30px 0 60px -40px rgba(36,21,16,.4); }
.comptoir::before { content: ""; position: absolute; inset: 0; background: url("../assets/papier.svg"); mix-blend-mode: multiply; opacity: .5; pointer-events: none; }
.comptoir > * { position: relative; }
.comptoir h1 { font-size: clamp(40px, 3.6vw, 62px); }
.comptoir h1 .arche { width: .34em; height: .64em; margin: 0 .04em; vertical-align: 0; }
.comptoir__chapeau { font-size: 18px; line-height: 1.25; color: var(--sepia); }
.prix { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; border-top: 1px solid color-mix(in srgb, var(--encre) 15%, transparent); padding-top: 14px; }
.prix__montant { font: 400 clamp(52px, 4.6vw, 76px)/.9 var(--f-titre); letter-spacing: -.04em; color: var(--brique); font-variant-numeric: tabular-nums; }
.prix__montant small { font-size: .28em; letter-spacing: .04em; }
.prix__nom { font: 400 30px/1 var(--f-main); color: var(--brique); text-align: right; }
.puces { display: flex; flex-wrap: wrap; gap: 6px; }
.puce { height: 34px; padding: 0 12px; border-radius: 2px; font: 400 12px var(--f-mono); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--encre) 22%, transparent); transition: .25s; }
.puce:hover { box-shadow: inset 0 0 0 1px var(--encre); }
.puce[aria-pressed="true"] { background: var(--encre); color: var(--papier); box-shadow: none; }
.puce--libre { display: inline-flex; align-items: center; gap: 4px; padding: 0 4px 0 10px; }
.puce--libre input { width: 64px; height: 32px; border: 0; background: none; font: inherit; outline: none; }
.puce--libre:focus-within { box-shadow: inset 0 0 0 1.5px var(--flash); }
input[type="range"].curseur-prix { -webkit-appearance: none; appearance: none; width: 100%; height: 28px; background: none; cursor: grab; }
input[type="range"].curseur-prix::-webkit-slider-runnable-track { height: 2px; background: linear-gradient(90deg, var(--brique) var(--p, 0%), color-mix(in srgb, var(--encre) 15%, transparent) var(--p, 0%)); }
input[type="range"].curseur-prix::-moz-range-track { height: 2px; background: color-mix(in srgb, var(--encre) 15%, transparent); }
input[type="range"].curseur-prix::-moz-range-progress { height: 2px; background: var(--brique); }
input[type="range"].curseur-prix::-webkit-slider-thumb { -webkit-appearance: none; width: 22px; height: 22px; margin-top: -10px; border-radius: 50%; background: var(--papier-clair); box-shadow: 0 0 0 1.5px var(--brique), 0 4px 12px rgba(36,21,16,.25); }
input[type="range"].curseur-prix::-moz-range-thumb { width: 20px; height: 20px; border-radius: 50%; border: 1.5px solid var(--brique); background: var(--papier-clair); }
.explique { font-size: 16px; line-height: 1.3; color: var(--sepia); min-height: 2.6em; }
.explique b { font-weight: 400; color: var(--brique); }
.monter { color: var(--flash); border-bottom: 1px solid; }
.prenom { display: grid; gap: 4px; overflow: hidden; max-height: 0; opacity: 0; transition: max-height .6s var(--doux), opacity .4s; }
.prenom.ouvert { max-height: 90px; opacity: 1; }
.prenom .champ input { font: 400 30px var(--f-main); color: var(--brique); height: 44px; }
.comptoir__bas { margin-top: auto; display: grid; gap: 10px; }
.comptoir__rassure { display: flex; justify-content: space-between; gap: 10px; opacity: .65; }

/* questions */
.questions { position: fixed; z-index: 90; right: 14px; bottom: 14px; top: 14px; width: min(520px, calc(100vw - 28px)); background: var(--papier-clair); border-radius: 6px; padding: 30px; overflow-y: auto; box-shadow: 0 40px 90px -20px rgba(36,21,16,.5); transform: translateX(calc(100% + 40px)); transition: transform .7s var(--doux); }
.questions.on { transform: none; }
.questions h2 { font-size: 44px; margin-bottom: 14px; }
.questions details { border-bottom: 1px solid color-mix(in srgb, var(--encre) 18%, transparent); }
.questions summary { list-style: none; cursor: pointer; padding: 16px 0; display: flex; justify-content: space-between; gap: 16px; font-size: 21px; }
.questions summary::-webkit-details-marker { display: none; }
.questions summary::after { content: "+"; font-family: var(--f-mono); color: var(--brique); transition: transform .3s; }
.questions details[open] summary::after { transform: rotate(45deg); }
.questions details p { padding: 0 0 18px; opacity: .85; font-size: 18px; }

@media (max-width: 900px) {
  .atelier { grid-template-columns: 1fr; }
  .etabli { padding: 96px 10px 250px; align-content: start; padding-top: 110px; }
  .navigation { bottom: 236px; grid-template-columns: auto 1fr auto; }
  .navigation__folio { display: none; }
  .bande { height: 40px; }
  .comptoir { position: fixed; left: 0; right: 0; bottom: 0; height: auto; max-height: 86svh; padding: 18px 18px 16px; gap: 10px; border-radius: 10px 10px 0 0; box-shadow: 0 -20px 50px -20px rgba(36,21,16,.4); transition: transform .6s var(--doux); }
  .comptoir:not(.deplie) .replie-cache { display: none; }
  .comptoir h1, .comptoir__chapeau, .comptoir__rassure { display: none; }
  .prix { border: 0; padding-top: 0; }
  .prix__montant { font-size: 46px; }
  .poignee { display: block !important; width: 44px; height: 4px; border-radius: 4px; background: color-mix(in srgb, var(--encre) 25%, transparent); margin: 0 auto 2px; }
}
.poignee { display: none; }
.comptoir__reglages { display: grid; gap: 10px; }
@media (max-width: 900px) { .aide-livre { display: none; } .comptoir:not(.deplie) .comptoir__reglages { display: none; } .comptoir:not(.deplie) .prix::after { content: "choisir mon prix ↑"; font: 400 11px var(--f-mono); text-transform: uppercase; letter-spacing: .06em; color: var(--brique); align-self: center; } .comptoir:not(.deplie) .prix__nom { display: none; } }
.colophon { background: var(--papier-clair) url("../assets/papier.svg"); display: grid; align-items: end; padding: 14%; font: 400 calc(var(--pw) * .028)/1.6 var(--f-mono); text-transform: uppercase; letter-spacing: .08em; color: var(--sepia); }

/* ── v3 : le shader prend le relais pendant le geste ── */
.en-gl { visibility: hidden; }
.sans-transition { transition: none !important; }
.gl-pages { position: absolute; }

/* ── v3 : les remerciements en trois listes ── */
.merci-page { padding: 11% 11% 8%; gap: 0; }
.merci-page__titre { margin-bottom: 6%; }
.liste { margin-bottom: 6%; transition: opacity .6s; }
.liste h4 { font: 400 calc(var(--pw) * .022)/1 var(--f-mono); letter-spacing: .14em; text-transform: uppercase; color: var(--sepia); margin-bottom: 2.4%; font-weight: 400; display: flex; align-items: center; gap: 8px; }
.liste h4::after { content: ""; flex: 1; height: 1px; background: color-mix(in srgb, var(--brique) 25%, transparent); }
.liste.ici h4 { color: var(--flash); }
.liste__noms { display: flex; flex-wrap: wrap; align-items: baseline; gap: .1em .5em; font-family: var(--f-main); color: var(--brique); line-height: 1; }
.liste--producteurs .liste__noms { font-size: calc(var(--pw) * .1); }
.liste--mecenes .liste__noms { font-size: calc(var(--pw) * .062); }
.liste--soutiens .liste__noms { font-size: calc(var(--pw) * .042); color: var(--sepia); }
.fantome-nom { display: inline-block; width: 3.2em; height: .1em; border-bottom: 1px dashed color-mix(in srgb, var(--brique) 28%, transparent); }
.toi { display: inline-block; height: 1.1em; }
.toi svg { height: 100%; width: auto; overflow: visible; }
.toi text { font-family: var(--f-main); font-size: 64px; fill: var(--brique); fill-opacity: 0; stroke: var(--brique); stroke-width: 1; stroke-dasharray: 1200; stroke-dashoffset: 1200; }
.liste--producteurs .toi text { stroke-width: 1.3; }
.toi text.ecrit { animation: plume 2.1s var(--doux) forwards; }
.toi.efface { animation: efface .8s var(--doux) forwards; }
@keyframes efface { to { opacity: 0; filter: blur(4px); transform: translateY(-6px); } }

/* ── v3 : choisir sa place ── */
.comptoir { gap: 12px; }
.comptoir h1 { font-size: clamp(34px, 2.8vw, 48px); }
.rangs { display: grid; gap: 6px; }
.rang { position: relative; display: grid; grid-template-columns: 1fr auto; grid-template-areas: "nom prix" "mot prix"; align-items: center; gap: 2px 12px; padding: 10px 14px; text-align: left; border-radius: 3px;
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--encre) 14%, transparent); transition: background .3s, box-shadow .3s, transform .4s var(--doux); }
.rang:hover { box-shadow: inset 0 0 0 1px var(--encre); transform: translateX(-3px); }
.rang__nom { grid-area: nom; }
.rang__nom em { font-style: normal; margin-left: 6px; padding: 2px 6px; background: var(--flash); color: var(--papier-clair); }
.rang__prix { grid-area: prix; font: 400 30px/1 var(--f-titre); letter-spacing: -.03em; color: var(--brique); }
.rang__prix small { font-size: .4em; }
.rang__mot { grid-area: mot; font: 400 22px/1 var(--f-main); color: var(--sepia); }
.rang[aria-checked="true"] { background: var(--encre); color: var(--papier); box-shadow: none; }
.rang[aria-checked="true"] .rang__prix, .rang[aria-checked="true"] .rang__mot { color: var(--papier-clair); }
.rang--vedette:not([aria-checked="true"]) { box-shadow: inset 0 0 0 1.5px var(--flash); }
.avantages { list-style: none; display: grid; gap: 4px; font-size: 16px; }
.avantages li { display: flex; gap: 8px; align-items: baseline; }
.avantages li span { width: 14px; color: var(--brique); }
.avantages li.non { color: color-mix(in srgb, var(--encre) 45%, transparent); }
.avantages li.non span { color: var(--flash); }
.avantages li button { margin-left: auto; color: var(--flash); border-bottom: 1px solid; font-size: 10.5px; }
.explique { min-height: 0; font-size: 15.5px; }
.monter { display: inline; text-align: left; color: var(--flash); border-bottom: 1px solid; font: inherit; }
.perte { color: var(--flash); font-style: italic; }
.libre { display: flex; gap: 12px; align-items: center; }
.libre .champ { flex: 1; }
.libre .champ input { height: 36px; }
@media (max-width: 900px) { .rang { padding: 8px 12px; } .rang__prix { font-size: 24px; } .rang__mot { font-size: 18px; } .avantages { font-size: 14px; } }
/* v3 : le comptoir tient sur un écran */
.comptoir { padding-top: 100px; gap: 10px; }
.comptoir h1, .comptoir__chapeau { display: none; }
.prix { border: 0; padding-top: 0; }
.prix__montant { font-size: clamp(46px, 3.8vw, 64px); }
.rang { padding: 7px 12px; }
.rang__prix { font-size: 26px; }
.rang__mot { font-size: 19px; }
.avantages { font-size: 14.5px; gap: 2px; }
.explique { font-size: 14.5px; line-height: 1.3; }
.prenom .champ input { height: 38px; font-size: 26px; }
.comptoir__bas { gap: 8px; }
.comptoir__titre { display: flex; justify-content: space-between; align-items: baseline; }
@media (max-height: 820px) { .avantages li.non { display: none; } }

/* v4 : la planche « la suite est dans le livre » */
.reste-g { background: var(--encre); padding: 0; }
.reste-g__grille { display: grid; grid-template-columns: repeat(6, 1fr); gap: 3px; padding: 3px; }
.reste-g__grille span { aspect-ratio: 1; background: #3a251c center / cover; opacity: .85; }
.reste-d { background: var(--papier-clair) url("../assets/papier.svg"); display: grid; align-items: center; padding: 12%; color: var(--brique); }
.reste-d__nombre { font: 400 calc(var(--pw) * .2)/.9 var(--f-titre); letter-spacing: -.04em; }
.reste-d__mot { font: 400 calc(var(--pw) * .03) var(--f-mono); letter-spacing: .1em; text-transform: uppercase; color: var(--sepia); margin: 2% 0 8%; }
.reste-d__main { font: 400 calc(var(--pw) * .07)/1 var(--f-main); transform: rotate(-3deg); margin-bottom: 10%; }
.reste-d .bouton { height: calc(var(--pw) * .1); font-size: calc(var(--pw) * .028); padding: 0 6%; }
