/*
 * Digitalting landing page.
 *
 * One typeface, one page grid, one spacing scale. The page has two layouts, chosen by
 * the data-motion attribute on the html element:
 *
 *   still   ordinary flow with one still image per beat. This is the markup default
 *           and everything outside the "live" rules below.
 *   live    the artwork canvas is pinned behind the journey and the text scrolls over it.
 */

/* ---------- Typeface ---------- */

@font-face {
  font-family: 'Newsreader';
  src: url('assets/fonts/newsreader.woff2') format('woff2');
  font-style: normal;
  font-weight: 400 500;
  font-display: swap;
}

/*
 * Georgia, scaled and re-seated to occupy the space Newsreader will, so text keeps its
 * line breaks when the web font arrives. Newsreader's optical size axis makes it wider
 * as it gets larger, so one adjustment cannot fit every size: each stand-in below matches
 * Newsreader at the pixel size in its name, measured in Chrome against the page's own
 * words. The overrides are Newsreader's ascent (0.735em) and descent (0.265em) divided by
 * the size adjustment.
 */
@font-face {
  font-family: 'Newsreader Fallback 20';
  src: local('Georgia');
  size-adjust: 90.9%;
  ascent-override: 80.9%;
  descent-override: 29.2%;
  line-gap-override: 0%;
}

@font-face {
  font-family: 'Newsreader Fallback 28';
  src: local('Georgia');
  size-adjust: 93%;
  ascent-override: 79%;
  descent-override: 28.5%;
  line-gap-override: 0%;
}

@font-face {
  font-family: 'Newsreader Fallback 38';
  src: local('Georgia');
  size-adjust: 94.5%;
  ascent-override: 77.8%;
  descent-override: 28%;
  line-gap-override: 0%;
}

@font-face {
  font-family: 'Newsreader Fallback 54';
  src: local('Georgia');
  size-adjust: 97.5%;
  ascent-override: 75.4%;
  descent-override: 27.2%;
  line-gap-override: 0%;
}

@font-face {
  font-family: 'Newsreader Fallback 72';
  src: local('Georgia');
  size-adjust: 100.5%;
  ascent-override: 73.1%;
  descent-override: 26.4%;
  line-gap-override: 0%;
}

/* ---------- Tokens ---------- */

