/* =========================================================
   La boussole intérieure — direction artistique
   Fond encre, anneaux d'astrolabe, couleurs des 4 fonctions.
   ========================================================= */

/* polices de secours calibrées sur la largeur des vraies : pas de saut quand elles arrivent */
@font-face { font-family: "Fraunces Fallback"; src: local("Georgia"); size-adjust: 82%; }
@font-face { font-family: "Fraunces Fallback 2"; src: local("Times New Roman"), local("Noto Serif"); size-adjust: 90%; }
@font-face { font-family: "Instrument Sans Fallback"; src: local("Arial"), local("Helvetica"), local("Roboto"); size-adjust: 101.5%; }
:root {
  --bg: #0d0c0b;
  --bg2: #121110;
  --surface: #181614;
  --surface2: #201d1a;
  --line: rgba(236, 226, 208, .09);
  --line2: rgba(236, 226, 208, .18);
  --ink: #ece5d8;
  --muted: #a39a8b;
  --dim: #8c8477;

  --N: #a895dc;
  --S: #e2b65f;
  --T: #72a8cf;
  --F: #e5806a;

  --alpha: #93c48d;
  --beta: #e5806a;
  --gamma: #e2b65f;
  --delta: #72a8cf;

  --instinct: #e5806a;
  --coeur: #d993b5;
  --tete: #72a8cf;

  --r: 6px;
  --max: 1120px;
  --serif: "Fraunces", "Fraunces Fallback", "Fraunces Fallback 2", serif;
  --sans: "Instrument Sans", "Instrument Sans Fallback", system-ui, sans-serif;
  --ease: cubic-bezier(.22, .8, .2, 1);
  color-scheme: dark;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; background: var(--bg); }
body {
  margin: 0; min-height: 100vh;
  background:
    radial-gradient(1200px 700px at 80% -10%, rgba(168,149,220,.07), transparent 60%),
    radial-gradient(900px 600px at -10% 30%, rgba(114,168,207,.05), transparent 60%),
    var(--bg);
  color: var(--ink); font-family: var(--sans); font-size: 17px; line-height: 1.6;
  -webkit-font-smoothing: antialiased; overflow-x: hidden;
}
/* grain */
body::after {
  content: ""; position: fixed; inset: 0; pointer-events: none; z-index: 100; opacity: .07; transform: translateZ(0);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}
::selection { background: rgba(168,149,220,.35); }
a { color: inherit; }
svg { display: block; max-width: 100%; overflow: visible; }
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; padding: 0; }
p { margin: 0; }
h1, h2, h3 { font-family: var(--serif); font-weight: 300; line-height: 1.08; margin: 0; letter-spacing: -.015em; }
h1 { font-size: clamp(2.8rem, 7vw, 5.6rem); }
h2 { font-size: clamp(2rem, 4.4vw, 3.2rem); }
h3 { font-size: 1.35rem; font-weight: 400; }
em { font-style: italic; color: var(--muted); }

.wrap { max-width: var(--max); margin: 0 auto; padding: 0 24px; }
.label { font-size: .72rem; letter-spacing: .16em; text-transform: uppercase; color: var(--dim); }
.muted { color: var(--muted); }
.small { font-size: .88rem; }

/* couleurs par élément */
.fn { font-family: var(--serif); font-weight: 500; color: var(--c, var(--ink)); }
.el-N { --c: var(--N); } .el-S { --c: var(--S); } .el-T { --c: var(--T); } .el-F { --c: var(--F); }

/* lanterne qui suit le curseur */
.lantern {
  position: fixed; left: 0; top: 0; width: 840px; height: 840px; pointer-events: none; z-index: 0; border-radius: 50%;
  background: radial-gradient(closest-side, rgba(236,226,208,.05), transparent); will-change: transform; transform: translate3d(-9999px,0,0);
}
@media (pointer: coarse) { .lantern { display: none; } }
main, .nav, footer { position: relative; z-index: 1; }

/* progression */
.progress { position: fixed; top: 0; left: 0; height: 2px; width: 100%; z-index: 30; transform-origin: 0 50%; transform: scaleX(0); will-change: transform;
  background: linear-gradient(90deg, var(--N), var(--S), var(--T), var(--F)); }

/* ---------- Navigation ---------- */
.nav { position: sticky; top: 0; z-index: 20; background: linear-gradient(var(--bg) 40%, transparent); }
.nav .wrap { display: flex; align-items: center; justify-content: space-between; height: 68px; gap: 16px; }
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; font-family: var(--serif); font-size: 1.1rem; white-space: nowrap; }
.brand svg { width: 22px; height: 22px; transition: transform .8s var(--ease); }
.brand:hover svg { transform: rotate(90deg); }
.nav ol { list-style: none; display: flex; gap: 2px; margin: 0; padding: 0; }
.nav a.navlink { display: flex; gap: 6px; align-items: baseline; padding: 6px 12px; border-radius: 99px; text-decoration: none; color: var(--muted); font-size: .88rem; white-space: nowrap; transition: color .2s, background .2s; }
.nav a.navlink small { font-size: .68rem; color: var(--dim); }
.nav a.navlink:hover { color: var(--ink); }
.nav a.navlink[aria-current="page"] { color: var(--ink); background: var(--surface2); }
.map-btn { display: flex; align-items: center; gap: 8px; padding: 7px 14px; border: 1px solid var(--line2); border-radius: 99px; font-size: .85rem; color: var(--muted); transition: color .2s, border-color .2s; }
.map-btn:hover { color: var(--ink); border-color: var(--muted); }
@media (max-width: 900px) { .nav ol { display: none; } }

/* ---------- Carte (navigation libre) ---------- */
.map {
  position: fixed; inset: 0; z-index: 60; display: grid; place-items: center;
  background: rgba(10,9,8,.86); backdrop-filter: blur(14px);
  opacity: 0; pointer-events: none; transition: opacity .4s var(--ease);
}
.map.open { opacity: 1; pointer-events: auto; }
.map-inner { width: min(980px, 92vw); max-height: 88vh; overflow: auto; display: grid; grid-template-columns: 1.1fr 1fr; gap: 48px; align-items: center; padding: 8px; }
@media (max-width: 760px) { .map-inner { grid-template-columns: 1fr; gap: 24px; } .map-svg { max-width: 260px; margin: 0 auto; } }
.map-close { position: absolute; top: 20px; right: 24px; font-size: .85rem; color: var(--muted); padding: 8px 14px; border: 1px solid var(--line2); border-radius: 99px; }
.map-svg a text { transition: fill .2s; }
.map-svg a:hover circle.node { stroke: var(--ink); }
.map-svg circle.node { transition: stroke .2s, r .3s; }
.map-list h3 { font-size: 1.1rem; margin-bottom: 12px; color: var(--muted); }
.map-list ol { list-style: none; margin: 0 0 28px; padding: 0; display: grid; gap: 2px; counter-reset: m; }
.map-list li a { display: flex; gap: 14px; align-items: baseline; padding: 9px 0; text-decoration: none; border-bottom: 1px solid var(--line); transition: padding-left .3s var(--ease), color .2s; }
.map-list li a:hover { padding-left: 8px; }
.map-list li a span { font-family: var(--serif); color: var(--dim); font-size: .85rem; min-width: 22px; }
.map-list li a.here { color: var(--S); }

/* ---------- En-têtes ---------- */
.hero { min-height: 86vh; display: grid; align-items: center; position: relative; padding: 40px 0 60px; }
.hero-grid { display: grid; grid-template-columns: 1.1fr 1fr; gap: 40px; align-items: center; }
@media (max-width: 860px) { .hero-grid { grid-template-columns: 1fr; } .hero-art { order: -1; max-width: 340px; margin: 0 auto; } }
.hero .lead { margin-top: 26px; font-size: 1.18rem; color: var(--muted); max-width: 30em; }
.hero h1 em { color: var(--ink); font-weight: 300; }

.chapter-hero { padding: 90px 0 40px; position: relative; }
.chapter-hero .ghost {
  position: absolute; right: -10px; top: 10px; font-family: var(--serif); font-weight: 300;
  font-size: clamp(9rem, 26vw, 22rem); line-height: .8; color: transparent;
  -webkit-text-stroke: 1px var(--line2); pointer-events: none; user-select: none;
}
.chapter-hero .lead { margin-top: 22px; font-size: 1.15rem; color: var(--muted); max-width: 32em; }
.toc { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 36px; }
.toc a { font-size: .85rem; padding: 7px 14px; border-radius: 99px; border: 1px solid var(--line2); text-decoration: none; color: var(--muted); transition: color .2s var(--ease), background-color .2s var(--ease), border-color .2s var(--ease), box-shadow .2s var(--ease), opacity .2s var(--ease), transform .2s var(--ease); }
.toc a:hover { color: var(--ink); border-color: var(--muted); transform: translateY(-2px); }
.toc a b { font-family: var(--serif); font-weight: 400; color: var(--dim); margin-right: 6px; }

/* ---------- Sections ---------- */
.sec { padding: 110px 0 40px; scroll-margin-top: 40px; }
.sec-head { max-width: 40em; margin-bottom: 48px; }
.sec-head .label { display: block; margin-bottom: 16px; }
.sec-head p { margin-top: 16px; color: var(--muted); font-size: 1.05rem; }
.divider { height: 1px; background: linear-gradient(90deg, transparent, var(--line2), transparent); margin: 30px 0; }

/* ---------- Scrollytelling ---------- */
.scrolly { display: grid; grid-template-columns: minmax(0, .85fr) minmax(0, 1.15fr); gap: 56px; }
.scrolly .stage { grid-column: 2; grid-row: 1; position: sticky; top: calc(50vh - 270px); height: 540px; display: grid; place-items: center; }
.scrolly .steps { grid-column: 1; grid-row: 1; padding: 22vh 0 30vh; }
.step { min-height: 64vh; display: flex; flex-direction: column; justify-content: center; opacity: .18; transition: opacity .6s var(--ease), transform .6s var(--ease); transform: translateX(-6px); }
.step.active { opacity: 1; transform: none; }
.step .k { font-family: var(--serif); color: var(--dim); font-size: .95rem; margin-bottom: 10px; }
.step .cap { font-family: var(--serif); font-weight: 300; font-size: clamp(1.45rem, 2.4vw, 2rem); line-height: 1.25; }
.step .cap b { font-weight: 500; }
.step .sub { margin-top: 12px; color: var(--muted); max-width: 26em; }
@media (max-width: 860px) {
  .scrolly { grid-template-columns: 1fr; gap: 0; }
  .scrolly .stage { grid-column: 1; top: 64px; height: 50vh; z-index: 2; background: linear-gradient(var(--bg) 85%, transparent); }
  .scrolly .steps { grid-column: 1; grid-row: 2; padding: 4vh 0 30vh; }
  .step { min-height: 55vh; justify-content: flex-start; padding-top: 4vh; }
}

/* éléments de scène qui apparaissent par étape */
[data-from], [data-only] { opacity: 0; transition: opacity .7s var(--ease), transform .7s var(--ease); }
.on[data-from], .on[data-only] { opacity: 1; }
.draw { stroke-dasharray: 1; stroke-dashoffset: 1; transition: stroke-dashoffset 1.4s var(--ease), opacity .5s; }
.on.draw, .on .draw { stroke-dashoffset: 0; }
.pop { transform-box: fill-box; transform-origin: center; transform: scale(.4); }
.on.pop, .on .pop { transform: scale(1); }

/* ---------- Boussole (fonctions) ---------- */
.compass text { font-family: var(--serif); }
.compass .pt { cursor: default; transition: opacity .5s var(--ease); }
.compass.interactive .pt { cursor: pointer; }
.compass .pt circle.dot { transition: r .35s var(--ease), stroke-width .3s; }
.compass.interactive .pt:hover circle.dot { r: 21; }
.compass .pt.sel circle.halo { opacity: .9; }
.compass circle.halo { opacity: 0; transition: opacity .4s; }
.compass.focus .pt:not(.inStack) { opacity: .18; }
.compass .spin { transform-origin: 200px 200px; animation: spin 90s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.pulse { transform-origin: 200px 200px; animation: pulse 3.2s ease-in-out infinite; }
@keyframes pulse { 0%,100% { opacity: .15; transform: scale(.9); } 50% { opacity: .5; transform: scale(1.08); } }

/* panneau d'exploration */
.explore { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 48px; align-items: center; }
@media (max-width: 860px) { .explore { grid-template-columns: 1fr; } .explore svg { max-width: 420px; margin: 0 auto; } }
.panel { position: relative; padding: 32px; border-radius: var(--r); background: linear-gradient(160deg, var(--surface2), var(--surface)); border: 1px solid var(--line); overflow: hidden; }
.panel::before { content: ""; position: absolute; inset: -1px; border-radius: inherit; padding: 1px; background: linear-gradient(160deg, var(--c, var(--line2)), transparent 50%); -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0); -webkit-mask-composite: xor; mask-composite: exclude; opacity: .7; pointer-events: none; }
.panel .big { font-family: var(--serif); font-weight: 300; font-size: 4.2rem; line-height: .9; color: var(--c); }
.panel h3 { font-size: 1.7rem; margin-top: 10px; }
.panel .kw { color: var(--muted); margin-top: 8px; }
.panel dl { display: grid; grid-template-columns: 100px 1fr; gap: 10px 16px; margin: 24px 0 0; }
.panel dt { color: var(--dim); font-size: .82rem; text-transform: uppercase; letter-spacing: .08em; padding-top: 3px; }
.panel dd { margin: 0; }
.panel .cmp { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin-top: 22px; }
.panel .cmp div { padding: 14px; border-radius: 12px; background: rgba(0,0,0,.25); border: 1px solid var(--line); font-size: .92rem; }
.panel .cmp .label { display: block; margin-bottom: 6px; }
.swap { animation: swap .3s var(--ease); }
@keyframes swap { from { opacity: 0; transform: translate3d(0,10px,0); } }
.hint { font-size: .85rem; color: var(--dim); margin-top: 16px; display: flex; align-items: center; gap: 8px; }
.hint::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: var(--S); box-shadow: 0 0 10px var(--S); animation: blink 2s infinite; }
@keyframes blink { 50% { opacity: .3; } }

