/*
 * Pulpworth, «Blended to order» — a page played from footage, and a page that travels
 * (tickets/SC-48.md; the footage, the words and the colours are those of ../prototype-film, SC-21).
 *
 * 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 scenes
 * lie the blocks of the page: two smoothies by name, the phrase of the bar.
 *
 * Then (html.live, set before the first paint when the film will play) the page becomes
 * five scenes 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: 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 scene (.poster) until the film is
 *                 there, then the footage (.screen, a canvas of its own in every scene).
 *                 In scene 2 it is a window the shape of a glass (clip-path, set by the
 *                 script), which opens to the whole screen
 *     .leaders    the line from a word to its thing
 *   .cue        the words of a scene lie on the page, not on the scene: they come from
 *               below and leave upwards with the scroll while the picture stands pinned.
 *               (What must stand on a thing of the picture — the names over the four
 *               glasses, the last line on the wall — the script moves into the scene.)
 *   .block      what lies between two scenes and scrolls as any page does: the colour a
 *               smoothie has left, with its name. A block lies over the end of the scene
 *               before it, so its words rise on the flood while that still stands pinned
 *   .bar        the name and the four glasses, fixed over all of it
 * After the film, in the flow of the page: .foot — the counter from above, the order sticker.
 */
:root {
  --pw-light: #fff7ec;
  --pw-ink: #2a1b12;
  --pw-mango: #ff7a3d;
  --pw-green: #6bcb4b;
  --pw-berry: #d6336c;
  /* The fourth smoothie has no colour of the brand: it is the colour of what is in its glass. */
  --pw-oat: #e8c68f;
  --pw-wall: #f1e4cf;

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

  /* The bar's pair: a round face for everything large, and a plain round one for what is small. */
  --face-display: "Fredoka", "Arial Rounded MT Bold", "Helvetica Neue", sans-serif;
  --face-text: "Nunito", "Helvetica Neue", Arial, sans-serif;
  /* The studio's own face, for its corner only. */
  --face-studio: "Onest", system-ui, -apple-system, "Segoe UI", sans-serif;
}

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

html {
  background: var(--pw-wall);
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  color: var(--pw-ink);
  font-family: var(--face-text);
  font-size: 18px;
  font-weight: 600;
  line-height: 1.3;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overscroll-behavior-y: none;
}

::selection {
  background-color: var(--pw-mango);
  color: var(--pw-ink);
}

p,
h1,
h2,
h3,
ol,
ul {
  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;
  --ui: var(--pw-ink);
  --ui-dim: rgb(42 27 18 / 0.88);
  --plate: rgb(255 247 236 / 0.74);
}

.stage,
.menu,
.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(--pw-ink);
  font-size: 16px;
  font-weight: 700;
  line-height: 1;
}

.brand,
.sticker-brand {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  font-family: var(--face-display);
  font-size: 27px;
  font-weight: 600;
  line-height: 1;
}

.brand {
  position: relative;
  isolation: isolate;
  color: var(--ui);
  transition: color 240ms linear;
}

/* The name passes over tile, hands and fruit: it carries its own soft patch of the wall's light. */
.brand::before {
  content: "";
  position: absolute;
  inset: -20px -30px;
  z-index: -1;
  background-image: radial-gradient(closest-side, var(--plate), rgb(255 247 236 / 0));
  pointer-events: none;
  transition: opacity 240ms linear;
}

/* The mark of the bar: a drop of fruit and its leaf. */
.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 — captions of one shot side by side. */
.shot {
  position: relative;
  display: flex;
  flex-flow: row wrap;
  align-content: flex-end;
  align-items: flex-end;
  gap: 12px clamp(24px, 4vw, 64px);
  min-height: 100vh;
  min-height: 100svh;
  padding: 96px var(--gutter) clamp(28px, 6vh, 60px);
  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 washed with the wall's light, so the ink reads on any of the eight. */
.shot::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background-image: linear-gradient(to top, rgb(255 247 236 / 0.9), rgb(255 247 236 / 0.66) 16%, rgb(255 247 236 / 0) 36%);
  pointer-events: none;
}

