/* =====================================================================
   hubbleresearchlab.com · accueil (fusion : le sceau fermé + la scène Travaux)
   Chargé après ../_shared/styles.css et assets/css/com.css.
   Repris de la proposition « Le sceau fermé » :
   one page modifier (.sceau-page), one header modifier (.site-head--plain),
   one tag modifier (.tag--muet), one footer modifier (.site-foot--teal),
   and five hooks that are no-ops on any page that does not carry them:
   [data-seal], [data-manifest], [data-under], [data-halftone], .fil.
   Modes, set on <html> by proposal.js:
     (none)    no script: stacked page, every word visible, one open seal
     .m-pin    desktop, motion allowed: pinned stages + travelling seal
     .m-flow   under 900 px, motion allowed: plain flow + travelling seal
     .m-still  prefers-reduced-motion: stacked, motionless, three still seals
   Set by assets/js/accueil.js.
   Flat throughout: no blur, no shadow, no veil, no glow.
   ===================================================================== */

.sceau-page{
  --g: clamp(18px, 1.95vw, 28px);          /* gutter each side of the axis */
  --axe: 50%;                               /* x of the line */
  --sceau: min(280px, 31vh);                /* final seal, stage 3 */
  --pas: min(2.75vh, 26px);                  /* ledger row pitch */
  --encre-22: color-mix(in oklch, var(--encre) 22%, transparent);
  /* registration of the painted wax impression in tile-fidelite.webp,
     measured on the 1100 px file (red-mask moments + overlay check) */
  --cire-x: 0.501; --cire-y: 0.682;         /* centre, fraction of the side */
  --cire-a: 0.1018; --cire-b: 0.0555;       /* semi-axes, fraction of the side */
  --cire-phi: 2.85deg;                      /* rotation of the impression */
  --S: max(106vw, 150vh);                   /* rendered side of the painting */
  background: var(--papier);
}
.sceau-page section{padding-block:0}
.sceau-page p{max-width:none;margin:0}

/* ---- header: plain, no background, no blur ------------------------- */
.site-head--plain{position:absolute;top:0;left:0;right:0;background:none;-webkit-backdrop-filter:none;backdrop-filter:none}
.site-head--plain .brand{font-size:1.5rem}
.tag--muet{color:var(--graphite)}
.origine{position:absolute;left:calc(var(--axe) - 4px);bottom:-1px;width:9px;height:9px;transform:translateY(50%);pointer-events:none}
.origine::before,.origine::after{content:"";position:absolute;background:var(--encre)}
.origine::before{left:4px;top:0;width:1px;height:9px}
.origine::after{left:0;top:4px;width:9px;height:1px}

/* ---- the seal glyph (house glyph + 256 positions) ------------------ */
.sceau-svg{display:block;width:100%;height:100%;overflow:visible}
.sceau-svg .s-disque{fill:var(--vermillon);opacity:0}
.sceau-svg .s-bord{fill:none;stroke:var(--vermillon);stroke-width:1.25px;vector-effect:non-scaling-stroke}
.sceau-svg .s-int{fill:none;stroke:var(--vermillon);stroke-width:1px;vector-effect:non-scaling-stroke}
.sceau-svg .s-bits circle{fill:var(--vermillon);opacity:0}
.sceau-svg .s-bits circle.q{opacity:1;fill:none;stroke:var(--encre);stroke-width:.45}
.sceau-svg .s-coche{fill:none;stroke:var(--papier);stroke-width:2.4;stroke-linecap:round;stroke-linejoin:round;stroke-dasharray:40;stroke-dashoffset:40;opacity:0}
/* chargé: one dot per 1-bit, ring by ring, outer first */
[data-anneaux="1"] .s-bits .r1.b1,
[data-anneaux="2"] .s-bits :is(.r1,.r2).b1,
[data-anneaux="3"] .s-bits :is(.r1,.r2,.r3).b1,
[data-anneaux="4"] .s-bits .b1{opacity:1}
/* clos: solid disc, engraving reversed out in paper, rotated -4deg */
[data-etat="clos"] .sceau-svg{transform:rotate(-4deg)}
[data-etat="clos"] .s-disque{opacity:1}
[data-etat="clos"] .s-bord,[data-etat="clos"] .s-int{stroke:var(--papier)}
[data-etat="clos"] .s-bits .b1{fill:var(--papier)}
[data-etat="clos"] .s-bits circle.q{stroke:var(--encre)}
[data-etat="clos"] .s-coche{stroke-dashoffset:0;opacity:1}
/* the stamp: 560 ms, played once when the computed root equals the published one */
.frappe .sceau-svg{animation:frappe var(--seal) var(--ease) both}
.frappe .s-disque,.frappe .s-bord,.frappe .s-int,.frappe .s-bits circle{transition:opacity var(--seal) var(--ease),fill var(--seal) var(--ease),stroke var(--seal) var(--ease)}
.frappe .s-coche{transition:stroke-dashoffset var(--seal) var(--ease) 120ms,opacity 1ms linear 120ms}
@keyframes frappe{from{transform:scale(1.12) rotate(0deg)}to{transform:scale(1) rotate(-4deg)}}