:root {
  color-scheme: dark;

  /* Colour. Pure black wherever the artwork or a still shows; one near-black elsewhere. */
  --black: #000;
  --ground: #0b0b0a;
  --ivory: #eae5db;
  --text: #cac4b9;
  --gold: #dac29d;
  --hairline: #30302d;

  /*
   * Type: nine sizes. The display size is always the largest at any width. Beside the
   * mark the headline has seven columns and grows by about 4.9% of the viewport's width,
   * from its smallest size at 35em. The title starts to grow at that width too and more
   * slowly, so it stays the smaller of the two.
   */
  --size-display: clamp(2rem, 5.2vw, 5.5rem);
  --size-title: clamp(1.875rem, 0.6rem + 3.6vw, 3.75rem);
  --size-line: clamp(1.75rem, 1.1rem + 1.7vw, 2.75rem);
  --size-statement: clamp(1.375rem, 1.1rem + 0.9vw, 1.75rem);
  --size-lead: clamp(1.25rem, 1rem + 0.9vw, 1.75rem);
  --size-text: clamp(1.125rem, 1rem + 0.45vw, 1.375rem);
  --size-brand: 1.375rem;
  --size-ui: 0.875rem;
  --size-label: 0.8125rem;

  /* Georgia stand-ins for the sizes that change with the viewport; see the steps below. */
  --serif: Georgia, 'Times New Roman', serif;
  --fallback-display: 'Newsreader Fallback 38';
  --fallback-line: 'Newsreader Fallback 28';
  --fallback-lead: 'Newsreader Fallback 20';

  --leading-display: 1.06;
  --leading-heading: 1.2;
  --leading-statement: 1.4;
  --leading-text: 1.5;

  --tracking-display: -0.03em;
  --tracking-statement: -0.01em;
  --tracking-text: 0em;
  --tracking-capitals: 0.12em;

  --measure: 34em;

  /* Space: one scale on an 8px base. */
  --space-1: 0.5rem;
  --space-2: 1rem;
  --space-3: 1.5rem;
  --space-4: 2rem;
  --space-6: 3rem;
  --space-8: 4rem;
  --space-12: 6rem;
  --space-16: 8rem;
  --space-24: 12rem;

  /* Page grid: twelve columns inside one maximum width, shared by every section. */
  --page-max: 90rem;
  --gutter: clamp(1.25rem, 5vw, 5.5rem);
  --page-inset: max(var(--gutter), calc(50% - var(--page-max) / 2));
  --grid-gap: var(--space-2);
  --section-space: var(--space-6);

  /* Controls never fall below 44px, whatever font size the visitor has set. */
  --control-size: max(2.75rem, 44px);
  /*
   * The header is one row of controls. A visitor's own text spacing can wrap it onto a
   * second row on a narrow screen: page.js measures the header and writes its real height
   * here, on the html element.
   */
  --header-height: calc(var(--control-size) + 2 * var(--space-1));
  --header-clearance: var(--header-height);

  /* A soft dark cloud that keeps words legible wherever the artwork passes behind them. */
  --halo:
    0 0 0.15em rgb(0 0 0 / 0.9), 0 0 0.5em rgb(0 0 0 / 0.85), 0 0 1.2em rgb(0 0 0 / 0.75),
    0 0 2.4em rgb(0 0 0 / 0.6);

  /*
   * Laid from the top or bottom of the screen inwards: dark behind the words of a control
   * and fading to nothing beyond them, with no edge.
   */
  --veil-deepest: rgb(0 0 0 / 0.96);
  --veil: var(--veil-deepest), rgb(0 0 0 / 0.92) 60%, rgb(0 0 0 / 0);

  --fade: 180ms;
}

@media (min-width: 60em) {
  :root {
    --grid-gap: var(--space-3);
    --section-space: var(--space-8);
    --fallback-line: 'Newsreader Fallback 38';
    --fallback-lead: 'Newsreader Fallback 28';
  }
}

/*
 * The headline is sized from the column it sits in, so it breaks into the same four
 * lines at every screen size and in the stand-in face. Measured in Chrome, it sets in
 * four lines while its size is between 9.95% and 11.9% of the column on a phone, and
 * between 9.05% and 10.95% at 72px and above, because the optical size axis widens the
 * larger cuts. This line runs through the middle of both ranges. Browsers without
 * container units keep the viewport-based size above.
 */
@supports (font-size: 1cqi) {
  :root {
    --size-display: clamp(2rem, 9.35cqi + 0.3125rem, 5.5rem);
  }
}

/*
 * The headline's stand-in follows its size. Stacked, the headline passes 44 and 62
 * pixels at these widths.
 */
@media (min-width: 29em) {
  :root {
    --fallback-display: 'Newsreader Fallback 54';
  }
}

@media (min-width: 42.25em) {
  :root {
    --fallback-display: 'Newsreader Fallback 72';
  }
}

/* Wide screens give the headline seven of the twelve columns, so it passes them later. */
@media (min-width: 35em) and (orientation: landscape) {
  :root {
    --fallback-display: 'Newsreader Fallback 38';
  }
}

@media (min-width: 50.5em) and (orientation: landscape) {
  :root {
    --fallback-display: 'Newsreader Fallback 54';
  }
}

@media (min-width: 73.75em) and (orientation: landscape) {
  :root {
    --fallback-display: 'Newsreader Fallback 72';
  }
}

/* ---------- Base ---------- */

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

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

