/* « Comment m'aborder » — version web
   Couleurs : bleu = le centre, jaune = moi, brun = l'écart / l'effort */

:root {
  --encre: #1F2A24;
  --gris: #6E6E6E;
  --dore: #E3C25B;
  --bleu: #DCEAF2;
  --bleu-clair: #EEF5F9;
  --bleu-fonce: #7FA7BF;
  --jaune: #F5B81C;
  --jaune-88: #FEF7E4;
  --jaune-80: #FDEFD1;
  --jaune-70: #FCEABB;
  --brun: #6B3F1D;
  --brun-clair: #EDE8E4;
  --vert: #6FA77D;
  --vert-clair: #EAF4EC;
  --fond: #FFFDF8;
  /* Identité : tournesol jaune sur vert profond (évoque le code du handicap
     invisible, sans reprendre les couleurs ni le logo officiels) */
  --vert-id: #2D6A4F;
  --vert-id-fonce: #1B4332;
  --creme: #FFFDF8;
  --rail: #B9B9B9;
  --largeur: 44rem;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--fond);
  color: var(--encre);
  font-family: "Avenir Next", "Avenir", "Helvetica Neue", "Segoe UI", system-ui, sans-serif;
  font-size: 1.125rem;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

strong { font-weight: 600; }
a { color: var(--vert-id); }

svg { display: block; width: 100%; height: auto; overflow: visible; }
svg text { font-family: inherit; }

/* ── Barre de progression ─────────────────────────────────── */
#progression {
  position: fixed; inset: 0 0 auto 0; height: 3px; z-index: 50;
  background: var(--jaune); transform-origin: 0 50%; transform: scaleX(0);
}

/* ── Fond en parallaxe ────────────────────────────────────── */
#parallaxe {
  position: fixed; inset: 0; z-index: -1; pointer-events: none; overflow: hidden;
}
#parallaxe .petale {
  position: absolute; border-radius: 50%; will-change: transform;
}

/* ── Accueil ──────────────────────────────────────────────── */
.accueil {
  min-height: 100vh; min-height: 100svh;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  text-align: center; padding: 2rem 1.25rem; position: relative;
  background: radial-gradient(ellipse at 50% 38%, var(--vert-id) 0%, var(--vert-id-fonce) 100%);
  color: var(--creme); overflow: hidden;
}
.accueil .surtitre {
  font-size: .8rem; font-weight: 600; letter-spacing: .16em; text-transform: uppercase;
  color: var(--jaune); margin: 0 0 .8rem;
}
.accueil .fleur { width: min(42vw, 200px); margin-bottom: 1.5rem; will-change: transform; }
.accueil h1 {
  font-size: clamp(2.4rem, 7vw, 4rem); font-weight: 500; margin: 0; line-height: 1.1;
  will-change: transform;
}
.accueil .trait { width: 4rem; height: 2px; background: var(--jaune); margin: 1.2rem auto; border: 0; }
.accueil .sous-titre { color: rgba(255, 253, 248, .82); font-size: 1.15rem; margin: 0; max-width: 30rem; }
.indice-defilement {
  position: absolute; bottom: 2rem; left: 50%; transform: translateX(-50%);
  color: rgba(255, 253, 248, .7); font-size: .9rem; display: flex; flex-direction: column; align-items: center; gap: .3rem;
}
.indice-defilement span:last-child { animation: rebond 2s ease-in-out infinite; font-size: 1.3rem; }
@keyframes rebond { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(6px); } }

/* ── Texte courant ────────────────────────────────────────── */
main { padding: 4.5rem 1.25rem 6rem; }
.prose { max-width: var(--largeur); margin: 0 auto; }
.prose p { margin: 0 0 1.1em; }

h2 {
  font-size: clamp(1.6rem, 4vw, 2.1rem); font-weight: 600; line-height: 1.2; color: var(--vert-id-fonce);
  max-width: var(--largeur); margin: 6rem auto 1.5rem;
  display: flex; align-items: center; gap: .7rem;
}
h2::before {
  content: ""; flex: none; width: .3rem; height: 1.1em; border-radius: .2rem; background: var(--vert-id);
}
h3 {
  font-size: 1.3rem; font-weight: 600; color: var(--brun); line-height: 1.3;
  max-width: var(--largeur); margin: 3.5rem auto 1rem;
}

