/* Motion runs whatever the device's reduced-motion setting: the owner's call, 15 Nov 2026 (Windows with
   Animation effects off showed a half-still site). What used to wait for no-preference is @media all. */
/* ==========================================================================
   scene.css: the scenes in the heroes of the six audience pages and the home
   page. Loaded only by pages that have one (the assembler adds it where the
   page has data-scene), after base.css and site.css, whose tokens, bill, lead,
   ticket, quiet and switch it uses. The script is assets/js/scene/scene.js;
   how it fits together is in website/SCENES.md.
   ========================================================================== */

.scene-poster { padding-block: 0; overflow: clip; isolation: isolate; --tour-ms: 6500ms; }

/* Words left, the model right. The model's cell bleeds to the poster's top and
   right edges; the rule with the eight views runs along the bottom. */
.scene-grid {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 0.86fr) minmax(0, 1.14fr);
  grid-template-rows: minmax(0, 1fr) auto;
  column-gap: clamp(1.5rem, 3vw, 3rem);
  /* The first screen under the site's header: the rule with the views stays in sight. */
  min-height: clamp(38rem, calc(100svh - var(--header-h, 4.3rem)), 58rem);
}

.scene-copy { grid-column: 1; grid-row: 1; align-self: center; padding-block: clamp(2.5rem, 6vh, 4.5rem) 1.5rem; position: relative; z-index: 1; }
.scene-intro .bill { font-size: clamp(2.75rem, 3.6vw + 1rem, 4.6rem); }
/* A page whose headline has a long line: a size down, so no line breaks in two. */
.scene-poster--long .scene-intro .bill { font-size: clamp(2.5rem, 3vw + 1rem, 4rem); }
.scene-intro .lead { margin-top: 1.4rem; max-width: 34ch; }
.scene-intro .actions { margin-top: 2rem; }

.scene-intro .try-line { margin-top: 0.9rem; }
/* Who the made-up organisation is, and the tour: a programme note under the buttons. */
.scene-note {
  margin-top: 1.4rem; padding-top: 0.9rem; max-width: 34rem;
  border-top: 1px solid color-mix(in srgb, currentColor 30%, transparent);
  font-size: var(--fs-sm); line-height: 1.5; color: var(--on-purple-2);
}
.scene-note .quiet { display: flex; width: fit-content; margin-top: 0.35rem; color: var(--on-purple); }

/* Buttons that read as the site's quiet links. */
.scene-plain { background: none; border: 0; padding: 0; color: inherit; text-align: left; }
.scene-plain.quiet { min-height: 2.75rem; }

/* ---------- The stage --------------------------------------------------- */
.scene-frame { grid-column: 2; grid-row: 1; position: relative; min-height: 22rem; }
.scene-stage {
  position: absolute; top: 0; bottom: 0; left: 0;
  /* out to the viewport's right edge, past the container's gutter */
  right: calc(-1 * max(var(--gutter), (100vw - var(--container)) / 2 + var(--gutter)));
}
.scene-stage canvas { display: block; width: 100%; height: 100%; opacity: 0; touch-action: pan-y; }
.scene-stage.is-ready canvas { opacity: 1; }
.scene-stage.is-hot canvas { cursor: pointer; }

/* While the model loads: its name and a filling ink line, as the live demo does. */
.scene-loading {
  position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%);
  display: grid; gap: 0.6rem; justify-items: center;
  font-size: var(--fs-sm); font-weight: 650; color: var(--on-purple-2);
  transition: opacity 0.3s;
}
.scene-loading i { display: block; width: 9rem; height: 2px; background: color-mix(in srgb, currentColor 28%, transparent); position: relative; overflow: hidden; }
.scene-loading i::after { content: ''; position: absolute; inset: 0; background: var(--ink2); transform-origin: left; animation: scene-fill 2.4s var(--ease) infinite; }
.scene-stage.is-ready .scene-loading, .scene-stage.is-flat .scene-loading { opacity: 0; visibility: hidden; }
@keyframes scene-fill { from { transform: scaleX(0); } to { transform: scaleX(1); } }