body {
  margin: 0;
  background: var(--ground);
  color: var(--text);
  font-family: 'Newsreader', 'Newsreader Fallback 20', var(--serif);
  font-size: var(--size-text);
  font-optical-sizing: auto;
  font-synthesis: none;
  font-weight: 400;
  line-height: var(--leading-text);
  letter-spacing: var(--tracking-text);
  overflow-wrap: break-word;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

h1,
h2,
p,
figure {
  margin: 0;
}

h1,
h2 {
  color: var(--ivory);
  font-weight: 400;
  letter-spacing: var(--tracking-display);
  text-wrap: balance;
}

h1 {
  font-family: 'Newsreader', var(--fallback-display), var(--serif);
  font-size: var(--size-display);
  line-height: var(--leading-display);
}

h2 {
  font-family: 'Newsreader', var(--fallback-line), var(--serif);
  font-size: var(--size-title);
  line-height: var(--leading-display);
}

img,
svg,
canvas {
  display: block;
}

[hidden] {
  display: none !important;
}

::selection {
  background: var(--gold);
  color: var(--black);
}

a {
  color: inherit;
  text-decoration-line: none;
  text-decoration-thickness: 1px;
  text-underline-offset: 0.3em;
  transition:
    color var(--fade) ease,
    text-decoration-color var(--fade) ease;
  -webkit-tap-highlight-color: transparent;
}

a:hover {
  color: var(--gold);
  text-decoration-line: underline;
}

:focus-visible {
  outline: 2px solid var(--gold);
  outline-offset: 4px;
  border-radius: 2px;
}

/*
 * Sections that receive focus from an in-page link are destinations, not controls: they
 * take no ring, and they stop below the fixed header rather than underneath it.
 */
[tabindex='-1'] {
  scroll-margin-top: var(--header-clearance);
}

[tabindex='-1']:focus {
  outline: none;
}

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

/* ---------- Shared pieces ---------- */

/*
 * Every section is laid out on this grid. Narrow and portrait screens need one column;
 * twelve gaps would not even fit across a phone whose owner has doubled the text size.
 */
.page-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  column-gap: var(--grid-gap);
  padding-inline: var(--page-inset);
}

@media (min-width: 35em) and (orientation: landscape), (min-width: 60em) {
  .page-grid {
    grid-template-columns: repeat(12, minmax(0, 1fr));
  }
}

.page-grid > * {
  grid-column: 1 / -1;
}

.label {
  color: var(--gold);
  font-size: var(--size-label);
  font-weight: 500;
  line-height: var(--leading-text);
  letter-spacing: var(--tracking-capitals);
  text-transform: uppercase;
}

.lead {
  color: var(--ivory);
  font-family: 'Newsreader', var(--fallback-lead), var(--serif);
  font-size: var(--size-lead);
  line-height: var(--leading-heading);
  letter-spacing: var(--tracking-display);
}

/*
 * Short paragraphs are balanced, so none ends on a line of a word or two. Firefox balances
 * and has no `pretty`.
 */
.prose {
  max-width: var(--measure);
  text-wrap: balance;
}

/* The width follows from the height by the proportions of each symbol in assets/mark.svg. */
.mark {
  --mark-size: 1.375rem;
  --mark-ratio: 276.073 / 268.886;
  flex: none;
  width: calc(var(--mark-size) * var(--mark-ratio));
  height: var(--mark-size);
}

.mark-large {
  --mark-size: 3.5rem;
  --mark-ratio: 268.073 / 260.886;
}

/* ---------- Skip link ---------- */

.skip-link {
  position: fixed;
  top: var(--space-1);
  left: var(--page-inset);
  z-index: 20;
  display: inline-flex;
  align-items: center;
  min-height: var(--control-size);
  padding-inline: var(--space-2);
  background: var(--ivory);
  color: var(--black);
  font-size: var(--size-ui);
  transform: translateY(-200%);
}

.skip-link:hover {
  color: var(--black);
}

.skip-link:focus {
  transform: none;
}

/* ---------- Header ---------- */

