/*
 * Larkfold, «From vine to glass» — 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 word of the sunset on the red of the wine, the phrase of
 * the page and four stills of the day on the gold.
 *
 * 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).
 *                 In the cellar it is a tall doorway at the right of the dark page, in the
 *                 dusk a round window in the gold (clip-path, set by the script): each
 *                 opens to the whole screen
 *     .aside      the word of the act in the dark beside the doorway; it gives way as
 *                 the doorway opens (--open, set by the script)
 *     .leaders    the line from a word to its thing
 *   .cue        the words of an act lie on the page, not on the scene: they come from
 *               below and leave upwards with the scroll while the picture stands pinned
 *   .block      what lies between two acts and scrolls as any page does. A block that
 *               follows a flood lies over the end of the act before it, so its words rise
 *               on the colour while that still stands pinned
 *   .bar        the name and the acts of the day, fixed over all of it
 * After the film, in the flow of the page: .foot — the lid of a wine crate.
 *
 * The words take their ink from what lies under them (data-tone): the night's ink on a
 * sunlit frame or on the gold, the cream of the light on a dark one or on the wine.
 *
 * Brand colours (tickets/SC-19.md): night #1a0d12, wine #7b1e3a, light #e9d8b4, leaf #5c6b3a.
 */

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

  /* The winery's own pair. Fraunces — an old-style serif with a soft, wine-list italic,
     the one on the labels — for everything large. Work Sans for everything small. The
     studio's faces (Unbounded, Onest) are in the studio's lime corner and nowhere else. */
  --face-display: "Fraunces", Georgia, "Times New Roman", serif;
  --face-text: "Work Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
  --face-studio-display: "Unbounded", "Arial Black", Arial, sans-serif;
  --face-studio-text: "Onest", system-ui, -apple-system, "Segoe UI", sans-serif;
}

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

html {
  background: #1a0d12;
  color: #f3e7cb;
  -webkit-text-size-adjust: 100%;
}

body {
  position: relative;
  margin: 0;
  color: #f3e7cb;
  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;

  /* The cream of the light: the ink of every word until something says otherwise. */
  --ui: #f3e7cb;
  --ui-dim: rgb(243 231 203 / 0.9);
  --plate: rgb(26 13 18 / 0.52);
}

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

ol,
ul {
  list-style: none;
}

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

.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: #f3e7cb;
  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: 25px;
  font-weight: 600;
  letter-spacing: -0.015em;
  transition: color 300ms linear;
}

/* The name passes over a pale sky and a dark cellar 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-sun {
  fill: currentColor;
}

.brand-rows,
.brand-ring {
  fill: none;
  stroke: currentColor;
  stroke-width: 1.1;
  stroke-linecap: round;
}

.brand-ring {
  stroke-width: 1.4;
}

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

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

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

/* Under the words a still is darker, so the cream reads on any of the seven. */
.shot::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background-image: linear-gradient(to top, rgb(26 13 18 / 0.78), rgb(26 13 18 / 0.42) 24%, rgb(26 13 18 / 0) 52%);
  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(26 13 18 / 0.78), rgb(26 13 18 / 0.42) 24%, rgb(26 13 18 / 0) 52%),
    linear-gradient(to bottom, rgb(26 13 18 / 0.5), rgb(26 13 18 / 0) 18%);
}

/* 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.2em;
  margin-bottom: -0.2em;
}

.line > span {
  display: block;
}

/* The line of the first screen. */
.title {
  font-family: var(--face-display);
  font-size: clamp(34px, 3.7vw, 60px);
  font-weight: 600;
  letter-spacing: -0.025em;
  line-height: 1.02;
}

.notes {
  margin-top: 12px;
  color: var(--ui-dim);
  font-size: clamp(16px, 1.3vw, 19px);
  font-weight: 500;
  line-height: 1.36;
}

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

/* The word of an act. */
.cue-act,
.aside,
.word,
.phrase {
  font-family: var(--face-display);
  font-style: italic;
  font-weight: 600;
  letter-spacing: -0.03em;
  line-height: 0.98;
}

.cue-act,
.aside,
.word {
  font-size: clamp(52px, 7.4vw, 118px);
}

.phrase {
  font-size: clamp(40px, 5.2vw, 84px);
}

