/* ============================================================
   PALETTE & VARIABLES
   ============================================================ */
:root {
  --bg: #0a0a0a;
  --bg-elev: #141414;
  --bg-light: #1f1d1a;
  --text: #e8e6e1;
  --text-dim: #9a978f;
  --text-faint: #5a5751;
  --accent: #c0392b;       /* rouge sang — allemand / chiffres clés */
  --accent-glow: rgba(192, 57, 43, 0.4);
  --allied: #3a6b8c;       /* bleu — alliés */
  --sepia: #a08e6c;        /* archive */
  --rule: rgba(232, 230, 225, 0.12);

  --serif: 'Cormorant Garamond', Georgia, serif;
  --sans: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  --display: 'Oswald', 'Inter', sans-serif;

  --max-width: 1200px;
  --content-width: 720px;
}

/* ============================================================
   BASE
   ============================================================ */
body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--sans);
  font-size: 16px;
  font-weight: 300;
  letter-spacing: 0.01em;
  overflow-x: hidden;
}

strong { color: #fff; font-weight: 600; }
em { font-style: italic; color: var(--sepia); }

/* Scrollbar discrète */
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(232, 230, 225, 0.1); border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: rgba(232, 230, 225, 0.2); }

/* Sélection */
::selection { background: var(--accent); color: #fff; }

/* ============================================================
   LAYOUT GLOBAL — SECTIONS
   ============================================================ */
.section {
  position: relative;
  width: 100%;
  padding: 8rem 0;
}

.container {
  width: 100%;
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 2rem;
}

.section__overline {
  font-family: var(--display);
  text-transform: uppercase;
  letter-spacing: 0.4em;
  font-size: 0.75rem;
  color: var(--accent);
  margin-bottom: 1rem;
}

.section__title {
  font-family: var(--serif);
  font-size: clamp(2.5rem, 6vw, 4.5rem);
  font-weight: 600;
  line-height: 1.05;
  margin-bottom: 1.5rem;
  letter-spacing: -0.01em;
}

.word-reveal {
  display: inline-block;
  overflow: hidden;
  vertical-align: bottom;
  padding-bottom: 0.05em;
}

.word-reveal__inner {
  display: inline-block;
  will-change: transform, opacity;
}

.section__title--small {
  font-size: clamp(1.75rem, 3vw, 2.5rem);
}

.section__lede {
  font-family: var(--serif);
  font-size: clamp(1.25rem, 2vw, 1.6rem);
  font-style: italic;
  color: var(--text-dim);
  max-width: 700px;
  margin-bottom: 4rem;
}

/* ============================================================
   NAV CHAPITRES (fixe à gauche)
   ============================================================ */
.chapter-nav {
  position: fixed;
  top: 50%;
  left: 2rem;
  transform: translateY(-50%);
  z-index: 100;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.5s ease;
}

.chapter-nav.is-visible { opacity: 1; }

.chapter-nav ol {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  pointer-events: auto;
}

.chapter-nav a {
  display: flex;
  align-items: center;
  gap: 0.8rem;
  font-family: var(--display);
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.15em;
  color: var(--text-faint);
  transition: color 0.3s ease, transform 0.3s ease;
}

.chapter-nav a span {
  display: inline-block;
  width: 28px;
  height: 1px;
  background: currentColor;
  transition: width 0.3s ease, background 0.3s ease;
}

.chapter-nav a:hover,
.chapter-nav a.active {
  color: var(--text);
  transform: translateX(4px);
}

.chapter-nav a.active span {
  width: 48px;
  background: var(--accent);
}

@media (max-width: 900px) {
  .chapter-nav { display: none; }
}

/* ============================================================
   SCROLLYTELLING (sticky + steps)
   Carte plein écran derrière, texte en panneau à droite.
   ============================================================ */
.section--scroll {
  position: relative;
  padding: 0;
}

.scroll__sticky {
  position: sticky;
  top: 0;
  height: 100vh;
  width: 100%;
  z-index: 1;
}

.scroll__viz {
  position: relative;
  width: 100%;
  height: 100%;
}

/* Voile lateral pour fondre le texte avec la carte */
.scroll__viz::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(
    90deg,
    rgba(10, 10, 10, 0.15) 0%,
    rgba(10, 10, 10, 0) 35%,
    rgba(10, 10, 10, 0) 50%,
    rgba(10, 10, 10, 0.55) 75%,
    rgba(10, 10, 10, 0.85) 100%
  );
  pointer-events: none;
  z-index: 400;
}

/* Steps : alignés à droite, pas au centre */
.scroll__steps {
  position: relative;
  z-index: 2;
  max-width: 480px;
  width: 38%;
  margin: -100vh 5vw 0 auto;   /* ← collé à droite */
  padding: 4rem 0;
  pointer-events: none;
}

.step {
  min-height: 90vh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 2.2rem 2.5rem;
  margin-bottom: 4rem;
  background: rgba(8, 8, 8, 0.72);
  backdrop-filter: blur(14px) saturate(1.1);
  -webkit-backdrop-filter: blur(14px) saturate(1.1);
  border: 1px solid rgba(232, 230, 225, 0.06);
  border-radius: 2px;
  pointer-events: auto;
  opacity: 0;
  transform: translateX(40px);
  transition: opacity 0.6s ease, transform 0.6s cubic-bezier(0.2, 0.7, 0.2, 1);
  box-shadow:
    0 30px 80px rgba(0, 0, 0, 0.5),
    0 0 0 1px rgba(192, 57, 43, 0) inset;
}

