/*
 * Fizzbrook Kombucha — a one-page project in live 3D (tickets/SC-03.md, SC-04.md).
 *
 * Layers of the pinned stage, back to front:
 *   .field     z0  the field of a colour, lit like a cyclorama
 *   .word …    z1  what is painted on a field: the monument word, the sun, the phrase, the brook
 *   #gl        z2  the cans: a transparent canvas, so the fields show around them
 *   .marks     z3  two crosses and a tag
 *   .bar …     z4  the interface, which stands still: the captions of act 1, the callouts
 *                  of act 2, the line and the button of act 4
 * After the stage, in the flow of the page: .foot.
 *
 * Brand colours: site/src/variants/pavilion/examples/kombucha/kombucha.module.css.
 */

:root {
  --fz-teal: #0fa3a3;
  --fz-coral: #ff6f61;
  --fz-lemon: #ffd84d;
  --fz-cream: #fff6e3;
  --fz-ink: #14212a;

  --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 project's own face, the one printed on its cans: Rubik — Black for the large
   * words, the regular and medium weights for everything read. The studio's Unbounded
   * and Onest stay in one place only: the lime corner that signs the page.
   */
  --face-display: "Rubik", "Arial Black", Arial, sans-serif;
  --face-text: "Rubik", "Helvetica Neue", Arial, sans-serif;
  --face-studio-display: "Unbounded", "Arial Black", Arial, sans-serif;
  --face-studio-text: "Onest", "Helvetica Neue", Arial, sans-serif;
}

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

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

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

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

/* ——— The pinned scene ——— */

/* Six screens of scroll for the four acts, and the screen the stage itself takes. */
.scene {
  position: relative;
  height: 700vh;
}

.stage {
  position: sticky;
  top: 0;
  height: 100vh;
  height: 100svh;
  overflow: hidden;
  isolation: isolate;
}

/* ——— z0: the field ——— */

.field {
  position: absolute;
  inset: 0;
  /* A layer of its own: while a flood grows only its mask is repainted, not the field. */
  transform: translateZ(0);
  background-color: var(--f);
  background-image: radial-gradient(
    120% 88% at 50% 44%,
    var(--f-hi) 0%,
    var(--f) 48%,
    var(--f-lo) 100%
  );
}

.field[data-tone="ink"] {
  --f: #14212a;
  --f-hi: #1e3442;
  --f-lo: #0b141a;
  --w: #f3e9d4;
}

.field[data-tone="teal"] {
  --f: #0fa3a3;
  --f-hi: #22b3b0;
  --f-lo: #0a8689;
  --w: var(--fz-cream);
}

.field[data-tone="coral"] {
  --f: #ff6f61;
  --f-hi: #ff8072;
  --f-lo: #ee5747;
  --w: var(--fz-cream);
}

.field[data-tone="lemon"] {
  --f: #ffd84d;
  --f-hi: #ffe06a;
  --f-lo: #f4c22a;
  --w: var(--fz-ink);
}

.field[data-tone="cream"] {
  --f: #fff6e3;
  --f-hi: #fffaf0;
  --f-lo: #f1e3c4;
  --w: var(--fz-ink);
}

/* A flavour floods over the field before it: a soft-edged circle that grows from its can. */
.flood {
  visibility: hidden;
  -webkit-mask-image: radial-gradient(
    circle at var(--fx, 50%) var(--fy, 50%),
    #000 var(--r0, 0px),
    transparent var(--r1, 0px)
  );
  mask-image: radial-gradient(
    circle at var(--fx, 50%) var(--fy, 50%),
    #000 var(--r0, 0px),
    transparent var(--r1, 0px)
  );
}

.flood.is-open {
  visibility: visible;
}

.flood.is-full {
  -webkit-mask-image: none;
  mask-image: none;
}

/* A field wholly under a full one is not painted. */
.field.is-under {
  visibility: hidden;
}

/* ——— z1: the monument word ——— */

