/*
 * Griddlemere, «One burger, done right» — a page played from footage, and a page that travels
 * (tickets/SC-48.md; the footage, the words, the faces and the colours are those of ../prototype-film).
 *
 * This sheet is written in two halves.
 *
 * First, the page as it is without the script, or where motion is not wanted: every shot
 * is a screen of its own — its still, its words at the foot of it — and between the acts
 * lie the blocks of the page: the phrase of the page on the red, what is in the burger on
 * the black.
 *
 * Then (html.live, set before the first paint when the film will play) the page becomes
 * four acts with real scroll between them:
 *   .act        as tall as its scene is pinned for, plus one screen (--pin, set by the script)
 *   .stage      the scene of the act: a sticky screen. The page brings it in from below,
 *               holds it and carries it away upwards
 *     .frame      the picture: the first frame of the act (.poster) until the film is
 *                 there, then the footage (.screen, a canvas of its own in every act).
 *                 The smash is seen through the hatch — a wide low window at the foot of
 *                 the amber page that opens upwards (clip-path, set by the script)
 *     .aside      the word of the act on the amber over the hatch; the picture takes its
 *                 place as the hatch opens (--open, set by the script)
 *     .leaders    the line from a word to its thing
 *   .cue        the words of an act lie on the page, not on the scene: they come from
 *               below and leave upwards with the scroll while the picture stands pinned
 *   .block      what lies between two acts and scrolls as any page does. A block that
 *               follows a flood lies over the end of the act before it, so its words rise
 *               on the colour while that still stands pinned
 *   .bar        the name and the steps of the story, fixed over all of it
 * After the film, in the flow of the page: .foot — the tray and the wrap left on it.
 *
 * The words take their ink from what lies under them (data-tone): cream on the dark of
 * the griddle and the street ("night"), black on the white paper and on amber ("day").
 *
 * Brand colours (tickets/SC-24.md): black #111111, amber #f2b33d, red #d5362b.
 */

:root {
  --ease-camera: cubic-bezier(0.65, 0, 0.35, 1);
  --ease-text: cubic-bezier(0.16, 1, 0.3, 1);
  --gutter: clamp(16px, 2.6vw, 40px);

  --black: #111111;
  --amber: #f2b33d;
  --red: #d5362b;
  --cream: #fbf1df;

  /* The joint's own pair. Alfa Slab One — the slab of its neon sign — for every large
     word; Public Sans for everything small. The studio's faces (Unbounded, Onest) are in
     the studio's lime corner and nowhere else. */
  --face-display: "Alfa Slab One", "Rockwell", Georgia, serif;
  --face-text: "Public Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
  --face-studio-display: "Unbounded", "Arial Black", Arial, sans-serif;
  --face-studio-text: "Onest", system-ui, -apple-system, "Segoe UI", sans-serif;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  background: #111111;
  color: #fbf1df;
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  color: #fbf1df;
  font-family: var(--face-text);
  font-size: 16px;
  line-height: 1.4;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overscroll-behavior-y: none;
}

p,
h1,
h2,
h3,
ol,
ul,
figure {
  margin: 0;
  padding: 0;
}

ol,
ul {
  list-style: none;
}

/*
 * ——— The page without the film: eight stills, their words, and the blocks between ———
 */

body {
  position: relative;

  /* Cream: the ink of every word until something says otherwise. */
  --ui: #fbf1df;
  --ui-dim: rgb(251 241 223 / 0.92);
  --plate: rgb(17 17 17 / 0.58);
}

.stage,
.steps,
.hint {
  display: none;
}

.bar {
  position: absolute;
  top: var(--gutter);
  left: var(--gutter);
  right: var(--gutter);
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  color: #fbf1df;
  font-size: 15px;
  font-weight: 600;
  line-height: 1;
}

.brand {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  isolation: isolate;
  color: var(--ui);
  font-family: var(--face-display);
  font-size: 23px;
  font-weight: 400;
  letter-spacing: 0.01em;
  transition: color 300ms linear;
}

/* The name passes over a lit window and a dark griddle alike: it carries its own soft plate. */
.brand::before {
  content: "";
  position: absolute;
  inset: -22px -34px;
  z-index: -1;
  background-image: radial-gradient(closest-side, var(--plate), rgb(0 0 0 / 0));
  pointer-events: none;
  transition: opacity 200ms linear;
}

