/* loader — the load curtain as an overture.
   loader.js restages .curtain as two layers (charcoal panel, vermilion sliver behind it) and owns the clock:
   the wait is a ~1s score (delays below count from its first beat, "100" lands at 1000ms) that loader.js
   speeds up or slows down to end at INTRO_START; the lift is pinned to INTRO_START → INTRO_END.
   Every fx-loader-* element is created by loader.js, so none of this exists without JS or motion. */

/* Plain curtain (loader.js absent or late): stay blank for .3s, so the restaging never shows as a cut. */
@keyframes fx-loader-hold{from{opacity:0}}
@media (prefers-reduced-motion:no-preference){
  .curtain-mark{animation:curtain-mark 1.5s var(--out) .3s both,fx-loader-hold .3s linear .3s backwards}
  .curtain-meta{animation:fx-loader-hold .3s linear .3s backwards}
}

.js .curtain.fx-loader{display:block;background:none;animation:none;overflow:hidden;
  --fx-loader-lag:18ms; /* the sliver leaves this far behind the panel. The lift peaks near 4px/ms, so 18ms is a band of about 8% of the screen for a blink (45ms was a fifth of it) */
  --fx-loader-lift:calc(var(--fx-loader-len) - var(--fx-loader-lag))} /* each layer's travel time: the sliver lands on INTRO_END */

/* ---------- exit: the panel lifts, the sliver chases it ---------- */
/* Both layers are one panel radius taller than the screen: the rounded foot only shows once it is moving. */
.fx-loader-panel,.fx-loader-sliver{position:absolute;inset:0 0 calc(var(--r-panel)*-1);border-radius:0 0 var(--r-panel) var(--r-panel);will-change:transform;
  animation:fx-loader-lift var(--fx-loader-lift) var(--inout) var(--fx-loader-out) both}
.fx-loader-sliver{background:var(--verm);animation-delay:calc(var(--fx-loader-out) + var(--fx-loader-lag))}
.fx-loader-panel{background:var(--ink);overflow:hidden}
/* the stage hangs back while its panel leaves, so the rising edge swallows it from below */
.fx-loader-stage{position:absolute;inset:0 0 var(--r-panel);display:grid;grid-template-rows:auto 1fr auto auto;
  padding:clamp(16px,1.8vw,26px) var(--gutter) clamp(18px,2.4vw,34px);color:var(--paper);will-change:transform;
  animation:fx-loader-hang var(--fx-loader-lift) var(--inout) var(--fx-loader-out) both}
@keyframes fx-loader-lift{to{transform:translate3d(0,-100.5%,0)}}
@keyframes fx-loader-hang{to{transform:translate3d(0,32vh,0)}}

/* ---------- small labels: the top row drops in, the foot row rises ---------- */
.fx-loader-bar{display:flex;justify-content:space-between;align-items:flex-end;gap:20px;color:var(--stone);
  font:500 clamp(10px,.74vw,12px)/1.5 var(--tech);letter-spacing:.14em;text-transform:uppercase}
.fx-loader-m{display:block;overflow:hidden}
.fx-loader-m>i{display:block;font-style:normal;max-width:17em}
.fx-loader-m>*{animation:fx-loader-rise .7s var(--out) 50ms both}
.fx-loader-top .fx-loader-m>*{animation-name:fx-loader-drop}
@keyframes fx-loader-rise{from{transform:translate3d(0,110%,0)}}
@keyframes fx-loader-drop{from{transform:translate3d(0,-110%,0)}}

/* ---------- wordmark: letter by letter out of a mask, with a little overshoot ---------- */
.fx-loader-word{place-self:center;display:flex;font-family:var(--display);font-stretch:125%;font-weight:800;font-size:clamp(3.4rem,19vw,13rem);line-height:.72;
  animation:fx-loader-breath 1s var(--out) 50ms both} /* one slow breath in while the letters land */
.fx-loader-l{overflow:hidden;padding:.36em .03em 0;margin:-.36em -.05em 0} /* line-height .72 puts the mask floor on the baseline; the top padding is headroom for the É accent and the overshoot */
.fx-loader-l>b{display:block;font-weight:inherit;transform-origin:0 100%;
  animation:fx-loader-letter .66s var(--spring) calc(80ms + var(--fx-loader-i)*65ms) both}
@keyframes fx-loader-letter{from{transform:translate3d(0,140%,0) rotate(9deg)}}
@keyframes fx-loader-breath{from{transform:scale(.94)}}

/* ---------- counter: 00 · 27 · 64 · 89 · (held breath) · 100 ---------- */
.fx-loader-count{display:flex;align-items:flex-start;color:var(--paper);font:500 clamp(3.2rem,8vw,7.4rem)/1 var(--tech);letter-spacing:0;text-transform:none;font-variant-numeric:tabular-nums}
.fx-loader-col{height:1em;overflow:hidden}
.fx-loader-col>span{display:block;animation:fx-loader-count .9s var(--spring) calc(var(--fx-loader-i)*30ms) both} /* --fx-loader-i: hundreds lead, units trail */
.fx-loader-col b{display:block;height:1em;font-weight:inherit;text-align:center}
.fx-loader-count sup{align-self:flex-start;margin:.5em 0 0 .5em;color:var(--stone);font-size:clamp(10px,.74vw,12px);line-height:1;letter-spacing:.14em;
  animation:fx-loader-hold .4s linear 170ms both}
/* each strip holds one digit per stop; one stop = 20% of the strip */
@keyframes fx-loader-count{
  0%{transform:translate3d(0,20%,0)}
  12%,16%{transform:none}
  30%,35%{transform:translate3d(0,-20%,0)}
  50%,55%{transform:translate3d(0,-40%,0)}
  68%,84%{transform:translate3d(0,-60%,0)}
  100%{transform:translate3d(0,-80%,0)}
}

/* ---------- hairline: the track draws from the right, the fill answers from the left on the counter's beats ---------- */
.fx-loader-line{position:relative;height:2px;margin-top:clamp(12px,1.4vw,20px)}
.fx-loader-line::before,.fx-loader-line>i{content:"";position:absolute;inset:0}
.fx-loader-line::before{top:1px;background:rgba(241,242,236,.2);transform-origin:right;animation:fx-loader-draw .7s var(--out) both}
.fx-loader-line>i{background:var(--paper);transform-origin:left;animation:fx-loader-fill .9s var(--out) 30ms both}
@keyframes fx-loader-draw{from{transform:scaleX(0)}}
@keyframes fx-loader-fill{
  0%,16%{transform:scaleX(0)}
  30%,35%{transform:scaleX(.27)}
  50%,55%{transform:scaleX(.64)}
  68%,84%{transform:scaleX(.89)}
  100%{transform:scaleX(1)}
}
