:root {
  --bg: #0b0814;
  --bg2: #120d20;
  --panel: #19122b;
  --line: #2e2448;
  --text: #e8e1f2;
  --muted: #a99cc0;
  --gold: #d8b46a;
  --violet: #a879ff;
  --accent: var(--violet);
  --title: "Cinzel", "Trajan Pro", Georgia, serif;
  --body: "EB Garamond", Georgia, "Times New Roman", serif;
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0; background: var(--bg); color: var(--text);
  font-family: var(--body); font-size: 19px; line-height: 1.6;
  background-image: radial-gradient(1200px 600px at 50% 120%, #1d1236 0%, transparent 70%);
}
img { max-width: 100%; height: auto; display: block; }
a { color: var(--gold); }
h1, h2, h3 { font-family: var(--title); font-weight: 700; letter-spacing: .04em; line-height: 1.2; }

/* Barre du haut */
.topbar {
  position: fixed; inset: 0 0 auto 0; z-index: 10;
  display: flex; align-items: center; gap: 24px; padding: 12px 24px;
  background: linear-gradient(#0b0814ee, #0b081400);
  transition: background .3s;
}
.topbar.solid { background: #0b0814f2; border-bottom: 1px solid var(--line); }
.brand { font-family: var(--title); font-size: 22px; color: var(--text); text-decoration: none; letter-spacing: .15em; }
.nav { display: flex; gap: 20px; margin-left: auto; }
.nav a { color: var(--muted); text-decoration: none; font-size: 17px; }
.nav a:hover { color: var(--text); }
.nav { align-items: center; }

/* Menu déroulant des tomes */
.dd { position: relative; }
.dd > button {
  background: none; border: 0; padding: 4px 0; cursor: pointer;
  color: var(--muted); font: 17px var(--body);
}
.dd > button:hover, .dd.open > button { color: var(--text); }
.dd-caret { display: inline-block; font-size: 12px; transition: transform .2s; }
.dd.open .dd-caret { transform: rotate(180deg); }
.dd-menu {
  display: none; position: absolute; top: calc(100% + 10px); left: 50%; transform: translateX(-50%);
  min-width: 290px; margin: 0; padding: 6px; list-style: none;
  max-height: calc(100vh - 90px); max-height: calc(100dvh - 90px); overflow-y: auto; overscroll-behavior: contain;
  background: #140e24f7; border: 1px solid var(--line); border-radius: 8px; box-shadow: 0 16px 40px #000c;
}
.dd.open .dd-menu { display: block; }
.dd-menu a { display: flex; align-items: center; gap: 12px; padding: 8px 10px; border-radius: 6px; color: var(--text); font-size: 18px; line-height: 1.25; }
.dd-menu a:hover, .dd-menu a:focus-visible { background: #ffffff0f; color: var(--text); outline: none; }
.dd-menu img { width: 64px; height: 50px; object-fit: cover; border-radius: 4px; flex: none; box-shadow: 0 0 0 1px #ffffff14; }
.dd-menu small { display: block; font: 600 12px var(--title); letter-spacing: .2em; text-transform: uppercase; color: var(--accent, var(--violet)); }
.dd-all { border-top: 1px solid var(--line); margin-top: 6px; padding-top: 6px; }
.dd-all a { justify-content: center; color: var(--muted); font-size: 16px; }
.lang { display: flex; border: 1px solid var(--line); border-radius: 999px; overflow: hidden; }
.lang button {
  background: none; border: 0; color: var(--muted); font: 600 14px var(--title);
  padding: 6px 12px; cursor: pointer; letter-spacing: .08em;
}
.lang button[aria-pressed="true"] { background: var(--violet); color: #12091f; }

/* Bandeau */
.hero { position: relative; min-height: clamp(540px, 92vh, 860px); display: grid; place-items: end center; overflow: hidden; }
.hero picture, .hero-bg { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: 65% center; }
.hero-shade { position: absolute; inset: 0; background: linear-gradient(180deg, #0b081466 0%, #0b081400 35%, #0b0814cc 75%, var(--bg) 100%); }
.hero-content { position: relative; text-align: center; max-width: 760px; padding: 0 16px 9vh; }
.kicker { font-family: var(--title); color: var(--gold); letter-spacing: .3em; text-transform: uppercase; font-size: 14px; margin: 0; }
.hero h1 { font-size: clamp(38px, 7vw, 76px); margin: 10px 0 16px; text-shadow: 0 0 30px #a879ff88, 0 2px 4px #000; }
.lead { font-size: clamp(18px, 2.2vw, 22px); color: #ddd3ee; margin: 0 auto 28px; text-shadow: 0 1px 3px #000; }
.note { color: var(--muted); font-size: 15px; margin-top: 14px; }
.btn {
  display: inline-block; padding: 12px 28px; border-radius: 4px; text-decoration: none;
  font: 700 16px var(--title); letter-spacing: .1em; color: #140a22;
  background: linear-gradient(180deg, #e9cd8c, var(--gold)); box-shadow: 0 0 24px #d8b46a44;
  transition: transform .15s, box-shadow .15s; border: 0; cursor: pointer;
}
.btn:hover { transform: translateY(-1px); box-shadow: 0 0 32px #d8b46a77; }

/* Sections */
.section { max-width: 1120px; margin: 0 auto; padding: 72px 16px; }
.section > h2 { font-size: clamp(28px, 4vw, 40px); text-align: center; margin: 0 0 8px; }
.section > h2::after { content: ""; display: block; width: 80px; height: 2px; margin: 14px auto 0; background: linear-gradient(90deg, transparent, var(--gold), transparent); }
.sub { text-align: center; color: var(--muted); margin: 0 0 48px; }

/* Vignettes des tomes (accueil) */
.book-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 240px), 1fr)); gap: 24px; }
.card {
  --accent: var(--violet);
  display: flex; flex-direction: column; text-decoration: none; color: var(--text); overflow: hidden;
  background: linear-gradient(160deg, var(--panel), var(--bg2));
  border: 1px solid var(--line); border-radius: 10px; box-shadow: 0 20px 60px #0008;
  transition: transform .2s, border-color .2s, box-shadow .2s; scroll-margin-top: 80px;
}
.card:hover, .card:focus-visible { transform: translateY(-4px); border-color: var(--accent); box-shadow: 0 24px 60px #000a, 0 0 40px color-mix(in srgb, var(--accent) 25%, transparent); outline: none; }
.card img { width: 100%; aspect-ratio: 1024 / 796; object-fit: cover; transition: filter .3s; filter: saturate(.9); }
.card:hover img { filter: saturate(1.1); }
.card-body { padding: 18px 20px 22px; display: flex; flex-direction: column; flex: 1; }
.card h3 { font-size: clamp(22px, 2.4vw, 27px); margin: 4px 0 6px; }
.card .tagline { margin-bottom: 18px; font-size: 18px; }
.card-more { margin-top: auto; font: 700 15px var(--title); letter-spacing: .1em; color: var(--accent); }

/* Page d'un tome */
.book-main { max-width: 1120px; margin: 0 auto; padding: 88px 16px 56px; }
.crumb { margin: 0 0 18px; font-size: 17px; }
.crumb a { color: var(--muted); text-decoration: none; }
.crumb a:hover { color: var(--text); }
.actions.center { justify-content: center; margin-top: 32px; }
.pager { display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.pager a { color: var(--muted); text-decoration: none; font-size: 18px; }
.pager a:hover { color: var(--text); }
.pager small { font: 600 12px var(--title); letter-spacing: .2em; text-transform: uppercase; color: var(--gold); }
.pager .next { margin-left: auto; text-align: right; }

/* Fiche d'un tome */
.book {
  --accent: var(--violet);
  display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 6fr); gap: 40px;
  background: linear-gradient(160deg, var(--panel), var(--bg2));
  border: 1px solid var(--line); border-radius: 10px; padding: 32px; margin-bottom: 48px;
  box-shadow: 0 20px 60px #0008;
}
.book-cover { position: relative; }
.book-cover img { width: 100%; border-radius: 6px; box-shadow: 0 0 0 1px #ffffff14, 0 10px 40px #000a, 0 0 60px color-mix(in srgb, var(--accent) 25%, transparent); }
.book-num { font-family: var(--title); color: var(--accent); letter-spacing: .25em; text-transform: uppercase; font-size: 14px; margin: 0; }
.book h1 { font-size: clamp(30px, 4vw, 44px); margin: 4px 0 4px; }
.tagline { font-style: italic; color: var(--gold); margin: 0 0 16px; font-size: 20px; }
.book-desc { margin: 0 0 20px; }
.stats { display: flex; flex-wrap: wrap; gap: 10px 28px; margin: 0 0 24px; padding: 0; list-style: none; }
.stats b { display: block; font-family: var(--title); font-size: 26px; color: var(--accent); line-height: 1; }
.stats span { color: var(--muted); font-size: 15px; }
.actions { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; }
.link-btn { background: none; border: 1px solid var(--line); color: var(--text); font: 16px var(--body); padding: 10px 18px; border-radius: 4px; cursor: pointer; }
.link-btn:hover { border-color: var(--accent); }
.intro { display: none; margin: 0 0 28px; padding: 18px 22px; border-left: 2px solid var(--accent); background: #0005; border-radius: 0 6px 6px 0; }
.intro.open { display: block; }
.intro p { margin: 0 0 12px; } .intro p:last-child { margin: 0; }
.book-extra { grid-column: 1 / -1; order: 3; }
.section, .book { scroll-margin-top: 64px; }
.book-extra h4 { font-family: var(--title); letter-spacing: .1em; font-size: 16px; color: var(--muted); text-transform: uppercase; margin: 8px 0 14px; }
.talents { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 14px; margin: 0 0 28px; padding: 0; list-style: none; }
.talents li { border: 1px solid var(--line); border-radius: 6px; padding: 14px 16px; background: #0003; }
.talents strong { display: block; font-family: var(--title); font-size: 16px; color: var(--accent); margin-bottom: 4px; }
.talents span { color: var(--muted); font-size: 17px; }
.gallery { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 10px; }
.gallery button { padding: 0; border: 0; background: none; cursor: zoom-in; border-radius: 4px; overflow: hidden; position: relative; aspect-ratio: 1024 / 796; }
.gallery img { width: 100%; height: 100%; object-fit: cover; transition: transform .35s, filter .35s; filter: saturate(.85); }
.gallery button:hover img, .gallery button:focus-visible img { transform: scale(1.06); filter: saturate(1.1); }

/* Comment jouer */
.steps { list-style: none; padding: 0; margin: 40px 0 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 20px; }
.steps li { background: var(--panel); border: 1px solid var(--line); border-radius: 8px; padding: 24px; }
.steps .num { font-family: var(--title); font-size: 32px; color: var(--gold); }
.steps h3 { font-size: 19px; margin: 6px 0 8px; }
.steps p { margin: 0; color: var(--muted); }

.about { max-width: 760px; text-align: center; color: var(--muted); }
.footer { text-align: center; color: var(--muted); font-size: 15px; padding: 30px 16px 40px; border-top: 1px solid var(--line); }

/* Visionneuse */
#lightbox { border: 0; padding: 0; background: transparent; max-width: min(1100px, 94vw); color: var(--text); }
#lightbox::backdrop { background: #05030ae8; }
#lightbox img { max-height: 80vh; width: auto; margin: 0 auto; border-radius: 6px; }
.lb-cap { text-align: center; font-style: italic; margin: 12px 0 0; }
.lb-close { position: absolute; top: 6px; right: 10px; z-index: 1; background: #000a; border: 0; color: #fff; font-size: 30px; width: 44px; height: 44px; border-radius: 50%; cursor: pointer; }

@media (min-width: 1000px) {
  .hero { place-items: center start; }
  .hero-content { text-align: left; max-width: 620px; margin-left: max(40px, calc((100vw - 1120px) / 2)); padding: 80px 16px 0; }
  .hero-content .lead { margin-left: 0; }
  .hero-shade { background: linear-gradient(90deg, #0b0814dd 0%, #0b081499 35%, #0b081400 60%), linear-gradient(180deg, #0b081400 70%, var(--bg) 100%); }
}
@media (min-width: 900px) {
  .dd.open .dd-menu { display: grid; grid-template-columns: 1fr 1fr; column-gap: 4px; width: 640px; }
  .dd-all { grid-column: 1 / -1; }
}
@media (max-width: 860px) {
  .book { grid-template-columns: 1fr; padding: 20px; gap: 24px; }
}
@media (max-width: 600px) {
  body { font-size: 18px; }
  .topbar { padding: 10px 16px; gap: 12px; }
  .nav-link { display: none; }
  .nav { margin-left: auto; }
  .dd-menu { left: auto; right: -60px; transform: none; min-width: min(290px, calc(100vw - 32px)); }
  .gallery { grid-template-columns: repeat(2, 1fr); }
  .section { padding: 56px 16px; }
}
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } * { transition: none !important; } }
