/* Eumatheia — the scroll scene (after Batture's « chaîne »).
   Without script or with reduced motion, the four steps stay as plain blocks. */
.chain { --cw: 20rem; --ch: 26rem; --pw: 16rem; --ph: 11.75rem; position: relative; }
.chain .static-head { padding-top: clamp(40px, 6vw, 88px); }
.monde, .fonds, .compteur, .ch-cells, .ch-paper { display: none; }
.chain .txts { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; padding-bottom: clamp(40px, 6vw, 80px); }
.chain .txt { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: clamp(18px, 2.4vw, 30px); }
.chain .txt .no { font: 700 12.5px/1.3 var(--mono); color: var(--green); letter-spacing: .06em; text-transform: uppercase; margin: 0 0 10px; }
.chain .txt h3 { margin: 0 0 12px; font-weight: 800; font-size: clamp(28px, 3.2vw, 46px); line-height: 1.02; letter-spacing: -0.04em; text-wrap: balance; }
.chain .txt p.dit { margin: 0; font-size: clamp(16px, 1.3vw, 18.5px); color: var(--ink-2); }
.chain .txt p.dit code { font: 600 .86em/1 var(--mono); background: var(--green-soft); color: var(--green-deep); border-radius: 5px; padding: 2px 5px; }

/* ---------- animated ---------- */
.ch-anime .chain { height: 680vh; }
.ch-anime .chain .static-head { display: none; }
.ch-anime .chain .txts { display: block; padding: 0; }
.ch-anime .scene { position: sticky; top: 0; height: 100vh; height: 100svh; overflow: hidden; background: var(--paper); color: var(--ink); transition: background-color .7s ease, color .7s ease; --stroke: rgba(15, 29, 25, .16); }
.ch-anime .scene.ton-vert { background: var(--green); color: #fff; --stroke: rgba(255, 255, 255, .22); }
.ch-anime .scene.ton-nuit { background: var(--console); color: #fff; --stroke: rgba(255, 255, 255, .16); }
.ch-anime .ch-paper { display: block; position: absolute; inset: 0; pointer-events: none; opacity: .9; transition: opacity .7s;
  background-image: linear-gradient(rgba(11, 122, 92, .11) 1px, transparent 1px), linear-gradient(90deg, rgba(11, 122, 92, .11) 1px, transparent 1px), linear-gradient(rgba(15, 29, 25, .045) 1px, transparent 1px), linear-gradient(90deg, rgba(15, 29, 25, .045) 1px, transparent 1px);
  background-size: 60px 60px, 60px 60px, 12px 12px, 12px 12px; background-position: center; }
.ch-anime .scene.ton-vert .ch-paper, .ch-anime .scene.ton-nuit .ch-paper { opacity: .18; }
.ch-anime .fonds { display: block; position: absolute; inset: 0; z-index: 0; pointer-events: none; }
.fonds > span { position: absolute; left: 0; top: 50%; margin-top: -0.55em; font-weight: 900; font-size: clamp(120px, 22vw, 340px); line-height: 1.1; letter-spacing: -0.06em; white-space: nowrap; color: transparent; -webkit-text-stroke: 2px var(--stroke); opacity: 0; will-change: transform; }
.ch-anime .monde { display: block; position: absolute; inset: 0; z-index: 2; perspective: 1500px; perspective-origin: 50% 44%; pointer-events: none; }
.fiche, .sheet, .part, .fiche2, .ch-sol { position: absolute; left: 50%; top: 50%; }
.fiche, .sheet, .fiche2 { width: var(--cw); height: var(--ch); margin: calc(var(--ch) / -2) 0 0 calc(var(--cw) / -2); }
.fiche, .fiche2 { transform-style: preserve-3d; will-change: transform; }
.fiche .face, .fiche2 .face { position: absolute; inset: 0; border-radius: 18px; backface-visibility: hidden; -webkit-backface-visibility: hidden; background: #FBFAF6; color: var(--ink); border: 1px solid var(--line); box-shadow: 0 30px 60px -30px rgba(8, 40, 30, .45); padding: 22px 22px 20px; display: flex; flex-direction: column; gap: 10px; overflow: hidden; }
.fiche .face::after { content: ""; position: absolute; inset: 0; border-radius: inherit; background: rgba(15, 29, 25, var(--ombre, 0)); pointer-events: none; }
.fiche .arriere { transform: rotateY(180deg); background: #fff; }
.face .k { margin: 0; font: 700 11.5px/1.2 var(--mono); letter-spacing: .07em; text-transform: uppercase; color: var(--green); display: flex; justify-content: space-between; gap: 8px; }
.face .k em { font-style: normal; color: var(--ink-2); font-weight: 600; letter-spacing: 0; text-transform: none; }
.ch-req { flex: none; margin: 0; padding: 10px 12px; border-radius: 10px; background: var(--console); color: var(--console-text); font: 500 12px/1.5 var(--mono); min-height: 3.2em; overflow-wrap: anywhere; }
.ch-req b { color: var(--mark); font-weight: 700; }
.ch-req .cur { display: inline-block; width: .55em; height: 1.05em; background: var(--mark); vertical-align: -0.18em; animation: blink 1s steps(1) infinite; }
.ch-req.done .cur { display: none; }
.face .big { margin: 6px 0 0; font-weight: 800; font-size: 30px; line-height: 1.02; letter-spacing: -0.035em; }
.face .tag { margin: 0; font: 500 12px/1.4 var(--mono); color: var(--ink-2); }
.face .lines { display: grid; gap: 7px; margin-top: auto; }
.face .lines i { display: block; height: 7px; border-radius: 4px; background: var(--paper-2); }
.face .lines i.s { width: 62%; }
.face .rev { margin: 0; font: 500 11.5px/1.3 var(--mono); color: var(--ink-2); }
.stamp { align-self: flex-start; display: inline-flex; align-items: center; gap: 8px; padding: 8px 12px; border-radius: 10px; border: 2px solid var(--draft); color: var(--draft); background: var(--draft-bg); font: 700 12.5px/1.2 var(--mono); transform: scale(1.8) rotate(-8deg); opacity: 0; transition: transform .35s cubic-bezier(.3, 1.6, .5, 1), opacity .2s; }
.stamp::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: currentColor; }
.stamp.vu { transform: scale(1) rotate(-3deg); opacity: 1; }
.ch-path { list-style: none; margin: 6px 0 0; padding: 0; display: grid; }
.ch-path li { position: relative; padding: 0 0 12px 26px; font-weight: 650; font-size: 15.5px; line-height: 1.25; opacity: .25; transform: translateX(10px); transition: opacity .35s, transform .45s cubic-bezier(.2, .7, .2, 1); }
.ch-path li small { display: block; font: 500 11px/1.4 var(--mono); color: var(--ink-2); }
.ch-path li::before { content: ""; position: absolute; left: 4px; top: 5px; width: 10px; height: 10px; border-radius: 2px; border: 2px solid var(--green); background: #fff; }
.ch-path li::after { content: ""; position: absolute; left: 9px; top: 18px; bottom: 0; width: 2px; background: var(--line); }
.ch-path li:last-child::after { display: none; }
.ch-path li:last-child::before { background: var(--mark); border-color: var(--ink); }
.ch-path li.vu { opacity: 1; transform: none; }
.face .ref { margin: auto 0 0; padding: 10px 12px; border-radius: 10px; background: var(--paper); font: 500 11.5px/1.45 var(--mono); color: var(--ink-2); }
.face .ref b { display: block; color: #B3261E; font-weight: 700; margin-bottom: 2px; }
.sheet { border-radius: 14px; background-color: #FBFAF6; border: 1px solid var(--line); background-image: linear-gradient(rgba(11, 122, 92, .16) 1px, transparent 1px), linear-gradient(90deg, rgba(11, 122, 92, .16) 1px, transparent 1px); background-size: 16px 16px; will-change: transform, opacity; }
.ch-sol { width: var(--cw); height: 3rem; margin: -1.5rem 0 0 calc(var(--cw) / -2); border-radius: 50%; background: radial-gradient(closest-side, rgba(15, 29, 25, .32), rgba(15, 29, 25, 0)); will-change: transform, opacity; }
.ton-vert .ch-sol, .ton-nuit .ch-sol { background: radial-gradient(closest-side, rgba(0, 0, 0, .45), rgba(0, 0, 0, 0)); }
.part { width: var(--pw); height: var(--ph); margin: calc(var(--ph) / -2) 0 0 calc(var(--pw) / -2); background: #FBFAF6; color: var(--ink); border-radius: 16px; padding: 14px 16px; border: 1px solid rgba(255, 255, 255, .5); box-shadow: 0 24px 48px -24px rgba(0, 0, 0, .55); opacity: 0; will-change: transform, opacity; display: flex; flex-direction: column; gap: 6px; overflow: hidden; }
.part .n { font: 700 11px/1 var(--mono); color: var(--green); display: flex; justify-content: space-between; gap: 6px; letter-spacing: .05em; }
.part .n code { font-weight: 500; color: var(--ink-2); letter-spacing: 0; }
.part h4 { margin: 0; font-size: 15px; line-height: 1.2; letter-spacing: -0.01em; }
.part p { margin: 0; font-size: 13.5px; line-height: 1.42; color: var(--ink-2); display: -webkit-box; -webkit-line-clamp: 4; -webkit-box-orient: vertical; overflow: hidden; }
.part.hl { background: var(--mark); }
.part.hl p { color: var(--ink); }
.fiche2 .face { gap: 10px; }
.ch-anime .ch-cells { display: block; position: absolute; inset: 0; width: 100%; height: 100%; z-index: 3; pointer-events: none; }
.ch-anime .compteur { display: flex; position: absolute; z-index: 5; left: 50%; bottom: 1.4rem; transform: translateX(-50%); width: min(44rem, calc(100% - 2 * var(--gutter))); gap: .7rem; list-style: none; margin: 0; padding: 0; transition: opacity .4s; }
.compteur li { position: relative; flex: 1; padding-top: .6rem; font-size: .88rem; font-weight: 800; letter-spacing: -.01em; opacity: .42; transition: opacity .3s; }
.compteur li span { font: 700 .72rem/1 var(--mono); letter-spacing: .05em; margin-right: .4rem; }
.compteur li::before, .compteur li::after { content: ""; position: absolute; left: 0; right: 0; top: 0; height: 3px; border-radius: 2px; background: currentColor; }
.compteur li::before { opacity: .22; }
.compteur li::after { transform-origin: 0 0; transform: scaleX(var(--p, 0)); background: var(--mark); }
.compteur li.actif { opacity: 1; }
.ch-anime .chain .txt { position: absolute; top: 50%; width: min(34vw, 31rem); z-index: 4; opacity: 0; visibility: hidden; will-change: transform, opacity; background: none; border: 0; padding: 0; }
.ch-anime .chain .txt.g { left: max(var(--gutter), calc((100vw - var(--max)) / 2 + var(--gutter))); }
.ch-anime .chain .txt.d { right: max(var(--gutter), calc((100vw - var(--max)) / 2 + var(--gutter))); }
.ch-anime .chain .txt .no { color: inherit; opacity: .75; }
.ch-anime .scene .txt .no { color: var(--green); opacity: 1; }
.ch-anime .scene.ton-vert .txt .no, .ch-anime .scene.ton-nuit .txt .no { color: var(--mark); }
.ch-anime .chain .txt h3 { font-size: clamp(34px, 3.9vw, 60px); }
.ch-anime .chain .txt p.dit { color: inherit; opacity: .82; }
.ch-anime .scene.ton-vert .txt p.dit code, .ch-anime .scene.ton-nuit .txt p.dit code { background: rgba(255, 255, 255, .14); color: #fff; }

@media (max-width: 760px) and (orientation: portrait) {
  .chain { --cw: 14.5rem; --ch: 18.75rem; --pw: 10.6rem; --ph: 9.4rem; }
  .chain .txts { grid-template-columns: 1fr; }
  .ch-anime .chain .txt, .ch-anime .chain .txt.d, .ch-anime .chain .txt.g { top: auto; bottom: 1.6rem; left: var(--gutter); right: var(--gutter); width: auto; }
  .ch-anime .chain .txt h3 { font-size: clamp(26px, 7.4vw, 34px); margin-bottom: 8px; }
  .ch-anime .chain .txt p.dit { font-size: 15px; }
  .ch-anime .monde { perspective: 1000px; perspective-origin: 50% 32%; }
  .ch-anime .compteur { top: 78px; bottom: auto; }
  .compteur li { font-size: .68rem; }
  .compteur li span { display: none; }
  .fiche .face, .fiche2 .face { padding: 16px; gap: 8px; }
  .face .big { font-size: 21px; }
  .ch-req { font-size: 10.5px; }
  .ch-path li { font-size: 13px; padding-bottom: 9px; }
  .part { padding: 10px 11px; gap: 4px; }
  .part h4 { font-size: 12.5px; }
  .part p { font-size: 11.5px; -webkit-line-clamp: 4; }
  .part .n code { display: none; }
  .fonds > span { top: 34%; }
}
@media (max-width: 760px) and (orientation: landscape) { .ch-anime .chain .txt p.dit { display: none; } }

.chain .static-head .eyebrow { margin-bottom: 16px; }

/* ---------- the landing screen inside the scene ---------- */
.ch-hero { position: relative; }
.ch-anime .ch-hero { position: absolute; inset: 0; z-index: 3; display: flex; flex-direction: column; justify-content: center; padding: 76px 0 8px; }
.ch-anime .ch-hero .hero-top, .ch-anime .ch-hero .hero-body { will-change: transform, opacity; }
.ch-anime .ch-hero .hero-body { padding-bottom: 0; }
.ch-anime .ch-hero .hero-body h1 { font-size: clamp(28px, min(4.4vw, 6.6vh), 62px); }
.cells canvas.tall { position: absolute; left: 0; top: 0; width: 100%; pointer-events: none; }
.ch-hero .scroll-cue { display: none; }
.ch-anime .ch-hero .scroll-cue { display: inline-flex; align-items: center; gap: 8px; margin-top: 18px; font: 600 12px/1 var(--mono); color: var(--ink-2); letter-spacing: .06em; text-transform: uppercase; }
.ch-anime .ch-hero .scroll-cue i { width: 14px; height: 22px; border: 1.5px solid var(--ink-2); border-radius: 8px; position: relative; }
.ch-anime .ch-hero .scroll-cue i::after { content: ""; position: absolute; left: 50%; top: 4px; width: 2px; height: 5px; margin-left: -1px; border-radius: 1px; background: var(--green); animation: cue 1.6s ease-in-out infinite; }
@keyframes cue { 50% { transform: translateY(6px); opacity: .3; } }
@media (max-width: 760px) and (orientation: portrait) {
  .ch-anime .ch-hero { justify-content: flex-start; padding-top: 96px; }
  .ch-anime .ch-hero .hero-body h1 { font-size: clamp(26px, 8vw, 36px); }
  .ch-anime .ch-hero .hero-body p { font-size: 15.5px; margin-bottom: 16px; }
}
@media (max-height: 640px) and (min-width: 761px) { .ch-anime .ch-hero .hero-body p { font-size: 15px; } .ch-anime .ch-hero .hero-body { padding-top: 14px; } }
/* the scene sits under the sticky header from the first pixel, so it is pinned before any scroll */
.ch-anime .chain { margin-top: -68px; }
