/* ════════════════════════════════════════════════════════
   IBM Plex Sans + IBM Plex Mono
   Minimaliste · blanc · noir · accent rouge
════════════════════════════════════════════════════════ */
@import url('https://fonts.googleapis.com/css2?family=IBM+Plex+Sans:ital,wght@0,300;0,400;0,500;1,300;1,400&family=IBM+Plex+Mono:wght@400;500&display=swap');

:root {
  --white:   #ffffff;
  --off:     #f8f8f6;
  --ink:     #111110;
  --mid:     #6e6e6c;
  --light:   #b8b8b4;
  --rule:    #e2e2de;
  --red:     #d0190a;
  --salmon:  #e8796a;
  --sans:    'IBM Plex Sans', 'Helvetica Neue', Arial, sans-serif;
  --mono:    'IBM Plex Mono', monospace;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }

body {
  background: var(--white);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 15px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

/* ── Intro — pleine page, texte centré ─────────────────── */
#intro {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 12vh 8vw;
  border-bottom: 1px solid var(--rule);
  text-align: center;
  position: relative;
}

.intro-index {
  font-size: 10px;
  letter-spacing: 0.28em;
  text-transform: uppercase;
  color: var(--light);
  margin-bottom: 5vh;
  font-weight: 400;
}

.intro-initiative {
  font-family: var(--mono);
  font-size: 15px;
  letter-spacing: 0.06em;
  color: var(--mid);
  margin-bottom: 1.2rem;
  font-weight: 400;
}

.intro-title {
  font-size: clamp(3.2rem, 8vw, 7rem);
  font-weight: 300;
  letter-spacing: -0.03em;
  line-height: 1.0;
  color: var(--ink);
  margin-bottom: 4vh;
  max-width: 900px;
}

.intro-title strong {
  font-weight: 700;
}

.intro-title em {
  font-style: italic;
  font-weight: 300;
  color: var(--red);
}

.intro-rule {
  width: 1px;
  height: 48px;
  background: var(--rule);
  margin: 4vh auto;
}

.intro-sub {
  font-size: 12px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--mid);
  margin-bottom: 5vh;
  font-weight: 400;
}

.intro-body {
  width: 100%;
  max-width: 520px;
  text-align: left;
  font-size: 13px;
  font-weight: 400;
  color: var(--mid);
  line-height: 1.85;
  padding-left: 1.2rem;
  border-left: 1px solid var(--rule);
  margin-bottom: 6vh;
}

.scroll-cue {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  font-size: 9px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--light);
  animation: nudge 2.5s ease-in-out infinite;
}

.scroll-cue svg { width: 14px; height: 14px; stroke: var(--light); }

@keyframes nudge {
  0%, 100% { transform: translateY(0); }
  55%       { transform: translateY(6px); }
}

/* ── Layout scrollytelling ─────────────────────────────── */
#scrolly {
  display: flex;
  max-width: 1600px;
  margin: 0 auto;
  padding-bottom: 30vh;
}

/* Colonne texte — étroite, à gauche, beaucoup d'air */
#scroll-text {
  width: 36%;
  min-width: 280px;
  padding: 0 4vw 0 6vw;
  position: relative;
  z-index: 2;
}

/* Graphique sticky — prend tout le reste */
#sticky-chart {
  width: 64%;
  position: sticky;
  top: 0;
  height: 100vh;
  padding: 5vh 5vw 5vh 3vw;
  display: flex;
  flex-direction: column;
  justify-content: center;
  border-left: 1px solid var(--rule);
}

#chart-container {
  width: 100%;
  flex: 1;
  min-height: 0;
  position: relative;
}

/* ── Steps ─────────────────────────────────────────────── */
.step {
  min-height: 100vh;
  display: flex;
  align-items: center;
  opacity: 0;
  transition: opacity 0.6s ease;
}

.step.is-active { opacity: 1; }

.step-inner {
  padding: 0;
  max-width: 340px;
}

/* Numéro flottant */
.step-num {
  display: block;
  font-size: 9px;
  letter-spacing: 0.24em;
  text-transform: uppercase;
  color: var(--light);
  margin-bottom: 2.4rem;
  font-weight: 400;
}

/* Ligne de séparation fine avant le numéro */
.step-num::before {
  content: '';
  display: block;
  width: 20px;
  height: 1px;
  background: var(--light);
  margin-bottom: 1rem;
}

.step h2 {
  font-size: clamp(1.4rem, 2.5vw, 2rem);
  font-weight: 300;
  letter-spacing: -0.02em;
  line-height: 1.15;
  margin-bottom: 1.8rem;
  color: var(--ink);
}

.step h2 strong {
  font-weight: 700;
}

