/*
 * Tresswell, «From dark to honey» — 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, SC-38).
 *
 * 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 afternoon in three stills, the phrase, the third word.
 *
 * 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 act 2 it is a round window in the dark margins of the page, which
 *                 opens to the whole screen; in act 4 it closes to the shape of the
 *                 salon's mirror (clip-path, 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
 *               (--at, set by the script: how far down the act they lie, in screens)
 *   .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 of the house and the acts of the story, fixed over all of it
 * After the film, in the flow of the page: .foot — the salon's shade chart on its counter.
 *
 * The words take their ink from what lies under them (data-tone). The salon is light, so
 * over the footage it is the dark brown on a soft cream plate ("ink"); on the cream and
 * the copper the same brown without a plate ("day"); on the dark the cream ("night").
 *
 * The colours of the house (tickets/SC-38.md): cream #f3e6da, copper #b76e4b, dark #2b1b14.
 */

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

  --cream: #f3e6da;
  --copper: #b76e4b;
  --dark: #2b1b14;

  /* The dark brown: the ink of every word until something says otherwise. */
  --ui: #2b1b14;
  --ui-dim: rgb(43 27 20 / 0.84);
  --under: #f3e6da;
  --plate: rgb(243 230 218 / 0.72);

  /* The house's own pair. Playfair Display — the letters painted on its wall — for every
     large word; Plus Jakarta Sans for everything small. The studio's faces (Unbounded,
     Onest) are in the studio's lime corner and nowhere else. */
  --face-display: "Playfair Display", "Bodoni 72", Didot, Georgia, "Times New Roman", serif;
  --face-text: "Plus Jakarta 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: #f3e6da;
  color: #2b1b14;
  -webkit-text-size-adjust: 100%;
}

body {
  position: relative;
  margin: 0;
  color: #2b1b14;
  font-family: var(--face-text);
  font-size: 16px;
  font-weight: 500;
  line-height: 1.45;
  -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;
}

em {
  font-style: italic;
}

/*
 * ——— 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: flex-start;
  justify-content: space-between;
  gap: 16px;
  color: #2b1b14;
  line-height: 1;
}

/* The name as it is painted on the wall over the mirror: the serif, set as a word. */
.brand {
  position: relative;
  isolation: isolate;
  padding-top: 2px;
  color: var(--ui);
  font-family: var(--face-display);
  font-size: 28px;
  font-weight: 600;
  letter-spacing: 0;
  line-height: 1;
  transition: color 300ms linear;
}

/* It passes over the wall, the window and her hair alike: it carries its own soft plate. */
.brand::before {
  content: "";
  position: absolute;
  inset: -22px -36px;
  z-index: -1;
  background-image: radial-gradient(closest-side, var(--plate), rgb(243 230 218 / 0));
  pointer-events: none;
  transition: opacity 200ms linear;
}

.bar.is-bare .brand::before,
.bar.is-bare .steps::before {
  opacity: 0;
}

/* 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: 6px 28px;
  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 its words — in the corner they stand in — a still goes out into the cream of the page,
   so the brown reads on any of the eight; the rest of the picture is left as it is. */
.shot::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background-image: radial-gradient(ellipse 48% 58% at 0% 100%, rgb(243 230 218 / 0.95), rgb(243 230 218 / 0.82) 34%, rgb(243 230 218 / 0) 100%);
  pointer-events: none;
}

/* A still with no words keeps its foot. */
.shot[data-words="none"]::after {
  content: none;
}

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

.line {
  display: block;
  overflow: hidden;
  padding: 0.08em 0.1em 0.24em 0;
  margin: -0.08em 0 -0.24em;
}

.line > span {
  display: block;
  width: -webkit-fit-content;
  width: fit-content;
}

/* The salon's three words, on the first screen. */
.title {
  font-family: var(--face-display);
  font-size: clamp(44px, 6.2vw, 104px);
  font-weight: 600;
  letter-spacing: -0.01em;
  line-height: 1;
  white-space: nowrap;
}

.title em,
.final-title em,
.phrase em,
.word em,
.three em {
  font-weight: 500;
}

/* The word of an act. */
.cue-act,
.word {
  font-family: var(--face-display);
  font-size: clamp(56px, 8vw, 128px);
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 0.96;
}

/* The large phrase of the page. */
.phrase {
  font-family: var(--face-display);
  font-size: clamp(48px, 7vw, 112px);
  font-weight: 600;
  letter-spacing: -0.015em;
  line-height: 1;
  white-space: nowrap;
}

