/*
 * Aurevane, «One scent» — 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, tickets/SC-33.md).
 *
 * 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: three stills of the footage, the name.
 *
 * 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 two acts it is a window (clip-path, set by the script): an arch —
 *                 a doorway — that opens to the whole bench, a card that opens to the table
 *     .leaders    the line from a word to its thing on the bench
 *   .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: three stills on
 *               the gold, the name on the mist
 *   .bar        the name, fixed over all of it; .steps — the marks of the steps, in the
 *               lower left corner
 * After the film, in the flow of the page: .foot — the lid of the box.
 *
 * The words take their ink from what lies under them (data-tone): cream on the dark of
 * the atelier ("night"), the night's ink on the white, on the gold and on the linen ("day").
 *
 * Brand colours (tickets/SC-33.md): night #0d0d12, gold #d9b26f, cream #f2e9e4.
 */

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

  --night: #0d0d12;
  --gold: #d9b26f;
  --cream: #f2e9e4;

  /* Cream on the dark: the ink of every word until something says otherwise. */
  --ui: var(--cream);
  --ui-dim: rgb(242 233 228 / 0.86);
  --plate: rgb(13 13 18 / 0.6);

  /* The house's own pair. Italiana — a thin Didone drawn like the lettering of a perfume
     label — for everything large. Hanken Grotesk for everything small. The studio's faces
     (Unbounded, Onest) are in the studio's lime corner and nowhere else. */
  --face-display: "Italiana", "Bodoni 72", Didot, "Times New Roman", serif;
  --face-text: "Hanken Grotesk", system-ui, -apple-system, "Segoe UI", sans-serif;
  --face-studio-display: "Unbounded", "Arial Black", Arial, sans-serif;
  --face-studio-text: "Onest", system-ui, -apple-system, "Segoe UI", sans-serif;
}

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

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

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

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

ol,
ul {
  list-style: none;
}

/*
 * ——— The page without the film: eight 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;
  line-height: 1;
}

/* The name as the label of the bottle says it: capitals, set wide. */
.brand {
  position: relative;
  display: inline-block;
  isolation: isolate;
  padding: 6px 0;
  color: var(--ui);
  font-family: var(--face-display);
  font-size: 23px;
  font-weight: 400;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  transition: color 300ms linear;
}

/* The name passes over a pale sky and a dark room alike: it carries its own soft plate. */
.brand::before {
  content: "";
  position: absolute;
  inset: -22px -40px;
  z-index: -1;
  background-image: radial-gradient(closest-side, var(--plate), rgb(0 0 0 / 0));
  pointer-events: none;
}

/* 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 eight. */
.shot::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background-image: linear-gradient(to top, rgb(13 13 18 / 0.88), rgb(13 13 18 / 0.52) 26%, rgb(13 13 18 / 0) 56%);
  pointer-events: none;
}

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

/* A still with no words is left as it was shot, and takes less of the page. */
.shot[data-words="none"] {
  min-height: 72vh;
  min-height: 72svh;
}

.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 house, on the first screen. */
.title {
  font-family: var(--face-display);
  font-size: clamp(44px, 5.6vw, 92px);
  font-weight: 400;
  letter-spacing: -0.005em;
  line-height: 1.04;
}

/* The words of the floods: the first note, the kind of the perfume, the name. */
.cue-word {
  font-family: var(--face-display);
  font-size: clamp(56px, 7.6vw, 120px);
  font-weight: 400;
  letter-spacing: -0.01em;
  line-height: 1;
}

/* Without the film a still shows its word in one line. */
.cue-word .line {
  display: inline-block;
  vertical-align: top;
}

/* The other two notes. Without the film: one line of words, as the house says it. */
.notes {
  display: flex;
  flex-wrap: wrap;
  gap: 4px clamp(14px, 1.4vw, 22px);
}

.cue-note {
  font-family: var(--face-display);
  font-size: clamp(34px, 3.6vw, 58px);
  font-weight: 400;
  line-height: 1.1;
  white-space: nowrap;
}

.cue-measure {
  font-family: var(--face-display);
  font-size: clamp(44px, 5vw, 82px);
  font-weight: 400;
  line-height: 1.04;
  white-space: nowrap;
}