/* On the last still the counter is full of glasses and fruit: its words stand on the wall, at its head. */
.shot[data-shot="C8b"] {
  align-content: flex-start;
}

.shot[data-shot="C8b"]::after {
  background-image: linear-gradient(to bottom, rgb(255 247 236 / 0.86), rgb(255 247 236 / 0.6) 22%, rgb(255 247 236 / 0) 44%);
}

/* The first still also carries the name, at its head. */
.shot[data-shot="C1"]::after {
  background-image:
    linear-gradient(to top, rgb(255 247 236 / 0.9), rgb(255 247 236 / 0.66) 16%, rgb(255 247 236 / 0) 36%),
    linear-gradient(to bottom, rgb(255 247 236 / 0.7), rgb(255 247 236 / 0) 14%);
}

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

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

.line > span {
  display: block;
}

/* The line of the bar. */
.voice {
  font-family: var(--face-display);
  font-size: clamp(38px, 4.9vw, 80px);
  font-weight: 600;
  line-height: 0.98;
}

.notes {
  margin-top: 12px;
  color: var(--ui-dim);
  font-size: clamp(17px, 1.35vw, 21px);
  font-weight: 700;
  line-height: 1.28;
}

/* A word tied to a thing of the picture. */
.caption-word,
.callout-word {
  display: block;
  width: -webkit-fit-content;
  width: fit-content;
  font-family: var(--face-display);
  font-size: clamp(36px, 4.6vw, 76px);
  font-weight: 600;
  line-height: 0.98;
}

.callout-text {
  margin-top: 8px;
  color: var(--ui-dim);
  font-size: clamp(17px, 1.4vw, 21px);
  font-weight: 700;
  line-height: 1.25;
}

/* The name of a smoothie. */
.card-name,
.title {
  font-family: var(--face-display);
  font-size: clamp(40px, 5.6vw, 92px);
  font-weight: 600;
  line-height: 0.96;
}

.card-name .line {
  display: inline-block;
  vertical-align: top;
}

.card-notes,
.recipe {
  margin-top: 10px;
  font-size: clamp(18px, 1.6vw, 24px);
  font-weight: 700;
  line-height: 1.3;
}

.recipe {
  display: flex;
  flex-wrap: wrap;
  gap: 0 0.9em;
}

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

/*
 * The blocks of the page, between the scenes. Each lies on the colour of a smoothie, or on the ink.
 */

.block {
  position: relative;
  overflow: hidden;
  padding: clamp(44px, 9vh, 96px) var(--gutter);
  background-color: var(--field);
  color: var(--pw-light);
}

[data-field="wall"] {
  --field: #f1e4cf;
}

[data-field="berry"] {
  --field: #d6336c;
}

[data-field="mango"] {
  --field: #ff7a3d;
}

[data-field="green"] {
  --field: #6bcb4b;
}

[data-field="ink"] {
  --field: #2a1b12;
}

.block[data-field="mango"] {
  color: var(--pw-ink);
}

/* The phrase of the page. */
.phrase {
  font-family: var(--face-display);
  font-size: clamp(56px, 11vw, 168px);
  font-weight: 600;
  line-height: 0.92;
}

.block-card .card-name {
  font-size: clamp(56px, 11vw, 168px);
  line-height: 0.92;
}
.final {
  flex-basis: 100%;
}

/* Without the film the four are named in a row under the last line. */
.tag {
  order: 2;
  color: var(--ui-dim);
  font-size: clamp(17px, 1.4vw, 21px);
  font-weight: 700;
}
.final-title {
  font-family: var(--face-display);
  font-size: clamp(2.6rem, 5vw, 5.5rem);
  font-weight: 600;
  line-height: 0.96;
}

/* The button: a dark capsule with its arrow in a round of mango. */
.pill {
  display: inline-flex;
  align-items: center;
  gap: 18px;
  height: 58px;
  margin-top: clamp(20px, 3.4vh, 36px);
  padding: 6px 6px 6px 26px;
  border-radius: 999px;
  background-color: var(--pw-ink);
  color: var(--pw-light);
  font-size: 19px;
  font-weight: 800;
  line-height: 1;
  text-decoration: none;
  white-space: nowrap;
  transition: background-color 180ms linear;
}