/* On one even colour — a block of the page, a margin, a flood — the name and the steps need no plate. */
.bar.is-bare .brand::before,
.bar.is-bare .steps::before,
.brand.is-flat::before,
.steps.is-flat::before {
  opacity: 0;
}

.brand-mark {
  flex: none;
  width: 28px;
  height: 28px;
  fill: currentColor;
}

/* A shot: its still fills a screen, its words stand at the foot of it. */
.shot {
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  align-items: flex-start;
  gap: 14px;
  min-height: 100vh;
  min-height: 100svh;
  padding: 96px var(--gutter) clamp(28px, 6vh, 64px);
  overflow: hidden;
  isolation: isolate;
}

.still {
  position: absolute;
  inset: 0;
  z-index: -2;
  display: block;
}

.still img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* Under the words a still is darker, so the cream reads on any of the eight. */
.shot::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background-image: linear-gradient(to top, rgb(17 17 17 / 0.86), rgb(17 17 17 / 0.5) 26%, rgb(17 17 17 / 0) 56%);
  pointer-events: none;
}

/* A still with no words is left as it was shot. */
.shot[data-words="none"]::after {
  content: none;
}

.cue {
  position: relative;
  color: var(--ui);
}

.line {
  display: block;
  overflow: hidden;
  padding-bottom: 0.16em;
  margin-bottom: -0.16em;
}

.line > span {
  display: block;
}

/* The line of the first screen. */
.title {
  font-family: var(--face-display);
  font-size: clamp(34px, 4.2vw, 68px);
  font-weight: 400;
  letter-spacing: 0;
  line-height: 1.04;
}


/* The word of an act, and the phrase of the page. */
.cue-act,
.aside,
.word,
.run {
  font-family: var(--face-display);
  font-weight: 400;
  line-height: 0.98;
}

.cue-act,
.aside,
.word {
  font-size: clamp(40px, 6vw, 96px);
}

.run {
  font-size: clamp(44px, 6.4vw, 104px);
  white-space: nowrap;
}

/* Without the film the phrase says itself once. */
.run span[aria-hidden],
.run-right {
  display: none;
}

/* A word tied to a thing of the picture. */
.caption-word {
  width: -webkit-fit-content;
  width: fit-content;
  font-family: var(--face-display);
  font-size: clamp(34px, 4.2vw, 66px);
  font-weight: 400;
  line-height: 1.06;
  white-space: nowrap;
}

/* What is in the burger: three lines, as if printed on its paper. */
.layers {
  font-family: var(--face-display);
  font-size: clamp(30px, 3.5vw, 56px);
  font-weight: 400;
  line-height: 1.08;
  white-space: nowrap;
}

.final-title {
  font-family: var(--face-display);
  font-size: clamp(40px, 5.2vw, 86px);
  font-weight: 400;
  line-height: 1.02;
  white-space: nowrap;
}

/* The button: a capsule of amber, its arrow in a round of black. */
.pill {
  display: inline-flex;
  align-items: center;
  gap: 18px;
  height: 60px;
  margin-top: clamp(20px, 3.4vh, 36px);
  padding: 6px 6px 6px 28px;
  border-radius: 999px;
  background-color: #f2b33d;
  color: #111111;
  font-size: 18px;
  font-weight: 700;
  line-height: 1;
  text-decoration: none;
  white-space: nowrap;
  transition: background-color 180ms linear;
}

.pill:hover {
  background-color: #f7c764;
}

.pill:focus-visible {
  outline: 2px solid #fbf1df;
  outline-offset: 3px;
}

.pill-round {
  display: grid;
  place-items: center;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background-color: #111111;
  color: #f2b33d;
  transition: transform 180ms var(--ease-camera);
}

.pill-round svg,
.studio svg {
  width: 20px;
  height: 20px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
  transition: transform 180ms var(--ease-camera);
}

.pill:hover .pill-round,
.pill:focus-visible .pill-round {
  transform: scale(1.06);
}

.pill:hover .pill-round svg,
.pill:focus-visible .pill-round svg {
  transform: rotate(45deg);
}

/*
 * The blocks of the page, between the acts. Each lies on one of the page's colours.
 */

