/* =========================================================================
   RISHØJ & DE LORENZO — opening sequence (styles)
   Loaded only by the entry page. Tokens come from rdl.css.
   ========================================================================= */
.opening{--track:330vh}
.track{height:var(--track)}
/* The opening owns the frame until it hands it over. .bseq sits at z-index 2
   and --seam pulls it up so it overlaps the last quarter of the pinned track;
   without this the first station painted over the canvas from p 0.71, which
   put a brand plate on screen underneath the arrival type — the two things
   that must never be present together. --seam is untouched: the sequence
   still overlaps exactly as it did, it is simply behind the canvas while the
   canvas is still saying something. When the pin ends, the stage scrolls away
   and the station is already in its place. */
#stage{position:relative;z-index:3;height:100vh;height:100svh;width:100%;overflow:hidden;background:var(--room-ground)}
/* ...and lets go the moment it is done. Set from render() on p alone, so it is
   exactly as reversible as everything else in the sequence. .bseq is z-index 2,
   so 0 puts the whole stage — canvas, arrival, every layer — behind the
   stations without taking anything out of the paint. */
#stage[data-released="1"]{z-index:0}
/* Handed over means the canvas has nothing left to say. Its context is
   {alpha:false}, so it cannot be cleared — clearRect paints black — and the
   opaque frame it still holds was showing through the brand sequence, which is
   why the first brand sat on a ground of its own whatever palette was chosen.
   Hidden, not cleared, and back the moment it is not released. */
#stage[data-released="1"] canvas{visibility:hidden}
/* THE CUE BELONGS TO THE APPROACH, AND ONLY TO IT. Arriving straight at the
   sequence -- the nav's Brands link, which is a hash jump -- lands the page
   past the opening with no scroll event to follow, so the scrubbed p is still
   0 and render() leaves the cue at full opacity. Measured at 1440x900:
   released "1", inline opacity 1, the block sitting at y 2714 over the first
   brands, which is why "Explore our universe" was turning up between Wolford
   and Banana Moon. Tie it to the stage's own released state, which is already
   1 there. It comes back if the visitor scrolls up into the approach. */
#stage[data-released="1"] #cue{ visibility:hidden }
/* ...and the same again from the scroll position, because data-released is
   decided by the render loop and the loop has not run when the page opens
   already past the opening. At 390x844 that case measured released "0" with
   the cue visible. See the cue gate in opening.js. */
.opening[data-past="1"] #cue{ visibility:hidden }
/* !important, and it is earned: ScrollTrigger writes the spacer's z-index as an
   INLINE style when it builds the wrapper, so a normal rule in a stylesheet
   cannot reach it. An important author declaration beats a normal inline one,
   which also means GSAP rewriting that inline value on refresh cannot take the
   release back. */
.pin-spacer[data-released="1"]{z-index:0 !important}
html.no-gsap #stage{position:sticky;top:0}

/* --- the frame: sharp plate + a defocused copy masked to the periphery --- */
#sharp,#soft{position:absolute;inset:0;width:100%;height:100%;display:block}
#soft{
  opacity:0;
  filter:blur(0px);
  -webkit-mask-image:radial-gradient(ellipse 86% 86% at 50% 50%, rgba(0,0,0,0) 44%, rgba(0,0,0,.30) 66%, #000 96%);
          mask-image:radial-gradient(ellipse 86% 86% at 50% 50%, rgba(0,0,0,0) 44%, rgba(0,0,0,.30) 66%, #000 96%);
}

.layer{position:absolute;inset:0;pointer-events:none}
#vignette{
  background:radial-gradient(138% 108% at 50% 50%, rgba(0,0,0,0) 44%, rgba(0,0,0,.24) 74%, rgba(0,0,0,.76) 100%);
  opacity:.22;
}
/* The gathering light at the threshold was rgba(255,253,248,.58) on screen
   blend — additive white over a ground that is already 0.9155. It is the
   third of the three near-white sources that stacked centre-frame, and it is
   gone. The beat it carried is now made in the canvas, by taking less away
   from the surfaces near the doorway rather than by adding anything to them,
   so it can never pass --room-ground. */