.pill:hover {
  background-color: #120a05;
}

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

.pill-round {
  display: grid;
  place-items: center;
  width: 46px;
  height: 46px;
  border-radius: 50%;
  background-color: var(--pw-mango);
  color: var(--pw-ink);
  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 film: five scenes, and the page between them ———
 */

/* The ink of the words over the footage: the cream on a dark flood, the ink on the wall and on a light one. */
.live [data-tone="night"] {
  --ui: var(--pw-light);
  --ui-dim: rgb(255 247 236 / 0.92);
  --plate: rgb(255 247 236 / 0);
}

.live [data-tone="day"] {
  --ui: var(--pw-ink);
  --ui-dim: rgb(42 27 18 / 0.88);
}

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

/* Nothing of a scene makes the page wider than the screen: a soft plate under riding words may reach past its edge. */
.live .film {
  overflow-x: clip;
}

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

/* Over a flood, or on the colour of the page, the name lies on one colour: it needs no patch. */
.bar.is-bare .brand::before {
  opacity: 0;
}

/* A scene's part of the page is as tall as the 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);
}

.live .stage {
  position: sticky;
  top: 0;
  z-index: 0;
  display: block;
  height: 100vh;
  height: 100svh;
  overflow: hidden;
  background-color: var(--field, #f1e4cf);
}

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

.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 scene 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 scene. */
.live .shot {
  position: static;
  display: block;
  min-height: 0;
  padding: 0;
  overflow: visible;
  isolation: auto;
  background-color: transparent;
}

.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;
}

/* A line is drawn twice: a wider one of the wall's light under a thin one of the ink, so it reads on tile, fruit and glass alike. */
/* A line that is not on is not drawn at all: Safari leaves a dot where a dash of no length begins. */
.leader path {
  fill: none;
  stroke-dasharray: 1;
  stroke-dashoffset: 1;
  stroke-linejoin: round;
  visibility: hidden;
  transition:
    stroke-dashoffset 160ms var(--ease-camera),
    visibility 0s linear 160ms;
}

.leader .halo {
  stroke: rgb(255 247 236 / 0.82);
  stroke-width: 5;
}

.leader .ink {
  stroke: var(--pw-ink);
  stroke-width: 1.75;
}

.leader circle {
  opacity: 0;
  transition: opacity 160ms linear;
}

.leader .dot {
  fill: var(--pw-ink);
  stroke: var(--pw-light);
  stroke-width: 2;
}

.leader .ring {
  fill: rgb(255 247 236 / 0.28);
  stroke: var(--pw-ink);
  stroke-width: 1.5;
}

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

.leader.is-on circle {
  opacity: 1;
  transition: opacity 180ms linear 240ms;
}

/*
 * The words of a scene. They are set on the page — on the scene's part of it, 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 240ms linear,
    visibility 0s linear 0s;
}

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

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

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

/* Under words on the footage: one soft patch of the wall's light, no glow round every letter. */
.live .caption::before,
.live .callout::before,
.live .final::before,
.live .stack::before {
  content: "";
  position: absolute;
  inset: -46% -22%;
  z-index: -1;
  background-image: radial-gradient(closest-side, var(--plate), rgb(255 247 236 / 0));
  opacity: 0;
  pointer-events: none;
  transition: opacity 240ms linear;
}

.live .caption.is-on::before,
.live .callout.is-on::before,
.live .final.is-on::before,
.live .stack:has(.is-on)::before {
  opacity: 1;
  transition: opacity 480ms linear 60ms;
}

/* Words that come one after another in one place are stacked: the stack rides with the page, its words come and go in it. */
.live .stack {
  position: absolute;
  z-index: 3;
  isolation: isolate;
  pointer-events: none;
  /* Set by the script: on a narrow screen the stack fades just before it would ride up under the header. */
  opacity: var(--fade, 1);
}

.live .stack .cue {
  position: relative;
  z-index: auto;
}

