/*
 * Ovenholt, «One pizza at a time» — 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 name of the pizza on the orange of the fire, its four
 * words and four round stills on the yellow.
 *
 * 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 oven is seen through its own mouth — an arch that stands on the foot
 *                 of the yellow page and opens to the whole screen (clip-path, 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 pizza box on the charred table.
 *
 * The words take their ink from what lies under them (data-tone): the flour's cream on
 * the dark room and the fire, the dark of the room on marble, on the orange and on the yellow.
 *
 * Brand colours (tickets/SC-25.md): room #1c1410, ember #e4572e, yolk #f4d35e.
 */

: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);

  --room: #1c1410;
  --ember: #e4572e;
  --yolk: #f4d35e;
  --flour: #f6ecd9;

  /* The pizzeria's own pair. Abril Fatface — a fat didone, the face of the sign over the
     oven — for everything large. Figtree for everything small. The studio's faces
     (Unbounded, Onest) are in the studio's lime corner and nowhere else. */
  --face-display: "Abril Fatface", "Bodoni 72", Didot, Georgia, serif;
  --face-text: "Figtree", 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: var(--room);
  color: var(--flour);
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  color: var(--flour);
  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: the stills, their words, and the blocks between ———
 */

body {
  position: relative;

  /* The cream of the flour: the ink of every word until something says otherwise. */
  --ui: var(--flour);
  --ui-dim: rgb(246 236 217 / 0.92);
  --plate: rgb(28 20 16 / 0.6);
}

.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: var(--flour);
  font-size: 15px;
  font-weight: 500;
  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: 26px;
  letter-spacing: 0.005em;
  transition: color 300ms linear;
}

/* The name passes over pale marble and a dark room 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: 30px;
  height: 30px;
}

.brand-arch {
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
}

.brand-flame {
  fill: var(--ember);
}

/* 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: 10px;
  min-height: 100vh;
  min-height: 100svh;
  padding: 96px var(--gutter) clamp(28px, 6vh, 64px);
  overflow: hidden;
  isolation: isolate;
}

/* The first half of the bake has nothing of its own to show on a page that stands still. */
.shot[data-still="none"] {
  display: none;
}

.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 them — the marble too. */
.shot::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background-image: linear-gradient(to top, rgb(28 20 16 / 0.86), rgb(28 20 16 / 0.56) 26%, rgb(28 20 16 / 0) 56%);
  pointer-events: none;
}

/* The first still also carries the name, at its head. */
.shot[data-shot="C1"]::after {
  background-image:
    linear-gradient(to top, rgb(28 20 16 / 0.86), rgb(28 20 16 / 0.56) 26%, rgb(28 20 16 / 0) 56%),
    linear-gradient(to bottom, rgb(28 20 16 / 0.55), rgb(28 20 16 / 0) 20%);
}

/* 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(44px, 5.6vw, 96px);
  font-weight: 400;
  letter-spacing: -0.012em;
  line-height: 1;
}

.notes {
  margin-top: 14px;
  color: var(--ui-dim);
  font-size: clamp(17px, 1.4vw, 21px);
  font-weight: 500;
  line-height: 1.36;
}

/* The word of an act, and the phrase of the page. */
.cue-act,
.word,
.phrase {
  font-family: var(--face-display);
  font-weight: 400;
  letter-spacing: -0.015em;
  line-height: 1;
}

.cue-act,
.word {
  font-size: clamp(48px, 7vw, 112px);
}

.phrase {
  font-size: clamp(34px, 4.4vw, 72px);
}

/* The word of the fire stands on a flood of the film only: without the film the first line of the page says it. */
#cue-woodfired {
  display: none;
}

/* Without the film the four words of the phrase run on as one line of text. */
.phrase .line {
  display: inline-block;
  vertical-align: top;
}

/* 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(40px, 5.2vw, 88px);
  font-weight: 400;
  letter-spacing: -0.012em;
  line-height: 1.02;
  white-space: nowrap;
}

.final-title {
  font-family: var(--face-display);
  font-size: clamp(2.75rem, 5vw, 5.25rem);
  font-weight: 400;
  letter-spacing: -0.012em;
  line-height: 1;
}

/* The button: a capsule the colour of the embers, its arrow in a round of yolk. */
.pill {
  display: inline-flex;
  align-items: center;
  gap: 18px;
  height: 60px;
  margin-top: clamp(22px, 3.6vh, 38px);
  padding: 6px 6px 6px 28px;
  border-radius: 999px;
  background-color: var(--ember);
  color: var(--room);
  font-size: 18px;
  font-weight: 700;
  line-height: 1;
  text-decoration: none;
  white-space: nowrap;
  transition: background-color 180ms linear;
}

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

.pill:focus-visible {
  outline: 2px solid var(--flour);
  outline-offset: 3px;
}

.pill-round {
  display: grid;
  place-items: center;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background-color: var(--yolk);
  color: var(--room);
  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(--room);
}