.final-title {
  font-family: var(--face-display);
  font-size: clamp(2.6rem, 4.7vw, 5rem);
  font-weight: 400;
  letter-spacing: -0.005em;
  line-height: 1.06;
}

/* The button: a capsule of the night, its arrow in a round of gold. */
.pill {
  display: inline-flex;
  align-items: center;
  gap: 22px;
  height: 64px;
  margin-top: clamp(20px, 3.4vh, 34px);
  padding: 6px 6px 6px 32px;
  border: 1px solid rgb(217 178 111 / 0.7);
  border-radius: 999px;
  background-color: var(--night);
  color: var(--cream);
  font-size: 19px;
  font-weight: 500;
  letter-spacing: 0.01em;
  line-height: 1;
  text-decoration: none;
  white-space: nowrap;
  transition: background-color 180ms linear;
}

.pill:hover {
  background-color: #1b1b25;
}

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

.pill-round {
  display: grid;
  place-items: center;
  width: 50px;
  height: 50px;
  border-radius: 50%;
  background-color: var(--gold);
  color: var(--night);
  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 house's colours.
 */

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

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

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

/* Three stills of the footage: the garden, the harvest, the blend — a step lower each. */
.block-plates {
  padding: clamp(40px, 8vh, 84px) var(--gutter) clamp(44px, 9vh, 96px);
}

.plates {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: clamp(14px, 3.4vw, 56px);
  align-items: start;
  max-width: 1280px;
  margin: 0 auto;
}

.plates li:nth-child(2) {
  margin-top: clamp(28px, 9vh, 96px);
}

.plates li:nth-child(3) {
  margin-top: clamp(56px, 18vh, 192px);
}

.plates img {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 4 / 5;
  object-fit: cover;
  /* An arch, as the doorway of the atelier. */
  border-radius: 999px 999px 0 0;
  background-color: #2a2418;
}

.plates figcaption {
  margin-top: 14px;
  font-family: var(--face-display);
  font-size: clamp(30px, 3.4vw, 54px);
  font-weight: 400;
  line-height: 1.08;
}

/* The name of the house. Without the film: one word, set wide, as on the label. */
.block-name {
  padding: clamp(48px, 11vh, 110px) var(--gutter);
  text-align: center;
}

.name {
  font-family: var(--face-display);
  font-size: clamp(56px, 13vw, 220px);
  font-weight: 400;
  letter-spacing: 0.02em;
  line-height: 1;
  white-space: nowrap;
}

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

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

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

.live .frame {
  position: absolute;
  inset: 0;
  z-index: 0;
  overflow: hidden;
  background-color: var(--night);
}

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

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

/* Over a flood a word takes the flood's ink and has no plate: on one even colour a plate is a smudge. */
.live .cue.is-flat::before {
  opacity: 0;
}

/*
 * A card stands on a flood inside an act: in the middle of the pinned scene (the script
 * moves it into the scene), drifting up as the page goes. On a flood there is nothing to
 * lift the words off.
 */
.live .cue-card {
  left: 50%;
  top: 50%;
  width: -webkit-max-content;
  width: max-content;
  max-width: calc(100vw - 2 * var(--gutter));
  transform: translate3d(-50%, calc(-50% + var(--ty, 0px)), 0);
}

.live .cue-card::before {
  content: none;
}

/*
 * The blocks between the acts scroll as any page does.
 */

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

/* The ink of the words over the footage. */
.live [data-tone="night"] {
  --ui: var(--cream);
  --ui-dim: rgb(242 233 228 / 0.86);
  --plate: rgb(13 13 18 / 0.6);
  --measure: rgb(242 233 228 / 0.42);
}

/*
 * On the pale sky, on the white wall by the window and on the linen cloth: the night's
 * ink, on a soft plate of cream — it is not seen on what is pale already, and it carries
 * the name across the dark frame of the window.
 */
.live [data-tone="day"] {
  --ui: var(--night);
  --ui-dim: rgb(13 13 18 / 0.82);
  --plate: rgb(242 233 228 / 0.84);
  --measure: rgb(13 13 18 / 0.4);
}

/* On a flood — one even colour — there is nothing to lift the ink off. */
.live .is-flat {
  --plate: rgb(242 233 228 / 0);
}


/* The margins round a window are the page's colour of the moment. */
.live .stage[data-field="jasmine"] {
  background-color: var(--cream);
}

.live .stage[data-field="gold"] {
  background-color: var(--gold);
}

/* The arch rides in over the white as soon as that has shut: the flood and the page of the act are one white. */
.live .act[data-act="blend"] {
  margin-top: -6vh;
  margin-top: -6svh;
}

/* The card of the last act rides in under the foot of the name. */
.live .act[data-act="box"] {
  margin-top: -12vh;
  margin-top: -12svh;
}

.live .notes {
  display: contents;
}

/* A line is gold with a thin shadow of the night under it: it reads on glass and on wood. */
.leader {
  filter: drop-shadow(0 0 2px rgb(13 13 18 / 0.8));
}

.leader .casing {
  display: none;
}

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

.leader .dot {
  fill: var(--gold);
  stroke: var(--cream);
  stroke-width: 1.25;
  opacity: 0;
  transition: opacity 180ms linear;
}

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

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

.leader.is-on .dot {
  opacity: 1;
  transition: opacity 200ms linear 380ms;
}

.leader.is-on .ring {
  opacity: 0.75;
  transition: opacity 200ms linear 460ms;
}

/* The line of the house: in the lower left corner, over the marks of the steps; it 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 name. */
  opacity: var(--fade, 1);
  left: var(--gutter);
  bottom: calc(var(--pin, 1) * 100vh + var(--gutter) + 78px);
  bottom: calc(var(--pin, 1) * 100svh + var(--gutter) + 78px);
}