/* The line of the bar stands on the tile of the wall, and goes up with the page from the first turn of the wheel. */
.live .stack-open {
  left: 27%;
  top: 27vh;
  top: 27svh;
}

/*
 * A word tied to a thing of the picture: it rides up its side of the page (`--at`, set by
 * the script: it crosses its line of the screen as its second of the film comes), and
 * while it passes a line ties it to its thing.
 */
.live .note {
  top: calc(var(--at, 0.6) * 100vh);
  top: calc(var(--at, 0.6) * 100svh);
  opacity: var(--fade, 1);
  transform: translate3d(0, -50%, 0);
}

.live #cue-strawberry,
.live #cue-banana {
  left: clamp(40px, 6vw, 108px);
}

.live #cue-blended,
.live #cue-size {
  left: clamp(40px, 8.5vw, 150px);
}

.live #cue-fruit {
  right: clamp(40px, 5vw, 96px);
}

/* The name of a smoothie on the flood inside a scene: in the middle of the pinned scene (the script moves it there), drifting up as the flood holds. */
.live .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 .card-name {
  font-size: clamp(72px, 13vw, 208px);
  line-height: 0.9;
}

.live .card-notes {
  /* Clear of the tails of the letters above: the name is set tight. */
  margin-top: clamp(22px, 3.4vh, 40px);
  color: var(--ui);
  font-size: clamp(20px, 1.9vw, 30px);
  font-weight: 800;
}

.live .card.is-on .line > span {
  transition: transform 460ms var(--ease-text) calc(var(--i, 0) * 50ms);
}

.live .card:not(.is-on) .line > span {
  transition-duration: 160ms;
}

/*
 * The second smoothie is named beside its jar: the name rides up the left of the wall while
 * the mango goes under, and is half-way up the screen when the mango floods it.
 */
.live .card-side {
  left: clamp(40px, 7vw, 124px);
  top: calc((var(--pin, 1) + 0.36) * 100vh);
  top: calc((var(--pin, 1) + 0.36) * 100svh);
  opacity: var(--fade, 1);
}

.live .card-side .card-name {
  font-size: clamp(64px, 10.5vw, 168px);
}

.live .card-side .card-name .line {
  display: block;
}

/* A scene that follows a flood lies over the last of the scene before it: it rides in over the colour while that still stands pinned. */
.live .act.is-over {
  margin-top: calc(var(--over, 0.2) * -100vh);
  margin-top: calc(var(--over, 0.2) * -100svh);
}

/* The fourth smoothie: its name and its three things ride up the left of the glass; each thing comes as it lands. */
.live .stack-oat {
  left: clamp(40px, 6.5vw, 116px);
  top: calc((var(--pin, 1) - 0.02) * 100vh);
  top: calc((var(--pin, 1) - 0.02) * 100svh);
}

.live .recipe {
  display: block;
  margin-top: 14px;
  font-family: var(--face-display);
  font-size: clamp(22px, 2.3vw, 36px);
  font-weight: 500;
  line-height: 1.16;
}
/* The four names stand on the glasses they name (the script moves them into the scene and puts each on the top of its glass). */
.live .tag {
  left: 0;
  top: 0;
  width: 0;
  height: 0;
  color: var(--pw-ink);
}

.live .tag > span {
  position: absolute;
  left: 0;
  bottom: 30px;
  display: block;
  padding: 7px 14px 8px;
  border-radius: 999px;
  background-color: var(--pw-light);
  box-shadow: 0 6px 14px rgb(42 27 18 / 0.16);
  font-family: var(--face-display);
  font-size: clamp(20px, 1.5vw, 24px);
  font-weight: 600;
  line-height: 1;
  white-space: nowrap;
  opacity: 0;
  transform: translate3d(-50%, 14px, 0);
  transition:
    opacity 160ms linear,
    transform 240ms var(--ease-camera);
}

/* The stem from a name down to its glass. */
.live .tag::after {
  content: "";
  position: absolute;
  left: -1px;
  bottom: 4px;
  width: 2px;
  height: 26px;
  border-radius: 1px;
  background-color: var(--pw-ink);
  transform: scaleY(0);
  transform-origin: 50% 0;
  transition: transform 200ms var(--ease-camera);
}