/* A word tied to a thing of the picture by a line. Without the film there is no line, and the word is not shown. */
.cue-caption {
  display: none;
  font-family: var(--face-display);
  font-size: clamp(34px, 4.2vw, 66px);
  font-style: italic;
  font-weight: 500;
  line-height: 1.04;
  white-space: nowrap;
}

.final-title {
  font-family: var(--face-display);
  font-size: clamp(40px, 5.2vw, 86px);
  font-weight: 600;
  letter-spacing: -0.01em;
  line-height: 1.04;
  white-space: nowrap;
}

/* The button: a capsule of the dark brown, its arrow in a round of copper. */
.pill {
  display: inline-flex;
  align-items: center;
  gap: 18px;
  height: 60px;
  margin-top: clamp(20px, 3.4vh, 36px);
  padding: 6px 6px 6px 28px;
  border-radius: 999px;
  background-color: #2b1b14;
  color: #f3e6da;
  font-size: 18px;
  font-weight: 700;
  line-height: 1;
  text-decoration: none;
  white-space: nowrap;
  transition: background-color 180ms linear;
}

.pill:hover {
  background-color: #432a1f;
}

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

.pill-round {
  display: grid;
  place-items: center;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background-color: #b76e4b;
  color: #2b1b14;
}

.pill-round svg,
.studio svg {
  width: 20px;
  height: 20px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
  transition: transform 220ms var(--ease-camera);
}

.pill:hover .pill-round svg,
.pill:focus-visible .pill-round svg {
  transform: translate3d(4px, 0, 0);
}

/*
 * The blocks of the page, between the acts. Each lies on one of the house's three colours.
 */

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

.block[data-field="dark"] {
  --field: #2b1b14;
  color: #f3e6da;
}

/* On the copper the dark brown is a shade deeper: the words hold 4.5:1 there at any size. */
.block[data-field="copper"] {
  --field: #b76e4b;
  color: #1c110c;
}

.block[data-field="cream"] {
  --field: #f3e6da;
}

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

/* The afternoon in three stills of the footage: a word of the salon's three under each, the middle one a step lower. */
.block-three {
  padding: clamp(40px, 8vh, 84px) var(--gutter) clamp(36px, 7vh, 72px);
}

.three {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: clamp(14px, 3vw, 48px);
  align-items: start;
  width: min(100%, 1020px);
  margin: 0 auto;
}

.three li:nth-child(2) {
  margin-top: clamp(24px, 7vh, 64px);
}

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

.three figcaption {
  margin-top: 12px;
  font-family: var(--face-display);
  font-size: clamp(26px, 3.3vw, 52px);
  font-weight: 600;
  letter-spacing: -0.01em;
  line-height: 1.1;
}

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

/* The ink of the words over the footage: the dark brown on a soft cream plate. */
.live [data-tone="ink"] {
  --ui: #2b1b14;
  --ui-dim: rgb(43 27 20 / 0.84);
  --under: #f3e6da;
  --plate: rgb(243 230 218 / 0.72);
}

/* On the cream and the copper: the same brown, nothing under it. */
.live [data-tone="day"] {
  --ui: #2b1b14;
  --ui-dim: rgb(43 27 20 / 0.84);
  --under: #f3e6da;
  --plate: rgb(243 230 218 / 0);
}

/* On the dark: the cream. */
.live [data-tone="night"] {
  --ui: #f3e6da;
  --ui-dim: rgb(243 230 218 / 0.84);
  --under: #2b1b14;
  --plate: rgb(43 27 20 / 0);
}

.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);
  /* The soft plate under a line of words may reach past the edge of a phone: it is cut there, and the page gets no sideways scroll. */
  overflow-x: clip;
}

/* The round window rides in under the foot of the three stills: the block ends on the window's own dark margin. */
.live .act[data-act="colour"] {
  margin-top: -7vh;
  margin-top: -7svh;
}

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

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

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

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

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

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

/*
 * A line that is off is not drawn at all. Its dashes are of no length then, yet WebKit
 * still draws their round caps — a dot was left where every hidden line begins.
 */
.leader {
  --ui: #2b1b14;
  --under: #f3e6da;
  visibility: hidden;
  transition: visibility 0s linear 280ms;
}

.leader.is-on {
  visibility: visible;
  transition: visibility 0s linear 0s;
}

/* A line: a hair of the word's ink over a wider one of the other tone, a ring where it lands. */
.leader path {
  fill: none;
  stroke-dasharray: 1;
  stroke-dashoffset: 1;
  transition: stroke-dashoffset 240ms var(--ease-camera);
}

.leader path.casing {
  stroke: var(--under);
  stroke-width: 6;
  stroke-linecap: round;
  opacity: 0.6;
}

