/* =====================================================================
   LA CARTE : un beau livre, lisible avant tout
   Fond sobre et chaleureux, pages du menu nettes, papier épais et texturé.
   ===================================================================== */
:root {
  --pw: 460px; --ph: 650px; --tl: 6px; --tr: 14px;
  --leather: url("https://images.unsplash.com/photo-1571829604981-ea159f94e5ad?auto=format&fit=crop&w=1200&q=80");
}
body.carte { margin: 0; min-height: 100svh; overflow: hidden; color: #efe3cf; background: #100a06; }
.c-bg { position: fixed; inset: -20px; z-index: -1; pointer-events: none;
  background:
    radial-gradient(ellipse 58% 62% at 50% 47%, rgba(255, 196, 130, .2), transparent 70%),
    radial-gradient(ellipse 85% 85% at 50% 47%, transparent 35%, rgba(6, 3, 1, .82) 100%),
    linear-gradient(rgba(20, 11, 5, .38), rgba(20, 11, 5, .38)),
    url("https://images.unsplash.com/photo-1576092762791-dd9e2220abd1?auto=format&fit=crop&w=2200&q=80") center / cover;
  filter: blur(1.5px) saturate(1.05); }
body.carte::after { opacity: .06; }   /* grain très léger de style.css */

/* ---------- barre du haut ---------- */
.c-top { position: fixed; top: 0; left: 0; right: 0; z-index: 20; display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; padding: 14px 20px; }
.c-back { font-family: var(--sans); font-size: 12px; letter-spacing: .18em; text-transform: uppercase; color: #d9c7aa; text-decoration: none; }
.c-back:hover { color: #fff; }
.c-title span { font-family: var(--title); font-size: 15px; letter-spacing: .42em; text-transform: uppercase; color: #c9a56a; padding-left: .42em; }
.c-right { display: flex; justify-content: flex-end; align-items: center; gap: 10px; }
.c-zoom { background: none; border: 1px solid rgba(201, 165, 106, .45); color: #e8d7b8; border-radius: 999px; padding: 8px 14px; font-family: var(--sans); font-size: 11px; letter-spacing: .16em; text-transform: uppercase; }
.c-zoom:hover { background: rgba(201, 165, 106, .15); }
@media (max-width: 640px) { .c-title { display: none; } .c-top { grid-template-columns: auto 1fr; gap: 10px; padding: 12px 14px; } }

/* ---------- le livre ---------- */
.c-stage { height: 100svh; display: grid; place-items: center; padding: 60px 16px 92px; box-sizing: border-box; }
.c-book { position: relative; opacity: 0; transform: translateY(18px) scale(.985); transition: opacity 1.2s ease, transform 1.4s cubic-bezier(.2, .7, .2, 1); }
.c-book.in { opacity: 1; transform: none; }
.c-move { position: absolute; inset: 0; transition: transform .9s cubic-bezier(.45, .05, .35, 1); }   /* tout le livre bouge d'un bloc */
.c-book.closed .c-move { transform: translateX(calc(var(--pw) * -.5)); }
.c-book.closed-end .c-move { transform: translateX(calc(var(--pw) * .5)); }
.c-book.portrait .c-move { transform: none !important; }
#book { position: relative; z-index: 4; }

/* ombre du livre sur le fond */
.c-shadow { position: absolute; z-index: 0; left: -1%; right: -1%; top: 2%; bottom: -3%; border-radius: 8px; background: rgba(0, 0, 0, .7); filter: blur(26px); transform: translate(10px, 14px); }
/* plats de couverture en cuir, sous les pages */
.c-boards { position: absolute; z-index: 1; top: -11px; bottom: -13px; left: calc(-11px - var(--tl)); right: calc(-11px - var(--tr)); border-radius: 7px;
  background: linear-gradient(rgba(35, 16, 6, .45), rgba(20, 8, 2, .62)), var(--leather) center / cover;
  box-shadow: inset 0 0 0 1px rgba(255, 220, 170, .06), inset 0 0 22px rgba(0, 0, 0, .7), 0 2px 0 #140803, 0 18px 40px rgba(0, 0, 0, .45); transition: opacity .6s; }
.c-boards::after { content: ""; position: absolute; left: 50%; top: -2px; bottom: -2px; width: 30px; margin-left: -15px; background: linear-gradient(90deg, rgba(0, 0, 0, .5), rgba(255, 220, 170, .07), rgba(0, 0, 0, .5)); }
.c-boards, .c-stack { transition: opacity .35s ease .75s, width .6s ease; }
.c-book.closed .c-boards, .c-book.closed-end .c-boards, .c-book.closed .c-stack, .c-book.closed-end .c-stack { opacity: 0; transition: opacity .15s ease 0s, width .6s ease; }
.c-shadow { transition: left .9s, right .9s; }
.c-book.closed .c-shadow { left: 51%; right: -1%; } .c-book.closed-end .c-shadow { left: -1%; right: 51%; }

/* épaisseur du papier : la tranche des pages, en couches, plus épaisse du côté non lu */
.c-stack { position: absolute; z-index: 3; }
.c-stack.left, .c-stack.right { top: 2px; bottom: -4px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, .25), transparent 30%, transparent 70%, rgba(70, 45, 15, .25)),
    repeating-linear-gradient(90deg, #f6f0e3 0 2px, #e4d8c0 2px 3px, #b8a585 3px 3.6px); }
.c-stack.left { right: 100%; width: var(--tl); border-radius: 3px 0 0 3px; box-shadow: inset -3px 0 4px rgba(60, 40, 15, .35), -1px 0 0 rgba(0, 0, 0, .35); }
.c-stack.right { left: 100%; width: var(--tr); border-radius: 0 3px 3px 0; box-shadow: inset 3px 0 4px rgba(60, 40, 15, .35), 1px 0 0 rgba(0, 0, 0, .35); }
.c-stack.bottom { left: calc(-1 * var(--tl)); right: calc(-1 * var(--tr)); bottom: -6px; height: 6px; border-radius: 0 0 3px 3px;
  background: repeating-linear-gradient(180deg, #efe6d3 0 2px, #b9a785 2px 2.6px); box-shadow: 0 1px 0 rgba(0, 0, 0, .4); }
.c-book.portrait .c-stack.left { display: none; }
.c-book.portrait .c-boards::after { display: none; }

/* ---------- une page : papier épais, légèrement grainé, courbé vers la reliure ---------- */
.c-page { background: #f4eee2; overflow: hidden; box-shadow: inset 0 0 0 1px rgba(150, 125, 90, .35), inset 0 0 6px rgba(120, 95, 60, .18); }
.c-page img.menu { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: fill; user-select: none; -webkit-user-drag: none; pointer-events: none; }
.c-page .paper { position: absolute; inset: 0; pointer-events: none; opacity: .55;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='220' height='220'%3E%3Cfilter id='p'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='3' seed='3'/%3E%3CfeColorMatrix values='0 0 0 0 .42 0 0 0 0 .33 0 0 0 0 .2 0 0 0 .16 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23p)'/%3E%3C/svg%3E"),
              url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='400' height='400'%3E%3Cfilter id='f'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.012 .5' numOctaves='3' seed='8'/%3E%3CfeColorMatrix values='0 0 0 0 .5 0 0 0 0 .4 0 0 0 0 .25 0 0 0 .1 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23f)'/%3E%3C/svg%3E"); }
/* papier vergé : fines lignes de fabrication visibles à la lumière, comme un papier épais de qualité */
.c-page .paper::after { content: ""; position: absolute; inset: 0; opacity: .55;
  background: repeating-linear-gradient(0deg, rgba(120, 95, 60, .05) 0 1px, transparent 1px 3px),
              repeating-linear-gradient(90deg, rgba(120, 95, 60, .06) 0 1px, transparent 1px 64px); }
.c-page .light { position: absolute; inset: 0; pointer-events: none; }
/* la page se creuse vers la reliure, accroche la lumière, puis s'assombrit à peine sur le bord */
.c-page.--right .light { background: linear-gradient(90deg, rgba(40, 25, 8, .38) 0%, rgba(40, 25, 8, .1) 2.5%, transparent 6%, transparent 94%, rgba(60, 40, 15, .08) 100%), linear-gradient(160deg, rgba(255, 245, 225, .1), transparent 45%, rgba(40, 25, 8, .06)); }
.c-page.--left .light { background: linear-gradient(270deg, rgba(40, 25, 8, .38) 0%, rgba(40, 25, 8, .1) 2.5%, transparent 6%, transparent 94%, rgba(60, 40, 15, .08) 100%), linear-gradient(160deg, rgba(255, 245, 225, .12), transparent 45%, rgba(40, 25, 8, .07)); }
.c-book.portrait .c-page .light { background: linear-gradient(90deg, rgba(55, 35, 12, .28) 0%, rgba(55, 35, 12, .08) 4%, transparent 12%, transparent 94%, rgba(60, 40, 15, .1) 100%); }

/* ---------- couverture : cuir et dorure ---------- */
.c-cover { background: #3a1e10 var(--leather) center / cover; }
.c-cover .tint { position: absolute; inset: 0; background: radial-gradient(ellipse 90% 85% at 45% 40%, rgba(60, 28, 10, .2), rgba(18, 7, 2, .65) 100%); }
.c-cover .spine { position: absolute; top: 0; bottom: 0; width: 7%; }
.c-cover.front .spine { left: 0; background: linear-gradient(90deg, rgba(0, 0, 0, .6), rgba(255, 210, 160, .1) 45%, rgba(0, 0, 0, .25) 75%, transparent); }
.c-cover.back .spine { right: 0; background: linear-gradient(270deg, rgba(0, 0, 0, .6), rgba(255, 210, 160, .1) 45%, rgba(0, 0, 0, .25) 75%, transparent); }
.c-cover .frame { position: absolute; inset: 6.5%; border: 1.5px solid #b58c4c; outline: 1px solid rgba(181, 140, 76, .7); outline-offset: -8px; box-shadow: 0 1px 0 rgba(0, 0, 0, .5), inset 0 1px 0 rgba(0, 0, 0, .5); }
.c-cover::after { content: ""; position: absolute; inset: 0; box-shadow: inset 0 0 0 2px rgba(0, 0, 0, .4), inset 0 0 20px rgba(0, 0, 0, .6); }
.c-cover .face { position: relative; z-index: 1; height: 100%; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; font-size: calc(var(--pw) / 30); }
.c-cover img { width: 8.5em; filter: sepia(1) saturate(1.5) brightness(1.05) drop-shadow(0 1px 0 rgba(0, 0, 0, .7)); }
.c-gold { background: linear-gradient(180deg, #f1dca6 0%, #c79a52 48%, #91682c 60%, #e2c27f 100%); -webkit-background-clip: text; background-clip: text; color: transparent; filter: drop-shadow(0 1px 1px rgba(0, 0, 0, .7)); }
.c-cover h1 { font-family: var(--title); font-weight: 400; font-size: 2.5em; letter-spacing: .1em; margin: .9em 0 .15em; }
.c-cover .sub { font-family: var(--serif); font-style: italic; font-size: 1.35em; }
.c-cover .word { font-family: var(--title); letter-spacing: .5em; font-size: 1.05em; margin-top: 2.4em; padding-left: .5em; }

/* ---------- navigation ---------- */
.c-arrow { position: fixed; top: 50%; z-index: 15; width: 52px; height: 52px; margin-top: -26px; border-radius: 50%; border: 1px solid rgba(201, 165, 106, .4); background: rgba(20, 13, 8, .5);
  color: #ead9bc; font-size: 26px; line-height: 1; transition: background .3s, opacity .3s; }
.c-arrow:hover { background: rgba(70, 48, 25, .7); }
.c-arrow.prev { left: 22px; } .c-arrow.next { right: 22px; }
.c-arrow[disabled] { opacity: .2; pointer-events: none; }
.c-chapters { position: fixed; left: 0; right: 0; bottom: calc(14px + env(safe-area-inset-bottom)); z-index: 15; display: flex; justify-content: center; gap: 4px; overflow-x: auto; padding: 4px 14px; scrollbar-width: none; }
.c-chapters::-webkit-scrollbar { display: none; }
.c-chapters button { flex-shrink: 0; background: none; border: 0; color: #bba684; font-family: var(--title); font-size: 13px; letter-spacing: .12em; text-transform: uppercase; padding: 8px 12px; border-bottom: 1px solid transparent; transition: color .3s, border-color .3s; }
.c-chapters button:hover { color: #f1e2c6; }
.c-chapters button.on { color: #f3e3c2; border-color: #c9a56a; }
@media (max-width: 760px) {
  .c-chapters { justify-content: flex-start; bottom: calc(8px + env(safe-area-inset-bottom)); }
  .c-arrow { top: auto; bottom: calc(60px + env(safe-area-inset-bottom)); margin-top: 0; width: 44px; height: 44px; }
  .c-arrow.prev { left: 12px; } .c-arrow.next { right: 12px; }
  .c-stage { padding: 56px 10px 110px; }
}

/* ---------- loupe : la page en grand, à faire défiler ou zoomer ---------- */
.c-loupe { position: fixed; inset: 0; z-index: 40; background: rgba(12, 8, 5, .94); overflow: auto; -webkit-overflow-scrolling: touch; }
.c-loupe[hidden] { display: none; }
.c-loupe-in { display: flex; flex-wrap: wrap; justify-content: center; gap: 18px; padding: 64px 12px 40px; }
.c-loupe-in img { width: min(900px, 100%); height: auto; box-shadow: 0 14px 40px rgba(0, 0, 0, .6); border-radius: 2px; }
.c-close { position: fixed; top: 12px; right: 14px; z-index: 41; width: 44px; height: 44px; border-radius: 50%; border: 1px solid rgba(201, 165, 106, .45); background: rgba(20, 13, 8, .8); color: #f0e0c2; font-size: 26px; line-height: 1; }

/* si la bibliothèque des pages ne se charge pas : le menu s'affiche simplement */
.c-fallback { display: none; }
body.no-flip { overflow: auto; } body.no-flip .c-stage, body.no-flip .c-arrow { display: none; }
body.no-flip .c-fallback { display: flex; flex-direction: column; align-items: center; gap: 18px; padding: 70px 12px 80px; }
body.no-flip .c-fallback img { width: min(800px, 100%); box-shadow: 0 14px 40px rgba(0, 0, 0, .6); }
.table-bar { display: none; }

.c-link { text-decoration: none; display: inline-block; }
@media (max-width: 640px) { .c-right .c-link { display: none; } .c-zoom { padding: 7px 11px; font-size: 10px; } .c-right .btn.sm { min-height: 34px; padding: 0 14px; font-size: 11px; letter-spacing: .1em; } .c-back { white-space: nowrap; } }

/* =====================================================================
   VERSION PREMIUM (29/11/2026) : écrin sombre et velouté, livre noir à
   filets dorés, tranches dorées, papier ivoire net. Plus de bois ni de cuir usé.
   ===================================================================== */
:root { --leather: linear-gradient(135deg, #1d1814 0%, #120e0b 55%, #1a1511 100%); }
body.carte { background: #0b0907; }
.c-bg { inset: 0; filter: none;
  background:
    radial-gradient(ellipse 46% 52% at 50% 46%, rgba(214, 178, 118, .16), transparent 72%),
    radial-gradient(ellipse 90% 90% at 50% 46%, transparent 40%, rgba(0, 0, 0, .75) 100%),
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='56' height='56'%3E%3Cpath d='M28 0L56 28L28 56L0 28Z' fill='none' stroke='%23c9a56a' stroke-opacity='.07' stroke-width='.8'/%3E%3Ccircle cx='28' cy='28' r='1.2' fill='%23c9a56a' fill-opacity='.12'/%3E%3C/svg%3E"),
    linear-gradient(180deg, #17120e, #0b0907 70%); }
/* cadre doré très fin autour de l'écran */
.c-bg::after { content: ""; position: absolute; inset: 12px; border: 1px solid rgba(201, 165, 106, .18); border-radius: 4px; }
body.carte::after { opacity: .04; }

/* plats du livre : noir lisse, reflet satiné, filet doré */
.c-boards { background: radial-gradient(ellipse 80% 60% at 30% 20%, rgba(255, 235, 200, .07), transparent 60%), linear-gradient(135deg, #221c17, #110d0a 60%, #1b1612);
  box-shadow: inset 0 0 0 1px rgba(201, 165, 106, .55), inset 0 0 0 4px #15110d, inset 0 0 0 5px rgba(201, 165, 106, .25), 0 2px 0 #050403, 0 30px 60px rgba(0, 0, 0, .6); }
.c-boards::after { background: linear-gradient(90deg, rgba(0, 0, 0, .55), rgba(201, 165, 106, .12), rgba(0, 0, 0, .55)); }
.c-shadow { background: rgba(0, 0, 0, .85); filter: blur(34px); }

/* tranches dorées */
.c-stack.left, .c-stack.right { background:
    linear-gradient(180deg, rgba(255, 248, 225, .45), transparent 25%, transparent 70%, rgba(60, 38, 10, .35)),
    repeating-linear-gradient(90deg, #e9cf96 0 1.4px, #b8893f 1.4px 2.2px, #d9b56e 2.2px 3px); }
.c-stack.bottom { background: linear-gradient(90deg, rgba(255, 248, 225, .3), transparent 40%, rgba(60, 38, 10, .3)), repeating-linear-gradient(180deg, #e9cf96 0 1.4px, #b08240 1.4px 2px); }

/* papier ivoire, net et fin */
.c-page { background: #fbf7ef; box-shadow: inset 0 0 0 1px rgba(169, 131, 75, .25); }
.c-page .paper { opacity: .22; }
.c-page .paper::after { display: none; }

/* couverture : noir profond, dorure à chaud, double filet */
.c-cover { background: radial-gradient(ellipse 85% 70% at 35% 25%, rgba(255, 235, 200, .08), transparent 60%), linear-gradient(140deg, #231d17, #100c09 58%, #1a1511); }
.c-cover .tint { background: radial-gradient(ellipse 90% 85% at 50% 45%, transparent 55%, rgba(0, 0, 0, .45) 100%); }
.c-cover .frame { inset: 6%; border: 1px solid #c9a56a; outline: .5px solid rgba(201, 165, 106, .65); outline-offset: -7px; box-shadow: none; }
.c-cover .frame::before, .c-cover .frame::after { content: "✦"; position: absolute; left: 50%; transform: translateX(-50%); color: #c9a56a; font-size: 12px; background: #17120e; padding: 0 8px; line-height: 1; }
.c-cover .frame::before { top: -7px; } .c-cover .frame::after { bottom: -7px; }
.c-cover img { filter: sepia(1) saturate(1.3) brightness(1.15) drop-shadow(0 1px 0 rgba(0, 0, 0, .8)); }

/* barre du haut et navigation plus fines */
.c-top { background: linear-gradient(180deg, rgba(11, 9, 7, .85), transparent); }
.c-right .btn { white-space: nowrap; }
.c-arrow { background: rgba(15, 12, 9, .6); border-color: rgba(201, 165, 106, .5); color: #e8cf9c; backdrop-filter: blur(4px); }
.c-arrow:hover { background: #c9a56a; color: #15110d; }
.c-chapters button { color: #a8977c; }
.c-chapters button.on { color: #f1dca6; border-color: #c9a56a; }
.c-zoom { white-space: nowrap; }
@media (max-width: 640px) {
  .c-back { font-size: 0; display: inline-grid; place-items: center; width: 38px; height: 38px; border: 1px solid rgba(201, 165, 106, .45); border-radius: 50%; }
  .c-back::before { content: "←"; font-size: 18px; letter-spacing: 0; color: #e8cf9c; }
  .c-bg::after { inset: 6px; }
}

/* fond : marbre noir veiné d'or (assets/fond-marbre.jpg), lumière douce sur le livre */
.c-bg { background:
    radial-gradient(ellipse 44% 50% at 50% 46%, rgba(214, 178, 118, .14), transparent 72%),
    radial-gradient(ellipse 95% 95% at 50% 46%, transparent 45%, rgba(0, 0, 0, .7) 100%),
    url("../assets/fond-marbre.jpg") center / cover, #0d0b09; }

/* le livre reste dans son plan : il ne passe plus jamais devant les rubriques ni les flèches */
.c-stage { position: relative; z-index: 1; }
.c-top { z-index: 30; }
.c-arrow { z-index: 30; }
.c-chapters { z-index: 30; left: 50%; right: auto; transform: translateX(-50%); max-width: calc(100% - 24px); box-sizing: border-box;
  padding: 4px 10px; border-radius: 999px; background: rgba(13, 10, 8, .82); border: 1px solid rgba(201, 165, 106, .35);
  backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); box-shadow: 0 10px 30px rgba(0, 0, 0, .5); }
.c-chapters button { color: #d6c3a0; padding: 9px 13px; }
.c-chapters button:hover { color: #fff; }
.c-chapters button.on { color: #15110d; background: linear-gradient(120deg, #c99d5a, #ecd39c 50%, #c69a57); border-radius: 999px; border-color: transparent; }
@media (max-width: 760px) { .c-chapters { left: 12px; right: 12px; transform: none; max-width: none; justify-content: flex-start; } }
.c-chapters button { font-size: 12px; letter-spacing: .1em; padding: 8px 11px; } .c-chapters { gap: 2px; }
@media (min-width: 761px) { .c-chapters { width: max-content; } }