/* ---------- Puces / chips ---------- */
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip { padding: 7px 14px; border-radius: 99px; border: 1px solid var(--line2); font-size: .88rem; color: var(--muted); transition: color .2s var(--ease), background-color .2s var(--ease), border-color .2s var(--ease), box-shadow .2s var(--ease), opacity .2s var(--ease), transform .2s var(--ease); }
.chip:hover { color: var(--ink); border-color: var(--muted); }
.chip[aria-pressed="true"] { color: var(--bg); background: var(--c, var(--ink)); border-color: var(--c, var(--ink)); }

/* ---------- Pile de fonctions ---------- */
.stack { display: grid; gap: 9px; }
.stack .row { display: grid; grid-template-columns: 96px 1fr; gap: 12px; align-items: center; }
.stack .lbl { font-size: .78rem; color: var(--dim); text-transform: uppercase; letter-spacing: .08em; }
.stack .bar { height: 42px; border-radius: 10px; display: flex; align-items: center; gap: 10px; padding: 0 14px; width: 0;
  background: linear-gradient(90deg, color-mix(in srgb, var(--c) 85%, transparent), color-mix(in srgb, var(--c) 35%, transparent));
  color: #0d0c0b; font-family: var(--serif); font-size: 1.15rem; font-weight: 500; overflow: hidden; white-space: nowrap;
  transition: width .9s var(--ease); box-shadow: 0 0 24px -8px var(--c); }
.stack .bar small { font-family: var(--sans); font-weight: 500; font-size: .78rem; opacity: .75; }

/* ---------- MBTI : lettres ---------- */
.slots { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; width: 100%; }
.slot { text-align: center; padding: 22px 6px 18px; border-radius: var(--r); border: 1px solid var(--line); background: var(--surface); transition: color .35s var(--ease), background-color .35s var(--ease), border-color .35s var(--ease), box-shadow .35s var(--ease), opacity .35s var(--ease), transform .35s var(--ease); position: relative; }
.slot .pair { display: flex; justify-content: center; gap: 4px; font-family: var(--serif); font-weight: 300; font-size: clamp(2.2rem, 5vw, 3.6rem); line-height: 1; height: 1.1em; }
.slot .pair span { transition: color .35s var(--ease), background-color .35s var(--ease), border-color .35s var(--ease), box-shadow .35s var(--ease), opacity .35s var(--ease), transform .35s var(--ease); color: var(--dim); }
.slot .pair span.pick { color: var(--ink); }
.slot .q { margin-top: 12px; font-size: .72rem; letter-spacing: .14em; text-transform: uppercase; color: var(--dim); }
.slot .d { margin-top: 10px; font-size: .82rem; color: var(--muted); min-height: 3.2em; line-height: 1.4; transition: opacity .5s; }
.slot.hidden { opacity: .15; }
.slot.hidden .pair span { opacity: 0; }
.slot.cur { border-color: var(--line2); background: var(--surface2); transform: translateY(-6px); box-shadow: 0 18px 40px -20px rgba(0,0,0,.8); }
.slot.done .pair span:not(.pick) { opacity: 0; width: 0; }
.slot.done .d { opacity: 0; }
.stage-cap { text-align: center; margin-top: 26px; font-family: var(--serif); font-size: 1.4rem; min-height: 1.6em; }

/* bascules interactives */
.toggles { display: grid; gap: 10px; }
.tg { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 14px; }
.tg .lab { font-size: .9rem; color: var(--muted); transition: color .3s; }
.tg .lab:last-child { text-align: right; }
.tg .lab.on { color: var(--ink); }
.tg .lab b { font-family: var(--serif); font-weight: 400; font-size: 1.5rem; margin: 0 8px; vertical-align: -3px; }
.switch { width: 74px; height: 36px; border-radius: 99px; background: var(--surface2); border: 1px solid var(--line2); position: relative; }
.switch::after { content: ""; position: absolute; top: 4px; left: 4px; width: 26px; height: 26px; border-radius: 50%; background: var(--ink); transition: transform .45s var(--ease); }
.switch[aria-checked="true"]::after { transform: translateX(38px); }
.build { display: grid; grid-template-columns: 1fr 1fr; gap: 48px; align-items: center; }
@media (max-width: 860px) { .build { grid-template-columns: 1fr; } }
.code-big { font-family: var(--serif); font-weight: 300; font-size: clamp(3.4rem, 8vw, 5.6rem); line-height: 1; letter-spacing: .04em; }
.code-big span { display: inline-block; transition: transform .5s var(--ease), color .5s; }
.code-big span.flipped { animation: flipIn .55s var(--ease); }
@keyframes flipIn { from { transform: rotateX(90deg); opacity: 0; } }

/* dérivation */
.derive { position: relative; width: 100%; max-width: 520px; height: 440px; }
.derive .lt { position: absolute; top: 0; width: 25%; text-align: center; font-family: var(--serif); font-weight: 300; font-size: 3.4rem; color: var(--dim); transition: color .5s, text-shadow .5s; }
.derive .lt.hl { color: var(--ink); text-shadow: 0 0 24px rgba(236,226,208,.4); }
.derive .sl { position: absolute; top: 330px; width: 22%; height: 64px; margin-left: 1.5%; border: 1px dashed var(--line2); border-radius: 12px; }
.derive .sl span { position: absolute; top: 72px; left: 0; right: 0; text-align: center; font-size: .7rem; letter-spacing: .12em; text-transform: uppercase; color: var(--dim); }
.derive .ch { position: absolute; width: 22%; height: 64px; margin-left: 1.5%; border-radius: 12px; display: grid; place-items: center;
  font-family: var(--serif); font-size: 1.7rem; color: #0d0c0b; background: var(--c); box-shadow: 0 0 30px -6px var(--c);
  transition: left .9s var(--ease), top .9s var(--ease), opacity .5s, transform .5s var(--ease); opacity: 0; transform: scale(.6); }
.derive .ch.on { opacity: 1; transform: none; }
.derive .ar { position: absolute; left: 0; right: 0; top: 76px; text-align: center; font-size: .82rem; color: var(--muted); transition: opacity .4s; }

/* grille des 16 types */
.types16 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; }
@media (max-width: 600px) { .types16 { grid-template-columns: repeat(2, 1fr); } }
.tile { position: relative; text-align: left; padding: 18px 16px; border-radius: 14px; background: var(--surface); border: 1px solid var(--line); overflow: hidden; transition: transform .35s var(--ease), border-color .3s, opacity .4s, background .3s; }
.tile::after { content: ""; position: absolute; width: 140px; height: 140px; right: -60px; top: -60px; border-radius: 50%; background: var(--c); opacity: .08; filter: blur(18px); transition: opacity .3s; }
.tile:hover { transform: translateY(-3px); border-color: var(--line2); }
.tile:hover::after { opacity: .3; }
.tile b { display: block; font-family: var(--serif); font-weight: 400; font-size: 1.5rem; letter-spacing: .04em; }
.tile span { font-size: .82rem; color: var(--muted); }
.tile i { position: absolute; left: 16px; bottom: 0; width: 26px; height: 2px; background: var(--c); }
.tile.dim { opacity: .2; }
.legend { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 22px; }

/* tiroir latéral */
.drawer-bg { position: fixed; inset: 0; z-index: 50; background: rgba(0,0,0,.5); opacity: 0; pointer-events: none; transition: opacity .4s; }
.drawer { position: fixed; top: 0; right: 0; bottom: 0; z-index: 51; width: min(460px, 100%); background: var(--bg2); border-left: 1px solid var(--line2); padding: 34px 30px; overflow-y: auto; transform: translateX(102%); transition: transform .55s var(--ease); }
.drawer.open { transform: none; }
.drawer-bg.open { opacity: 1; pointer-events: auto; }
.drawer .close { position: absolute; right: 22px; top: 22px; font-size: .82rem; padding: 6px 12px; border-radius: 99px; border: 1px solid var(--line2); color: var(--muted); }
.drawer .code-big { font-size: 4rem; margin-top: 24px; }
.drawer .tag { display: inline-block; margin-top: 4px; padding: 4px 10px; border-radius: 99px; font-size: .72rem; letter-spacing: .1em; text-transform: uppercase; color: var(--c); border: 1px solid color-mix(in srgb, var(--c) 50%, transparent); }
.drawer .stack { margin-top: 30px; }
.drawer .link { display: inline-flex; gap: 8px; margin-top: 28px; padding: 10px 16px; border-radius: 99px; border: 1px solid var(--line2); text-decoration: none; font-size: .9rem; transition: border-color .2s; }
.drawer .link:hover { border-color: var(--ink); }

/* tempéraments */
.temps { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; }
@media (max-width: 860px) { .temps { grid-template-columns: repeat(2, 1fr); } }
.temp { padding: 22px; border-radius: var(--r); background: var(--surface); border: 1px solid var(--line); transition: transform .35s var(--ease), border-color .3s; text-align: left; }
.temp:hover, .temp[aria-pressed="true"] { transform: translateY(-4px); border-color: var(--c); }
.temp .l { font-family: var(--serif); font-size: 2.2rem; font-weight: 300; color: var(--c); line-height: 1; }
.temp h3 { margin-top: 10px; font-size: 1.15rem; }
.temp p { color: var(--muted); font-size: .9rem; margin-top: 4px; }

/* recul : 3 idées */
.trio { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1px; background: var(--line); border-radius: var(--r); overflow: hidden; border: 1px solid var(--line); }
@media (max-width: 760px) { .trio { grid-template-columns: 1fr; } }
.trio div { background: var(--bg2); padding: 26px; }
.trio .n { font-family: var(--serif); font-size: 2rem; color: var(--dim); font-weight: 300; }
.trio h3 { font-size: 1.1rem; margin-top: 6px; }
.trio p { color: var(--muted); font-size: .9rem; margin-top: 6px; }

/* ---------- Socionique ---------- */
.morph { position: relative; width: 100%; height: 360px; display: grid; place-items: center; }
.morph .layer { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; transform: translateY(14px) scale(.98); filter: blur(6px); }
.morph .layer.on { transform: none; filter: none; }
.morph .huge { font-family: var(--serif); font-weight: 300; font-size: clamp(4rem, 10vw, 7rem); line-height: 1; letter-spacing: .04em; }
.morph .huge .x { color: var(--F); display: inline-block; }
.morph .on .huge .x { animation: flipIn .8s .3s var(--ease) both; }
.morph .under { margin-top: 18px; color: var(--muted); }
.morph .abbr { display: flex; gap: 22px; }
.morph .abbr div { display: flex; flex-direction: column; align-items: center; }
.morph .abbr b { font-family: var(--serif); font-weight: 300; font-size: clamp(4rem, 10vw, 7rem); line-height: 1; }
.morph .abbr span { font-size: .75rem; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); margin-top: 8px; }

.conv { display: flex; align-items: center; justify-content: center; gap: 22px; flex-wrap: wrap; padding: 32px; border-radius: var(--r); background: var(--surface); border: 1px solid var(--line); margin-top: 16px; }
.conv .box { text-align: center; }
.conv .v { font-family: var(--serif); font-weight: 300; font-size: 2.4rem; line-height: 1.2; }
.conv .v em { font-style: normal; color: var(--F); }
.conv .eq { color: var(--dim); font-family: var(--serif); font-size: 1.5rem; }

.wheel-wrap { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, .9fr); gap: 48px; align-items: center; }
@media (max-width: 860px) { .wheel-wrap { grid-template-columns: 1fr; } .wheel-wrap svg { max-width: 440px; margin: 0 auto; } }
.wheel text { font-family: var(--serif); pointer-events: none; }
.wheel .q { cursor: pointer; transition: opacity .4s; }
.wheel .q path { transition: fill-opacity .4s; }
.wheel .q:hover path { fill-opacity: .22; }
.wheel .tn { cursor: pointer; }
.wheel .tn circle { transition: r .3s var(--ease), fill .3s; }
.wheel .tn:hover circle { r: 21; }

