/* #rooms: The room, back (brief 7.5), theme light. Rebuilt 29 Oct 2026 as a scroll film (Jared: "make it bigger
   with text next to it and as you scroll that video plays"); since 30 Oct 2026 the film opens on the storeroom
   (brief 7.4's words; Jared: "Add the storeroom"). The old overlapping cards are in _source/Replaced sections
   (29 Oct 2026)/, this file before the storeroom in its Before storeroom chapter (30 Oct 2026)/.

   Static layout (reduced motion, no GSAP, and until rooms.js runs): the storeroom's words, the storeroom photo as
   it was taken (a rounded floating card with its caption), then the room's words, the two renders as rounded
   floating cards, side by side from 768px and stacked under it, each with its mono label on a glass pill, then the
   caption. The chapter list is hidden (the cards carry the labels); so is the re-projected storeroom of the film.

   Film layout (#rooms.rooms--film, added by js/sections/rooms.js): the section is pinned; .rooms-pin, its first
   screen, holds the words and one big stage, rounded and floating, and the section adds some air below it for the
   join with How it works. The stage holds .rooms-cam, the camera: the re-projected storeroom on top, both renders
   under it (all three share one camera) and two bands of light, moved with one matrix3d per frame. The words sit
   beside it, the storeroom's and the room's in one grid cell (only one set shows at a time, rooms.js swaps them
   with the film), so the column, and the stage beside or under it, keep one size for the whole film:
   - side by side (screens at least 560px wide and wider than tall, phones held sideways included): the eyebrow,
     heading and body or chapter list in the left 4 columns (5 under 1200px wide), vertically centred; the stage
     from the next column to 12px from the right edge of the screen, from under the nav to 12px from the bottom (the
     hall's inset and radius).
   - stacked (narrow screens, and screens at least as tall as wide): the words at the top, the stage under them to
     12px from the screen's sides and bottom.
   Until 30 Oct 2026 the side by side layout began at 768px, so a phone held sideways under 768px wide (667x375,
   740x360) got the stacked one on a screen 375px tall: the words took the top 233px and the film showed as a strip
   128px tall, cut off by the bottom of the screen with its caption.
   The caption sits on a glass pill in the stage's bottom-right corner, so it reads at full contrast on any frame. */

#rooms {
  --rooms-inset: 12px;                              /* the stage's inset from the screen edge (as the hall) */
  --rooms-r: 0px;                                   /* the stage's radius (as the hall) */
  --rooms-pill: rgba(245, 242, 237, .80);
}


/* ------------------------------------------------------------------ static layout */
#rooms .rooms-inner { display: flex; flex-direction: column; }
#rooms .rooms-copy { display: block; }
#rooms .rooms-words { display: grid; justify-items: start; gap: clamp(16px, 2.2vh, 24px); }
#rooms .rooms-title { max-width: 21em; }
#rooms .rooms-text { margin: 0; }
#rooms .rooms-chapters { display: none; }
/* the storeroom as it was taken, between its words and the room's */
#rooms .rooms-still { margin: clamp(32px, 5vh, 56px) 0 clamp(56px, 9vh, 112px); }
#rooms .rooms-still > img {
  display: block; width: 100%; height: auto; aspect-ratio: 16 / 9; object-fit: cover; object-position: 72% 50%;
  border-radius: var(--r-media); background: var(--media-bg); box-shadow: var(--shadow-float);
}
#rooms .rooms-still__caption { margin-top: 16px; }
#rooms .rooms-shot--0 { display: none; }
#rooms .rooms-stage { margin-top: clamp(32px, 5vh, 56px); }
#rooms .rooms-cam { display: grid; grid-template-columns: minmax(0, 1fr); gap: 16px; }
#rooms .rooms-shot {
  position: relative; overflow: hidden; isolation: isolate; margin: 0;
  aspect-ratio: 16 / 10; border-radius: var(--r-media);
  background: var(--media-bg); box-shadow: var(--shadow-float);
}
#rooms .rooms-shot > img {
  position: absolute; inset: 0; width: 100%; height: 100%; max-width: none;
  object-fit: cover; object-position: 50% 50%;
  user-select: none; -webkit-user-select: none; -webkit-user-drag: none;
}
#rooms .rooms-light { display: none; }
#rooms .rooms-caption { margin-top: 16px; }

