/*
 * Ricetide — a one-page project in live 3D (tickets/SC-14.md).
 *
 * The pinned stage, back to front:
 *   #gl        z0  the bar itself: counter, paper screen, lanterns, the food,
 *                  the box and the printed paper — one opaque canvas
 *   .bar …     z1  the interface, which stands still: the lines of acts 1 and 3,
 *                  the caption of the stack, the menu under the dishes
 * After the stage, in the flow of the page: .foot.
 *
 * Brand colours: indigo, salmon, white (tickets/SC-14.md → «Бренд»).
 */

:root {
  --rt-indigo: #26306b;
  --rt-night: #161b47;
  --rt-salmon: #ff8a65;
  --rt-rice: #f4eee3;
  --rt-ink: #14183d;

  --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 faces of this project: the bar's own heavy one (one weight, never under 20 px) and a
     round Japanese gothic for everything small. The studio's faces are only in its corner. */
  --face-display: "Dela Gothic One", "Arial Black", Arial, sans-serif;
  --face-text: "Zen Maru Gothic", system-ui, -apple-system, "Segoe UI", sans-serif;
}

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

html {
  background: var(--rt-night);
  color: #fff;
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  color: #fff;
  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,
dl,
dd {
  margin: 0;
  padding: 0;
}

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

/* ——— 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;
  /* Before the first frame, and behind the canvas if it never comes: the screen at night. */
  background-color: var(--rt-night);
  background-image: linear-gradient(#161b47 0%, #26306b 52%, #120c0a 52.2%, #1d120c 100%);
}

/* ——— z0: the bar ——— */

/* The foot of the picture goes a little darker, as under a lens hood: the words there lie on it. */
.stage::after {
  content: "";
  position: absolute;
  z-index: 1;
  left: 0;
  right: 0;
  bottom: 0;
  height: 46%;
  background-image: linear-gradient(to top, rgb(9 8 20 / 0.66) 0%, rgb(9 8 20 / 0.34) 46%, rgb(9 8 20 / 0) 100%);
  pointer-events: none;
}

.stage > [data-ui] {
  z-index: 2;
}

#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: white on the dark, ink on the light of the screen ——— */

[data-ui] {
  --ui: #fff;
  --ui-dim: rgb(255 255 255 / 0.78);
  --ui-line: rgb(255 255 255 / 0.4);
  --ui-rice: var(--rt-indigo);
  /* Said in plain values as well as through --ui: a reader of the stylesheet sees white on the dark. */
  color: #fff;
  transition: color 420ms var(--ease-camera);
}

[data-ui][data-tone="dark"] {
  color: #14183d;
  --ui: var(--rt-ink);
  --ui-dim: rgb(20 24 61 / 0.86);
  --ui-line: rgb(20 24 61 / 0.5);
  --ui-rice: var(--rt-rice);
}

/* ——— z1: the interface ——— */

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

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-family: var(--face-display);
  font-size: 20px;
  font-weight: 400;
}

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

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

.bar-link {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 0 4px;
  color: inherit;
  text-decoration: none;
  text-underline-offset: 5px;
}

.bar-link:hover,
.bar-link:focus-visible {
  text-decoration: underline;
}

.bar-link:focus-visible {
  outline: 2px solid currentColor;
  outline-offset: 2px;
}

/* The captions share one cell; one is shown at a time. They lie over the wood of the counter. */
.captions {
  position: absolute;
  left: var(--gutter);
  bottom: calc(var(--gutter) + 4px);
  display: grid;
  width: min(34vw, 520px);
}

.caption {
  position: relative;
  grid-area: 1 / 1;
  align-self: end;
  pointer-events: none;
}

.title {
  font-family: var(--face-display);
  font-size: clamp(24px, 2.5vw, 42px);
  font-weight: 400;
  letter-spacing: 0;
  line-height: 1.12;
}

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

/* 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 {
  transform: none;
  transition: transform 700ms var(--ease-text) calc(var(--i, 0) * 70ms + 160ms);
}

/* The price of the box: a round salmon sticker, a little askew. */
.price {
  position: absolute;
  left: calc(100% + 20px);
  bottom: 6px;
  display: grid;
  place-items: center;
  width: clamp(84px, 7.4vw, 112px);
  aspect-ratio: 1;
  border-radius: 50%;
  background-color: var(--rt-salmon);
  color: var(--rt-ink);
  opacity: 0;
  transform: rotate(-24deg) scale(0.6);
  transition:
    opacity 200ms linear,
    transform 320ms var(--ease-camera);
}

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

.price b {
  font-family: var(--face-display);
  font-size: clamp(24px, 2.3vw, 34px);
  font-weight: 400;
  letter-spacing: 0;
  line-height: 1;
}