/*
 * Fixed so the brand and a way out stay in reach throughout the artwork. There is no
 * bar: the words carry a halo, and a veil with no edge fades whatever scrolls up behind
 * them. Only the links take pointer events, so the page beneath stays selectable.
 */
.site-header {
  position: fixed;
  inset: 0 0 auto;
  z-index: 10;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  column-gap: var(--space-2);
  padding: var(--space-1) var(--page-inset);
  color: var(--ivory);
  text-shadow: var(--halo);
  pointer-events: none;
}

.site-header::before {
  content: '';
  position: absolute;
  inset: 0 0 calc(-1 * var(--space-4));
  z-index: -1;
  background: linear-gradient(to bottom, var(--veil));
}

.site-header a {
  display: inline-flex;
  align-items: center;
  min-height: var(--control-size);
  line-height: 1;
  pointer-events: auto;
}

.brand {
  gap: var(--space-1);
  font-size: var(--size-brand);
  font-weight: 500;
  letter-spacing: var(--tracking-display);
}

.brand .mark {
  filter: drop-shadow(0 0 var(--space-1) var(--black));
}

.site-nav {
  display: flex;
  column-gap: var(--space-2);
  font-size: var(--size-ui);
}

@media (min-width: 35em) {
  .site-nav {
    column-gap: var(--space-4);
  }
}

/* ---------- Journey ---------- */

/*
 * The stage, the steps and the motion control share one grid cell.
 *
 * Following a link to the next section stops the page with the journey's last strip, as
 * tall as the header, behind the header. That strip is kept empty: the steps end above it
 * and the motion control, which leaves the screen with the journey's end, rides above it,
 * so the control has gone by the time the end of the journey reaches the header.
 */
.journey {
  --journey-tail: var(--header-clearance);
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  background: var(--black);
}

.journey > * {
  grid-area: 1 / 1;
}

.stage {
  display: none;
}

.steps {
  z-index: 1;
  padding-block-end: var(--journey-tail);
  text-shadow: var(--halo);
}

.step {
  row-gap: var(--space-4);
  padding-block: var(--section-space);
}

/*
 * The hero takes the first screen and is laid out the same way in both layouts, so the
 * page can change layout after it has been painted without moving the headline.
 *
 * Stacked, the text keeps its own height at the top and the mark is given the room the
 * screen has left, which ends above the motion control.
 */
.step-hero {
  --hero-gap: var(--space-3);
  grid-template-rows: auto 1fr;
  row-gap: var(--hero-gap);
  min-height: 100vh;
  min-height: 100svh;
  padding-block: calc(var(--header-height) + var(--space-3))
    calc(var(--control-size) + var(--space-2) + var(--hero-gap));
}

/* The headline's size is a share of this column's width. */
.hero-text {
  container-type: inline-size;
}

/* At its largest size the headline keeps the same share by holding its own measure. */
.hero-text h1 {
  max-width: 10em;
}

.hero-text p {
  max-width: 30em;
  margin-block-start: var(--space-3);
  font-family: 'Newsreader', var(--fallback-lead), var(--serif);
  font-size: var(--size-lead);
  text-wrap: balance;
}

/*
 * The slot is the box the mark is composed in: the still image covers it, and
 * motion/choreography.js seats the live mark in it from its width (MARK_IN_SLOT).
 *
 * Stacked, the slot is a wide, short box around the D and its stream, which need half as
 * much height as width. It is as wide as its column allows, up to the largest size the
 * mark is shown at, and no taller than the room it is given, so on a short phone the
 * whole mark shrinks to stay on the first screen with the text.
 */
.hero-art {
  --slot-smallest: 9rem;
  --slot-largest: 28rem;
  --slot-shape: 2;
  display: grid;
  place-items: center end;
}

.hero-slot {
  width: min(100%, var(--slot-largest));
  aspect-ratio: var(--slot-shape);
}

