/* 2. L'ouverture.
   À plat (sans JavaScript, mouvement réduit, écran très bas) : une page calme, tout est posé.
   En film (data-ouverture="film") : un plateau collé à l'écran pendant que la page défile. */
.ouverture { position: relative; background: var(--nuit); color: var(--ivoire); }
.plateau { position: relative; overflow: clip; display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 40px; align-items: center; padding: 56px var(--marge) 72px; }
.halo { position: absolute; inset: 0; background: radial-gradient(60vmin 62vmin at 74% 30%, rgb(255 203 117 / .42), rgb(255 203 117 / .1) 55%, transparent 100%); }
.dessus { display: none; }
/* la lampe, le disque au bout de son manche, le miroir : posés dans la même case */
.lampe { position: relative; grid-column: 2; grid-row: 1 / 3; align-self: end; justify-self: start; width: 27%; max-height: 420px; overflow: visible; }
.lampe [data-objet="flamme"] { transform-origin: 130px 300px; }
@keyframes flamme { 25% { transform: scaleY(1.04); } 60% { transform: scaleY(.96); } }
html[data-motion="full"] .lampe [data-objet="flamme"] { animation: flamme .9s ease-in-out 4; }
.disque { position: relative; grid-column: 2; grid-row: 1 / 3; align-self: start; width: min(100%, 70vh); aspect-ratio: 1; justify-self: center; margin-bottom: min(54%, 38vh); }
/* le manche derrière, le moyeu devant, tous deux immobiles : seul le carton tourne (mesures de illustrations/cabinet) */
.disque .manche { position: absolute; width: 17.31%; height: auto; left: 41.35%; top: 44.23%; pointer-events: none; }
.disque .moyeu { position: absolute; width: 11.54%; height: auto; left: 44.23%; top: 44.23%; pointer-events: none; }
.disque-tourne { position: relative; width: 100%; height: 100%; border-radius: 50%; }
.disque img { user-select: none; -webkit-user-select: none; }
.disque-tourne img { width: 100%; height: 100%; }
.rayon, .volets, .flou, .table-fils { display: none; }
.annonce { position: relative; grid-column: 1; grid-row: 1; }
.annonce h1 { font-size: clamp(3.2rem, 8.4vw, 8.4rem); font-weight: 900; letter-spacing: -.035em; line-height: .9; }
.annonce-phrase { font: 500 clamp(1.3rem, 2vw, 1.8rem)/1.35 var(--texte); max-width: 24ch; margin-top: 28px; }
.annonce-aide { margin-top: 22px; color: var(--lampe); font-weight: 700; }
.annonce-aide a { display: inline-block; padding: 4px 0; font-weight: 500; text-underline-offset: 5px; }
html:not([data-ouverture="film"]) .annonce-aide { display: none; }