/* ---------- Pins: a tag on a 1px leader line ending in a dot ------------- */
.scene-pins { position: absolute; inset: 0; overflow: hidden; pointer-events: none; transition: opacity 0.35s; }
[data-scene]:not([data-view='whole']) .scene-pins { opacity: 0; visibility: hidden; transition: opacity 0.2s, visibility 0s 0.2s; }
.scene-pin {
  position: absolute; left: 0; top: 0;
  display: flex; flex-direction: column; align-items: center;
  padding: 0; border: 0; background: none; color: var(--on-purple);
  font-size: var(--fs-xs); font-weight: 750; font-stretch: 82%; line-height: 1; white-space: nowrap;
  pointer-events: auto;
  transform: translate3d(var(--x, -200px), var(--y, -200px), 0) translate(-50%, -100%);
}
.scene-pin b {
  font-weight: inherit; padding: 0.42rem 0.6rem 0.4rem; border-radius: var(--r-sm);
  background: var(--purple-deep); color: var(--on-purple);
  transition: background 0.2s, color 0.2s, transform 0.35s var(--ease);
}
.scene-pin::before { content: ''; order: 1; width: 1px; height: var(--len, 30px); background: currentColor; opacity: 0.85; }
.scene-pin::after { content: ''; order: 2; width: 7px; height: 7px; border-radius: 50%; background: currentColor; box-shadow: 0 0 0 3px color-mix(in srgb, currentColor 25%, transparent); }
.scene-pin:hover b, .scene-pin.is-hot b, .scene-pin:focus-visible b { background: var(--ink2); color: var(--on-ink2); transform: translateY(-2px); }
.scene-pin:focus-visible { outline: 0; }
.scene-pin:focus-visible b { outline: 2px solid var(--on-purple); outline-offset: 2px; }

/* ---------- Full size: the screen being looked at opens in the site's viewer ---- */
.scene-stage.is-zoomable canvas { cursor: zoom-in; }
.scene-enlarge {
  position: absolute; left: 1rem; bottom: 1rem; z-index: 2;
  display: inline-flex; align-items: center; gap: 0.5rem;
  min-height: 2.75rem; padding: 0.5rem 0.95rem 0.5rem 0.8rem;
  border: 0; border-radius: var(--r-sm);
  background: var(--purple-deep); color: var(--on-purple);
  font-size: var(--fs-sm); font-weight: 700;
  transition: background 0.2s, color 0.2s, transform 0.35s var(--ease);
}
.scene-enlarge[hidden] { display: none; }
.scene-enlarge svg { width: 1.1rem; height: 1.1rem; flex: none; }
.scene-enlarge:hover { background: var(--ink2); color: var(--on-ink2); transform: translateY(-2px); }
/* The real captures, kept in the page for the viewer and for browsers without WebGL. */
/* Not drawn at all, so the browser does not fetch the full-size captures (they are loading="lazy") until the
   viewer asks for one: the model has its own, lighter copies. */
.scene-shots { display: none; }

/* ---------- Before the model: a still of the whole set ------------------- */
/* What is there while the model loads, where there is no WebGL and where there is no script. */
.scene-still { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; object-position: center; pointer-events: none; }
.scene-stage.is-ready .scene-still { display: none; }
/* With a still in place the set is simply there, then alive: no loading line across the middle of it. */
.scene-still ~ .scene-loading { display: none; }
.scene-stage.is-flat .scene-still { inset: 9% 6% 6%; width: 88%; height: 85%; }
[data-scene]:not([data-view='whole']) .scene-stage.is-flat .scene-still { display: none; }