.word {
  position: absolute;
  left: 0;
  right: 0;
  top: 47%;
  transform: translate3d(var(--wx, 0px), -50%, 0);
  color: var(--w);
  font-family: var(--face-display);
  font-size: var(--word-size, 16vw);
  font-weight: 900;
  line-height: 0.8;
  letter-spacing: -0.02em;
  text-align: center;
  white-space: nowrap;
  user-select: none;
  -webkit-user-select: none;
}

/* Act 2: the sun of the Peach & Ginger can, behind the can. It grows a little with the scroll. */
.disc {
  position: absolute;
  left: 50%;
  top: 50%;
  width: min(80vh, 60vw);
  aspect-ratio: 1;
  border-radius: 50%;
  background-color: var(--fz-lemon);
  transform: translate3d(-50%, -50%, 0) scale(var(--disc, 1));
}

/* Act 3: the phrase as wide as the screen. It slides against the scroll. */
.shout {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate3d(calc(-50% + var(--shift, 0px) + var(--wx, 0px)), -50%, 0);
  /* Ink on coral: the colours of the brand book's round sticker. */
  color: var(--fz-ink);
  font-family: var(--face-display);
  font-size: var(--shout-size, 36vw);
  font-weight: 900;
  line-height: 0.8;
  letter-spacing: -0.03em;
  text-transform: uppercase;
  white-space: nowrap;
  user-select: none;
  -webkit-user-select: none;
}

/* Act 4: the brook of the brand book at the foot of the teal field. */
.brook {
  position: absolute;
  left: -8%;
  bottom: -1px;
  width: 116%;
  height: 24%;
  fill: #0a8689;
  transform: translate3d(var(--brook, 0px), 0, 0);
}

/* ——— z2: the cans ——— */

#gl {
  position: absolute;
  inset: 0;
  display: block;
  width: 100%;
  height: 100%;
  opacity: 0;
  transition: opacity 900ms var(--ease-camera);
}

#gl.is-ready {
  opacity: 1;
}

/* ——— Tones of the interface: ink on a colour, cream on ink ——— */

[data-ui] {
  --ui: var(--fz-ink);
  --ui-dim: rgb(20 33 42 / 0.94);
  --ui-line: rgb(20 33 42 / 0.4);
  --ui-wave: var(--fz-cream);
  color: var(--ui);
  transition: color 420ms var(--ease-camera);
}

[data-ui][data-tone="ink"] {
  --ui: var(--fz-cream);
  --ui-dim: rgb(255 246 227 / 0.68);
  --ui-line: rgb(255 246 227 / 0.34);
  --ui-wave: var(--fz-coral);
}

/* ——— z3: the markup layer ——— */