/* It stands on a bush in full blossom: the corner under it goes to dusk, so thin letters read on white petals. */
.live .cue-opening::before {
  inset: -90% -55% -120% -60%;
  background-image: radial-gradient(closest-side, rgb(13 13 18 / 0.8), rgb(13 13 18 / 0.6) 46%, rgb(13 13 18 / 0));
}

/*
 * A word rides: the script lays it on the page (--at, screens from the top of its act) so
 * that it comes on at its line of the screen, and the scroll carries it up from there.
 */
.live .cue-word,
.live .cue-note,
.live .cue-measure {
  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-word {
  line-height: 0.92;
}

.live .cue-word .line {
  display: block;
}

/* «Jasmine,» — one word across the screen: it rises over the hand, and the white it rides into takes its plate away. */
.live #cue-jasmine {
  left: 50%;
  width: -webkit-max-content;
  width: max-content;
  font-size: clamp(84px, 19vw, 330px);
  transform: translate3d(-50%, -50%, 0);
}

.live #cue-jasmine::before {
  inset: -30% -12%;
}

.live #cue-jasmine.is-on .line > span {
  transition: transform 1100ms cubic-bezier(0.2, 0.75, 0.2, 1) 60ms;
}

/* «Eau de parfum,» — two lines up the dark wall left of the bottle, the second a step to the right. */
.live #cue-eau {
  left: 5%;
  font-size: clamp(60px, 8.6vw, 150px);
}

.live #cue-eau .line + .line {
  margin-left: 0.62em;
}

/*
 * The two notes of the bench ride up the shelves over their things, so that neither line
 * crosses the dropper: each line goes down to its thing.
 */
.live .cue-note::before,
.live .cue-measure::before {
  inset: -70% -28%;
}

.live #cue-bergamot {
  left: 61%;
}

.live #cue-cedar {
  left: 79%;
}

/* «50 ml.» rides up the dark wall, left of the bottle it measures. */
.live #cue-ml {
  left: 21.5%;
}

/* The last line: on the linen, right of the box; it rides away with the table. */
.live .cue-final {
  left: 65.5%;
  top: calc((var(--pin, 1) + 0.33) * 100vh);
  top: calc((var(--pin, 1) + 0.33) * 100svh);
}

/* The night's ink on pale linen: it needs nothing under it. */
.live .cue-final::before {
  content: none;
}

.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 420ms,
    transform 640ms var(--ease-text) 420ms,
    background-color 180ms linear;
}


/* The three stills ride through at three paces: the first a little ahead of the page, the last a little behind. */
.live .block-plates {
  padding-top: 4vh;
  padding-top: 4svh;
}