.step.is-active {
  opacity: 1;
  transform: translateX(0);
  box-shadow:
    0 30px 80px rgba(0, 0, 0, 0.6),
    -3px 0 0 var(--accent);
}

.step h2,
.step h3 {
  font-family: var(--serif);
  font-size: 2rem;
  font-weight: 600;
  margin-bottom: 1.2rem;
  line-height: 1.1;
  color: #fff;
}

.step p {
  font-size: 1.05rem;
  line-height: 1.7;
  color: var(--text);
}

.step p + p { margin-top: 1rem; }

/* ============================================================
   CARTES (Leaflet)
   ============================================================ */
.map {
  width: 100%;
  height: 100%;
  background: #0d0d0d;
}

/* Mode sombre Leaflet — on filtre les tuiles */
.leaflet-tile-pane {
  filter: grayscale(1) invert(0.95) brightness(0.75) contrast(1.1) hue-rotate(180deg);
}

.leaflet-container {
  background: #0a0a0a !important;
  font-family: var(--sans) !important;
}

.leaflet-control-attribution {
  background: rgba(0, 0, 0, 0.7) !important;
  color: var(--text-faint) !important;
  font-size: 10px !important;
}

.leaflet-control-attribution a { color: var(--text-dim) !important; }

.map-legend {
  position: absolute;
  bottom: 1.5rem;
  left: 5vw;            /* déplacé à gauche (le texte est à droite maintenant) */
  z-index: 500;
  background: rgba(10, 10, 10, 0.85);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border: 1px solid var(--rule);
  padding: 0.8rem 1rem;
  font-size: 0.75rem;
  color: var(--text-dim);
  font-family: var(--sans);
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.map-legend i {
  display: inline-block;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  margin-right: 0.5rem;
  vertical-align: middle;
}

/* ============================================================
   PULSE MARKERS (custom divIcon)
   ============================================================ */
.pulse-marker {
  position: relative;
  display: block;
}

.pulse-marker__core {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  border-radius: 50%;
  z-index: 2;
  box-shadow: 0 0 12px rgba(0, 0, 0, 0.6);
  border: 2px solid rgba(255, 255, 255, 0.9);
}

.pulse-marker__ring {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  border-radius: 50%;
  border: 2px solid;
  z-index: 1;
  animation: pulse-ring 2.2s cubic-bezier(0.2, 0.7, 0.2, 1) infinite;
  opacity: 0;
}

@keyframes pulse-ring {
  0%   { transform: translate(-50%, -50%) scale(0.6); opacity: 0.9; }
  100% { transform: translate(-50%, -50%) scale(3.2); opacity: 0; }
}

/* Labels de villes (sans interaction) */
.city-label span {
  font-family: var(--display);
  text-transform: uppercase;
  letter-spacing: 0.15em;
  font-weight: 500;
  white-space: nowrap;
  text-shadow:
    0 0 8px rgba(0, 0, 0, 0.95),
    0 1px 2px rgba(0, 0, 0, 0.9);
  padding: 2px 6px;
}

/* HUD clavier — bandeau d'aide en bas */
.kbd-hud {
  position: fixed;
  bottom: 1.2rem;
  left: 50%;
  transform: translateX(-50%) translateY(8px);
  z-index: 1500;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.4s ease, transform 0.4s ease;
}
.kbd-hud.is-visible {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}
.kbd-hud__inner {
  display: flex;
  align-items: center;
  gap: 1.5rem;
  padding: 0.7rem 1.4rem;
  background: rgba(10, 10, 10, 0.92);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid var(--rule);
  border-radius: 999px;
  font-family: var(--display);
  font-size: 0.72rem;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--text-dim);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.6);
  white-space: nowrap;
}
.kbd-hud__chapter {
  color: #fff;
  font-weight: 500;
}
.kbd-hud__progress {
  color: var(--accent);
}
.kbd-hud__keys {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  color: var(--text-faint);
  border-left: 1px solid var(--rule);
  padding-left: 1.2rem;
}
.kbd-hud__keys kbd {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 22px;
  height: 22px;
  padding: 0 6px;
  background: rgba(232, 230, 225, 0.08);
  border: 1px solid var(--rule);
  border-radius: 4px;
  font-family: var(--sans);
  font-size: 11px;
  letter-spacing: 0;
  color: var(--text);
}
.kbd-hud__keys span { margin: 0 0.5rem 0 0.2rem; }

@media (max-width: 700px) {
  .kbd-hud { display: none; }
}

/* Tooltips Leaflet sombres */
.map-tooltip.leaflet-tooltip {
  background: rgba(10, 10, 10, 0.92) !important;
  color: var(--text) !important;
  border: 1px solid var(--rule) !important;
  font-family: var(--sans) !important;
  font-size: 12px !important;
  padding: 6px 10px !important;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.6) !important;
  border-radius: 2px !important;
}
.map-tooltip.leaflet-tooltip::before { display: none !important; }