/* ---------- Without WebGL: the real capture, pasted flat ----------------- */
/* The rows are given a size (not left to their content) so a tall capture is held to the stage's height. */
.scene-flat { position: absolute; inset: 7% 9% 7% 3%; display: grid; grid-template: minmax(0, 1fr) auto / minmax(0, 1fr); place-items: center; }
.scene-flat[hidden] { display: none; }
.scene-flat-open { display: grid; grid-template: minmax(0, 1fr) / minmax(0, 1fr); place-items: center; width: 100%; height: 100%; min-height: 0; padding: 0; border: 0; background: none; cursor: zoom-in; }
.scene-flat img { max-width: 100%; max-height: 100%; width: auto; height: auto; border-radius: var(--r); border: 1px solid color-mix(in srgb, var(--on-purple) 32%, transparent); background: var(--sheet); }
.scene-flat-note { text-align: center; font-size: var(--fs-sm); color: var(--on-purple-2); }
.scene-stage.is-flat canvas, .scene-stage.is-flat .scene-pins:not(.is-list) { display: none; }
/* With no model to click, the screens are a plain row of names along the top. */
.scene-pins.is-list { display: flex; flex-wrap: wrap; gap: 0.5rem; padding: 1rem; inset: 0 0 auto; pointer-events: auto; opacity: 1 !important; visibility: visible !important; }

/* ---------- One screen's facts ------------------------------------------- */
.scene-stop-title {
  font-size: clamp(1.9rem, 1.9vw + 1.05rem, 2.85rem);
  font-weight: 850; font-stretch: 82%; line-height: 1; letter-spacing: -0.026em; text-wrap: balance;
  max-width: 15ch;
}
.scene-stop-title:focus { outline: 0; }
.scene-stop-who { margin-top: 0.8rem; font-size: var(--fs-sm); font-weight: 650; color: var(--on-purple-2); }
.scene-points { margin: 1.5rem 0 0; max-width: 27rem; }
.scene-points > div { padding: 0.8rem 0 0.9rem; border-top: 1px solid color-mix(in srgb, currentColor 30%, transparent); }
.scene-points > div:last-child { border-bottom: 1px solid color-mix(in srgb, currentColor 30%, transparent); }
.scene-points dt { font-weight: 750; font-stretch: 90%; font-size: 1.0625rem; letter-spacing: -0.012em; line-height: 1.25; }
.scene-points dd { margin: 0.25rem 0 0; font-size: var(--fs-sm); line-height: 1.5; color: var(--on-purple-2); }
.scene-stop-foot { display: flex; flex-wrap: wrap; align-items: center; gap: 0.75rem 1.5rem; margin-top: 1.25rem; }
.scene-stop-note { margin-top: 0.9rem; max-width: 27rem; }
.scene-stop-nav { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 0.25rem 1.5rem; margin-top: 1.1rem; max-width: 27rem; }
.scene-stop-nav button { display: inline-flex; align-items: center; gap: 0.45em; min-height: 2.75rem; font-size: var(--fs-sm); font-weight: 650; color: var(--on-purple-2); }
.scene-stop-nav button:hover { color: var(--on-purple); }
.scene-stop-nav svg { width: 1em; height: 1em; transition: transform 0.3s var(--ease); }
.scene-stop-nav [data-go]:hover svg { transform: translateX(-3px); }
.scene-stop-nav [data-next]:hover svg { transform: translateX(3px); }

/* A small outlined action: open and close the folding phone. */
.scene-chip {
  min-height: 2.5rem; padding: 0.4rem 0.95rem; border-radius: var(--r-sm);
  background: transparent; color: var(--on-purple); font-weight: 700; font-size: var(--fs-sm);
  border: 1.5px solid color-mix(in srgb, currentColor 55%, transparent);
  transition: border-color 0.2s, background 0.2s;
}
.scene-chip:hover { border-color: currentColor; background: color-mix(in srgb, var(--on-purple) 10%, transparent); }

/* ---------- With the script running: one panel at a time ----------------- */
.is-live .scene-copy { display: grid; }
.is-live .scene-copy > * { grid-area: 1 / 1; align-self: center; }
.is-live .scene-intro, .is-live .scene-stop {
  opacity: 0; visibility: hidden; transform: translateY(12px);
  transition: opacity 0.2s, transform 0.2s, visibility 0s 0.2s;
}
.is-live .scene-intro.is-on, .is-live .scene-stop.is-on {
  opacity: 1; visibility: visible; transform: none;
  transition: opacity 0.5s var(--ease) 0.12s, transform 0.6s var(--ease) 0.12s, visibility 0s;
}
.scene-poster:not(.is-live) .scene-stop { margin-top: 2.5rem; }
.scene-poster:not(.is-live) .scene-rail { display: none; }