.block {
  position: relative;
  overflow: hidden;
  background-color: var(--field);
  color: var(--ink);
}

.block[data-field="red"] {
  --field: #d5362b;
  --ink: #111111;
}

.block[data-field="night"] {
  --field: #111111;
  --ink: #fbf1df;
}

.block-run {
  padding: clamp(48px, 11vh, 110px) var(--gutter);
}

.block-list {
  padding: clamp(48px, 10vh, 100px) var(--gutter);
}

/* What is in the burger: five names, each a step to the right of the one over it. */
.stack {
  font-family: var(--face-display);
  font-size: clamp(40px, 7.4vw, 124px);
  font-weight: 400;
  line-height: 1.02;
}

.stack li {
  padding-left: calc(var(--k, 0) * 4.6vw);
  white-space: nowrap;
}

/* The cheddar is amber, the sauce is red. */
.stack li:nth-child(2) {
  color: #f2b33d;
}

.stack li:nth-child(5) {
  color: #e8483c;
}

/* The word of the last act is lit amber, like the window. */
.block-list .word {
  margin-top: clamp(28px, 6vh, 60px);
  color: #f2b33d;
  text-align: right;
}

/*
 * ——— The film: the acts, and the page between them ———
 */

/* The ink of the words over the footage. */
.live [data-tone="night"] {
  --ui: #fbf1df;
  --ui-dim: rgb(251 241 223 / 0.92);
  --plate: rgb(17 17 17 / 0.58);
}

.live [data-tone="day"] {
  --ui: #111111;
  --ui-dim: rgb(17 17 17 / 0.92);
  --plate: rgb(251 241 223 / 0);
}

.live .bar {
  position: fixed;
  transition: opacity 320ms var(--ease-camera);
}

.live .bar.is-away {
  opacity: 0;
  pointer-events: none;
}

/* An act is as tall as its scene is pinned for, and the screen the scene itself takes. */
.live .act {
  position: relative;
  z-index: 0;
  height: calc((1 + var(--pin, 1)) * 100vh);
  height: calc((1 + var(--pin, 1)) * 100svh);
  /* A word that rides up the right of the page carries a soft plate wider than itself: it must not widen the page. (Not `hidden`: the scene inside is sticky.) */
  overflow-x: clip;
}

.live .stage {
  position: sticky;
  top: 0;
  z-index: 0;
  display: block;
  height: 100vh;
  height: 100svh;
  overflow: hidden;
  background-color: #111111;
}

/* The margins round a window are the page's colour of the moment. */
.live .stage[data-field="amber"] {
  background-color: #f2b33d;
}

.live .stage[data-field="red"] {
  background-color: #d5362b;
}

.live .stage[data-field="night"] {
  background-color: #111111;
}

.live .frame {
  position: absolute;
  inset: 0;
  z-index: 1;
  overflow: hidden;
  background-color: #111111;
}

.live .poster {
  position: absolute;
  inset: 0;
  display: block;
}

/* Until the script has laid it exactly where the film will lie, the first frame covers its scene. */
.live .poster img {
  position: absolute;
  inset: 0;
  display: block;
  width: 100%;
  height: 100%;
  max-width: none;
  object-fit: cover;
}

/* A canvas is shown from its first drawing on: before that the first frame of the act stands there. */
.live .screen {
  position: absolute;
  inset: 0;
  display: block;
  width: 100%;
  height: 100%;
  visibility: hidden;
}

.live .screen.is-painted {
  visibility: visible;
}

/* A shot is no longer a box: its words lie on the page of its act. */
.live .shot {
  position: static;
  display: block;
  min-height: 0;
  padding: 0;
  overflow: visible;
  isolation: auto;
}

.live .shot::after {
  content: none;
}

.live .still {
  display: none;
}

.live .leaders {
  position: absolute;
  inset: 0;
  z-index: 2;
  display: block;
  width: 100%;
  height: 100%;
  overflow: visible;
  pointer-events: none;
}

.leader path {
  fill: none;
  stroke: var(--ui);
  stroke-width: 1.25;
  stroke-dasharray: 1;
  stroke-dashoffset: 1;
  transition: stroke-dashoffset 160ms var(--ease-camera);
}

.leader .dot {
  fill: var(--ui);
  opacity: 0;
  transition: opacity 140ms linear;
}

