/* =========================================================
   MON PARCOURS — scrollytelling nuit
   Fond noir, image centrale qui zoome au scroll,
   deux sentiers qui encadrent l'image.
   ========================================================= */
:root {
  --noir: #000000;
  --blanc: #ffffff;
  --texte-2: #cccccc;
  --texte-3: #999999;
  --carte-fond: rgba(255, 255, 255, 0.06);
  --carte-bord: rgba(255, 255, 255, 0.22);
  --halo: rgba(255, 255, 255, 0.25);
  --calligraphie: 'Rakkas', 'Grenze Gotisch', serif;
  --titre: 'Gabarito', sans-serif;
  --corps: 'Inter', sans-serif;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--noir);
  color: var(--blanc);
  font-family: var(--corps);
}

/* Placeholders à remplacer */
.a-completer {
  color: #ffd27a;
  border-bottom: 1px dashed #ffd27a;
  padding: 0 3px;
  font-style: italic;
}

/* =========================================================
   MODE INTERACTIF (défilement + zoom)
   ========================================================= */
.scrolly { position: relative; height: 620vh; }   /* hauteur = "piste" de scroll */
.stage {
  position: sticky;
  top: 0;
  height: 100vh;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* L'image centrale, dans un cadre qui masque le débordement du zoom */
.cadre {
  position: relative;
  aspect-ratio: 1200 / 982;               /* ratio de l'image */
  /* on tient dans l'écran SANS casser le ratio (donc sans rognage à l'ouverture) */
  height: min(86vh, calc(90vw * 982 / 1200));
  max-width: 94vw;
  border: 1px solid var(--carte-bord);
  border-radius: 12px;
  overflow: hidden;
  background: #000;
}
#village {
  position: absolute;
  top: 0; left: 0;
  width: 100%; height: 100%;
  object-fit: cover;
  transform-origin: 0 0;
  will-change: transform;
}

/* Texte de consigne (au départ, par-dessus l'image) */
.consigne {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  text-align: center;
  background: rgba(0, 0, 0, 0.35);
  transition: opacity 0.4s ease;
}
.consigne .phrase {
  font-family: var(--calligraphie);
  font-size: clamp(40px, 9vw, 74px);
  margin: 0;
  text-shadow: 0 2px 20px #000;
}
.consigne .nom {
  font-family: var(--titre);
  font-size: 14px; font-weight: 700;
  letter-spacing: 0.16em; text-transform: uppercase;
  margin: 0; color: var(--texte-2);
}
.consigne .sous { font-weight: 300; color: var(--texte-2); margin: 12px 0 0; font-size: 14px; }
.consigne .fleche { font-size: 26px; margin: 6px 0 0; animation: sautille 1.6s ease-in-out infinite; }
@keyframes sautille { 0%,100%{ transform: translateY(0);} 50%{ transform: translateY(7px);} }

/* Écran final : surcouche pleine largeur.
   Grille [titre | bouton | titre] pour garder le bouton bien centré. */
.fin {
  position: absolute;
  inset: 0;
  z-index: 5;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: clamp(20px, 4vw, 60px);
  padding: 0 4vw;
  background: rgba(0, 0, 0, 0.45);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.5s ease;
}
.fin.on { opacity: 1; pointer-events: auto; }

.fin-txt {
  font-family: var(--titre);
  font-size: 15px; font-weight: 700;
  letter-spacing: 0.16em; text-transform: uppercase;
  color: var(--texte-2); margin: 0;
  /* glisse depuis les côtés puis se cale près du bouton */
  transition: transform 0.8s cubic-bezier(0.22, 0.61, 0.36, 1), opacity 0.6s ease;
}
.fin-txt.gauche { justify-self: end; text-align: right; transform: translateX(-42vw); opacity: 0; }
.fin-txt.droite { justify-self: start; text-align: left; transform: translateX(42vw); opacity: 0; }
.fin.on .fin-txt { transform: translateX(0); opacity: 1; }
.btn-portfolio {
  font-family: var(--titre);
  font-size: 15px; font-weight: 700;
  letter-spacing: 0.14em; text-transform: uppercase;
  color: var(--noir); background: var(--blanc);
  text-decoration: none;
  padding: 16px 30px; border-radius: 8px;
  border: 1px solid var(--blanc);
  transition: all 0.25s ease;
}
.btn-portfolio:hover { transform: translateY(-3px); box-shadow: 0 8px 22px var(--halo); }

