/* De la cabosse au carré — feuille de style.
   Palette tirée du cacao lui-même : vert sombre du sous-bois, vert-jaune des feuilles,
   brun des fèves, orange et jaune des cabosses, sable de la terre, gris clair de l'atelier. */
:root {
  --nuit: #14100c;
  --nuit-2: #1f1812;
  --creme: #f4ecdc;
  --creme-2: #cfc4ae;
  --foret: #16261c;
  --foret-2: #20382a;
  --chartreuse: #c5c94a;
  --olive: #5d6320;
  --bois: #6e4125;
  --bois-2: #3a2114;
  --cabosse: #e58b2c;
  --jaune: #ecd43f;
  --sable: #efe4cb;
  --atelier: #e7eaec;
  --encre: #22262a;
  --titre: "Fraunces", "Iowan Old Style", "Palatino Linotype", Georgia, serif;
  --texte: "Source Sans 3", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --marge: clamp(20px, 5vw, 72px);
  --rayon: 14px;
  /* couleurs du thème courant, redéfinies par section */
  --fond: var(--nuit); --sur: var(--creme); --doux: var(--creme-2); --accent: var(--cabosse); --carte: var(--nuit-2);
}
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 64px; -webkit-text-size-adjust: 100%; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } * { transition: none !important; animation: none !important; } }
body { margin: 0; background: var(--nuit); color: var(--creme); font: 400 1.125rem/1.6 var(--texte); }
img, video, svg { display: block; max-width: 100%; }
[hidden] { display: none !important; }
h1, h2, h3 { font-family: var(--titre); font-weight: 400; line-height: 1.08; margin: 0; text-wrap: balance; }
p { margin: 0 0 1em; text-wrap: pretty; }
a { color: inherit; }
button { font: inherit; color: inherit; cursor: pointer; }
:focus-visible { outline: 3px solid var(--jaune); outline-offset: 3px; border-radius: 4px; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.skip { position: absolute; left: -999px; top: 8px; background: var(--jaune); color: var(--nuit); padding: 10px 16px; z-index: 100; border-radius: 6px; }
.skip:focus { left: 8px; }

/* ── Barre de visite ── */
.barre { position: fixed; inset: 0 0 auto 0; z-index: 50; display: flex; align-items: center; gap: 12px; height: 56px; padding: 0 var(--marge);
  background: rgba(20,16,12,.9); backdrop-filter: blur(10px); color: var(--creme); transform: translateY(-100%); transition: transform .3s; }
.barre.visible, .barre:focus-within { transform: none; }
.barre-titre { font-family: var(--titre); font-size: 1.05rem; text-decoration: none; white-space: nowrap; }
.barre-chapitre { flex: 1; min-width: 0; font-size: .9rem; color: var(--creme-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.barre-actions { display: flex; gap: 8px; }
.barre button, .sommaire-tete button { background: none; border: 1px solid rgba(244,236,220,.35); border-radius: 999px; padding: 6px 14px; font-size: .9rem; min-height: 40px; }
.barre button:hover { border-color: var(--creme); }
#btn-son[aria-pressed="true"] { background: var(--creme); color: var(--nuit); }
.progression { position: absolute; left: 0; right: 0; bottom: 0; height: 3px; background: rgba(244,236,220,.12); }
.progression span { display: block; height: 100%; background: var(--cabosse); transform-origin: 0 50%; transform: scaleX(0); }
@media (max-width: 640px) { .barre-titre { display: none; } .barre { gap: 8px; } .barre button { padding: 6px 12px; } }

/* ── Sommaire et fenêtre de détail ── */
dialog { border: 0; padding: 0; color: var(--creme); background: var(--nuit-2); }
dialog::backdrop { background: rgba(10,8,6,.75); }
.sommaire { width: min(440px, 100vw); max-width: 100vw; height: 100dvh; max-height: 100dvh; margin: 0 0 0 auto; padding: 24px; }
.sommaire-tete { display: flex; justify-content: space-between; align-items: center; margin-bottom: 20px; }
.sommaire-tete h2 { font-size: 1.6rem; }
.sommaire ol { list-style: none; margin: 0; padding: 0; }
.sommaire li a { display: flex; gap: 14px; padding: 14px 8px; text-decoration: none; border-bottom: 1px solid rgba(244,236,220,.12); font-size: 1.1rem; }
.sommaire li a:hover, .sommaire li a.actif { background: rgba(244,236,220,.07); }
.sommaire li a.actif { box-shadow: inset 3px 0 var(--cabosse); }
.som-num { width: 1.4em; color: var(--cabosse); font-family: var(--titre); }
.detail { width: min(980px, calc(100vw - 24px)); max-height: calc(100dvh - 24px); border-radius: var(--rayon); }
.detail-corps { display: grid; gap: 24px; padding: 20px; }
.detail-corps img { width: 100%; border-radius: 8px; }
.detail-corps h2 { font-size: 1.7rem; margin-bottom: .6em; }
@media (min-width: 820px) { .detail-corps { grid-template-columns: 1.15fr 1fr; align-items: start; padding: 28px; } }

/* ── Boutons ── */
.bouton { display: inline-block; background: var(--cabosse); color: var(--nuit); border: 0; border-radius: 999px; padding: 14px 28px; font-weight: 600; text-decoration: none; min-height: 48px; }
.bouton:hover { background: var(--jaune); }
.bouton-discret { background: rgba(20,16,12,.55); color: var(--creme); border: 1px solid rgba(244,236,220,.6); }
.bouton-discret:hover { background: var(--creme); color: var(--nuit); }
.lien-detail { background: none; border: 0; border-bottom: 2px solid var(--accent); padding: 4px 0; font-weight: 600; min-height: 44px; }
.lien-detail::after { content: " →"; }

/* ── Accueil ── */
.accueil { position: relative; min-height: 100svh; display: grid; align-items: end; overflow: hidden; }
.accueil > img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: var(--pos, 50% 50%); }
.accueil::after { content: ""; position: absolute; inset: 0; background: linear-gradient(to top, rgba(20,16,12,.92) 0%, rgba(20,16,12,.55) 38%, rgba(20,16,12,.05) 70%); }
.accueil-texte { position: relative; z-index: 1; padding: 0 var(--marge) clamp(56px, 10vh, 110px); max-width: 900px; }
.surtitre, .numero { font-size: .85rem; letter-spacing: .18em; text-transform: uppercase; margin-bottom: .8em; color: var(--accent); font-weight: 600; }
.accueil .surtitre { color: var(--jaune); }
h1 { font-size: clamp(3rem, 11vw, 7rem); letter-spacing: -.02em; }
.question { font-family: var(--titre); font-style: italic; font-size: clamp(1.25rem, 3.2vw, 1.9rem); margin: .6em 0 1.2em; max-width: 22em; }
.accueil-actions { display: flex; flex-wrap: wrap; gap: 12px; }
.credit-plan { position: absolute; z-index: 1; right: var(--marge); bottom: 14px; margin: 0; font-size: .78rem; color: var(--creme-2); }

/* ── Blocs de texte ── */
.texte { max-width: 44rem; margin: 0 auto; padding: clamp(48px, 9vw, 110px) var(--marge); }
.texte-etroit { padding: 0; margin: 0; }
.texte h3, .pause h3 { font-size: clamp(1.5rem, 3.5vw, 2rem); margin-bottom: .6em; }
.grand { font-family: var(--titre); font-size: clamp(1.45rem, 3.6vw, 2.15rem); line-height: 1.25; margin-bottom: .8em; }
.centre { text-align: center; }
.note { font-size: .92rem; color: var(--doux); }
.intro .surtitre { color: var(--cabosse); }
.legende-provenance { list-style: none; padding: 20px 22px; margin: 2em 0 1.2em; background: var(--nuit-2); border-radius: var(--rayon); font-size: 1rem; }
.legende-provenance li + li { margin-top: .6em; }
.pastille { display: inline-block; width: .7em; height: .7em; border-radius: 50%; margin-right: .35em; vertical-align: baseline; }
.pastille-visite { background: var(--cabosse); }
.pastille-ci { background: #2f9e62; }
.pastille-schema { background: transparent; border: 2px solid currentColor; }

/* ── Chapitres et thèmes ── */
.chapitre { background: var(--fond); color: var(--sur); padding-bottom: clamp(48px, 8vw, 96px); }
.theme-foret { --fond: var(--foret); --carte: var(--foret-2); --accent: var(--chartreuse); --doux: #b9c4b3; }
.theme-bois { --fond: var(--bois-2); --carte: #4a2b1a; --accent: var(--cabosse); --doux: #d8c3ad; }
.theme-chartreuse { --fond: #262a10; --carte: #353a16; --accent: var(--chartreuse); --doux: #c9cba6; }
.theme-nuit { --fond: var(--nuit); --carte: var(--nuit-2); --accent: var(--cabosse); }
.theme-atelier { --fond: var(--atelier); --sur: var(--encre); --carte: #fff; --accent: #8a4b22; --doux: #5a6268; }
.theme-ci { --fond: var(--sable); --sur: #2b2015; --carte: #fbf5e6; --accent: #1f7a4a; --doux: #6a5a45; }
.tete-chapitre { padding: clamp(72px, 12vw, 150px) var(--marge) clamp(28px, 5vw, 56px); max-width: 60rem; }
.tete-chapitre h2, .plan-titre h2 { font-size: clamp(2.5rem, 8vw, 5.2rem); letter-spacing: -.02em; }
.tete-chapitre > p:last-child, .plan-titre > p:last-child { font-family: var(--titre); font-style: italic; font-size: clamp(1.15rem, 2.6vw, 1.6rem); margin: .5em 0 0; max-width: 26em; }
.bandeau-ci { display: inline-block; background: #1f7a4a; color: #fff; padding: 6px 14px; border-radius: 999px; font-size: .85rem; font-weight: 600; margin-bottom: 1.6em; }
.bandeau-ci .pastille-ci { background: #fff; }

/* ── Plans larges (image ou vidéo plein cadre) ── */
figure { margin: 0; }
.plan { position: relative; height: 100svh; min-height: 520px; overflow: hidden; background: #000; }
.plan-court { height: min(78svh, 760px); min-height: 380px; margin-top: clamp(40px, 7vw, 90px); }
.plan > img, .plan > video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: var(--pos, 50% 50%); }
.plan::after { content: ""; position: absolute; inset: 0; pointer-events: none; background: linear-gradient(to top, rgba(10,8,6,.88) 0%, rgba(10,8,6,.35) 40%, rgba(10,8,6,0) 65%); }
.plan-titre { position: absolute; z-index: 2; left: var(--marge); right: var(--marge); bottom: 72px; color: var(--creme); }
.plan-titre .numero { color: var(--jaune); }
.plan figcaption { position: absolute; z-index: 2; left: var(--marge); right: var(--marge); bottom: 18px; font-size: .82rem; color: var(--creme-2); }
.video-commandes { position: absolute; z-index: 3; top: 72px; right: var(--marge); }
.video-commandes button { background: rgba(20,16,12,.65); color: var(--creme); border: 1px solid rgba(244,236,220,.5); border-radius: 999px; padding: 8px 18px; min-height: 44px; font-size: .9rem; }
.repere { position: absolute; z-index: 2; left: var(--marge); right: var(--marge); bottom: 64px; margin: 0; font-family: var(--titre); font-size: clamp(1.2rem, 3.4vw, 2rem); line-height: 1.2; color: var(--creme); max-width: 22em; min-height: 2.4em; text-shadow: 0 1px 12px rgba(0,0,0,.6); }

/* ── Duos image + texte ── */
.duo { display: grid; gap: clamp(24px, 4vw, 64px); padding: clamp(24px, 5vw, 64px) var(--marge); align-items: center; max-width: 1280px; margin: 0 auto; }
@media (min-width: 860px) { .duo { grid-template-columns: 1fr 1fr; } .duo-inverse > :first-child { order: 2; } }
.cadre img { width: 100%; aspect-ratio: 4 / 5; object-fit: cover; object-position: var(--pos, 50% 50%); border-radius: var(--rayon); }
.cadre-haut img { aspect-ratio: 3 / 4; }
figcaption, .legende { font-size: .85rem; color: var(--doux); margin: 10px 0 0; }
.pause { background: var(--carte); border-left: 4px solid var(--accent); border-radius: 0 var(--rayon) var(--rayon) 0; padding: clamp(22px, 4vw, 40px); }
.pause-titre { font-size: .8rem; letter-spacing: .16em; text-transform: uppercase; color: var(--accent); font-weight: 600; margin-bottom: .8em; }
.pause > :last-child { margin-bottom: 0; }
.chiffres { list-style: none; padding: 0; margin: 0 0 1.2em; }
.chiffres li { padding: 10px 0; border-top: 1px solid color-mix(in srgb, currentColor 18%, transparent); }
.chiffres strong { display: block; font-family: var(--titre); font-weight: 400; font-size: 1.7rem; color: var(--accent); }
.galerie { display: grid; gap: 20px; padding: 0 var(--marge); max-width: 1280px; margin: 0 auto; }
@media (min-width: 760px) { .galerie { grid-template-columns: repeat(3, 1fr); } }

/* ── Interactions : cadre commun ── */
.interaction { margin: clamp(16px, 4vw, 48px) auto; padding: clamp(16px, 3vw, 32px); max-width: min(1180px, calc(100% - 2 * var(--marge) + 24px)); background: var(--carte); border-radius: calc(var(--rayon) + 4px); }
.interaction-nue { margin: 0; max-width: none; }
.consigne { font-size: .95rem; font-weight: 600; color: var(--accent); margin-bottom: 14px; }
.consigne::before { content: "☞ "; }
.transfo-etape { font-size: .8rem; letter-spacing: .14em; text-transform: uppercase; color: var(--accent); font-weight: 600; margin-bottom: .5em; }
.interaction h3 { font-size: clamp(1.5rem, 3.6vw, 2.1rem); margin-bottom: .5em; }

/* 1 · cabosse à toucher */
.points-cadre { position: relative; border-radius: var(--rayon); overflow: hidden; }
.points-cadre img { width: 100%; }
.point { position: absolute; left: var(--x); top: var(--y); width: 48px; height: 48px; margin: -24px 0 0 -24px; border-radius: 50%; border: 2px solid #fff; background: rgba(20,16,12,.72); color: #fff; font-weight: 600; display: grid; place-items: center; padding: 0; }
.point::before { content: ""; position: absolute; inset: -8px; border-radius: 50%; border: 2px solid rgba(255,255,255,.7); animation: pouls 2.2s ease-out infinite; }
.point.vu::before { animation: none; opacity: 0; }
.point.vu { background: rgba(229,139,44,.85); }
.point.actif { background: var(--jaune); color: var(--nuit); border-color: var(--nuit); transform: scale(1.12); }
@keyframes pouls { from { transform: scale(.75); opacity: 1; } to { transform: scale(1.35); opacity: 0; } }
@media (max-width: 520px) { .point { width: 44px; height: 44px; margin: -22px 0 0 -22px; } }
.point-info { padding: 20px 4px 4px; min-height: 12.5em; }
.point-compte { font-size: .9rem; color: var(--doux); margin: 0; }

/* 2 · curseur de transformation */
.transfo-grille { display: grid; gap: 24px; align-items: center; }
@media (min-width: 760px) { .transfo-grille { grid-template-columns: minmax(0, 420px) 1fr; gap: 40px; } }
.transfo-image img { width: 100%; aspect-ratio: 1; object-fit: cover; border-radius: var(--rayon); }
.transfo-texte { min-height: 19em; }
.jauges { display: grid; gap: 12px; margin-top: 1.2em; }
.jauge { display: grid; grid-template-columns: 9.5em 1fr 7.5em; gap: 12px; align-items: center; font-size: .92rem; }
.jauge-rail { height: 12px; background: rgba(0,0,0,.35); border-radius: 999px; overflow: hidden; }
.jauge-rail i { display: block; height: 100%; width: var(--v); background: var(--cabosse); border-radius: 999px; transition: width .5s; }
.jauge-rail i.eau { background: #6fb6d6; }
.jauge-val { color: var(--doux); }
@media (max-width: 520px) { .jauge { grid-template-columns: 1fr 1fr; } .jauge-rail { grid-column: 1 / -1; order: 3; } .jauge-val { text-align: right; } }
.curseur { display: block; margin-top: 24px; }
input[type="range"] { width: 100%; height: 44px; margin: 0; background: none; accent-color: var(--chartreuse); -webkit-appearance: none; appearance: none; }
input[type="range"]::-webkit-slider-runnable-track { height: 8px; border-radius: 999px; background: linear-gradient(to right, #efe9dc, #8a3b22 55%, #4a2a18); }
input[type="range"]::-moz-range-track { height: 8px; border-radius: 999px; background: linear-gradient(to right, #efe9dc, #8a3b22 55%, #4a2a18); }
input[type="range"]::-webkit-slider-thumb { -webkit-appearance: none; width: 34px; height: 34px; margin-top: -13px; border-radius: 50%; background: var(--chartreuse); border: 3px solid var(--nuit); }
input[type="range"]::-moz-range-thumb { width: 30px; height: 30px; border-radius: 50%; background: var(--chartreuse); border: 3px solid var(--nuit); }
.curseur-etapes { list-style: none; display: grid; grid-template-columns: repeat(5, 1fr); padding: 0; margin: 4px 0 0; font-size: .8rem; color: var(--doux); text-align: center; }
.curseur-etapes li:first-child { text-align: left; } .curseur-etapes li:last-child { text-align: right; }
.curseur-etapes li.actif { color: var(--sur); font-weight: 600; }

/* 3 · table des machines */
.machines-grille { display: grid; gap: 24px; }
@media (min-width: 860px) { .machines-grille { grid-template-columns: 1.1fr 1fr; gap: 40px; align-items: center; } }
.machines-cadre { position: relative; aspect-ratio: 3 / 4; overflow: hidden; border-radius: var(--rayon); background: #cfd4d8; max-height: 78svh; }
.machines-cadre img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; opacity: 0; transition: transform .9s cubic-bezier(.4,0,.2,1), opacity .5s; }
.machines-cadre img.visible { opacity: 1; }
.machines-texte { min-height: 22em; display: flex; flex-direction: column; }
.machines-matiere { font-weight: 600; padding: 12px 16px; background: color-mix(in srgb, var(--accent) 12%, transparent); border-radius: 8px; }
.machines-nav { display: flex; align-items: center; gap: 14px; margin-top: auto; padding-top: 12px; }
.machines-nav button { border: 2px solid var(--sur); background: none; border-radius: 999px; padding: 10px 20px; min-height: 48px; font-weight: 600; }
.machines-nav button.plein { background: var(--sur); color: var(--fond); }
.machines-nav button:disabled { opacity: .35; cursor: default; }
.machines-nav span { font-size: .9rem; color: var(--doux); }

/* 4 · tablette */
.choix { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 20px; }
.choix button { border: 2px solid color-mix(in srgb, currentColor 45%, transparent); background: none; border-radius: 999px; padding: 8px 16px; min-height: 44px; }
.choix button[aria-checked="true"] { background: var(--creme); color: var(--nuit); border-color: var(--creme); font-weight: 600; }
.tablette-grille { display: grid; grid-template-columns: repeat(8, 1fr); gap: 4px; padding: 10px; background: #0c0907; border-radius: 10px; max-width: 420px; margin-bottom: 20px; }
.tablette-grille i { aspect-ratio: 1; border-radius: 3px; transition: background .35s; box-shadow: inset 0 -3px rgba(0,0,0,.18), inset 0 2px rgba(255,255,255,.12); }
.masse { background: #4a2a1b; } .beurre { background: #e6d77a; } .lait { background: #f3ead6; } .sucre { background: #c9cdd2; }
.ingredients { list-style: none; padding: 0; margin: 0; display: flex; flex-wrap: wrap; gap: 6px 18px; font-size: .95rem; }
.cle { display: inline-block; width: .85em; height: .85em; border-radius: 2px; margin-right: .4em; vertical-align: -1px; }
#tablette > div[aria-live] { min-height: 11em; }

/* ── Schémas ── */
.schema { background: var(--carte); border-radius: var(--rayon); padding: clamp(14px, 3vw, 28px); }
.schema svg { width: 100%; height: auto; }
.schema-large { margin: 0 var(--marge); max-width: 1180px; overflow-x: auto; }
@media (min-width: 1300px) { .schema-large { margin: 0 auto; } }
.schema-large svg { min-width: 640px; }
.schema text { font-family: var(--texte); fill: currentColor; text-anchor: middle; font-size: 13px; }
.cal-fond { fill: none; stroke: color-mix(in srgb, currentColor 12%, transparent); stroke-width: 26; }
.cal-principale { fill: none; stroke: #1f7a4a; stroke-width: 26; }
.cal-intermediaire { fill: none; stroke: #d9a441; stroke-width: 10; }
.cal-mois text { font-weight: 600; }
.schema .cal-centre { font-family: var(--titre); font-size: 22px; }
.schema .cal-centre-petit { font-size: 15px; }
.cle-principale { background: #1f7a4a; } .cle-intermediaire { background: #d9a441; }
.route-ligne { stroke: #1f7a4a; stroke-width: 3; stroke-dasharray: 2 8; stroke-linecap: round; fill: none; }
.route-etape circle { fill: #1f7a4a; }
.route-etape text { font-weight: 600; font-size: 15px; }
.schema .route-sous { font-weight: 400; font-size: 11.5px; opacity: .75; }
.axe { stroke: currentColor; stroke-width: 1.5; opacity: .5; }
.courbe { fill: none; stroke: var(--accent); stroke-width: 4; stroke-linecap: round; }
.pt { fill: var(--accent); }
.schema .t-val { font-weight: 600; font-size: 14px; } .schema .t-nom { font-size: 13px; opacity: .8; }

/* ── Récit final ── */
.recit { list-style: none; counter-reset: r; display: grid; gap: 16px; padding: 0 var(--marge); margin: 0 auto; max-width: 1180px; }
@media (min-width: 700px) { .recit { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 1040px) { .recit { grid-template-columns: repeat(3, 1fr); } }
.recit li { counter-increment: r; position: relative; background: var(--carte); border-radius: var(--rayon); overflow: hidden; display: flex; flex-direction: column; }
.recit li::before { content: counter(r); position: absolute; top: 12px; left: 12px; width: 40px; height: 40px; border-radius: 50%; background: var(--jaune); color: var(--nuit); display: grid; place-items: center; font-family: var(--titre); font-size: 1.3rem; }
.recit img { width: 100%; aspect-ratio: 16 / 10; object-fit: cover; object-position: var(--pos, 50% 50%); }
.recit p { padding: 16px 18px 0; margin: 0; flex: 1; }
.recit a { display: inline-block; margin: 6px 18px 14px; padding: 8px 0; font-size: .9rem; font-weight: 600; color: var(--accent); }

/* ── Pied : sources et crédits (discret) ── */
.pied { background: #0d0a08; color: var(--creme-2); padding: 28px var(--marge) 40px; font-size: .9rem; }
.pied summary { cursor: pointer; padding: 10px 0; min-height: 44px; }
.pied-colonnes { display: grid; gap: 24px; padding: 12px 0 20px; max-width: 1100px; }
@media (min-width: 800px) { .pied-colonnes { grid-template-columns: 1fr 1fr; gap: 48px; } }
.pied h3 { font-family: var(--texte); font-weight: 600; font-size: .8rem; letter-spacing: .14em; text-transform: uppercase; margin-bottom: 1em; }
.pied ul { padding-left: 1.1em; margin: 0; } .pied li { margin-bottom: .6em; }
.pied-ligne { margin: 16px 0 0; }

/* Accueil sur écran étroit : la photo en haut, le texte dessous, pour que les cabosses restent visibles */
@media (max-width: 700px) and (orientation: portrait) {
  .accueil > img { height: 66%; object-position: 80% 50%; }
  .accueil::after { background: linear-gradient(to top, var(--nuit) 0%, var(--nuit) 36%, rgba(20,16,12,0) 62%); }
  .accueil-texte { padding-bottom: 56px; }
}

/* Sur téléphone : les commandes restent collées à l'image qu'elles pilotent */
@media (max-width: 759px) {
  #transfo, #machines { display: flex; flex-direction: column; }
  .transfo-grille, .machines-grille, .machines-texte { display: contents; }
  .transfo-image { order: 1; } .transfo-image img { aspect-ratio: 16 / 11; }
  #transfo .curseur { order: 2; margin-top: 8px; } #transfo .curseur-etapes { order: 3; }
  .transfo-texte { order: 4; margin-top: 22px; min-height: 24em; }
  .machines-cadre { order: 1; }
  .machines-nav { order: 2; margin: 14px 0 18px; padding: 0; justify-content: space-between; }
  #machines-etape { order: 3; } #machines-titre { order: 4; } #machines-desc { order: 5; min-height: 11.5em; } #machines-matiere { order: 6; }
  #machines > .legende { order: 7; }
}

/* Accueil sur écran large : texte à gauche, photo entière à droite */
@media (min-width: 900px) and (orientation: landscape) {
  .accueil > img { left: auto; right: 0; width: 58%; object-position: 72% 50%; }
  .accueil::after { background: linear-gradient(to right, var(--nuit) 0%, var(--nuit) 42%, rgba(20,16,12,0) 62%); }
  .accueil { align-items: center; }
  .accueil-texte { padding: 0 0 0 var(--marge); max-width: 46%; }
  h1 { font-size: clamp(3rem, 6.4vw, 6.2rem); }
}

/* ═════════ Version « Côte d'Ivoire » : photos libres et illustrations ═════════ */
.pastille-photo { background: var(--cabosse); }
.tete-secondaire { padding-top: clamp(56px, 9vw, 110px); }
.tete-secondaire h2 { font-size: clamp(2.1rem, 6vw, 3.8rem); }
.cadre-large img { aspect-ratio: 4 / 3; }
.galerie { margin-top: clamp(8px, 2vw, 24px); }
.galerie + .schema-large, .schema-large + .duo { margin-top: clamp(24px, 4vw, 48px); }
.galerie figcaption strong { color: var(--sur); }

/* Interaction 1 · la carte */
.carte-grille { display: grid; gap: 24px; align-items: center; }
@media (min-width: 820px) { .carte-grille { grid-template-columns: minmax(0, 480px) 1fr; gap: 48px; } }
.carte-cadre { position: relative; max-width: 480px; width: 100%; margin: 0 auto; }
.carte-cadre svg { width: 100%; height: auto; }
.carte-pays { fill: #e3d3ad; stroke: #2b2015; stroke-width: 2; stroke-linejoin: round; }
.carte-zone { fill: #2f8a55; opacity: .85; }
.carte-cadre text { font-family: var(--texte); text-anchor: middle; }
.carte-legende { font-size: 13px; letter-spacing: .14em; text-transform: uppercase; fill: #6a5a45; }
.carte-legende-zone { fill: #eaf5e6; }
.carte-mer { font-size: 12px; font-style: italic; fill: #6a5a45; }
.ville { position: absolute; left: var(--x); top: var(--y); transform: translate(-50%, -50%); display: flex; flex-direction: column; align-items: center; gap: 2px; background: none; border: 0; padding: 6px; min-width: 48px; min-height: 48px; justify-content: center; }
.ville i { width: 18px; height: 18px; border-radius: 50%; background: #fff; border: 3px solid #2b2015; display: block; transition: transform .2s; }
.ville-port i { border-radius: 4px; }
.ville span { font-size: .78rem; font-weight: 600; line-height: 1; color: #1c140c; background: rgba(251,245,230,.88); padding: 3px 6px; border-radius: 4px; white-space: nowrap; }
.ville.vu i { background: var(--cabosse); }
.ville.actif i { background: var(--jaune); transform: scale(1.35); }
.ville.actif span { background: #2b2015; color: #fff; }
.carte-texte { min-height: 15em; }
@media (max-width: 480px) { .ville span { font-size: .7rem; padding: 2px 4px; } }

/* Interaction 2 · la cabosse dessinée */
.points-dessin { background: #2a1a10; padding: 4% 2%; }
.points-dessin svg { width: 100%; height: auto; }
.cab-ombre { fill: rgba(0,0,0,.35); }
.cab-coque { fill: #e2952f; stroke: #8a4a12; stroke-width: 4; }
.cab-coque-int { fill: #f1c46a; }
.cab-pulpe { fill: #fbf3e2; }
.cab-axe { stroke: #e6d2ae; stroke-width: 9; stroke-linecap: round; fill: none; }
.cab-graines ellipse { fill: #7b3f6e; stroke: #fff8ea; stroke-width: 5; }

/* Interaction 3 · la graine qui se transforme */
.transfo-image svg { width: 100%; height: auto; border-radius: var(--rayon); }
#feve-dessin * { transition: fill .7s, opacity .7s, transform .7s, stroke .7s; }
.feve-fond { fill: #3d4a1e; }
.feve-feuille { fill: #5f8a2f; } .feve-feuille-2 { fill: #4b7325; }
.feve-pulpe { fill: #fdf6e8; }
.feve-gouttes path { fill: #fdf6e8; opacity: 0; }
.feve-graine { fill: #efe3cf; stroke: #cbb99a; stroke-width: 3; }
.feve-reflet { fill: none; stroke: #fff; stroke-width: 5; stroke-linecap: round; opacity: .7; }
.feve-fissure { fill: none; stroke: #2a160d; stroke-width: 2.5; stroke-linecap: round; opacity: 0; }
.feve-vapeur path { fill: none; stroke: #fff; stroke-width: 4; stroke-linecap: round; opacity: 0; }
.feve-soleil { opacity: 0; } .feve-soleil circle { fill: var(--jaune); } .feve-soleil path { stroke: var(--jaune); stroke-width: 5; stroke-linecap: round; }
#transfo[data-etape="1"] .feve-pulpe { opacity: .55; transform: translateY(10px) scaleY(.94); transform-origin: 200px 266px; }
#transfo[data-etape="1"] .feve-gouttes path { opacity: .9; }
#transfo[data-etape="1"] .feve-graine { fill: #e8d3bd; }
#transfo[data-etape="2"] .feve-pulpe, #transfo[data-etape="3"] .feve-pulpe, #transfo[data-etape="4"] .feve-pulpe { opacity: 0; }
#transfo[data-etape="2"] .feve-graine { fill: #a4523a; stroke: #6d2f20; }
#transfo[data-etape="2"] .feve-vapeur path { opacity: .85; }
#transfo[data-etape="2"] .feve-fond { fill: #5a3a1c; }
#transfo[data-etape="3"] .feve-graine { fill: #7a4429; stroke: #4c2816; }
#transfo[data-etape="3"] .feve-vapeur path { opacity: .35; }
#transfo[data-etape="3"] .feve-reflet, #transfo[data-etape="4"] .feve-reflet { opacity: .25; }
#transfo[data-etape="4"] .feve-graine { fill: #4f2c1a; stroke: #2d170c; transform: scale(.9); transform-origin: 200px 186px; }
#transfo[data-etape="4"] .feve-fissure { opacity: .8; }
#transfo[data-etape="4"] .feve-soleil { opacity: 1; }
#transfo[data-etape="4"] .feve-fond { fill: #b9803a; }
#transfo[data-etape="4"] .feve-feuille { fill: #c79a54; } #transfo[data-etape="4"] .feve-feuille-2 { fill: #b0823f; }
#transfo.a-l-ecran[data-etape="2"] .feve-vapeur path, #transfo.a-l-ecran[data-etape="3"] .feve-vapeur path { animation: monte 2.4s ease-in-out infinite; }
@keyframes monte { 0%, 100% { transform: translateY(6px); } 50% { transform: translateY(-6px); } }

/* Interaction 4 · les machines dessinées */
.machines-dessin { aspect-ratio: 5 / 4; background: #dfe4e7; }
.machines-dessin svg { position: absolute; inset: 0; width: 100%; height: 100%; }
.m-fond { fill: #dfe4e7; } .m-sol { stroke: #8f999f; stroke-width: 3; stroke-linecap: round; }
.scene { opacity: 0; visibility: hidden; transition: opacity .45s; }
#machines[data-scene="0"] .scene[data-s="0"], #machines[data-scene="1"] .scene[data-s="1"], #machines[data-scene="2"] .scene[data-s="2"],
#machines[data-scene="3"] .scene[data-s="3"], #machines[data-scene="4"] .scene[data-s="4"], #machines[data-scene="5"] .scene[data-s="5"] { opacity: 1; visibility: visible; }
.m-cuve { fill: #f6f8f9; stroke: #3d464c; stroke-width: 4; stroke-linejoin: round; }
.m-cuve-int { fill: #fff; stroke: #aab3b8; stroke-width: 2; }
.m-pied, .m-bras { stroke: #3d464c; stroke-width: 7; stroke-linecap: round; fill: none; }
.m-pale, .m-trait { stroke: #8f999f; stroke-width: 4; stroke-linecap: round; fill: none; }
.m-rouleau { fill: #9aa5ab; stroke: #3d464c; stroke-width: 4; }
.m-axe { fill: #3d464c; }
.m-meule { fill: #b7c0c5; stroke: #3d464c; stroke-width: 4; } .m-meule-bas { fill: #9aa5ab; }
.m-feves ellipse { fill: #6b3a22; stroke: #3c1d0f; stroke-width: 2; }
.m-eclats path { fill: #6b3a22; }
.m-coques path { fill: none; stroke: #b98f5e; stroke-width: 5; stroke-linecap: round; }
.m-air { stroke: #5aa7cf; stroke-width: 4; stroke-linecap: round; stroke-dasharray: 10 8; fill: none; } .m-air-pointe { fill: #5aa7cf; }
.m-fleche-rot { fill: none; stroke: #5aa7cf; stroke-width: 4; stroke-linecap: round; }
.m-flammes path { fill: var(--cabosse); }
.m-vapeur path { fill: none; stroke: #8f999f; stroke-width: 4; stroke-linecap: round; }
.m-liquide { fill: #5a311c; } .m-coulee { fill: none; stroke: #5a311c; stroke-width: 9; stroke-linecap: round; } .m-coulee-large { stroke-width: 16; }
.m-sac { fill: #c9a56a; stroke: #7b5a2b; stroke-width: 4; } .m-sac-col { fill: #b08c52; stroke: #7b5a2b; stroke-width: 4; }
.m-sac ~ .m-trait { stroke: #7b5a2b; stroke-width: 3; }
.m-etiquette { font-family: var(--texte); font-weight: 600; font-size: 22px; text-anchor: middle; fill: #3c2a12; letter-spacing: .08em; }
.m-petit { font-size: 14px; letter-spacing: .02em; fill: #3d464c; } .m-sac ~ .m-petit { fill: #3c2a12; }
.m-moule { fill: #c9d0d4; stroke: #3d464c; stroke-width: 4; }
.m-carres rect { fill: #4a2a1b; stroke: #2d170c; stroke-width: 2; }
.m-tourne, .m-tourne-inv, .m-balance { transform-box: view-box; }
#machines.a-l-ecran .m-tourne { animation: tourne 5s linear infinite; }
#machines.a-l-ecran .m-tourne-inv { animation: tourne 5s linear infinite reverse; }
#machines.a-l-ecran .m-balance { animation: balance 3.2s ease-in-out infinite; }
#machines.a-l-ecran .m-flammes path { animation: flamme 1s ease-in-out infinite alternate; transform-box: fill-box; transform-origin: 50% 100%; }
#machines.a-l-ecran .m-vapeur path { animation: monte 2.4s ease-in-out infinite; }
#machines.a-l-ecran .m-air { animation: souffle 1s linear infinite; }
#machines.a-l-ecran .m-coques path { animation: derive 2s ease-in-out infinite alternate; }
@keyframes tourne { to { transform: rotate(360deg); } }
@keyframes balance { 0%, 100% { transform: rotate(-32deg); } 50% { transform: rotate(32deg); } }
@keyframes flamme { from { transform: scaleY(.8); } to { transform: scaleY(1.15); } }
@keyframes souffle { to { stroke-dashoffset: -18; } }
@keyframes derive { from { transform: translateX(0); } to { transform: translateX(14px); } }
@media (max-width: 759px) { .machines-dessin { aspect-ratio: 5 / 4; } #machines-desc { min-height: 10em; } .transfo-image svg { max-height: 44svh; } }
