/* #hall: the hall, set out and stacked away (brief 7.3). Theme dark.

   Default (reduced motion, no GSAP, no JS): a still frame split at the middle by the yellow line, with both lines
   of the heading, so the page reads without any animation.
   html.has-motion: a full-bleed frame (inset 12px, radius 24px) that js/sections/hall.js pins for 1.5 screens,
   wiping site-hall-set-out.jpg away from right to left over render-hall-cleared.jpg (--w goes 0 to 1).
   While pinned the frame starts below the fixed nav (--nav-clear, 84px) so the bar never sits over the photo.

   The heading and the caption sit on the page's gutter lines (the same left edge as the foot's words that follow):
   --hall-pad-x is the .wrap content edge measured from the frame (100cqw is the frame's width). Phones use 20px.

   Lining the two renders up: the frame is a size container. .hall__plate is the cleared render's cover box
   (1100 x 738), and the set-out render is placed in that box so its curtain top, stage lip and stage floor line
   land on the cleared render's, and the two curtains share a centre. The cleared render is shown mirrored
   (scaleX(-1)) so both stages sit left of centre. Measured in image px: set-out (2000 x 1342) curtain x 427 to 989,
   top 184, lip 482, floor 546; cleared (1100 x 738, mirrored) curtain x 130 to 560, top 48, lip 239, floor 280.
   One scale fits all three heights: set-out px x .6409 = cleared px. (The cleared stage opening is wider, so the
   curtain ends differ by about 35 cleared px each side.) Tested 29 Oct: moving the set-out render right by those
   35 px (left -6.704%) lines up the right-hand curtain ends and clears the thin dark strip beside the line at p0.5,
   but the line then cuts the set-out stage steps around p0.44 and the left-hand curtain step doubles near p0.8,
   so the curtains stay centred. The real fix is a set-out and cleared pair rendered from the same camera. */

#hall {
  --hall-inset: 12px;
  --hall-radius: 0px;   /* square since 31 Oct 2026 (the website look) */
  --hall-pad-x: calc(max(0px, (100cqw + 2 * var(--hall-inset) - var(--max)) / 2) + var(--gutter) - var(--hall-inset));
  --hall-pad-y: clamp(24px, 5.4vh, 56px);
  padding-block: var(--section-pad) clamp(40px, 7vh, 88px);
}
#hall .hall__pin { padding-inline: var(--hall-inset); }

#hall .hall__frame {
  --w: .5;                 /* the wipe: 0 shows the hall set out, 1 shows it cleared */
  --fx: .5; --fy: .38;     /* the point of the cleared render the frame centres on when it has to crop */
  position: relative; isolation: isolate; overflow: hidden;
  width: 100%; aspect-ratio: 16 / 10; max-height: calc(100vh - 2 * var(--hall-inset));
  border-radius: var(--hall-radius);
  background: var(--ink-3);
  color: #fff;
  container-type: size;
}

/* ------------------------------------------------------------------ the two renders */
#hall .hall__media { position: absolute; inset: 0; margin: 0; }
#hall .hall__zoom { position: absolute; inset: 0; transform-origin: 50% 46%; }
#hall .hall__layer { position: absolute; inset: 0; overflow: hidden; }
#hall .hall__layer--before { clip-path: inset(0 calc(var(--w) * 100%) 0 0); }
#hall .hall__plate {
  --pw: max(100cqw, 149.0515cqh);
  --ph: max(100cqh, 67.0909cqw);
  position: absolute; width: var(--pw); height: var(--ph);
  left: clamp(100cqw - var(--pw), 50cqw - var(--fx) * var(--pw), 0px);
  top: clamp(100cqh - var(--ph), 50cqh - var(--fy) * var(--ph), 0px);
}
#hall .hall__img {
  position: absolute; display: block; max-width: none;
  user-select: none; -webkit-user-select: none; -webkit-user-drag: none;
}
#hall .hall__img--after { inset: 0; width: 100%; height: 100%; transform: scaleX(-1); }
#hall .hall__img--before { left: -9.886%; top: -9.475%; width: 116.524%; height: 116.540%; }

/* ------------------------------------------------------------------ the wipe edge: a 2px yellow line */
#hall .hall__edge {
  position: absolute; inset: 0; z-index: 2; pointer-events: none;
  transform: translate3d(calc(var(--w) * -100%), 0, 0);
}
#hall .hall__edge-line {
  position: absolute; top: 0; bottom: 0; right: -1px; width: 2px;
  background: var(--yellow);
  box-shadow: 0 0 0 .5px rgba(11,11,13,.14), 0 0 20px 1px rgba(255,203,62,.45);
}

/* ------------------------------------------------------------------ legibility: a soft dark gradient, strongest bottom left,
   with a small pool bottom right so the caption reads at 4.5:1 or better over the bright floor */
#hall .hall__shade {
  position: absolute; inset: 0; z-index: 1; pointer-events: none;
  background:
    linear-gradient(to top, rgba(11,11,13,.46) 0%, rgba(11,11,13,.2) 20%, rgba(11,11,13,0) 42%),
    radial-gradient(58% 54% at 0% 100%, rgba(11,11,13,.34) 0%, rgba(11,11,13,0) 72%),
    radial-gradient(50% 44% at 100% 100%, rgba(11,11,13,.46) 0%, rgba(11,11,13,0) 74%);
}

/* ------------------------------------------------------------------ heading and caption */
#hall .hall__title {
  position: absolute; z-index: 3; left: var(--hall-pad-x); bottom: var(--hall-pad-y);
  display: grid; margin: 0; color: #fff;
}
/* each phrase rises through its own mask, padded so descenders are not clipped */
#hall .hall__mask { display: block; overflow: clip; padding-block: .1em .2em; margin-block: -.1em -.2em; }
#hall .hall__phrase { display: block; }
/* set like every other caption on the page (13px sentence case), in white over the bottom-right pool of the shade */
#hall .hall__caption {
  position: absolute; z-index: 3; right: var(--hall-pad-x); bottom: calc(var(--hall-pad-y) + var(--fs-l) * .14);
  font-family: var(--font-sans); font-size: var(--fs-caption); line-height: 1.45; font-weight: 400;
  letter-spacing: 0; text-transform: none; color: rgba(255, 255, 255, .84);
}

/* ------------------------------------------------------------------ motion: pinned full-bleed frame, clear of the nav */
html.has-motion #hall .hall__pin { height: 100vh; height: 100svh; padding: var(--nav-clear) var(--hall-inset) var(--hall-inset); }
html.has-motion #hall .hall__frame { --w: 0; height: 100%; aspect-ratio: auto; max-height: none; }
html.has-motion #hall .hall__mask { grid-area: 1 / 1; }
/* until hall.js takes over: the set-out line shows, the cleared line waits below its mask */
html.has-motion #hall .hall__phrase--b { transform: translate3d(0, 135%, 0); }
html.has-motion #hall .hall__edge-line { opacity: 0; }

/* ------------------------------------------------------------------ portrait frames crop the sides: keep the stage end and the stacks */
@media (min-width: 768px) and (max-aspect-ratio: 1 / 1) {
  #hall .hall__frame { --fx: .56; }
}

/* ------------------------------------------------------------------ phones */
@media (max-width: 767.98px) {
  #hall { --hall-pad-x: 20px; --hall-pad-y: 22px; }
  #hall .hall__frame { --fx: .585; aspect-ratio: 4 / 5; }
  #hall .hall__title { font-size: clamp(30px, 8.8vw, 40px); bottom: calc(var(--hall-pad-y) + 28px); }
  #hall .hall__caption { bottom: var(--hall-pad-y); }
}