/* Without the film the phrase is set in one line. */
.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(36px, 4.4vw, 72px);
  font-weight: 600;
  font-style: italic;
  letter-spacing: -0.025em;
  line-height: 1.04;
  white-space: nowrap;
}

.final-title {
  font-family: var(--face-display);
  font-size: clamp(2.3rem, 3.7vw, 4rem);
  font-weight: 600;
  letter-spacing: -0.03em;
  line-height: 1.04;
}

/* The button: a capsule in the red of the wine, its arrow in a round of the light. */
.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: #7b1e3a;
  color: #f8efd9;
  font-size: 17px;
  font-weight: 600;
  line-height: 1;
  text-decoration: none;
  white-space: nowrap;
  transition: background-color 180ms linear;
}

.pill:hover {
  background-color: #8f2545;
}

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

.pill-round {
  display: grid;
  place-items: center;
  width: 46px;
  height: 46px;
  border-radius: 50%;
  background-color: #e9d8b4;
  color: #1a0d12;
  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 blocks of the page, between the acts. Each lies on one of the page's colours.
 */

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

.block[data-field="wine"] {
  --field: #7b1e3a;
  --ink: #f3e7cb;
}

.block[data-field="gold"] {
  --field: #e0ad58;
  --ink: #1a0d12;
}

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

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

/* Four stills of the day: a row, every second one a step lower. */
.strip {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: clamp(10px, 2.2vw, 32px);
  align-items: start;
  margin-top: clamp(32px, 7vh, 64px);
}

.strip li:nth-child(even) {
  margin-top: clamp(20px, 5vh, 46px);
}

.strip img {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 4 / 5;
  object-fit: cover;
  border-radius: 3px;
  background-color: #c79647;
}

.strip figcaption {
  margin-top: 12px;
  font-family: var(--face-display);
  font-size: clamp(22px, 2.3vw, 36px);
  font-style: italic;
  font-weight: 600;
  letter-spacing: -0.02em;
  line-height: 1.1;
}

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

/* The ink of the words over the footage. */
.live [data-tone="night"] {
  --ui: #f3e7cb;
  --ui-dim: rgb(243 231 203 / 0.9);
  --plate: rgb(26 13 18 / 0.52);
}

.live [data-tone="day"] {
  --ui: #1a0d12;
  --ui-dim: rgb(26 13 18 / 0.9);
  --plate: rgb(246 236 212 / 0.62);
}

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

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

/* The round window rides in under the foot of the strip: the gold of the block is its own margin. */
.live .act[data-act="dusk"] {
  margin-top: -5vh;
  margin-top: -5svh;
}

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

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

.live .stage[data-field="wine"] {
  background-color: #7b1e3a;
}

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

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

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

.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 word of the cellar stands in the dark beside the doorway: it rides in with the
 * scene, and as the doorway opens over it, it draws away to the left.
 */
.live .aside {
  position: absolute;
  left: var(--gutter);
  top: 42%;
  z-index: 0;
  color: #f3e7cb;
  font-size: clamp(60px, 8.6vw, 140px);
  white-space: nowrap;
  opacity: calc(1 - var(--open, 0) * 1.6);
  transform: translate3d(calc(var(--open, 0) * -12vw), -50%, 0);
}

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

/* 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);
  left: var(--gutter);
  bottom: calc(var(--pin, 1) * 100vh + var(--gutter) + 4px);
  bottom: calc(var(--pin, 1) * 100svh + var(--gutter) + 4px);
  width: min(40vw, 520px);
}

/* «Morning.» comes up the right of the screen while the camera flies over the rows. */
.live #cue-morning {
  right: var(--gutter);
  top: 106vh;
  top: 106svh;
  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;
}

/* Each rides where its frame is quiet, on the side its thing is not. */
.live #cue-picked {
  left: var(--gutter);
}

.live #cue-oak {
  right: var(--gutter);
  --plate: rgb(22 13 10 / 0.76);
}

.live #cue-pinot {
  right: var(--gutter);
}

.live #cue-name {
  left: 63%;
}

.live #cue-size {
  left: 69%;
}

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

/* The last line rides in from below once the candle burns: on the sky of the dusk, left of the two bottles. */
.live .cue-final {
  left: var(--gutter);
  top: calc((var(--pin, 1) + 0.16) * 100vh);
  top: calc((var(--pin, 1) + 0.16) * 100svh);
}

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