/*
 * The room is measured as a container, which also keeps the slot from adding to the
 * hero's height: below the smallest size the mark can be read at, the hero grows instead.
 * Browsers without container units give the slot its full width and let the hero grow.
 */
@supports (width: 1cqh) {
  .hero-art {
    container-type: size;
    min-height: calc(var(--slot-smallest) / var(--slot-shape));
  }

  .hero-slot {
    width: min(100cqw, 100cqh * var(--slot-shape), var(--slot-largest));
  }
}

.hero-slot img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/*
 * Thirteen ems is narrower than the shortest line and wider than half the longest, so
 * wherever the column has that much room each line sets in two.
 */
.line {
  max-width: 13em;
  color: var(--ivory);
  font-family: 'Newsreader', var(--fallback-line), var(--serif);
  font-size: var(--size-line);
  line-height: var(--leading-heading);
  letter-spacing: var(--tracking-display);
  text-wrap: balance;
}

/* A still fills the content width but stays short enough to be seen whole. */
.still img {
  width: 100%;
  height: auto;
  max-height: 85svh;
  object-fit: contain;
}

/*
 * The statement is what the journey arrives at: the company's belief, said once. It is set
 * as a lede, larger and brighter than body copy, on a measure short enough to be read as
 * one thought. Its block is padded alike above and below, with room for the motion
 * control, so the words sit in the middle of the screen.
 */
.step-statement {
  padding-block: calc(var(--section-space) + var(--control-size));
}

.statement {
  max-width: 30em;
  color: var(--ivory);
  font-family: 'Newsreader', var(--fallback-lead), var(--serif);
  font-size: var(--size-statement);
  line-height: var(--leading-statement);
  letter-spacing: var(--tracking-statement);
  text-wrap: balance;
}

/*
 * Wide screens: the text takes seven columns and the mark the other five, in one row
 * centred on the screen.
 */
@media (min-width: 35em) and (orientation: landscape) {
  .step-hero {
    grid-template-rows: none;
    align-content: center;
    padding-block-end: var(--section-space);
  }

  /*
   * The text centres against the mark. Should the text ever be the taller of the two,
   * the mark stays at the top of the row, on screen, instead of following its middle down.
   */
  .hero-text {
    align-self: center;
  }

  .hero-text,
  .line,
  .statement {
    grid-column: 1 / span 7;
  }

  /*
   * Beside the text the slot is a square: as wide as its column allows, but no taller
   * than the screen can spare, and no smaller than the mark needs to be read.
   */
  .hero-art {
    --slot-smallest: 12rem;
    --slot-room: calc(100svh - var(--header-height) - var(--space-3) - var(--section-space));
    grid-column: 8 / -1;
    container-type: normal;
    min-height: 0;
    align-items: start;
  }

  .hero-slot {
    width: min(100%, max(var(--slot-smallest), var(--slot-room)));
    aspect-ratio: 1;
  }
}

/* ---------- Journey, live layout ---------- */

html[data-motion='live'] .stage {
  position: sticky;
  top: 0;
  z-index: 0;
  display: block;
  align-self: start;
  height: 100vh;
  height: 100svh;
  opacity: var(--art-dim, 1);
  pointer-events: none;
}

html[data-motion='live'] .stage canvas {
  width: 100%;
  height: 100%;
}

/* The hero is laid out alike in both layouts; see .step-hero. */
html[data-motion='live'] .step-statement {
  align-content: center;
  min-height: 100vh;
  min-height: 100svh;
}

html[data-motion='live'] .step-line {
  min-height: 90vh;
  min-height: 90svh;
}

/*
 * Where each line rests is half of a composition whose other half is in
 * motion/choreography.js: its BESIDE and STACKED poses place the artwork so that these
 * words are left on black.
 *
 * Stacked, the words run the full width, so each line rests low on the screen, just clear
 * of the motion control, and the mark keeps to the upper part.
 */
html[data-motion='live'] .step-line {
  --line-rest: calc(var(--control-size) + var(--space-6));
  align-content: end;
  padding-block-end: var(--line-rest);
}