/* They come out of the gold as soon as it has shut over the bench. */
.live .plates {
  opacity: 0;
  transition: opacity 360ms linear;
}

.live .block.is-on .plates {
  opacity: 1;
}

.live .plates li {
  --lift: 0px;
  transform: translate3d(0, calc((0.5 - var(--p, 0.5)) * var(--lift)), 0);
}

.live .plates li:nth-child(1) {
  --lift: 150px;
}

.live .plates li:nth-child(3) {
  --lift: -150px;
}

/*
 * The name on the mist: it rides up with the page, and its letters draw apart as mist
 * does — close as it comes in at the foot of the screen, wide as it leaves at the head.
 */
.live .block-name {
  padding: 5vh 0 12vh;
  padding: 5svh 0 12svh;
}

.live .name {
  opacity: 0;
  transition: opacity 500ms linear;
}

.live .block.is-on .name {
  opacity: var(--fade, 1);
}

.live .name > span {
  display: inline-flex;
}

.live .name > span > span {
  display: block;
  transform: translate3d(calc((var(--k) - 3.5) * (var(--p, 0.5) - 0.3) * 4.2vw), 0, 0);
}

/*
 * The marks of the steps, in the lower left corner — the one corner no hand of the film
 * reaches. Six measures in a row; the step on screen says its name and its measure is the
 * long one, filling as the step goes by.
 */
.live .steps {
  position: fixed;
  left: var(--gutter);
  bottom: calc(var(--gutter) - 8px);
  z-index: 10;
  display: block;
  isolation: isolate;
  color: var(--ui);
  transition:
    color 300ms linear,
    opacity 320ms var(--ease-camera);
}

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

/* On a flood, a block or a margin — one even colour — the marks need no plate. */
.live .steps.is-flat::before,
.live .brand.is-flat::before {
  opacity: 0;
}

.live .steps::before {
  content: "";
  position: absolute;
  inset: -30px -56px;
  z-index: -1;
  background-image: radial-gradient(closest-side, var(--plate), rgb(0 0 0 / 0));
  pointer-events: none;
}

.steps ol {
  display: flex;
  align-items: center;
  gap: 10px;
}

.steps button {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 0;
  padding: 14px 0;
  border: 0;
  background: none;
  color: var(--ui);
  font: inherit;
  font-size: 16px;
  font-weight: 500;
  line-height: 1;
  cursor: pointer;
}

.steps button:focus-visible {
  outline: 2px solid currentColor;
  outline-offset: 4px;
  border-radius: 2px;
}

