/* =====================================================================
   methode.css: concept « Henri », hubbleresearchlab.com/methode.html.
   An EXTENSION of sites/_shared/styles.css, written as one block ("Trame")
   that could be appended to the shared file as it is: every rule hangs on
   its own hooks (.sec-trame, .plate, .st-*, .dial, .sceau, .site-head--plain,
   .tag--mute, .foot--henri, html.trame-on), nothing in the shared system is
   redefined for other pages. Tokens and families are the shared ones only.
   Flat: no filter, no blur, no shadow, no blend, no grain.
   Static form (no JS, reduced motion, short viewport) = the default rules.
   Pinned form = everything under html.trame-on (set in <head>, confirmed
   by methode.js).
   ===================================================================== */

/* ---- units: svh with a vh fallback --------------------------------- */
:root{ --vh:1vh; }
@supports (height:1svh){ :root{ --vh:1svh; } }

/* ---- figure box B, pitch, rest frontier (desktop) -------------------- */
:root{
  --b-h: min(calc(var(--vh) * 120), 75vw);
  --b-w: calc(var(--b-h) * 1100 / 1149);
  --b-top: calc(var(--vh) * 11);
  --b-right: 2vw;
  --pas: calc(var(--b-w) / 96);
  --f-rest: calc(var(--vh) * 78);
  --sheet: var(--teal);          /* the plate */
  --on-sheet: var(--teal-ink);   /* dots and type on the plate */
}
@media (max-width:899px){
  :root{
    --b-w: min(130vw, calc(var(--vh) * 63));
    --b-h: calc(var(--b-w) * 1149 / 1100);
    --b-top: calc(var(--vh) * 102 - var(--b-h));
    --f-rest: calc(var(--vh) * 80);
  }
}
/* colder variant of section 4.2 (same geometry): ?froid */
html.froid{ --sheet: var(--papier-2); --on-sheet: var(--encre); }

/* ---- header: fixed, opaque paper, one rule, no blur ------------------ */
.site-head--plain{position:fixed;left:0;right:0;top:0;background:var(--papier);backdrop-filter:none;-webkit-backdrop-filter:none}
.tag--mute{color:var(--graphite)}

/* ---- the section (shared traps reset: section padding, proofstage height) */
.sec-trame{padding:0;min-height:0;position:relative;background:var(--sheet)}
.sec-trame p{margin:0;max-width:none}

/* =====================================================================
   0. Seuil: the plate (first viewport; the same frame in both forms)
   ===================================================================== */
.plate{position:relative;height:100vh;height:calc(var(--vh) * 100);overflow:hidden;background:var(--papier)}
.plate-mark{position:absolute;z-index:1;left:var(--pad);top:calc(var(--vh) * 30);margin:0;display:flex;flex-direction:column;align-items:flex-start;gap:.4rem;color:var(--encre);font-size:1rem;line-height:1}
.plate-mark .wm-name{font-family:var(--font-display);font-weight:400;font-size:clamp(3.2rem, 10vw, 9.5rem);line-height:.9;letter-spacing:-.015em}
.plate-mark .wm-rl{font-family:var(--font-sans);font-weight:600;font-size:clamp(.7rem, 1.1vw, .95rem);letter-spacing:.34em;text-transform:uppercase;color:var(--graphite);padding-left:.08em}
.plate-line{position:absolute;z-index:1;left:var(--pad);top:calc(var(--vh) * 52);color:var(--encre)}

/* B = the frame of the figure (1100:1149). The PNG is a 2048 square with
   the figure at x 117..1896, y 188..2047 (alpha bounds, measured): its box
   is scaled and offset so that B holds exactly the figure. */
.b{position:absolute;right:var(--b-right);top:var(--b-top);width:var(--b-w);height:var(--b-h)}
.b img{position:absolute;max-width:none;left:0;top:0;width:100%;height:100%}
@media (min-width:900px){ .b img{width:115.0566%;height:auto;aspect-ratio:1/1;left:-6.5730%;top:-10.1120%} }
.b--art{z-index:2}

