/* Page « Des sites à feuilleter » : la scène 3D épinglée sous l'en-tête pendant que la piste défile.
   Polices du livre (OFL) : Inter et JetBrains Mono, variables (400 à 500) ; le titre reprend Inter Tight du site. */
@font-face { font-family: "Inter"; font-style: normal; font-weight: 400 500; font-display: swap; src: url(fonts/inter-400-latin.woff2) format("woff2"); }
@font-face { font-family: "JetBrains Mono"; font-style: normal; font-weight: 400 500; font-display: swap; src: url(fonts/jetbrains-mono-400-latin.woff2) format("woff2"); }

.livre, .livre-page { --edge: clamp(20px, 4.167vw, 60px); color: #fff; }
.livre-page { background: #060505; }
.livre-piste { position: relative; }
.livre-scene { position: sticky; top: var(--entete); height: calc(100svh - var(--entete)); overflow: hidden; background: #060505; isolation: isolate; }
.livre-hote { position: absolute; inset: 0; }
.livre-canvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; touch-action: pan-y; opacity: 0; transition: opacity 1.2s ease; }
.livre[data-pret] .livre-canvas { opacity: 1; }
.livre-vignette { position: absolute; inset: 0; pointer-events: none; background: radial-gradient(ellipse 75% 70% at 50% 55%, transparent 55%, rgb(0 0 0 / .55) 100%); }

/* Haut de la scène : repère et appel à l'action */
.livre-haut { position: absolute; top: 24px; left: var(--edge); right: var(--edge); display: flex; align-items: center; justify-content: space-between; gap: 16px; pointer-events: none; }
.livre-etiquette { margin: 0; font: 500 12px/1 "JetBrains Mono", ui-monospace, monospace; letter-spacing: .16em; text-transform: uppercase; color: rgb(255 255 255 / .55); }
.livre-page .livre-cta { pointer-events: auto; display: inline-flex; align-items: center; padding: 12px 22px; border-radius: 5px; background: #fff; color: #000;
  font: 500 18px/1 "Inter Tight", system-ui, sans-serif; letter-spacing: -0.02em; text-decoration: none; white-space: nowrap; transition: opacity .15s ease; }
.livre-page .livre-cta:hover { opacity: .86; color: #000; }
.livre-page .livre-cta:focus-visible { outline: 2px solid #fff; outline-offset: 3px; }

/* Titre : arrive avec la scène, s'efface quand le livre s'ouvre, revient quand il se referme */
.livre-titre { position: absolute; top: clamp(84px, 17vh, 170px); left: var(--edge); width: clamp(300px, 40.14vw, 578px); display: flex; flex-direction: column;
  gap: 26px; font-family: "Inter Tight", system-ui, sans-serif; line-height: 1; pointer-events: none;
  opacity: 0; transform: translateY(8px); transition: opacity 1s ease .3s, transform 1s ease .3s; }
.livre[data-pret] .livre-titre { opacity: 1; transform: none; }
.livre[data-ouvert=oui] .livre-titre { opacity: 0; transform: translateY(-12px); transition: opacity .5s ease, transform .6s ease; }
.livre .livre-titre h1 { margin: 0; color: #fff; font-weight: 500; font-size: clamp(34px, 4.444vw, 64px); line-height: 1; letter-spacing: -0.02em; }
.livre-titre p { margin: 0; font-size: clamp(15px, 1.389vw, 20px); line-height: 1.25; letter-spacing: -0.02em; opacity: .5; }
/* Sans grand titre (onglet « Version PC » de la page Création de site) : la consigne seule, en haut à gauche */
.livre-titre--consigne { top: 24px; width: min(420px, calc(100% - 2 * var(--edge))); }
.livre-titre--consigne p { font-size: clamp(14px, 1.1vw, 17px); opacity: .62; }

/* Invitation à défiler et repères des doubles pages */
.livre-indice { position: absolute; left: 50%; bottom: 20px; margin: 0; transform: translateX(-50%); font: 500 11px/1 "JetBrains Mono", ui-monospace, monospace;
  letter-spacing: .18em; text-transform: uppercase; color: rgb(255 255 255 / .5); transition: opacity .4s ease; pointer-events: none; }
.livre-indice::after { content: ""; display: block; width: 1px; height: 26px; margin: 10px auto 0; background: linear-gradient(rgb(255 255 255 / .6), transparent);
  animation: livre-indice 2.2s ease-in-out infinite; }
@keyframes livre-indice { 0%, 100% { transform: scaleY(.4); transform-origin: top; } 50% { transform: scaleY(1); transform-origin: top; } }
.livre:not([data-page="0"]) .livre-indice { opacity: 0; }
.livre-reperes { position: absolute; right: var(--edge); top: 50%; transform: translateY(-50%); display: grid; gap: 12px; margin: 0; padding: 0; list-style: none; pointer-events: none; }
.livre-reperes li { width: 6px; height: 6px; border-radius: 50%; background: rgb(255 255 255 / .22); transition: background .3s, transform .3s; }
.livre-reperes li[data-actif] { background: #fff; transform: scale(1.4); }

/* Après la scène : les mêmes sites en liste, lisible sans 3D et par les lecteurs d'écran */
.livre-liste { padding: clamp(56px, 7vw, 96px) var(--edge) clamp(64px, 8vw, 112px); }
.livre-page .livre-liste h2 { margin: 0 0 28px; color: #fff; font: 500 clamp(28px, 3vw, 44px)/1 "Inter Tight", system-ui, sans-serif; letter-spacing: -0.02em; }
/* Une carte par site, la capture du site en fond : on reconnaît le site avant d'avoir lu son nom */
.livre-liste-sites { margin: 0 0 40px; padding: 0; list-style: none; display: grid; gap: clamp(14px, 1.6vw, 22px);
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 250px), 1fr)); }
.livre-liste-sites li + li { margin-top: 0; } /* l'espacement de base des listes décalerait les cartes */
.livre-carte { position: relative; display: block; aspect-ratio: 16 / 10; overflow: hidden; isolation: isolate; border-radius: 14px;
  border: 1px solid rgb(255 255 255 / .1); background: #111214; color: #fff; text-decoration: none;
  transition: border-color .4s, transform .5s cubic-bezier(.2, .7, .2, 1); }
.livre-carte picture { position: absolute; inset: 0; z-index: -2; }
.livre-carte-img { display: block; width: 100%; height: 100%; object-fit: cover; object-position: top center;
  transform: scale(1.02); transition: transform .9s cubic-bezier(.2, .7, .2, 1), filter .5s; filter: saturate(.92); }
/* Voile : le haut reste lisible pour le numéro et le bouton, le bas porte le nom */
.livre-carte::after { content: ""; position: absolute; inset: 0; z-index: -1;
  background: linear-gradient(180deg, rgb(6 5 5 / .32) 0%, rgb(6 5 5 / 0) 30%); }
.livre-carte:hover, .livre-carte:focus-visible { border-color: rgb(255 255 255 / .28); transform: translateY(-3px); }
.livre-carte:hover .livre-carte-img, .livre-carte:focus-visible .livre-carte-img { transform: scale(1.07); filter: saturate(1.05); }
.livre-carte:focus-visible { outline: 2px solid #22d3ee; outline-offset: 3px; }
.livre-num { position: absolute; left: 12px; top: 12px; padding: 6px 9px; border-radius: 999px; background: rgb(6 5 5 / .62);
  -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px); font: 500 12px/1 "JetBrains Mono", ui-monospace, monospace; letter-spacing: .04em; }
/* Le nom sur un bandeau dépoli : il reste lisible quels que soient les titres de la capture en dessous */
.livre-carte-texte { position: absolute; left: 0; right: 0; bottom: 0; display: grid; gap: 4px; padding: 12px 16px 13px;
  background: rgb(10 10 12 / .78); -webkit-backdrop-filter: blur(12px) saturate(1.2); backdrop-filter: blur(12px) saturate(1.2);
  border-top: 1px solid rgb(255 255 255 / .08); }
.livre-nom { font-family: inherit; font-size: 17px; font-weight: 600; line-height: 1.25; }
.livre-genre { overflow: hidden; font: 400 11px/1.4 "JetBrains Mono", ui-monospace, monospace; letter-spacing: .06em; text-transform: uppercase;
  white-space: nowrap; text-overflow: ellipsis; color: rgb(255 255 255 / .7); }
/* Le même bouton rond que dans le livre (disque clair, puis sombre cerclé de cyan) : le site s'ouvre dans un nouvel onglet */
.livre-fleche { position: absolute; right: 12px; top: 12px; width: 36px; height: 36px; border-radius: 50%; background: #f4f2ee; color: #111;
  box-shadow: 0 4px 14px rgb(0 0 0 / .3); transition: background .3s, color .3s, box-shadow .3s; }
.livre-fleche::before { content: ""; position: absolute; inset: 0; margin: auto; width: 14px; height: 14px; background: currentColor;
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M7 17L17 7'/%3E%3Cpath d='M8 7h9v9'/%3E%3C/svg%3E") center / contain no-repeat;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M7 17L17 7'/%3E%3Cpath d='M8 7h9v9'/%3E%3C/svg%3E") center / contain no-repeat; }
.livre-carte:hover .livre-fleche, .livre-carte:focus-visible .livre-fleche { background: #111; color: #fff; box-shadow: 0 0 0 2px #22d3ee, 0 4px 14px rgb(0 0 0 / .3); }

@media (max-width: 560px) {
  .livre-titre { width: auto; right: var(--edge); gap: 16px; }
  .livre-page .livre-cta { font-size: 15px; padding: 10px 16px; }
  .livre-reperes { display: none; }
}
@media (prefers-reduced-motion: reduce) {
  .livre-indice::after { animation: none; }
  .livre-carte, .livre-carte-img { transition: none; }
  .livre-carte:hover, .livre-carte:focus-visible, .livre-carte:hover .livre-carte-img, .livre-carte:focus-visible .livre-carte-img { transform: none; }
}