/* ---- the still seals (no script / reduced motion) ------------------ */
.sceau-fixe{display:none;z-index:3}
html:not(.m-pin):not(.m-flow) .sceau-fixe--pli{display:block}
.m-still .sceau-fixe--registre,.m-still .sceau-fixe--cire{display:block}

/* ---- the thread: line + travelling seal (fixed layer) -------------- */
.fil,.sceau-voyage{display:none}
.m-pin .fil,.m-flow .fil{display:block;position:fixed;inset:0;pointer-events:none;z-index:38}
.fil span{position:absolute;left:0;top:0;width:1px;height:100vh;transform-origin:0 0;transform:scaleY(0)}
.fil-trace{background:var(--encre)}
.fil-avant{background:var(--encre);opacity:.22}
.m-pin .sceau-voyage,.m-flow .sceau-voyage{display:block;position:fixed;left:0;top:0;z-index:40;pointer-events:none;width:112px;height:112px;transform-origin:50% 50%}
/* sans script : aucune empreinte ne sera calculée, la colonne vide se retire */
html:not(.js) .registre .d{display:none}
/* the static rule at the axis for the height of main (no script, reduced motion) */
.sceau-main{position:relative}
html:not(.m-pin):not(.m-flow) .sceau-main::before{content:"";position:absolute;left:var(--axe);top:0;bottom:0;width:1px;background:var(--encre);opacity:.22;z-index:2}

/* =====================================================================
   1 · Pli
   ===================================================================== */
.pli{position:relative;height:100vh;height:100svh;min-height:560px}
.pli-axe{position:absolute;left:0;right:0;top:calc(49vh - 0.82em);font-size:clamp(3.2rem, 10vw, 9.5rem);
  display:grid;grid-template-columns:1fr 1fr;align-items:baseline}
.titre{font-size:1em;text-align:right;padding-right:var(--g);line-height:.9}
.titre-nom{display:block;font-family:var(--font-display);font-weight:400;font-size:1em;line-height:.9;letter-spacing:-.015em;color:var(--encre)}
.titre-rl{display:block;margin-top:.4rem;font-family:var(--font-sans);font-weight:600;font-size:clamp(.7rem, 1.1vw, .95rem);line-height:1;letter-spacing:.34em;margin-right:-.34em;text-transform:uppercase;color:var(--graphite)}
.statut{padding-left:var(--g);font-family:var(--font-mono);font-size:.82rem;line-height:1.55;color:var(--encre)}
.sceau-fixe--pli{position:absolute;left:var(--axe);top:74%;width:112px;height:112px;transform:translate(-50%,-50%);z-index:3}

/* =====================================================================
   2 · La phrase
   ===================================================================== */
.phrase{position:relative}
.phrase .scene{position:relative;padding-block:clamp(6rem, 18vh, 12rem)}
.citation{margin:0}
.citation-texte{display:grid;grid-template-columns:1fr 1fr;align-items:start;
  font-family:var(--font-display);font-weight:400;font-size:clamp(2.2rem, 1.3rem + 3.6vw, 4.4rem);line-height:1.04;letter-spacing:-.008em;color:var(--encre)}
.citation-texte em{font-family:var(--font-body);font-style:italic;font-weight:400}
.sujet-box{display:block;overflow:clip;padding-left:var(--pad);padding-right:var(--g);text-align:right}
.sujet{display:inline-block;text-align:right;will-change:transform}
.predicat-box{display:block;position:relative;padding-left:var(--g)}
.predicat{display:block}
.attrib{position:absolute;left:var(--g);top:calc(100% + 26px);font-family:var(--font-mono);font-size:.66rem;letter-spacing:.06em;line-height:1;color:var(--graphite)}

/* =====================================================================
   3 · Travaux (scène de la fusion : grammaire de ligne du registre)
   ===================================================================== */