/* =========================================================
   COLONNES LATÉRALES (les deux sentiers encadrant l'image)
   ========================================================= */
.col {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: min(310px, 24vw);
  z-index: 3;
}
.col-gauche { left: 3vw; }
.col-droite { right: 3vw; }
/* à l'écran final, les titres latéraux s'effacent (ils "passent" au centre) */
.col { transition: opacity 0.5s ease; }
body.final .col { opacity: 0; pointer-events: none; }
.col-titre {
  font-family: var(--titre);
  font-size: 13px; font-weight: 700;
  letter-spacing: 0.14em; text-transform: uppercase;
  color: var(--texte-3);
  margin: 0 0 14px;
  text-align: center;
}
.cartes { position: relative; height: 260px; }

/* chaque carte occupe la même place ; seule l'active est visible */
.carte {
  position: absolute;
  inset: 0;
  background: var(--carte-fond);
  border: 1px solid var(--carte-bord);
  border-radius: 10px;
  padding: 18px;
  backdrop-filter: blur(4px);
  opacity: 0;
  transform: translateY(12px);
  transition: opacity 0.45s ease, transform 0.45s ease;
  pointer-events: none;
}
.carte.actif { opacity: 1; transform: none; pointer-events: auto; }

.annee {
  font-family: var(--titre);
  font-size: 12px; font-weight: 700; letter-spacing: 0.12em;
  color: var(--texte-3); margin: 0 0 6px;
}
.etape-titre { font-size: 16px; font-weight: 700; margin: 0 0 8px; line-height: 1.3; }
.etape-desc { font-size: 13.5px; font-weight: 300; color: var(--texte-2); margin: 0; }
.cours { margin: 10px 0 0; padding-left: 18px; font-size: 13px; font-weight: 300; color: var(--texte-2); }
.lien {
  display: inline-block; margin-top: 12px;
  font-family: var(--titre); font-size: 12px; font-weight: 700; letter-spacing: 0.08em;
  color: var(--blanc); text-decoration: none;
  border-bottom: 1px solid var(--blanc); padding-bottom: 2px;
}
.lien:hover { opacity: 0.6; }

/* =========================================================
   MODE STATIQUE (mobile / prefers-reduced-motion)
   Tout est empilé, pas de zoom au scroll.
   ========================================================= */
body.statique .scrolly { height: auto; }
body.statique .stage {
  position: static; height: auto; overflow: visible;
  flex-direction: column; gap: 30px; padding: 30px 16px 60px;
}
body.statique .cadre { height: auto; width: min(680px, 92vw); aspect-ratio: 1200 / 982; }
body.statique #village { position: static; width: 100%; height: 100%; transform: none !important; }
body.statique .consigne { position: static; background: none; padding: 10px 0 0; }
body.statique .consigne .fleche { display: none; }
body.statique .fin { position: static; opacity: 1; pointer-events: auto; background: none; margin-top: 10px; display: flex; flex-direction: column; gap: 16px; padding: 0; }
body.statique .fin-txt { transform: none !important; opacity: 1 !important; justify-self: center; text-align: center; }
body.statique .col { opacity: 1 !important; }
body.statique .col { position: static; transform: none; width: min(520px, 92vw); }
body.statique .cartes { height: auto; display: flex; flex-direction: column; gap: 14px; }
body.statique .carte { position: static; inset: auto; opacity: 1; transform: none; pointer-events: auto; }