/* the mono label, on a light glass pill in the card's top-left corner */
#rooms .rooms-label {
  position: absolute; z-index: 2; top: clamp(12px, 1.4vw, 22px); left: clamp(12px, 1.4vw, 22px);
  display: inline-flex; align-items: center; gap: 9px;
  height: 30px; padding: 0 13px 0 11px; border-radius: var(--r-pill);
  color: var(--ink); white-space: nowrap;
  background: var(--rooms-pill);
  border: 1px solid rgba(255, 255, 255, .62);
  -webkit-backdrop-filter: blur(12px) saturate(140%);
          backdrop-filter: blur(12px) saturate(140%);
  box-shadow: 0 10px 22px -14px rgba(11, 11, 13, .45);
}
#rooms .rooms-label::before {
  content: ""; flex: none; width: 6px; height: 6px; border-radius: 1px; background: var(--yellow);
}

@media (min-width: 768px) {
  #rooms .rooms-cam { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--col-gap); }
}
@media (max-width: 767.98px) {
  #rooms .rooms-stage { margin-top: 32px; }
  #rooms .rooms-label { height: 26px; padding: 0 10px 0 9px; gap: 8px; }
  #rooms .rooms-still > img { aspect-ratio: 4 / 3; }
}


/* ------------------------------------------------------------------ film layout: shared */
#rooms.rooms--film {
  --rooms-split: 4;                                 /* columns the words take on the left (side by side) */
  /* air under the stage once the pin lets go, so How it works keeps the page's rhythm (about 260px from the
     stage to its eyebrow at 1440x900); while pinned it lies below the screen */
  --rooms-after: clamp(72px, 13vh, 150px);
  padding-block: 0 var(--rooms-after);
}
/* .rooms-pin is the stage's containing block: one screen, in flow inside the pinned section (an absolutely placed
   stage whose containing block is the pinned element itself was reported by Chrome as a layout shift each time
   the pin took hold or let go) */
#rooms.rooms--film .rooms-pin { position: relative; height: 100vh; height: 100svh; }
#rooms.rooms--film .rooms-inner { height: 100%; }
/* the storeroom's words and the room's share one cell, so the column keeps the taller set's size all through */
#rooms.rooms--film .rooms-copy { position: relative; z-index: 1; display: grid; grid-template-columns: minmax(0, 1fr); }
#rooms.rooms--film .rooms-words { grid-area: 1 / 1; min-width: 0; }
#rooms.rooms--film .rooms-still { display: none; }

/* the stage: rounded and floating; its screen clips the camera (clip-path as well as overflow, so Safari keeps the
   rounded corners round over the 3D-transformed camera) */
#rooms.rooms--film .rooms-stage {
  margin: 0; border-radius: var(--rooms-r);
  background: var(--media-bg); box-shadow: var(--shadow-float);
}
#rooms.rooms--film .rooms-screen {
  position: relative; width: 100%; height: 100%; overflow: hidden; isolation: isolate;
  border-radius: inherit; clip-path: inset(0 round var(--rooms-r));
}
/* the camera: sized and moved by rooms.js (width, height and a matrix3d about its top-left corner) */
#rooms.rooms--film .rooms-cam {
  display: block; position: absolute; left: 0; top: 0; width: 1792px; height: 1120px;
  transform-origin: 0 0;
}
#rooms.rooms--film .rooms-cam.is-live { will-change: transform; }   /* while the film can be seen */
#rooms.rooms--film .rooms-shot {
  position: absolute; inset: 0; overflow: visible; isolation: auto;
  aspect-ratio: auto; border-radius: 0; background: none; box-shadow: none;
}
#rooms.rooms--film .rooms-shot > img { object-fit: fill; }
#rooms.rooms--film .rooms-shot--1 { z-index: 1; }
/* the second render waits behind a fully clear mask until its change (rooms.js moves the mask's edge) */
#rooms.rooms--film .rooms-shot--2 {
  z-index: 2;
  -webkit-mask-image: linear-gradient(90deg, transparent 0 100%); mask-image: linear-gradient(90deg, transparent 0 100%);
}
/* the storeroom, re-projected into the renders' camera, lies over both behind a fully solid mask until its change
   (rooms.js moves the edge, then clears it); its img shows an inline blurred preview of it until the photo is in
   (since 30 Oct 2026), over a dim fill, so the room back never shows early */