.modelA { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; position: relative; }
.ringline { grid-column: 1 / -1; display: flex; align-items: center; gap: 12px; font-size: .7rem; letter-spacing: .14em; text-transform: uppercase; color: var(--dim); }
.ringline::before, .ringline::after { content: ""; flex: 1; height: 1px; background: var(--line2); }
.blk { border-radius: 14px; padding: 12px; border: 1px solid var(--line); background: var(--surface); }
.blk.val { background: linear-gradient(160deg, var(--surface2), var(--surface)); border-color: var(--line2); }
.blk-h { display: flex; justify-content: space-between; font-size: .7rem; letter-spacing: .1em; text-transform: uppercase; color: var(--dim); margin-bottom: 8px; }
.blk-h i { font-style: normal; color: var(--S); }
.blk .cells { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.cell { text-align: left; border-radius: 10px; padding: 10px 12px; background: rgba(0,0,0,.25); border: 1px solid transparent; transition: border-color .25s, transform .3s var(--ease); }
.cell:hover, .cell.on { border-color: var(--c); }
.cell.on { transform: translateY(-2px); box-shadow: 0 0 26px -10px var(--c); }
.cell .p { font-size: .7rem; color: var(--dim); }
.cell .f { font-family: var(--serif); font-size: 1.8rem; line-height: 1.1; color: var(--c); }
.cell .f.flipped { animation: flipIn .5s var(--ease); }
.cell .nm { font-size: .76rem; color: var(--muted); line-height: 1.3; }
@media (max-width: 520px) { .modelA { grid-template-columns: 1fr; } }

.rel-wrap { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, .85fr); gap: 40px; align-items: center; }
@media (max-width: 860px) { .rel-wrap { grid-template-columns: 1fr; } .rel-wrap svg { max-width: 480px; margin: 0 auto; } }
.radial text { font-family: var(--serif); pointer-events: none; }
.radial .nd { cursor: pointer; transition: opacity .4s; }
.radial .nd circle { transition: r .3s var(--ease); }
.radial .nd:hover circle, .radial .nd.sel circle { r: 22; }
.radial .ln { transition: opacity .4s, stroke-width .3s; }
.radial .nd.faded, .radial .ln.faded { opacity: .1; }
.radial .ln.sel { stroke-width: 3; }

.schools { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1px; background: var(--line); border: 1px solid var(--line); border-radius: var(--r); overflow: hidden; }
@media (max-width: 800px) { .schools { grid-template-columns: repeat(2, 1fr); } }
.schools div { background: var(--bg2); padding: 22px; }
.schools b { font-family: var(--serif); font-weight: 400; font-size: 1.2rem; }
.schools p { color: var(--muted); font-size: .86rem; margin-top: 6px; }

/* ---------- Ennéagramme ---------- */
.ennea text { font-family: var(--serif); pointer-events: none; }
.ennea .pt { cursor: pointer; }
.ennea .pt circle { transition: r .35s var(--ease), fill .35s, stroke .35s; }
.ennea .pt:hover circle.c { r: 22; }

.orbs { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 48px; align-items: center; }
@media (max-width: 860px) { .orbs { grid-template-columns: 1fr; } .orbs svg { max-width: 380px; margin: 0 auto; } }
.orb circle { transition: r .8s var(--ease), fill-opacity .6s, stroke-dasharray .6s; }
.orb text { font-family: var(--serif); transition: font-size .6s var(--ease), opacity .6s; }
.orb-desc { display: grid; gap: 14px; margin-top: 24px; }
.orb-desc div { display: grid; grid-template-columns: 44px 1fr; gap: 14px; align-items: baseline; transition: opacity .5s; }
.orb-desc b { font-family: var(--serif); font-weight: 400; font-size: 1.3rem; }
.orb-desc span { color: var(--muted); font-size: .92rem; }
.orb-desc .rank { display: block; font-size: .7rem; letter-spacing: .12em; text-transform: uppercase; color: var(--dim); }

.matrix { display: grid; grid-template-columns: 54px repeat(3, 1fr); gap: 4px; }
.matrix .h { font-size: .72rem; letter-spacing: .12em; text-transform: uppercase; color: var(--dim); padding: 8px 12px; }
.matrix .n { font-family: var(--serif); font-size: 1.4rem; color: var(--c); display: grid; place-items: center; border-radius: 10px; transition: background .3s; }
.matrix .m { padding: 12px 14px; border-radius: 10px; background: var(--surface); border: 1px solid var(--line); font-size: .92rem; transition: background .3s, border-color .3s, opacity .3s, color .3s; color: var(--muted); }
.matrix.hov .m { opacity: .35; }
.matrix.hov .m.hl { opacity: 1; color: var(--ink); border-color: var(--line2); background: var(--surface2); }
.matrix .m.x { opacity: 1 !important; border-color: var(--c) !important; color: var(--ink); box-shadow: 0 0 22px -10px var(--c); }
@media (max-width: 600px) { .matrix { grid-template-columns: 34px repeat(3, 1fr); } .matrix .m { padding: 9px 8px; font-size: .8rem; } .matrix .h { padding: 6px 4px; font-size: .62rem; } }