/* Only the step on screen keeps its name; the others are their measures. */
.steps li:not(.is-now) span {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

.steps i {
  position: relative;
  display: block;
  width: 24px;
  height: 2px;
  overflow: hidden;
  border-radius: 1px;
  background-color: var(--measure);
}

.steps .is-now i {
  width: 72px;
}

.steps i::after {
  content: "";
  position: absolute;
  inset: 0;
  background-color: var(--gold);
  transform: scaleX(var(--p, 0));
  transform-origin: 0 50%;
}

/* On the linen and on a flood the gold is too pale for a thin measure: it takes the ink. */
.steps[data-tone="day"] i::after {
  background-color: var(--night);
}

.steps button:hover i {
  background-color: var(--ui);
}

.live .hint {
  position: absolute;
  right: var(--gutter);
  bottom: calc(var(--gutter) + 4px);
  z-index: 3;
  display: flex;
  align-items: center;
  gap: 12px;
  color: var(--cream);
  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 the box ———
 *
 * The lid seen from over it (textures/lid.webp, a photograph): midnight paper with the
 * weave of linen in it, the gold satin ribbon crossed over it and tied in a bow. What the
 * house says of its perfume is printed on the paper in gold, above the ribbon; the small
 * print of every box lies under it. The studio's lime corner is the one thing that is the
 * same on every page.
 */

.foot {
  position: relative;
  z-index: 1;
  background-color: var(--night);
  color: var(--cream);
}

.lid {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  grid-template-rows: auto auto auto 1fr;
  justify-items: start;
  min-height: clamp(560px, 92vh, 880px);
  padding: 64px 40px 88px;
  padding-top: clamp(40px, 8vh, 84px);
  padding-bottom: clamp(72px, 10vh, 96px);
  overflow: hidden;
  isolation: isolate;
  background-color: #161b2c;
  background-image: url("textures/lid.webp");
  background-position: 50% 50%;
  background-size: cover;
}

.lid-name {
  color: var(--gold);
  font-family: var(--face-display);
  font-size: clamp(4.2rem, 11.6vw, 11.4rem);
  font-weight: 400;
  letter-spacing: -0.01em;
  line-height: 0.98;
}

.lid-kind {
  margin-top: clamp(14px, 2.6vh, 28px);
  color: var(--cream);
  font-family: var(--face-display);
  font-size: clamp(26px, 2.9vw, 44px);
  font-weight: 400;
  line-height: 1.12;
}

.lid-notes {
  margin-top: 12px;
  color: var(--cream);
  font-size: clamp(18px, 1.45vw, 21px);
  font-weight: 400;
  line-height: 1.45;
}

/* The small print, under the ribbon. */
.lid-care {
  align-self: end;
  color: var(--cream);
  font-size: 15px;
  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 var(--cream);
  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 words at the foot ———
 * (The script switches to the tall series at the same ratio.)
 */

@media (max-aspect-ratio: 3 / 4) {
  .brand {
    font-size: 20px;
  }

  .title {
    font-size: 44px;
  }

  .cue-note {
    font-size: 36px;
  }

  .cue-measure {
    font-size: 46px;
  }

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

  .pill {
    gap: 16px;
    height: 56px;
    margin-top: 18px;
    padding-left: 26px;
    font-size: 17px;
  }

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

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

  .live #cue-jasmine {
    font-size: clamp(64px, 21.5vw, 120px);
  }

  .live #cue-eau {
    left: var(--gutter);
    font-size: clamp(56px, 17vw, 100px);
  }

  .live #cue-eau .line + .line {
    margin-left: 0.2em;
  }

  .name {
    font-size: clamp(48px, 15.5vw, 96px);
  }

  .live .name > span > span {
    transform: translate3d(calc((var(--k) - 3.5) * (var(--p, 0.5) - 0.3) * 3.4vw), 0, 0);
  }

  /* The three stills stand one under another, each a step to the side. */
  .plates {
    grid-template-columns: minmax(0, 1fr);
    gap: 26px;
  }

  .plates li,
  .plates li:nth-child(2),
  .plates li:nth-child(3) {
    width: 68%;
    margin-top: 0;
  }

  .plates li:nth-child(2) {
    margin-left: 32%;
  }

  .plates li:nth-child(3) {
    margin-left: 12%;
  }

  .live .plates li:nth-child(1),
  .live .plates li:nth-child(3) {
    --lift: 0px;
  }

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

  .live .cue-opening::before {
    inset: -70% -40% -110% -30%;
  }

  /* The two notes ride up from the foot of the screen, one after the other; the frame follows the hand. */
  .live #cue-bergamot,
  .live #cue-cedar,
  .live #cue-ml {
    left: var(--gutter);
  }

  /* The last line: over the box, on the linen behind it. */
  .live .cue-final {
    left: var(--gutter);
    right: var(--gutter);
    top: calc((var(--pin, 1) + 0.135) * 100vh);
    top: calc((var(--pin, 1) + 0.135) * 100svh);
  }

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

  .steps ol {
    gap: 8px;
  }

  .steps i {
    width: 20px;
  }

  .steps .is-now i {
    width: 52px;
  }

  .live .hint span {
    display: none;
  }

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

  /* The lid stands on end: the print at its head, the ribbon and its bow across its foot. */
  .lid {
    min-height: 720px;
    padding: 52px 16px 84px;
    background-position: 70% 50%;
  }

  .lid-name {
    font-size: clamp(3.3rem, 15.5vw, 4.4rem);
  }

  .lid-kind {
    max-width: 9.4em;
    margin-top: 18px;
    font-size: 27px;
  }

  .lid-notes {
    max-width: 11em;
    margin-top: 14px;
    font-size: 18px;
  }

  /* The tails of the bow lie across the foot of the lid: the small print goes up, under the notes. */
  .lid-care {
    align-self: start;
    margin-top: 22px;
  }
}

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