#rooms.rooms--film .rooms-shot--0 {
  display: block; z-index: 4; background: rgb(74, 70, 66);
  -webkit-mask-image: linear-gradient(90deg, #000 0 100%); mask-image: linear-gradient(90deg, #000 0 100%);
}
/* the labels stay in the figures for screen readers; the chapter list shows them */
#rooms.rooms--film .rooms-label {
  position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px; border: 0;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; box-shadow: none;
  -webkit-backdrop-filter: none; backdrop-filter: none;
}
/* the bands of light that ride the two changes, storeroom to room and robotics to art and drama (moved by
   rooms.js; the storeroom's is wider and brighter, so the seam between the two cameras is lost in it) */
#rooms.rooms--film .rooms-light {
  display: block; position: absolute; left: 0; top: -25%; height: 150%; width: 600px; z-index: 3;
  pointer-events: none; opacity: 0; transform-origin: 50% 50%;
  background: linear-gradient(90deg, rgba(255, 248, 238, 0) 0%, rgba(255, 248, 238, .55) 32%,
    rgba(255, 250, 242, 1) 50%, rgba(255, 248, 238, .55) 68%, rgba(255, 248, 238, 0) 100%);
}
#rooms.rooms--film .rooms-light--store { z-index: 5; }

/* the caption, on a glass pill in the stage's bottom-right corner */
#rooms.rooms--film .rooms-caption {
  position: absolute; z-index: 2; right: 14px; bottom: 14px; margin: 0;
  display: inline-flex; align-items: center; height: 28px; padding: 0 12px; border-radius: var(--r-pill);
  color: rgba(11, 11, 13, .74); white-space: nowrap;
  background: var(--rooms-pill);
  border: 1px solid rgba(255, 255, 255, .6);
  -webkit-backdrop-filter: blur(12px) saturate(140%);
          backdrop-filter: blur(12px) saturate(140%);
}

/* the chapter list: each layout's label over a thin bar that fills as its part of the film plays */
#rooms.rooms--film .rooms-chapters {
  display: grid; gap: clamp(14px, 2.2vh, 22px); width: 100%;
  margin-top: clamp(18px, 4.4vh, 52px);
}
#rooms .rooms-chapter {
  --fill: 0;
  position: relative; display: flex; align-items: baseline; gap: 14px;
  padding-top: clamp(12px, 1.7vh, 16px);
  opacity: .3; transition: opacity .8s var(--ease-out);
}
#rooms .rooms-chapter.is-active { opacity: 1; }
#rooms .rooms-chapter__bar { position: absolute; left: 0; right: 0; top: 0; height: 2px; }
#rooms .rooms-chapter__bar::before {
  content: ""; position: absolute; left: 0; right: 0; top: .5px; height: 1px; background: var(--line);
}
#rooms .rooms-chapter__fill {
  position: absolute; inset: 0; border-radius: 1px; background: var(--yellow);
  transform-origin: 0 50%; transform: scaleX(var(--fill));
}
#rooms .rooms-chapter__num {
  flex: none; font-family: var(--font-mono); font-size: var(--fs-label); line-height: 1.2; font-weight: 500;
  letter-spacing: .08em; color: var(--muted); font-variant-numeric: tabular-nums;
}
#rooms .rooms-chapter__name {
  font-size: clamp(20px, min(1.7vw, 3.2vh), 30px); line-height: 1.12; font-weight: 400; letter-spacing: -.02em;
}