.leader .ring {
  fill: none;
  stroke: var(--ui);
  stroke-width: 1.25;
  opacity: 0;
  transition: opacity 140ms linear;
}

.leader.is-on path {
  stroke-dashoffset: 0;
  transition: stroke-dashoffset 380ms var(--ease-text) 40ms;
}

.leader.is-on .dot {
  opacity: 1;
  transition: opacity 180ms linear 220ms;
}

.leader.is-on .ring {
  opacity: 0.6;
  transition: opacity 180ms linear 280ms;
}

/* The hatch rides in over the amber of the window while that still stands pinned (the hold of the first act): the amber is one page. */
.live .act[data-act="smash"] {
  margin-top: -10vh;
  margin-top: -10svh;
}

/*
 * The words of an act. They are set on the page — on the act, which is taller than the
 * screen — so the scroll itself brings them up from below and carries them off at the
 * top, over a picture that stands pinned.
 */
.live .cue {
  position: absolute;
  z-index: 3;
  isolation: isolate;
  pointer-events: none;
  transition:
    color 300ms linear,
    visibility 0s linear 0s;
}

.live .cue:not(.is-on) {
  visibility: hidden;
  transition:
    color 300ms linear,
    visibility 0s linear 340ms;
}

/* A line comes up from under a mask and leaves the way it came. */
.live .line > span {
  transform: translate3d(0, 122%, 0);
  transition: transform 300ms var(--ease-camera);
}

.live .cue.is-on .line > span {
  transform: none;
  transition: transform 640ms var(--ease-text) calc(var(--i, 0) * 70ms + 90ms);
}

/* Under a block of words the picture is one soft plate of the block's own tone: no glow round every letter. */
.live .cue::before {
  content: "";
  position: absolute;
  inset: -58% -34%;
  z-index: -1;
  background-image: radial-gradient(closest-side, var(--plate), rgb(0 0 0 / 0));
  opacity: 0;
  pointer-events: none;
  transition: opacity 260ms linear;
}

.live .cue.is-on::before {
  opacity: 1;
  transition: opacity 520ms linear 80ms;
}

/* On a flood there is nothing to lift the words off. */
.live .cue-card::before {
  content: none;
}

/* The line of the first screen stands in its corner and goes up with the page from the first turn of the wheel. */
.live .cue-opening {
  /* Set by the script: the words fade just before they would ride up under the header. */
  opacity: var(--fade, 1);
  bottom: calc(var(--pin, 1) * 100vh + var(--gutter) + 4px);
  bottom: calc(var(--pin, 1) * 100svh + var(--gutter) + 4px);
}

/* A large word that rides up the page by itself. */
.live .cue-ride {
  opacity: var(--fade, 1);
}

/*
 * A word tied to a thing of the picture rides up past it (--at, set by the script: where
 * on the act it lies). It is a shade dim until it crosses the line of its legend; then
 * it is lit and a line ties it to its thing.
 */
.live .cue-note {
  top: calc(var(--at, 0.6) * 100vh);
  top: calc(var(--at, 0.6) * 100svh);
  --lit: 0.82;
  opacity: calc(var(--lit) * var(--fade, 1));
  transform: translate3d(0, -50%, 0);
  transition:
    opacity 220ms linear,
    color 300ms linear,
    visibility 0s linear 0s;
}

.live .cue-note:not(.is-on) {
  transition:
    opacity 220ms linear,
    color 300ms linear,
    visibility 0s linear 340ms;
}

.live .cue-note.is-now {
  --lit: 1;
}

/* Words that stand on a flood inside an act: in the middle of the pinned scene (the script moves them into it), drifting up as the page goes. */
.live .cue-card {
  left: 50%;
  top: 50%;
  width: -webkit-max-content;
  width: max-content;
  max-width: calc(100vw - 2 * var(--gutter));
  text-align: center;
  transform: translate3d(-50%, calc(-50% + var(--ty, 0px)), 0);
}

.live .pill {
  opacity: 0;
  transform: translate3d(0, 16px, 0);
  transition:
    opacity 220ms linear,
    transform 300ms var(--ease-camera),
    background-color 180ms linear;
}