#bloom{ display:none }
#dark{background:#000;opacity:0}
/* The arrival sits over the interior, and the interior is daylight now, so the
   scrim that used to darken behind white type lifts behind dark type instead. */
/* Retired with the arrival card's move into the room. A screen-space wash
   behind screen-space type is exactly what the card stopped being. */
#scrim{ display:none }
#grain{background-image:url("../ui/grain.png");background-size:170px 170px;opacity:.04;mix-blend-mode:overlay}

/* --- the hairline that opens the arrival --- */
#hair{
  position:absolute;left:50%;top:50%;width:1px;height:0;
  background:linear-gradient(180deg,transparent,color-mix(in srgb, var(--room-ink) 42%, transparent),transparent);
  transform:translate(-50%,-50%);opacity:0;pointer-events:none;
}

/* --- type --- */
/* The arrival lives in the dark field now, not over a daylight hall, so it is
   set in the ground rather than the ink. As dark ink on the field it measured
   1.29:1 — the type was there and could not be read. It is gone before the
   field lifts, so it never has to work on both. */
/* The arrival type sits on the FACADE now, not on the room, so its tone is
   derived from what is behind it — the same solve the cue and the header
   use. The fallback is the light end, which is what survives the glazing. */
#arrival{--arr-ink:#e8e6e4;--arr-halo:rgba(12,11,10,.45);
  position:absolute;inset:0;will-change:transform,opacity;display:flex;flex-direction:column;
  align-items:center;justify-content:center;text-align:center;opacity:0;
  color:var(--arr-ink);text-shadow:0 0 18px var(--arr-halo),0 1px 8px var(--arr-halo);
  /* Same reason as the header: the tone is solved against what the camera is
     looking at, and a solve that lands in one step reads as a glitch on type
     this size. The first solve now happens before the card fades up, so this
     only ever eases a change made while it is already on screen. */
  transition:color .24s linear, text-shadow .24s linear}
/* It was clipped at both viewport edges: .46em of tracking on a nowrap line
   is wider than a phone. It wraps and gives up tracking before it gives up
   being read. */
#arrival .mark{margin:0;font-size:clamp(.92rem,2.3vw,2.1rem);font-weight:200;letter-spacing:clamp(.18em,.46em,.46em);text-indent:.46em;max-width:92vw;text-wrap:balance}
/* 90px and drawn with scaleX, not a width animated from 0: the width was
   rewriting the card's layout on every frame of the arrival. Centred in
   the column, a scaleX about the centre is the same line. */
#arrival .rule{width:90px;height:1px;margin:2.4em 0 2.2em;transform:scaleX(0);
  transform-origin:50% 50%;background:color-mix(in srgb, var(--arr-ink) 72%, transparent);
  transition:background-color .24s linear}
#arrival .line{
  font-size:clamp(.76rem,1.15vw,.98rem);font-weight:300;letter-spacing:.30em;text-indent:.30em;
  color:var(--room-ground);max-width:34ch;line-height:2.2;text-transform:uppercase;
}