/* ------------------------------------------------------------------ film layout: side by side */
@media (min-width: 560px) and (orientation: landscape) {
  #rooms.rooms--film .rooms-inner {
    display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); column-gap: var(--col-gap);
    align-items: center; padding-top: var(--nav-clear); padding-bottom: var(--rooms-inset);
  }
  #rooms.rooms--film .rooms-copy {
    grid-column: 1 / span var(--rooms-split); grid-row: 1; align-self: stretch; align-items: center;
    padding-right: clamp(4px, 1vw, 16px);
  }
  #rooms.rooms--film .rooms-words { display: flex; flex-direction: column; align-items: flex-start; gap: 0; }
  #rooms.rooms--film .rooms-words > .eyebrow { margin-bottom: clamp(16px, 2.6vh, 26px); }
  #rooms.rooms--film .rooms-title { max-width: none; font-size: clamp(32px, min(3.5vw, 6.2vh), 60px); }
  #rooms.rooms--film .rooms-text {
    margin-top: clamp(16px, 2.8vh, 30px); max-width: 30em;
    font-size: clamp(15px, min(1.32vw, 2.3vh), 19px); line-height: 1.5;
  }
  /* the stage starts at the next grid column (the .wrap's content edge plus the copy's columns) and runs to 12px
     from the screen's right edge (on screens wider than 1920px it stops where it would on a 1920px screen, so the
     composition stays balanced); .rooms-pin (the full width, one screen tall) is its containing block */
  #rooms.rooms--film .rooms-stage {
    --rooms-colw: calc((min(100%, var(--max)) - 2 * var(--gutter) - 11 * var(--col-gap)) / 12);
    position: absolute; top: var(--nav-clear); bottom: var(--rooms-inset);
    right: max(var(--rooms-inset), calc((100% - 1920px) / 2 + var(--rooms-inset)));
    left: calc(max(0px, (100% - var(--max)) / 2) + var(--gutter) + var(--rooms-split) * (var(--rooms-colw) + var(--col-gap)));
  }
}
@media (min-width: 560px) and (max-width: 1199.98px) and (orientation: landscape) {
  #rooms.rooms--film { --rooms-split: 5; }
}
/* phones held sideways (375 to 430px tall): the words smaller, so they fit under the nav beside the stage even with
   the browser's bar showing */
@media (orientation: landscape) and (max-height: 430px) {
  #rooms.rooms--film .rooms-title { font-size: clamp(22px, 7.4vh, 32px); }
  #rooms.rooms--film .rooms-chapter__name { font-size: clamp(16px, 4.6vh, 22px); }
  #rooms.rooms--film .rooms-words > .eyebrow { margin-bottom: 10px; }
  /* the storeroom's words no smaller than 13.5px (they were 12 to 13.3px until the review of 30 Oct 2026) */
  #rooms.rooms--film .rooms-text { margin-top: 10px; font-size: clamp(13.5px, 3.8vh, 14px); line-height: 1.4; }
}


/* ------------------------------------------------------------------ film layout: stacked (narrow screens, screens at least as tall as wide) */
@media (max-width: 559.98px), (orientation: portrait) {
  #rooms.rooms--film .rooms-inner {
    display: flex; flex-direction: column;
    padding-top: calc(var(--nav-clear) + clamp(4px, 1.4vh, 16px)); padding-bottom: var(--rooms-inset);
  }
  /* both word sets sit at the foot of their shared cell, just over the stage: the storeroom's are taller, so the
     room's words leave air under the nav, not a gap over the film (30 Oct 2026, after the review) */
  #rooms.rooms--film .rooms-copy { flex: none; align-items: end; }
  #rooms.rooms--film .rooms-words { gap: clamp(12px, 1.8vh, 18px); }
  #rooms.rooms--film .rooms-text { font-size: clamp(15px, min(2.4vw, 2.1vh), 19px); line-height: 1.45; }
  #rooms.rooms--film .rooms-title { max-width: 18em; font-size: clamp(30px, min(5.4vw, 4.6vh), 54px); }
  #rooms.rooms--film .rooms-chapters {
    grid-template-columns: repeat(2, minmax(0, 1fr)); column-gap: 16px; margin-top: clamp(2px, 1vh, 10px);
  }
  #rooms.rooms--film .rooms-chapter { gap: 10px; }
  #rooms.rooms--film .rooms-chapter__name { font-size: clamp(16px, 2.6vw, 24px); }
  /* the stage takes the rest of the screen, out to 12px from its sides (past the gutter) */
  #rooms.rooms--film .rooms-stage {
    position: relative; flex: 1 1 0; min-height: 200px;
    margin: clamp(14px, 2.4vh, 26px) calc(var(--rooms-inset) - var(--gutter)) 0;
  }
}
@media (max-width: 767.98px) and (orientation: portrait) {
  #rooms.rooms--film { --rooms-r: 0px; }
  #rooms.rooms--film .rooms-title { font-size: min(36px, 8.8vw); }
  #rooms.rooms--film .rooms-text { font-size: clamp(14.5px, 2vh, 16.5px); }
  #rooms.rooms--film .rooms-caption { right: 10px; bottom: 10px; height: 26px; padding: 0 10px; }
}