.travaux{position:relative;counter-reset:t}
.travaux .scene{position:relative;padding-block:clamp(4rem,12vh,8rem)}
.t-lignes{list-style:none;margin:0;padding:0}
.t-ligne{position:relative;display:grid;grid-template-columns:1fr 1fr;align-items:center;min-height:15vh;counter-increment:t}
.t-ligne .g{display:block;text-align:right;padding:0 var(--g) 0 var(--pad)}
.t-ligne .g::before{content:counter(t,decimal-leading-zero);display:block;margin-bottom:.35rem;font-family:var(--font-mono);font-size:.66rem;letter-spacing:.06em;color:var(--graphite)}
.t-nom{font-family:var(--font-display);font-weight:400;font-size:clamp(1.8rem,1rem + 2.4vw,3.2rem);line-height:1.04;letter-spacing:-.008em;color:var(--encre);transition:opacity var(--fast) var(--ease)}
.t-ligne .trait{position:absolute;left:calc(var(--axe) - 4px);top:50%;width:9px;height:1px;background:var(--encre);opacity:.22;transition:opacity var(--fast) var(--ease)}
.t-ligne .d{display:block;overflow:clip;padding:0 var(--pad) 0 var(--g)}
.t-ligne .d-in{display:block;transition:transform 420ms var(--ease)}
.t-enonce{display:block;font-family:var(--font-body);font-size:1.05rem;line-height:1.5;max-width:46ch;color:var(--encre)}
.t-etat{display:block;margin-top:.5rem;font-family:var(--font-mono);font-size:.72rem;line-height:1.55;color:var(--graphite)}
.t-etat a{color:var(--encre);border-bottom:1px solid var(--encre-22)}
.t-ligne.fait .trait{opacity:1}
:is(.m-pin,.m-flow) .t-ligne:not(.fait) .t-nom{opacity:.34}
:is(.m-pin,.m-flow) .t-ligne:not(.fait) .d-in{transform:translateX(calc(-100% - var(--g) - 2px))}
.m-pin .travaux{height:260vh}
.m-pin .travaux .scene{position:sticky;top:0;height:100vh;padding:0;overflow:hidden}
.m-pin .t-lignes{position:absolute;left:0;right:0;top:20vh}
@media (max-width:899px){
  .travaux .scene{padding:3rem 20px 4rem var(--col)}
  .t-ligne{display:block;min-height:0;padding:1.4rem 0}
  .t-ligne .g{text-align:left;padding:0}
  .t-ligne .trait{left:calc(var(--axe) - var(--col));width:10px;top:2.6rem}
  .t-ligne .d{padding:0;margin-top:.5rem}
  :is(.m-pin,.m-flow) .t-ligne:not(.fait) .d-in{transform:translateX(calc(-100% - 60px))}
}

/* =====================================================================
   4 · Le manifeste (the ledger)
   ===================================================================== */
.manifeste{position:relative}
.manifeste .scene{position:relative;padding-block:clamp(4rem, 12vh, 8rem)}
.registre{position:relative;font-family:var(--font-mono);font-size:.82rem;line-height:1.2;color:var(--encre)}
.lignes{list-style:none;margin:0;padding:0}
.ligne{position:relative;display:grid;grid-template-columns:1fr 1fr;align-items:center;height:var(--pas);min-height:22px}
.ligne .g{display:block;text-align:right;padding-right:var(--g);white-space:nowrap;overflow:hidden;text-overflow:clip}
.ligne .chemin{opacity:.62;transition:opacity var(--fast) var(--ease)}
.ligne .taille{display:inline-block;margin-right:1.4em;font-size:.72rem;color:var(--graphite);opacity:0;transition:opacity var(--fast) var(--ease)}
.ligne .trait{position:absolute;left:calc(var(--axe) - 4px);top:50%;width:9px;height:1px;transform:translateY(-.5px);background:var(--encre);opacity:.22;transition:opacity var(--fast) var(--ease)}
.ligne .d{display:block;overflow:clip;padding-left:var(--g);white-space:nowrap}
.ligne .d-in{display:inline-flex;align-items:baseline;gap:.9em;transform:translateX(calc(-100% - var(--g) - 2px));transition:transform 420ms var(--ease)}
.ligne .cmp{display:inline-block;width:1ch;opacity:0;transition:opacity var(--fast) var(--ease)}
.ligne .hex{display:inline-grid;grid-template-columns:repeat(4, auto);column-gap:.62em;font-size:clamp(.66rem, .91vw, .82rem);letter-spacing:0;font-variant-numeric:tabular-nums}
.ligne .ms{font-size:.72rem;color:var(--graphite);opacity:0;transition:opacity var(--fast) var(--ease)}
/* states: computing (hex out of the axis), done (= or ≠, ink) */
.ligne.calc .d-in{transform:none}
.ligne.fait .chemin{opacity:1}
.ligne.fait .taille,.ligne.fait .ms,.ligne.fait .cmp{opacity:1}
.ligne.fait .trait{opacity:1}
.ligne.ecart .cmp{color:var(--encre)}
.somme{height:1px;background:var(--rule);margin:calc(2.8vh - var(--pas) / 2) var(--pad) 0}
.ligne--racine{margin-top:calc(3.3vh - var(--pas) / 2)}
.ligne--racine .chemin{opacity:.62}
.hex--racine i{font-style:normal;cursor:default}
.hex--racine i.q{background:var(--encre);color:var(--papier)}