/* --- brand coda --- */
#brands{position:absolute;inset:0;pointer-events:none}
.brand{position:absolute;inset:0;display:flex;align-items:center;justify-content:center;opacity:0;isolation:isolate;will-change:transform,opacity}
.brand .plate{position:relative;height:64vh;aspect-ratio:3/4;overflow:hidden;background:#0b0b0b;will-change:transform}
.brand .plate img{width:100%;height:100%;object-fit:cover;display:block;filter:brightness(.80) contrast(1.06)}
.brand .plate::after{
  content:"";position:absolute;inset:0;
  background:
    radial-gradient(92% 34% at 50% 50%, rgba(0,0,0,.62), rgba(0,0,0,0) 74%),
    linear-gradient(180deg,rgba(0,0,0,.30),rgba(0,0,0,0) 34%,rgba(0,0,0,0) 60%,rgba(0,0,0,.46));
}
.brand .bname{
  position:absolute;left:0;right:0;top:50%;transform:translateY(-50%);text-align:center;
  font-size:6vw;font-weight:200;letter-spacing:.02em;line-height:.92;color:#fff;
  mix-blend-mode:difference;white-space:nowrap;will-change:transform;
}
.brand .bmeta{
  position:absolute;left:50%;bottom:9vh;transform:translateX(-50%);
  display:flex;gap:2.4em;align-items:baseline;font-size:.63rem;letter-spacing:.34em;text-indent:.34em;
  text-transform:uppercase;color:rgba(244,242,239,.78);white-space:nowrap;
}
.brand .bmeta .idx{color:rgba(244,242,239,.34)}

/* --- chrome --- */
/* The cue has to say two things: that there is something in here, and that
   scrolling is how you get to it. It used to say only "SCROLL", at 0.6rem,
   and it faded out inside the first 3% of the track — one nudge of a
   trackpad and the only instruction on the page was gone. */
/* THE CUE SITS ON THE BUILDING. Measured at 1440x900 at p=0, it was set in
   --room-ink (L 0.023) at bottom:5vh, which places it on the shopfront glass
   (L 0.045) — the darkest surface in the photograph. Dark ink on near-black:
   1.31:1 for the lead, 1.87:1 for the instruction. The falling line only
   cleared 4.34:1 because it hangs lower, over the pavement.

   Moving it down to the pavement would have been the wrong fix — 4.34:1 is
   still under the floor and the lead is 14.72px, which is not large text. So
   the position stays and stops being an accident: the words sit IN the glass,
   the way the company name is already painted on the facade in the
   photograph, and the ink inverts to suit what is behind them.

   --cue-ink and --cue-halo are SOLVED at runtime from the luminance actually
   sampled behind the text, not hardcoded — see tuneCue() in opening.js. The
   cue is light because the glass is dark, not because the theme is. The
   values below are only the fallback for the first frame. */
#cue{
  --cue-ink:#e8e6e4;
  /* .86, not .72, and solved rather than judged. When sampling is refused —
     file:, a tainted canvas — the block stays at its CSS position, and at
     390x844 that puts the falling line below the facade entirely, on the page's
     own ground at L 0.916. Light ink on a light ground: measured 3.80:1 at a
     .72 halo. The halo has to carry its own ground so the cue survives losing
     the measurement. At .86 the same worst case is 5.3:1. */
  --cue-halo:rgba(12,11,10,.86);
  position:absolute;left:50%;bottom:5vh;transform:translateX(-50%);
  display:flex;flex-direction:column;align-items:center;gap:.95em;
  text-align:center;
  color:var(--cue-ink);
  /* the halo is the inverse of the ink, so a bright reflection in the glass
     cannot take a character with it */
  text-shadow:0 0 18px var(--cue-halo), 0 1px 8px var(--cue-halo);
}
/* the invitation: set as words, not as a label — tracking loose enough to
   belong to the page, tight enough to still read as a sentence */
#cue .cue__lead{
  font-size:clamp(.74rem,1.05vw,.92rem); font-weight:300;
  letter-spacing:.3em; text-indent:.3em; text-transform:uppercase;
}
/* the instruction, quieter, directly above the thing that falls */
/* The instruction was at 62% of the ink and the bar track at 26%. Those
   alphas were survivable against a light ground and are not here: every part
   has to clear 4.5:1 against the glass, so the quiet ones are quiet by a few
   points of alpha, not by half. */
#cue .cue__act{
  font-size:.56rem; letter-spacing:.42em; text-indent:.42em;
  text-transform:uppercase;
  color:color-mix(in srgb, var(--cue-ink) 88%, transparent);
}
/* The line needs the same halo the words get, and text-shadow does not
   apply to a div. Without it the line is the one part with no local
   ground of its own — measured, it fell to 3.74:1 at 390x844 whenever the
   sampling could not run and the block stayed at its CSS position, over
   the pavement. box-shadow is the exact analogue and it travels with
   --cue-halo, so it inverts with the ink. */
