@font-face { font-family: 'Cinzel'; src: url('fonts/Cinzel.ttf') format('truetype'); font-weight: 700; font-display: swap; }
@font-face { font-family: 'Literata'; src: url('fonts/Literata.ttf') format('truetype'); font-weight: 400; font-display: swap; }
@font-face { font-family: 'Literata'; src: url('fonts/Literata-Italic.ttf') format('truetype'); font-weight: 400; font-style: italic; font-display: swap; }

:root {
  --night: #141b2b;
  --night2: #1d2740;
  --gold: #e2b65a;
  --cream: #f8f1e1;
  --ink: #2a2118;
  --soft: #b9ad95;
}
* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0; background: radial-gradient(120% 90% at 50% 30%, var(--night2), var(--night) 70%);
  color: #f3e6c8; font-family: 'Literata', Georgia, serif;
  display: flex; flex-direction: column; overflow: hidden;
  -webkit-user-select: none; user-select: none;
}
button { font: inherit; color: inherit; cursor: pointer; }

.top { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 12px 20px 8px; flex-wrap: wrap; }
.kicker { font: 700 11px/1.2 Georgia, serif; letter-spacing: .22em; text-transform: uppercase; color: var(--gold); }
.kicker a.retour { color: var(--gold); text-decoration: none; }
.kicker a.retour:hover, .kicker a.retour:focus-visible { text-decoration: underline; outline: none; }
.top h1 { margin: 3px 0 0; font: 700 clamp(18px, 2.4vw, 26px)/1.1 'Cinzel', Georgia, serif; color: #fff7e6; letter-spacing: .02em; }
.jumps { display: flex; gap: 6px; flex-wrap: wrap; }
.jumps button { background: transparent; border: 1px solid rgba(226,182,90,.45); border-radius: 999px; padding: 6px 13px; font-size: 13px; color: #f3e6c8; }
.jumps button:hover, .jumps button:focus-visible { background: rgba(226,182,90,.16); outline: none; }

.stage { flex: 1; min-height: 0; position: relative; display: flex; align-items: center; justify-content: center; padding: 6px 64px; }
.book { position: relative; display: flex; justify-content: center; align-items: stretch; filter: drop-shadow(0 18px 30px rgba(0,0,0,.45)); transition: opacity .18s ease; }
.book.fading { opacity: 0; }
.page { position: relative; width: var(--pw); height: var(--ph); background: var(--cream); overflow: hidden; }
.page img { width: 100%; height: 100%; display: block; -webkit-user-drag: none; pointer-events: none; }
.page.blank { background: #efe6d2; }
.spread .page.left::after { content: ''; position: absolute; inset: 0 0 0 auto; width: 9%; background: linear-gradient(to left, rgba(0,0,0,.22), transparent); pointer-events: none; }
.spread .page.right::after { content: ''; position: absolute; inset: 0 auto 0 0; width: 9%; background: linear-gradient(to right, rgba(0,0,0,.18), transparent); pointer-events: none; }
.page.hit { cursor: pointer; }

.turn { position: absolute; top: 50%; transform: translateY(-50%); width: 46px; height: 46px; border-radius: 50%;
  border: 1px solid rgba(226,182,90,.5); background: rgba(20,27,43,.6); font-size: 30px; line-height: 40px; color: var(--gold); z-index: 2; }
.turn:hover, .turn:focus-visible { background: rgba(226,182,90,.2); outline: none; }
.turn:disabled { opacity: .25; cursor: default; }
.turn.prev { left: 12px; } .turn.next { right: 12px; }

.bar { display: flex; align-items: center; gap: 14px; padding: 6px 20px 2px; }
.where { font-size: 13px; color: #e9dcc0; min-width: 190px; }
.progress { flex: 1; height: 3px; background: rgba(255,255,255,.12); border-radius: 3px; overflow: hidden; }
.progress i { display: block; height: 100%; width: 0; background: var(--gold); transition: width .25s ease; }
.full { background: transparent; border: 1px solid rgba(226,182,90,.45); border-radius: 8px; width: 34px; height: 30px; color: var(--gold); font-size: 16px; }
.legal { margin: 0; padding: 4px 20px 10px; font-size: 10.5px; color: var(--soft); text-align: center; }

/* page de fin */
.endpage { background: var(--cream); color: var(--ink); }
.end-in { position: absolute; inset: 0; padding: 9% 10% 8%; display: flex; flex-direction: column; }
.endpage .kicker { color: #a87b22; }
.endpage h2 { margin: .5em 0 .45em; font: 700 calc(var(--ph) * .045) / 1.1 'Cinzel', Georgia, serif; color: #1d2a44; }
.endpage .lead { margin: 0 0 .8em; font: italic 400 calc(var(--ph) * .021) / 1.45 'Literata', Georgia, serif; }
.toc { margin: 0; padding: 0; list-style: none; font-size: calc(var(--ph) * .0172); line-height: 1.3; }
.toc li { display: flex; gap: .7em; padding: .32em 0; border-bottom: 1px dotted #cdb98f; }
.toc b { flex: 0 0 6.2em; font: 700 .78em/1.6 Georgia, serif; letter-spacing: .08em; text-transform: uppercase; color: #8a6a2b; }
.toc span em { display: block; font-size: .82em; color: #6b5b45; }
.whole { margin: auto 0 0; padding-top: .9em; font-size: calc(var(--ph) * .0175); line-height: 1.45; color: #4a3e2f; }

.noscript { padding: 20px; overflow: auto; }
.noscript img { width: 100%; max-width: 520px; display: block; margin: 0 auto 16px; }

@media (max-width: 760px) {
  .top { padding: 10px 14px 6px; }
  .jumps button { padding: 5px 10px; font-size: 12px; }
  .stage { padding: 4px 8px; }
  .turn { width: 34px; height: 34px; font-size: 22px; line-height: 28px; background: rgba(20,27,43,.55); opacity: .8; }
  .turn.prev { left: 4px; } .turn.next { right: 4px; }
  .where { min-width: 0; font-size: 12px; }
  .bar { padding: 6px 14px 2px; }
}