.live .cue-final.is-on .pill {
  opacity: 1;
  transform: none;
  pointer-events: auto;
  transition:
    opacity 400ms linear 380ms,
    transform 640ms var(--ease-text) 380ms,
    background-color 180ms linear;
}

/*
 * The blocks between the acts.
 */

.live .block {
  z-index: 1;
}

/*
 * A block after a flood lies over the last of the act before it (--over screens, set by
 * the script from the act's hold). Up there it is clear — the flood itself is the colour —
 * and its words rise over the pinned flood; below the act it paints the same colour on,
 * and flood and block ride away as one page.
 */
.live .block.is-over {
  margin-top: calc(var(--over, 0.2) * -100vh);
  margin-top: calc(var(--over, 0.2) * -100svh);
  background-color: rgb(0 0 0 / 0);
  background-image: linear-gradient(to bottom, rgb(0 0 0 / 0) calc(var(--over, 0.2) * 100vh - 2px), var(--field) calc(var(--over, 0.2) * 100vh - 2px));
  background-image: linear-gradient(to bottom, rgb(0 0 0 / 0) calc(var(--over, 0.2) * 100svh - 2px), var(--field) calc(var(--over, 0.2) * 100svh - 2px));
}

.live .cue-opening {
  left: var(--gutter);
}

/* Once the amber has taken the screen the line is black on it, and needs no plate. */
.live .act.is-flooded .cue-opening {
  --ui: #111111;
  --plate: rgb(17 17 17 / 0);
}

/*
 * The word of the act stands on the amber over the hatch: it rides in with the scene, and
 * the picture takes its place as the hatch opens upwards.
 */
.live .aside {
  position: absolute;
  left: 7%;
  top: 23%;
  z-index: 0;
  color: #111111;
  font-size: clamp(44px, 9.6vw, 164px);
  white-space: nowrap;
  transform: translate3d(0, calc(-50% - var(--open, 0) * 6vh), 0);
}

/* A word that rides past its thing is set a size under the words that stand: it must not cover the thing on its way. */
.live .cue-note .caption-word {
  font-size: clamp(30px, 3.6vw, 56px);
}

/* Each word rides where its frame is quiet, on the side its thing is not. */
.live #cue-beef {
  left: 9%;
}

.live #cue-cheddar,
.live #cue-bun {
  left: 7%;
}

/* The three of the dressed bun ride up the white paper to the right of it; black on the paper, on a plate of cream where the griddle shows. */
.live #cue-sauce,
.live #cue-pickles,
.live #cue-onion {
  left: 63%;
  --plate: rgb(251 241 223 / 0.74);
}

/* What is in the burger rides up the paper left of the two halves. */
.live .cue-layers {
  left: 7%;
  --plate: rgb(251 241 223 / 0.74);
}

.live .cue-layers .layers {
  font-size: clamp(28px, 3.3vw, 52px);
}

/* The last line rides in from below once the counter is in sight: over its dark, left of the tray. */
.live .cue-final {
  left: var(--gutter);
  top: calc((var(--pin, 1) + 0.2) * 100vh);
  top: calc((var(--pin, 1) + 0.2) * 100svh);
}

/* «Smashed to order.»: two rows far wider than the screen. As the page goes down the first runs to the left, the second to the right. */
.live .block-run {
  padding: 3vh 0 7vh;
  padding: 3svh 0 7svh;
}

.live .run {
  display: flex;
  gap: 0.5em;
  width: -webkit-max-content;
  width: max-content;
  font-size: clamp(52px, 11.6vw, 198px);
  line-height: 1.12;
  /* Set by the script: a row fades just before it would ride up under the header. */
  opacity: var(--fade, 1);
  visibility: hidden;
}

.live .run span[aria-hidden],
.live .run-right {
  display: flex;
}

.live .run span {
  display: block;
}

.live .block.is-on .run {
  visibility: visible;
}

.live .run-left {
  color: #fbf1df;
  transform: translate3d(calc(6vw - var(--p, 0.5) * 120vw), 0, 0);
}

.live .run-right {
  color: #111111;
  transform: translate3d(calc(var(--p, 0.5) * 120vw - 190vw), 0, 0);
}

/* The stair of names: as the block rides through, the steps draw in from both sides and stand true in the middle of the screen. */
.live .block-list {
  padding: 5vh var(--gutter) 9vh;
  padding: 5svh var(--gutter) 9svh;
}