/* the sheet: rises by transform only; its content is counter-translated so
   that the dot screen stays registered on the figure while the edge moves */
.sheet-wrap{position:absolute;z-index:3;left:0;right:0;top:0;height:calc(var(--vh) * 112);transform:translate3d(0,var(--f-rest),0);will-change:transform}
.sheet{position:absolute;inset:0;background:var(--sheet);overflow:hidden}
.sheet-inner{position:absolute;left:0;top:0;width:100%;height:100vh;height:calc(var(--vh) * 100);transform:translate3d(0,calc(var(--f-rest) * -1),0);will-change:transform}
.trame{position:absolute;inset:0;width:100%;height:100%;display:block}

/* fringe: six rows of growing sheet-coloured dots on the pitch, on the B grid
   (generalises the one-size fringe of styles.css:121-122) */
.fringe{position:absolute;left:0;right:0;bottom:100%;height:calc(var(--pas) * 6);
  --gx: calc(98vw - var(--b-w));
  background:
    radial-gradient(circle, var(--sheet) calc(var(--pas) * .12), transparent calc(var(--pas) * .12 + .7px)) var(--gx) 0 / var(--pas) var(--pas) repeat-x,
    radial-gradient(circle, var(--sheet) calc(var(--pas) * .20), transparent calc(var(--pas) * .20 + .7px)) var(--gx) calc(var(--pas) * 1) / var(--pas) var(--pas) repeat-x,
    radial-gradient(circle, var(--sheet) calc(var(--pas) * .28), transparent calc(var(--pas) * .28 + .7px)) var(--gx) calc(var(--pas) * 2) / var(--pas) var(--pas) repeat-x,
    radial-gradient(circle, var(--sheet) calc(var(--pas) * .36), transparent calc(var(--pas) * .36 + .7px)) var(--gx) calc(var(--pas) * 3) / var(--pas) var(--pas) repeat-x,
    radial-gradient(circle, var(--sheet) calc(var(--pas) * .46), transparent calc(var(--pas) * .46 + .7px)) var(--gx) calc(var(--pas) * 4) / var(--pas) var(--pas) repeat-x,
    radial-gradient(circle, var(--sheet) calc(var(--pas) * .60), transparent calc(var(--pas) * .60 + .7px)) var(--gx) calc(var(--pas) * 5) / var(--pas) var(--pas) repeat-x}

/* CSS dot screen (no JS): the painting seen through round holes of the sheet,
   one hole per cell of the pitch. Hidden once the canvas has drawn. */