/* The pointer of the four acts: it lies over the counter in every one of them. */
.index {
  position: absolute;
  right: var(--gutter);
  top: 74%;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 18px;
  transform: translateY(-50%);
  transition: opacity 420ms var(--ease-camera);
}

.count {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  font-weight: 700;
  line-height: 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.5;
  transition:
    width 500ms var(--ease-text),
    opacity 300ms linear;
}

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

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

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

/* In the menu the row of dishes and their names take the whole foot of the screen. */
.stage[data-act="3"] .index {
  opacity: 0;
  pointer-events: none;
}

.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: 700;
  line-height: 1;
  transition: opacity 420ms var(--ease-camera);
}

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

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

/* ——— Act 2: the stack. One caption, always in one place; its line swings to the layer ——— */

.detail,
.lineup {
  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.25;
  stroke-dasharray: 1;
  stroke-dashoffset: 1;
  transition: stroke-dashoffset 260ms var(--ease-camera);
}

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

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

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

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

.leader.is-on .ring {
  opacity: 0.55;
  transition: opacity 220ms linear 540ms;
}

.callout {
  position: absolute;
  left: 67%;
  top: 23%;
  width: min(31vw, 460px);
}

.callout-word {
  width: -webkit-fit-content;
  width: fit-content;
  font-family: var(--face-display);
  font-size: clamp(30px, 4vw, 64px);
  font-weight: 400;
  letter-spacing: 0;
  line-height: 1.1;
}

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

/* ——— Act 4: the menu. A name, a note and a price under every dish ——— */

.dish {
  position: absolute;
  left: var(--x, 50%);
  top: var(--menu-top, 76%);
  width: min(17vw, 250px);
  text-align: center;
  opacity: 0;
  transform: translate3d(-50%, 22px, 0);
  transition:
    opacity 200ms linear,
    transform 320ms var(--ease-camera);
}

.lineup.is-on .dish {
  opacity: 1;
  transform: translate3d(-50%, 0, 0);
  transition:
    opacity 380ms linear calc(var(--i) * 80ms + 80ms),
    transform 800ms var(--ease-text) calc(var(--i) * 80ms + 80ms);
}

.dish-price {
  font-family: var(--face-display);
  font-size: clamp(22px, 2.3vw, 38px);
  font-weight: 400;
  letter-spacing: 0;
  line-height: 1;
  color: var(--rt-salmon);
}

.dish-name {
  margin-top: 10px;
  font-size: clamp(15px, 1.25vw, 19px);
  font-weight: 700;
  letter-spacing: -0.01em;
  line-height: 1.2;
}

.dish-note {
  margin-top: 4px;
  color: var(--ui-dim);
  font-size: clamp(14px, 1vw, 15px);
  font-weight: 500;
  line-height: 1.35;
}

/* The button: a capsule with its arrow in a round — salmon on the wood, ink on the salmon. */
.pill {
  position: absolute;
  left: 50%;
  bottom: calc(var(--gutter) + 2px);
  display: inline-flex;
  align-items: center;
  gap: 18px;
  height: 56px;
  padding: 6px 6px 6px 26px;
  border-radius: 999px;
  background-color: var(--rt-salmon);
  color: var(--rt-ink);
  font-size: 15px;
  font-weight: 700;
  line-height: 1;
  text-decoration: none;
  white-space: nowrap;
  opacity: 0;
  transform: translate3d(-50%, 18px, 0);
  transition:
    opacity 240ms linear,
    transform 320ms var(--ease-camera),
    background-color 180ms linear;
}

.lineup.is-go .pill {
  opacity: 1;
  transform: translate3d(-50%, 0, 0);
  pointer-events: auto;
  transition:
    opacity 420ms linear 120ms,
    transform 700ms var(--ease-text) 120ms,
    background-color 180ms linear;
}

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

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

