/* ============================================================
   SpiLi — l'accueil : le hall de la maison
   ------------------------------------------------------------
   Repris du prototype `docs/prototypes/maison/` (15 octobre 2026),
   validé avec la typographie le 31 octobre. Le hall en cuivre
   coulé, la vitrine (le moment de l'absinthe), les trois ailes de
   salles, les galeries, le projet. Tout est dans le périmètre
   `.maison-page` : rien ne fuit vers les autres pages.
   ============================================================ */

.maison-page {
  /* la maison : du cuivre coulé, un noir de chai, un blanc nacré (moodboard Notion) */
  --chai: #0d0907;
  --nacre: #f4efe8;
  --cuivre-clair: #f3c7a2;
  --cuivre-mat: #c8763f;
  --cuivre-fonce: #6e3517;
  --cuivre-trait: rgb(184 112 63 / .75);
  --bleu-nuit: #1b2a4a;
  --cuivre-repli: radial-gradient(120% 90% at 78% 70%, #a4552a 0%, #4a2412 38%, #0d0907 72%);

  --pierre: var(--spili-fond);
  --pierre-2: #e8e1d5;
  --pierre-3: #d8cebe;
  --encre: var(--spili-texte);
  --encre-2: var(--spili-texte-doux);
  --encre-3: var(--spili-texte-faible);
  --trait: rgb(29 26 21 / .13);
  --trait-fort: rgb(29 26 21 / .3);

  /* palettes d’ambiance des salles (reprises des prototypes) */
  --fee-nuit: #0b0f0c; --fee: #b4d36a; --fee-sombre: #5f7a25; --opale: #e3e9d6;
  --gin-nuit: #0a0806; --lampe: #f3c27a;
  --bois: #2c2018; --papier: #f2e8d2; --papier-2: #e8dbbd; --kraft: #b08953; --tampon: #ad231a;
  --foyer: #0b0806; --braise: #ff6b2c; --ambre: #f5b860; --cuivre: #d98a50;

  --gouttiere: clamp(16px, 4.6vw, 64px);
  --mesure: 36rem;
  --sortie: cubic-bezier(.16, 1, .3, 1);
  --liquide: cubic-bezier(.65, 0, .35, 1);
  --decante: cubic-bezier(.45, .05, .25, 1);

  /* seuil : origine et teinte du passage */
  --seuil-x: 50%;
  --seuil-y: 55%;
  --seuil-teinte: var(--pierre);
  color-scheme: light;
  --f-titre: var(--spili-titre);
  --f-texte: var(--spili-courant);
  --f-cartel: var(--spili-data);
  --texte-taille: 1.0625rem;
  --h1-poids: 500; --h1-style: normal; --h1-largeur: 100%; --h1-interlettre: -.012em; --h1-interligne: 1.02; --h1-echelle: 1;
  --h2-poids: 500; --h2-largeur: 100%; --h2-interlettre: -.008em;
  --em-style: italic; --em-poids: 400;
  --cartel-casse: none; --cartel-interlettre: .025em; --cartel-poids: 500; --cartel-taille: .875rem;
  --surtitre-casse: none; --surtitre-interlettre: .03em;
  font-size: var(--texte-taille); line-height: 1.62; color: var(--encre);
}

/* ---------- Base, dans le périmètre de l'accueil ---------- */
.maison-page img { display: block; max-width: 100%; height: auto; }
.maison-page a { color: inherit; text-decoration-thickness: 1px; text-underline-offset: .22em; }
.maison-page a:hover { text-decoration-thickness: 2px; color: inherit; }
.maison-page button { font: inherit; color: inherit; }
.maison-page h1, .maison-page h2, .maison-page h3, .maison-page h4 { margin: 0; font-family: var(--f-titre); font-weight: var(--h2-poids); letter-spacing: var(--h2-interlettre); text-wrap: balance; line-height: 1.06; color: inherit; }
.maison-page p { margin: 0; text-wrap: pretty; }
.maison-page em { font-style: var(--em-style); font-weight: var(--em-poids); }
.maison-page sup { font-size: .66em; line-height: 0; vertical-align: .5em; }
.maison-page .cache { position: absolute !important; width: 1px; height: 1px; margin: -1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }

.maison-page .mur { width: min(1312px, 100% - 2 * var(--gouttiere)); margin-inline: auto; }
.maison-page section[id], .maison-page [id].aile { scroll-margin-top: calc(var(--spili-entete) + 12px); }

.maison-page .surtitre {
  font-family: var(--f-cartel); font-weight: var(--cartel-poids); font-size: var(--cartel-taille);
  text-transform: var(--surtitre-casse); letter-spacing: var(--surtitre-interlettre); color: var(--encre-3);
}
.maison-page .cartel {
  font-family: var(--f-cartel); font-weight: var(--cartel-poids); font-size: var(--cartel-taille); line-height: 1.45;
  text-transform: var(--cartel-casse); letter-spacing: var(--cartel-interlettre); color: var(--encre-3);
}
.maison-page .cartel cite { font-style: normal; color: var(--encre-2); }
.maison-page .cartel a { text-decoration-color: var(--trait-fort); }
.maison-page .chapeau { font-size: clamp(1.125rem, 1.45vw, 1.3rem); line-height: 1.55; color: var(--encre-2); max-width: var(--mesure); }

.bouton {
  display: inline-flex; align-items: center; gap: .6em; min-height: 48px; padding: .7em 1.25em;
  background: var(--encre); color: var(--pierre); text-decoration: none; border-radius: 999px;
  font-family: var(--f-texte); font-weight: 600; font-size: 1rem; letter-spacing: .005em;
  transition: transform .4s var(--sortie);
}
.maison-page .bouton { color: var(--pierre); } /* passe devant « .maison-page a » */
.bouton:hover { transform: translateY(-2px); }
.bouton svg { width: 1.1em; height: 1.1em; flex: none; transition: transform .45s var(--sortie); }
.bouton:hover svg { transform: translateY(2px); }
.lien-fleche { display: inline-flex; align-items: center; gap: .5em; font-weight: 600; text-decoration: none; min-height: 44px; }
.lien-fleche svg { width: 1.2em; height: 1.2em; transition: transform .45s var(--sortie); }
.lien-fleche:hover svg { transform: translateX(4px); }
.lien-fleche span { text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: .22em; text-decoration-color: var(--trait-fort); }

/* =====================================================================
   1. Le hall — du cuivre coulé
   Le métal de l'alambic, fondu et remis en mouvement (moodboard Notion,
   déc. 2024). Une surface de cuivre ondule lentement ; la main y laisse
   des ondes. Rendu WebGL derrière le texte, voile sombre pour la lecture.
   ===================================================================== */
.hall {
  position: relative; isolation: isolate; overflow: hidden;
  display: grid; align-content: start; min-height: min(94svh, 1000px);
  padding-bottom: clamp(140px, 24vh, 260px);
  background: var(--chai) var(--cuivre-repli); color: var(--nacre);
  touch-action: pan-y;
}
.coulee { position: absolute; inset: 0; z-index: -2; }
.coulee canvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
.hall::before { /* le voile de lecture : sombre sous le texte, ouvert sur le métal en bas et à droite */
  content: ""; position: absolute; inset: 0; z-index: -1; pointer-events: none;
  background:
    linear-gradient(100deg, rgb(13 9 7 / .9) 0%, rgb(13 9 7 / .72) 38%, rgb(13 9 7 / .18) 70%, rgb(13 9 7 / 0) 100%),
    linear-gradient(180deg, rgb(13 9 7 / .55) 0%, rgb(13 9 7 / 0) 30%, rgb(13 9 7 / 0) 78%, rgb(13 9 7 / .5) 100%);
}
.hall-haut { display: grid; grid-template-columns: minmax(0, 1fr) minmax(260px, 340px); gap: 24px clamp(32px, 6vw, 96px); align-items: end; padding-top: clamp(48px, 10vh, 120px); }
.hall .surtitre { color: var(--cuivre-clair); }
.hall h1 {
  font-weight: var(--h1-poids); font-stretch: var(--h1-largeur); letter-spacing: var(--h1-interlettre); line-height: var(--h1-interligne);
  font-size: calc(clamp(2.7rem, 6.6vw, 6.4rem) * var(--h1-echelle)); max-width: 15ch; margin-top: 18px;
  text-shadow: 0 2px 30px rgb(13 9 7 / .55);
}
.hall h1 em { color: var(--cuivre-clair); }
.hall .chapeau { margin-top: 26px; color: #e6dccd; }
.hall-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 24px; margin-top: 30px; }
.hall .bouton { background: linear-gradient(135deg, var(--cuivre-clair), var(--cuivre) 55%, var(--cuivre-fonce)); color: var(--chai); }
.hall .lien-fleche span { text-decoration-color: rgb(243 199 162 / .5); }

.plan { border-top: 1px solid rgb(243 199 162 / .45); padding: 14px 18px 4px; margin-inline: -18px; border-radius: 0 0 14px 14px; background: rgb(13 9 7 / .5); -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px); }
.plan h2 { font-family: var(--f-cartel); font-weight: var(--cartel-poids); font-size: var(--cartel-taille); text-transform: var(--surtitre-casse); letter-spacing: var(--surtitre-interlettre); color: var(--cuivre-clair); font-stretch: 100%; }
.plan ol { margin: 10px 0 0; padding: 0; list-style: none; }
.plan li + li { border-top: 1px solid rgb(244 239 232 / .14); }
.plan a { display: grid; grid-template-columns: 1fr auto; align-items: baseline; gap: 2px 12px; padding: 10px 0; text-decoration: none; }
.plan a:hover .plan-nom { text-decoration: underline; text-decoration-color: var(--cuivre-clair); }
.plan-nom { font-family: var(--f-titre); font-weight: var(--h2-poids); font-stretch: var(--h2-largeur); font-size: 1.2rem; line-height: 1.2; }
.plan-compte { font-family: var(--f-cartel); font-size: var(--cartel-taille); text-transform: var(--cartel-casse); letter-spacing: var(--cartel-interlettre); color: #c9bba8; }
.plan-geste { grid-column: 1 / -1; font-size: .875rem; color: #c9bba8; line-height: 1.4; }
.hall :focus-visible { outline-color: var(--cuivre-clair); }

.coulee-note { position: absolute; right: var(--gouttiere); bottom: 16px; margin: 0; font-family: var(--f-cartel); font-size: var(--cartel-taille); letter-spacing: var(--cartel-interlettre); text-transform: var(--cartel-casse); color: var(--nacre); opacity: .78; pointer-events: none; text-shadow: 0 1px 8px rgb(13 9 7 / .8); }
.coulee-note .si-tactile { display: none; }
@media (hover: none) { .coulee-note .si-souris { display: none; } .coulee-note .si-tactile { display: inline; } }

@media (max-width: 900px) {
  .hall { min-height: 0; padding-bottom: 200px; }
  .hall::before { background: linear-gradient(180deg, rgb(13 9 7 / .82) 0%, rgb(13 9 7 / .7) 55%, rgb(13 9 7 / .12) 85%, rgb(13 9 7 / .35) 100%); }
  .hall-haut { grid-template-columns: 1fr; padding-top: 36px; }
  .plan { max-width: 30rem; }
}

/* =====================================================================
   2. LA VITRINE — le moment de l’absinthe
   ===================================================================== */
.vitrine-section { padding: clamp(56px, 9vw, 120px) 0 clamp(40px, 6vw, 80px); }
.niche {
  position: relative; isolation: isolate; overflow: hidden;
  display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.05fr); align-items: center; gap: clamp(24px, 5vw, 80px);
  padding: clamp(56px, 8vw, 110px) clamp(20px, 6vw, 96px) clamp(36px, 5vw, 72px);
  background: var(--fee-nuit); color: #ece5d3;
  box-shadow: inset 0 0 0 1.5px var(--cuivre-trait), inset 0 1px 40px rgb(200 118 63 / .12); /* la niche est cerclée de cuivre */
  border-radius: min(46vw, 640px) min(46vw, 640px) 18px 18px / clamp(120px, 18vw, 260px) clamp(120px, 18vw, 260px) 18px 18px;
}
.niche::before { /* la lampe de la vitrine, fixe */
  content: ""; position: absolute; inset: 0; z-index: -1; pointer-events: none;
  background: radial-gradient(40% 50% at 28% 36%, rgb(236 229 211 / .09), transparent 70%), radial-gradient(50% 30% at 28% 92%, rgb(180 211 106 / .07), transparent 70%);
}
.niche .surtitre { color: #a9b39b; }
.niche h2 { font-weight: var(--h1-poids); font-stretch: var(--h1-largeur); letter-spacing: var(--h1-interlettre); font-size: calc(clamp(2.3rem, 4.6vw, 4.4rem) * var(--h1-echelle)); line-height: 1.02; margin-top: 14px; }
.niche h2 em { color: var(--fee); }
.niche p.corps { margin-top: 20px; color: #ddd6c4; max-width: 34rem; }
.niche p.corps + p.corps { margin-top: 12px; color: #bdb7a5; }
.niche .cartel { color: #8f8a7c; margin-top: 26px; max-width: 34rem; }
.niche .cartel cite { color: #bdb7a5; }
.niche-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 22px; margin-top: 30px; }
.niche .bouton { background: var(--fee); color: #10140e; position: relative; }
.niche .bouton::after { /* un appel doux, jamais un clignotement (cycle de 2,8 s) */
  content: ""; position: absolute; inset: -6px; border-radius: inherit; border: 1px solid var(--fee); opacity: 0; pointer-events: none;
}
.niche.appel .bouton::after { animation: appel 2.8s ease-in-out infinite; }
@keyframes appel { 0%, 100% { opacity: 0; transform: scale(.96); } 50% { opacity: .7; transform: scale(1.02); } }

.verre-zone { display: grid; justify-items: center; gap: 14px; }
.verre { width: min(100%, 340px); aspect-ratio: 240 / 360; touch-action: none; cursor: grab; user-select: none; -webkit-user-select: none; -webkit-touch-callout: none; }
.verre.verse { cursor: grabbing; }
.verre svg { width: 100%; height: 100%; overflow: visible; }
.verre .liquide { transition: transform 1.1s var(--sortie); }
.verre .nuage { transition: opacity 1.4s ease, transform 1.6s var(--sortie); }
.verre .onde-surface { transform-box: fill-box; transform-origin: center; }
.verser {
  display: inline-flex; align-items: center; gap: .6em; min-height: 52px; padding: .65em 1.3em; border-radius: 999px;
  background: transparent; color: #ece5d3; border: 1px solid rgb(236 229 211 / .38); cursor: pointer; touch-action: none;
  font-family: var(--f-texte); font-weight: 600;
  transition: border-color .3s, background-color .3s;
}
.verser:hover { border-color: var(--fee); }
.verser[aria-disabled="true"] { opacity: .6; cursor: default; }
.verser svg { width: 14px; height: 18px; }
.verre-etat { min-height: 1.6em; font-style: italic; color: #bdb7a5; text-align: center; font-size: .975rem; }
.verre-aide { font-size: .8125rem; color: #8f8a7c; text-align: center; max-width: 24rem; }
@media (max-width: 860px) {
  .niche { grid-template-columns: 1fr; text-align: left; border-radius: 48vw 48vw 16px 16px / 26vw 26vw 16px 16px; padding-top: 72px; }
  .verre { width: min(70vw, 280px); }
}

/* =====================================================================
   3. LES SALLES — trois ailes, une par régime
   ===================================================================== */
.salles { padding: clamp(48px, 8vw, 112px) 0 0; }
.salles-tete { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr); gap: 20px clamp(32px, 6vw, 96px); align-items: end; }
.salles-tete h2, .galeries-tete h2, .projet h2 { font-size: clamp(2.3rem, 5vw, 4.4rem); }
.salles-tete .chapeau { max-width: 32rem; }
.legende-portes { margin-top: 14px; font-size: .9375rem; color: var(--encre-3); max-width: 32rem; }

.aile { padding: clamp(48px, 7vw, 96px) 0; }
.aile + .aile { border-top: 1px solid var(--trait); }
.aile-tete { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 12px clamp(32px, 6vw, 96px); align-items: end; margin-bottom: clamp(28px, 4vw, 52px); }
.aile-tete h3 { font-size: clamp(2.1rem, 4.4vw, 3.8rem); line-height: 1; margin-top: 10px; }
.aile-tete p.corps { color: var(--encre-2); max-width: 32rem; }
.aile-tete .aile-compte { margin-top: 10px; }

.portes { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: clamp(28px, 3.4vw, 48px) clamp(20px, 3vw, 44px); align-items: start; }
.aile-remonter .porte:nth-child(1) { grid-column: 1 / 7; }
.aile-remonter .porte:nth-child(2) { grid-column: 8 / 13; margin-top: clamp(40px, 12vh, 140px); }
.aile-decanter .porte:nth-child(1), .aile-transformer .porte:nth-child(1) { grid-column: 1 / 5; grid-row: 1 / 3; }
.aile-decanter .porte:nth-child(2), .aile-transformer .porte:nth-child(2) { grid-column: 5 / 9; grid-row: 1 / 3; }
.aile-decanter .porte:nth-child(3), .aile-transformer .porte:nth-child(3) { grid-column: 9 / 13; grid-row: 1; }
.aile-decanter .porte:nth-child(4), .aile-transformer .porte:nth-child(4) { grid-column: 9 / 13; grid-row: 2; }
@media (max-width: 1020px) {
  .salles-tete, .aile-tete { grid-template-columns: 1fr; }
  .portes .porte:nth-child(n) { grid-column: span 6; grid-row: auto; margin-top: 0; }
}
@media (max-width: 640px) {
  .portes { gap: 44px; grid-template-columns: minmax(0, 1fr); }
  .portes .porte:nth-child(n) { grid-column: 1 / -1; }
}

/* ---------- La porte ---------- */
.porte { position: relative; display: flex; flex-direction: column; }
.porte-cadre { position: relative; }
.porte-cadre::after { /* le chambranle, dessiné dans la pierre */
  content: ""; position: absolute; inset: -7px; border: 1.5px solid var(--cuivre-trait); border-radius: var(--chambranle, 3px); pointer-events: none;
  transition: inset .9s var(--sortie), border-color .5s ease;
}
.porte.ouverte .porte-cadre::after { inset: -11px; border-color: var(--cuivre-mat); }
.porte-baie {
  position: relative; overflow: hidden; isolation: isolate; background: var(--teinte, var(--encre));
  aspect-ratio: 3 / 4; max-height: min(64vh, 620px); width: 100%; clip-path: var(--ferme); transition: clip-path 1s var(--sortie);
}
.aile-remonter .porte-baie { aspect-ratio: 4 / 5; }
.porte.ouverte .porte-baie { clip-path: var(--ouvert); }
.porte-petite .porte-baie { aspect-ratio: 16 / 10; }
.porte-baie > img, .porte-baie > picture > img, .porte-baie .couche { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.porte-texte { padding-top: 22px; display: grid; gap: 8px; }
.porte-type { font-family: var(--f-cartel); font-weight: var(--cartel-poids); font-size: var(--cartel-taille); text-transform: var(--cartel-casse); letter-spacing: var(--cartel-interlettre); color: var(--encre-3); }
.porte h4 { font-size: clamp(1.5rem, 2.2vw, 2rem); line-height: 1.08; }
.porte-petite h4 { font-size: clamp(1.3rem, 1.7vw, 1.55rem); }
.porte h4 a { text-decoration: none; }
.porte h4 a::after { content: ""; position: absolute; inset: -7px; z-index: 3; } /* toute la porte est cliquable */
.porte h4 a:focus-visible { outline: none; }
.porte:has(h4 a:focus-visible) .porte-cadre::after { border: 2px solid var(--encre); inset: -9px; }
.porte-question { font-family: var(--f-titre); font-weight: var(--h2-poids); font-stretch: var(--h2-largeur); font-size: 1.15rem; line-height: 1.3; color: var(--encre-2); }
.porte-accroche { font-size: .975rem; color: var(--encre-3); line-height: 1.55; }
.porte-liste { font-size: .9375rem; color: var(--encre-2); line-height: 1.55; }
.porte .cartel { margin-top: 4px; position: relative; z-index: 4; }
.porte-entrer { display: inline-flex; align-items: center; gap: .4em; font-weight: 600; font-size: .9375rem; }
.porte-entrer svg { width: 1.1em; height: 1.1em; transition: transform .5s var(--sortie); }
.porte.ouverte .porte-entrer svg { transform: translateX(5px); }

/* Les baies ne sont plus des rectangles : hublot, galet, goutte (moodboard Notion). */
/* ---- Régime « faire remonter » : un hublot dans le noir, une lampe qui suit la main ---- */
.porte[data-regime="remonter"] { --ferme: inset(16% 30% 16% 30% round 50%); --ouvert: inset(0 round 50%); --chambranle: 50%; }
.porte[data-regime="remonter"] .porte-baie > img,
.porte[data-regime="remonter"] .porte-baie > picture > img { filter: sepia(.35) contrast(1.06) brightness(.96); }
.porte .nuit {
  position: absolute; left: -100%; top: -100%; width: 300%; height: 300%; pointer-events: none;
  background: radial-gradient(ellipse 15% 11.25% at 50% 50%, rgb(10 8 6 / 0) 0%, rgb(10 8 6 / .18) 38%, rgb(10 8 6 / .78) 72%, rgb(10 8 6 / .97) 100%);
  transform: translate(var(--tx, 0%), var(--ty, -2%)) scale(.62);
  transition: transform .7s var(--sortie);
}
.porte.ouverte .nuit { transform: translate(var(--tx, 0%), var(--ty, -2%)) scale(1.05); }

/* ---- Régime « décanter » : un dossier trouble, le dépôt qui tombe ---- */
/* ---- un galet de papier : deux liquides qui se séparent ---- */
.porte[data-regime="decanter"] {
  --galet: 34% 42% 30% 38% / 26% 30% 24% 28%;
  --ferme: inset(5% 4% round var(--galet)); --ouvert: inset(0 round var(--galet)); --chambranle: var(--galet); --teinte: var(--papier);
}
.porte[data-regime="decanter"] .porte-baie > img,
.porte[data-regime="decanter"] .porte-baie > picture > img { filter: sepia(.28) contrast(1.04); }
.trouble, .particules { position: absolute; left: 0; right: 0; top: 0; height: 100%; pointer-events: none; transition: transform 1.5s var(--decante), opacity 1s ease; }
.trouble {
  background:
    radial-gradient(circle at 20% 30%, rgb(176 137 83 / .5) 0 1.2px, transparent 1.6px) 0 0 / 23px 19px,
    radial-gradient(circle at 70% 60%, rgb(120 90 50 / .45) 0 1px, transparent 1.4px) 0 0 / 17px 29px,
    linear-gradient(to bottom, rgb(232 219 189 / .45), rgb(232 219 189 / .84) 14%, rgb(214 192 150 / .93) 100%);
}
.particules {
  background:
    radial-gradient(circle, rgb(120 86 44 / .55) 0 1.1px, transparent 1.5px) 3px 5px / 13px 11px,
    radial-gradient(circle, rgb(150 112 62 / .4) 0 .9px, transparent 1.3px) 7px 2px / 19px 15px;
  opacity: .85;
}
.porte.ouverte .trouble { transform: translateY(80%); }
.porte.ouverte .particules { transform: translateY(88%); transition-duration: 1.1s; }
.tampon {
  position: absolute; right: 9%; top: 12%; z-index: 2; pointer-events: none;
  font: 700 .82rem/1 "Courier New", ui-monospace, monospace; letter-spacing: .14em; text-transform: uppercase; white-space: nowrap;
  color: var(--tampon); border: 2.5px solid currentColor; outline: 1px solid currentColor; outline-offset: 3px; border-radius: 4px; padding: .5em .7em .42em;
  mix-blend-mode: multiply; opacity: 0; transform: rotate(-9deg) scale(1.35);
  transition: opacity .25s ease .95s, transform .45s cubic-bezier(.3, 1.6, .5, 1) .95s;
}
.porte.ouverte .tampon { opacity: .88; transform: rotate(-9deg) scale(1); }
.fiche { /* un énoncé posé dans le dossier, pour les jeux */
  position: absolute; inset: 0; display: grid; place-items: center; padding: 8% 10%;
  font-family: var(--f-titre); font-weight: var(--h2-poids); font-stretch: var(--h2-largeur); font-size: clamp(1.1rem, 1.6vw, 1.45rem); line-height: 1.25; text-align: center; color: var(--encre);
}

/* ---- Régime « transformer » : une voûte de foyer, la chaleur et la vapeur ---- */
.porte[data-regime="transformer"] {
  /* une goutte, ou une alvéole du hall de cuivre */
  --ferme: inset(18% 28% 4% 28% round 50% 50% 46% 46% / 40% 40% 28% 28%);
  --ouvert: inset(0 round 50% 50% 46% 46% / 34% 34% 22% 22%);
  --chambranle: 50% 50% 46% 46% / 34% 34% 22% 22%; --teinte: var(--foyer);
}
.porte-petite[data-regime="transformer"] { --ouvert: inset(0 round 50% 50% 40% 40% / 50% 50% 36% 36%); --ferme: inset(14% 28% 4% 28% round 50% 50% 40% 40% / 50% 50% 36% 36%); --chambranle: 50% 50% 40% 40% / 50% 50% 36% 36%; }
.porte-baie .gravure-lumiere { filter: invert(1) sepia(.95) saturate(2.6) hue-rotate(-14deg) brightness(.92) contrast(1.15); }
.porte-baie .froid { filter: invert(1) grayscale(1) brightness(.62) contrast(1.1); }
.porte-baie .terne { filter: grayscale(.6) brightness(.42) contrast(1.05); }
.porte-baie .vive { filter: sepia(.15) brightness(.95); }
.chaud { opacity: 0; transition: opacity 1.2s ease; }
.porte.ouverte .chaud { opacity: 1; }
.porte[data-variante="temps"] .chaud { opacity: 1; clip-path: inset(100% 0 0 0); transition: clip-path 1.8s var(--decante); }
.porte[data-variante="temps"].ouverte .chaud { clip-path: inset(0 0 0 0); }
.braise { position: absolute; inset: auto 0 0; height: 70%; pointer-events: none; background: radial-gradient(60% 70% at 50% 100%, rgb(255 107 44 / .55), rgb(255 107 44 / .12) 55%, transparent 75%); opacity: .3; transition: opacity 1s ease; }
.porte.ouverte .braise { opacity: 1; animation: braise 3.2s ease-in-out infinite alternate; }
@keyframes braise { from { opacity: .72; } to { opacity: 1; } }
.vapeur { position: absolute; left: 20%; bottom: 0; width: 60%; aspect-ratio: 1; border-radius: 50%; pointer-events: none; background: radial-gradient(circle, rgb(255 240 222 / .3), rgb(255 240 222 / .1) 45%, transparent 70%); opacity: 0; }
.porte.ouverte .vapeur { animation: vapeur 4.2s linear infinite; }
.porte.ouverte .vapeur:nth-of-type(2) { animation-delay: -1.4s; left: 6%; }
.porte.ouverte .vapeur:nth-of-type(3) { animation-delay: -2.8s; left: 34%; }
@keyframes vapeur {
  0% { transform: translateY(30%) scale(.55); opacity: 0; }
  25% { opacity: .9; }
  100% { transform: translateY(-150%) scale(1.7); opacity: 0; }
}
.mots { position: absolute; inset: 0; display: flex; flex-wrap: wrap; align-content: center; justify-content: center; gap: .1em .5em; padding: 22% 9% 8%; text-align: center; font-family: var(--f-titre); font-weight: var(--h2-poids); font-stretch: var(--h2-largeur); font-size: clamp(1rem, 1.35vw, 1.25rem); line-height: 1.2; }
.mots.froid { color: rgb(244 233 218 / .38); filter: none; }
.mots.chaud { color: var(--ambre); }

/* ---------- Mouvement apaisé ---------- */
@media (prefers-reduced-motion: reduce) {
  .porte-baie, .porte.ouverte .porte-baie { clip-path: var(--ouvert); transition: none; }
  .porte .nuit, .porte.ouverte .nuit { transform: translate(0, -2%) scale(1.05); transition: none; }
  .trouble, .particules { transition: opacity .5s ease; transform: none !important; }
  .porte.ouverte .trouble { opacity: .12; }
  .porte.ouverte .particules { opacity: 0; }
  .tampon { transform: rotate(-9deg); transition: opacity .4s ease .3s; }
  .porte.ouverte .tampon { transform: rotate(-9deg); }
  .porte.ouverte .vapeur, .porte.ouverte .braise { animation: none; }
  .porte.ouverte .vapeur { opacity: .5; transform: translateY(-40%) scale(1.2); }
  .porte[data-variante="temps"] .chaud { clip-path: none; opacity: 0; transition: opacity .6s ease; }
  .porte[data-variante="temps"].ouverte .chaud { opacity: 1; }
  .chaud { transition-duration: .5s; }
}

/* =====================================================================
   4. LES GALERIES — les couloirs de la maison
   ===================================================================== */
.galeries { padding: clamp(64px, 9vw, 128px) 0 clamp(40px, 6vw, 80px); background: var(--pierre-2); }
.galeries-tete { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 20px clamp(32px, 6vw, 96px); align-items: end; }
.galeries-tete .chapeau { max-width: 32rem; }
.transmission { margin-top: clamp(28px, 4vw, 44px); padding: 20px 0 0; border-top: 1px solid var(--trait-fort); max-width: 54rem; color: var(--encre-2); }
.transmission strong { color: var(--encre); font-weight: 700; }
.couloir { position: relative; margin-top: clamp(32px, 4vw, 52px); display: grid; grid-template-columns: minmax(0, .82fr) minmax(0, 1.4fr); gap: 24px clamp(28px, 4vw, 64px); align-items: center; padding: clamp(24px, 3vw, 40px); background: var(--pierre); border-radius: 4px; }
.couloir::before { /* le couloir est une bande de pierre, un peu plus claire */
  content: ""; position: absolute; inset: 0; border: 1px solid var(--trait); border-radius: inherit; pointer-events: none;
}
.couloir-dimension { font-family: var(--f-cartel); font-weight: var(--cartel-poids); font-size: var(--cartel-taille); text-transform: var(--surtitre-casse); letter-spacing: var(--surtitre-interlettre); color: var(--encre-3); }
.couloir h3 { font-size: clamp(2rem, 3.6vw, 3.1rem); margin-top: 6px; }
.couloir h3 a { text-decoration: none; }
.couloir h3 a::after { content: ""; position: absolute; inset: 0; z-index: 2; }
.couloir:has(h3 a:focus-visible)::before { border: 2px solid var(--encre); }
.couloir h3 a:focus-visible { outline: none; }
.couloir-question { margin-top: 12px; font-family: var(--f-titre); font-weight: var(--h2-poids); font-stretch: var(--h2-largeur); font-size: 1.2rem; line-height: 1.3; color: var(--encre-2); }
.couloir p.corps { margin-top: 12px; color: var(--encre-2); font-size: .975rem; }
.chiffres { display: flex; flex-wrap: wrap; gap: 6px 22px; margin: 18px 0 0; padding: 0; list-style: none; }
.chiffres li { display: grid; }
.chiffres b { font-family: var(--f-titre); font-weight: var(--h2-poids); font-stretch: var(--h2-largeur); font-size: clamp(1.8rem, 2.6vw, 2.4rem); line-height: 1; font-variant-numeric: lining-nums; }
.chiffres span { font-family: var(--f-cartel); font-size: var(--cartel-taille); text-transform: var(--cartel-casse); letter-spacing: var(--cartel-interlettre); color: var(--encre-3); }
.couloir .porte-entrer { margin-top: 18px; }
.couloir figure { margin: 0; position: relative; z-index: 3; }
.couloir figcaption { margin-top: 10px; }
.couloir figure > svg { display: block; width: 100%; height: auto; overflow: visible; }

/* Atlas : les terres, les terroirs teintés par matière (comme sur la carte),
   et l’onde qui part de chaque origine, d’ouest en est (src/lib/mini-carte.js) */
.figure-atlas .graticule { fill: none; stroke: var(--encre); stroke-opacity: .07; stroke-width: 1; vector-effect: non-scaling-stroke; }
.figure-atlas .terre { fill: var(--carte-terre, #E6DFD2); stroke: color-mix(in srgb, var(--encre) 22%, transparent); stroke-width: .6; vector-effect: non-scaling-stroke; }
.figure-atlas .m-raisin   { --m: var(--matiere-raisin); }
.figure-atlas .m-pomme    { --m: var(--matiere-pomme); }
.figure-atlas .m-fruits   { --m: var(--matiere-fruits); }
.figure-atlas .m-cereales { --m: var(--matiere-cereales); }
.figure-atlas .m-canne    { --m: var(--matiere-canne); }
.figure-atlas .m-agave    { --m: var(--matiere-agave); }
.figure-atlas .m-riz      { --m: var(--matiere-riz); }
.figure-atlas .m-plantes  { --m: var(--matiere-plantes); }
.figure-atlas .terroirs circle { fill: var(--m, var(--encre)); fill-opacity: .9; stroke: var(--pierre); stroke-width: .8; vector-effect: non-scaling-stroke; }
.figure-atlas .origine { fill: color-mix(in srgb, var(--m, var(--encre)) 16%, var(--pierre)); stroke: var(--m, var(--encre)); stroke-width: 1.8; vector-effect: non-scaling-stroke; }
.figure-atlas .onde { fill: none; stroke: var(--m, var(--encre)); stroke-width: 1.1; opacity: 0; transform-box: fill-box; transform-origin: center; vector-effect: non-scaling-stroke; }
.couloir.ouverte .figure-atlas .onde { animation: onde 2.8s var(--d) cubic-bezier(.2, .6, .35, 1) infinite; }
.couloir.ouverte .figure-atlas .onde-2 { animation-delay: calc(var(--d) + 1.1s); }
@keyframes onde { 0% { transform: scale(1); opacity: .65; } 100% { transform: scale(6.5); opacity: 0; } }

/* Frise : une goutte qui suit le temps ; la forme dit le degré de certitude */
.figure-frise .frise-ligne { stroke: var(--encre); stroke-opacity: .55; stroke-width: 1.4; }
.figure-frise .frise-borne { stroke: var(--encre); stroke-opacity: .22; }
.figure-frise .frise-ere { font-family: var(--f-cartel); font-size: 18px; fill: var(--encre-3); text-transform: var(--cartel-casse); letter-spacing: var(--cartel-interlettre); }
.figure-frise .jalon { color: var(--encre); transform-box: fill-box; transform-origin: center; }
.figure-frise .frise-goutte circle { fill: var(--fee-sombre); }
.figure-frise .frise-goutte { opacity: 0; }
.couloir.ouverte .figure-frise .frise-goutte { animation: goutte-temps 3.6s var(--liquide) infinite; }
.couloir.ouverte .figure-frise .jalon { animation: jalon 3.6s calc(var(--d) * 1.5) ease-out infinite; }
@keyframes goutte-temps { 0% { transform: translateX(0); opacity: 0; } 6% { opacity: 1; } 94% { opacity: 1; } 100% { transform: translateX(1000px); opacity: 0; } }
@keyframes jalon { 0%, 12%, 100% { transform: scale(1); } 5% { transform: scale(1.7); } }
.certitudes { display: flex; flex-wrap: wrap; gap: 4px 18px; margin: 14px 0 0; padding: 0; list-style: none; font-size: .875rem; color: var(--encre-2); }
.certitudes li { display: inline-flex; align-items: center; gap: 7px; }
.certitudes svg { width: 14px; height: 14px; color: var(--encre); }
.jalons-choisis { margin: 16px 0 0; padding: 0; list-style: none; display: grid; gap: 0; }
.jalons-choisis li { display: grid; grid-template-columns: 6.5rem 1fr auto; gap: 12px; align-items: baseline; padding: 8px 0; border-top: 1px solid var(--trait); font-size: .9375rem; }
.jalons-choisis .date { font-family: var(--f-cartel); font-size: var(--cartel-taille); letter-spacing: var(--cartel-interlettre); text-transform: var(--cartel-casse); color: var(--encre-3); }
.jalons-choisis .degre { display: inline-flex; align-items: center; gap: 6px; font-size: .8125rem; color: var(--encre-3); }
.jalons-choisis .degre svg { width: 12px; height: 12px; color: var(--encre); }

/* Parentés : la filiation, des matières aux catégories */
.figure-parentes .liens path { fill: none; stroke: var(--encre); stroke-width: 1.1; stroke-opacity: .2; vector-effect: non-scaling-stroke; }
.couloir.ouverte .figure-parentes .liens path { animation: filiation 2.6s var(--d) ease-in-out infinite; }
@keyframes filiation { 0%, 100% { stroke-opacity: .18; } 40% { stroke-opacity: .85; } }
.figure-parentes .noeuds circle { fill: var(--encre); }
.figure-parentes .noeuds circle.petit { fill: var(--pierre); stroke: var(--encre); stroke-width: 1.3; }
.figure-parentes text { fill: var(--encre-2); font-family: var(--f-texte); }
.figure-parentes .nom-matiere { font-size: 17px; font-weight: 600; fill: var(--encre); }
.figure-parentes .nom-categorie { font-size: 13px; }

@media (max-width: 900px) {
  .galeries-tete { grid-template-columns: 1fr; }
  .couloir { grid-template-columns: 1fr; }
}
@media (max-width: 640px) {
  .figure-parentes .nom-categorie { display: none; }
  .figure-parentes .nom-matiere { font-size: 30px; }
  .figure-frise .frise-ere { font-size: 24px; }
  .couloir figure > svg.figure-frise { overflow: hidden; }
  .figure-frise .frise-ere:nth-of-type(even) { display: none; }
  .jalons-choisis li { grid-template-columns: 5.2rem 1fr; }
  .jalons-choisis .degre { grid-column: 2; }
}
@media (prefers-reduced-motion: reduce) {
  .couloir.ouverte .figure-atlas .onde { animation: none; opacity: .4; transform: scale(2.4); transition: opacity .6s; }
  .couloir.ouverte .figure-frise .frise-goutte, .couloir.ouverte .figure-frise .jalon { animation: none; }
  .couloir.ouverte .figure-parentes .liens path { animation: none; stroke-opacity: .5; }
}

/* =====================================================================
   5. LE PROJET, puis le pied
   ===================================================================== */
.projet { padding: clamp(64px, 9vw, 128px) 0 clamp(48px, 6vw, 80px); }
.projet-grille { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); gap: 40px clamp(32px, 6vw, 96px); align-items: start; }
.projet .corps { margin-top: 18px; color: var(--encre-2); max-width: 38rem; }
.projet .accroche { margin-top: 14px; font-family: var(--f-titre); font-weight: var(--h2-poids); font-stretch: var(--h2-largeur); font-size: clamp(1.4rem, 2.2vw, 1.9rem); line-height: 1.2; }
.route h3, .soutien h3 { font-size: clamp(1.4rem, 2vw, 1.8rem); }
.jalons-route { position: relative; margin: 20px 0 0; padding: 0 0 0 28px; list-style: none; display: grid; gap: 20px; }
.jalons-route::before { /* un filet qui coule d’une étape à l’autre */
  content: ""; position: absolute; left: 6px; top: 8px; bottom: 8px; width: 1.5px; background: linear-gradient(var(--encre), rgb(29 26 21 / .15));
}
.jalons-route li { position: relative; }
.jalons-route li::before { content: ""; position: absolute; left: -27px; top: .45em; width: 11px; height: 14px; border-radius: 50% 50% 50% 50% / 62% 62% 40% 40%; background: var(--pierre); border: 1.5px solid var(--encre); }
.jalons-route li:first-child::before { background: var(--encre); }
.jalons-route .date { display: block; font-family: var(--f-cartel); font-weight: var(--cartel-poids); font-size: var(--cartel-taille); text-transform: var(--cartel-casse); letter-spacing: var(--cartel-interlettre); color: var(--encre-3); }
.jalons-route p { color: var(--encre-2); font-size: .975rem; }
.soutien { margin-top: clamp(48px, 6vw, 80px); padding-top: 28px; border-top: 1px solid var(--trait-fort); }
.soutien > p { margin-top: 10px; color: var(--encre-2); max-width: 40rem; }
.voies { margin: 24px 0 0; padding: 0; list-style: none; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 0; border-top: 1px solid var(--trait); }
.voies li { padding: 18px 20px 20px 0; display: grid; gap: 8px; align-content: start; }
.voies li + li { padding-left: 20px; border-left: 1px solid var(--trait); }
.voies h4 { font-size: 1.15rem; }
.voies p { font-size: .9375rem; color: var(--encre-2); }
.voies a { font-weight: 600; font-size: .9375rem; }
@media (max-width: 1020px) { .projet-grille { grid-template-columns: 1fr; } .voies { grid-template-columns: 1fr 1fr; } .voies li:nth-child(3) { padding-left: 0; border-left: 0; } .voies li:nth-child(n+3) { border-top: 1px solid var(--trait); } }
@media (max-width: 560px) { .voies { grid-template-columns: 1fr; } .voies li:nth-child(n) { padding-left: 0; border-left: 0; } .voies li + li { border-top: 1px solid var(--trait); } }


/* ---------- Fonder — la proposition faite aux maisons ----------
   La page se referme ici, et non sur l'appel du pied, que l'accueil
   retire (`appel: false`) : les deux diraient la même chose à trois
   cents pixels d'écart. Un mur de pierre plus claire, un filet de
   cuivre, quatre engagements numérotés comme des articles de charte
   (pas des cartes à icône), puis ce que le mécénat finance et deux
   portes de sortie. */
.route-note { margin-top: 4px; font-family: var(--f-cartel); font-weight: var(--cartel-poids); font-size: var(--cartel-taille); letter-spacing: var(--cartel-interlettre); color: var(--encre-3); }

.fonder { position: relative; padding: clamp(64px, 9vw, 128px) 0; background: var(--spili-fond-eleve); border-top: 1px solid var(--trait); }
.fonder::before { content: ""; position: absolute; left: var(--gouttiere); right: var(--gouttiere); top: -1px; height: 2px; background: linear-gradient(90deg, transparent, var(--cuivre-mat) 18%, var(--cuivre-clair) 50%, var(--cuivre-mat) 82%, transparent); }
.fonder-tete { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); gap: 20px clamp(32px, 6vw, 96px); align-items: end; }
.fonder-tete h2 { font-size: clamp(2rem, 4.2vw, 3.4rem); line-height: 1.05; max-width: 19ch; }
.fonder-tete .chapeau { color: var(--encre-2); max-width: 34rem; }

.engagements { margin: clamp(40px, 5vw, 64px) 0 0; padding: 0; list-style: none; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); border-top: 1px solid var(--trait-fort); counter-reset: none; }
.engagements li { position: relative; padding: 22px 22px 8px 0; display: grid; gap: 10px; align-content: start; }
.engagements li + li { padding-left: 22px; border-left: 1px solid var(--trait); }
.engagement-num { font-family: var(--f-titre); font-style: italic; font-weight: 400; font-size: 2.6rem; line-height: 1; color: var(--spili-accent); font-variant-numeric: oldstyle-nums; }
.engagements h3 { font-size: 1.25rem; line-height: 1.2; }
.engagements p { font-size: .975rem; color: var(--encre-2); }

.fonder-bas { margin-top: clamp(40px, 5vw, 64px); padding-top: 28px; border-top: 1px solid var(--trait); display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr); gap: 28px clamp(32px, 6vw, 96px); align-items: end; }
.fonder-finance-titre { font-family: var(--f-cartel); font-weight: var(--cartel-poids); font-size: var(--cartel-taille); letter-spacing: var(--cartel-interlettre); color: var(--encre-3); }
.fonder-finance { margin: 12px 0 0; padding: 0; list-style: none; display: flex; flex-wrap: wrap; gap: 8px 10px; }
.fonder-finance li { padding: 6px 14px; border: 1px solid var(--trait-fort); border-radius: 999px; font-size: .9375rem; color: var(--encre); background: var(--pierre); }
.fonder-actions { display: grid; gap: 14px; justify-items: start; }
.maison-page .bouton-cuivre { background: var(--chai); color: var(--nacre); box-shadow: inset 0 0 0 1px var(--cuivre-fonce), 0 10px 28px -14px rgb(110 53 23 / .7); }
.maison-page .bouton-cuivre:hover { background: #1c120d; }
.bouton-cuivre:hover svg { transform: translateX(3px); }

@media (max-width: 960px) {
  .fonder-tete, .fonder-bas { grid-template-columns: minmax(0, 1fr); align-items: start; }
  .engagements { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .engagements li:nth-child(3) { padding-left: 0; border-left: 0; }
  .engagements li:nth-child(n + 3) { border-top: 1px solid var(--trait); }
}
@media (max-width: 560px) {
  .engagements { grid-template-columns: minmax(0, 1fr); }
  .engagements li, .engagements li + li { padding: 20px 0 6px; border-left: 0; }
  .engagements li + li { border-top: 1px solid var(--trait); }
}

/* Japonais : les titres se coupent entre les groupes de mots, jamais au
   milieu (« ひ|もとく ») ; les navigateurs sans auto-phrase gardent la coupe usuelle. */
.maison-page :is(h1, h2, h3, h4):lang(ja) { word-break: auto-phrase; }