.b--dots{
  -webkit-mask-image:radial-gradient(circle, #000 calc(var(--pas) * .42), transparent calc(var(--pas) * .42 + .6px));
          mask-image:radial-gradient(circle, #000 calc(var(--pas) * .42), transparent calc(var(--pas) * .42 + .6px));
  -webkit-mask-size:var(--pas) var(--pas); mask-size:var(--pas) var(--pas);
  -webkit-mask-repeat:repeat; mask-repeat:repeat;
  -webkit-mask-position:0 0; mask-position:0 0}
.has-canvas .b--dots{display:none}

.cue{display:none}

/* =====================================================================
   Static form: the stacked page (no JS, reduced motion, short viewport)
   ===================================================================== */
.st-out{padding:calc(var(--vh) * 12) var(--pad) calc(var(--vh) * 5)}
.st-statement{color:var(--on-sheet)}
.st-statement .ln{display:block;white-space:nowrap}
.still{position:relative;height:calc(var(--vh) * 78);overflow:hidden}
.b--still{top:0;--pas:calc(var(--b-w) / 24)}
.still-cv{position:absolute;inset:0;width:100%;height:100%;display:block}

.dial{font-family:var(--font-mono);color:var(--on-sheet)}
.dial-row{display:grid;grid-template-columns:repeat(12,minmax(0,1fr));column-gap:1.4rem;align-items:center;height:3.4rem}
.dial-k{grid-column:1 / 3;font-size:.66rem;letter-spacing:.04em}
.dial-scale{grid-column:3 / 11;position:relative;height:100%}
.tick{position:absolute;top:50%;height:8px;margin-top:-4px}
.tick i{position:absolute;left:0;top:0;width:1px;height:8px;background:currentColor}
.tick b{position:absolute;left:7px;top:50%;transform:translateY(-50%);font-weight:400;font-size:.64rem;line-height:1;white-space:nowrap}
.dial-index{position:absolute;top:50%;left:50%;width:9px;height:9px;margin:-4.5px 0 0 -4px;border-radius:50%;background:currentColor}
.dial-pas{grid-column:11 / 13;justify-self:end;font-size:.66rem;white-space:nowrap}
.dial-pas[hidden]{display:none}
.dial-pk{letter-spacing:.04em}

.st-name{color:var(--on-sheet);padding:calc(var(--vh) * 10) var(--pad) 0;max-width:none}
.st-access{display:flex;align-items:baseline;align-items:last baseline;gap:.5em;padding:calc(var(--vh) * 8) var(--pad) calc(var(--vh) * 14);font-size:clamp(2.2rem, 1.3rem + 3.6vw, 4.4rem)}
.st-access-line{color:var(--on-sheet);flex:0 1 auto}
.bl{display:inline-block;width:0;height:0}
.leader{flex:1 1 auto;min-width:2em;height:.3em;
  background:radial-gradient(circle, var(--on-sheet) calc(var(--pas) * .16), transparent calc(var(--pas) * .16 + .6px)) 0 50% / var(--pas) var(--pas) repeat-x}
.sceau{flex:0 0 auto;width:44px;height:44px;align-self:center;transform:rotate(-4deg)}

.foot--henri{border-top:0}

/* =====================================================================
   Pinned form (html.trame-on): one 700svh pin, four stages
   ===================================================================== */
html.trame-on{scroll-behavior:auto}   /* the shared html{scroll-behavior:smooth} would animate Lenis' immediate jumps */
.trame-on .sec-trame{height:700vh;height:calc(var(--vh) * 700);background:var(--papier)}
.trame-on .trame-pin{position:sticky;top:0;height:100vh;height:calc(var(--vh) * 100);overflow:hidden;background:var(--papier)}
.trame-on .plate{position:absolute;inset:0;height:auto}
.trame-on .still{display:none}

/* load: painting and dots fade in together once decoded (M6 only) */
.trame-on .plate-art,.trame-on .trame{transition:opacity .4s var(--ease)}
.trame-wait .plate-art,.trame-wait .trame{opacity:0}

.trame-on .cue{display:block;position:absolute;z-index:5;left:var(--pad);bottom:calc(var(--vh) * 6);width:1px;height:26px;background:var(--on-sheet);opacity:.6}

/* statement: top left, line by line (480 ms, 90 ms apart, 14 px rise) */
.trame-on .st-out{position:absolute;z-index:6;left:0;top:0;padding:0;transition:opacity .2s var(--ease)}
.trame-on .st-out.on{opacity:0}
.trame-on .st-statement{position:absolute;left:var(--pad);top:calc(var(--vh) * 20);width:max-content}
.trame-on .st-statement .ln{opacity:0;transform:translate3d(0,14px,0);transition:opacity .48s var(--ease),transform .48s var(--ease)}
.trame-on .st-statement .ln:nth-child(2){transition-delay:.09s}
.trame-on .st-statement .ln:nth-child(3){transition-delay:.18s}
.trame-on .st-statement .ln:nth-child(4){transition-delay:.27s}
.trame-on .st-statement.on .ln{opacity:1;transform:none}

/* dial: a paper strip that docks at p = 0.25 (420 ms) */
.trame-on .dial{position:absolute;z-index:7;left:0;right:0;bottom:0;background:var(--papier);border-top:1px solid var(--rule);color:var(--graphite);transform:translate3d(0,101%,0);transition:transform .42s var(--ease)}
.trame-on .dial.on{transform:none}
.trame-on .dial-index{left:0;background:var(--encre);will-change:transform}
.trame-on .dial-pas{color:var(--encre)}
.trame-on .dial .tick b{color:var(--graphite)}

/* Henri: in the DOM for reading; the dot field writes it on screen */
.trame-on .st-name{position:absolute;width:1px;height:1px;padding:0;overflow:hidden;clip-path:inset(50%);white-space:nowrap}

/* access line, leader and seal: placed on the leader row by methode.js */
.trame-on .st-access{position:absolute;z-index:6;inset:0;display:block;padding:0;pointer-events:none}
.trame-on .st-access-line{position:absolute;left:var(--pad);top:calc(var(--vh) * 76);width:calc(100% - 2 * var(--pad));opacity:0;transform:translate3d(0,14px,0);transition:opacity .48s var(--ease),transform .48s var(--ease)}
.trame-on .st-access-line.on{opacity:1;transform:none}
.trame-on .leader{display:none}
.trame-on .sceau{position:absolute;left:calc(100% - var(--pad) - 22px);top:calc(var(--vh) * 84);width:44px;height:44px;margin:-22px 0 0 -22px;opacity:0;transform:scale(.5) rotate(-12deg);transition:opacity var(--seal) var(--ease),transform var(--seal) var(--ease)}
.trame-on .sceau.on{opacity:1;transform:scale(1) rotate(-4deg)}

/* =====================================================================
   Phone portrait (under 900 px wide)
   ===================================================================== */
@media (max-width:899px){
  .plate-mark{top:calc(var(--vh) * 11)}
  .plate-line{top:calc(var(--vh) * 20)}
  .st-out{padding-top:calc(var(--vh) * 9)}
  .trame-on .sec-trame{height:520vh;height:calc(var(--vh) * 520)}
  .trame-on .st-statement{top:calc(var(--vh) * 11)}
  .dial-row{display:flex;gap:.8rem;height:3rem}
  .dial-k{flex:0 0 auto}
  .dial-scale{flex:0 0 312px;width:312px}
  .st-access{flex-wrap:wrap}
  .st-access-line{flex-basis:100%}
  .trame-on .sceau{left:calc(100% - var(--pad) - 18px);width:36px;height:36px;margin:-18px 0 0 -18px}
}
@media (max-width:559px){ .dial-pas{display:none!important} }

/* =====================================================================
   Méthode: the section under the pin, on paper, read in focus (scrub.js §7).
   The thread goes on as a column of dots in the margin, same dot as .leader.
   ===================================================================== */
.methode{position:relative;background:var(--papier);padding-block:clamp(4rem,9vw,9rem)}
.methode .wrap{position:relative}
.methode .wrap::before{content:"";position:absolute;left:calc(var(--pad) / 2);top:0;bottom:0;width:var(--pas);
  background:radial-gradient(circle, var(--teal-ink) calc(var(--pas) * .16), transparent calc(var(--pas) * .16 + .6px)) 50% 0 / var(--pas) var(--pas) repeat-y}
.fringe--bas{top:0;bottom:auto;transform:scaleY(-1);--gx:0px}
@media (max-width:899px){ .methode .wrap::before{display:none} }

/* phone fixes: the header tag stays on one line; the dial scale takes the
   room that is left, so its last label (« 0 ») is not cut by the screen edge */
.site-head--plain .tag{white-space:nowrap}
@media (max-width:899px){ .dial-scale{margin-right:1.2rem} }
@media (max-width:559px){
  .dial-scale{flex:1 1 auto;width:auto}
}
/* short landscape phone (static form, under 560 px high): the phone rules put
   the wordmark under the fixed header and the access line on the wordmark;
   here the two stack in the flow under the header, the figure stays where it is */
@media (max-width:899px) and (max-height:559px){
  .plate{height:auto;min-height:100vh;min-height:calc(var(--vh) * 100);padding:calc(4.4rem + 1.2rem) var(--pad) 2rem}
  .plate-mark,.plate-line{position:relative;left:auto;top:auto}
  .sec-trame .plate-line{margin-top:1.1rem}
}