.regard { position: relative; grid-column: 1; display: grid; gap: 28px; }
.regard-pas { display: grid; gap: 14px; max-width: 46ch; font-size: 1.25rem; line-height: 1.4; }
.regard-pas strong { color: var(--lampe); }
.deux-images { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; max-width: 460px; }
.deux-images figure { margin: 0; display: grid; gap: 10px; justify-items: center; }
.deux-images figcaption { font-weight: 700; }
.rond { width: 100%; aspect-ratio: 1; border-radius: 50%; overflow: hidden; }
.rond img { width: 100%; height: 100%; }
.glace { position: relative; z-index: 1; grid-column: 2; grid-row: 1 / 3; align-self: end; justify-self: end; display: grid; justify-items: center; gap: 14px; }
.miroir { position: relative; width: 220px; aspect-ratio: 340 / 480; }
.miroir svg { position: absolute; inset: 0; width: 100%; height: 100%; }
.miroir-glace { position: absolute; left: 22.06%; top: 12.9%; width: 55.9%; height: 45.84%; border-radius: 50%; overflow: hidden; background: radial-gradient(circle at 40% 30%, #fffaf0, #f1e7c9 70%, #d9c89b); transform: scaleX(-1); }
.miroir-glace img { width: 1600%; max-width: none; height: auto; margin-top: 7%; }
.regard-compte { white-space: nowrap; color: var(--lampe); font: 800 1.25rem/1 var(--titre); font-variant-numeric: tabular-nums; }
html:not([data-motion]) .regard-compte { display: none; }

.table { position: relative; grid-column: 1 / -1; }
.table ol { columns: 2 340px; column-gap: 48px; }
.table li { break-inside: avoid; padding: 8px 0; }
.table a { display: inline-block; font: 800 clamp(1.25rem, 2vw, 1.75rem)/1.1 var(--titre); text-decoration: none; padding: 4px 0; }
.table a:hover, .table a:focus-visible { color: var(--lampe); }
.table small { display: block; font: 400 1rem/1.3 var(--texte); color: #f1ead6; margin-top: 3px; letter-spacing: 0; }
.table-sert { display: none; }

@media (max-width: 760px) {
  .plateau { grid-template-columns: minmax(0, 1fr); padding-top: 40px; }
  .disque, .lampe, .glace { grid-column: 1; grid-row: 2; } .annonce { grid-row: 1; grid-column: 1; } .regard, .table { grid-row: auto; grid-column: 1; }
  .disque { margin-bottom: 58%; }
  .miroir { width: 112px; } .lampe { width: 25%; }
}

/* ---------- En film ---------- */
html[data-ouverture="film"] .ouverture { height: 380vh; }
html[data-ouverture="film"] .plateau { position: sticky; top: var(--entete); height: calc(100vh - var(--entete)); height: calc(100svh - var(--entete)); display: block; padding: 0; }
html[data-ouverture="film"] .halo { inset: auto; left: 0; top: 0; width: 230vmin; height: 230vmin; margin: -115vmin 0 0 -115vmin; background: radial-gradient(closest-side, rgb(255 196 100 / .72), rgb(226 130 52 / .3) 42%, rgb(120 60 60 / .1) 70%, transparent); will-change: transform; }
html[data-ouverture="film"] .lampe { position: absolute; left: 0; top: 0; width: 100px; max-height: none; transform-origin: 0 0; z-index: 3; pointer-events: none; }
html[data-ouverture="film"] .dessus { display: block; position: absolute; inset: auto 0 0; height: 10%; background: linear-gradient(#6d3b1c, #3a1d0b 70%, #24110a); border-top: 2px solid #b97a44; }
html[data-ouverture="film"] .disque { position: absolute; left: 0; top: 0; width: 1000px; height: 1000px; max-width: none; margin: -500px 0 0 -500px; will-change: transform; touch-action: pan-y; cursor: grab; border-radius: 50%; }
html[data-ouverture="film"] .disque.est-tire { cursor: grabbing; }
html[data-ouverture="film"] .disque-tourne { position: relative; will-change: transform; }
/* Le disque flou : les seize dessins mélangés (css/2b-flou.css). Aucun filtre, seulement des anneaux et une traînée */
html[data-ouverture="film"] .flou { display: block; position: absolute; inset: 1.4%; border-radius: 50%; opacity: 0; background: var(--trainee), var(--flou); will-change: opacity; }
html[data-ouverture="film"] .rayon { display: block; position: absolute; inset: 0; border-radius: 50%; pointer-events: none; opacity: 0; transition: opacity .2s; rotate: var(--a, 0deg);
  background: conic-gradient(from -11.25deg at 50% 50%, rgb(207 52 25 / .28) 0 22.5deg, transparent 0); -webkit-mask: radial-gradient(closest-side, transparent 25%, #000 25.3% 97%, transparent 97.2%); mask: radial-gradient(closest-side, transparent 25%, #000 25.3% 97%, transparent 97.2%); }
html[data-ouverture="film"] .rayon.allume { opacity: 1; }
/* la lumière de la lampe reste en place pendant que le disque tourne */
html[data-ouverture="film"] .disque::after { content: ""; position: absolute; inset: .8%; border-radius: 50%; pointer-events: none; background: radial-gradient(circle at 30% 8%, rgb(255 190 80 / .18), transparent 42%), radial-gradient(circle at 40% 26%, transparent 50%, rgb(64 30 16 / .4) 98%); }
html[data-ouverture="film"] .volets { display: block; position: absolute; inset: 0; width: 100%; height: 100%; z-index: 4; pointer-events: none; visibility: hidden; }
.volets path { fill: #05070f; stroke: #05070f; stroke-width: 1.5; }
html[data-ouverture="film"] .annonce { position: absolute; left: var(--marge); bottom: calc(10% + clamp(18px, 4vh, 44px)); z-index: 5; pointer-events: none; }
html[data-ouverture="film"] .annonce a { pointer-events: auto; }
html[data-ouverture="film"] .annonce h1 { font-size: clamp(3.6rem, min(8.6vw, 15.5vh), 9.4rem); max-width: 5.4em; }
html[data-ouverture="film"] .regard { position: absolute; left: var(--marge); top: 16%; width: min(430px, 30vw); z-index: 5; display: block; }
html[data-ouverture="film"] .regard-pas { gap: 0; }
html[data-ouverture="film"] .regard-pas li { grid-area: 1 / 1; visibility: hidden; opacity: 0; font-size: clamp(1.2rem, 1.7vw, 1.6rem); }
html[data-ouverture="film"] .regard-pas strong { display: block; font: 800 clamp(1.6rem, 2.9vw, 3rem)/1.05 var(--titre); letter-spacing: -.02em; margin-bottom: .45em; text-wrap: balance; }
html[data-ouverture="film"] .deux-images { display: none; }
html[data-ouverture="film"] .glace { position: absolute; left: var(--marge); top: 50%; width: min(225px, 25vh); z-index: 2; justify-self: auto; visibility: hidden; opacity: 0; justify-items: start; }
html[data-ouverture="film"] .miroir { width: 100%; }
html[data-ouverture="film"] .table { position: absolute; inset: 0; z-index: 3; visibility: hidden; pointer-events: none; }
html[data-ouverture="film"] .table.est-la { visibility: visible; }
html[data-ouverture="film"] .table-fils { display: block; position: absolute; inset: 0; width: 100%; height: 100%; }
.table-fils path { fill: none; stroke: var(--laiton); stroke-width: 1.4; stroke-linejoin: round; opacity: .75; transition: stroke .15s, opacity .15s; }
.table-fils path.allume { stroke: var(--lampe); stroke-width: 2.4; opacity: 1; }
html[data-ouverture="film"] .table ol { columns: auto; }
html[data-ouverture="film"] .table li { position: absolute; left: 0; top: 0; padding: 0; transform: translate(var(--x), var(--y)) translateY(-50%); }
html[data-ouverture="film"] .table a { white-space: nowrap; pointer-events: auto; font-size: clamp(1.2rem, min(1.85vw, 3.6vh), 2.3rem); padding: 2px 0; }
html[data-ouverture="film"] .table-note { position: absolute; right: var(--marge); bottom: 7vh; width: min(380px, 26vw); pointer-events: auto; }
html[data-ouverture="film"] .table-sert { font: 600 clamp(1.2rem, 1.8vw, 1.8rem)/1.25 var(--titre); min-height: 3.8em; display: grid; align-content: end; color: var(--lampe); }
html[data-ouverture="film"] .table-actions { margin-top: 22px; }
/* à la table, le miroir se range au-dessus de la note */
@media (min-width: 761px) { html[data-ouverture="film"] .glace { top: 8vh; } html[data-ouverture="film"] .regard { top: calc(50% + 36px); } html[data-ouverture="film"] .regard-pas li { align-self: start; } }
@media (min-width: 761px) and (max-height: 700px) { html[data-ouverture="film"] .regard { top: calc(50% + 66px); } }
@media (max-height: 620px) { .table small { font-size: .9375rem; margin-top: 0; } }

@media (max-width: 760px) {
  html[data-ouverture="film"] .annonce { top: 22px; bottom: auto; right: var(--marge); padding: 0; }
  html[data-ouverture="film"] .annonce h1 { font-size: clamp(3.2rem, 17vw, 5rem); }
  html[data-ouverture="film"] .annonce-phrase { margin-top: 14px; max-width: 20ch; font-size: 1.15rem; }
  html[data-ouverture="film"] .annonce-aide { margin-top: 8px; }
  html[data-ouverture="film"] .lampe, html[data-ouverture="film"] .dessus { display: none; }
  html[data-ouverture="film"] .regard { top: 18px; width: auto; right: var(--marge); }
  html[data-ouverture="film"] .regard-pas li { font-size: 1.0625rem; line-height: 1.32; }
  html[data-ouverture="film"] .regard-pas strong { font-size: 1.5rem; }
  html[data-ouverture="film"] .glace { display: none; }
  html[data-ouverture="film"] .table a { font-size: 1.1rem; white-space: normal; max-width: var(--large); }
  html[data-ouverture="film"] .table small { font-size: .9375rem; margin-top: 0; }
  html[data-ouverture="film"] .table-note { left: auto; right: var(--marge); bottom: 14px; width: auto; }
  html[data-ouverture="film"] .table-sert { display: none; }
}

/* ---------- La notice ---------- */
.notice { background: var(--ivoire); padding: clamp(56px, 6vw, 96px) var(--marge); display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 28px clamp(32px, 5vw, 90px); align-items: center; }
.notice h2 { grid-column: 1 / -1; font-size: clamp(2.2rem, 4.6vw, 4.2rem); }
.notice p { max-width: 60ch; }
.notice p + p { margin-top: .7em; }
.notice-texte { font-size: 1.25rem; }
.notice-coupe { margin: 0; }
.notice-coupe { container-type: inline-size; }
.coupe-cadre { overflow: hidden; border-radius: 6px; }
.coupe-cadre svg { display: block; width: 100%; height: auto; }
.cp-petit, .coupe-vu { display: none; }
/* le point de lumière (js/planche.js) : un rond et son halo, posés sur le trajet */
.coupe-point { opacity: 0; }
/* les quatre numéros : seulement quand rien ne bouge (réduit, ou sans JavaScript) */
html[data-motion="full"] .coupe-numeros { display: none; }
.coupe-etapes { counter-reset: lu; display: grid; grid-template-columns: 1fr 1fr; gap: 10px 28px; margin-top: 16px; }
.coupe-etapes li { counter-increment: lu; position: relative; padding-left: 40px; font-size: 1.0625rem; line-height: 1.35; }
.coupe-etapes li::before { content: counter(lu); position: absolute; left: 0; top: .02em; width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; background: var(--nuit); color: var(--ivoire); font: 800 1rem/1 var(--titre); }
.coupe-etapes li.ici::before { background: var(--vermillon); color: #fff; }
.notice-coupe .cmd { margin-top: 18px; }
/* planche étroite : on recadre au lieu de rapetisser. Le médaillon descend sous le dessin. */
@container (max-width: 440px) {
  .coupe-cadre { aspect-ratio: 576 / 426; border: 2px solid #1a1b33; }
  .coupe-cadre svg { width: calc(100% * 780 / 576); max-width: none; margin: calc(-100% * 20 / 576) 0 0 calc(-100% * 30 / 576); }
  .cp-large { display: none; }
  .cp-petit { display: inline; }
  .coupe-vu { display: grid; grid-template-columns: 104px 1fr; gap: 16px; align-items: center; margin-top: 12px; }
  .coupe-vu svg { border-radius: 50%; }
  .coupe-vu p { font: 800 1.25rem/1.25 var(--titre); text-wrap: balance; }
  .coupe-etapes { grid-template-columns: minmax(0, 1fr); }
}
/* à 320 px, « le miroir » descend d'une ligne pour ne pas toucher « la fente » */
@container (max-width: 330px) { .coupe-cadre [data-objet="mots"] { font-size: 27px; } .coupe-cadre .cp-fente { translate: 6px 0; } .coupe-cadre .cp-petit { translate: 0 30px; } }
.notice-mode { border-left: 8px solid var(--vermillon); padding-left: 28px; grid-column: 1 / -1; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 4px 40px; }
.notice-mode p + p { margin: 0; }
.notice-mode h3 { grid-column: 1 / -1; }
.notice-mode h3 { font-size: 1.5rem; margin-bottom: 12px; }

/* ---------- Nos trois durées ---------- */
.durees { background: var(--nuit); color: var(--ivoire); padding: clamp(48px, 5vw, 80px) var(--marge); display: grid; grid-template-columns: 4fr 7fr; gap: 32px clamp(32px, 6vw, 110px); align-items: start; }
.durees h2 { font-size: clamp(2.2rem, 4.6vw, 4.2rem); }
.durees-tete p { margin-top: 18px; max-width: 40ch; }
.durees :focus-visible { outline-color: var(--lampe); }
/* une milliseconde = la même longueur sur les trois règles */
.durees-liste { display: grid; gap: 20px; }
.durees-liste li { display: grid; grid-template-columns: 7rem 6rem minmax(0, 1fr); gap: 4px 14px; align-items: baseline; }
.durees-liste b { font: 900 1.6rem/1 var(--titre); color: var(--lampe); white-space: nowrap; }
.durees-liste span { font: italic 600 1.2rem/1 var(--titre); }
.regle-duree { grid-column: 1 / -1; position: relative; display: block; width: calc(100% * var(--ms) / 400); height: 14px; margin-top: 8px; border-radius: 7px; background: repeating-linear-gradient(90deg, rgb(255 203 117 / .55) 0 2px, transparent 2px calc(100% * 50 / var(--ms))) , rgb(255 255 255 / .1); }
.regle-duree i { position: absolute; left: 0; top: 50%; width: 26px; height: 26px; margin: -13px 0 0 -13px; border-radius: 50%; background: var(--vermillon); border: 3px solid var(--ivoire); }
.regle-duree i.est-arrivee { left: 100%; }
.durees-pied { grid-column: 1 / -1; display: flex; flex-wrap: wrap; gap: 14px 28px; align-items: center; }
.durees-code { margin: 0; padding: 12px 16px; background: var(--nuit-basse); font-size: 1rem; overflow-x: auto; max-width: 100%; white-space: pre-wrap; }
.durees-note { max-width: 44ch; font-size: 1.0625rem; line-height: 1.35; }
.durees .cmd:hover { background: var(--ivoire); color: var(--nuit); border-color: var(--ivoire); }
@media (max-width: 760px) {
  .notice, .durees { grid-template-columns: minmax(0, 1fr); }
  .notice-texte { font-size: 1.1875rem; } .notice-mode { grid-template-columns: minmax(0, 1fr); gap: 12px; }
  .durees-liste li { grid-template-columns: auto 1fr; }
  .durees-liste li p { grid-column: 1 / -1; }
}