/*
 * The stream leaves the screen through its left edge, above the line, and nearest above it
 * on a short phone. So on a screen shorter than about 630 pixels the line rests lower, by
 * up to a rem on the shortest, which is still clear of the control. The screen is measured
 * with its toolbars showing, as the stage is; a browser without that unit keeps the line
 * where it is.
 */
@supports (height: 1svh) {
  html[data-motion='live'] .step-line {
    --line-rest: calc(
      var(--control-size) + clamp(var(--space-4), 20svh - 4.875rem, var(--space-6))
    );
  }
}

/*
 * Side by side, the stream runs from the star at the upper right down to the lower left,
 * so each line rests in the upper left, above it. The block is centred on the screen when
 * the line rests, a twentieth of the screen below its top, and on a short screen the line
 * is kept clear of the header and its veil.
 */
@media (min-width: 35em) and (orientation: landscape) {
  html[data-motion='live'] .step-line {
    --line-rest: max(16svh, calc(var(--header-height) + var(--space-4) - 5svh));
    align-content: start;
    padding-block: var(--line-rest) var(--section-space);
  }
}

/* Hidden from first paint, so a lazy still is never requested in this layout. */
html[data-motion='live'] .still {
  display: none;
}

/*
 * Once the canvas has drawn, it shows the mark in exactly this place. The image is faded
 * itself, not through its picture element: Safari before version 26 does not apply the
 * opacity of an inline box to a block inside it, and would go on showing the image.
 */
html[data-motion='live'] .hero-slot img {
  transition: opacity var(--fade) ease;
}

html[data-motion='live'][data-motion-ready='true'] .hero-slot img {
  opacity: 0;
}

/*
 * Each line is only shown where it has black behind it. Its presence follows the
 * visitor's own scrolling, along a timeline that runs from the line entering at the bottom
 * of the screen to it leaving at the top, so it is not motion that plays by itself and is
 * kept under reduced motion. The keyframes belong with the resting places above and with
 * the poses in motion/choreography.js, whose LINE_PRESENCE repeats their stops: a browser
 * without view timelines is given each line's presence by motion/scroll-motion.js
 * instead, as --line-presence. Each line follows the keyframes named for it here.
 *
 * Stacked, a line rests between a fifth and a third of the way along, low on the screen.
 * About half way along, and a little sooner on a short phone, the first word of a line
 * meets the lower edge of the stream, so the line is gone before that.
 */
.journey {
  --line-keyframes: line-presence-stacked;
}

/*
 * Stacked on a wide screen, the lines keep to a column on the left and the stream comes
 * further down the screen across it, so a line has to be gone sooner.
 */
@media (min-width: 35em) and (orientation: portrait) {
  .journey {
    --line-keyframes: line-presence-stacked-wide;
  }
}

/*
 * The third line is read on the field itself, not on black. Stacked, it has nothing to
 * be gone before, so on a screen of any width it keeps its full strength for longer:
 * a third press of Space or Page Down stops the page with this line well past where it
 * rests.
 */
[data-beat='field'] {
  --line-keyframes: line-presence-stacked-field;
}

/*
 * Side by side, a line comes up through the lower end of the stream, so it stays hidden
 * until it is above that: half way along on the squarest of these screens, where the
 * stream crosses the line's columns highest. It is at full strength a little after, a
 * good way short of where it rests, about seven tenths of the way along, and keeps that
 * strength until it is behind the header: a press of Space or Page Down stops the page
 * short of where a line rests or past it.
 */
@media (min-width: 35em) and (orientation: landscape) {
  .journey,
  [data-beat='field'] {
    --line-keyframes: line-presence-beside;
  }
}

html[data-motion='live'] .line {
  opacity: var(--line-presence, 1);
}

@supports (animation-timeline: view()) {
  html[data-motion='live'] .line {
    animation: var(--line-keyframes) linear both;
    animation-timeline: view();
  }
}