.cloture{position:relative;height:calc(var(--sceau) + 14vh);margin-top:4vh}
.sceau-fixe--registre{position:absolute;left:var(--axe);top:50%;width:var(--sceau);height:var(--sceau);transform:translate(-50%,-50%)}
.note{position:absolute;left:calc(50% + var(--sceau) / 2 + 48px);top:calc(50% - 1.9em);right:var(--pad);font-size:.82rem;line-height:1.75}
.note::before{content:"";position:absolute;left:-36px;top:1.95em;width:24px;height:1px;background:var(--encre-22)}
.commande code{font-family:var(--font-mono);font-size:1em;color:var(--encre);user-select:all;-webkit-user-select:all;overflow-wrap:anywhere}
.indispo{color:var(--graphite)}
.indispo:not(:empty){margin-left:.6em}
.methode{margin-top:.55em;font-size:.72rem;color:var(--graphite);opacity:0;transition:opacity var(--fast) var(--ease)}
.methode.on{opacity:1}

/* =====================================================================
   5 · La lettre (one painting, halftone, réserve)
   ===================================================================== */
.lettre{position:relative;background:var(--teal);color:var(--teal-ink)}
.lettre::before{content:"";position:absolute;left:0;right:0;top:-64px;height:66px;z-index:1;
  background:radial-gradient(var(--teal) 30%, transparent 33%) 0 0/10px 10px}
.lettre .scene{position:relative;height:100vh;height:100svh;min-height:560px;overflow:hidden}
.planche{position:absolute;width:var(--S);height:var(--S);
  left:calc(50% - var(--cire-x) * var(--S));top:calc(60% - var(--cire-y) * var(--S))}