/* «Sunset.»: one word as wide as the page lets it be, sliding across the red as the page goes down. */
.live .block-word {
  padding: 3vh var(--gutter) 6vh;
  padding: 3svh var(--gutter) 6svh;
}

.live .word {
  width: -webkit-max-content;
  width: max-content;
  margin: 0 auto;
  font-size: clamp(88px, 21vw, 340px);
  line-height: 0.92;
  /* Set by the script: the word fades just before it would ride up under the header. */
  opacity: var(--fade, 1);
  transform: translate3d(calc((0.5 - var(--p, 0.5)) * 26vw), 0, 0);
}

.live .word .line {
  padding: 0 0.08em 0.24em;
  margin: 0 -0.08em -0.24em;
}

/* It takes its time: the word rises slowly out of the flood. */
.live .block.is-on .word .line > span {
  transform: none;
  transition: transform 1200ms cubic-bezier(0.22, 0.72, 0.2, 1) 80ms;
}

/* «From vine to glass.»: the first line at the left of the gold, the second at its right; they draw towards each other as the block rides through. */
.live .block-day {
  padding: 3vh 0 11vh;
  padding: 3svh 0 11svh;
}

.live .phrase {
  padding: 0 var(--gutter);
  font-size: clamp(52px, 8.8vw, 148px);
}

.live .phrase .line {
  display: block;
  width: -webkit-max-content;
  width: max-content;
  padding-right: 0.08em;
  opacity: var(--fade, 1);
  transform: translate3d(calc((var(--p, 0.5) - 0.2) * var(--drift, 0vw)), 0, 0);
}

.live .phrase .line:first-child {
  --drift: 22vw;
}

.live .phrase .line + .line {
  --drift: -22vw;
  margin-left: auto;
}

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

/* The strip: four stills far wider than the screen together, which run to the left as the page goes down. */
.live .strip {
  display: flex;
  gap: 2.2vw;
  width: -webkit-max-content;
  width: max-content;
  margin-top: 7vh;
  margin-top: 7svh;
  padding: 0 var(--gutter);
  transform: translate3d(calc(9vw - var(--p, 0.5) * 48vw), 0, 0);
}

.live .strip li {
  flex: none;
  width: 30vw;
}

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

/* The acts of the day: a name and a measure each; a measure fills as its act 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 acts pass over leaves, sky and stone, 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) + 4px);
  z-index: 3;
  display: flex;
  align-items: center;
  gap: 12px;
  color: #f3e7cb;
  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 lid of a wine crate ———
 *
 * Seen from over it: three pine boards (textures/crate.webp, photographed) held by two
 * battens nailed across them. The brand is burnt into the wood; the two wines and what a
 * bottle holds are stencilled in the red of the wine — letters with the bridges a stencil
 * leaves. Both are laid on the pine by multiplying, so the grain shows through them. The
 * studio's lime corner is the one thing that is the same on every page.
 */

.foot {
  position: relative;
  z-index: 1;
  padding: clamp(20px, 3.4vw, 44px) var(--gutter) clamp(84px, 12vh, 120px);
  background-color: #1a0d12;
  color: #2c160c;
}

.lid {
  --batten: clamp(54px, 6.6vw, 104px);
  position: relative;
  display: grid;
  /* A row to a board: nothing printed on the lid runs across a gap between two of them. */
  grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr);
  grid-template-rows: repeat(3, minmax(0, 1fr));
  column-gap: clamp(20px, 4vw, 64px);
  height: clamp(540px, 80vh, 780px);
  padding: 0 clamp(96px, 13vw, 210px);
  overflow: hidden;
  border-radius: 3px;
  background-color: #dcbd8d;
  background-image: url("textures/crate.webp");
  background-size: 100% 100%;
  box-shadow:
    0 30px 60px rgb(0 0 0 / 0.5),
    inset 0 0 0 1px rgb(60 34 16 / 0.35);
}

/* A batten: one board of the same pine laid across the three, its grain along its own length, a nail to each board. */
.batten {
  position: absolute;
  top: 0;
  bottom: 0;
  width: var(--batten);
  overflow: hidden;
  background-color: #d2b07e;
  /* It stands a board's thickness over the lid: one shadow, away from the light. */
  box-shadow: 3px 4px 7px rgb(0 0 0 / 0.32);
}