.encadre {
  background: var(--jaune-88); border-left: 4px solid var(--jaune);
  border-radius: 10px; padding: 1.1rem 1.4rem; margin: 1.6rem 0;
}
.encadre.bleu { background: var(--bleu-clair); border-color: var(--bleu-fonce); }
.encadre.brun { background: var(--brun-clair); border-color: var(--brun); }
.encadre.vert { background: var(--vert-clair); border-color: var(--vert); }
.encadre.vert-id { background: #EAF1ED; border-color: var(--vert-id); }
.encadre.vert-id .titre, .encadre.vert-id .chute { color: var(--vert-id-fonce); }
.encadre .chute { display: inline-block; margin-top: .4rem; }
.encadre .titre { font-weight: 600; display: block; margin-bottom: .3rem; }
.encadre .note { color: var(--gris); }
.encadre ul { margin: .4rem 0 0; padding-left: 1.2rem; }
.encadre li { margin: .3rem 0; }
.encadre li::marker { color: var(--dore); }

.duo { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; margin: 1.6rem 0; }
.duo .encadre { margin: 0; }

.pastille-bleue {
  display: inline-block; width: .8em; height: .8em; border-radius: .18em;
  background: var(--bleu); border: 1px solid var(--bleu-fonce); vertical-align: -0.08em;
}

ul.liste { padding-left: 1.3rem; }
ul.liste li { margin: .45rem 0; }
ul.liste li::marker { color: var(--dore); }

.discret { color: var(--gris); }

/* ── Figures ──────────────────────────────────────────────── */
figure { margin: 2.5rem auto; max-width: 62rem; }
figure.etroit { max-width: var(--largeur); }
figcaption, .legende {
  text-align: center; color: var(--gris); font-style: italic; font-size: .92rem; margin-top: .9rem;
}
.legende-points {
  display: flex; flex-wrap: wrap; gap: .4rem 1.4rem; justify-content: center;
  font-size: .9rem; color: var(--gris); margin-top: .8rem;
}
.legende-points b { color: var(--brun); }

/* Scènes fixées pendant le défilement */
.scrolly { position: relative; height: var(--len, 250vh); }
.scrolly > .scene-fixe {
  position: sticky; top: 0; height: 100vh; height: 100svh;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  padding: 2.5rem 1rem 1.5rem;
}
.scrolly .fig { width: 100%; max-width: 62rem; margin: 0 auto; }
.scrolly .fig svg { max-height: 68vh; max-height: 68svh; }
.etape {
  max-width: 40rem; text-align: center; min-height: 3.4em; margin-top: 1rem;
  font-size: 1.02rem; transition: opacity .35s;
}
.etape b { color: var(--brun); }

/* Compteurs */
.compteurs { display: flex; gap: 1rem; justify-content: center; flex-wrap: wrap; margin-top: 1rem; }
.compteur {
  background: var(--jaune-88); border-radius: 10px; padding: .5rem 1rem; text-align: center; min-width: 9rem;
}
.compteur .valeur { display: block; font-size: 1.6rem; font-weight: 700; color: var(--brun); line-height: 1.2; }
.compteur .libelle { font-size: .85rem; color: var(--gris); }
.compteur.bleu { background: var(--bleu-clair); }
.compteur.bleu .valeur { color: var(--bleu-fonce); }

/* ── Tableau de l'écart et comparaisons ───────────────────── */
.tableau { display: grid; grid-template-columns: 1fr 2.4rem 1fr; gap: .5rem 0; margin: 1.6rem auto; max-width: var(--largeur); }
.tableau.deux { grid-template-columns: 1fr 1fr; gap: .5rem .8rem; }
.tableau > div { padding: .65rem .9rem; border-radius: 6px; font-size: 1rem; display: flex; align-items: center; }
.tableau .t-bleu { background: var(--bleu); font-weight: 600; flex-direction: column; align-items: flex-start; }
.tableau .t-jaune { background: var(--jaune); font-weight: 600; flex-direction: column; align-items: flex-start; }
.tableau .t-bleu small, .tableau .t-jaune small { font-weight: 400; font-size: .9rem; }
.tableau .t-bleu small { color: var(--gris); }
.tableau .c-bleu { background: var(--bleu-clair); }
.tableau .c-jaune { background: var(--jaune-80); }
.tableau .c-brun { background: var(--brun-clair); font-weight: 600; }
.tableau .c-vert { background: var(--vert-clair); font-weight: 600; }
.tableau .fleche { justify-content: center; color: var(--brun); font-size: 1.3rem; padding: 0; }

.phrases { display: grid; grid-template-columns: 1fr 1fr; gap: .6rem; margin: 1.2rem 0; }
.phrases div { background: var(--brun-clair); border-radius: 8px; padding: .6rem .9rem; }

/* Réactions en chaîne */
.chaine { display: flex; flex-wrap: wrap; align-items: center; gap: .45rem; margin: .8rem 0; font-size: 1rem; }
.chaine span.etape-chaine { background: var(--jaune-80); border-radius: 6px; padding: .25rem .6rem; }
.chaine span.sep { color: var(--brun); }

/* ── Arbre ────────────────────────────────────────────────── */
.arbre {
  border: 1px solid #E4E4E4; border-radius: 12px; padding: 1.4rem; background: #fff;
  max-width: 62rem; margin: 1.5rem auto;
}
.pill { display: inline-block; border-radius: 6px; padding: .2rem .6rem; font-size: .95rem; line-height: 1.4; }
.pill.l0 { background: var(--encre); color: #fff; font-weight: 600; }
.pill.l1 { background: var(--jaune); font-weight: 600; }
.pill.l2 { background: var(--jaune-80); }
.pill.l3 { background: #fff; border: 1px solid #C9C9C9; color: #555; font-size: .9rem; }
.arbre-cols {
  display: grid; grid-template-columns: 1fr 1fr; gap: 0 1.5rem; margin-left: .9rem; position: relative;
}
.arbre-cols::before {
  content: ""; position: absolute; top: 0; left: 0; width: calc(50% + .75rem);
  border-top: 1.5px solid var(--rail);
}
.arbre ul { list-style: none; margin: 0; padding: 0 0 0 1.4rem; }
.arbre-cols > ul { padding-left: 0; }
.arbre li { position: relative; padding: .45rem 0 0 1.25rem; }
.arbre li::before {
  content: ""; position: absolute; left: 0; top: 0; bottom: 0; border-left: 1.5px solid var(--rail);
}
.arbre li:last-child::before { bottom: auto; height: calc(.45rem + .8em); }
.arbre li::after {
  content: ""; position: absolute; left: 0; top: calc(.45rem + .8em); width: 1rem;
  border-top: 1.5px solid var(--rail);
}
.arbre li { opacity: 0; transform: translateX(-10px); transition: opacity .5s, transform .5s; transition-delay: var(--d, 0ms); }
.arbre.in li { opacity: 1; transform: none; }

/* ── Conclusion mise en exergue ───────────────────────────── */
.exergue {
  display: grid; grid-template-columns: minmax(0, 22rem) 1fr; gap: 2rem; align-items: center;
  background: var(--jaune-88); border-left: 6px solid var(--jaune); border-radius: 14px;
  padding: 1.8rem 2rem; margin: 3rem auto; max-width: 56rem;
}
.exergue .avant { color: var(--gris); font-size: 1rem; margin: 0 0 .6rem; }
.exergue .phrase-cle { font-size: clamp(1.4rem, 3vw, 1.9rem); font-weight: 600; line-height: 1.3; margin: 0; }
.exergue .phrase-cle em { font-style: normal; color: var(--brun); }

/* Cent conversations */
.cent {
  display: grid; grid-template-columns: 1fr 1fr; grid-template-rows: repeat(5, auto);
  column-gap: 2rem; width: 100%; max-width: 44rem;
}
/* Les deux panneaux partagent les mêmes lignes : titres, grilles et totaux alignés */
.cent .panneau {
  text-align: center; display: grid; grid-row: span 5; grid-template-rows: subgrid; row-gap: 0;
}
.cent .panneau h4 { align-self: end; }
.cent .panneau .detail { align-self: start; }
.cent .panneau h4 { margin: 0; font-size: 1.15rem; font-weight: 600; }
.cent .panneau .sous { color: var(--gris); font-size: .9rem; margin-bottom: .6rem; }
.cent .panneau svg { max-width: 15rem; margin: 0 auto; }
.cent .panneau .total { font-size: 1.5rem; font-weight: 700; margin-top: .5rem; }
.cent .panneau .total.jaune { color: var(--brun); }
.cent .panneau .total.bleu { color: var(--bleu-fonce); }
.cent .panneau .detail { font-size: .9rem; color: var(--gris); }

/* Graphe + texte côte à côte */
.cote-a-cote { display: grid; grid-template-columns: 1fr 1fr; gap: 2rem; align-items: center; }

/* ── Révélations au défilement ────────────────────────────── */
.reveal { opacity: 0; transform: translateY(26px); transition: opacity .8s ease, transform .8s ease; }
.reveal.in { opacity: 1; transform: none; }
.tableau > .reveal { transition-delay: var(--d, 0ms); }

/* ── Pied de page ─────────────────────────────────────────── */
.signature { font-family: Charter, Georgia, serif; font-style: italic; color: var(--gris); margin-top: 2rem; }
.liens { max-width: var(--largeur); margin: 3rem auto 0; font-size: .95rem; color: var(--gris); }

.annexe { border-top: 1px solid #E6E1D6; margin-top: 7rem; padding-top: 1rem; }

/* ── Petits écrans ────────────────────────────────────────── */
@media (max-width: 720px) {
  body { font-size: 1.05rem; }
  .duo, .phrases, .cote-a-cote, .exergue { grid-template-columns: 1fr; }
  .arbre-cols { grid-template-columns: 1fr; }
  .arbre-cols::before { display: none; }
  .arbre-cols > ul:last-child > li:first-child { padding-top: .45rem; }
  .tableau { grid-template-columns: 1fr 1.6rem 1fr; }
  .tableau > div { font-size: .92rem; padding: .55rem .65rem; }
  .cent { column-gap: 1rem; }
  .cent .panneau h4 { font-size: 1.02rem; line-height: 1.3; }
  .exergue { padding: 1.4rem; }
}

/* ── Mouvement réduit : tout est affiché, rien ne bouge ───── */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .scrolly { height: auto; }
  .scrolly > .scene-fixe { position: static; height: auto; padding: 1rem 0; }
  .reveal, .arbre li { opacity: 1; transform: none; transition: none; }
  .indice-defilement span:last-child { animation: none; }
  #parallaxe { display: none; }
}

/* Deux schémas côte à côte (empilés sur mobile) */
.deux-svg { display: grid; grid-template-columns: 1.1fr 1fr; gap: 2rem; align-items: center; width: 100%; }
.scrolly .deux-svg svg { max-height: 62vh; max-height: 62svh; }
.liste-compteurs { display: flex; flex-direction: column; gap: .55rem; }
.titre-compteurs { font-weight: 600; margin-bottom: .2rem; }
.ligne-compteur {
  display: flex; justify-content: space-between; align-items: center;
  background: var(--jaune-88); border-radius: 9px; padding: .5rem .9rem; transition: opacity .2s;
}
.ligne-compteur span { color: var(--gris); }
.ligne-compteur b { font-size: 1.5rem; color: var(--brun); }
.note-compteurs { color: var(--gris); font-size: .92rem; margin-top: .3rem; }
@media (max-width: 720px) {
  .deux-svg { grid-template-columns: 1fr; gap: 1rem; }
  .scrolly .deux-svg svg { max-height: 36vh; max-height: 36svh; }
  .scrolly > .scene-fixe { padding: 1.2rem .75rem 1rem; }
}

/* Pied de page aux couleurs de l'identité */
.pied {
  background: var(--vert-id-fonce); color: rgba(255, 253, 248, .8);
  text-align: center; padding: 2.5rem 1.25rem; font-size: .95rem;
}
.pied a { color: var(--jaune); }
.pied .fleur-pied { width: 2.6rem; margin: 0 auto .8rem; }