.live .stack li {
  transform: translate3d(calc((0.42 - var(--p, 0.42)) * (var(--k, 0) - 2) * 26vw), 0, 0);
}

.live .block-list .word {
  font-size: clamp(44px, 9.6vw, 164px);
  transform: translate3d(calc((0.7 - var(--p, 0.7)) * 40vw), 0, 0);
}

/* The steps of the story: a name and a measure each; a measure fills as its step goes by and stays full after it. */
.live .steps {
  position: relative;
  display: block;
  isolation: isolate;
  color: var(--ui);
  transition: color 300ms linear;
}

/* Like the name: the steps pass over light and dark alike, and carry their own soft plate. */
.live .steps::before {
  content: "";
  position: absolute;
  inset: -26px -44px;
  z-index: -1;
  background-image: radial-gradient(closest-side, var(--plate), rgb(0 0 0 / 0));
  pointer-events: none;
  transition: opacity 200ms linear;
}

.steps ol {
  display: flex;
  align-items: center;
  gap: clamp(14px, 1.8vw, 28px);
  list-style: none;
}

.steps button {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0;
  padding: 10px 0;
  border: 0;
  background: none;
  color: var(--ui-dim);
  font: inherit;
  font-size: 15px;
  font-weight: 600;
  line-height: 1;
  cursor: pointer;
  transition: color 200ms linear;
}

.steps button:hover,
.steps .is-now button {
  color: var(--ui);
}

.steps button:focus-visible {
  outline: 2px solid currentColor;
  outline-offset: 4px;
  border-radius: 2px;
}

.steps .is-now button {
  font-weight: 700;
}

.steps i {
  position: relative;
  display: block;
  width: 40px;
  height: 2px;
  overflow: hidden;
  border-radius: 1px;
  background-color: color-mix(in srgb, currentColor 38%, transparent);
}

.steps i::after {
  content: "";
  position: absolute;
  inset: 0;
  background-color: currentColor;
  transform: scaleX(var(--p, 0));
  transform-origin: 0 50%;
}

.live .hint {
  position: absolute;
  right: var(--gutter);
  bottom: calc(var(--gutter) + 4px);
  z-index: 3;
  display: flex;
  align-items: center;
  gap: 12px;
  color: #fbf1df;
  font-size: 15px;
  font-weight: 600;
  line-height: 1;
  transition: opacity 360ms var(--ease-camera);
}

.hint i {
  display: block;
  width: 2px;
  height: 34px;
  background-color: #f2b33d;
}

.hint.is-off {
  opacity: 0;
}

/*
 * ——— The footer: the tray, and the wrap left on it ———
 *
 * Seen from over it: the steel tray on the black counter and the sheet the burger came
 * in — creased, a few crumbs, one pickle (textures/tray.webp, photographed). The sheet
 * is the joint's printed paper: its name in the red of the neon, its lines in black. The
 * ink is laid on the paper by multiplying, so every crease shows through the letters.
 * The studio's lime corner is the one thing that is the same on every page.
 */

.foot {
  position: relative;
  z-index: 1;
  padding: clamp(28px, 5vh, 52px) var(--gutter) clamp(84px, 12vh, 112px);
  background-color: #111111;
  color: #111111;
}

.tray {
  position: relative;
  width: min(100%, 1160px);
  margin: 0 auto;
  aspect-ratio: 2477 / 1536;
  container-type: inline-size;
  isolation: isolate;
}

/* Under the photograph, where its sheet lies: plain paper, so the print can be read even if the photograph does not come. */
.tray::after {
  content: "";
  position: absolute;
  left: 20%;
  right: 20%;
  top: 14%;
  bottom: 12%;
  z-index: -1;
  background-color: #f1ece4;
}