@keyframes line-presence-stacked {
  0% {
    opacity: 0;
  }

  12%,
  40% {
    opacity: 1;
  }

  45%,
  100% {
    opacity: 0;
  }
}

@keyframes line-presence-stacked-wide {
  0% {
    opacity: 0;
  }

  12%,
  30% {
    opacity: 1;
  }

  40%,
  100% {
    opacity: 0;
  }
}

@keyframes line-presence-stacked-field {
  0% {
    opacity: 0;
  }

  12%,
  46% {
    opacity: 1;
  }

  60%,
  100% {
    opacity: 0;
  }
}

@keyframes line-presence-beside {
  0%,
  50% {
    opacity: 0;
  }

  58%,
  95% {
    opacity: 1;
  }

  100% {
    opacity: 0;
  }
}

/* ---------- Motion control ---------- */

/*
 * The control follows the screen's lower edge through the journey and leaves with the
 * journey's end, above the empty strip there. Reached by keyboard from further down the
 * page, it is brought back into view below the header and clear of the header's veil.
 */
.motion-toggle {
  position: sticky;
  bottom: var(--space-2);
  z-index: 2;
  align-self: end;
  justify-self: end;
  min-width: var(--control-size);
  min-height: var(--control-size);
  margin: 0 var(--page-inset) calc(var(--journey-tail) + var(--space-2)) 0;
  scroll-margin-block-start: calc(var(--header-clearance) + var(--space-4));
  padding: 0;
  border: 0;
  background: none;
  color: var(--ivory);
  font: inherit;
  font-size: var(--size-ui);
  line-height: 1;
  text-decoration-thickness: 1px;
  text-underline-offset: 0.3em;
  text-shadow: var(--halo);
  cursor: pointer;
  transition: color var(--fade) ease;
  -webkit-tap-highlight-color: transparent;
}

.motion-toggle:hover {
  color: var(--gold);
  text-decoration-line: underline;
}

/*
 * On its way off the screen the control passes behind the header, whose veil would only
 * dim it. page.js marks it for as long as it is there, and its words are not shown.
 */
.motion-toggle[data-behind-header] {
  color: transparent;
  text-shadow: none;
  pointer-events: none;
}

/*
 * A visitor who presses "Play motion" in the still layout waits for the artwork's data,
 * which takes many seconds on a slow connection, and nothing else on the page says the
 * press was taken; a second press would call the download off. Until the artwork starts,
 * a thin gold rule breathes slowly under the label, where its underline would be, and the
 * pointer resting on the control adds no underline of its own. page.js marks the control
 * busy for the same time.
 */
html[data-motion='still'][data-motion-status='loading'] .motion-toggle {
  text-decoration-line: none;
}

html[data-motion='still'][data-motion-status='loading']
  .motion-toggle:not([data-behind-header])::after {
  content: '';
  position: absolute;
  inset: calc(50% + 0.8em) 0 auto;
  height: 1px;
  background: var(--gold);
  animation: waiting-breath 1.6s ease-in-out infinite alternate;
}

@keyframes waiting-breath {
  from {
    opacity: 0.2;
  }

  to {
    opacity: 1;
  }
}

/*
 * Where the text runs the full width of the screen it passes behind the control, so the
 * control lays the same veil as the header across the bottom of the screen. The veil is
 * as wide as the viewport and ends at its right edge, one gutter beyond the control. At
 * its deepest it runs on down to the end of the journey, over the empty strip there.
 */
.motion-toggle::before {
  content: '';
  position: absolute;
  inset-block: calc(-1 * var(--space-4)) calc(-1 * (var(--journey-tail) + var(--space-2)));
  right: calc(-1 * var(--gutter));
  z-index: -1;
  width: 100vw;
  background:
    linear-gradient(to top, var(--veil)) top / 100% calc(100% - var(--journey-tail)) no-repeat,
    linear-gradient(var(--veil-deepest), var(--veil-deepest)) bottom / 100% var(--journey-tail)
      no-repeat;
  pointer-events: none;
}