#cue .bar{position:relative;width:1px;height:62px;background:color-mix(in srgb, var(--cue-ink) 62%, transparent);overflow:hidden;
  box-shadow:0 0 14px 3px var(--cue-halo), 0 0 5px 1px var(--cue-halo)}
#cue .bar i{position:absolute;left:0;top:-50px;width:1px;height:50px;background:var(--cue-ink);animation:fall 2.6s cubic-bezier(.7,0,.3,1) infinite}
@keyframes fall{0%{top:-50px}62%{top:50px}100%{top:50px}}

/* --- a light in the doorway ----------------------------------------------
   One soft light inside the door aperture, sized and placed by draw() from the
   door's own projected rect — about 170px wide on screen at 1440 — so it is
   local to the opening and not a screen-centred radial. Its colour is
   --room-ground, so compositing it over anything can never produce a pixel
   brighter than the ground: the P18 rule holds by construction rather than by
   tuning. Shallow and slow: it should read as light left on, not as a pulse. */
#dlight{
  position:absolute; z-index:1; pointer-events:none; opacity:0;
  background:radial-gradient(ellipse 62% 46% at 50% 62%,
    color-mix(in srgb, var(--room-ground) 74%, transparent) 0%,
    color-mix(in srgb, var(--room-ground) 34%, transparent) 38%,
    color-mix(in srgb, var(--room-ground) 8%,  transparent) 68%,
    transparent 100%);
  animation:dbreathe 5.2s ease-in-out infinite;
}
@keyframes dbreathe{ 0%,100%{ filter:brightness(.88) } 50%{ filter:brightness(1) } }

@media (prefers-reduced-motion: reduce){
  /* The words and a static light remain, at full contrast. */
  #cue .bar i{ animation:none; top:6px; height:38px }
  #dlight{ animation:none }
  #arrival, #arrival .rule{ transition:none }
}
#progress{position:fixed;left:0;bottom:0;height:1px;width:100%;background:color-mix(in srgb, var(--room-ink) 8%, transparent);z-index:40}
#progress i{display:block;height:100%;width:0;background:color-mix(in srgb, var(--room-ink) 35%, transparent)}
#tag{position:fixed;left:22px;bottom:18px;z-index:41;font-size:.53rem;letter-spacing:.3em;text-transform:uppercase;color:rgba(255,255,255,.28)}
#loader{position:fixed;inset:0;z-index:60;background:var(--room-ground);display:flex;align-items:center;justify-content:center}
#loader .lbar{width:min(190px,34vw);height:1px;background:color-mix(in srgb, var(--room-ink) 16%, transparent)}
#loader .lbar i{display:block;height:100%;width:0;background:color-mix(in srgb, var(--room-ink) 70%, transparent);transition:width .35s ease}

@media (max-width:820px){
  .opening{--track:264vh}
  .brand .plate{height:46vh}
  .brand .bmeta{gap:1.3em;font-size:.55rem;bottom:7vh}
  #arrival .mark{letter-spacing:.3em;text-indent:.3em}
}

/* --- the seam: a way out of the sequence for anyone who wants one --------- */
#skip{
  position:fixed; right:clamp(20px,4.4vw,72px); bottom:clamp(18px,3vh,34px); z-index:62;
  font-size:.6rem; letter-spacing:.3em; text-indent:.3em; text-transform:uppercase;
  color:color-mix(in srgb, var(--room-ink) 62%, transparent);
  opacity:0; pointer-events:none; transition:opacity .9s cubic-bezier(.22,.61,.36,1), color .4s;
}
#skip[data-ready="1"]{ opacity:1; pointer-events:auto }
#skip[data-done="1"]{ opacity:0; pointer-events:none }
#skip:hover{ color:var(--room-ink) }
#tag{ display:none }