/* The photograph: its counter goes out into the black of the page at all four edges. */
.tray::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image: url("textures/tray.webp");
  background-size: 100% 100%;
  --edge-x: 8.5%;
  --edge-y: 3.4%;
  -webkit-mask-image: linear-gradient(to right, rgb(0 0 0 / 0), #000 var(--edge-x), #000 calc(100% - var(--edge-x)), rgb(0 0 0 / 0)), linear-gradient(to bottom, rgb(0 0 0 / 0), #000 var(--edge-y), #000 calc(100% - var(--edge-y)), rgb(0 0 0 / 0));
  -webkit-mask-composite: source-in;
  mask-image: linear-gradient(to right, rgb(0 0 0 / 0), #000 var(--edge-x), #000 calc(100% - var(--edge-x)), rgb(0 0 0 / 0)), linear-gradient(to bottom, rgb(0 0 0 / 0), #000 var(--edge-y), #000 calc(100% - var(--edge-y)), rgb(0 0 0 / 0));
  mask-composite: intersect;
}

/* The sheet: where the paper lies in the photograph. */
.wrap {
  position: absolute;
  left: 20%;
  right: 20%;
  top: 14%;
  bottom: 12%;
  display: grid;
  grid-template-rows: auto auto 1fr auto;
  justify-items: start;
  align-content: start;
  padding: 4.5% 5% 4% 5.5%;
  /* White, multiplied, leaves the photographed paper as it is; only the ink darkens it. */
  background-color: #ffffff;
  mix-blend-mode: multiply;
}

/* The sizes of the print go with the sheet (cqw: a hundredth of the tray's width). */
.wrap-name {
  color: #d5362b;
  font-family: var(--face-display);
  font-size: clamp(2.2rem, 5.6vw, 5.4rem);
  font-size: 7.4cqw;
  line-height: 1;
}

.wrap-line {
  margin-top: 0.5em;
  color: #111111;
  font-family: var(--face-display);
  font-size: clamp(22px, 2.5vw, 36px);
  line-height: 1.1;
}

/* What is in it, as a printed list: one thing after another, a red dot between two. */
.wrap-list {
  display: flex;
  flex-wrap: wrap;
  align-self: start;
  gap: 4px 0;
  margin-top: 1.5em;
  list-style: none;
  color: #111111;
  font-size: clamp(16px, 1.4vw, 20px);
  font-weight: 600;
  line-height: 1.3;
}

.wrap-list li:not(:last-child)::after {
  content: "";
  display: inline-block;
  width: 6px;
  height: 6px;
  margin: 0 0.7em 0.14em;
  border-radius: 50%;
  background-color: #d5362b;
}

.wrap-late {
  color: #111111;
  font-size: clamp(16px, 1.4vw, 20px);
  font-weight: 700;
  line-height: 1.3;
}

/* The studio signs in its own colours, not the brand's: volt and ink, in the corner. */
.studio {
  position: absolute;
  right: 0;
  bottom: 0;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 18px var(--gutter) 18px 26px;
  border-top-left-radius: 28px;
  background-color: #d6fa50;
  color: #0a0a0a;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.08em;
  line-height: 1;
  text-decoration: none;
  transition: background-color 180ms linear;
}

.studio-by {
  font-family: var(--face-studio-text);
  text-transform: uppercase;
}

.studio-name {
  font-family: var(--face-studio-display);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: -0.01em;
}

.studio:hover,
.studio:focus-visible {
  background-color: #b8dc2c;
}

.studio:focus-visible {
  outline: 2px solid #fbf1df;
  outline-offset: 3px;
}

.studio svg {
  width: 16px;
  height: 16px;
}

.studio:hover svg,
.studio:focus-visible svg {
  transform: rotate(45deg);
}

/*
 * ——— A tall screen: the tall frames ———
 * (The script switches to the tall series at the same ratio.)
 */

@media (max-aspect-ratio: 3 / 4) {
  .brand {
    font-size: 21px;
  }

  .title {
    font-size: 36px;
  }

  /* The street is wider than a phone: its still is laid across the screen's width, the whole sign in it, and goes down into black. */
  .shot[data-shot="C1"] .still {
    top: 15%;
    bottom: auto;
    height: calc(100vw * 4 / 3);
  }

  .shot[data-shot="C1"]::after {
    background-image:
      linear-gradient(to bottom, rgb(17 17 17 / 1) 15%, rgb(17 17 17 / 0) 22%),
      linear-gradient(to top, rgb(17 17 17 / 1) calc(85% - 100vw * 4 / 3), rgb(17 17 17 / 0) calc(85% - 100vw * 4 / 3 + 22%));
  }

  .caption-word,
  .live .cue-note .caption-word {
    font-size: 38px;
  }

  .layers,
  .live .cue-layers .layers {
    font-size: 31px;
  }

  .final-title {
    font-size: clamp(2.3rem, 10.6vw, 3rem);
  }

  .pill {
    height: 56px;
    margin-top: 18px;
  }

  .pill-round {
    width: 44px;
    height: 44px;
  }

  .stack {
    font-size: clamp(40px, 12.6vw, 60px);
  }

  /* Under the street, where it has gone down into black. */
  .live .cue-opening {
    bottom: calc(var(--pin, 1) * 100vh + var(--gutter) + 6px + env(safe-area-inset-bottom, 0px));
    bottom: calc(var(--pin, 1) * 100svh + var(--gutter) + 6px + env(safe-area-inset-bottom, 0px));
  }

  /* The word over the hatch stands in two lines. */
  .live .aside {
    left: var(--gutter);
    top: 25%;
    width: 80vw;
    font-size: clamp(56px, 17.4vw, 92px);
    white-space: normal;
  }

  /* Every word rides up the left of the screen. */
  .live #cue-beef,
  .live #cue-cheddar,
  .live #cue-bun,
  .live #cue-sauce,
  .live #cue-pickles,
  .live #cue-onion,
  .live .cue-layers,
  .live .cue-final {
    left: var(--gutter);
    right: auto;
  }

  .live .cue::before {
    inset: -46% -16% -34%;
  }

  .live .cue-final {
    top: calc((var(--pin, 1) + 0.13) * 100vh);
    top: calc((var(--pin, 1) + 0.13) * 100svh);
  }

  .live .run {
    font-size: clamp(60px, 19vw, 110px);
  }

  .live .run-left {
    transform: translate3d(calc(6vw - var(--p, 0.5) * 200vw), 0, 0);
  }

  .live .run-right {
    transform: translate3d(calc(var(--p, 0.5) * 200vw - 330vw), 0, 0);
  }

  .live .stack li {
    padding-left: calc(var(--k, 0) * 3vw);
    transform: translate3d(calc((0.42 - var(--p, 0.42)) * (var(--k, 0) - 2) * 22vw), 0, 0);
  }

  .live .block-list .word {
    font-size: clamp(52px, 15vw, 84px);
  }

  /* Only the step on screen keeps its name; the others are their measures. */
  .steps ol {
    gap: 8px;
  }

  .steps li:not(.is-now) span {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip-path: inset(50%);
    white-space: nowrap;
  }

  .steps i {
    width: 18px;
  }

  .live .hint span {
    display: none;
  }

  .live .hint {
    bottom: calc(var(--gutter) + 6px + env(safe-area-inset-bottom, 0px));
  }

  /* The tray stands on end. */
  .foot {
    padding-top: 22px;
    padding-bottom: 88px;
  }

  .tray {
    aspect-ratio: 1536 / 2422;
  }

  .tray::before {
    --edge-x: 3.4%;
    --edge-y: 7.5%;
    background-image: url("textures/tray-tall.webp");
  }

  .wrap {
    left: 12.5%;
    right: 14.5%;
    top: 19.6%;
    bottom: 19.6%;
    padding: 9% 6% 7% 6.5%;
  }

  .tray::after {
    left: 12.5%;
    right: 14.5%;
    top: 19.6%;
    bottom: 19.6%;
  }

  .wrap-name {
    font-size: 8vw;
    font-size: 8.9cqw;
  }

  .wrap-line {
    font-size: 22px;
  }

  .wrap-list {
    flex-direction: column;
    gap: 6px;
    margin-top: 1.3em;
    font-size: 17px;
  }

  .wrap-list li:not(:last-child)::after {
    content: none;
  }

  /* The pickle lies in the sheet's lower left corner: the last line stands to the right of it. */
  .wrap-late {
    justify-self: end;
    font-size: 17px;
  }
}

/* ——— Checks ——— */

.hud {
  position: fixed;
  left: 8px;
  top: 64px;
  z-index: 20;
  margin: 0;
  padding: 8px 10px;
  border-radius: 4px;
  background: rgb(0 0 0 / 0.82);
  color: #b6ff7a;
  font: 11px/1.45 ui-monospace, Menlo, monospace;
  white-space: pre;
  pointer-events: none;
}