.pill-round {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background-color: var(--rt-ink);
  color: #fff;
  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 footer: the slip of an order, lying on the counter ———
 *
 * A narrow strip of paper in the middle, torn off a roll: a perforation at its head, a torn
 * edge at its foot, the menu line by line. The wood under it is the counter of the scene.
 */

.foot {
  --wood: #20140e;
  --paper: #f3ecdc;
  --slip-ink: #1b1e45;
  position: relative;
  display: grid;
  justify-items: center;
  padding: clamp(36px, 5vh, 52px) var(--gutter) 92px;
  background-color: #20140e;
  background-image:
    repeating-linear-gradient(0deg, rgb(0 0 0 / 0) 0 118px, rgb(0 0 0 / 0.5) 118px 120px),
    repeating-linear-gradient(1deg, rgb(120 78 48 / 0.1) 0 3px, rgb(0 0 0 / 0) 3px 11px),
    linear-gradient(#2a1a11, #1b100a);
  color: #1b1e45;
}

/* Ink on paper, in plain values: 13 to 1. (--paper and --wood paint the torn edges below.) */
.slip {
  position: relative;
  width: min(100%, 420px);
  padding: 30px 26px 22px;
  background-color: #f3ecdc;
  /* The paper of the place mat and the chopstick sleeve: washi, its fibres showing. */
  background-image: url("textures/washi.webp");
  background-size: 420px 420px;
  color: #1b1e45;
  box-shadow: 0 18px 34px -14px rgb(0 0 0 / 0.7);
  transform: rotate(-1.1deg);
  font-variant-numeric: tabular-nums;
}

/* The head of the strip: the row of holes it was torn along, and the dashed line of the perforation. */
.slip::before {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  top: -5px;
  height: 10px;
  background-image: radial-gradient(circle at 50% 50%, var(--wood) 0 3.4px, rgb(0 0 0 / 0) 3.9px);
  background-size: 14px 10px;
  background-position: 7px 0;
}

/* Its foot: torn against the teeth of the cutter. */
.slip::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  top: 100%;
  height: 9px;
  background-image:
    linear-gradient(135deg, var(--paper) 6.4px, rgb(0 0 0 / 0) 6.6px),
    linear-gradient(225deg, var(--paper) 6.4px, rgb(0 0 0 / 0) 6.6px);
  background-size: 18px 9px;
}

.slip-head {
  display: grid;
  justify-items: center;
  gap: 6px;
  padding-top: 14px;
  border-top: 2px dashed rgb(27 30 69 / 0.4);
  text-align: center;
}

.slip-mark {
  width: 44px;
  height: 44px;
  margin-bottom: 6px;
}

.slip-name {
  font-family: var(--face-display);
  font-size: 30px;
  font-weight: 400;
  letter-spacing: 0;
  line-height: 1;
}

.slip-tag,
.slip-title,
.slip-facts dt {
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 0.02em;
  line-height: 1.2;
}

.slip-title {
  margin-top: 18px;
  padding-top: 12px;
  border-top: 2px dashed rgb(27 30 69 / 0.4);
}

.slip-list {
  display: grid;
  gap: 9px;
  margin-top: 12px;
  list-style: none;
}

/* A line of the slip: the dish, a row of dots, the price. */
.slip-row {
  display: flex;
  align-items: baseline;
  gap: 8px;
}

.slip-row b {
  font-size: 17px;
  font-weight: 700;
  letter-spacing: -0.01em;
  line-height: 1.25;
}

.slip-row i {
  flex: 1;
  min-width: 16px;
  border-bottom: 2px dotted rgb(27 30 69 / 0.45);
  transform: translateY(-4px);
}

.slip-row span {
  font-family: var(--face-display);
  font-size: 20px;
  font-weight: 400;
  line-height: 1.25;
}

.slip-note {
  margin-top: 1px;
  color: rgb(27 30 69 / 0.82);
  font-size: 14px;
  line-height: 1.35;
}

.slip-facts {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px 18px;
  margin-top: 16px;
  padding-top: 14px;
  border-top: 2px dashed rgb(27 30 69 / 0.4);
}

.slip-facts dt {
  margin-bottom: 5px;
}

.slip-facts dd {
  font-size: 14px;
  line-height: 1.4;
}

.slip-facts a {
  display: inline-block;
  padding: 6px 0;
  color: inherit;
  font-size: 16px;
  font-weight: 700;
  text-decoration: underline;
  text-underline-offset: 4px;
}

.slip-facts a:focus-visible {
  outline: 2px solid var(--slip-ink);
  outline-offset: 3px;
}

/* The studio signs in its own colours, not the bar'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;
  /* The studio signs in its own face too. */
  font-family: "Onest", system-ui, -apple-system, "Segoe UI", sans-serif;
  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 #fff;
  outline-offset: 3px;
}

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

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

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