.block[data-field="ember"] {
  --field: var(--ember);
}

.block[data-field="yolk"] {
  --field: var(--yolk);
}

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

.block-made {
  padding: clamp(48px, 10vh, 100px) var(--gutter) clamp(40px, 8vh, 84px);
}

/* The pizza as it is built, from straight above: four round stills in a row. */
.rounds {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: clamp(12px, 2.6vw, 40px);
  margin-top: clamp(32px, 7vh, 64px);
}

.rounds img {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 1;
  border-radius: 50%;
  object-fit: cover;
  background-color: #d9cdbb;
}

.rounds figcaption {
  margin-top: 14px;
  font-family: var(--face-display);
  font-size: clamp(22px, 2.5vw, 40px);
  letter-spacing: -0.012em;
  line-height: 1.04;
  text-align: center;
}

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

/* The ink of the words over the footage. */
.live [data-tone="night"] {
  --ui: var(--flour);
  --ui-dim: rgb(246 236 217 / 0.92);
  --plate: rgb(28 20 16 / 0.6);
}

.live [data-tone="day"] {
  --ui: var(--room);
  --ui-dim: rgb(28 20 16 / 0.92);
  --plate: rgb(246 238 224 / 0.74);
}

.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: #1c1410;
}

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

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

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

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

.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 arch rides in under the foot of the yellow block: the block is its own margin. */
.live .act[data-act="oven"] {
  margin-top: -6vh;
  margin-top: -6svh;
}

/*
 * 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);
  width: min(52vw, 760px);
}

/* Once the fire has taken the screen the line is dark on it, and needs no plate. */
.live .act.is-flooded .cue-opening {
  --ui: var(--room);
  --ui-dim: var(--room);
  --plate: rgb(28 20 16 / 0);
}

/* The word of the fire: in the middle of the page, riding up through the flood inside the oven and on over the bake. */
.live #cue-woodfired {
  display: block;
  left: 50%;
  top: 76vh;
  top: 76svh;
  width: -webkit-max-content;
  width: max-content;
  font-size: clamp(52px, 12.4vw, 216px);
  transform: translate3d(-50%, 0, 0);
}

/* Letters this size read on the fire and on the bricks alike: no plate under them. */
.live #cue-woodfired::before {
  content: none;
}

/* 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(34px, 4.3vw, 70px);
}

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

/* The three of the pizza ride up the right of the marble, as a recipe is read. */
.live #cue-tomato,
.live #cue-mozzarella,
.live #cue-basil {
  right: var(--gutter);
}

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

/* «Margherita.»: one word across the orange, tilting from one side to the other as it rides up — as a pizza is turned on the peel. */
.live .block-word {
  padding: 5vh var(--gutter) 9vh;
  padding: 5svh var(--gutter) 9svh;
}

.live .word {
  width: -webkit-max-content;
  width: max-content;
  margin: 0 auto;
  font-size: clamp(52px, 12.4vw, 216px);
  /* Set by the script: the word fades just before it would ride up under the header. */
  opacity: var(--fade, 1);
  transform: rotate(calc((0.5 - var(--p, 0.5)) * 9deg));
}

.live .word .line {
  padding: 0 0.04em 0.2em;
  margin: 0 -0.04em -0.2em;
}

.live .block.is-on .word .line > span {
  transform: none;
  transition: transform 1100ms cubic-bezier(0.22, 0.72, 0.2, 1) 80ms;
}

/* The four words of the pizza: two to a row, each coming up after the one before. */
.live .block-made {
  padding: 3vh var(--gutter) 11vh;
  padding: 3svh var(--gutter) 11svh;
}

.live .phrase {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  column-gap: 0.24em;
  row-gap: 0.02em;
  max-width: 11.4em;
  margin: 0 auto;
  font-size: clamp(46px, 8.6vw, 150px);
}

.live .phrase .line {
  display: block;
  opacity: var(--fade, 1);
}

.live .block.is-on .phrase .line > span {
  transform: none;
  transition: transform 900ms cubic-bezier(0.22, 0.72, 0.2, 1) calc(var(--i, 0) * 160ms + 80ms);
}

/* The four rounds turn as the page goes down, each a little further than the one before, every second one a step lower. */
.live .rounds {
  gap: 3vw;
  max-width: 92vw;
  margin: 8vh auto 0;
  margin: 8svh auto 0;
}

.live .rounds li:nth-child(even) {
  margin-top: 6vh;
  margin-top: 6svh;
}

.live .rounds img {
  transform: rotate(calc((var(--p, 0.5) - 0.62) * (150deg + var(--k, 0) * 40deg)));
}