.tri { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
@media (max-width: 700px) { .tri { grid-template-columns: 1fr; } }
.tri .col { padding: 20px; border-radius: var(--r); background: var(--surface); border: 1px solid var(--line); }
.tri .col .label { display: block; margin-bottom: 14px; color: var(--c); }
.tri .nums { display: flex; gap: 10px; }
.tri .nb { width: 58px; height: 58px; border-radius: 50%; border: 1px solid var(--line2); font-family: var(--serif); font-size: 1.6rem; display: grid; place-items: center; transition: color .35s var(--ease), background-color .35s var(--ease), border-color .35s var(--ease), box-shadow .35s var(--ease), opacity .35s var(--ease), transform .35s var(--ease); }
.tri .nb:hover { border-color: var(--c); }
.tri .nb[aria-pressed="true"] { background: var(--c); border-color: var(--c); color: #0d0c0b; box-shadow: 0 0 28px -6px var(--c); }
.tri .nm { margin-top: 12px; font-size: .85rem; color: var(--muted); min-height: 1.4em; }
.tri-out { margin-top: 14px; padding: 28px; border-radius: var(--r); border: 1px solid var(--line2); display: flex; gap: 28px; flex-wrap: wrap; align-items: center; background: radial-gradient(500px 200px at 0% 50%, rgba(226,182,95,.08), transparent), var(--bg2); }
.tri-out .code-big span { display: inline-block; }
.tri-out p { color: var(--muted); max-width: 30em; }

.groups { display: grid; grid-template-columns: minmax(0, .8fr) minmax(0, 1.2fr); gap: 48px; align-items: center; }
@media (max-width: 860px) { .groups { grid-template-columns: 1fr; } .groups svg { max-width: 300px; margin: 0 auto; } }
.groups .set { margin-top: 20px; }
.groups .set .label { display: block; margin-bottom: 10px; }

/* ---------- Accueil ---------- */
.journey { position: relative; display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; }
@media (max-width: 860px) { .journey { grid-template-columns: 1fr 1fr; } }
@media (max-width: 520px) { .journey { grid-template-columns: 1fr; } }
.stop { position: relative; display: block; padding: 26px 22px 24px; border-radius: var(--r); background: var(--surface); border: 1px solid var(--line); text-decoration: none; overflow: hidden; transition: transform .45s var(--ease), border-color .3s; }
.stop:hover { transform: translateY(-6px); border-color: var(--line2); }
.stop .n { font-family: var(--serif); font-weight: 300; font-size: 3rem; line-height: 1; color: transparent; -webkit-text-stroke: 1px var(--c); }
.stop h3 { margin-top: 18px; }
.stop p { color: var(--muted); font-size: .9rem; margin-top: 6px; }
.stop svg { position: absolute; right: -24px; top: -24px; width: 120px; opacity: .25; transition: opacity .4s, transform 1s var(--ease); }
.stop:hover svg { opacity: .7; transform: rotate(30deg); }
.stop .go { margin-top: 22px; font-size: .85rem; color: var(--c); display: inline-flex; gap: 6px; }
.stop .go span { transition: transform .3s var(--ease); }
.stop:hover .go span { transform: translateX(4px); }

.two { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
@media (max-width: 700px) { .two { grid-template-columns: 1fr; } }
.two > div { padding: 30px; border-radius: var(--r); background: var(--surface); border: 1px solid var(--line); }
.two .eg { margin-top: 26px; font-family: var(--serif); font-weight: 300; font-size: 2rem; }

/* ---------- Suite / pied ---------- */
.next { display: flex; justify-content: space-between; align-items: center; gap: 16px; margin: 110px 0 60px; padding: 40px; border-radius: 20px; text-decoration: none; position: relative; overflow: hidden; border: 1px solid var(--line2); background: var(--bg2); transition: border-color .3s; }
.next::before { content: ""; position: absolute; inset: 0; background: radial-gradient(500px 220px at var(--gx, 80%) 50%, rgba(226,182,95,.12), transparent 70%); transition: opacity .4s; }
.next:hover { border-color: var(--muted); }
.next > * { position: relative; }
.next h3 { font-size: clamp(1.6rem, 3vw, 2.4rem); font-weight: 300; margin-top: 6px; }
.next .arrow { font-family: var(--serif); font-size: 2.4rem; transition: transform .4s var(--ease); }
.next:hover .arrow { transform: translateX(8px); }
footer { border-top: 1px solid var(--line); padding: 30px 0 50px; color: var(--dim); font-size: .85rem; }

/* ---------- Glossaire ---------- */
.gl { border-bottom: 1px dotted var(--muted); cursor: help; }
.gl-pop { position: fixed; z-index: 70; max-width: 280px; padding: 14px 16px; border-radius: 12px; background: var(--surface2); border: 1px solid var(--line2); box-shadow: 0 20px 50px -20px #000; font-size: .88rem; color: var(--muted); opacity: 0; transform: translateY(6px); pointer-events: none; transition: opacity .25s, transform .25s var(--ease); }
.gl-pop.on { opacity: 1; transform: none; }
.gl-pop b { display: block; font-family: var(--serif); font-weight: 400; color: var(--ink); font-size: 1.05rem; margin-bottom: 4px; }

/* ---------- Ressources ---------- */
.res-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 56px 48px; }
@media (max-width: 760px) { .res-grid { grid-template-columns: 1fr; } }
.res h3 { display: flex; gap: 12px; align-items: center; margin-bottom: 14px; }
.res h3 i { width: 10px; height: 10px; border-radius: 50%; background: var(--c); box-shadow: 0 0 12px var(--c); }
.res ul { list-style: none; margin: 0; padding: 0; }
.res li a { display: flex; justify-content: space-between; gap: 14px; padding: 13px 0; border-bottom: 1px solid var(--line); text-decoration: none; transition: padding-left .3s var(--ease), color .2s; }
.res li a:hover { padding-left: 8px; color: var(--c); }
.res li a span:last-child { color: var(--dim); font-size: .82rem; white-space: nowrap; }

/* ---------- Apparition ---------- */
.reveal { opacity: 0; transform: translate3d(0,12px,0); transition: opacity .5s var(--ease), transform .6s var(--ease); }
.reveal.in { opacity: 1; transform: none; filter: none; }
.stagger > * { opacity: 0; transform: translateY(16px); transition: opacity .7s var(--ease), transform .7s var(--ease); }
.stagger.in > * { opacity: 1; transform: none; }
.stagger.in > *:nth-child(2) { transition-delay: .08s; } .stagger.in > *:nth-child(3) { transition-delay: .16s; }
.stagger.in > *:nth-child(4) { transition-delay: .24s; } .stagger.in > *:nth-child(5) { transition-delay: .32s; }
.stagger.in > *:nth-child(n+6) { transition-delay: .4s; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition-property: opacity, color, background-color, border-color !important; transition-duration: .2s !important; }
  html { scroll-behavior: auto; }
  .reveal, .stagger > * { opacity: 1; transform: none; filter: none; }
}
@media (max-width: 860px) {
  .derive { transform: scale(.74); transform-origin: top center; margin-bottom: -110px; }
  .slot .d { font-size: .72rem; }
  .slot { padding: 16px 4px 14px; }
}

/* =========================================================
   v3 — colonnes, modèle A expliqué, jeux, progression
   ========================================================= */
.sec { scroll-margin-top: 72px; }
.map { z-index: 90; }

/* 16 types rangés sous leur tempérament */
.tcols { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; }
@media (max-width: 900px) { .tcols { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 480px) { .tcols { grid-template-columns: 1fr; } }
.tcol { display: grid; gap: 8px; align-content: start; padding: 8px; border-radius: 22px; border: 1px solid transparent; transition: border-color .4s, background .4s, opacity .4s; }
.tcol:hover { border-color: color-mix(in srgb, var(--c) 45%, transparent); background: color-mix(in srgb, var(--c) 6%, transparent); }
@media (hover: hover) { .tcols:hover .tcol:not(:hover) { opacity: .4; } }
.tcol .head { padding: 18px 16px; border-radius: 16px; background: linear-gradient(160deg, color-mix(in srgb, var(--c) 16%, var(--surface)), var(--surface)); border: 1px solid color-mix(in srgb, var(--c) 35%, transparent); }
.tcol .head .l { font-family: var(--serif); font-weight: 300; font-size: 2.4rem; color: var(--c); line-height: 1; }
.tcol .head h3 { margin-top: 8px; font-size: 1.1rem; }
.tcol .head p { color: var(--muted); font-size: .85rem; margin-top: 4px; }
.tcol .tile { padding: 14px 16px; }
.tcol .tile b { font-size: 1.3rem; }

/* scène du modèle A */
.ma { width: 100%; max-width: 540px; display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.ma .ringline { transition: color .5s; }
.ma .ringline.hl { color: var(--ink); }
.ma .ringline.hl::before, .ma .ringline.hl::after { background: var(--ink); }
.ma .blk { transition: opacity .6s var(--ease), border-color .6s, box-shadow .6s, transform .6s var(--ease); position: relative; }
.ma.dim .blk:not(.hl) { opacity: .22; }
.ma .blk.hl { border-color: var(--ink); transform: scale(1.03); z-index: 1; }
.ma .bd { font-size: .78rem; color: var(--muted); margin: -2px 0 10px; min-height: 2.5em; line-height: 1.35; }
.ma .cell { cursor: default; transition: border-color .5s, opacity .5s; }
.ma .sw-tag { display: inline-block; font-size: .6rem; letter-spacing: .12em; text-transform: uppercase; padding: 2px 6px; border-radius: 99px; margin-top: 6px; }
.ma .strong .sw-tag { background: var(--ink); color: var(--bg); }
.ma .weak .sw-tag { border: 1px dashed var(--muted); color: var(--muted); }
.ma.sw .cell.strong { border: 1px solid var(--c); box-shadow: 0 0 22px -10px var(--c); }
.ma.sw .cell.weak { border: 1px dashed var(--line2); opacity: .55; }
.ma.val .blk.v { border-color: var(--S); box-shadow: 0 0 46px -14px var(--S); transform: scale(1.03); }
.ma.val .blk:not(.v) { opacity: .3; }
.ma .vtag { position: absolute; top: -10px; right: 12px; font-size: .62rem; letter-spacing: .12em; text-transform: uppercase; background: var(--S); color: var(--bg); padding: 3px 8px; border-radius: 99px; }
.ma .dual { grid-column: 1 / -1; display: flex; align-items: center; gap: 14px; flex-wrap: wrap; padding: 12px 16px; border-radius: 14px; border: 1px solid var(--alpha); background: color-mix(in srgb, var(--alpha) 10%, var(--surface)); }
.ma .dual b { font-family: var(--serif); font-weight: 400; font-size: 1.4rem; color: var(--alpha); }
.ma .dual .fn { font-size: 1.3rem; }
.blk-d { font-size: .74rem; color: var(--muted); margin: -2px 0 8px; line-height: 1.35; }

/* jeux */
.game { position: relative; overflow: hidden; padding: 34px; border-radius: 26px; border: 1px solid var(--line2);
  background: radial-gradient(700px 300px at 50% -10%, rgba(168,149,220,.10), transparent 70%), var(--bg2); }
.game::before { content: ""; position: absolute; inset: 0; pointer-events: none; background: repeating-radial-gradient(circle at 50% 120%, transparent 0 38px, rgba(236,226,208,.025) 38px 39px); }
.game > * { position: relative; }
@media (max-width: 600px) { .game { padding: 22px 16px; } }
.game-top { display: flex; justify-content: space-between; align-items: center; gap: 16px; flex-wrap: wrap; margin-bottom: 26px; }
.game-top .label { color: var(--S); }
.dots { display: flex; gap: 6px; }
.dots i { width: 10px; height: 10px; border-radius: 50%; border: 1px solid var(--line2); transition: color .35s var(--ease), background-color .35s var(--ease), border-color .35s var(--ease), box-shadow .35s var(--ease), opacity .35s var(--ease), transform .35s var(--ease); }
.dots i.cur { border-color: var(--ink); transform: scale(1.3); }
.dots i.ok { background: var(--alpha); border-color: var(--alpha); box-shadow: 0 0 10px var(--alpha); }
.dots i.ko { background: var(--F); border-color: var(--F); }
.score { font-family: var(--serif); font-size: 1.4rem; }
.score small { color: var(--dim); font-size: .9rem; }
.quote { font-family: var(--serif); font-style: italic; font-weight: 300; font-size: clamp(1.5rem, 3vw, 2.2rem); line-height: 1.25; min-height: 2.6em; display: flex; align-items: center; }
.quote.center { justify-content: center; text-align: center; }
.feedback { min-height: 3em; margin-top: 14px; color: var(--muted); }
.feedback b { color: var(--ink); font-weight: 500; }
.feedback .ok { color: var(--alpha); } .feedback .ko { color: var(--F); }
.quiz-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 40px; align-items: center; }
@media (max-width: 860px) { .quiz-grid { grid-template-columns: 1fr; } .quiz-grid svg { max-width: 340px; margin: 0 auto; } }
.shake { animation: shake .45s; }
@keyframes shake { 20% { transform: translateX(-7px); } 40% { transform: translateX(7px); } 60% { transform: translateX(-4px); } 80% { transform: translateX(3px); } }
.spark { position: fixed; width: 7px; height: 7px; border-radius: 50%; pointer-events: none; z-index: 85; }
.btn { display: inline-flex; align-items: center; gap: 8px; padding: 11px 20px; border-radius: 99px; background: var(--ink); color: var(--bg); font-size: .92rem; font-weight: 500; text-decoration: none; transition: transform .3s var(--ease), box-shadow .3s; }
.btn:hover { transform: translateY(-2px); box-shadow: 0 10px 30px -10px rgba(236,226,208,.5); }
.btn.ghost { background: transparent; color: var(--ink); border: 1px solid var(--line2); }
.end { text-align: center; padding: 10px 0; }
.end .code-big { font-size: clamp(3.4rem, 9vw, 6rem); }
.end p { color: var(--muted); margin-top: 10px; }
.end .chips { justify-content: center; margin-top: 24px; gap: 10px; }

/* ce ou cela */
.codeslots { display: flex; gap: 8px; justify-content: center; margin-bottom: 26px; }
.codeslots span { width: 56px; height: 66px; border-radius: 12px; border: 1px dashed var(--line2); display: grid; place-items: center; font-family: var(--serif); font-size: 2.1rem; font-weight: 300; transition: color .35s var(--ease), background-color .35s var(--ease), border-color .35s var(--ease), box-shadow .35s var(--ease), opacity .35s var(--ease), transform .35s var(--ease); }
.codeslots span.f { border-style: solid; border-color: var(--ink); background: var(--surface2); animation: flipIn .55s var(--ease); }
.codeslots span.cur { border-color: var(--S); box-shadow: 0 0 20px -6px var(--S); }
.duel-q { text-align: center; font-family: var(--serif); font-size: 1.5rem; font-weight: 300; margin-bottom: 20px; }
.duel { display: grid; grid-template-columns: 1fr auto 1fr; gap: 18px; align-items: stretch; }
.duel .or { align-self: center; font-family: var(--serif); font-style: italic; color: var(--dim); }
@media (max-width: 600px) { .duel { grid-template-columns: 1fr; gap: 10px; } .duel .or { display: none; } .pick { padding: 16px; } .pick svg { width: 44px; height: 44px; } }
.pick { padding: 26px 20px; border-radius: 22px; border: 1px solid var(--line2); background: var(--surface); text-align: center; transition: transform .45s var(--ease), border-color .3s, background .3s, opacity .4s; }
.pick:hover { transform: translateY(-6px); border-color: var(--c); }
.pick svg { width: 64px; height: 64px; margin: 0 auto 14px; stroke: var(--c); fill: none; stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; }
.pick b { display: block; font-family: var(--serif); font-size: 2.2rem; font-weight: 300; color: var(--c); line-height: 1; }
.pick span { display: block; color: var(--muted); margin-top: 10px; }
.pick.chosen { background: color-mix(in srgb, var(--c) 16%, var(--surface)); border-color: var(--c); transform: scale(1.04); }
.pick.lost { opacity: .18; transform: scale(.95); }

/* trouve le dual */
.choices { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; }
@media (max-width: 640px) { .choices { grid-template-columns: repeat(2, 1fr); } }
.choice { padding: 18px 10px; border-radius: 18px; border: 1px solid var(--line2); background: var(--surface); text-align: center; transition: transform .35s var(--ease), border-color .3s, background .3s, opacity .3s; }
.choice:hover { transform: translateY(-4px); border-color: var(--c); }
.choice b { display: block; font-family: var(--serif); font-weight: 400; font-size: 1.6rem; }
.choice span { font-size: .8rem; color: var(--muted); }
.choice .fns { margin-top: 6px; font-family: var(--serif); }
.choice.ok { border-color: var(--alpha); background: color-mix(in srgb, var(--alpha) 15%, var(--surface)); }
.choice.ko { border-color: var(--F); opacity: .5; }
.choice[disabled] { cursor: default; transform: none; }
.target { text-align: center; margin-bottom: 26px; }
.target .code-big { font-size: 4rem; }
.target .row { display: flex; justify-content: center; gap: 22px; margin-top: 12px; font-size: .85rem; color: var(--muted); flex-wrap: wrap; }
.target .row .fn { font-size: 1.2rem; }
.hint-blur { filter: blur(6px); transition: filter .4s; cursor: pointer; }
.hint-blur.shown { filter: none; cursor: default; }

/* progression */
.badge { position: absolute; top: 18px; right: 18px; z-index: 1; font-size: .66rem; letter-spacing: .1em; text-transform: uppercase; padding: 4px 9px; border-radius: 99px; background: color-mix(in srgb, var(--c) 22%, transparent); color: var(--c); }
.journey-meter { display: flex; align-items: center; gap: 14px; margin-top: 26px; color: var(--muted); font-size: .9rem; }
.journey-meter svg { width: 44px; height: 44px; }

/* inclinaison au survol */
.tilt { will-change: transform; }

@media (max-width: 860px) {
  .ma { gap: 6px; }
  .ma .bd { display: none; }
  .ma .blk { padding: 8px; }
  .ma .cell { padding: 6px 8px; }
  .ma .cell .f { font-size: 1.3rem; }
  .ma .dual { padding: 8px 12px; gap: 8px; font-size: .85rem; }
}

.scrolly .stage > * { min-width: 0; max-width: 100%; }
.ma, .ma .cells, .modelA, .blk .cells { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
.ma > *, .cell { min-width: 0; }
.cell .p, .cell .nm { overflow-wrap: anywhere; }
@media (max-width: 520px) { .modelA { grid-template-columns: minmax(0, 1fr); } }

/* =========================================================
   v4 — décodeur, profils, comparateur, attention
   ========================================================= */

/* décodeur des lettres */
.decode { width: 100%; display: grid; justify-items: center; gap: 14px; }
.decode svg { width: min(330px, 100%); }
.dl { display: flex; gap: 8px; }
.dl div { width: 74px; text-align: center; padding: 8px 0 7px; border-radius: 12px; border: 1px solid var(--line); background: var(--surface); transition: color .35s var(--ease), background-color .35s var(--ease), border-color .35s var(--ease), box-shadow .35s var(--ease), opacity .35s var(--ease), transform .35s var(--ease); }
.dl b { display: block; font-family: var(--serif); font-weight: 300; font-size: 2.2rem; line-height: 1.05; color: var(--dim); transition: color .5s; }
.dl span { font-size: .58rem; letter-spacing: .1em; text-transform: uppercase; color: var(--dim); }
.dl div.hl { border-color: var(--S); background: var(--surface2); transform: translateY(-4px); box-shadow: 0 0 26px -10px var(--S); }
.dl div.hl b { color: var(--ink); }
.dk .pt circle { fill: var(--bg2); stroke: var(--line2); stroke-width: 1.2; transition: fill .6s, stroke .6s, r .4s; }
.dk .pt text { fill: var(--dim); font-family: var(--serif); transition: fill .6s; }
.dk .pt.cand circle { stroke: var(--c); stroke-width: 2; }
.dk .pt.cand text { fill: var(--ink); }
.dk .pt.lit circle { fill: var(--c); stroke: var(--c); r: 20; filter: drop-shadow(0 0 10px var(--c)); }
.dk .pt.lit text { fill: #0d0c0b; }
.dk .pt.half circle { fill: color-mix(in srgb, var(--c) 30%, var(--bg2)); stroke: var(--c); }
.dk .pt.half text { fill: var(--ink); }
.dstack { display: flex; gap: 6px; flex-wrap: wrap; justify-content: center; min-height: 54px; }
.dstack span { display: grid; justify-items: center; min-width: 76px; padding: 6px 10px; border-radius: 10px; border: 1px dashed var(--line2); font-family: var(--serif); font-size: 1.3rem; color: var(--dim); transition: color .35s var(--ease), background-color .35s var(--ease), border-color .35s var(--ease), box-shadow .35s var(--ease), opacity .35s var(--ease), transform .35s var(--ease); }
.dstack span small { font-family: var(--sans); font-size: .58rem; letter-spacing: .1em; text-transform: uppercase; }
.dstack span.on { border: 1px solid var(--c); color: var(--c); background: color-mix(in srgb, var(--c) 10%, transparent); }
@media (max-width: 860px) { .decode svg { width: 230px; } .dl div { width: 58px; } .dl b { font-size: 1.7rem; } .dstack span { min-width: 60px; font-size: 1.1rem; } .decode .chips { display: none; } }

/* profils : tableaux */
.atlas-bar { display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 18px; }
.seg { display: inline-flex; padding: 4px; border-radius: 99px; background: var(--surface); border: 1px solid var(--line2); }
.seg .chip { border: 0; }
.atlas-wrap { overflow-x: auto; border-radius: 18px; border: 1px solid var(--line); background: var(--bg2); }
table.atlas { width: 100%; border-collapse: collapse; min-width: 860px; }
.atlas th { position: sticky; top: 0; text-align: left; padding: 14px 16px; font-size: .68rem; letter-spacing: .12em; text-transform: uppercase; color: var(--dim); font-weight: 500; background: var(--surface); border-bottom: 1px solid var(--line2); }
.atlas td { padding: 14px 16px; border-bottom: 1px solid var(--line); font-size: .92rem; vertical-align: middle; }
.atlas td small { display: block; color: var(--dim); font-size: .78rem; margin-top: 2px; }
.atlas td .fn { font-size: 1.15rem; }
.atlas td.code { font-family: var(--serif); font-size: 1.35rem; color: var(--c); position: relative; padding-left: 22px; white-space: nowrap; }
.atlas td.code::before { content: ""; position: absolute; left: 0; top: 18%; bottom: 18%; width: 3px; border-radius: 3px; background: var(--c); transition: top .3s, bottom .3s; }
.atlas tbody tr { cursor: pointer; transition: background .25s, opacity .4s; animation: rowIn .6s var(--ease) both; animation-delay: calc(var(--i) * 25ms); }
.atlas tbody tr:hover, .atlas tbody tr:focus-visible { background: color-mix(in srgb, var(--c) 8%, transparent); outline: none; }
.atlas tbody tr:hover td.code::before { top: 0; bottom: 0; }
.atlas tbody tr.off { opacity: .15; }
@keyframes rowIn { from { opacity: 0; transform: translateY(8px); } }
.pl { display: inline-block; font-size: .72rem; letter-spacing: .06em; padding: 3px 9px; border-radius: 99px; color: var(--c); border: 1px solid color-mix(in srgb, var(--c) 45%, transparent); white-space: nowrap; }

/* comparateur */
.cmp-ctrl { display: grid; grid-template-columns: 1fr auto 1fr auto; gap: 10px; align-items: center; margin: 18px 0 26px; }
@media (max-width: 700px) { .cmp-ctrl { grid-template-columns: 1fr auto 1fr; } .cmp-ctrl #cmp-rand { grid-column: 1 / -1; } }
.sel { position: relative; }
.sel select { width: 100%; appearance: none; -webkit-appearance: none; font: inherit; color: var(--ink); background: var(--surface); border: 1px solid var(--line2); border-radius: 14px; padding: 14px 40px 14px 16px; font-family: var(--serif); font-size: 1.15rem; cursor: pointer; transition: border-color .2s; }
.sel select:hover, .sel select:focus { border-color: var(--muted); outline: none; }
.sel::after { content: "▾"; position: absolute; right: 16px; top: 50%; transform: translateY(-50%); color: var(--muted); pointer-events: none; }
.sel .label { position: absolute; top: -9px; left: 14px; background: var(--bg); padding: 0 6px; font-size: .62rem; }
.iconbtn { width: 46px; height: 46px; border-radius: 50%; border: 1px solid var(--line2); display: grid; place-items: center; font-size: 1.1rem; color: var(--muted); transition: color .2s var(--ease), background-color .2s var(--ease), border-color .2s var(--ease), box-shadow .2s var(--ease), opacity .2s var(--ease), transform .2s var(--ease); }
.iconbtn:hover { color: var(--ink); border-color: var(--ink); transform: rotate(180deg); }
#cmp-rand { width: auto; padding: 0 16px; border-radius: 99px; font-size: .85rem; }
#cmp-rand:hover { transform: none; }
.cmp-out { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.1fr) minmax(0, 1fr); gap: 14px; align-items: start; }
@media (max-width: 900px) { .cmp-out { grid-template-columns: 1fr 1fr; } .cmp-out .verdict { grid-column: 1 / -1; order: 3; } }
@media (max-width: 520px) { .cmp-out { grid-template-columns: 1fr; } }
.ccard { padding: 24px; border-radius: 20px; background: linear-gradient(170deg, color-mix(in srgb, var(--c) 12%, var(--surface)), var(--surface) 60%); border: 1px solid color-mix(in srgb, var(--c) 35%, transparent); }
.ccard .code-big { color: var(--c); font-size: clamp(2.8rem, 6vw, 4rem); margin-top: 6px; }
.ccard .stack { margin-top: 18px; }
.ccard .stack .row { grid-template-columns: 76px 1fr; }
.verdict { padding: 24px; border-radius: 20px; border: 1px solid var(--line2); background: var(--bg2); display: grid; gap: 12px; }
.lrows { display: grid; gap: 6px; }
.lrows div { display: grid; grid-template-columns: 40px 1fr 40px; align-items: center; text-align: center; padding: 6px; border-radius: 10px; }
.lrows b { font-family: var(--serif); font-weight: 400; font-size: 1.5rem; }
.lrows span { font-size: .7rem; letter-spacing: .1em; text-transform: uppercase; color: var(--dim); }
.lrows .eq { background: color-mix(in srgb, var(--alpha) 12%, transparent); }
.lrows .eq b { color: var(--alpha); }
.lrows .ne b { color: var(--muted); }
.vline { color: var(--muted); font-size: .92rem; }
.vline b { color: var(--ink); font-weight: 500; }
.vline.warn { color: var(--F); }
.vrel { padding: 16px; border-radius: 14px; border: 1px solid color-mix(in srgb, var(--c, var(--line2)) 50%, transparent); background: color-mix(in srgb, var(--c, transparent) 10%, transparent); }
.vrel strong { display: block; font-family: var(--serif); font-weight: 300; font-size: 1.8rem; color: var(--c, var(--ink)); margin-top: 4px; }
.vrel.big strong { font-size: 2.4rem; }
.vrel p { color: var(--muted); font-size: .9rem; margin-top: 4px; }
.mini-fig { width: 100%; max-width: 220px; margin: 0 auto; }
.mini-ma { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
.mini-ma > div { display: grid; grid-template-columns: 1fr 1fr; gap: 4px; padding: 6px; border-radius: 10px; border: 1px solid var(--line); position: relative; padding-top: 20px; }
.mini-ma > div.v { border-color: color-mix(in srgb, var(--S) 50%, transparent); }
.mini-ma em { position: absolute; top: 4px; left: 8px; font-style: normal; font-size: .58rem; letter-spacing: .1em; text-transform: uppercase; color: var(--dim); }
.mini-ma span { display: grid; justify-items: center; padding: 4px 0; border-radius: 6px; background: rgba(0,0,0,.25); font-family: var(--serif); font-size: 1.1rem; color: var(--c); }
.mini-ma span small { font-family: var(--sans); font-size: .55rem; color: var(--dim); }
.dl2 { display: grid; grid-template-columns: 90px 1fr; gap: 8px 12px; margin: 18px 0 0; font-size: .92rem; }
.dl2 dt { color: var(--dim); font-size: .72rem; text-transform: uppercase; letter-spacing: .08em; padding-top: 3px; }
.dl2 dd { margin: 0; }

/* rail des sections */
.rail { position: fixed; right: 20px; top: 50%; transform: translateY(-50%); z-index: 15; display: flex; flex-direction: column; gap: 14px; }
.rail a { display: flex; align-items: center; justify-content: flex-end; gap: 10px; text-decoration: none; }
.rail i { width: 8px; height: 8px; border-radius: 50%; border: 1px solid var(--muted); transition: color .35s var(--ease), background-color .35s var(--ease), border-color .35s var(--ease), box-shadow .35s var(--ease), opacity .35s var(--ease), transform .35s var(--ease); flex: none; }
.rail span { font-size: .74rem; color: var(--ink); background: var(--surface2); border: 1px solid var(--line2); padding: 3px 10px; border-radius: 99px; white-space: nowrap; opacity: 0; transform: translateX(8px); transition: color .2s var(--ease), background-color .2s var(--ease), border-color .2s var(--ease), box-shadow .2s var(--ease), opacity .2s var(--ease), transform .2s var(--ease); pointer-events: none; }
.rail a:hover span { opacity: 1; transform: none; }
.rail a.on i { background: var(--S); border-color: var(--S); box-shadow: 0 0 12px var(--S); transform: scale(1.4); }
@media (min-width: 1500px) { .rail a.on span { opacity: 1; transform: none; } }
@media (max-width: 1240px) { .rail { display: none; } }

/* titres mot à mot */
.split .w { display: inline-block; overflow: hidden; vertical-align: top; padding-bottom: .1em; margin-bottom: -.1em; }
.split .w > span { display: inline-block; transform: translateY(105%); transition: transform .7s var(--ease); }
.split.in .w > span, .in .split .w > span { transform: none; }
.split.reveal { filter: none; transform: none; opacity: 1; }

/* indice de défilement */
.cue { display: flex; align-items: center; gap: 12px; margin-top: 54px; font-size: .72rem; letter-spacing: .16em; text-transform: uppercase; color: var(--dim); }
.cue i { width: 1px; height: 46px; background: linear-gradient(var(--S), transparent); animation: cue 2.4s var(--ease) infinite; transform-origin: top; }
@keyframes cue { 0% { transform: scaleY(0); } 50% { transform: scaleY(1); } 100% { transform: scaleY(1); opacity: 0; } }
.ghost { will-change: transform; }

@media (prefers-reduced-motion: reduce) { .split .w > span { transform: none; } .atlas tbody tr { animation: none; } }

/* v5 — un type MBTI, plusieurs types socioniques */
.morph .fork { display: grid; justify-items: center; gap: 18px; }
.fork-row { display: flex; gap: 10px; flex-wrap: wrap; justify-content: center; }
.fork-row span { font-family: var(--serif); font-size: clamp(1.4rem, 3vw, 2rem); padding: 6px 16px; border-radius: 12px; border: 1px solid var(--line2); color: var(--ink); opacity: 0; transform: translateY(10px); }
.morph .on .fork-row span { animation: forkIn .7s var(--ease) forwards; }
.fork-row span:nth-child(1) { animation-delay: .15s; border-color: var(--T); }
.fork-row span:nth-child(2) { animation-delay: .3s; border-color: var(--N); }
.fork-row span:nth-child(3) { animation-delay: .45s; border-color: var(--S); }
.fork-row span:nth-child(4) { animation-delay: .6s; color: var(--dim); }
@keyframes forkIn { to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) { .fork-row span { opacity: 1; transform: none; } }

/* v6 — symboles socioniques, aspects, interactions */
.sym { display: inline-block; vertical-align: -0.08em; overflow: visible; flex: none; }
.big .sym { vertical-align: -0.02em; margin-right: .1em; }
.cell .f .sym { vertical-align: 0; }
.aspect { display: grid; gap: 8px; margin-top: 20px; }
.aspect div { display: grid; grid-template-columns: 96px 1fr; gap: 10px; align-items: baseline; padding: 8px 12px; border-radius: 10px; background: rgba(0,0,0,.22); }
.aspect b { font-family: var(--serif); font-weight: 400; color: var(--c); text-transform: capitalize; }
.aspect span { color: var(--muted); font-size: .88rem; }
.aspects { display: grid; grid-template-columns: 110px repeat(4, minmax(0, 1fr)); gap: 8px; }
.aspects .ah, .aspects .ar { font-size: .72rem; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); display: grid; align-content: end; padding: 4px 6px; }
.aspects .ar { align-content: center; }
.aspects small { display: block; letter-spacing: .06em; color: var(--dim); font-size: .62rem; margin-top: 2px; }
.asp { display: grid; justify-items: start; gap: 6px; text-align: left; padding: 14px; border-radius: 14px; border: 1px solid var(--line); background: var(--surface); transition: border-color .25s, transform .3s var(--ease), background .25s; }
.asp b { font-family: var(--serif); font-weight: 400; font-size: 1.35rem; color: var(--c); line-height: 1; }
.asp span { font-size: .78rem; color: var(--muted); line-height: 1.3; }
.asp:hover { border-color: var(--c); }
.asp[aria-pressed="true"] { border-color: var(--c); background: color-mix(in srgb, var(--c) 10%, var(--surface)); transform: translateY(-2px); box-shadow: 0 0 26px -12px var(--c); }
@media (max-width: 700px) {
  .aspects { grid-template-columns: 64px repeat(4, minmax(0, 1fr)); gap: 5px; }
  .asp { padding: 10px 6px; justify-items: center; text-align: center; }
  .asp span { display: none; }
  .aspects .ah, .aspects .ar { font-size: .58rem; letter-spacing: .04em; padding: 2px; }
}
#ennea-stage .pt, #ennea-stage .pt * { cursor: default; }
#hero-compass .pt.sel circle { stroke-width: 2.4; }

/* v7 — scrollytelling lisible : repères, fil, côtés alternés */
.scrolly .stage { top: calc(50vh - 296px); height: 592px; padding-bottom: 52px; }
.scrolly.flip { grid-template-columns: minmax(0, 1.15fr) minmax(0, .85fr); }
.scrolly.flip .stage { grid-column: 1; }
.scrolly.flip .steps { grid-column: 2; }

/* le fil des étapes : ce qui est lu reste lisible */
.scrolly .steps { position: relative; padding-left: 34px; }
.scrolly .steps::before, .scrolly .steps::after { content: ""; position: absolute; left: 6px; top: 22vh; bottom: 30vh; width: 1px; background: var(--line2); }
.scrolly .steps::after { bottom: 30vh; transform-origin: top; transform: scaleY(var(--prog, 0)); background: linear-gradient(var(--S), var(--N)); box-shadow: 0 0 10px var(--S); transition: transform .6s var(--ease); }
.scrolly .step { position: relative; opacity: .28; transform: translateY(14px); cursor: pointer; transition: opacity .7s var(--ease), transform .7s var(--ease); }
.scrolly .step.done { opacity: .55; transform: none; }
.scrolly .step.active { opacity: 1; transform: none; cursor: default; }
.scrolly .step::before { content: ""; position: absolute; left: -33px; top: 50%; width: 11px; height: 11px; margin-top: -6px; border-radius: 50%; background: var(--bg); border: 1px solid var(--line2); transition: color .35s var(--ease), background-color .35s var(--ease), border-color .35s var(--ease), box-shadow .35s var(--ease), opacity .35s var(--ease), transform .35s var(--ease); z-index: 1; }
.scrolly .step.done::before { background: var(--S); border-color: var(--S); transform: scale(.7); }
.scrolly .step.active::before { background: var(--S); border-color: var(--S); box-shadow: 0 0 0 5px color-mix(in srgb, var(--S) 22%, transparent), 0 0 18px var(--S); }
.scrolly .step .cap, .scrolly .step .sub { transition: transform .8s var(--ease), opacity .8s var(--ease); }
.scrolly .step:not(.active) .sub { transform: translateY(6px); }
.scrolly .step.active .cap { animation: capIn .8s var(--ease) both; }
.scrolly .step.active .sub { animation: capIn .8s .12s var(--ease) both; }
@keyframes capIn { from { opacity: 0; transform: translate3d(0,14px,0); } }
/* flèche qui relie le texte actif au schéma */
.scrolly .step::after { content: "→"; position: absolute; right: -40px; top: 50%; transform: translate(-14px, -50%); font-family: var(--serif); font-size: 1.6rem; color: var(--S); opacity: 0; transition: opacity .5s var(--ease), transform .6s var(--ease); }
.scrolly .step.active::after { opacity: .8; transform: translate(0, -50%); }
.scrolly.flip .step::after { content: "←"; right: auto; left: -78px; transform: translate(14px, -50%); }
.scrolly.flip .step.active::after { transform: translate(0, -50%); }

/* repères dans le schéma */
.hud { position: absolute; left: 50%; bottom: 4px; transform: translateX(-50%); display: flex; align-items: center; gap: 14px; padding: 8px 14px; border-radius: 99px; background: color-mix(in srgb, var(--surface) 86%, transparent); border: 1px solid var(--line2); white-space: nowrap; z-index: 3; font-size: .78rem; color: var(--muted); }
.hud-n { font-family: var(--serif); font-size: .95rem; color: var(--dim); min-width: 2.6em; }
.hud-n b { font-weight: 500; color: var(--ink); display: inline-block; }
.hud-bar { display: flex; gap: 4px; }
.hud-bar button { padding: 8px 0; }
.hud-bar i { display: block; width: 18px; height: 3px; border-radius: 3px; background: var(--line2); transition: background .4s, width .4s var(--ease), box-shadow .4s; }
.hud-bar button:hover i { background: var(--muted); }
.hud-bar button.on i { background: var(--S); }
.hud-bar button.now i { width: 30px; box-shadow: 0 0 10px var(--S); }
.hud-hint { display: inline-flex; gap: 6px; align-items: center; max-width: 230px; overflow: hidden; transition: max-width .6s var(--ease), opacity .4s; }
.hud-hint i { font-style: normal; color: var(--S); animation: hintBob 1.6s var(--ease) infinite; }
@keyframes hintBob { 50% { transform: translateY(3px); } }
.hud.moved .hud-hint { max-width: 0; opacity: 0; margin-left: -14px; }
.hud.end .hud-n b { color: var(--S); }

/* respiration du schéma à chaque étape */
.stage-glow { will-change: opacity; position: absolute; inset: 8% 10% 16%; border-radius: 50%; background: radial-gradient(closest-side, color-mix(in srgb, var(--S) 16%, transparent), transparent); opacity: 0; pointer-events: none; z-index: -1; }
.stage.bump .stage-glow { animation: glow 1.1s var(--ease); }
@keyframes glow { 30% { opacity: 1; } }
@keyframes nudge { 30% { transform: scale(1.012); } }

@media (max-width: 1100px) { .scrolly .step::after { display: none; } }
@media (max-width: 860px) {
  .scrolly .stage { height: 52vh; top: 64px; padding-bottom: 40px; }
  .scrolly.flip .stage, .scrolly.flip .steps { grid-column: 1; }
  .scrolly .steps { padding-left: 26px; }
  .scrolly .steps::before, .scrolly .steps::after { left: 4px; top: 4vh; }
  .scrolly .step::before { left: -27px; top: calc(4vh + 1.1em); margin-top: 0; }
  .hud { bottom: 2px; padding: 5px 12px; gap: 10px; }
  .hud-bar i { width: 12px; }
  .hud-bar button.now i { width: 20px; }
  .hud-hint { max-width: 150px; }
  .hud-hint .l { display: none; }
  .hud .hud-hint .s { display: inline; }
}
@media (prefers-reduced-motion: reduce) {
  .scrolly .step.active .cap, .scrolly .step.active .sub, .stage.bump .stage-glow, .stage.bump > *, .hud-hint i { animation: none; }
}


@media (min-width: 861px) { .scrolly .step { min-height: 50vh; } }

@media (max-width: 860px) { .scrolly.flip { grid-template-columns: 1fr; } }
.hud-hint .s { display: none; }

/* v8 — huit éléments : vue unique, définition toujours visible */
.el-layout { display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, .95fr); gap: 48px; align-items: start; }
.el-layout > .panel { position: sticky; top: 96px; min-height: 360px; transition: border-color .4s; }
.el-view { display: grid; gap: 18px; justify-items: center; }
.el-stage { display: grid; width: 100%; min-height: 380px; }
.el-v { grid-area: 1 / 1; align-self: center; width: 100%; opacity: 0; visibility: hidden; transform: scale(.96); transition: opacity .5s var(--ease), transform .6s var(--ease), visibility 0s .6s; }
.el-v.on { opacity: 1; visibility: visible; transform: none; transition: opacity .5s .25s var(--ease), transform .7s .2s var(--ease), visibility 0s; }
.el-v svg { width: 100%; max-width: 440px; margin: 0 auto; }
.el-v.arrive .sym, .el-v.arrive circle.dot, .el-v.arrive text { animation: landIn .9s var(--ease) both; }
@keyframes landIn { 0%, 55% { opacity: 0; } }
.el-legend { text-align: center; max-width: 34em; margin: 0; }
.fly { position: fixed; z-index: 60; pointer-events: none; display: inline-flex; align-items: center; gap: 5px; padding: 5px 9px; border-radius: 99px; background: color-mix(in srgb, currentColor 14%, var(--bg)); border: 1px solid currentColor; box-shadow: 0 0 18px -4px currentColor; font-family: var(--serif); font-size: .95rem; }
.fly b { font-weight: 400; }
/* la fiche change en douceur */
#el-panel .swap { animation: elSwap .3s var(--ease); }
@keyframes elSwap { from { opacity: 0; transform: translate3d(8px,0,0); } }
@media (max-width: 860px) {
  .el-layout { grid-template-columns: 1fr; gap: 24px; }
  .el-layout > .panel { position: static; min-height: 0; }
  .el-stage { min-height: 0; }
  .el-v svg { max-width: 340px; }
}

/* =========================================================
   v9 — direction éditoriale + mouvement
   ========================================================= */

/* nav : tout sur la même ligne, outils séparés */
.nav ol { align-items: center; }
.nav a.navlink { align-items: center; line-height: 1.3; }
.nav ol li:nth-child(5) { margin-left: 8px; padding-left: 8px; border-left: 1px solid var(--line2); }

/* typographie plus éditoriale, moins « gabarit » */
h1 { font-size: clamp(3.2rem, 8.6vw, 7.4rem); line-height: .94; letter-spacing: -.035em; }
h2 { font-size: clamp(2.3rem, 5vw, 4rem); line-height: 1; letter-spacing: -.03em; }
h2 em, h1 em { font-weight: 300; }
.label { font-family: var(--serif); font-style: italic; font-size: .98rem; letter-spacing: 0; text-transform: none; color: var(--muted); display: inline-flex; align-items: center; gap: 12px; }
.sel .label, .box .label, .vrel .label, .ccard .label, .hud .label, .panel .label, .drawer .label, .verdict .label, .el-v .label { font-family: var(--sans); font-style: normal; font-size: .66rem; letter-spacing: .14em; text-transform: uppercase; color: var(--dim); }
.sel .label::before, .box .label::before, .vrel .label::before, .ccard .label::before, .panel .label::before, .drawer .label::before, .verdict .label::before { display: none; }
.sec-head { position: relative; }
.sec-head h2 { margin-top: 14px; }

/* cartes : angles nets, filets fins, moins de halos */
.panel, .ccard, .verdict, .next, .two > div, .stop, .asp, .tile, .atlas-wrap, .conv, .cmp-out .vrel, .res { border-radius: 4px; }
.ccard, .verdict { border-radius: 4px; }
.next { border-radius: 4px; }
.panel::before { opacity: .55; }
.badge { position: absolute; top: 14px; right: 14px; text-transform: none; letter-spacing: 0; font-family: var(--serif); font-style: italic; font-size: .85rem; color: var(--c); padding: 0; border: 0; background: none; }
.badge::before { content: "✓ "; font-style: normal; }

/* révélations : plusieurs gestes au lieu d'un seul fondu */
.reveal.settled { will-change: auto; }
.sec-head.reveal { filter: none; transform: none; opacity: 1; }
.sec-head.reveal .label { opacity: 0; transition: opacity .5s var(--ease); }
.sec-head.reveal.in .label { opacity: 1; transform: none; }
.sec-head.reveal > p { opacity: 0; transition: opacity .5s .1s var(--ease); }
.sec-head.reveal.in > p { opacity: 1; transform: none; }
.stagger > * { transform: translate3d(0,12px,0); transition: opacity .5s var(--ease), transform .6s var(--ease); }
.stagger.in > * { transform: none; }

@media (prefers-reduced-motion: reduce) {
  .sec-head.reveal .label, .sec-head.reveal > p { opacity: 1; transform: none; }
}


/* =========================================================
   v10 — continuité plutôt qu'interruption
   ========================================================= */
.stagger.in > *:nth-child(2) { transition-delay: .04s; } .stagger.in > *:nth-child(3) { transition-delay: .08s; }
.stagger.in > *:nth-child(4) { transition-delay: .12s; } .stagger.in > *:nth-child(n+5) { transition-delay: .16s; }

/* navigation entre pages : la barre reste en place, le contenu glisse, le titre cliqué se transforme */
@view-transition { navigation: auto; }
.nav { view-transition-name: nav; }
.progress { view-transition-name: progress; }
.chapter-hero h1 { view-transition-name: chap-title; }
::view-transition-old(root) { animation: vtOut .2s cubic-bezier(.23, 1, .32, 1) both; }
::view-transition-new(root) { animation: vtIn .38s cubic-bezier(0, 0, .2, 1) both; }
::view-transition-group(chap-title) { animation-duration: .5s; animation-timing-function: cubic-bezier(.2, .8, .2, 1); }
::view-transition-old(chap-title), ::view-transition-new(chap-title) { height: 100%; object-fit: contain; object-position: left center; }
::view-transition-group(nav), ::view-transition-group(progress) { animation-duration: .3s; }
@keyframes vtOut { to { opacity: 0; transform: translate3d(0,-8px,0); } }
@keyframes vtIn { from { opacity: 0; transform: translate3d(0,10px,0); } }
/* changement d'onglet dans une page */
::view-transition-old(atlas), ::view-transition-new(atlas) { animation-duration: .25s; }
#atlas { view-transition-name: atlas; }
@media (prefers-reduced-motion: reduce) {
  ::view-transition-group(*), ::view-transition-old(*), ::view-transition-new(*) { animation: none !important; }
}

/* =========================================================
   v11 — profils en cartes + mouvements liés au défilement
   ========================================================= */
.atlas-bar { align-items: center; }
.pcards { display: grid; grid-template-columns: repeat(var(--cols, 4), minmax(0, 1fr)); gap: 18px; border: 0; background: none; overflow: visible; align-items: start; }
.pcol { display: grid; gap: 8px; transition: opacity .4s var(--ease), filter .4s; }
.pcol.off { opacity: .22; }
.pcol header { padding: 0 2px 10px; border-bottom: 1px solid color-mix(in srgb, var(--c) 45%, transparent); margin-bottom: 6px; }
.pcol h3 { font-size: 1.45rem; color: var(--c); }
.pcol header p { color: var(--dim); font-size: .82rem; line-height: 1.4; margin-top: 4px; min-height: 2.8em; }
.ptile { display: grid; grid-template-columns: auto 1fr; grid-template-areas: "code name" "code sub"; column-gap: 14px; row-gap: 2px; align-items: center; text-align: left; padding: 14px 16px; border-radius: 4px; background: var(--surface); border: 1px solid var(--line); transition: border-color .25s, background .25s, transform .35s var(--ease); }
.ptile b { grid-area: code; font-family: var(--serif); font-weight: 300; font-size: 1.9rem; line-height: 1; color: var(--c); min-width: 2.4em; }
.ptile .pn { grid-area: name; font-size: .95rem; color: var(--ink); }
.ptile .pstack, .ptile .ppass { grid-area: sub; display: flex; gap: 8px; font-size: .82rem; color: var(--muted); align-items: center; flex-wrap: wrap; }
.ptile .pstack i { font-style: normal; }
.ptile small { grid-column: 2; font-size: .74rem; color: var(--dim); }
.ptile:hover, .ptile:focus-visible { border-color: var(--c); background: color-mix(in srgb, var(--c) 7%, var(--surface)); transform: translate3d(4px,0,0); outline: none; }
@media (max-width: 900px) { .pcards { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 560px) {
  .pcards { grid-template-columns: 1fr; gap: 30px; }
  .pcol { grid-template-columns: 1fr 1fr; }
  .pcol header { grid-column: 1 / -1; }
  .pcol header p { min-height: 0; }
  .ptile { grid-template-columns: 1fr; grid-template-areas: "code" "name" "sub"; padding: 12px; }
  .ptile small { grid-column: 1; }
}

/* défilement : --v va de 0 (entre en bas) à 1 (sort en haut) */
[data-sfx] { will-change: transform; }
:root [data-sfx="exitspin"] { transform: rotate(calc(max(var(--v, .5) - .45, 0) * 60deg)) scale(calc(1 - max(var(--v, .5) - .45, 0) * .35)); }
@media (prefers-reduced-motion: reduce) { [data-sfx] { transform: none !important; opacity: 1 !important; } }


/* =========================================================
   v12 — corrections issues de l'audit Lighthouse
   ========================================================= */
/* le haut de page s'affiche tout de suite (pas d'attente du script) */
.hero .reveal, .chapter-hero .reveal { opacity: 1; transform: none; animation: topIn .7s var(--ease) both; }
.chapter-hero .split .w > span { transform: none; animation: wordUp .7s var(--ease) both; }
@keyframes topIn { from { opacity: .01; transform: translate3d(0, 12px, 0); } }
@keyframes wordUp { from { transform: translateY(105%); } }
/* l'indice « défiler » ne pousse plus le contenu en apparaissant */
.chapter-hero .cue { position: absolute; left: 0; bottom: -78px; margin: 0; }
/* lisibilité */
.ptile .pstack i { opacity: 1 !important; }
.ptile .pstack i:first-child .fn { font-weight: 600; }
.blk-h, .cell .p { color: var(--muted); }
/* cibles tactiles suffisantes */
.hud-bar { gap: 0; }
.hud-bar button { min-width: 24px; min-height: 24px; padding: 0 3px; display: grid; place-items: center; }
@media (prefers-reduced-motion: reduce) { .hero .reveal, .chapter-hero .reveal, .chapter-hero .split .w > span { animation: none; } }

/* =========================================================
   v13 — audit animation + entrées latérales + arrondis
   ========================================================= */
:root { --r: 14px; --r-sm: 10px; }

/* 11. arrondis cohérents : une seule douceur pour les cartes, les panneaux et les boutons de navigation */
.panel, .ccard, .verdict, .next, .two > div, .stop, .tile, .atlas-wrap, .conv, .cmp-out .vrel, .res, .ptile, .tcol .head, .game, .slot, .blk, .matrix, .drawer .panel { border-radius: var(--r); }
.asp, .cell, .dl div, .codeslots span, .dstack span, .aspect div, .mini-ma > div, .lrows div { border-radius: var(--r-sm); }
.pcards { border-radius: 0; }

/* 11. titres sans mot isolé, focus visible partout, toucher net sur mobile */
h1, h2, h3, .cap { text-wrap: balance; }
p, .sub { text-wrap: pretty; }
:focus-visible { outline: 2px solid var(--S); outline-offset: 3px; }
.atlas tbody tr:focus-visible, .ptile:focus-visible, .sel select:focus-visible { outline: 2px solid var(--S); outline-offset: 2px; }
a, button, select, [role="button"], .gl { touch-action: manipulation; -webkit-tap-highlight-color: transparent; }
.nav { scroll-padding-top: 80px; }
html { scroll-padding-top: 80px; }
.drawer { overscroll-behavior: contain; }
.lrows b, .meter, .best, .score, .gtop { font-variant-numeric: tabular-nums; }

/* 5. retour d'appui : léger enfoncement, sortie rapide */
:is(button, .chip, .ptile, .tile, .stop, .next, .asp, .iconbtn, .map-btn, .toc a, .res a):active { transform: scale(.98); transition: transform .16s var(--ease); }

/* 6. survols qui déplacent : seulement avec une souris */
@media (hover: none) {
  .stop:hover, .ptile:hover, .tile:hover, .iconbtn:hover, .next:hover .arrow, .stop:hover svg { transform: none; }
}

/* ajout B. la carte s'ouvre depuis son bouton */
.map-inner { transform: scale(.96) translate3d(0, -8px, 0); transform-origin: 90% 0; transition: transform .3s var(--ease); }
.map.open .map-inner { transform: none; }

/* comparateur : seules les cartes se transforment */
#cmp-out { view-transition-name: cmp; }
::view-transition-group(cmp) { animation-duration: .3s; animation-timing-function: cubic-bezier(.23, 1, .32, 1); }

/* entrées liées au défilement : --p va de 0 (l'élément apparaît en bas) à 1 (il a atteint 55 % de l'écran).
   L'arrivée se fait sur le côté ou par le bas, puis l'élément ne bouge plus pendant qu'on le lit. */
:root [data-sfx="left"] { transform: translate3d(calc((1 - var(--p, 1)) * -1 * var(--dx, 110px)), 0, 0); opacity: calc(.1 + var(--p, 1) * .9); }
:root [data-sfx="right"] { transform: translate3d(calc((1 - var(--p, 1)) * var(--dx, 110px)), 0, 0); opacity: calc(.1 + var(--p, 1) * .9); }
:root [data-sfx="rise"] { transform: translate3d(0, calc((1 - var(--p, 1)) * var(--d, 60px)), 0); opacity: calc(.1 + var(--p, 1) * .9); }
:root [data-sfx="exitspin"] { transform: rotate(calc(max(var(--v, .5) - .45, 0) * 60deg)) scale(calc(1 - max(var(--v, .5) - .45, 0) * .35)); }
:root [data-sfx]:active { transform: scale(.98); }
:root { --dx: 40px; }
@media (max-width: 860px) { :root { --dx: 28px; } }
@media (prefers-reduced-motion: reduce) { :root [data-sfx] { transform: none !important; opacity: 1 !important; } }

/* les éléments qui arrivent des côtés ne créent jamais de défilement horizontal */
html, body { overflow-x: clip; }


/* =========================================================
   v15 — passages de page, fiches complètes, arrondis
   ========================================================= */
/* arrondis : plus doux et cohérents */
:root { --r: 18px; --r-sm: 12px; }
.next { border-radius: 24px; }
.choice { border-radius: var(--r); }
.game { border-radius: 24px; }
.drawer { border-radius: 24px 0 0 24px; }
@media (max-width: 600px) { .drawer { border-radius: 0; } }

/* fiche complète */
.drawer { width: min(540px, 100%); }
.dsec { margin-top: 28px; padding-top: 18px; border-top: 1px solid var(--line); }
.dsec h4 { font-family: var(--serif); font-style: italic; font-weight: 400; font-size: 1.05rem; color: var(--muted); margin: 0 0 12px; }
.dsec p { color: var(--muted); font-size: .94rem; }
.dsec p b { font-weight: 500; }
.frow { display: grid; grid-template-columns: 34px 110px 1fr; align-items: baseline; gap: 10px; padding: 6px 0; }
.frow b { font-family: var(--serif); font-weight: 400; font-size: 1.5rem; line-height: 1; }
.frow span { font-size: .8rem; color: var(--dim); }
.frow em { font-style: normal; color: var(--ink); }
.fcard { display: grid; grid-template-columns: 92px 1fr; gap: 14px; padding: 12px 14px; margin-bottom: 8px; border-radius: var(--r-sm); background: color-mix(in srgb, var(--c) 7%, var(--surface)); border: 1px solid color-mix(in srgb, var(--c) 30%, transparent); }
.fcard b { display: flex; align-items: center; gap: 6px; font-family: var(--serif); font-weight: 400; font-size: 1.45rem; color: var(--c); line-height: 1.1; }
.fcard small { display: block; font-size: .72rem; color: var(--dim); margin-top: 2px; }
.fcard strong { display: block; font-weight: 500; font-size: .92rem; }
.fcard p { font-size: .86rem; margin-top: 3px; color: var(--muted); }
.frow2 { display: grid; grid-template-columns: 110px 1fr; gap: 12px; padding: 7px 0; border-bottom: 1px dashed var(--line); }
.frow2:last-child { border-bottom: 0; }
.frow2 span { font-size: .82rem; color: var(--dim); }
.frow2 p { color: var(--ink); font-size: .94rem; }
.rgrp { display: grid; gap: 6px; margin-bottom: 12px; }
.rgrp > span { font-size: .8rem; }
.rgrp > div { display: flex; flex-wrap: wrap; gap: 6px; }
.rchip { font-size: .8rem; padding: 4px 10px; border-radius: 99px; border: 1px solid var(--line2); color: var(--muted); }
.rchip b { color: var(--ink); font-weight: 500; }
.pnav { display: flex; justify-content: space-between; gap: 8px; margin-top: 30px; padding-top: 18px; border-top: 1px solid var(--line); flex-wrap: wrap; }
.pnav .pcmp { color: var(--ink); border-color: var(--muted); }
.dlinks { display: flex; flex-wrap: wrap; gap: 8px; }
.dlinks .link { margin-top: 18px; }
.drawer .mini-ma { margin-top: 4px; }
@media (max-width: 480px) { .frow { grid-template-columns: 28px 90px 1fr; } .fcard { grid-template-columns: 76px 1fr; } .frow2 { grid-template-columns: 92px 1fr; } }


/* =========================================================
   v17 — iris de la boussole : aux vraies ruptures de chapitre,
   la page A recule sous un voile, la croix de Jung se trace,
   puis la page B s'ouvre en cercle depuis le centre de l'écran,
   avec la rose qui se pose derrière elle. Ensuite la lecture
   verticale reprend. Molette adoucie par Lenis.
   ========================================================= */
/* une seule propriété pilote le cercle de la feuille ET l'anneau : même fil, même courbe */
@property --ir { syntax: "<length>"; inherits: false; initial-value: 0px; }
/* les sœurs de l'iris (v18) suivent une progression 0 → 1 sur la même horloge */
@property --sq { syntax: "<number>"; inherits: false; initial-value: 0; }
:root { --run: 70vh; --iris-R: 120vmax; --iris-dur: .8s; --iris-del: .2s; --iris-ease: cubic-bezier(.5,0,.2,1); --iris-back: .75s; --iris-back-ease: cubic-bezier(.55,0,.3,1); --recede: cubic-bezier(.3,0,.2,1); }
/* règles de lenis.css, intégrées */
html.lenis, html.lenis body { height: auto; }
html.lenis { scroll-behavior: auto !important; }
.lenis.lenis-stopped { overflow: clip; }
.lenis [data-lenis-prevent] { overscroll-behavior: contain; }
.lenis.lenis-smooth iframe { pointer-events: none; }
/* enveloppes neutres tant que html.seams est absent */
.leaf { display: flow-root; }
.seam-iris, .seam-rose { display: none; }
html.seams { scroll-behavior: auto; overflow-anchor: none; }
/* la feuille déborde sur toute la largeur ; clip (et non hidden) garde les sticky imbriqués */
html.seams .sheet { position: relative; margin-inline: calc(50% - 50vw); padding-inline: calc(50vw - 50%); overflow-x: clip; }
html.seams .page { position: relative; }
/* tenues natives : chaque durée de tenue est un espaceur ::after dans le flux */
html.seams .leaf.in { margin-top: calc(-100vh - var(--run)); }
html.seams .leaf.in::after, html.seams .leaf.out > .sheet::after { content: ""; display: block; height: var(--run); }
html.seams .leaf.in > .sheet > .page, html.seams .leaf.out > .sheet > .page { min-height: 100vh; }
html.seams .leaf.out > .sheet > .page { position: sticky; top: calc(100vh - var(--h, 100000px)); }
/* B : la feuille s'ouvre en cercle depuis le centre de l'écran */
html.seams .leaf.in > .sheet { position: sticky; top: 0; background: var(--bg); clip-path: circle(var(--ir) at 50% 50vh); transition: --ir var(--iris-dur) var(--iris-ease) var(--iris-del), --sq var(--iris-dur) var(--iris-ease) var(--iris-del); }
html.seams .leaf.in.lead > .sheet { z-index: 3; }
html.seams .leaf.in.open > .sheet { --ir: var(--iris-R); --sq: 1; }
html.seams .leaf.in.landed > .sheet { clip-path: none; }
html.seams .leaf.in.back > .sheet { transition: --ir var(--iris-back) var(--iris-back-ease), --sq var(--iris-back) var(--iris-back-ease); }
/* reprise d'un passage en plein vol : pas de nouveau temps mort */
html.seams .leaf.re, .seam-iris.re { --iris-del: 0s; }
/* B : la page se pose (1.07 → none), la rose tourne. L'état armé (.prep) se pose
   sans transition, page encore invisible ; seuls les passages animent. */
html.seams .leaf.in > .sheet > .page { transform-origin: 50% 50vh; }
html.seams .leaf.in.prep:not(.open) > .sheet > .page { scale: 1.07; }
html.seams .leaf.in.open > .sheet > .page { transition: scale var(--iris-dur) var(--iris-ease) var(--iris-del); }
html.seams .leaf.in.back.turning > .sheet > .page { transition: scale var(--iris-back) var(--iris-back-ease); }
html.seams .leaf.in .seam-rose { display: block; position: absolute; z-index: -1; top: 0; left: calc(50% - 50vw); width: 100vw; height: 160vh; overflow: clip; pointer-events: none; -webkit-mask-image: linear-gradient(#000 55%, transparent 95%); mask-image: linear-gradient(#000 55%, transparent 95%); }
.seam-rose svg { position: absolute; left: 50%; top: 50vh; width: min(124vmin, 1100px); aspect-ratio: 1; translate: -50% -50%; overflow: visible; }
/* le point et l'arc d'accent posent leur propre remplissage (style en ligne) */
.seam-rose svg * { vector-effect: non-scaling-stroke; fill: none; }
html.seams .leaf.in.prep:not(.open) .seam-rose svg { scale: 1.4; rotate: -14deg; }
html.seams .leaf.in.open .seam-rose svg { transition: scale var(--iris-dur) var(--iris-ease) var(--iris-del), rotate var(--iris-dur) var(--iris-ease) var(--iris-del); }
html.seams .leaf.in.back.turning .seam-rose svg { transition: scale var(--iris-back) var(--iris-back-ease), rotate var(--iris-back) var(--iris-back-ease); }
/* rôle A (aussi pour une feuille du milieu) : elle recule */
html.seams .leaf.covered > .sheet > .page { scale: .94; transform-origin: 50% calc(var(--h) - 50vh); transition: scale .7s var(--recede); }
html.seams .leaf.back-out > .sheet > .page { transform-origin: 50% calc(var(--h) - 50vh); transition: scale var(--iris-back) var(--iris-back-ease) .15s; }
/* calques seulement près d'une tenue ; retirés à l'atterrissage pour que le texte se redessine net */
html.seams .leaf.prep:not(.landed) > .sheet > .page, html.seams .leaf.prep:not(.landed) .seam-rose svg, html.seams .leaf.prep-out > .sheet > .page { will-change: scale; }
/* calque du passage : voile, croix, cadran, anneau */
html.seams .seam-iris { display: block; position: fixed; inset: 0; z-index: 2; pointer-events: none; visibility: hidden; contain: layout paint style; }
html.seams .seam-iris.run { visibility: visible; }
.seam-iris > * { position: absolute; }
.si-veil { inset: 0; background: radial-gradient(ellipse at 50% 50%, rgba(0,0,0,.6), rgba(0,0,0,.92) 72%); opacity: 0; transition: opacity .6s var(--recede); }
.seam-iris.dim .si-veil { opacity: 1; }
.seam-iris.back .si-veil { transition: opacity .6s var(--iris-back-ease) .15s; }
.si-arm { background: var(--c); opacity: .55; transition: scale .52s cubic-bezier(.65,0,.15,1) .12s, opacity .15s; }
.si-arm[data-d="N"] { --c: var(--N); left: calc(50% - .5px); top: 0; width: 1px; height: 50%; transform-origin: 50% 100%; scale: 1 0; }
.si-arm[data-d="S"] { --c: var(--S); left: calc(50% - .5px); top: 50%; width: 1px; height: 50%; transform-origin: 50% 0; scale: 1 0; }
.si-arm[data-d="F"] { --c: var(--F); top: calc(50% - .5px); left: 50%; width: 50%; height: 1px; transform-origin: 0 50%; scale: 0 1; }
.si-arm[data-d="T"] { --c: var(--T); top: calc(50% - .5px); left: 0; width: 50%; height: 1px; transform-origin: 100% 50%; scale: 0 1; }
.si-arm.lit { opacity: 1; box-shadow: 0 0 0 .35px var(--c), 0 0 12px var(--c); }
.seam-iris.draw .si-arm { scale: 1; }
.si-dial { left: 50%; top: 50%; width: min(30vmin, 280px); aspect-ratio: 1; translate: -50% -50%; overflow: visible; opacity: 0; rotate: -30deg; transition: opacity .2s, rotate .7s cubic-bezier(.16,1,.3,1); }
.seam-iris.draw .si-dial { opacity: 1; rotate: none; }
.si-dial .ring { fill: none; stroke: rgba(236,229,216,.4); stroke-width: .85; stroke-dasharray: 1; stroke-dashoffset: 1; transition: stroke-dashoffset .3s cubic-bezier(.6,0,.2,1); }
.si-dial .r2 { transition-delay: .06s; }
.seam-iris.draw .si-dial .ring { stroke-dashoffset: 0; }
.si-bz { stroke: var(--line2); stroke-width: .85; }
.si-dial .pip { transform-box: fill-box; transform-origin: center; scale: 0; transition: scale .24s cubic-bezier(.34,1.56,.64,1); }
.si-dial .pip.N { fill: var(--N); transition-delay: .14s; }
.si-dial .pip.F { fill: var(--F); transition-delay: .17s; }
.si-dial .pip.S { fill: var(--S); transition-delay: .20s; }
.si-dial .pip.T { fill: var(--T); transition-delay: .23s; }
.seam-iris.draw .si-dial .pip { scale: 1; }
/* l'anneau : posé exactement sur le bord du cercle, avec un halo doux à l'extérieur */
.si-halo { inset: 0; opacity: 0; transition: --ir var(--iris-dur) var(--iris-ease) var(--iris-del), opacity .2s;
  background: radial-gradient(circle at 50% 50%, transparent calc(var(--ir) - .5px), var(--seam-c) calc(var(--ir) + .25px), var(--seam-c) calc(var(--ir) + 1.25px), color-mix(in srgb, var(--seam-c) 26%, transparent) calc(var(--ir) + 2.25px), transparent calc(var(--ir) + 36px)); }
.seam-iris.run .si-halo { opacity: 1; }
.seam-iris.open .si-halo { --ir: var(--iris-R); }
.seam-iris.back .si-halo { transition: --ir var(--iris-back) var(--iris-back-ease), opacity .15s linear .6s; }
.seam-iris.back:not(.open) .si-halo { opacity: 0; }
.seam-iris.back .si-arm, .seam-iris.detach .si-arm { opacity: 0; transition: opacity .15s, scale 0s .15s; }
.seam-iris.back .si-dial, .seam-iris.detach .si-dial { opacity: 0; transition: opacity .15s, rotate 0s .15s; }
/* --ir reste listée : l'anneau s'efface là où il est au lieu de sauter à sa valeur finale */
.seam-iris.detach .si-halo { opacity: 0; transition: --ir var(--iris-dur) var(--iris-ease) var(--iris-del), opacity .12s; }
.seam-iris.back.detach .si-halo { transition: --ir var(--iris-back) var(--iris-back-ease), opacity .12s; }
.leaf.instant, .leaf.instant *, .seam-iris.instant, .seam-iris.instant * { transition: none !important; }
html.seams .leaf.in .seam-head.reveal .label, html.seams .leaf.in .seam-head.reveal > p { opacity: 1; transition: none; }
html.seams .lantern { z-index: 2; }
/* sous le voile, l'habillage s'efface aussi : une seule image, sans bandeau ni lueur parasites */
html.seams :is(.nav, .rail, .lantern) { transition: opacity .6s var(--recede); }
html.seams:has(.seam-iris.dim) :is(.nav, .rail) { opacity: .2; }
html.seams:has(.seam-iris.dim) .lantern { opacity: 0; }
@media print { html.seams .leaf.in { margin-top: 0; } html.seams .leaf.in::after, html.seams .leaf.out > .sheet::after { display: none; } html.seams .sheet, html.seams .page { position: static !important; translate: none !important; scale: none !important; clip-path: none !important; min-height: 0; } .seam-iris, .seam-rose { display: none !important; } }


/* =========================================================
   v18 — trois sœurs de l'iris : même squelette, même horloge
   (recul de A, voile, croix, tenue, titre), autre ouverture.
   aiguille : B se découvre sous le balayage d'une aiguille ;
   anneaux : B s'ouvre en bandes concentriques ;
   figure : B s'ouvre dans la figure du chapitre.
   La variante tient à la feuille (data-fx), le calque la suit ;
   la découpe (--cut) est écrite par app.js sur la feuille.
   ========================================================= */
html.seams .leaf.in:is([data-fx="aiguille"], [data-fx="figure"]) > .sheet { clip-path: var(--cut); }
html.seams .leaf.in[data-fx="anneaux"] > .sheet { clip-path: none; -webkit-mask-image: var(--cut); mask-image: var(--cut); }
html.seams .leaf.in.landed[data-fx] > .sheet { clip-path: none; -webkit-mask-image: none; mask-image: none; }
/* calque : chaque sœur garde voile et croix, et pose son propre dessin */
.si-wrap, .si-fig { display: none; }
.seam-iris[data-fx="aiguille"] :is(.si-needle, .si-lit), .seam-iris[data-fx="anneaux"] .si-rings, .seam-iris[data-fx="figure"] :is(.si-edges, .si-fig) { display: block; }
.seam-iris[data-fx="figure"] .si-dial:not(.si-fig), .seam-iris[data-fx]:not([data-fx="iris"]) .si-halo { display: none; }
/* comme l'anneau de l'iris : visibles pendant le passage, effacés en fin de retour ou au décrochage */
.si-wrap { inset: 0; opacity: 0; transition: opacity .2s; }
.seam-iris.run .si-wrap { opacity: 1; }
.seam-iris.back .si-wrap { transition: opacity .15s linear .6s; }
.seam-iris.back:not(.open) .si-wrap { opacity: 0; }
.seam-iris.detach .si-wrap { opacity: 0; transition: opacity .12s; }
.si-wrap > i { position: absolute; }
/* porteurs de --sq : même fil que la feuille */
.si-q { inset: 0; transition: --sq var(--iris-dur) var(--iris-ease) var(--iris-del); }
.seam-iris.open .si-q { --sq: 1; }
.seam-iris.back .si-q { transition: --sq var(--iris-back) var(--iris-back-ease); }

/* aiguille : un tour complet sur une horloge plus longue et une courbe plus plate (≈ 820°/s au plus vite
   au lieu de 1350°/s) ; app.js règle ses filets sur ces mêmes durées. Pas sur une feuille qui recule (rôle A). */
html.seams .leaf[data-fx="aiguille"]:not(.back-out), .seam-iris[data-fx="aiguille"] { --iris-dur: 1.15s; --iris-ease: cubic-bezier(.45,0,.25,1); --iris-back: 1s; }
/* un trait sur le bord du secteur, sa lueur en avant (côté A). L'angle se lit sur --sq, comme la découpe :
   une seule horloge, l'aiguille ne peut pas devancer le bord qu'elle dessine */
.si-needle > i { inset: auto; left: 50%; top: calc(50% - var(--iris-R)); width: 36px; height: var(--iris-R); transform-origin: 0 100%; rotate: calc(var(--a0, 0deg) + var(--sq) * 360deg);
  background: linear-gradient(90deg, var(--seam-c) 0 1.25px, color-mix(in srgb, var(--seam-c) 26%, transparent) 2.25px, transparent 36px);
  -webkit-mask-image: linear-gradient(#000 calc(100% - 64px), transparent calc(100% - 14px)); mask-image: linear-gradient(#000 calc(100% - 64px), transparent calc(100% - 14px)); }
.seam-iris.run[data-fx="aiguille"] .si-needle > i { will-change: rotate; }
/* les graduations balayées s'allument : une copie colorée du cadran, découverte par un seul masque conique sur --sq */
.si-lit > i { -webkit-mask-image: conic-gradient(from var(--a0, 0deg) at 50% 50%, #000 calc(var(--sq) * 360deg), transparent 0); mask-image: conic-gradient(from var(--a0, 0deg) at 50% 50%, #000 calc(var(--sq) * 360deg), transparent 0); }
.si-lit .si-dial { position: absolute; }
.si-lit g { stroke: var(--seam-c); stroke-width: 2.2; }

/* anneaux : un trait sur le bord extérieur de chacune des trois bandes du dehors (--k = 2, 3, 4), par la même
   formule que le masque (--K, --D, --Z posés par app.js) ; il s'efface à mesure que sa bande se ferme */
.si-rings > i { --s: clamp(0, (var(--sq) - var(--k) * var(--D)) * var(--Z), 1); --r: calc(var(--iris-R) * (var(--k) + .5 + var(--s) * .5) / var(--K));
  opacity: calc(min(1, var(--s) * 12) * (1 - var(--s)));
  background: radial-gradient(circle at 50% 50%, transparent calc(var(--r) - .5px), var(--c) calc(var(--r) + .25px), var(--c) calc(var(--r) + 1.1px), var(--g) calc(var(--r) + 2px), transparent calc(var(--r) + 30px)); }
.si-rings > i:nth-child(1) { --c: var(--seam-c); --g: color-mix(in srgb, var(--seam-c) 26%, transparent); }
.si-rings > i:nth-child(2) { --c: rgba(236,229,216,.55); --g: transparent; }
.si-rings > i:nth-child(3) { --c: rgba(236,229,216,.4); --g: transparent; }

/* figure : tracée petite au centre, puis son contour suit l'ouverture : un trait et cinq bandes de lueur
   cumulées (28 → 3px), assez fines et pâles pour se lire comme un dégradé */
.seam-iris .si-fig { rotate: none; }
.si-fig .fg { stroke: var(--seam-c); stroke-width: 1.1; }
.si-fig .hx { stroke: rgba(236,229,216,.2); transition-delay: .1s; }
.si-edges > i { clip-path: var(--cut); opacity: min(1, var(--sq) * 25); background: color-mix(in srgb, var(--seam-c) 3%, transparent); }
.si-edges > i:nth-child(2) { background: color-mix(in srgb, var(--seam-c) 4%, transparent); }
.si-edges > i:nth-child(3) { background: color-mix(in srgb, var(--seam-c) 5%, transparent); }
.si-edges > i:nth-child(4) { background: color-mix(in srgb, var(--seam-c) 7%, transparent); }
.si-edges > i:nth-child(5) { background: color-mix(in srgb, var(--seam-c) 10%, transparent); }
.si-edges > i:nth-child(6) { background: var(--seam-c); }
@media print { html.seams .sheet { -webkit-mask-image: none !important; mask-image: none !important; } }
