/* =====================================================================
   NADIA CHEBAH — « Le Reflet d'une Frontière » (reflet.html)
   Page-livre immersive : un chapitre par écran, l'ambiance colorée
   suit le récit (fond/texte pilotés par data-bg / data-fg / data-accent
   via js/reflet.js). Mêmes familles typographiques que le site.
   ===================================================================== */

:root {
  --font-display: 'Cormorant Garamond', Georgia, 'Times New Roman', serif;
  --font-body:    'EB Garamond', Georgia, 'Times New Roman', serif;
  --gold:      #C2A06A;
  --gold-deep: #8F7341;

  /* Ambiance courante (mise à jour au scroll par reflet.js) */
  --page-bg:     #F4EDE3;
  --page-fg:     #33261B;
  --page-accent: #8F7341;

  --ease: cubic-bezier(0.22, 0.61, 0.36, 1);
}

*, *::before, *::after { box-sizing: border-box; }
* { margin: 0; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; background: var(--page-bg); }
body {
  font-family: var(--font-body);
  background: var(--page-bg);
  color: var(--page-fg);
  font-size: clamp(1.08rem, 0.5vw + 0.98rem, 1.25rem);
  line-height: 1.78;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  transition: background 1.1s var(--ease), color 1.1s var(--ease);
}
img, svg { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
button { font: inherit; cursor: pointer; border: none; background: none; color: inherit; }
:focus-visible { outline: 2px solid var(--page-accent); outline-offset: 3px; }
::selection { background: var(--gold-deep); color: #fff; }

/* ---------- Barre de progression ---------- */
.progress {
  position: fixed; inset: 0 0 auto 0; height: 2px; z-index: 120;
  background: transparent;
}
.progress span {
  display: block; height: 100%; width: 0;
  background: var(--page-accent);
  opacity: 0.65;
  transition: width 0.15s linear, background 1.1s var(--ease);
}

/* ---------- En-tête minimal ---------- */
.book-header {
  position: fixed; inset: 0 0 auto 0; z-index: 110;
  display: flex; align-items: center; justify-content: space-between;
  padding: 1.1rem clamp(1.25rem, 4vw, 3rem);
  pointer-events: none; /* laisse passer le scroll, réactivé sur les liens */
}
.book-header a, .book-header .lang-switch { pointer-events: auto; }
.back-link {
  font-family: var(--font-body);
  letter-spacing: 0.14em;
  font-size: 0.82rem;
  text-transform: uppercase;
  opacity: 0.75;
  transition: opacity 0.25s var(--ease);
}
.back-link:hover { opacity: 1; }
.brand-dot { color: var(--page-accent); }

.lang-switch { display: flex; align-items: center; gap: 0.4em; font-size: 0.82rem; }
.lang-sep { opacity: 0.4; }
.lang-btn {
  letter-spacing: 0.12em; padding: 0.2em 0.1em; opacity: 0.5;
  border-bottom: 1px solid transparent;
  transition: opacity 0.25s var(--ease), border-color 0.25s var(--ease);
}
.lang-btn:hover { opacity: 0.85; }
.lang-btn.is-active { opacity: 1; border-bottom-color: var(--page-accent); }

/* ---------- Chapitres ---------- */
.ch {
  min-height: 100vh;
  min-height: 100svh;
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  padding: clamp(5rem, 12vh, 8rem) clamp(1.25rem, 5vw, 3rem);
  position: relative;
}
.ch-inner {
  width: 100%; max-width: 38rem;
  text-align: center;
  opacity: 0; transform: translateY(26px);
  transition: opacity 0.9s var(--ease), transform 0.9s var(--ease);
}
.ch-inner.is-in { opacity: 1; transform: none; }

.ch-eyebrow {
  font-family: var(--font-body);
  text-transform: uppercase;
  letter-spacing: 0.3em;
  font-size: 0.72rem;
  color: var(--page-accent);
  transition: color 1.1s var(--ease);
  margin-bottom: 1.1rem;
}
.ch-title {
  font-family: var(--font-display);
  font-style: italic;
  font-weight: 500;
  font-size: clamp(2.2rem, 5.5vw, 3.6rem);
  line-height: 1.05;
  margin-bottom: clamp(1.6rem, 4vh, 2.6rem);
}
.ch-text p { margin-bottom: 1.15em; }
.ch-text p:last-child { margin-bottom: 0; }
.ch-text .is-strong {
  font-family: var(--font-display);
  font-style: italic;
  font-size: 1.22em;
  margin-top: 1.4em;
}

/* ---------- Couverture ---------- */
.hero-title {
  font-family: var(--font-display);
  font-style: italic;
  font-weight: 500;
  font-size: clamp(2.6rem, 7vw, 4.6rem);
  line-height: 1.02;
}
.hero-sub {
  margin-top: 0.9rem;
  font-style: italic;
  opacity: 0.75;
  font-size: 1.05em;
}
.gold-rule {
  display: block; width: 64px; height: 1px;
  background: var(--page-accent);
  margin: clamp(1.4rem, 3.5vh, 2.2rem) auto;
  transition: background 1.1s var(--ease);
}
.hero-art {
  width: min(400px, 78vw);
  margin-inline: auto;
  -webkit-mask-image: linear-gradient(to bottom, #000 72%, transparent 100%);
          mask-image: linear-gradient(to bottom, #000 72%, transparent 100%);
}
.hero-scroll {
  position: absolute; bottom: 2rem; left: 50%; transform: translateX(-50%);
  display: flex; flex-direction: column; align-items: center; gap: 0.7rem;
  text-transform: uppercase; letter-spacing: 0.26em; font-size: 0.68rem;
  opacity: 0.55;
}
.hero-scroll-line {
  width: 1px; height: 44px;
  background: currentColor;
  animation: scrollPulse 2.4s var(--ease) infinite;
  transform-origin: top;
}
@keyframes scrollPulse {
  0% { transform: scaleY(0); opacity: 0; }
  35% { transform: scaleY(1); opacity: 0.8; }
  100% { transform: scaleY(1) translateY(10px); opacity: 0; }
}

/* ---------- Ornements ---------- */
.black-ball {
  width: 46px; height: 34px;
  background: #0A0806;
  border-radius: 50%;
  margin: 0 auto 2rem;
  transform: rotate(-14deg);
  box-shadow: 0 0 46px 10px rgba(190, 60, 40, 0.35);
}
.fleuron {
  font-size: 1.6rem;
  color: var(--page-accent);
  margin-top: clamp(1.8rem, 4vh, 2.8rem);
  transition: color 1.1s var(--ease);
}

/* ---------- Boutons (repris du site) ---------- */
.btn {
  display: inline-block;
  font-family: var(--font-body);
  text-transform: uppercase;
  letter-spacing: 0.16em;
  font-size: 0.78rem;
  padding: 0.95em 1.8em;
  border-radius: 1px;
  transition: background 0.25s var(--ease), color 0.25s var(--ease), border-color 0.25s var(--ease);
}
.btn-primary { background: var(--gold-deep); color: #F6F0E6; }
.btn-primary:hover { background: #33261B; }
.btn-ghost { border: 1px solid var(--gold-deep); color: var(--gold); }
.btn-ghost:hover { background: var(--gold); color: #140F0A; border-color: var(--gold); }
.epilogue-actions { margin-top: clamp(1.6rem, 4vh, 2.4rem); }

/* ---------- L'artiste / pied de page ---------- */
.ch-artist { padding-bottom: 6.5rem; }
.artist-quote {
  font-family: var(--font-display);
  font-style: italic;
  font-size: clamp(1.7rem, 4vw, 2.5rem);
  margin-bottom: clamp(1.4rem, 3.5vh, 2.2rem);
}
.book-footer {
  position: absolute; bottom: 1.6rem; left: 0; right: 0;
  text-align: center;
  font-size: 0.82rem;
  opacity: 0.55;
}
.book-footer a { border-bottom: 1px solid rgba(194, 160, 106, 0.4); }

/* ---------- Accessibilité : mouvement réduit ---------- */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  body { transition: none; }
  .ch-inner { opacity: 1; transform: none; transition: none; }
  .hero-scroll-line { animation: none; }
}
