/* =====================================================================
   COM1 — LE SITE VIVANT
   Mêmes couleurs et jetons que commun.css. Le mouvement montre un chemin : on avance pas à pas,
   à son rythme. Sans JavaScript, tout reste lisible ; avec « réduire les animations », rien ne bouge.
   ===================================================================== */

/* 1. UN SEUL ALIGNEMENT : les titres de section et leur texte sont centrés, partout pareil. */
.en-tete, .en-tete.centre { text-align: center; margin-inline: auto; max-width: 50rem; }
.en-tete .chapo { margin-inline: auto; max-width: 62ch; text-wrap: pretty; }
.en-tete .chapo + .chapo { margin-top: .75rem; }
.en-tete h2 { text-wrap: balance; }
.en-tete .chapo--fort { color: var(--fg); }
/* Dans une section en deux colonnes, le titre suit sa colonne */
.ecosysteme .en-tete { text-align: left; margin-inline: 0; }
@media (max-width: 899px) { .ecosysteme .en-tete { text-align: center; margin-inline: auto; } }

/* 3. L'EXPLORATION DE LA PAGE : où j'en suis dans la visite */
.visite { position: fixed; left: 50%; bottom: max(12px, env(safe-area-inset-bottom)); translate: -50% 0; z-index: 40; display: flex; align-items: center; gap: .7rem; padding: .45rem .55rem .45rem 1rem; border-radius: 999px; background: color-mix(in srgb, var(--surface) 90%, transparent); border: 1px solid var(--line); box-shadow: var(--ombre); backdrop-filter: blur(12px); transition: opacity .3s, translate .3s; max-width: calc(100vw - 24px); }
.visite.est-cachee { opacity: 0; pointer-events: none; translate: -50% 14px; }
.visite-texte { font: 700 .78rem var(--f-texte); white-space: nowrap; }
.visite ol { display: flex; gap: .3rem; margin: 0; padding: 0; list-style: none; }
.visite ol a { display: block; width: 1.5rem; height: 1.5rem; border-radius: 50%; position: relative; }
.visite ol a::after { content: ""; position: absolute; inset: .45rem; border-radius: 50%; background: var(--line); transition: inset .25s, background .25s; }
.visite ol a.est-vu::after { background: color-mix(in srgb, var(--c) 55%, var(--line)); }
.visite ol a[aria-current="true"]::after { inset: .28rem; background: var(--c); }
.visite-suite { display: grid; place-items: center; width: 2.2rem; height: 2.2rem; border-radius: 50%; background: var(--fg); color: var(--bg); text-decoration: none; font-weight: 800; flex: none; }
.visite-suite:hover { text-decoration: none; }
@media (max-width: 560px) { .visite-texte { display: none; } .visite { padding-left: .55rem; } }
@media print { .visite { display: none; } }

/* 4. CARTES QUI RÉAGISSENT */
.vivante { transition: transform .3s var(--ease), border-color .25s, box-shadow .3s; }
@media (hover: hover) { .vivante:hover { transform: translateY(-6px); border-color: var(--ct); box-shadow: var(--ombre); } }

/* 7. LE CHEMIN DU PROJET (feuille de route et chantier) */
.route.est-chemin li { transition: transform .3s var(--ease), border-color .25s; }
.route.est-chemin li.ici { box-shadow: 0 0 0 4px color-mix(in srgb, var(--c) 20%, transparent); }
.chantier-onglets { display: flex; flex-wrap: wrap; justify-content: center; gap: .5rem; margin-bottom: 1.2rem; }
.chantier-onglets button { min-height: 48px; display: inline-flex; align-items: center; gap: .55rem; padding: .5rem 1.15rem; border-radius: 999px; border: 0; background: transparent; box-shadow: inset 0 0 0 1.5px var(--line); color: var(--fg); font: 700 .95rem var(--f-titres); cursor: pointer; }
.chantier-onglets button i { width: .8rem; height: .8rem; border-radius: 50%; background: var(--vert-vif); }
.chantier-onglets button:nth-child(2) i { background: var(--cyan-vif); }
.chantier-onglets button:nth-child(3) i { background: transparent; box-shadow: inset 0 0 0 2px var(--muted); }
.chantier-onglets button[aria-selected="true"] { background: var(--fg); color: var(--bg); box-shadow: none; }
.etat.est-onglets { display: block; max-width: 44rem; margin-inline: auto; }