.leader path.stroke {
  stroke: var(--ui);
  stroke-width: 2;
}

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

.leader circle.casing {
  fill: var(--under);
}

.leader .dot {
  fill: var(--ui);
}

.leader .ring {
  fill: none;
  stroke: var(--under);
  stroke-width: 2;
}

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

.leader.is-on circle.casing {
  opacity: 0.9;
  transition: opacity 200ms linear 300ms;
}

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

.leader.is-on .ring {
  opacity: 0.95;
  transition: opacity 220ms linear 380ms;
}

/*
 * 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. --at (the script): how far down the act they
 * lie, in screens; --fade (the script): they fade just before they would ride up under
 * the header.
 */
.live .cue {
  position: absolute;
  top: calc(var(--at, 0.5) * 100vh);
  top: calc(var(--at, 0.5) * 100svh);
  z-index: 3;
  isolation: isolate;
  opacity: var(--fade, 1);
  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, 128%, 0);
  transition: transform 280ms var(--ease-camera);
}

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

/* 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: -56% -28%;
  z-index: -1;
  background-image: radial-gradient(closest-side, var(--plate), rgb(243 230 218 / 0));
  opacity: 0;
  pointer-events: none;
  transition: opacity 260ms linear;
}

.live .cue.is-on::before {
  opacity: 1;
  transition: opacity 520ms linear 80ms;
}

/* The three words stand on the bare wall, right of the mirror, and go up it with the page. */
.live .cue-opening {
  right: calc(var(--gutter) + 5vw);
}

.live .cue-caption {
  display: block;
}

/* Each caption rides where its frame is quiet, on the side its thing is not. */
.live #cue-dark {
  left: 15%;
}

.live #cue-honey {
  left: 11%;
}

/* The word of an act rides up the left of the picture, large. */
.live .cue-act {
  left: calc(var(--gutter) + 1.5vw);
  font-size: clamp(64px, 8.2vw, 140px);
}

/* Over the footage the word passes the wall and the edge of her hair alike: its plate is denser than a caption's. */
.live .cue-act[data-tone="ink"] {
  --plate: rgb(243 230 218 / 0.88);
}

.live #cue-cut {
  font-size: clamp(96px, 14.5vw, 250px);
}

.live .cue-act::before {
  inset: -30% -16%;
}

/* The last line rides in on the wall, left of her hair; it is beside the mirror when the scene is let go. */
.live .cue-final {
  left: calc(var(--gutter) + 2vw);
}

.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 360ms,
    transform 640ms var(--ease-text) 360ms,
    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));
}

/* The three stills ride through at three paces: the outer two a little behind the page, the middle one ahead of it. */
.live .block-three {
  padding: 3vh var(--gutter) 9vh;
  padding: 3svh var(--gutter) 9svh;
}

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

.live .three li:nth-child(2) {
  --lift: -84px;
}

.live .three li:nth-child(3) {
  --lift: 110px;
}

/* A still and its word come up as the dark shuts under them, one after another. */
.live .three figure {
  opacity: 0;
  transform: translate3d(0, 36px, 0);
  transition:
    opacity 300ms linear,
    transform 300ms var(--ease-camera);
}

.live .block.is-on .three figure {
  opacity: 1;
  transform: none;
  transition:
    opacity 520ms linear calc(var(--k, 0) * 110ms),
    transform 900ms var(--ease-text) calc(var(--k, 0) * 110ms);
}

/* «From dark to honey.»: two lines that come from the two sides of the copper and cross as the block rides through. */
.live .block-phrase {
  padding: 2vh 0 4vh;
  padding: 2svh 0 4svh;
}

.live .phrase {
  width: -webkit-max-content;
  width: max-content;
  margin: 0 auto;
  font-size: clamp(60px, 11.5vw, 208px);
  line-height: 1;
}

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

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

.live .phrase .line + .line {
  --drift: -34vw;
  margin-left: 0.5em;
}

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

/* «Light.»: one word on the cream, as large as the screen lets it, leaning into the way the page goes. */
.live .block-word {
  padding: 1vh var(--gutter) 5vh;
  padding: 1svh var(--gutter) 5svh;
}

.live .word {
  width: -webkit-max-content;
  width: max-content;
  margin: 0 auto;
  font-size: clamp(110px, 22vw, 380px);
  line-height: 0.96;
  opacity: var(--fade, 1);
  transform: translate3d(calc((0.5 - var(--p, 0.5)) * 16vw), 0, 0);
}

.live .block.is-on .word .line > span {
  transform: none;
  transition: transform 1100ms cubic-bezier(0.22, 0.72, 0.2, 1) 80ms;
}