.batten::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 1100px;
  height: var(--batten);
  /* The photographed boards lie level: one of them, stood on end. */
  transform-origin: 0 0;
  transform: rotate(90deg) translateY(-100%);
  background-image: url("textures/crate.webp");
  background-size: auto 340%;
  background-position: 30% 6%;
}

.batten::after {
  content: "";
  position: absolute;
  inset: 0;
  background-image:
    radial-gradient(circle at 50% 16.6%, #4b4038 0 4px, rgb(75 64 56 / 0) 5px),
    radial-gradient(circle at 50% 50%, #4b4038 0 4px, rgb(75 64 56 / 0) 5px),
    radial-gradient(circle at 50% 83.3%, #4b4038 0 4px, rgb(75 64 56 / 0) 5px),
    linear-gradient(to right, rgb(60 34 16 / 0.22), rgb(60 34 16 / 0) 14%, rgb(60 34 16 / 0) 86%, rgb(60 34 16 / 0.28));
}

.batten-left {
  left: clamp(18px, 3.2vw, 56px);
}

.batten-right {
  right: clamp(18px, 3.2vw, 56px);
}

.batten-right::before {
  background-position: 80% 97%;
}

/* The brand, burnt in: scorched pine. The iron darkens the wood, it does not cover it — the grain shows through the letters. */
.burn {
  display: contents;
  color: #4a2412;
}

.burn-mark,
.burn-name,
.burn-line,
.stencil {
  mix-blend-mode: multiply;
}

.burn-mark {
  grid-row: 1;
  grid-column: 1;
  align-self: end;
  display: block;
  width: clamp(54px, 6vw, 92px);
  height: clamp(54px, 6vw, 92px);
  margin-bottom: clamp(14px, 2.6vh, 26px);
}

.burn-name {
  grid-row: 2;
  grid-column: 1;
  align-self: center;
  font-family: var(--face-display);
  font-size: clamp(4rem, 10.6vw, 10.6rem);
  font-weight: 600;
  letter-spacing: -0.035em;
  line-height: 0.92;
}

.burn-line {
  grid-row: 3;
  grid-column: 1;
  align-self: start;
  margin-top: clamp(14px, 2.6vh, 26px);
  font-family: var(--face-display);
  font-size: clamp(22px, 2.2vw, 34px);
  font-style: italic;
  font-weight: 400;
  line-height: 1.1;
}

/* Stencilled: the red of the wine sprayed through a cut sheet — every letter keeps its bridges. */
.stencil {
  grid-row: 2;
  grid-column: 2;
  align-self: center;
  justify-self: end;
  display: grid;
  gap: 0.18em;
  list-style: none;
  /* The red of the wine, as paint that has soaked into the wood. */
  color: #7b1e3a;
  font-family: var(--face-text);
  font-size: clamp(28px, 3.5vw, 54px);
  font-weight: 700;
  letter-spacing: 0.12em;
  line-height: 1.04;
  text-align: right;
  text-transform: uppercase;
  transform: rotate(-2.4deg);
  -webkit-mask-image: repeating-linear-gradient(to right, #000 0 0.36em, rgb(0 0 0 / 0) 0.36em 0.415em);
  mask-image: repeating-linear-gradient(to right, #000 0 0.36em, rgb(0 0 0 / 0) 0.36em 0.415em);
}

.stencil-size {
  grid-row: 3;
  grid-column: 2;
  display: block;
  transform: rotate(1.2deg);
}

.care {
  grid-row: 3;
  grid-column: 1;
  align-self: end;
  margin-bottom: clamp(18px, 3.4vh, 34px);
  color: #33190c;
  font-size: 16px;
  font-weight: 500;
  line-height: 1.4;
}

/* 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 #f3e7cb;
  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: 23px;
  }

  .title {
    font-size: 36px;
  }

  .notes {
    margin-top: 8px;
    font-size: 16px;
  }

  .caption-word {
    font-size: 44px;
  }

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

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

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

  /* Two stills to a row. */
  .strip {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 20px 12px;
  }

  .strip li:nth-child(even) {
    margin-top: 22px;
  }

  .strip figcaption {
    margin-top: 8px;
    font-size: 24px;
  }

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

  .live .cue-act {
    font-size: 64px;
  }

  /* The word stands over the window, the window under it. */
  .live .aside {
    top: 16%;
    font-size: clamp(52px, 16.4vw, 84px);
    transform: translate3d(calc(var(--open, 0) * -30vw), -50%, 0);
  }

  /* Every word rides up the left of the screen. */
  .live #cue-picked,
  .live #cue-oak,
  .live #cue-pinot,
  .live #cue-name,
  .live #cue-size,
  .live #cue-house,
  .live .cue-final {
    left: var(--gutter);
    right: auto;
  }

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

  /* On this tall frame the word passes over the basket and the vineyard in shade: the cream reads there, the ink does not. */
  .live #cue-picked,
  .live .leader[data-for="picked"] {
    --ui: #f3e7cb;
    --ui-dim: rgb(243 231 203 / 0.9);
    --plate: rgb(26 13 18 / 0.6);
  }

  /* The three words of the glass pass over the bright sky and the hand: the ink, on a plate of the light. */
  .live #cue-name,
  .live #cue-size,
  .live #cue-house {
    --plate: rgb(246 236 212 / 0.78);
  }

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

  .live .word {
    font-size: clamp(72px, 24vw, 132px);
    transform: translate3d(calc((0.5 - var(--p, 0.5)) * 30vw), 0, 0);
  }

  .live .phrase {
    font-size: clamp(50px, 15.4vw, 84px);
  }

  .live .phrase .line:first-child {
    --drift: 12vw;
  }

  .live .phrase .line + .line {
    --drift: -12vw;
  }

  .live .strip {
    gap: 3vw;
    transform: translate3d(calc(70vw - var(--p, 0.5) * 262vw), 0, 0);
  }

  .live .strip li {
    width: 64vw;
  }

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

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

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

  .steps i {
    width: 18px;
  }

  .live .hint span {
    display: none;
  }

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

  /* The lid stands on end: three boards one over another, a batten across its head and its foot. */
  .foot {
    padding-bottom: 88px;
  }

  .lid {
    --batten: 46px;
    grid-template-columns: minmax(0, 1fr);
    height: 690px;
    padding: 0 22px;
  }

  .batten {
    top: 12px;
    bottom: auto;
    left: 0;
    right: 0;
    width: auto;
    height: var(--batten);
  }

  .batten::before {
    width: 100%;
    transform: none;
  }

  .batten::after {
    background-image:
      radial-gradient(circle at 12% 50%, #4b4038 0 3.5px, rgb(75 64 56 / 0) 4.5px),
      radial-gradient(circle at 50% 50%, #4b4038 0 3.5px, rgb(75 64 56 / 0) 4.5px),
      radial-gradient(circle at 88% 50%, #4b4038 0 3.5px, rgb(75 64 56 / 0) 4.5px),
      linear-gradient(to bottom, rgb(60 34 16 / 0.22), rgb(60 34 16 / 0) 18%, rgb(60 34 16 / 0) 82%, rgb(60 34 16 / 0.28));
  }

  .batten-right {
    top: auto;
    bottom: 12px;
  }

  /* Two things to a board: one at its head, one at its foot. */
  .burn-mark,
  .burn-name,
  .burn-line,
  .stencil,
  .stencil-size,
  .care {
    grid-column: 1;
    justify-self: start;
    text-align: left;
  }

  .burn-mark {
    grid-row: 1;
    align-self: start;
    width: 52px;
    height: 52px;
    margin: 72px 0 0;
  }

  .burn-name {
    grid-row: 1;
    align-self: end;
    margin-bottom: 10px;
    font-size: clamp(3.6rem, 21vw, 5.4rem);
  }

  .burn-line {
    grid-row: 2;
    align-self: start;
    margin-top: 16px;
  }

  .stencil {
    grid-row: 2;
    align-self: end;
    margin-bottom: 20px;
    font-size: 30px;
    transform: rotate(-1.6deg);
  }

  .stencil-size {
    grid-row: 3;
    align-self: start;
    margin-top: 20px;
    transform: rotate(1deg);
  }

  .care {
    grid-row: 3;
    align-self: end;
    margin-bottom: 72px;
  }
}

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