.step p {
  font-size: 13px;
  font-weight: 400;
  color: var(--mid);
  line-height: 1.85;
  margin-bottom: 1rem;
}

.step p strong { font-weight: 500; color: var(--ink); }
.step p em { font-style: italic; }

.step ol {
  list-style: none;
  counter-reset: item;
  margin-top: 1.6rem;
}

.step ol li {
  counter-increment: item;
  font-size: 12px;
  color: var(--mid);
  line-height: 1.7;
  padding: 0.7rem 0;
  border-top: 1px solid var(--rule);
  display: flex;
  gap: 1rem;
  align-items: baseline;
}

.step ol li::before {
  content: counter(item, decimal-leading-zero);
  font-size: 9px;
  letter-spacing: 0.1em;
  color: var(--light);
  flex-shrink: 0;
  padding-top: 2px;
}

.step ol li:last-child { border-bottom: 1px solid var(--rule); }

.mark-red {
  color: var(--red);
  font-style: italic;
}

/* ── Méta graphique ────────────────────────────────────── */
#chart-meta {
  margin-bottom: 16px;
}

#chart-title {
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink);
  margin-bottom: 4px;
}

#chart-subtitle {
  font-size: 9px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--light);
}

/* ── Légendes ──────────────────────────────────────────── */
#chart-legend, #chart-legend-udc {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 24px;
  margin-top: 14px;
  font-size: 9px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--mid);
  opacity: 0;
  transition: opacity 0.5s ease;
  pointer-events: none;
}

#chart-legend.visible, #chart-legend-udc.visible { opacity: 1; }

.legend-item { display: flex; align-items: center; gap: 7px; }

.legend-swatch { width: 10px; height: 10px; flex-shrink: 0; }

/* ── Image UDC dans le graphique (step 0 initial) ───── */
#udc-image-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity 0.5s ease;
  pointer-events: none;
  background: var(--white);
  z-index: 10;
}

#udc-image-overlay.visible { opacity: 1; pointer-events: auto; }
#udc-image-overlay img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  display: block;
}

/* ── Outro ─────────────────────────────────────────────── */
#outro {
  min-height: 60vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 14vh 8vw;
  border-top: 1px solid var(--rule);
}

#outro p.label {
  font-size: 9px;
  letter-spacing: 0.24em;
  text-transform: uppercase;
  color: var(--light);
  margin-bottom: 3vh;
}

#outro h2 {
  font-size: clamp(2rem, 5vw, 4.5rem);
  font-weight: 300;
  letter-spacing: -0.03em;
  line-height: 1.05;
  max-width: 700px;
  margin-bottom: 3vh;
}

#outro h2 strong { font-weight: 700; }

#outro p.body {
  font-size: 13px;
  color: var(--mid);
  max-width: 480px;
  line-height: 1.85;
}

/* ── Sources ───────────────────────────────────────────── */
#sources {
  padding: 10vh 8vw 12vh;
  border-top: 1px solid var(--rule);
  max-width: 1000px;
  margin: 0 auto;
}

.sources-label {
  font-size: 9px;
  letter-spacing: 0.24em;
  text-transform: uppercase;
  color: var(--light);
  margin-bottom: 4vh;
  display: block;
}

.sources-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 0;
  border-top: 1px solid var(--rule);
}

.source-card {
  padding: 2rem 2rem 2rem 0;
  border-bottom: 1px solid var(--rule);
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.source-tag {
  font-size: 8.5px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--light);
}

.source-desc {
  font-size: 13px;
  color: var(--mid);
  line-height: 1.6;
  flex: 1;
  font-weight: 400;
}

.source-link {
  font-size: 10px;
  color: var(--ink);
  text-decoration: none;
  letter-spacing: 0.06em;
  border-bottom: 1px solid var(--rule);
  padding-bottom: 1px;
  align-self: flex-start;
  transition: border-color 0.2s, color 0.2s;
}
.source-link:hover { color: var(--red); border-color: var(--red); }

.sources-note {
  font-size: 10px;
  color: var(--light);
  margin-top: 4vh;
  line-height: 1.7;
}

/* ── Footer ─────────────────────────────────────────────── */
footer {
  padding: 2.5rem 8vw;
  border-top: 1px solid var(--rule);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

footer p {
  font-size: 9px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--light);
}

/* ── Responsive ─────────────────────────────────────────── */
@media (max-width: 860px) {
  #scrolly { flex-direction: column; }
  #scroll-text { width: 100%; padding: 0 6vw; }
  #sticky-chart {
    width: 100%; position: sticky; top: 0;
    height: 52vh; padding: 3vh 6vw;
    border-left: none; border-bottom: 1px solid var(--rule);
  }
  .step { min-height: 70vh; }
  .intro-title { font-size: clamp(2.4rem, 11vw, 4rem); }
}