@media (max-aspect-ratio: 4 / 5) {
  /* The menu is walked dish by dish there, so the scene is a little longer. */
  .scene {
    height: 800vh;
    height: 800svh;
  }


  .captions {
    width: auto;
    right: 84px;
    bottom: calc(var(--gutter) + 6px + env(safe-area-inset-bottom, 0px));
  }

  .title {
    font-size: 27px;
  }

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

  .price {
    left: auto;
    right: -72px;
    bottom: 0;
    width: 76px;
  }

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

  /* No pointer of the acts on a narrow screen: the name has the top of it, the piece the rest. */
  .index {
    display: none;
  }

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

  .hint span {
    display: none;
  }

  /* The caption of the stack stands at the foot, over the wood; its line climbs to the layer. */
  .callout {
    left: var(--gutter);
    right: var(--gutter);
    top: auto;
    bottom: calc(var(--gutter) + 6px + env(safe-area-inset-bottom, 0px));
    width: auto;
  }

  .callout-word {
    font-size: 38px;
  }

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

  /* On a narrow screen the names lie over the pale paper of the place mat: the foot of the
     picture goes dark under them, so white letters keep their contrast. */
  .lineup::before {
    content: "";
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    height: 46%;
    background-image: linear-gradient(to top, rgb(9 8 20 / 0.92) 0%, rgb(9 8 20 / 0.8) 58%, rgb(9 8 20 / 0) 100%);
    opacity: 0;
    transition: opacity 420ms var(--ease-camera);
  }

  .lineup.is-on::before {
    opacity: 1;
  }

  .rm .lineup::before {
    display: none;
  }

  /* One dish at a time: its name at the foot, the button under it. */
  .dish {
    left: var(--gutter);
    right: var(--gutter);
    top: auto;
    bottom: calc(var(--gutter) + 84px + env(safe-area-inset-bottom, 0px));
    width: auto;
    text-align: left;
    transform: translate3d(0, 22px, 0);
  }

  .lineup.is-on .dish {
    opacity: 0;
    transform: translate3d(0, 22px, 0);
    transition:
      opacity 180ms linear,
      transform 320ms var(--ease-camera);
  }

  .lineup.is-on .dish.is-near {
    opacity: 1;
    transform: none;
    transition:
      opacity 320ms linear 140ms,
      transform 700ms var(--ease-text) 140ms;
  }

  .dish-price {
    font-size: 30px;
  }

  .dish-name {
    margin-top: 8px;
    font-size: 19px;
  }

  .dish-note {
    font-size: 15px;
  }

  .pill {
    left: var(--gutter);
    bottom: calc(var(--gutter) + 6px + env(safe-area-inset-bottom, 0px));
    height: 52px;
    transform: translate3d(0, 18px, 0);
  }

  .lineup.is-go .pill {
    transform: none;
  }

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

  .foot {
    padding-bottom: 104px;
  }

  .slip {
    padding: 32px 20px 24px;
  }
}

/*
 * ——— 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), with the words of that act.
 */

.rm .scene {
  height: auto;
}

.rm .stage {
  position: relative;
}

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

.still {
  position: relative;
  height: 100vh;
  height: 100svh;
  overflow: hidden;
  isolation: isolate;
  background-color: var(--rt-night);
}

/* The same darker foot as on the stage: the words of a still lie on it. */
.still::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 46%;
  background-image: linear-gradient(to top, rgb(9 8 20 / 0.66) 0%, rgb(9 8 20 / 0.34) 46%, rgb(9 8 20 / 0) 100%);
  pointer-events: none;
}

.still > [data-ui] {
  z-index: 2;
}

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

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

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

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

.rm .caption {
  display: none;
}

.rm .still .caption {
  display: block;
}

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

/* The four things the roll is made of, named in a column where the one caption used to stand. */
.rm .detail {
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  gap: 10px;
  /* Over the wood of the counter, clear of the board and of what lies on it. */
  padding: 26vh var(--gutter) 0 67%;
}

.rm .callout {
  position: static;
  display: flex;
  align-items: baseline;
  gap: 14px;
  width: auto;
}

.rm .callout-word {
  font-size: clamp(24px, 2.6vw, 40px);
}

.rm .callout-text {
  margin: 0;
}

.rm .dish,
.rm .lineup.is-on .dish {
  opacity: 1;
  transform: translate3d(-50%, 0, 0);
}

.rm .pill,
.rm .lineup.is-go .pill {
  opacity: 1;
  transform: translate3d(-50%, 0, 0);
  pointer-events: auto;
}

@media (max-aspect-ratio: 4 / 5) {
  .rm .detail {
    justify-content: flex-end;
    gap: 6px;
    padding: 0 var(--gutter) calc(var(--gutter) + 6px);
  }

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

  /* The menu: its picture, and under the picture the five dishes as a list. */
  .still.is-menu {
    height: auto;
  }

  .still.is-menu::after {
    display: none;
  }

  .still.is-menu .still-shot {
    position: relative;
    height: 62vh;
    height: 62svh;
  }

  .rm .lineup {
    position: static;
    display: flex;
    flex-direction: column;
    gap: 12px;
    padding: 24px var(--gutter) 32px;
  }

  .rm .dish,
  .rm .lineup.is-on .dish {
    position: static;
    display: grid;
    grid-template-columns: 64px 1fr;
    column-gap: 10px;
    transform: none;
  }

  .rm .dish-price {
    grid-row: 1 / 3;
    font-size: 22px;
  }

  .rm .dish-name {
    margin-top: 0;
    font-size: 16px;
  }

  .rm .dish-note {
    margin-top: 0;
    font-size: 14px;
  }

  .rm .pill,
  .rm .lineup.is-go .pill {
    position: static;
    align-self: flex-start;
    margin-top: 8px;
    transform: 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 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;
}
