/* « Le projet » : la bibliothèque holographique (projet.js). Charte du site : crème, encre ardoise,
   rouge corail, turquoise ; titres Greed Condensed. Lumière turquoise, verre dépoli, un seul livre rouge. */

.prj { --holo: 0 154 172; --red-rgb: 234 80 75; display: grid; gap: 18px; position: relative; }
.prj-tete { display: grid; gap: 10px; max-width: 760px; }
.prj-kicker { margin: 0; font: 600 .82rem/1 var(--font-title, sans-serif); letter-spacing: .22em; text-transform: uppercase; color: var(--red, #ea504b); }
.prj-h1 { margin: 0; font: 900 clamp(2.4rem, 1.4rem + 4vw, 4.6rem)/.92 var(--font-title, sans-serif); text-transform: uppercase; color: var(--ink, #424047); letter-spacing: .01em; }
.prj-lede { margin: 0; font-size: 1.12rem; line-height: 1.5; color: var(--ink, #424047); max-width: 56ch; }
.prj-compte { margin: 0; font: 600 .95rem/1.3 var(--font-title, sans-serif); letter-spacing: .06em; text-transform: uppercase; color: var(--muted, #6c6a66); }
.prj-compte b { color: var(--teal, #009aac); font-weight: 900; }
/* .prj devant : .esp h2 du site fixerait la taille à 1,2rem */
.prj .prj-h2 { margin: 0; font: 900 clamp(1.9rem, 1.1rem + 2.6vw, 3.2rem)/.92 var(--font-title, sans-serif); text-transform: uppercase; color: var(--ink, #424047); letter-spacing: .01em; }
.prj-tete-props { margin-top: 36px; scroll-margin-top: 90px; }

/* ── La salle ───────────────────────────────────────────────────────────── */
.prj-salle {
  --rx: 0deg; --ry: 0deg; --lx: 50%; --ly: 40%;
  position: relative; overflow: hidden; isolation: isolate;
  min-height: clamp(430px, 64vh, 620px); display: grid; align-items: end;
  padding: 70px 0 64px; perspective: 1500px;
  background:
    radial-gradient(120% 80% at 50% 0%, #fff 0%, rgba(255,255,255,0) 60%),
    linear-gradient(180deg, #fdfcf9 0%, #f3f1ec 100%);
  border: 1px solid rgb(var(--holo) / .18);
}
.prj-salle::before { /* cadre lumineux */
  content: ""; position: absolute; inset: 10px; pointer-events: none; z-index: 3;
  border: 1px solid rgb(var(--holo) / .22);
  background:
    linear-gradient(90deg, rgb(var(--holo) / .9), rgb(var(--holo) / 0)) top left / 70px 2px no-repeat,
    linear-gradient(180deg, rgb(var(--holo) / .9), rgb(var(--holo) / 0)) top left / 2px 70px no-repeat,
    linear-gradient(270deg, rgb(var(--holo) / .9), rgb(var(--holo) / 0)) bottom right / 70px 2px no-repeat,
    linear-gradient(0deg, rgb(var(--holo) / .9), rgb(var(--holo) / 0)) bottom right / 2px 70px no-repeat;
}
.prj-sol { /* grille au sol, en perspective, qui défile doucement */
  position: absolute; left: -40%; right: -40%; bottom: -10%; height: 70%; z-index: 0; pointer-events: none;
  transform: rotateX(72deg); transform-origin: 50% 100%;
  background-image:
    linear-gradient(rgb(var(--holo) / .22) 1px, transparent 1px),
    linear-gradient(90deg, rgb(var(--holo) / .22) 1px, transparent 1px);
  background-size: 64px 64px;
  -webkit-mask-image: linear-gradient(0deg, #000 10%, transparent 85%); mask-image: linear-gradient(0deg, #000 10%, transparent 85%);
  animation: prj-sol 14s linear infinite;
}
@keyframes prj-sol { to { background-position: 0 64px, 0 0; } }
.prj-faisceaux { position: absolute; inset: 0; z-index: 0; pointer-events: none; }
.prj-faisceaux i {
  position: absolute; top: -10%; bottom: 20%; width: 18%; filter: blur(18px); opacity: .55;
  background: linear-gradient(180deg, rgb(var(--holo) / .22), rgb(var(--holo) / 0));
  transform: skewX(-12deg); animation: prj-faisceau 11s ease-in-out infinite alternate;
}
.prj-faisceaux i:nth-child(1) { left: 6%; }
.prj-faisceaux i:nth-child(2) { left: 32%; width: 10%; animation-delay: -3s; opacity: .4; }
.prj-faisceaux i:nth-child(3) { left: 58%; animation-delay: -6s; }
.prj-faisceaux i:nth-child(4) { left: 82%; width: 9%; animation-delay: -8s; opacity: .35; }
@keyframes prj-faisceau { to { transform: skewX(-12deg) translateX(40px); opacity: .25; } }
.prj-lueur { /* halo qui suit la main */
  position: absolute; inset: 0; z-index: 1; pointer-events: none;
  background: radial-gradient(360px circle at var(--lx) var(--ly), rgb(var(--holo) / .16), transparent 70%);
  transition: background .1s;
}

/* ── L'étagère ──────────────────────────────────────────────────────────── */
.prj-etagere {
  position: relative; z-index: 2; transform-style: preserve-3d;
  transform: rotateX(var(--rx)) rotateY(var(--ry)); transition: transform .5s cubic-bezier(.2,.8,.2,1);
  overflow-x: auto; overflow-y: visible; scrollbar-width: none;
  padding: 120px 32px 0; margin-top: -120px; scroll-snap-type: x proximity;
}
.prj-etagere::-webkit-scrollbar { display: none; }
.prj-rayon {
  list-style: none; margin: 0 auto; padding: 0 10px; display: flex; align-items: flex-end; gap: 10px;
  width: max-content; min-width: 100%; justify-content: center; transform-style: preserve-3d;
}
.prj-place { scroll-snap-align: center; transform-style: preserve-3d; }
.prj-planche {
  position: relative; height: 16px; margin: 0 12px; z-index: 1;
  background: linear-gradient(180deg, rgba(255,255,255,.95), rgba(255,255,255,.55));
  border-top: 2px solid rgb(var(--holo) / .75);
  box-shadow: 0 0 22px rgb(var(--holo) / .35), 0 18px 34px -18px rgb(var(--holo) / .6);
  -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px);
}
.prj-planche::after { /* reflet de l'étagère au sol */
  content: ""; position: absolute; left: 6%; right: 6%; top: 100%; height: 40px;
  background: linear-gradient(180deg, rgb(var(--holo) / .14), transparent);
}

/* ── Un livre (sa tranche) ──────────────────────────────────────────────── */
.prj-livre {
  --h: 300px; --dy: 0px; --dx: 0px; --dz: 0px; --rot: 0deg;
  position: relative; display: block; width: 58px; height: var(--h); padding: 0; cursor: grab;
  border: 1px solid rgb(var(--holo) / .38); border-radius: 3px 3px 1px 1px;
  background: linear-gradient(100deg, rgba(255,255,255,.88) 0%, rgba(255,255,255,.55) 45%, rgba(255,255,255,.78) 100%);
  -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px);
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.7), inset -6px 0 12px -8px rgb(var(--holo) / .45), 0 10px 24px -14px rgb(var(--holo) / .55);
  transform: translate3d(var(--dx), calc(var(--dy) + 0px), var(--dz)) rotateZ(var(--rot));
  transition: transform .45s cubic-bezier(.2,.9,.25,1.1), box-shadow .3s, opacity .4s;
  touch-action: pan-x; -webkit-user-select: none; user-select: none; overflow: hidden; color: var(--ink, #424047);
  font: inherit;
}
.prj-livre.h0 { --h: 292px; } .prj-livre.h1 { --h: 318px; width: 62px; } .prj-livre.h2 { --h: 276px; width: 54px; } .prj-livre.h3 { --h: 306px; width: 66px; }
.prj-livre.t1 { background: linear-gradient(100deg, rgba(233,246,248,.92) 0%, rgba(255,255,255,.55) 50%, rgba(226,242,245,.85) 100%); }
.prj-livre.t2 { background: linear-gradient(100deg, rgba(255,255,255,.95) 0%, rgba(244,241,235,.6) 50%, rgba(255,255,255,.85) 100%); }
.prj-livre::before { /* bandes de la tranche */
  content: ""; position: absolute; left: 0; right: 0; top: 18px; height: 6px; pointer-events: none;
  border-top: 1px solid rgb(var(--holo) / .55); border-bottom: 1px solid rgb(var(--holo) / .55);
}
.prj-livre::after { /* balayage holographique */
  content: ""; position: absolute; left: -2px; right: -2px; height: 46px; top: -60px; pointer-events: none;
  background: linear-gradient(180deg, transparent, rgb(var(--holo) / .32), transparent);
  opacity: 0;
}
.prj-dos { position: absolute; inset: 0; display: grid; grid-template-rows: auto 1fr auto; justify-items: center; padding: 30px 0 14px; }
.prj-no { font: 600 .74rem/1 var(--font-title, sans-serif); letter-spacing: .08em; color: rgb(var(--holo)); }
.prj-titre {
  writing-mode: vertical-rl; transform: rotate(180deg); align-self: center;
  font: 900 1.42rem/1 var(--font-title, sans-serif); text-transform: uppercase; letter-spacing: .06em; white-space: nowrap;
}
.prj-etat { writing-mode: vertical-rl; transform: rotate(180deg); font: 600 .66rem/1 var(--font-title, sans-serif); letter-spacing: .16em; text-transform: uppercase; color: var(--muted, #6c6a66); }

/* Livre en cours de rédaction : grisé, titre flouté (illisible tant qu'il n'est pas paru). */
.prj-livre.is-ecrit { color: rgb(66 64 71 / .5); cursor: not-allowed; filter: grayscale(1); opacity: .72;
  background: linear-gradient(100deg, rgba(236,235,232,.9) 0%, rgba(246,245,242,.6) 50%, rgba(232,231,228,.85) 100%); border-color: rgb(66 64 71 / .18); box-shadow: 0 10px 24px -16px rgb(66 64 71 / .45); }
.prj-livre.is-ecrit .prj-titre { color: rgb(66 64 71 / .55); filter: blur(4px); }
.prj-livre.is-ecrit .prj-no { color: rgb(66 64 71 / .4); }
.prj-livre.is-ecrit::before { border-color: rgb(66 64 71 / .2); }

.prj-livre.is-dispo {
  color: #fff; border-color: rgb(var(--red-rgb) / .9); cursor: grab;
  background: linear-gradient(100deg, #f06a63 0%, #ea504b 40%, #d2403b 100%);
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.25), 0 0 0 1px rgb(var(--red-rgb) / .3), 0 16px 40px -14px rgb(var(--red-rgb) / .9), 0 0 36px rgb(var(--red-rgb) / .35);
  animation: prj-pulse 2.8s ease-in-out infinite;
}
.prj-livre.is-dispo::before { border-color: rgba(255,255,255,.7); }
.prj-livre.is-dispo .prj-no, .prj-livre.is-dispo .prj-etat { color: rgba(255,255,255,.9); }
@keyframes prj-pulse { 50% { box-shadow: inset 0 0 0 1px rgba(255,255,255,.25), 0 0 0 1px rgb(var(--red-rgb) / .3), 0 16px 40px -14px rgb(var(--red-rgb) / .9), 0 0 58px rgb(var(--red-rgb) / .55); } }
.prj-place:has(.is-dispo) { position: relative; }
.prj-place:has(.is-dispo)::before { /* invitation flottante au-dessus du livre disponible */
  content: "Ouvrir ce livre"; position: absolute; left: 50%; bottom: calc(100% + 16px); transform: translateX(-50%);
  font: 600 .74rem/1 var(--font-title, sans-serif); letter-spacing: .18em; text-transform: uppercase; white-space: nowrap;
  color: rgb(var(--holo)); padding: 7px 10px; border: 1px solid rgb(var(--holo) / .5); background: rgba(255,255,255,.75);
  box-shadow: 0 0 18px rgb(var(--holo) / .25); animation: prj-flotte 2.6s ease-in-out infinite; pointer-events: none;
}
@keyframes prj-flotte { 50% { transform: translate(-50%, -6px); } }

@media (hover: hover) {
  .prj-livre:hover, .prj-livre:focus-visible { --dy: -16px; --dz: 40px; }
  .prj-livre:hover::after, .prj-livre:focus-visible::after { opacity: 1; animation: prj-scan 1.4s linear infinite; }
  .prj-livre.is-ecrit:hover { --dy: -6px; --dz: 10px; }
}
@keyframes prj-scan { to { top: 110%; } }
.prj-livre:focus-visible { outline: 2px solid rgb(var(--holo)); outline-offset: 3px; }
.prj-livre.is-tire { transition: none; cursor: grabbing; z-index: 5; }
.prj-livre.is-refus { animation: prj-refus .45s ease; }
@keyframes prj-refus { 20%, 60% { transform: translate3d(-5px, 0, 0); } 40%, 80% { transform: translate3d(5px, 0, 0); } }
.prj-livre.is-sorti { --dy: 60px; --dz: 300px; opacity: 0; transition: transform .55s cubic-bezier(.5,0,.75,0), opacity .5s .1s; }

.prj-bulle {
  position: absolute; z-index: 6; margin: 0; transform: translate(-50%, -100%);
  font: 600 .82rem/1.3 var(--font-title, sans-serif); letter-spacing: .08em; text-transform: uppercase; white-space: nowrap;
  padding: 8px 12px; color: var(--ink, #424047); background: rgba(255,255,255,.92);
  border: 1px solid rgb(var(--holo) / .55); box-shadow: 0 0 22px rgb(var(--holo) / .3);
}
.prj-bulle[hidden] { display: none; }

.prj-aide { margin: 0; color: var(--muted, #6c6a66); font-size: .95rem; }
.prj-aide-doigt { display: none; }
@media (hover: none) { .prj-aide-souris { display: none; } .prj-aide-doigt { display: inline; } }

/* ── Le livre sorti ─────────────────────────────────────────────────────── */
.prj-lecteur { position: fixed; inset: 0; z-index: 200; display: grid; place-items: center; perspective: 2000px; overflow: hidden; padding: 16px; }
.prj-lecteur[hidden] { display: none; }
.prj-voile {
  position: absolute; inset: 0; background: rgba(249,247,243,.84);
  -webkit-backdrop-filter: blur(10px) saturate(1.1); backdrop-filter: blur(10px) saturate(1.1);
  opacity: 0; transition: opacity .45s;
}
.prj-voile::after { /* grille holographique du voile */
  content: ""; position: absolute; inset: 0;
  background-image: linear-gradient(rgb(var(--holo) / .07) 1px, transparent 1px), linear-gradient(90deg, rgb(var(--holo) / .07) 1px, transparent 1px);
  background-size: 48px 48px;
}
.prj-lecteur.is-la .prj-voile { opacity: 1; }

.prj-livre3d {
  --w: min(420px, 44vw); --hh: min(700px, calc(100vh - 96px));
  position: relative; width: var(--w); height: var(--hh); transform-style: preserve-3d;
  transform: translate3d(0, 40vh, -600px) rotateY(-88deg) rotateX(8deg); opacity: 0;
  transition: transform .9s cubic-bezier(.2,.8,.2,1), opacity .4s;
}
.prj-lecteur.is-la .prj-livre3d { transform: translate3d(0, 0, 0) rotateY(-18deg) rotateX(4deg); opacity: 1; }
.prj-lecteur.is-ouvert .prj-livre3d { transform: translate3d(calc(var(--w) / 2), 0, 0) rotateY(0) rotateX(0); }

.prj-pages, .prj-couv { position: absolute; inset: 0; }
.prj-pages {
  background: linear-gradient(90deg, #f3f0ea 0, #fff 6%, #fff 100%); color: var(--ink, #424047);
  border: 1px solid rgb(var(--holo) / .3); box-shadow: 0 40px 80px -30px rgb(var(--holo) / .55), 10px 0 0 -4px #f4f1ec, 12px 0 0 -4px rgb(var(--holo) / .25);
  padding: clamp(20px, 3vw, 34px); display: grid; align-content: start; gap: 12px; overflow: auto; overscroll-behavior: contain;
}
.prj-page-kicker { margin: 0; font: 600 .78rem/1 var(--font-title, sans-serif); letter-spacing: .2em; text-transform: uppercase; color: var(--red, #ea504b); }
.prj-page-titre { margin: 0; font: 900 clamp(1.6rem, 1.1rem + 1.6vw, 2.3rem)/.98 var(--font-title, sans-serif); text-transform: uppercase; color: var(--teal, #009aac); }
.prj-page-resume { margin: 0; font-size: 1rem; line-height: 1.45; }
.prj-page-chapitres { margin: 0; padding-left: 1.3em; display: grid; gap: 2px; font-size: .86rem; line-height: 1.35; color: var(--muted, #6c6a66); }
.prj-page-chapitres li::marker { color: var(--red, #ea504b); font-weight: 700; }
.prj-page-meta { margin: 0; font: 600 .78rem/1.3 var(--font-title, sans-serif); letter-spacing: .1em; text-transform: uppercase; color: rgb(var(--holo)); }
.prj-page-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 4px; }
.prj-lancer, .prj-pdf {
  display: inline-flex; align-items: center; gap: 10px; padding: 13px 18px; text-decoration: none;
  font: 900 1rem/1 var(--font-title, sans-serif); text-transform: uppercase; letter-spacing: .06em;
}
.prj-lancer { background: var(--red, #ea504b); color: #fff; box-shadow: 0 12px 30px -12px rgb(var(--red-rgb) / .9); }
.prj-lancer:hover { background: var(--red-dark, #d2403b); }
.prj-pdf { border: 2px solid var(--teal, #009aac); color: var(--teal, #009aac); background: #fff; }
.prj-pdf:hover { background: rgb(var(--holo) / .08); }

.prj-couv { transform-origin: left center; transform-style: preserve-3d; transition: transform 1.1s cubic-bezier(.4,.1,.2,1); }
.prj-lecteur.is-ouvert .prj-couv { transform: rotateY(-178deg); }
.prj-couv-face, .prj-couv-dos { position: absolute; inset: 0; -webkit-backface-visibility: hidden; backface-visibility: hidden; }
.prj-couv-face {
  background: #fff; border: 1px solid rgb(var(--red-rgb) / .5); padding: 28px 26px; display: grid; align-content: start; gap: 10px;
  box-shadow: inset 0 0 0 8px #fff, inset 0 0 0 10px var(--red, #ea504b), 0 40px 80px -30px rgb(var(--holo) / .6);
  overflow: hidden;
}
.prj-couv-face img { width: 110px; height: auto; margin: 6px 0 22px 4px; }
.prj-couv-kicker { margin: 0 6px; font: 600 .74rem/1 var(--font-title, sans-serif); letter-spacing: .2em; text-transform: uppercase; color: var(--red, #ea504b); }
.prj-couv-titre { margin: 0 6px; font: 900 clamp(2.6rem, 2rem + 2vw, 3.6rem)/.9 var(--font-title, sans-serif); text-transform: uppercase; color: var(--teal, #009aac); }
.prj-couv-sous { margin: 0 6px; font: 600 1.15rem/1.2 var(--font-title, sans-serif); text-transform: uppercase; color: var(--ink, #424047); }
.prj-globe { position: absolute; right: -40px; bottom: -40px; width: 78%; height: auto; fill: none; stroke: rgb(var(--holo) / .55); stroke-width: 1; animation: prj-tourne 30s linear infinite; }
.prj-globe .pt { fill: var(--red, #ea504b); stroke: #fff; stroke-width: 1.2; }
@keyframes prj-tourne { to { transform: rotate(360deg); } }
.prj-couv-dos {
  transform: rotateY(180deg); background: linear-gradient(90deg, #fff 94%, #f3f0ea 100%); border: 1px solid rgb(var(--holo) / .3);
  display: grid; place-items: center; padding: 34px;
}
.prj-couv-dos p { margin: 0; font: 600 1.3rem/1.35 var(--font-title, sans-serif); text-transform: uppercase; color: var(--teal, #009aac); text-align: center; }

.prj-fermer {
  position: absolute; z-index: 3; top: calc(env(safe-area-inset-top, 0px) + 16px); right: max(16px, env(safe-area-inset-right, 0px));
  width: 46px; height: 46px; display: grid; place-items: center; cursor: pointer;
  background: #fff; border: 1px solid var(--red, #ea504b); color: var(--red, #ea504b);
}
.prj-fermer svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2.4; stroke-linecap: round; }
.prj-fermer:hover { background: var(--red, #ea504b); color: #fff; }

/* plongée dans le livre avant la présentation */
.prj-lecteur.is-plonge .prj-livre3d { transform: translate3d(calc(var(--w) / 2), 0, 900px); opacity: 0; transition: transform .7s cubic-bezier(.6,0,.8,.2), opacity .6s .1s; }
.prj-lecteur.is-plonge .prj-voile { background: #fff; }

/* ── Téléphone ──────────────────────────────────────────────────────────── */
@media (max-width: 760px) {
  .prj-salle { min-height: 470px; padding: 60px 0 46px; }
  .prj-etagere { padding: 110px 16px 0; }
  .prj-rayon { justify-content: flex-start; gap: 8px; }
  .prj-livre { width: 52px; } .prj-livre.h1 { width: 56px; } .prj-livre.h3 { width: 58px; }
  .prj-livre.h0 { --h: 262px; } .prj-livre.h1 { --h: 284px; } .prj-livre.h2 { --h: 248px; } .prj-livre.h3 { --h: 272px; }
  .prj-titre { font-size: 1.22rem; }
  .prj-livre3d { --w: min(340px, 86vw); --hh: min(560px, 80vh); }
  .prj-lecteur.is-ouvert .prj-livre3d { transform: translate3d(0, 0, 0); }
  .prj-lecteur.is-ouvert .prj-couv { transform: rotateY(-120deg); opacity: 0; transition: transform 1s cubic-bezier(.4,.1,.2,1), opacity .5s .5s; }
  .prj-lecteur.is-plonge .prj-livre3d { transform: translate3d(0, 0, 900px); }
}

@media (prefers-reduced-motion: reduce) {
  .prj-sol, .prj-faisceaux i, .prj-livre.is-dispo, .prj-place:has(.is-dispo)::before, .prj-globe { animation: none; }
  .prj-livre, .prj-livre3d, .prj-couv, .prj-voile, .prj-etagere { transition: none; }
}

/* ── La deuxième bibliothèque : « Les autres propositions » (salle de nuit) ─────────── */
.prj-salle.is-props {
  min-height: clamp(400px, 56vh, 540px);
  background:
    radial-gradient(120% 80% at 50% 0%, rgb(var(--holo) / .22) 0%, rgba(0,0,0,0) 60%),
    linear-gradient(180deg, #1b2a2e 0%, #14211f 100%);
  border-color: rgb(var(--holo) / .35);
}
.prj-salle.is-props .prj-planche { background: linear-gradient(180deg, rgb(var(--holo) / .35), rgb(var(--holo) / .1)); }
.prj-salle.is-props .prj-livre.is-ecrit {
  color: rgb(255 255 255 / .4); opacity: .55; filter: none;
  background: linear-gradient(100deg, rgba(255,255,255,.1) 0%, rgba(255,255,255,.04) 50%, rgba(255,255,255,.08) 100%);
  border: 1px dashed rgb(var(--holo) / .45); box-shadow: none;
}
.prj-salle.is-props .prj-livre.is-ecrit .prj-no, .prj-salle.is-props .prj-livre.is-ecrit .prj-etat { color: rgb(255 255 255 / .5); }
.prj-salle.is-props .prj-livre.is-ecrit::before { border-color: rgb(var(--holo) / .3); }
.prj-salle.is-props .prj-place:has(.is-dispo)::before { content: "Voir la proposition"; background: rgb(20 33 31 / .85); color: #8fd3df; }
.prj-salle.is-props .prj-bulle { background: #fff; }
.prj-embleme { position: absolute; right: -18px; bottom: 18px; width: 70%; height: auto; fill: none; stroke: rgb(var(--holo) / .6); stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; animation: prj-flotte-emb 5s ease-in-out infinite; }
.prj-embleme .pt { fill: var(--red, #ea504b); stroke: #fff; }
@keyframes prj-flotte-emb { 50% { transform: translateY(-8px) rotate(-3deg); } }
@media (prefers-reduced-motion: reduce) { .prj-embleme { animation: none; } }