/* ---------- The rule along the bottom ------------------------------------ */
.scene-rail { grid-column: 1 / -1; grid-row: 2; padding-bottom: clamp(1.1rem, 3vh, 1.9rem); position: relative; z-index: 1; }
.scene-rail .switch-wrap { margin-top: 0; max-width: none; }
.scene-rail .switch-row { flex-wrap: nowrap; gap: 0 1.5rem; }
.scene-rail .switch-label { flex: none; }
.scene-rail .switch { flex: 1; flex-wrap: nowrap; gap: 0 1.5rem; }
.scene-rail .switch li { flex: none; }
.scene-rail .switch button { white-space: nowrap; }
/* On the tour the ink bar fills for as long as each screen is held. */
.is-touring .scene-rail .switch button[aria-pressed='true']::after { animation: scene-fill var(--tour-ms) linear both; }

/* ---------- A short laptop screen: the words draw in, so the rule stays in the first screen ---- */
@media (min-width: 900px) and (max-height: 820px) {
  .scene-copy { padding-block: 1.5rem 0.75rem; }
  .scene-intro .bill, .scene-poster--long .scene-intro .bill { font-size: clamp(2.4rem, 2.6vw + 0.9rem, 3.5rem); }
  .scene-intro .lead { margin-top: 1rem; font-size: 1.0625rem; }
  .scene-intro .actions { margin-top: 1.25rem; }
  .scene-intro .try-line { margin-top: 0.6rem; }
  .scene-note { margin-top: 0.9rem; padding-top: 0.7rem; }
}

/* ---------- Narrower: words, then the model, the rule, the facts --------- */
@media (max-width: 1159.98px) {
  .scene-rail .switch-row { align-items: flex-start; flex-direction: column; }
  .scene-rail .switch-label { padding-top: 0.6rem; }
  .scene-rail .switch { flex-wrap: wrap; row-gap: 0; }
}
@media (max-width: 899.98px) {
  .scene-grid { grid-template-columns: minmax(0, 1fr); grid-template-rows: auto; min-height: 0; row-gap: 0; }
  .scene-copy, .is-live .scene-copy { display: contents; }
  .scene-intro { grid-column: 1; grid-row: 1; padding-block: clamp(2.5rem, 8vw, 4rem) 1.5rem; position: relative; z-index: 1; }
  .scene-intro .lead { max-width: 46ch; }
  /* The width is said outright: where the height is capped (a phone on its side), Safari otherwise narrows
     the box to keep the ratio and leaves the model as a small square at the left. Never shorter than 21rem. */
  .scene-frame { grid-column: 1; grid-row: 2; min-height: 0; width: calc(100% + 2 * var(--gutter)); aspect-ratio: 1 / 1.04; max-height: max(82svh, 21rem); margin-inline: calc(-1 * var(--gutter)); }
  .scene-stage { right: 0; }
  .scene-rail { grid-column: 1; grid-row: 3; padding-bottom: 0.5rem; }
  .is-live .scene-copy > .scene-stop, .scene-stop { grid-column: 1; grid-row: 4; align-self: start; padding-block: 1.25rem 2.5rem; position: relative; z-index: 1; }
  /* The intro stays put on a phone; only the facts change beneath the model. */
  .is-live .scene-intro { opacity: 1; visibility: visible; transform: none; }
  .is-live .scene-stop:not(.is-on) { display: none; }
  .scene-poster[data-view='whole'] .scene-rail { padding-bottom: 2rem; }
  .scene-stop-title { max-width: 18ch; }

  /* The views become one sideways row that keeps the chosen one in sight. */
  .scene-rail .switch-wrap { border-top-width: 2px; }
  .scene-rail .switch-row { flex-direction: row; align-items: center; gap: 0 1rem; }
  .scene-rail .switch-label { padding-top: 0; }
  .scene-rail .switch {
    flex-wrap: nowrap; overflow-x: auto; scroll-snap-type: x proximity; scrollbar-width: none;
    margin-right: calc(-1 * var(--gutter)); padding-right: var(--gutter);
  }
  .scene-rail .switch::-webkit-scrollbar { display: none; }
  .scene-rail .switch li { scroll-snap-align: start; }
  .scene-rail .switch button::after { top: -2px; bottom: auto; height: 6px; }

  /* Pins shrink to their dots; the row above names them. */
  .scene-pin b, .scene-pin::before { display: none; }
  .scene-pin { width: 2.75rem; height: 2.75rem; justify-content: center; transform: translate3d(var(--x, -200px), var(--y, -200px), 0) translate(-50%, -50%); }
  .scene-pin::after { width: 9px; height: 9px; }
  .scene-flat { inset: 6% 6%; }
}