@media (prefers-reduced-motion: no-preference) {
  html.avec-revele .revele > * { transition: opacity .55s var(--ease), translate .55s var(--ease); }
  html.avec-revele .revele:not(.vu) > * { opacity: 0; translate: 0 18px; }
  html.avec-revele .revele > *:nth-child(2) { transition-delay: .08s; } html.avec-revele .revele > *:nth-child(3) { transition-delay: .16s; }
  html.avec-revele .revele > *:nth-child(4) { transition-delay: .24s; } html.avec-revele .revele > *:nth-child(n+5) { transition-delay: .3s; }
  .etat.est-onglets > .carte:not([hidden]) { animation: vivant-entre .4s var(--ease) both; }
  @keyframes vivant-entre { from { opacity: 0; translate: 0 12px; } }
}

.conteneur > .cycle-titre { text-align: center; width: 100%; }

/* 8. SUR ORDINATEUR : une seule colonne de lecture, des blocs alignés entre eux (D-213) */
.hero h1 { max-width: 17ch; font-size: clamp(2.2rem, 1.5rem + 2.4vw, 3.5rem); text-wrap: balance; }
.en-tete h2 { margin-inline: auto; max-width: 22ch; }
.en-tete .chapo { max-width: 60ch; text-wrap: balance; }
/* Les encadrés sous un titre partagent la même largeur, centrée. */
.cycle-plus, .cooperative, .aujourdhui, .preuve, .avertissement, .atouts, .conteneur > .cycle { width: 100%; max-width: 62rem; margin-inline: auto; }
.cycle-plus { margin-top: 1.5rem; }
/* Les raisons d'épargner : six cartes égales */
.atouts { list-style: none; padding: 0; margin-block: 0; display: grid; gap: 1rem; grid-template-columns: repeat(auto-fit, minmax(min(100%, 17rem), 1fr)); }
.atouts li { padding: 1.35rem; border-radius: var(--r-lg); background: var(--surface); border: 1px solid var(--line); border-top: 4px solid var(--c); text-align: center; }
.atouts h3 { margin: 0 0 .5rem; font-size: 1.08rem; text-wrap: balance; }
.atouts p { margin: 0; max-width: none; font-size: .95rem; color: var(--muted); line-height: 1.5; text-wrap: pretty; }
.avertissement { margin-top: 1.25rem; margin-bottom: 0; padding: 1rem 1.25rem; border-radius: var(--r-md); border: 2px solid var(--fg); text-align: center; text-wrap: balance; }
.avertissement + .preuve { margin-top: 1rem; }
/* Titre au-dessus des deux colonnes (écosystème, laboratoire) */
.deux-colonnes-tete { margin-bottom: clamp(1.5rem, 3.5vw, 2.25rem); }
@media (min-width: 900px) {
  .hero h1 { max-width: 19ch; font-size: clamp(2.2rem, 1.4rem + 1.9vw, 3.15rem); }
  /* Le laboratoire : cinq repères sur la largeur, puis la phrase et le lien au centre */
  #laboratoire .grille-2 { display: flex; flex-direction: column; align-items: center; gap: 1.75rem; }
  #laboratoire .labo { order: -1; width: 100%; grid-template-columns: repeat(5, minmax(0, 1fr)); text-align: center; align-items: stretch; }
  #laboratoire .labo li { align-content: start; padding: 1.1rem .8rem; }
  #laboratoire .grille-2 > div { text-align: center; }
}