/* 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: 500;
  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: 600;
}

.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) + 8px);
  z-index: 3;
  display: flex;
  align-items: center;
  gap: 12px;
  color: var(--flour);
  font-size: 15px;
  font-weight: 500;
  line-height: 1;
  transition: opacity 360ms var(--ease-camera);
}

.hint i {
  display: block;
  width: 1px;
  height: 34px;
  background-color: currentColor;
}

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

/*
 * ——— The footer: the pizza box on the charred table ———
 *
 * One photograph (textures/box.webp): a closed kraft box seen from straight above, a
 * pizza wheel on one side of it, basil and flour on the other. The lid was shot blank;
 * what is printed on it is the text of the page, laid on the cardboard by multiplying,
 * so the fibres and the folds show through the ink. Two inks, as a printer would run a
 * box: the dark of the room for every word, the red of the embers for the mark, the
 * rule and the ring round the hours.
 * Every length of the print is a share of the photograph's width (--w), so the print
 * keeps its place on the lid at any size. The studio's lime corner is the one thing
 * that is the same on every page.
 */

.foot {
  position: relative;
  z-index: 1;
  overflow: hidden;
  /* The colour of the cardboard: the photograph covers all of it, and until the
     photograph has come — or if it never does — the print of the lid still reads. */
  background-color: #c69165;
}

.table {
  --w: 100vw;
  position: relative;
  width: var(--w);
  aspect-ratio: 1920 / 1072;
  margin-left: calc(50% - var(--w) / 2);
}

.table-photo {
  position: absolute;
  inset: 0;
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* The lid of the photograph, under its row of steam vents: 30.3–69.7% across, 14–86.5% down. */
.lid {
  position: absolute;
  left: 32%;
  top: 25.5%;
  width: 36%;
  height: 57.5%;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  color: #2a1a12;

  --red-ink: #a02d14;
}

.lid > * {
  mix-blend-mode: multiply;
}

.lid-mark {
  display: block;
  width: calc(var(--w) * 0.042);
  height: calc(var(--w) * 0.042);
  color: var(--red-ink);
}

.lid-name {
  margin-top: calc(var(--w) * 0.006);
  font-family: var(--face-display);
  font-size: calc(var(--w) * 0.068);
  letter-spacing: -0.01em;
  line-height: 1;
}

.lid-line {
  margin-top: calc(var(--w) * 0.008);
  padding-top: calc(var(--w) * 0.008);
  border-top: 2px solid var(--red-ink);
  font-size: max(15px, calc(var(--w) * 0.0145));
  font-weight: 700;
  letter-spacing: 0.01em;
  line-height: 1.2;
}

.lid-pizza {
  margin-top: auto;
  font-family: var(--face-display);
  font-size: calc(var(--w) * 0.034);
  line-height: 1.04;
}

.lid-made {
  margin-top: calc(var(--w) * 0.004);
  font-size: max(14px, calc(var(--w) * 0.0125));
  font-weight: 600;
  line-height: 1.3;
}

.lid-hours {
  margin-top: auto;
  padding: calc(var(--w) * 0.005) calc(var(--w) * 0.012);
  border: 2px solid var(--red-ink);
  border-radius: 999px;
  font-size: max(14px, calc(var(--w) * 0.0125));
  font-weight: 700;
  line-height: 1.2;
}

/* 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 var(--flour);
  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: 24px;
  }

  .title {
    font-size: 46px;
  }

  .notes {
    margin-top: 10px;
    font-size: 17px;
  }

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

  .final-title {
    font-size: clamp(2.75rem, 13vw, 3.5rem);
  }

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

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

  /* Two rounds to a row. */
  .rounds,
  .live .rounds {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 22px 16px;
  }

  .rounds figcaption {
    margin-top: 8px;
    font-size: 26px;
  }

  .live .rounds li:nth-child(even) {
    margin-top: 34px;
  }

  .live .cue-opening {
    width: min(88vw, 360px);
    bottom: calc(var(--pin, 1) * 100vh + var(--gutter) + 10px + env(safe-area-inset-bottom, 0px));
    bottom: calc(var(--pin, 1) * 100svh + var(--gutter) + 10px + env(safe-area-inset-bottom, 0px));
  }

  /* A word to a row: the longest of them, «mozzarella,», sets the size. */
  .live .word,
  .live #cue-woodfired,
  .live .phrase {
    font-size: 13.4vw;
  }

  .live .phrase .line {
    flex-basis: 100%;
    text-align: center;
  }

  /* Every word rides up the left of the screen. */
  .live #cue-dough,
  .live #cue-tomato,
  .live #cue-mozzarella,
  .live #cue-basil,
  .live .cue-final {
    left: var(--gutter);
    right: auto;
  }

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

  /* The last line lies over the pizza itself here: its plate is deeper. */
  .live .cue-final {
    top: calc((var(--pin, 1) + 0.12) * 100vh);
    top: calc((var(--pin, 1) + 0.12) * 100svh);
    --plate: rgb(28 20 16 / 0.8);
  }

  /* 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) + 10px + env(safe-area-inset-bottom, 0px));
  }

  /* The box fills the width of the phone; the table runs off both sides, and the
     studio's corner lies on the strip of table under the box. */
  .table {
    --w: 236vw;
  }
}


/* ——— 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;
}