/* The acts of the story: a name and, under it, a hairline that fills as the act goes by and stays full after it. */
.live .steps {
  position: relative;
  display: block;
  isolation: isolate;
  color: var(--ui);
  transition: color 300ms linear;
}

.live .steps::before {
  content: "";
  position: absolute;
  inset: -26px -44px;
  z-index: -1;
  background-image: radial-gradient(closest-side, var(--plate), rgb(243 230 218 / 0));
  pointer-events: none;
  transition: opacity 200ms linear;
}

.steps ol {
  display: flex;
  align-items: flex-start;
  gap: clamp(16px, 2vw, 32px);
  list-style: none;
}

.steps button {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 9px;
  min-width: 60px;
  margin: 0;
  padding: 8px 0 10px;
  border: 0;
  background: none;
  color: var(--ui-dim);
  font: inherit;
  font-size: 15px;
  font-weight: 600;
  line-height: 1;
  text-align: left;
  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: 700;
}

.steps i {
  position: relative;
  display: block;
  height: 2px;
  overflow: hidden;
  background-color: color-mix(in srgb, currentColor 30%, 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;
  left: var(--gutter);
  bottom: calc(var(--gutter) + 6px);
  z-index: 3;
  display: flex;
  align-items: center;
  gap: 12px;
  isolation: isolate;
  color: #2b1b14;
  font-size: 15px;
  font-weight: 600;
  line-height: 1;
  transition: opacity 360ms var(--ease-camera);
}

/* It stands over the floorboards and the olive's pot: its own soft plate under it. */
.live .hint::before {
  content: "";
  position: absolute;
  inset: -20px -32px;
  z-index: -1;
  background-image: radial-gradient(closest-side, rgb(243 230 218 / 0.8), rgb(243 230 218 / 0));
  pointer-events: none;
}

.hint i {
  display: block;
  width: 44px;
  height: 2px;
  background-color: #b76e4b;
}

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

/*
 * ——— The footer: the shade chart ———
 *
 * Seen from over the counter: the salon's shade chart — a card of thick cream paper with
 * seven swatches of hair hung along its lower edge, from the darkest to honey, a tail
 * comb and a brass clip beside it (textures/chart.webp, photographed). What the house
 * prints on the card is set here, on the card itself. The studio's lime corner is the one
 * thing that is the same on every page.
 */

/* The photograph is the whole of it: the studio's corner lies on the oak of the counter. */
.foot {
  position: relative;
  z-index: 1;
  background-color: #c7ad93;
  color: #2b1b14;
}

.counter {
  position: relative;
  isolation: isolate;
  width: min(100%, 1680px);
  margin: 0 auto;
  /* What the card is printed with is sized by the counter's own width. */
  container-type: inline-size;
  /* Until the photograph has come, the paper of its card: what is printed on it reads from the first moment. */
  background-color: #efe9df;
}

.chart {
  display: block;
}

.chart img {
  display: block;
  width: 100%;
  height: auto;
}

/* The card of the photograph: its blank upper part, from its left edge to its right. */
.card {
  position: absolute;
  left: 17.6%;
  right: 20%;
  top: 7.4%;
  height: 52%;
  z-index: 1;
  display: grid;
  grid-template-columns: 1fr auto;
  grid-template-rows: 1fr auto;
  align-items: start;
  gap: 0 3cqw;
  padding: 3.4cqw 4cqw 0.6cqw;
}

.card-name {
  grid-column: 1;
  grid-row: 1;
  color: #96512f;
  font-family: var(--face-display);
  font-size: clamp(40px, 7.6cqw, 128px);
  font-weight: 600;
  letter-spacing: -0.01em;
  line-height: 1;
}

.card-motto {
  grid-column: 2;
  grid-row: 1;
  padding-top: 1.5cqw;
  font-family: var(--face-display);
  font-size: clamp(20px, 2.1cqw, 34px);
  font-style: italic;
  font-weight: 500;
  line-height: 1.2;
  text-align: right;
}

.card-note {
  grid-column: 2;
  grid-row: 1;
  align-self: start;
  padding-top: calc(1.5cqw + clamp(20px, 2.1cqw, 34px) * 1.2 + 0.7cqw);
  font-size: clamp(15px, 1.15cqw, 19px);
  font-weight: 600;
  line-height: 1.4;
  text-align: right;
}

/* The two ends of the row of swatches under it: a word over the first, a word over the last, a hairline between. */
.card-scale {
  grid-column: 1 / -1;
  grid-row: 2;
  display: flex;
  align-items: center;
  gap: 2cqw;
  font-family: var(--face-display);
  font-size: clamp(20px, 2.3cqw, 38px);
  font-style: italic;
  font-weight: 500;
  line-height: 1.2;
  white-space: nowrap;
}

.card-scale i {
  flex: 1;
  height: 2px;
  background-color: #b76e4b;
}

/* The studio signs in its own colours, not the house'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 #2b1b14;
  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 under the picture ———
 * (The script switches to the tall series at the same ratio. On a phone it lays every
 * shot across the screen's width, under the header, and the words ride up over the cream
 * below the picture and over the picture itself.)
 */

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

  /* Without the film: the still, whole, and its words under it. */
  .shot {
    min-height: 0;
    padding: 0 var(--gutter) 34px;
  }

  .shot[data-shot="C1"] {
    padding-top: 68px;
  }

  .still {
    position: relative;
    inset: auto;
    z-index: 0;
    width: calc(100% + 2 * var(--gutter));
    margin: 0 calc(-1 * var(--gutter)) 18px;
    aspect-ratio: 3 / 4;
  }

  .shot::after {
    content: none;
  }

  .shot[data-words="none"] {
    padding-bottom: 0;
  }

  .shot[data-words="none"] .still {
    margin-bottom: 0;
  }

  .title {
    font-size: clamp(40px, 12vw, 52px);
  }

  .cue-act,
  .word {
    font-size: clamp(56px, 17vw, 72px);
  }

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

  .cue-caption {
    font-size: 38px;
  }

  .final-title {
    font-size: clamp(34px, 9.6vw, 44px);
  }

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

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

  .three {
    gap: 10px;
  }

  .three li:nth-child(2) {
    margin-top: 22px;
  }

  .three figcaption {
    margin-top: 8px;
    font-size: clamp(22px, 6.4vw, 30px);
  }

  /* With the film: the picture is the stage's again. */
  .live .shot {
    padding: 0;
  }

  .live .cue-opening {
    left: var(--gutter);
    right: auto;
  }

  /* The three words on one line, on the cream under the picture. */
  .live .title {
    display: flex;
    flex-wrap: wrap;
    gap: 0 0.24em;
    font-size: clamp(34px, 10.2vw, 46px);
  }

  /* The captions come up from under the picture and send their lines up into it. */
  .live #cue-dark,
  .live #cue-honey {
    left: var(--gutter);
  }

  .live .cue-act {
    left: var(--gutter);
    font-size: 21vw;
  }

  .live #cue-cut {
    font-size: 30vw;
  }

  .live .cue::before {
    inset: -40% -14%;
  }

  .live .phrase {
    font-size: 16.5vw;
  }

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

  .live .phrase .line + .line {
    --drift: -46vw;
    margin-left: 0.2em;
  }

  .live .word {
    font-size: 30vw;
  }

  .live .three li {
    --lift: 30px;
  }

  .live .three li:nth-child(2) {
    --lift: -44px;
  }

  .live .three li:nth-child(3) {
    --lift: 56px;
  }

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

  /* Only the act on screen keeps its name; the others are their hairlines. */
  .steps ol {
    align-items: flex-end;
    gap: 8px;
  }

  .steps button {
    min-width: 20px;
  }

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

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

  .live .hint span {
    display: none;
  }

  /* The card and its swatches alone; what it is printed with is set smaller. Under them the
     oak of the counter goes on as its own colour, and the studio's corner stands there. */
  .foot {
    padding-bottom: 92px;
  }

  .counter::after {
    content: "";
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    height: 9%;
    background-image: linear-gradient(to bottom, rgb(199 173 147 / 0), rgb(199 173 147 / 1));
    pointer-events: none;
  }

  .card {
    left: 3.2%;
    right: 3.8%;
    top: 7.4%;
    height: 52%;
    grid-template-columns: 1fr;
    grid-template-rows: auto auto 1fr auto;
    gap: 0;
    padding: 5cqw 5.5cqw 1cqw;
  }

  .card-name {
    font-size: clamp(40px, 13.5cqw, 64px);
  }

  .card-motto,
  .card-note {
    grid-column: 1;
    padding-top: 0;
    text-align: left;
  }

  .card-motto {
    grid-row: 2;
    margin-top: 2.4cqw;
    font-size: clamp(20px, 5.6cqw, 26px);
  }

  .card-note {
    grid-row: 3;
    margin-top: 1cqw;
    font-size: 15px;
  }

  .card-scale {
    grid-row: 4;
    gap: 3cqw;
    font-size: clamp(20px, 5.4cqw, 26px);
  }
}

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