.planche-img{position:absolute;inset:0;width:100%;height:100%;max-width:none;
  filter:grayscale(1) brightness(1.8) contrast(1.6);mix-blend-mode:multiply;
  -webkit-mask-image:radial-gradient(#000 2.4px, transparent 2.9px);mask-image:radial-gradient(#000 2.4px, transparent 2.9px);
  -webkit-mask-size:9px 9px;mask-size:9px 9px}
.planche-trame{position:absolute;inset:0;width:100%;height:100%;display:none}
.trame-ok .planche-img{visibility:hidden}
.trame-ok .planche-trame{display:block}
.cible{position:absolute;left:50%;top:60%;width:9px;height:9px;transform:translate(-50%,-50%);z-index:2}
.cible::before,.cible::after{content:"";position:absolute;background:var(--teal-ink)}
.cible::before{left:4px;top:0;width:1px;height:9px}
.cible::after{left:0;top:4px;width:9px;height:1px}
.sceau-fixe--cire{position:absolute;left:50%;top:60%;z-index:3;
  width:calc(2 * var(--cire-a) * var(--S));height:calc(2 * var(--cire-a) * var(--S));
  transform:translate(-50%,-50%)}
.sceau-fixe--cire[data-etat="clos"]{transform:translate(-50%,-50%) rotate(var(--cire-phi)) rotateX(acos(calc(var(--cire-b) / var(--cire-a))))}

/* =====================================================================
   Footer, on teal
   ===================================================================== */
.site-foot--teal{background:var(--teal);color:var(--teal-ink);border-top:1px solid color-mix(in oklch, var(--teal-ink) 25%, transparent);padding-block:clamp(2.4rem, 4vw, 3.6rem)}
.site-foot--teal .wrap{align-items:baseline}
.site-foot--teal .brand{font-size:1.25rem}
.site-foot--teal .brand .rl{color:var(--teal-ink);opacity:.72}
.site-foot--teal .textlink{font-size:.86rem;color:var(--teal-ink);border-bottom-color:color-mix(in oklch, var(--teal-ink) 30%, transparent)}
.site-foot--teal .textlink:hover{color:var(--encre)}
.site-foot--teal .fnav--com a{color:var(--teal-ink)}
.site-foot--teal .fnav--com a:hover{color:var(--encre)}

/* =====================================================================
   .m-pin · desktop choreography (pins; the thread is drawn by accueil.js)
   ===================================================================== */
.m-pin .phrase{height:220vh}
.m-pin .manifeste{height:340vh}
.m-pin .lettre{height:200vh}
.m-pin .phrase .scene,.m-pin .manifeste .scene,.m-pin .lettre .scene{position:sticky;top:0;height:100vh;padding:0;overflow:hidden}
.m-pin .lettre .scene{overflow:hidden}
.m-pin .citation{position:absolute;left:0;right:0;top:50%;transform:translateY(-50%)}
.m-pin .registre{position:absolute;inset:0}
.m-pin .registre-tab{position:absolute;left:0;right:0;top:calc(13vh - var(--pas) / 2)}
.m-pin .cloture{position:static;height:auto;margin:0}
.m-pin .note{top:calc(80vh - 1.95em)}
.m-pin .sceau-voyage .sceau-svg{transform-origin:50% 50%}

/* 900 to 1279 px: fifteen rows above the seal, digests on one line */
@media (min-width:900px) and (max-width:1279px){
  .sceau-page{--sceau:min(220px, 24vh)}
  .ligne .g{font-size:.72rem}
  .ligne .taille,.ligne .ms{display:none}
  .ligne .hex{font-size:.6rem}
}

/* =====================================================================
   under 900 px · the axis moves to the margin of a deed (x = 44 px)
   ===================================================================== */
@media (max-width:899px){
  .sceau-page{--axe:44px;--col:96px;--sceau:176px;--S:224vw}
  .site-head--plain .wrap{gap:1rem}
  .site-head--plain .brand{font-size:1.3rem}
  .site-head--plain .brand .rl{display:none}

  .pli-axe{display:block;left:var(--col);right:20px;top:calc(46svh - 0.82em);font-size:3.2rem}
  .titre{text-align:left;padding:0}
  .titre-rl{margin-top:.55rem;font-size:.7rem;letter-spacing:.34em}
  .pli-axe .statut{padding:0;margin-top:.85rem}
  .sceau-fixe--pli{width:72px;height:72px}

  .phrase .scene{padding:4rem 20px 4.5rem var(--col)}
  .citation-texte{display:block;font-size:clamp(2.2rem, 1.3rem + 3.6vw, 4.4rem)}
  .sujet-box,.predicat-box,.predicat{display:inline;padding:0;overflow:visible}
  .sujet{display:inline}
  .sujet br,.predicat br{display:none}
  .attrib{position:static;display:block;margin-top:1.4rem}

  .manifeste .scene{padding:3rem 20px 9rem var(--col)}
  .ligne{display:block;height:auto;min-height:0;padding:.7rem 0 .8rem}
  .ligne .g{display:flex;flex-wrap:wrap;align-items:baseline;column-gap:.8em;text-align:left;padding:0 3.6rem 0 0;white-space:normal;overflow:visible;overflow-wrap:anywhere}
  .ligne .g .taille{order:2;margin:0;flex-basis:100%;min-height:1.3em}   /* its own line, reserved before the size is known */
  .ligne .trait{left:calc(var(--axe) - var(--col));width:10px;top:1.3rem;transform:none}
  .ligne .d{padding:0;margin-top:.35rem;overflow:clip;min-height:2.6em}
  .ligne .ms{position:absolute;right:0;top:.85rem}
  .ligne .d-in{transform:translateX(calc(-100% - 60px));gap:.7em}
  .ligne .hex{grid-template-columns:repeat(2, auto);row-gap:.15em;font-size:min(.82rem, 3vw)}   /* two groups of 16 fit the column down to 360 px */
  .somme{margin:1rem 0 0}
  .ligne--racine{margin-top:.6rem}
  .cloture{height:auto;margin:0;display:flex;flex-direction:column}
  .sceau-fixe--registre{position:relative;left:auto;top:auto;transform:none;margin:2rem auto 0;width:176px;height:176px}
  .m-flow .cloture::before{content:"";display:block;height:240px}
  .note{position:relative;left:auto;top:auto;right:auto;margin-top:1.6rem;min-height:10em;order:-1}
  .note::before{display:none}

  .planche{top:calc(58% - var(--cire-y) * var(--S))}
  .cible,.sceau-fixe--cire{top:58%}

  .site-foot--teal .wrap{flex-direction:column;gap:1.2rem}
}

/* =====================================================================
   reduced motion: stacked, still, complete
   ===================================================================== */
@media (prefers-reduced-motion:reduce){
  .frappe .sceau-svg{animation:none}
  .sceau-page *{transition:none!important}
  .ligne .d-in{transform:none}
}