.live .tag.is-on > span {
  opacity: 1;
  transform: translate3d(-50%, 0, 0);
  transition:
    opacity 220ms linear,
    transform 520ms var(--ease-text);
}

.live .tag.is-on::after {
  transform: none;
  transition: transform 420ms var(--ease-text) 120ms;
}

/* The last line: on the wall, over the row (the script moves it into the scene); it comes when the first glass is served and leaves with the scene. */
.live .final {
  left: var(--gutter);
  top: clamp(76px, 11vh, 116px);
}
.live .pill {
  opacity: 0;
  transform: translate3d(0, 16px, 0);
  transition:
    opacity 200ms linear,
    transform 280ms var(--ease-camera),
    background-color 180ms linear;
}

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

/*
 * The blocks between the scenes.
 */

.live .block {
  z-index: 1;
  padding: 2vh var(--gutter) 9vh;
  padding: 2svh var(--gutter) 9svh;
  text-align: center;
}

/*
 * A block after a flood lies over the last of the scene before it (--over screens, set by
 * the script from the scene's hold). Up there it is clear — the flood itself is the colour —
 * and its words rise over the pinned flood; below the scene 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));
}

/* The name of a smoothie, as large as the screen lets it, and under it what is in it; the two words of the name draw apart a little as the block rides through. */
.live .block-card .card-name,
.live .block-phrase .phrase {
  font-size: clamp(72px, 13vw, 208px);
  line-height: 0.9;
}

.live .block .line {
  display: inline-block;
  vertical-align: top;
  /* Set by the script: a line fades just before it would ride up under the header. */
  opacity: var(--fade, 1);
  transform: translate3d(calc((var(--i, 0) - 0.5) * (var(--p, 0.5) - 0.5) * 12vw), 0, 0);
}

.live .block-card .line + .line {
  margin-left: 0.22em;
}

.live .block-phrase .line {
  display: block;
  transform: translate3d(calc((var(--i, 0) - 0.5) * (0.5 - var(--p, 0.5)) * 14vw), 0, 0);
}

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

.live .block .card-notes {
  color: inherit;
  opacity: 0;
  transform: translate3d(0, 14px, 0);
  transition:
    opacity 220ms linear,
    transform 300ms var(--ease-camera);
}

.live .block.is-on .card-notes {
  opacity: 1;
  transform: none;
  transition:
    opacity 420ms linear 420ms,
    transform 640ms var(--ease-text) 420ms;
}
/*
 * The row of four glasses: each fills with its smoothie while that smoothie is made, and
 * stays full. The row is a capsule of the wall's light, like the tags on the glasses: it
 * passes over hands, jars and floods and reads the same on all of them.
 */
.live .menu {
  display: block;
  margin-right: -6px;
  padding: 0 14px 0 10px;
  border-radius: 999px;
  background-color: rgb(255 247 236 / 0.88);
  box-shadow: 0 6px 14px rgb(42 27 18 / 0.1);
  color: var(--pw-ink);
}

.menu ol {
  display: flex;
  align-items: center;
  gap: clamp(6px, 1.3vw, 22px);
}

.menu li[data-flavour="berry"] {
  --c: var(--pw-berry);
}

.menu li[data-flavour="mango"] {
  --c: var(--pw-mango);
}

.menu li[data-flavour="green"] {
  --c: var(--pw-green);
}

.menu li[data-flavour="oat"] {
  --c: var(--pw-oat);
}

.menu button {
  display: flex;
  align-items: center;
  gap: 9px;
  min-height: 44px;
  padding: 0 4px;
  border: 0;
  border-radius: 8px;
  background: none;
  color: inherit;
  font: inherit;
  cursor: pointer;
}

.menu button:focus-visible {
  outline: 2px solid currentColor;
  outline-offset: 2px;
}

.menu button > span {
  opacity: 0.86;
  transition: opacity 200ms linear;
}

.menu li.is-now button > span,
.menu button:hover > span,
.menu button:focus-visible > span {
  opacity: 1;
}