/* ==========================================================================
   The home page's hero: the same script, with one room that could be anyone's.
   The hero itself (slogan, switch, dates) is site.css's.
   ========================================================================== */

/* The room takes the app sketch's column, and runs out to the poster's top, right and bottom
   edges and back over the gap between the columns. It is see-through, so the words stay clear. */
.scene-hero { --hero-top: clamp(2.5rem, min(6vw, 5vh), 5rem); --hero-gap: clamp(2rem, 5vw, 5rem); }
.scene-hero .hero-grid { align-items: stretch; }
.scene-hero .scene-intro { position: relative; z-index: 1; }
.hero-scene { grid-column: 2; grid-row: 1; position: relative; min-height: 30rem; }
.hero-scene .scene-stage { top: calc(-1 * var(--hero-top)); left: calc(-1 * var(--hero-gap)); }
.scene-hero:not(.is-live) .scene-captions { display: none; }

/* A caption on the model: a small deep tile, lower left, like a programme note. */
.scene-captions { position: absolute; left: var(--hero-gap); bottom: 1.5rem; z-index: 2; width: min(22rem, calc(100% - var(--hero-gap) - 1rem)); display: grid; }
.scene-captions .scene-stop {
  grid-area: 1 / 1; align-self: end;
  padding: 1.1rem 1.2rem 0.6rem;
  background: var(--purple-deep); color: var(--on-purple);
  border-radius: 4px;
}
.scene-captions .scene-stop-title { font-size: 1.35rem; font-weight: 800; font-stretch: 86%; line-height: 1.1; letter-spacing: -0.015em; max-width: none; }
.scene-stop-line { margin-top: 0.5rem; font-size: var(--fs-sm); line-height: 1.5; color: var(--on-purple-2); }
.scene-captions .scene-stop-foot { margin-top: 0.9rem; gap: 0.5rem 1.25rem; }
.scene-captions .scene-stop-foot .quiet { font-size: var(--fs-sm); }
.scene-captions .scene-stop-nav { margin-top: 0.5rem; padding-top: 0.15rem; border-top: 1px solid color-mix(in srgb, currentColor 26%, transparent); max-width: none; }

/* Who the room belongs to, in the model's corner. */
.hero-scene-note { position: absolute; right: 0; bottom: 0.9rem; margin: 0; max-width: 17rem; text-align: right; z-index: 1; transition: opacity 0.3s; }
.scene-hero:not([data-view='whole']) .hero-scene-note { opacity: 0; }

@media (max-width: 899.98px) {
  /* One column, in the home page's own order: slogan, lead, button, note, then the room, then the switch. */
  .scene-hero .scene-intro { display: contents; }
  .hero-scene { order: 5; min-height: 0; width: calc(100% + 2 * var(--gutter)); aspect-ratio: 1 / 1.02; max-height: max(78svh, 21rem); margin: 1rem calc(-1 * var(--gutter)) 0; }   /* width: as .scene-frame above */
  .hero-scene .scene-stage { top: 0; left: 0; right: 0; }
  /* A caption on the model would cover the screen it describes, so scene.js moves them under the room. */
  .scene-captions { position: static; order: 5; width: auto; margin-top: 0.5rem; }
  .scene-captions:not(:has(.is-on)) { display: none; }
  .hero-scene-note { right: var(--gutter); left: var(--gutter); bottom: 0.4rem; max-width: none; text-align: center; }
}
