/* =========================================================
   SCRUB — the edition section as a scroll-driven frame sequence. The ribbons arrive, resolve
   into the numeral, and the numeral parks beside the type on the last frame. Loaded by
   scroll.html alone, on top of styles.css.
   ========================================================= */

.scrub{position:relative;background:var(--bg)}
.js .scrub{height:340vh}
.scrub__stage{position:relative;display:grid;place-items:center;min-height:100svh;overflow:clip}
.js .scrub__stage{position:sticky;top:0;height:100svh}

/* The footage is lit on a ground of its own, a few levels above the page's and cooler with it,
   which reads as a lighter panel laid over the page. A touch of contrast pivots at mid grey:
   it drops that ground onto #070504 and leaves the gold where it is, a shade crisper. */
.scrub__canvas{position:absolute;inset:0;width:100%;height:100%;display:block;filter:contrast(1.06)}
/* the sequence is lit on its own ground; this carries its edges into the page's */
.scrub__veil{position:absolute;inset:0;pointer-events:none;background:
  linear-gradient(to bottom,var(--bg),transparent 16%,transparent 78%,var(--bg)),
  linear-gradient(var(--to-end),transparent 34%,rgba(4,3,2,.55) 62%,rgba(4,3,2,.86) 100%)}

.scrub__wrap{position:relative;z-index:2;width:min(100% - var(--pad) * 2,var(--wrap));margin-inline:auto;
  display:grid;grid-template-columns:minmax(0,1fr) minmax(0,1fr);align-items:center;align-content:center;
  gap:clamp(24px,5vw,84px)}
/* the words take the far column from the numeral: left in Arabic, right in English. The text
   itself keeps its own direction and sits against the gutter. */
.scrub__copy{grid-column:2;display:grid;justify-items:stretch;gap:16px;
  opacity:0;transform:translateY(24px);transition:opacity .9s var(--ease),transform .9s var(--ease)}
.scrub.is-landed .scrub__copy{opacity:1;transform:none}
.scrub__copy .eyebrow{margin:0}
.scrub__title{margin:0;font-size:clamp(30px,3.8vw,54px);font-weight:700;line-height:1.3;
  background:var(--metal-text);-webkit-background-clip:text;background-clip:text;color:transparent;
  font-feature-settings:'swsh' 1}
.scrub__text{max-width:38ch;margin:0;font-size:clamp(17px,1.55vw,22px);font-weight:300;line-height:1.9;color:var(--text)}
/* the right-hand cell is the numeral's room — the sequence lands it there, so the drawn
   numeral it holds only stands in where the sequence does not run */
.scrub__room{grid-column:1;min-height:0}
.scrub__room .numeral{display:none}

/* a hint that the section is scrubbed, fading out as soon as it is */
.scrub__cue{position:absolute;inset-block-end:clamp(18px,4vh,40px);inset-inline-start:50%;translate:-50% 0;z-index:3;
  display:flex;align-items:center;gap:10px;font-size:12.5px;letter-spacing:.14em;color:var(--text-3);
  transition:opacity .6s var(--ease)}
.scrub.is-landed .scrub__cue{opacity:0}
.scrub__cue i{display:block;width:26px;height:1px;background:var(--metal)}

/* ---------- phones: no sequence at all ----------
   Three screens of scroll and a hundred and ten frames buy little on a handset and cost a
   great deal. The section stands still, the drawn numeral takes the sequence's place above
   the words, and scrub.js never fetches a frame. */
@media (max-width:900px){
  .js .scrub{height:auto}
  .js .scrub__stage{position:relative;height:auto;min-height:0;
    padding-block:clamp(52px,11vw,96px) clamp(44px,9vw,82px)}
  .scrub__canvas,.scrub__veil,.scrub__cue{display:none}
  .scrub__wrap{grid-template-columns:1fr;gap:clamp(18px,5vw,28px);
    align-self:auto;align-content:start;justify-items:center;text-align:center}
  .scrub__copy{grid-column:auto;justify-items:center;opacity:1;transform:none}
  .scrub__text{margin-inline:auto}
  /* the numeral leads, the words follow */
  .scrub__room{display:grid;grid-column:auto;order:-1;place-items:center}
  .scrub__room .numeral{display:grid}
}

/* without scripting, or with motion turned down, it is simply the last frame and the words */
html:not(.js) .scrub__copy{opacity:1;transform:none}
@media (prefers-reduced-motion:reduce){
  .js .scrub{height:auto}
  .js .scrub__stage{position:relative;height:auto;min-height:0;padding-block:clamp(60px,9vw,120px)}
  .scrub__copy{opacity:1;transform:none}
  .scrub__cue{display:none}
}