/* A glass, seen from the side: wider at the mouth. */
.cup {
  position: relative;
  flex: none;
  display: block;
  width: 15px;
  height: 21px;
  border: 2px solid currentColor;
  border-top-width: 0;
  border-radius: 1px 1px 5px 5px;
  overflow: hidden;
  transition: transform 420ms var(--ease-text);
}

.cup::before {
  content: "";
  position: absolute;
  inset: 0;
  background-color: var(--c);
  transform: scaleY(var(--p, 0));
  transform-origin: 50% 100%;
}

.menu li.is-now .cup {
  transform: scale(1.22);
}

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

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

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

/* ——— The footer: the counter from above, and the order sticker off a glass ——— */

.foot {
  position: relative;
  z-index: 1;
  display: grid;
  place-items: center;
  min-height: 72vh;
  padding: clamp(48px, 8vh, 88px) var(--gutter) clamp(96px, 13vh, 124px);
  overflow: hidden;
  /* Everything on the counter is to the scale of the sticker. */
  --sticker: clamp(300px, 36vw, 500px);
  /* Until the script has painted the stone, and without the script: the stone as a plain background. */
  background: #f3e7d6 url("textures/terrazzo.webp") 0 0 / calc(var(--sticker) * 2.3) auto;
  color: var(--pw-ink);
}

/* The terrazzo and the sun on it, painted once by the script (see scene.js). */
.foot-stone {
  position: absolute;
  inset: 0;
  z-index: 0;
  display: block;
  width: 100%;
  height: 100%;
  pointer-events: none;
}

/* Two slices left on the counter: photographs, cut out. */
.foot-slice {
  position: absolute;
  z-index: 1;
  display: block;
  height: auto;
  pointer-events: none;
  filter: drop-shadow(5px 7px 6px rgb(0 0 0 / 0.24));
}

.foot-slice[data-at="a"] {
  left: calc(50% + var(--sticker) * 0.56);
  top: 14%;
  width: calc(var(--sticker) * 0.39);
  transform: rotate(24deg);
}

.foot-slice[data-at="b"] {
  left: calc(50% - var(--sticker) * 0.92);
  bottom: 17%;
  width: calc(var(--sticker) * 0.25);
  transform: rotate(-16deg);
}

/* The sticker: white paper, printed in one ink, stuck down a little askew. */
.sticker {
  position: relative;
  z-index: 2;
  width: var(--sticker);
  padding: 30px 32px 34px;
  border-radius: 20px;
  background-color: #fffdf8;
  box-shadow:
    0 1px 0 rgb(255 255 255 / 0.9) inset,
    0 14px 26px rgb(0 0 0 / 0.15),
    0 2px 3px rgb(0 0 0 / 0.18);
  transform: rotate(-3.2deg);
}

.sticker-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding-bottom: 18px;
  border-bottom: 2px dashed rgb(42 27 18 / 0.34);
}

.sticker-brand {
  font-size: clamp(26px, 2.5vw, 34px);
}

.sticker-size {
  flex: none;
  padding: 7px 14px 8px;
  border: 2px solid var(--pw-ink);
  border-radius: 999px;
  font-size: 17px;
  font-weight: 800;
  line-height: 1;
}

.sticker-list {
  display: grid;
  gap: clamp(12px, 1.5vw, 18px);
  padding: 20px 0 22px;
  border-bottom: 2px dashed rgb(42 27 18 / 0.34);
}

.sticker-list li {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  column-gap: 14px;
  align-items: center;
}

/* The box to tick. */
.box {
  position: relative;
  grid-row: 1 / 3;
  display: block;
  width: 30px;
  height: 30px;
  border: 2.5px solid var(--pw-ink);
  border-radius: 7px;
}