.marks {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.cross {
  position: absolute;
  width: 15px;
  height: 15px;
  color: var(--ui-line);
  transition: color 420ms var(--ease-camera);
}

.cross::before,
.cross::after {
  content: "";
  position: absolute;
  background-color: currentColor;
}

.cross::before {
  left: 7px;
  top: 0;
  width: 1px;
  height: 15px;
}

.cross::after {
  left: 0;
  top: 7px;
  width: 15px;
  height: 1px;
}

.cross[data-at="a"] {
  left: calc(25% - 7px);
  top: calc(14% - 7px);
}

.cross[data-at="b"] {
  right: calc(25% - 7px);
  bottom: calc(13% - 7px);
}

.tag {
  position: absolute;
  right: calc(25% + 18px);
  bottom: calc(13% - 7px);
  color: var(--ui-dim);
  font-size: 14px;
  font-weight: 500;
  letter-spacing: 0;
  line-height: 15px;
  transition: color 420ms var(--ease-camera);
}

/* ——— z4: the interface ——— */

.bar {
  position: absolute;
  top: var(--gutter);
  left: var(--gutter);
  right: var(--gutter);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  font-size: 15px;
  font-weight: 500;
  letter-spacing: 0;
  line-height: 1;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
}

.brand > span {
  font-family: var(--face-display);
  font-size: 20px;
  font-weight: 900;
  letter-spacing: -0.01em;
}

.brand-mark {
  flex: none;
  width: 26px;
  height: 26px;
}

.brand-wave {
  fill: var(--ui-wave);
  transition: fill 420ms var(--ease-camera);
}

.bar-note {
  color: var(--ui-dim);
  transition: color 420ms var(--ease-camera);
}

/* The captions share one cell; one is shown at a time. */
.captions {
  position: absolute;
  left: var(--gutter);
  bottom: calc(var(--gutter) + 4px);
  display: grid;
  width: min(25vw, 380px);
}

.caption {
  grid-area: 1 / 1;
  align-self: end;
}

/* A statement, not a name: said in the text face. */
.voice {
  font-size: clamp(21px, 1.95vw, 31px);
  font-weight: 500;
  letter-spacing: -0.015em;
  line-height: 1.12;
}

.title {
  font-family: var(--face-display);
  font-size: clamp(30px, 3.3vw, 56px);
  font-weight: 900;
  letter-spacing: -0.015em;
  line-height: 1.02;
}

.notes {
  margin-top: 16px;
  font-size: clamp(15px, 1.2vw, 18px);
  font-weight: 400;
  line-height: 1.38;
}

/* A line comes up from under a mask and leaves the way it came. */
.line {
  display: block;
  overflow: hidden;
  padding-bottom: 0.14em;
  margin-bottom: -0.14em;
}

.line > span {
  display: block;
  transform: translate3d(0, 118%, 0);
  transition: transform 320ms var(--ease-camera);
}

.caption.is-on .line > span,
.callout.is-on .line > span,
.final.is-on .line > span {
  transform: none;
  transition: transform 700ms var(--ease-text) calc(var(--i, 0) * 70ms + 160ms);
}

/* The pointer of the three flavours. */
.index {
  position: absolute;
  right: var(--gutter);
  top: 71%;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 18px;
  transform: translateY(-50%);
}

.count {
  display: flex;
  align-items: center;
  gap: 8px;
  font-family: var(--face-display);
  font-size: 15px;
  font-weight: 500;
  line-height: 1;
  opacity: 0.5;
  transition: opacity 420ms var(--ease-camera);
}

.index,
.tag {
  transition:
    opacity 420ms var(--ease-camera),
    visibility 0s linear 0s,
    color 420ms var(--ease-camera);
}

.stage:not([data-act="0"]) .index,
.stage:not([data-act="0"]) .tag {
  opacity: 0;
  visibility: hidden;
  transition:
    opacity 420ms var(--ease-camera),
    visibility 0s linear 420ms;
}

.stage[data-state="1"] .count,
.stage[data-state="2"] .count,
.stage[data-state="3"] .count {
  opacity: 1;
}

.count-now {
  display: block;
  height: 1em;
  overflow: hidden;
}

.roll {
  display: flex;
  flex-direction: column;
  transform: translate3d(0, calc(var(--n, 0) * -1em), 0);
  transition: transform 700ms var(--ease-text);
}

.roll > span {
  display: block;
  height: 1em;
}

.count-dash {
  color: var(--ui-dim);
}

.ticks {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 4px;
  list-style: none;
}

.ticks button {
  position: relative;
  display: block;
  width: 44px;
  height: 22px;
  padding: 0;
  border: 0;
  background: none;
  color: inherit;
  cursor: pointer;
}

.ticks button::after {
  content: "";
  position: absolute;
  right: 0;
  top: 10px;
  width: 16px;
  height: 2px;
  background-color: currentColor;
  opacity: 0.4;
  transition:
    width 500ms var(--ease-text),
    opacity 300ms linear;
}

.ticks button:hover::after,
.ticks button:focus-visible::after {
  opacity: 0.8;
}

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

.stage[data-state="1"] .ticks li:nth-child(1) button::after,
.stage[data-state="2"] .ticks li:nth-child(2) button::after,
.stage[data-state="3"] .ticks li:nth-child(3) button::after {
  width: 40px;
  opacity: 1;
}

.hint {
  position: absolute;
  right: var(--gutter);
  bottom: calc(var(--gutter) + 4px);
  display: flex;
  align-items: center;
  gap: 12px;
  color: var(--ui-dim);
  font-size: 14px;
  font-weight: 500;
  letter-spacing: 0;
  line-height: 1;
  transition:
    opacity 420ms var(--ease-camera),
    color 420ms var(--ease-camera);
}

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

.stage.is-moving .hint {
  opacity: 0;
}

/* ——— Act 2: one can in detail ——— */

.detail,
.final {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.leaders {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  overflow: visible;
}

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

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

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

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

.leader.is-on .dot {
  opacity: 1;
  transition: opacity 240ms linear 520ms;
}

.leader.is-on .ring {
  opacity: 0.5;
  transition: opacity 240ms linear 620ms;
}

.callout {
  position: absolute;
  left: var(--gutter);
  width: min(24vw, 360px);
}

.callout[data-n="0"] {
  top: 24%;
}

.callout[data-n="1"] {
  left: auto;
  right: var(--gutter);
  top: 43%;
  text-align: right;
}

.callout[data-n="1"] .callout-word {
  margin-left: auto;
  font-size: clamp(34px, 4vw, 66px);
  font-weight: 900;
  letter-spacing: -0.015em;
}

.callout[data-n="2"] {
  top: 62%;
}

.callout-word {
  width: -webkit-fit-content;
  width: fit-content;
  font-family: var(--face-display);
  font-size: clamp(30px, 3.5vw, 58px);
  font-weight: 700;
  letter-spacing: -0.025em;
  line-height: 1;
}

.callout-text {
  margin-top: 12px;
  color: var(--ui-dim);
  font-size: clamp(15px, 1.2vw, 18px);
  font-weight: 400;
  line-height: 1.35;
}

/* ——— Act 4: the three together ——— */

.final-body {
  position: absolute;
  left: var(--gutter);
  top: 48%;
  width: min(46vw, 680px);
  transform: translate3d(0, -50%, 0);
}

.final-title {
  font-family: var(--face-display);
  font-size: clamp(3.25rem, 7.4vw, 8rem);
  font-weight: 900;
  letter-spacing: -0.025em;
  line-height: 0.92;
}

/* The button: a capsule with its arrow in a round — ink on the field, the lemon of the brand. */
.pill {
  display: inline-flex;
  align-items: center;
  gap: 18px;
  height: 56px;
  margin-top: clamp(24px, 4vh, 44px);
  padding: 6px 6px 6px 24px;
  border-radius: 999px;
  background-color: var(--fz-ink);
  color: var(--fz-cream);
  font-size: 16px;
  font-weight: 500;
  line-height: 1;
  text-decoration: none;
  white-space: nowrap;
  opacity: 0;
  transform: translate3d(0, 18px, 0);
  transition:
    opacity 240ms linear,
    transform 320ms var(--ease-camera),
    background-color 180ms linear;
}

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

.pill:hover {
  background-color: #0b141a;
}

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

.pill-round {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background-color: var(--fz-lemon);
  color: var(--fz-ink);
  transition: transform 180ms var(--ease-camera);
}

.pill-round svg,
.studio svg {
  width: 20px;
  height: 20px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.75;
  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 price of the poster: a round cream sticker, a little askew. */
.price {
  position: absolute;
  left: 46%;
  top: 14%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  width: clamp(92px, 8.6vw, 128px);
  aspect-ratio: 1;
  border-radius: 50%;
  background-color: var(--fz-cream);
  color: var(--fz-ink);
  opacity: 0;
  transform: rotate(-24deg) scale(0.6);
  transition:
    opacity 200ms linear,
    transform 320ms var(--ease-camera);
}

.final.is-on .price {
  opacity: 1;
  transform: rotate(10deg);
  transition:
    opacity 240ms linear 620ms,
    transform 800ms var(--ease-text) 620ms;
}

.price b {
  font-family: var(--face-display);
  font-size: clamp(28px, 2.8vw, 42px);
  font-weight: 900;
  letter-spacing: -0.02em;
  line-height: 1;
}

.price span {
  font-size: 14px;
  font-weight: 500;
  letter-spacing: 0;
  line-height: 1;
}

/* ——— The footer: the brand, its flavours, and the studio's lime corner ——— */

.foot {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr);
  align-content: start;
  gap: clamp(28px, 5vh, 56px) var(--gutter);
  min-height: 50vh;
  padding: clamp(44px, 8vh, 88px) var(--gutter) clamp(84px, 12vh, 120px);
  background-color: var(--fz-ink);
  color: var(--fz-cream);
}

.foot-brand {
  display: flex;
  align-items: flex-start;
  gap: clamp(14px, 1.6vw, 24px);
}

.foot-mark {
  flex: none;
  width: clamp(44px, 5.2vw, 84px);
  height: clamp(44px, 5.2vw, 84px);
}

.foot-name {
  font-family: var(--face-display);
  font-size: clamp(2.5rem, 5.8vw, 6rem);
  font-weight: 900;
  letter-spacing: -0.02em;
  line-height: 0.96;
}

.foot-name span {
  display: block;
}

.foot-list {
  display: grid;
  align-content: start;
  list-style: none;
  border-top: 1px solid rgb(255 246 227 / 0.24);
}

.foot-list li {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
  padding: 14px 0;
  border-bottom: 1px solid rgb(255 246 227 / 0.24);
}

.foot-list b {
  font-size: clamp(1.125rem, 1.5vw, 1.5rem);
  font-weight: 500;
  letter-spacing: 0;
  line-height: 1.2;
}

.foot-list span,
.foot-note {
  color: rgb(255 246 227 / 0.72);
  font-size: 15px;
  line-height: 1.4;
}

.foot-list span {
  text-align: right;
}

.foot-note {
  grid-column: 1;
  align-self: end;
  max-width: 34ch;
}

/* 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(--fz-cream);
  outline-offset: 3px;
}

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

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

/* ——— A tall screen: the word in two halves, over the can and under it ——— */

@media (max-aspect-ratio: 4 / 5) {
  .scene {
    height: 660vh;
    height: 660svh;
  }

  .disc {
    top: 38%;
    width: 94vw;
  }

  /* The phrase stands on end: it reads up the screen and fills its height. */
  .shout {
    transform: translate3d(-50%, -50%, 0) rotate(-90deg)
      translate3d(calc(var(--shift, 0px) * -1), 0, 0);
  }

  .brook {
    height: 15%;
  }

  /* The callouts share the foot of the screen; the newest one is shown. */
  .callout[data-n="0"],
  .callout[data-n="1"],
  .callout[data-n="2"] {
    left: var(--gutter);
    right: var(--gutter);
    top: auto;
    bottom: calc(var(--gutter) + 6px + env(safe-area-inset-bottom, 0px));
    width: auto;
    text-align: left;
  }

  .callout-word,
  .callout[data-n="1"] .callout-word {
    margin-left: 0;
    font-size: 38px;
  }

  .callout-text {
    margin-top: 8px;
    font-size: 15px;
  }

  .final-body {
    top: auto;
    bottom: calc(var(--gutter) + 10px + env(safe-area-inset-bottom, 0px));
    width: auto;
    transform: none;
  }

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

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

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

  .price {
    left: auto;
    right: var(--gutter);
    top: 12%;
    width: 86px;
  }

  .price b {
    font-size: 26px;
  }

  .foot {
    grid-template-columns: minmax(0, 1fr);
    min-height: 0;
    padding-bottom: 96px;
  }

  .foot-list li {
    flex-direction: column;
    align-items: flex-start;
    gap: 2px;
  }

  .foot-list span {
    text-align: left;
  }

  .word {
    top: 11%;
    bottom: 22%;
    left: 5%;
    right: 5%;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    transform: translate3d(var(--wx, 0px), 0, 0);
    font-size: var(--word-size, 22vw);
  }

  .word span:first-child {
    text-align: left;
  }

  .word span:last-child {
    text-align: right;
  }

  .bar {
    font-size: 15px;
  }

  .bar-note {
    display: none;
  }

  .captions {
    width: min(72vw, 300px);
    bottom: calc(var(--gutter) + 6px + env(safe-area-inset-bottom, 0px));
  }

  .voice {
    font-size: 22px;
  }

  .title {
    font-size: 31px;
  }

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

  .index {
    top: var(--gutter);
    transform: none;
    gap: 14px;
  }

  .count {
    height: 26px;
    font-size: 14px;
  }

  .ticks button {
    width: 44px;
    height: 20px;
  }

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

  .hint span {
    display: none;
  }

  .cross[data-at="a"] {
    left: calc(var(--gutter) - 1px);
    top: calc(50% - 7px);
  }

  .cross[data-at="b"] {
    right: calc(var(--gutter) - 1px);
    bottom: calc(22% - 7px);
  }

  .tag {
    display: none;
  }
}

/*
 * ——— Reduced motion (or ?still): the acts become plain sections ———
 *
 * No pinned stage and no long scroll: the script draws one frame of each act
 * and sets it in a section of its own (.still) — the field, the picture of
 * the cans, the words — one under another.
 */

.rm .scene {
  height: auto;
}

.rm .stage {
  position: relative;
}

.rm .stage[hidden] {
  display: none;
}

.still {
  position: relative;
  height: 100vh;
  height: 100svh;
  overflow: hidden;
  isolation: isolate;
}

.still .field {
  visibility: visible;
  -webkit-mask-image: none;
  mask-image: none;
}

.still-shot {
  position: absolute;
  inset: 0;
  display: block;
  width: 100%;
  height: 100%;
}

.rm .hint,
.rm .index {
  display: none;
}

.rm #gl,
.rm [data-ui],
.rm .line > span,
.rm .roll,
.rm .leader path,
.rm .leader circle,
.rm .pill,
.rm .price {
  transition: none !important;
}

.rm .line > span {
  transform: none;
}

.rm .caption:not(.is-on) {
  display: none;
}

.rm .leader path {
  stroke-dashoffset: 0;
}

.rm .leader .dot {
  opacity: 1;
}

.rm .leader .ring {
  opacity: 0.5;
}

.rm .pill {
  opacity: 1;
  transform: none;
  pointer-events: auto;
}

.rm .price {
  opacity: 1;
  transform: rotate(10deg);
}

@media (max-aspect-ratio: 4 / 5) {
  /* On a phone the three callouts stand in a column at the foot, without their lines. */
  .rm .detail {
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    gap: 14px;
    padding: 0 var(--gutter) calc(var(--gutter) + 6px);
  }

  .rm .callout,
  .rm .callout[data-n="1"] {
    position: static;
  }

  .rm .callout-word {
    font-size: 28px;
  }

  .rm .callout-text {
    margin-top: 4px;
  }

  .rm .leaders {
    display: none;
  }
}

/* Before the script has run, or without it. */
@media (prefers-reduced-motion: reduce) {
  .scene {
    height: auto;
  }

  .stage {
    position: relative;
  }

  #gl,
  [data-ui],
  .line > span,
  .roll {
    transition: none;
  }
}

/* ——— No WebGL: the field, the word and the words stay ——— */

.no-gl #gl {
  display: none;
}

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

.labels {
  position: fixed;
  inset: 0;
  z-index: 30;
  display: grid;
  gap: 8px;
  padding: 8px;
  overflow: auto;
  background: #222;
}

.labels canvas {
  display: block;
  width: 100%;
  height: auto;
}