/* On wider screens the text keeps to its own columns and never reaches the control. */
@media (min-width: 35em) and (orientation: landscape), (min-width: 60em) {
  .motion-toggle::before {
    content: none;
  }
}

/* ---------- Small screens ---------- */

/*
 * A screen that is both this short and narrow enough to stack the hero has no room to
 * spare. It always gets the still layout and never the motion control: the script in the
 * head of index.html and motion/scroll-motion.js decide that with this same query. Here
 * the header scrolls away with the page, and neither the hero nor the statement needs
 * room for the control.
 */
@media (max-height: 34em) and (max-width: 34.99em) {
  :root {
    --header-clearance: 0px;
  }

  .site-header {
    position: absolute;
  }

  .step-hero {
    padding-block-end: var(--section-space);
  }

  .step-statement {
    padding-block: var(--section-space);
  }
}

/* ---------- Product ---------- */

.product {
  padding-block: var(--space-8) var(--space-12);
  border-top: 1px solid var(--hairline);
  background: var(--ground);
}

.product h2 {
  margin-block-start: var(--space-2);
}

.product-lead {
  margin-block-start: var(--space-3);
}

.product-text {
  margin-block-start: var(--space-3);
}

.product-status {
  margin-block-start: var(--space-6);
  text-wrap: balance;
}

@media (min-width: 60em) {
  .product {
    align-items: baseline;
    padding-block: var(--space-12) var(--space-16);
  }

  .product h2 {
    grid-column: 1 / span 7;
  }

  .product-lead,
  .product-text,
  .product-status {
    grid-column: 8 / -1;
  }

  /* The lead shares the name's row and sits on its baseline. */
  .product-lead {
    margin-block-start: 0;
  }
}

/* ---------- Footer ---------- */

/* The page ends here, so the footer is given more room below than any section above it. */
.site-footer {
  padding-block: var(--space-12) var(--space-16);
  border-top: 1px solid var(--hairline);
  background: var(--ground);
}

/* The way home from 404.html is set like the contact link. */
.contact-link,
.not-found a {
  justify-self: start;
  display: inline-flex;
  align-items: center;
  min-height: var(--control-size);
  margin-block-start: var(--space-4);
  color: var(--ivory);
  font-size: var(--size-lead);
  line-height: var(--leading-heading);
  letter-spacing: var(--tracking-display);
  overflow-wrap: anywhere;
  text-decoration-line: underline;
  text-decoration-color: var(--gold);
}

.site-footer-legal {
  margin-block-start: var(--space-3);
}

@media (min-width: 60em) {
  .site-footer {
    align-items: center;
    padding-block: var(--space-16) var(--space-24);
  }

  .site-footer .mark {
    grid-column: 1 / span 7;
  }

  .contact-link,
  .site-footer-legal {
    grid-column: 8 / -1;
  }

  .contact-link {
    margin-block-start: 0;
  }
}

/* ---------- Not found ---------- */

/*
 * 404.html: one sentence, set at the size of the product's name, and the way home. The
 * block clears the fixed header and takes most of a screen, so the sentence sits where the
 * eye lands and the footer keeps its distance.
 */
.not-found {
  align-content: center;
  min-height: 70vh;
  min-height: 70svh;
  padding-block: calc(var(--header-height) + var(--space-8)) var(--space-12);
}

.not-found h1 {
  font-family: 'Newsreader', var(--fallback-line), var(--serif);
  font-size: var(--size-title);
}

/* ---------- Reduced motion ---------- */

@media (prefers-reduced-motion: reduce) {
  a,
  .motion-toggle,
  html[data-motion='live'] .hero-slot img {
    transition: none;
  }

  /* The rule that marks a wait is shown and holds still. */
  html[data-motion='still'][data-motion-status='loading']
    .motion-toggle:not([data-behind-header])::after {
    animation: none;
  }
}