/* The one that was ordered: ticked by hand, in berry, over the edge of its box. */
.box svg {
  position: absolute;
  left: -3px;
  top: -12px;
  width: 44px;
  height: 44px;
  overflow: visible;
  fill: none;
  stroke: var(--pw-berry);
  stroke-width: 5;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.sticker-list b {
  font-family: var(--face-display);
  font-size: clamp(22px, 2.1vw, 28px);
  font-weight: 600;
  line-height: 1.05;
}

.sticker-list span {
  color: rgb(42 27 18 / 0.86);
  font-size: 16px;
  font-weight: 700;
  line-height: 1.25;
}

.sticker-line {
  padding-top: 18px;
  font-family: var(--face-display);
  font-size: clamp(20px, 1.8vw, 24px);
  font-weight: 500;
  line-height: 1.1;
}

/* One corner has come unstuck: the back of the paper, and its shade on the front. */
.sticker::after {
  content: "";
  position: absolute;
  right: 0;
  bottom: 0;
  width: 54px;
  height: 54px;
  border-top-left-radius: 14px;
  border-bottom-right-radius: 20px;
  background: linear-gradient(135deg, #f2eadb 0%, #fffdf8 46%, #e6dccb 50%, #f3e7d6 50.5%);
  box-shadow: -5px -5px 9px rgb(0 0 0 / 0.1);
}

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

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

.studio:focus-visible {
  outline: 2px solid var(--pw-ink);
  outline-offset: 3px;
}

.studio svg {
  width: 16px;
  height: 16px;
  stroke-width: 1.75;
}

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

/* ——— A tall screen ——— */

@media (max-aspect-ratio: 7 / 10) {
  .brand {
    font-size: 25px;
  }

  .voice {
    font-size: clamp(34px, 10.4vw, 46px);
  }

  .card-name .line {
    display: block;
  }

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

  .pill {
    height: 54px;
    margin-top: 16px;
  }

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

  /* The glasses without their names: there is no room for four of them beside the brand. */
  .menu button {
    padding: 0 5px;
  }

  .menu button > span {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip-path: inset(50%);
    white-space: nowrap;
  }

  .menu ol {
    gap: 0;
  }

  .live .menu {
    padding: 0 6px;
  }

  .live .stack-open {
    left: var(--gutter);
    right: var(--gutter);
    top: 19vh;
    top: 19svh;
  }

  /* The words tied to things ride up the left of the screen. */
  .live #cue-strawberry,
  .live #cue-banana,
  .live #cue-blended,
  .live #cue-size,
  .live #cue-fruit {
    left: var(--gutter);
    right: auto;
  }

  .caption-word,
  .callout-word {
    font-size: 42px;
  }

  .live .card-name,
  .live .block-card .card-name {
    font-size: clamp(64px, 23vw, 108px);
  }

  .live .block .line {
    display: block;
  }

  .live .block-card .line + .line {
    margin-left: 0;
  }

  .live .card-notes {
    font-size: 20px;
  }

  .live .block-phrase .phrase {
    font-size: clamp(60px, 21vw, 100px);
  }

  .live .card-side {
    left: var(--gutter);
  }

  .live .card-side .card-name {
    font-size: clamp(56px, 19vw, 92px);
  }

  .live .stack-oat {
    left: var(--gutter);
    top: calc((var(--pin, 1) + 0.14) * 100vh);
    top: calc((var(--pin, 1) + 0.14) * 100svh);
  }

  .live .stack-oat .title {
    font-size: 44px;
  }

  .live .recipe {
    display: flex;
    margin-top: 6px;
    font-size: 22px;
  }

  /* A phone cannot show the row at once: the four are not named there. */
  .live .tag {
    display: none;
  }

  .live .final {
    top: calc(var(--gutter) + 62px);
    right: var(--gutter);
  }

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

  .hint span {
    display: none;
  }

  .foot {
    --sticker: min(86vw, 360px);
    min-height: 0;
    padding: 72px var(--gutter) 128px;
  }

  .sticker {
    padding: 24px 22px 26px;
  }

  .foot-slice[data-at="a"] {
    left: auto;
    right: -9%;
    top: 1.5%;
  }

  .foot-slice[data-at="b"] {
    left: -5%;
    bottom: 3%;
  }
}

/* ——— Checks ——— */

.hud {
  position: fixed;
  left: 8px;
  bottom: 8px;
  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-wrap;
  max-width: calc(100vw - 16px);
  pointer-events: none;
}
