/* ============================================================================
 * Balade en forêt — Expérience immersive (image-backed, gouache + UI fluide)
 * Fonds peints plein écran en fondu, nav pilule, grand titre manuscrit,
 * scrollytelling doux. Typo : Fraunces / Cormorant Garamond / Caveat.
 * ========================================================================== */

:root {
  --ink: #2c2a26;
  --ink-soft: #50554c;
  --parchment: #f5efe3;
  --gold: #b8964e;
  --shadow: 0 24px 60px -24px rgba(20, 25, 18, .6);
  --serif: "Cormorant Garamond", Georgia, serif;
  --display: "Fraunces", "Cormorant Garamond", serif;
  --hand: "Caveat", "Segoe Script", cursive;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: var(--serif);
  color: #fff;
  background: #0e120e;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

/* ---- Scène fixe : fonds peints en fondu --------------------------------- */
.bf-stage { position: fixed; inset: -28px; z-index: 0; overflow: hidden; background: #0e120e; }
.bf-bg {
  position: absolute; inset: 0; opacity: 0;
  transition: opacity .7s ease;
  will-change: opacity;
}
.bf-bg__inner {
  position: absolute; inset: -3%;
  background-size: cover; background-position: center;
  animation: bf-kenburns 30s ease-in-out infinite alternate;
  will-change: transform;
}
@keyframes bf-kenburns {
  0%   { transform: scale(1.04) translate(0, 0); }
  100% { transform: scale(1.13) translate(-1.6%, -1.4%); }
}
/* voile de lisibilité (assombrit haut + bas) */
.bf-scrim {
  position: fixed; inset: 0; z-index: 1; pointer-events: none;
  background:
    linear-gradient(180deg, rgba(12,16,12,.42) 0%, rgba(12,16,12,0) 20%,
      rgba(12,16,12,0) 50%, rgba(12,16,12,.30) 78%, rgba(12,16,12,.62) 100%);
}

/* ---- Feuilles flottantes ------------------------------------------------ */
.bf-particles {
  position: fixed; inset: 0; z-index: 2; pointer-events: none; overflow: hidden;
  transform: translate3d(var(--pmx, 0px), var(--pmy, 0px), 0);
  transition: transform .6s cubic-bezier(.2,.7,.2,1);
}
.bf-leaf {
  position: absolute; top: -8vh; left: 0;
  background: linear-gradient(135deg, rgba(220,210,180,.7), rgba(150,130,90,.5));
  border-radius: 0 100% 0 100% / 100% 0 100% 0;
  filter: blur(.4px); will-change: transform;
  animation: bf-fall var(--dur, 20s) linear var(--delay, 0s) infinite;
}
@keyframes bf-fall {
  0%   { transform: translate3d(0, 0, 0) rotate(0deg); }
  50%  { transform: translate3d(5vw, 58vh, 0) rotate(180deg); }
  100% { transform: translate3d(-3vw, 122vh, 0) rotate(360deg); }
}

/* ---- Navigation (pilule glassmorphism) ---------------------------------- */
.bf-nav {
  position: fixed; top: 22px; left: 0; right: 0; z-index: 40;
  display: flex; justify-content: center; padding: 0 18px;
  pointer-events: none;
}
.bf-nav__pill {
  pointer-events: auto;
  display: flex; align-items: center; gap: 8px;
  padding: 9px 9px 9px 22px;
  background: rgba(255, 255, 255, .14);
  border: 1px solid rgba(255, 255, 255, .28);
  backdrop-filter: blur(14px) saturate(1.2);
  -webkit-backdrop-filter: blur(14px) saturate(1.2);
  border-radius: 999px;
  box-shadow: 0 10px 30px -12px rgba(0,0,0,.5);
}
.bf-nav__brand {
  font-family: var(--display); font-weight: 600; font-size: 18px;
  color: #fff; text-decoration: none; letter-spacing: .01em; margin-right: 10px;
  white-space: nowrap;
}
.bf-nav__links { display: flex; align-items: center; gap: 4px; }
.bf-nav__links a {
  color: rgba(255,255,255,.9); text-decoration: none;
  font-family: var(--display); font-size: 14px; letter-spacing: .02em;
  padding: 8px 14px; border-radius: 999px; transition: background .25s, color .25s;
  white-space: nowrap;
}
.bf-nav__links a:hover { background: rgba(255,255,255,.18); }
.bf-nav__cta {
  background: #fff !important; color: var(--ink) !important; font-weight: 600;
}
.bf-nav__cta:hover { background: #f0ead9 !important; }

/* Bouton hamburger (caché sur grand écran) */
.bf-nav__burger {
  display: none; background: none; border: 0; cursor: pointer;
  padding: 8px 8px; margin-left: 4px; color: #fff;
}
.bf-nav__burger span {
  display: block; width: 22px; height: 2px; background: currentColor;
  border-radius: 2px; margin: 4px 0; transition: transform .25s, opacity .25s;
}
.bf-nav__pill.is-open .bf-nav__burger span:nth-child(1) { transform: translateY(6px) rotate(45deg); }
.bf-nav__pill.is-open .bf-nav__burger span:nth-child(2) { opacity: 0; }
.bf-nav__pill.is-open .bf-nav__burger span:nth-child(3) { transform: translateY(-6px) rotate(-45deg); }

@media (max-width: 680px) {
  .bf-nav__pill { position: relative; padding: 8px 10px 8px 18px; gap: 6px; }
  .bf-nav__brand { font-size: 16px; margin-right: auto; }
  .bf-nav__burger { display: block; }
  /* Les liens deviennent un menu déroulant sous la pilule */
  .bf-nav__links {
    display: none;
    position: absolute; top: calc(100% + 10px); right: 0;
    flex-direction: column; align-items: stretch; gap: 2px;
    min-width: 200px; padding: 10px;
    background: rgba(18, 24, 16, .94);
    -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, .22); border-radius: 16px;
    box-shadow: 0 20px 44px -18px rgba(0, 0, 0, .65);
  }
  .bf-nav__pill.is-open .bf-nav__links { display: flex; }
  .bf-nav__links a { padding: 12px 16px; font-size: 15px; }
  .bf-nav__links a[data-opt] { display: block; } /* tous les liens visibles dans le menu */
}

/* ---- Sections (défilent par-dessus la scène fixe) ----------------------- */
#balade { position: relative; z-index: 3; }
.bf-zone { position: relative; min-height: 100vh; display: flex; flex-direction: column; }
.bf-zone--accueil { min-height: 100vh; }
.bf-zone--chapitre { min-height: 100vh; justify-content: center; padding: 16vh 0; }

.bf-content { position: relative; width: 100%; }

/* ---- Accueil (hero) ----------------------------------------------------- */
.bf-hero {
  min-height: 100vh; display: flex; flex-direction: column;
  align-items: center; justify-content: center; text-align: center;
  padding: 0 24px; position: relative;
}
.bf-hero__eyebrow {
  font-family: var(--display); font-weight: 500; letter-spacing: .44em;
  text-transform: uppercase; font-size: 13px; color: rgba(255,255,255,.92);
  margin: 0 0 6px; text-shadow: 0 2px 14px rgba(0,0,0,.4);
}
.bf-hero__title {
  font-family: var(--hand); font-weight: 700;
  font-size: clamp(72px, 15vw, 200px); line-height: .82; margin: 0;
  color: #fffaf0; letter-spacing: .01em;
  text-shadow: 0 6px 30px rgba(10, 20, 10, .5);
}
.bf-hero__title span { display: block; }
.bf-hero__author {
  font-family: var(--display); font-size: clamp(18px, 2.4vw, 26px);
  letter-spacing: .14em; color: #fff; margin: 18px 0 0;
  text-shadow: 0 2px 14px rgba(0,0,0,.45);
}
.bf-hero__lede {
  font-family: var(--serif); font-style: italic; font-size: clamp(18px, 2.2vw, 23px);
  color: #f3f6ea; max-width: 540px; margin: 22px auto 0; line-height: 1.5;
  text-shadow: 0 2px 14px rgba(0,0,0,.45);
}
.bf-scrollcue {
  position: absolute; bottom: 34px; left: 50%; transform: translateX(-50%);
  display: inline-flex; align-items: center; gap: 10px;
  padding: 10px 20px; border-radius: 999px;
  background: rgba(255,255,255,.14); border: 1px solid rgba(255,255,255,.28);
  backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
  font-family: var(--display); letter-spacing: .14em; text-transform: uppercase;
  font-size: 11px; color: #fff; transition: opacity .6s;
}
.bf-scrollcue i { font-style: normal; animation: bf-bob 1.8s ease-in-out infinite; }
@keyframes bf-bob { 0%,100% { transform: translateY(-2px); } 50% { transform: translateY(3px); } }
body.bf-scrolled .bf-scrollcue { opacity: 0; }

/* éclats de vers cliquables sur l'accueil */
.bf-glint {
  position: absolute; width: 24px; height: 24px; border: 0; background: none;
  cursor: pointer; transform: translate(-50%, -50%); padding: 0; z-index: 4;
}
.bf-glint i {
  display: block; width: 11px; height: 11px; margin: 6px auto; border-radius: 50%;
  background: radial-gradient(circle, #fff 0%, #f7e6a8 45%, transparent 72%);
  box-shadow: 0 0 16px 5px rgba(255, 244, 200, .75);
  animation: bf-pulse 2.6s ease-in-out infinite;
}
.bf-glint:hover i { transform: scale(1.5); }
@keyframes bf-pulse { 0%,100% { opacity: .5; transform: scale(.8); } 50% { opacity: 1; transform: scale(1.25); } }

/* ---- Passages de texte posés sur le décor (jamais de fond blanc) -------- */
.bf-passage {
  position: relative; z-index: 1;
  width: min(720px, 90vw); margin: 6vh auto 0;
  padding: 6vh 5vw; text-align: center; color: #fdfaf2;
  text-shadow: 0 2px 20px rgba(8, 14, 9, .7);
}
.bf-passage::before {           /* halo doux sombre pour la lisibilité — pas une carte */
  content: ""; position: absolute; inset: -6% -10%; z-index: -1;
  background: radial-gradient(ellipse at center, rgba(8, 12, 9, .55) 0%, rgba(8, 12, 9, .32) 45%, rgba(8, 12, 9, 0) 75%);
  filter: blur(10px);
}
.bf-passage__eyebrow {
  font-family: var(--display); letter-spacing: .36em; text-transform: uppercase;
  font-size: 12px; opacity: .9; margin: 0 0 22px;
}
.bf-passage--intro p {
  font-family: var(--serif); font-style: italic;
  font-size: clamp(18px, 2.3vw, 24px); line-height: 1.7; margin: 0 0 .55em;
}
.bf-verse span {
  display: block; font-family: var(--serif); font-style: italic;
  font-size: clamp(20px, 2.7vw, 30px); line-height: 1.78;
}

/* ---- En-tête de chapitre ------------------------------------------------ */
.bf-chapter-head { text-align: center; max-width: 760px; margin: 0 auto 8vh; padding: 0 24px; }
.bf-chapter-head__index {
  font-family: var(--display); letter-spacing: .36em; text-transform: uppercase;
  font-size: 12px; color: rgba(255,255,255,.85); margin: 0 0 14px;
  text-shadow: 0 2px 12px rgba(0,0,0,.5);
}
.bf-chapter-head__title {
  font-family: var(--display); font-weight: 600; font-size: clamp(56px, 10vw, 132px);
  margin: 0; line-height: .9; color: #fff; text-shadow: 0 6px 28px rgba(0,0,0,.5);
}
.bf-chapter-head__sub { font-family: var(--hand); font-size: clamp(26px, 4vw, 46px); color: #f6e7b8; margin: 4px 0 0; text-shadow: 0 3px 16px rgba(0,0,0,.5); }
.bf-chapter-head__essence {
  font-family: var(--serif); font-style: italic; font-size: clamp(18px, 2.1vw, 23px);
  max-width: 540px; margin: 22px auto 0; line-height: 1.55; color: #f3f6ea;
  text-shadow: 0 2px 14px rgba(0,0,0,.5);
}

/* ---- Poèmes (cartes translucides, lisibles sur image) ------------------- */
.bf-poemes { width: min(680px, 90vw); margin: 0 auto; display: flex; flex-direction: column; gap: 7vh; }
.bf-poeme {
  background: rgba(245, 239, 227, .9);
  backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
  border-radius: 6px; padding: 46px clamp(28px, 5vw, 58px);
  box-shadow: var(--shadow); color: var(--ink); position: relative;
}
.bf-poeme::before {
  content: ""; position: absolute; inset: 8px; border: 1px solid rgba(120, 100, 60, .22);
  border-radius: 3px; pointer-events: none;
}
.bf-poeme__title { font-family: var(--display); font-weight: 600; font-size: clamp(26px, 3.4vw, 38px); margin: 0 0 22px; text-align: center; color: var(--ink); }
.bf-poeme__title small { display: block; font-family: var(--hand); font-size: .62em; color: var(--gold); }
.bf-poeme__body { font-family: var(--serif); font-size: clamp(18px, 2.1vw, 21px); line-height: 1.62; text-align: center; color: #38352f; }
.bf-poeme__body span { display: block; }
.bf-poeme__body br { display: block; content: ""; margin-top: .7em; }

/* ---- Révélation au défilement ------------------------------------------ */
.bf-reveal { opacity: 0; transform: translateY(30px); transition: opacity 1s cubic-bezier(.2,.7,.2,1), transform 1s cubic-bezier(.2,.7,.2,1); }
.bf-reveal.is-in { opacity: 1; transform: none; }
.bf-poeme.bf-reveal { transition-delay: calc(var(--i, 0) * 40ms); }

/* ---- Voile de révélation (éclats) -------------------------------------- */
.bf-veil {
  position: fixed; inset: 0; z-index: 50; display: flex; align-items: center; justify-content: center;
  background: rgba(12, 16, 12, .55); backdrop-filter: blur(7px);
  opacity: 0; visibility: hidden; transition: opacity .5s; padding: 24px;
}
.bf-veil.is-open { opacity: 1; visibility: visible; }
.bf-veil__card { background: var(--parchment); border-radius: 8px; padding: 50px 46px; max-width: 540px; box-shadow: var(--shadow); position: relative; transform: scale(.94); transition: transform .5s cubic-bezier(.2,.8,.2,1); }
.bf-veil.is-open .bf-veil__card { transform: none; }
.bf-veil__close { position: absolute; top: 12px; right: 16px; border: 0; background: none; font-size: 30px; line-height: 1; color: var(--ink-soft); cursor: pointer; }
.bf-veil__text { font-family: var(--serif); font-style: italic; font-size: 24px; line-height: 1.6; color: var(--ink); margin: 0; text-align: center; }
.bf-veil__text span { display: block; }

/* ---- Pied de balade ----------------------------------------------------- */
.bf-end { text-align: center; padding: 22vh 24px 24vh; }
.bf-end__mark { font-family: var(--hand); font-size: clamp(34px, 6vw, 64px); color: #fffaf0; text-shadow: 0 4px 20px rgba(0,0,0,.5); margin: 0 0 18px; line-height: 1; }
.bf-end__note { font-family: var(--serif); font-style: italic; font-size: clamp(17px, 2vw, 21px); color: #f3f6ea; max-width: 540px; margin: 0 auto 30px; line-height: 1.65; text-shadow: 0 2px 16px rgba(0,0,0,.6); }
.bf-end__note strong { font-style: normal; color: #f6e7b8; }
.bf-end__links { display: flex; gap: 16px; justify-content: center; flex-wrap: wrap; }
.bf-btn {
  display: inline-block; padding: 14px 28px; border-radius: 999px;
  font-family: var(--display); font-size: 15px; letter-spacing: .04em; text-decoration: none;
  background: #fff; color: var(--ink); transition: transform .2s, background .25s;
}
.bf-btn:hover { transform: translateY(-2px); background: #f0ead9; }
.bf-btn--ghost { background: rgba(255,255,255,.14); color: #fff; border: 1px solid rgba(255,255,255,.5); }
.bf-btn--ghost:hover { background: rgba(255,255,255,.24); }

/* ---- Accessibilité ------------------------------------------------------ */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .bf-bg__inner, .bf-leaf, .bf-glint i, .bf-scrollcue i { animation: none !important; }
  .bf-reveal { opacity: 1; transform: none; }
}
