/*
 * ahead.rest: the v10 page, without motion (sprint 7).
 * Source: docs/design/v10/ (README.md's "Design tokens", the two prototypes in design/) and
 * the Designer's note, docs/sprints/design/sprint-7-note.md.
 *
 * Widths: below 768 px the mobile prototype (390 px); 768 to 1023 the mobile layout opened up;
 * from 1024 the desktop prototype (1440 px), its fixed offsets scaled by --rail and --col;
 * from 1440 the prototype's own numbers.
 *
 * Every colour below the token block is a var() of a token, or `transparent`.
 * Text on ground, contrast ratio (WCAG 2.x relative luminance):
 *   --text   #ECEBE7 on --bg-black 17.6, on --bg-dark 16.4
 *   --text-2 #BDBCB8 on --bg-black 11.1, on --bg-dark 10.3
 *   --text-3 #ABAAA6 on --bg-black  9.0, on --bg-dark  8.4
 *   --text-4 #8C8B87 on --bg-black  6.2, on --bg-dark  5.7
 *   --accent #2EC4E6 on --bg-black 10.2, on --bg-dark  9.5
 *   --black  on --accent 10.2 (buttons), on --cyan 6.1 (What we do, the menu)
 *   --white  on --cyan 3.5: 36 px and up only (What we do's heading), the menu's X, and the open
 *            menu's CLOSE (12 px, below AA: Josephine's call, sprint 17's Risk)
 */

:root {
  /* Colour: docs/design/v10/README.md, "Design tokens". The scheme is pending review. */
  --black: #000000;
  --bg-black: var(--black);
  --bg-dark: #0B0C0E;
  --text: #ECEBE7;
  --text-2: #BDBCB8;
  --text-3: #ABAAA6;
  --text-4: #8C8B87;
  --accent: #2EC4E6;
  --accent-2: #4FD3EE;
  --accent-3: #D8F6FC;
  --cyan: #2696AE;
  --white: #FFFFFF;
  --rule: color-mix(in srgb, var(--white) 18%, transparent);
  --card-border: color-mix(in srgb, var(--white) 6%, transparent);

  /* The prototypes' stat panel: two greys the README doesn't list, and its glow. */
  --panel-top: #121417;
  --panel-bottom: #0E1012;
  --panel-glow: color-mix(in srgb, var(--accent) 16%, transparent);

  /* The prototypes' alphas, mixed from the tokens above so a token change carries through. */
  --stat-value: color-mix(in srgb, var(--white) 79%, transparent);
  --stat-label: color-mix(in srgb, var(--text) 55%, transparent);
  --field-border: color-mix(in srgb, var(--text) 50%, transparent);
  --field-ground: color-mix(in srgb, var(--bg-dark) 85%, transparent);
  --footer-rule: color-mix(in srgb, var(--text) 14%, transparent);
  --fade-mid: color-mix(in srgb, var(--bg-dark) 85%, transparent);
  /* The deck's dots (sprint 12's, the carousel's then): the mobile prototype's .dot, --text at 35%. */
  --dot: color-mix(in srgb, var(--text) 35%, transparent);
  /* The deck's cards (sprint 20): mobile v12's .dk border, white at 12%, and its shadow, black at 55%. */
  --deck-border: color-mix(in srgb, var(--white) 12%, transparent);
  --deck-shadow: color-mix(in srgb, var(--black) 55%, transparent);

  /* The navigation (sprint 8): the fixed nav's other links (5.4:1 on --bg-dark), What we do's
     (5.5:1 on --cyan), and the mobile bar's blurred ground. */
  --nav-dim: color-mix(in srgb, var(--text) 55%, transparent);
  --nav-dim-dark: color-mix(in srgb, var(--black) 88%, transparent);
  --bar-blur: color-mix(in srgb, var(--black) 82%, transparent);

  /* The triangle field (sprint 9): three colours the README's tokens leave out, each the desktop
     prototype's own (the hover fill of .tf:hover, the grey of the top-right light and the shimmer's peak,
     rgb(70,92,98) and rgb(156,167,168)), then the prototypes' alphas of the light and the scrims. */
  --field-glow: #E6FAFE;
  --field-light: #465C62;
  --field-sweep: #9CA7A8;
  --field-light-mid: color-mix(in srgb, var(--field-light) 60%, transparent);
  --field-cyan-light: color-mix(in srgb, var(--accent) 13%, transparent);
  --field-cyan-light-mid: color-mix(in srgb, var(--accent) 5%, transparent);
  --field-scrim: color-mix(in srgb, var(--black) 75%, transparent);
  --field-scrim-left: color-mix(in srgb, var(--black) 60%, transparent);
  --field-scrim-mid: color-mix(in srgb, var(--black) 55%, transparent);
  --field-scrim-foot: color-mix(in srgb, var(--black) 35%, transparent);
  --field-scrim-top: color-mix(in srgb, var(--black) 15%, transparent);

  /* What we do's opening (sprint 10): the line along the growing triangle's edge, the desktop
     prototype's edgeRef stroke, the one colour it uses that the README's tokens leave out. Its glow is --accent. */
  --edge-line: #7FE3F5;

  /* Motion: the README's one system. Defined now, used from the motion sprints on. */
  --ease: cubic-bezier(0.65, 0, 0.25, 1);
  --ease-out: cubic-bezier(0.2, 0.7, 0.2, 1);
  --t1: 0.4s;
  --t2: 0.9s;
  --t3: 1.4s;
  --st: 0.15s;
  --t-loader: 3.6s;
  --t-loader-push: 2.6s;
  /* The loader (sprint 14): the overlay's leaving and the page's arrival take 0.5 s each, and the hero's
     reveal is timed off --L, the prototypes' hand-over (each part at --L + its --d). */
  --t-push: 0.5s;
  --L: 2.9s;
  --t-shimmer: 5s;
  --t-zoom: 2.8s;
  --t-count: 1.1s;
  /* The mobile menu: the README's 0.35 s slide; the links' wipe and its stagger are the mobile prototype's. */
  --t-menu: 0.35s;
  --t-menu-wipe: 0.5s;
  --t-menu-stagger: 0.06s;

  /* Type */
  --font-head: 'Jost', system-ui, sans-serif;
  --font-body: 'DM Sans', system-ui, sans-serif;
  --font-mono: 'IBM Plex Mono', ui-monospace, monospace;

  /* Layout */
  --bar: 64px;
  /* The clear space kept round a focused element the browser scrolls to (sprint 13). */
  --focus-clear: 16px;
  /* Mobile v12 (sprint 19): below 1024 px every side margin is 28 px, the sections', the bar's, the menu
     panel's and the footer's. From 1024 the layout is --col and --rail's; --gutter keeps the 48 px it had
     there, so nothing that still reads it moves. */
  --gutter: 28px;
  --rail: 0px;
  --col: 0px;
}

@media (min-width: 1024px) {
  :root {
    --gutter: 48px;
    --rail: clamp(40px, 6.94vw, 100px);
    --col: clamp(280px, 29.03vw, 418px);
  }
}

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

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

/* Every in-page link scrolls smoothly to its section (it jumps under reduced motion, at the end of this file).
   Whatever the browser scrolls into view, a focused element or a link's section, stops --focus-clear clear
   of the fixed bar (below 1024 px) and of the window's edges, so no focus sits under the bar or has its
   ring cut (sprint 13; WCAG 2.4.11). A section takes that clear space back with its scroll-margin, below,
   so a link still lands it where it did. */
html {
  scroll-behavior: smooth;
  scroll-padding: calc(var(--bar) + var(--focus-clear)) 0 var(--focus-clear);
}

@media (min-width: 1024px) {
  html {
    scroll-padding: var(--focus-clear) 0;
  }
}

body {
  margin: 0;
  background: var(--bg-dark);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.55;
  -webkit-text-size-adjust: 100%;
}

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

a {
  color: inherit;
}

img {
  display: block;
  max-width: 100%;
}

/* The prototypes' focus ring: a 2 px cyan outline, and a dark ring filling the gap so it shows on cyan too. */
a:focus-visible,
button:focus-visible,
input:focus-visible,
textarea:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
  box-shadow: 0 0 0 3px var(--bg-dark);
}

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

/* A nav link lands with its section's top at the fixed bar's foot below 1024 px, at the window's top from
   it: the html's scroll-padding, less the clear space kept for focus. (The hero and What we do sit in
   .opening, the stage motion.js pins, so this reaches every section, not only main's children.) */
main section {
  scroll-margin-top: calc(-1 * var(--focus-clear));
}

/* A section a nav link's landing focuses (motion.js, sprint 13) is only where the next Tab starts: no ring. */
main section[tabindex="-1"]:focus {
  outline: none;
}

/* A section's content: gutters on mobile; from 1024 the prototype's heading column (418 at 1440), 922 wide at most. */
.inner {
  margin-left: var(--gutter);
  margin-right: var(--gutter);
}

@media (min-width: 1024px) {
  .inner {
    max-width: 922px;
    margin-left: var(--col);
    margin-right: var(--rail);
  }
}

/* The triangle marker (8 x 7.85, or 14 x 13.74 in What we do). */
.marker {
  display: block;
  flex: none;
  width: 8px;
  height: 7.85px;
}

.cta {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 16px 28px;
  background: var(--accent);
  color: var(--black);
  font-size: 16px;
  font-weight: 600;
  line-height: 1.2;
  text-decoration: none;
}

/* The number of a step or a case: a white triangle and two digits. */
.num {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--text-4);
  font-family: var(--font-head);
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 1px;
  line-height: 1.4;
}

.num .marker {
  color: var(--white);
}

/* ---------- The bar (below 1024 px) and the hero's nav (from 1024 px) ---------- */

.bar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 20;
  height: var(--bar);
  padding: 0 var(--gutter);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

/* The bar's ground, on its own layer: a backdrop-filter on .bar itself would make it the box the
   fixed menu panel inside it is laid out in. Black where backdrop-filter isn't supported; blurred
   where it is; see-through while the page is at its top (menu.js adds .is-top) and while the menu is open. */
.bar::before {
  content: "";
  position: absolute;
  inset: 0;
  background-color: var(--bg-black);
  transition: background-color var(--t1) var(--ease-out);
}

@supports ((-webkit-backdrop-filter: blur(10px)) or (backdrop-filter: blur(10px))) {
  .bar::before {
    background-color: var(--bar-blur);
    -webkit-backdrop-filter: blur(10px);
    backdrop-filter: blur(10px);
  }
}

.bar.is-top::before,
.bar.is-open::before {
  background-color: transparent;
  -webkit-backdrop-filter: none;
  backdrop-filter: none;
}

.bar__mark {
  position: relative;
  z-index: 2;
  display: block;
  width: 44px;
  height: 30px;
  color: var(--text);
  transition: color var(--t1);
}

.bar__menu {
  display: flex;
  align-items: center;
}

.bar__mark svg,
.footer__mark {
  display: block;
  width: 100%;
  height: 100%;
}

.bar__nav {
  display: none;
}

.menu-button {
  position: relative;
  z-index: 2;
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 44px;
  padding: 0 2px;
  border: 0;
  background: none;
  color: var(--text);
  font-family: var(--font-head);
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 2.5px;
  line-height: 1;
  cursor: pointer;
  transition: color var(--t1);
}

.menu-button[hidden] {
  display: none;
}

.menu-button__label {
  display: block;
  padding-top: 1px;
}

.menu-button__icon {
  display: block;
  width: 18px;
  height: 10px;
  overflow: visible;
}

.menu-button__icon path {
  transform-box: view-box;
  transform-origin: 9px 5px;
  transition: transform var(--t1) var(--ease);
}

/* The panel: full-screen cyan under the bar. menu.js takes `hidden` off, then adds .is-open, so it
   slides down from above the screen; closing, it slides back up and menu.js hides it when the slide ends. */
.menu {
  position: fixed;
  inset: 0;
  z-index: 1;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 40px;
  padding: 120px var(--gutter) 40px;
  overflow-y: auto;
  background: var(--cyan);
  color: var(--black);
  transform: translateY(-100%);
  transition: transform var(--t-menu) var(--ease);
}

.menu.is-open {
  transform: none;
}

.menu[hidden] {
  display: none;
}

.menu__nav {
  display: flex;
  flex-direction: column;
  gap: 26px;
  font-family: var(--font-head);
  font-size: 32px;
  font-weight: 500;
  letter-spacing: -0.3px;
  line-height: 1.2;
}

/* Each link wipes in left to right, the first 0.15 s after the panel starts, then a stagger apart;
   the inset's 10 px of slack keeps the focus ring and the marker inside the clip. */
.menu__nav a {
  position: relative;
  align-self: flex-start;
  padding-left: 28px;
  text-decoration: none;
  clip-path: inset(0 100% 0 0);
  transition: clip-path var(--t-menu-wipe) var(--ease), color var(--t1);
}

.menu.is-open .menu__nav a {
  clip-path: inset(-10px -10px -10px -10px);
  transition-delay: calc(0.15s + var(--i, 0) * var(--t-menu-stagger)), 0s;
}

.menu__nav a:nth-child(2) { --i: 1; }
.menu__nav a:nth-child(3) { --i: 2; }
.menu__nav a:nth-child(4) { --i: 3; }
.menu__nav a:nth-child(5) { --i: 4; }

/* The current section's link: white, with the white triangle sliding in from 8 px to its left. */
.menu__nav a[aria-current="true"] {
  color: var(--white);
}

.menu__nav a::before {
  content: "";
  position: absolute;
  left: 0;
  top: 50%;
  width: 14px;
  height: 13.74px;
  background-color: var(--white);
  clip-path: polygon(50% 0, 100% 100%, 0 100%);
  opacity: 0;
  transform: translate(-8px, -50%);
  transition: opacity var(--t1) var(--ease-out), transform var(--t1) var(--ease-out);
}

.menu.is-open .menu__nav a[aria-current="true"]::before {
  opacity: 1;
  transform: translate(0, -50%);
  transition-delay: 0.3s;
}

.menu__name {
  font-family: var(--font-head);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 2.5px;
  opacity: 0;
  transition: opacity var(--t1) var(--ease-out);
}

.menu.is-open .menu__name {
  opacity: 1;
  transition-delay: 0.45s;
}

/* Open: the bar sits on the cyan panel (its ground goes see-through, above). The mark goes black
   (--text on cyan is 2.9:1); CLOSE and the X are white, as Josephine asked (sprint 17: about 3.5:1 for
   CLOSE's 12 px, below AA's 4.5:1, a design decision recorded as that sprint's Risk). */
.bar.is-open .bar__mark {
  color: var(--black);
}

.bar.is-open .menu-button {
  color: var(--white);
}

.bar.is-open .menu-button__icon {
  color: var(--white);
}

.bar.is-open .menu-button__icon path:first-child {
  transform: translateY(4px) rotate(45deg);
}

.bar.is-open .menu-button__icon path:last-child {
  transform: translateY(-4px) rotate(-45deg);
}

.menu-open,
.menu-open body {
  overflow: hidden;
}

/* Mobile v12 (sprint 19): while the hero opens into What we do, motion.js turns the mark's A --cyan as the
   triangle grows out of it, then the whole mark --black once the cyan covers it, and MENU and its lines
   --black once the cyan covers them (--text on --cyan is 2.9:1, --black 6.3:1). An open menu's own
   colours, above, win; the opening's come back when it closes. */
.bar__mark .mark__a {
  transition: color var(--t1);
}

.bar.is-a-lit:not(.is-open) .bar__mark .mark__a {
  color: var(--cyan);
}

.bar.is-mark-covered:not(.is-open) .bar__mark {
  color: var(--black);
}

.bar.is-menu-covered:not(.is-open) .menu-button {
  color: var(--black);
}

@media (min-width: 1024px) {
  /* The prototype's hero rail: the mark at (rail, 64), the five links in a column from (rail, 178). */
  .bar {
    position: absolute;
    right: auto;
    height: 0;
    padding: 0;
    display: block;
    background: none;
  }

  .bar::before {
    display: none;
  }

  .bar__mark {
    position: absolute;
    left: var(--rail);
    top: 64px;
    width: 61px;
    height: 42px;
  }

  .bar__nav {
    position: absolute;
    left: var(--rail);
    top: 178px;
  }

  .bar__nav a {
    color: var(--text);
  }

  /* The menu's nav, button and panel are the mobile layout's: from 1024 they leave the page and its accessibility tree. */
  .bar__menu {
    display: none;
  }
}

/* ---------- The desktop navs (from 1024 px) ----------
 * Three copies of the main nav, one look: the hero's (in the header, above), What we do's on the
 * cyan ground, and the fixed nav once What we do has gone. menu.js exposes exactly one of them to
 * assistive technology and Tab at a time; the others carry aria-hidden and tabindex="-1" but still
 * take a click. Below 1024 none of them shows: the menu's nav is the page's "Main". */

.rail,
.what__rail {
  display: none;
}

@media (min-width: 1024px) {
  .bar__nav,
  .rail__nav {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 26px;
    font-family: var(--font-head);
    font-size: 13px;
    font-weight: 500;
    letter-spacing: 2.5px;
    line-height: 1.4;
  }

  /* Hover draws an underline under the word only, left to right over --t1; the marker sits outside the word's box. */
  .bar__nav a,
  .rail__nav a {
    position: relative;
    padding-bottom: 3px;
    text-decoration: none;
    white-space: nowrap;
    background-image: linear-gradient(currentColor, currentColor);
    background-position: 0 100%;
    background-repeat: no-repeat;
    background-size: 0 1px;
    transition: background-size var(--t1) var(--ease);
  }

  .bar__nav a:hover,
  .rail__nav a:hover {
    background-size: 100% 1px;
  }

  /* The rail's mark at (rail, 64), 61 x 42; its links 72 px below the mark's foot, at (rail, 178). */
  .rail {
    display: block;
  }

  .rail__mark {
    display: block;
    width: 61px;
    height: 42px;
  }

  .rail__mark svg {
    display: block;
    width: 100%;
    height: 100%;
  }

  .rail__nav {
    margin-top: 72px;
  }

  /* The marker: the 8 x 7.85 triangle, 17 px left of the word, 3 px below the link's top. */
  .rail__nav a::before {
    content: "";
    display: none;
    position: absolute;
    left: -17px;
    top: 3px;
    width: 8px;
    height: 7.85px;
    clip-path: polygon(50% 0, 100% 100%, 0 100%);
  }

  /* What we do's copy: held where the hero's was while the cyan fills the screen, carried out with
     the section's foot. WHAT WE DO is always marked, in black (a cyan marker would vanish on cyan). */
  .what {
    position: relative;
  }

  .what__rail {
    display: block;
    position: absolute;
    top: 0;
    bottom: 0;
    left: var(--rail);
    padding-top: 64px;
  }

  .rail--what {
    position: sticky;
    top: 64px;
    color: var(--black);
  }

  .rail--what .rail__nav a {
    color: var(--nav-dim-dark);
  }

  .rail--what .rail__nav a[href="#what"] {
    color: var(--black);
  }

  .rail--what .rail__nav a[href="#what"]::before {
    display: block;
    background-color: var(--black);
  }

  /* The fixed nav: shown (menu.js adds .is-shown) once What we do's foot has passed the mark's top,
     so it only ever sits over the dark sections. Only the mark and the links take the pointer. */
  .rail--fixed {
    position: fixed;
    top: 64px;
    left: var(--rail);
    z-index: 15;
    color: var(--text);
    visibility: hidden;
    pointer-events: none;
  }

  .rail--fixed.is-shown {
    visibility: visible;
  }

  .rail--fixed a {
    pointer-events: auto;
  }

  .rail--fixed .rail__nav a {
    color: var(--nav-dim);
  }

  .rail--fixed .rail__nav a[aria-current="true"] {
    color: var(--text);
  }

  .rail--fixed .rail__nav a[aria-current="true"]::before {
    display: block;
    background-color: var(--accent);
  }
}

/* ---------- The triangle field (sprint 9) ----------
 * Behind the hero and Contact us: one .tri-field each, the section's first child. Bottom to top: the
 * black ground, the field (field.js draws it on the canvas), the shimmer's band, the top-right light,
 * the scrims that keep the words legible and, in Contact us, the ground from Who we are. The layer
 * clips all of it to the section, so nothing here widens the page, and takes no pointer, so the hero's
 * link and the form work through it. The prototypes' values, from docs/design/v10/design/ and the
 * Designer's note, docs/sprints/design/sprint-9-note.md: the mobile prototype's light and scrim below
 * 1024 px, the desktop prototype's from 1024. */

.tri-field {
  /* The sweep's geometry, set by field.js from the window's size; at rest without it. */
  --sw-w: 0px;
  --sw-h: 0px;
  --sw-x0: 0px;
  --sw-x1: 0px;
  --sw-angle: 0deg;
  --sw-band-start: 0px;
  --sw-peak: 0px;
  --sw-band-end: 0px;
  position: absolute;
  inset: 0;
  z-index: 0;
  overflow: hidden;
  isolation: isolate;
  pointer-events: none;
  background-color: var(--bg-black);
}

.tri-field > * {
  position: absolute;
  pointer-events: none;
}

.tri-field__canvas {
  left: 0;
  top: 0;
  display: block;
}

/* The shimmer: a band of light, two gradient halves meeting in an arrow, carried across by its
   transform only. Color-dodge brightens the triangles it passes over and leaves the black black. */
.tri-field__sweep {
  --sw-stops: var(--black) 0px, var(--black) var(--sw-band-start), var(--field-sweep) var(--sw-peak), var(--black) var(--sw-band-end), var(--black) 100%;
  left: 0;
  top: 0;
  width: var(--sw-w);
  mix-blend-mode: color-dodge;
  will-change: transform;
  transform: translateX(var(--sw-x0));
}

.tri-field__band {
  height: var(--sw-h);
  background-image: linear-gradient(var(--sw-angle), var(--sw-stops));
}

.tri-field__band--lower {
  background-image: linear-gradient(calc(180deg - var(--sw-angle)), var(--sw-stops));
}

/* One run of 5 s: the band crosses in the first 88%, then rests off the right edge. field.js adds the class. */
.tri-field__sweep.is-sweeping {
  animation: tri-field-sweep var(--t-shimmer) linear 1 both;
}

@keyframes tri-field-sweep {
  0% {
    transform: translateX(var(--sw-x0));
  }

  88%,
  100% {
    transform: translateX(var(--sw-x1));
  }
}

/* The top-right light: a grey that dodges the field brighter, and a faint cyan over it. */
.tri-field__light--grey {
  right: -40%;
  top: -20%;
  width: 120%;
  height: 80%;
  mix-blend-mode: color-dodge;
  background-image: radial-gradient(ellipse at 70% 30%, var(--field-light) 0%, var(--field-light-mid) 30%, transparent 70%);
}

.tri-field__light--cyan {
  right: -40%;
  top: -25%;
  width: 130%;
  height: 90%;
  background-image: radial-gradient(ellipse at 70% 30%, var(--field-cyan-light) 0%, var(--field-cyan-light-mid) 38%, transparent 68%);
}

/* Below 1024 one scrim over the whole section; from 1024 a band down the left and an ellipse behind the copy. */
.tri-field__scrim--left {
  display: none;
}

.tri-field__scrim--main {
  inset: 0;
  background-image: linear-gradient(180deg, var(--field-scrim-top) 0%, var(--field-scrim) 30%, var(--field-scrim) 75%, var(--field-scrim-foot) 100%);
}

.tri-field--contact .tri-field__scrim--main {
  background-image: linear-gradient(180deg, transparent 0%, var(--field-scrim-mid) 40%, var(--field-scrim) 100%);
}

/* Contact us: Who we are runs into it, a fade from --bg-dark at the top, over the field and the light. */
.tri-field__ground {
  left: 0;
  top: 0;
  width: 100%;
  height: 240px;
  background-image: linear-gradient(180deg, var(--bg-dark) 0, var(--fade-mid) 72px, transparent 240px);
}

@media (min-width: 768px) {
  .tri-field__ground {
    height: 360px;
    background-image: linear-gradient(180deg, var(--bg-dark) 0, var(--fade-mid) 108px, transparent 360px);
  }
}

@media (min-width: 1024px) {
  .tri-field__light--grey {
    right: -10%;
    top: -25%;
    width: 80%;
    height: 110%;
  }

  .tri-field__light--cyan {
    right: -15%;
    top: -35%;
    width: 85%;
    height: 120%;
  }

  .tri-field__scrim--left {
    display: block;
    left: 0;
    top: 0;
    width: 760px;
    height: 100%;
    background-image: linear-gradient(90deg, var(--field-scrim-left) 0%, var(--field-scrim-left) 55%, transparent 100%);
  }

  .tri-field__scrim--main {
    inset: auto;
    left: 280px;
    top: 120px;
    width: 1060px;
    height: 640px;
    background-image: radial-gradient(ellipse at 42% 48%, var(--field-scrim) 0%, var(--field-scrim) 38%, transparent 72%);
  }

  .tri-field--contact .tri-field__scrim--main {
    top: 80px;
    height: 1000px;
    background-image: radial-gradient(ellipse at 42% 45%, var(--field-scrim) 0%, var(--field-scrim) 40%, transparent 72%);
  }
}

/* ---------- Hero ---------- */

.hero {
  position: relative;
  min-height: max(640px, 100vh);
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: calc(var(--bar) + 40px) var(--gutter) 64px;
  background: var(--bg-black);
}

/* Over the triangle field. (From 1024 SCROLL ↓ is placed absolutely, below; it keeps this z-index.) */
.hero__copy,
.hero__scroll {
  position: relative;
  z-index: 1;
}

.hero__copy {
  display: flex;
  flex-direction: column;
  gap: 22px;
}

.hero__label {
  color: var(--accent);
  font-family: var(--font-head);
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 2.5px;
  line-height: 1.4;
}

.hero h1 {
  font-family: var(--font-head);
  font-size: 38px;
  font-weight: 500;
  line-height: 1.1;
  letter-spacing: -0.02em;
}

.hero__accent {
  color: var(--accent);
}

/* v11's desktop line breaks (sprint 18): the H1 after "now." and "should", the intro after "stays out.",
   from 1024 px only. Below that the <br>s are hidden and both wrap naturally; the space after each <br>
   keeps the words apart there. */
@media (max-width: 1023.98px) {
  .hero__br {
    display: none;
  }
}

.hero__more {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 22px;
}

.hero__intro {
  max-width: 580px;
  color: var(--text-2);
}

.hero__more .cta {
  margin-top: 4px;
  padding: 15px 26px;
}

.hero__scroll {
  display: none;
}

@media (min-width: 768px) {
  .hero h1 {
    font-size: clamp(46px, 3.8vw, 72px);
    line-height: 1.08;
  }
}

@media (min-width: 1024px) {
  .hero {
    display: block;
    padding: max(200px, calc(50vh - 230px)) 40px 120px calc(var(--col) + 7px);
  }

  .hero__copy {
    gap: 32px;
  }

  .hero__label {
    font-size: 13px;
  }

  .hero__more {
    gap: 28px;
  }

  .hero__more .cta {
    margin-top: 0;
    padding: 16px 28px;
  }

  .hero__scroll {
    display: block;
    position: absolute;
    left: 0;
    right: 0;
    bottom: 36px;
    color: var(--text-4);
    font-family: var(--font-mono);
    font-size: 12px;
    font-weight: 500;
    letter-spacing: 2px;
    text-align: center;
  }
}

/* ---------- What we do ---------- */

.what {
  padding: 112px 0 88px;
  background: var(--cyan);
  color: var(--black);
}

.what h2 {
  font-family: var(--font-head);
  font-size: 36px;
  font-weight: 500;
  line-height: 1.1;
  letter-spacing: -0.5px;
}

.what__light {
  color: var(--white);
}

.what__dark {
  color: var(--black);
}

.what__steps {
  margin-top: 56px;
  display: grid;
  gap: 44px;
}

.what__step {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.what__step .marker {
  width: 12px;
  height: 11.8px;
}

.what__step h3 {
  font-size: 24px;
  font-weight: 500;
  line-height: 1.2;
}

@media (min-width: 768px) {
  .what h2 {
    font-size: clamp(36px, 5vw, 72px);
    line-height: 1.08;
    letter-spacing: -1.1px;
  }

  .what h2 span {
    display: block;
  }

  .what__steps {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 32px;
  }

  .what__step {
    gap: 22px;
  }

  .what__step .marker {
    width: 14px;
    height: 13.74px;
  }

  .what__step h3 {
    font-size: clamp(24px, 2.36vw, 34px);
  }
}

/* Full-screen cyan, the end state of the prototype's pinned section. */
@media (min-width: 1024px) {
  .what {
    min-height: max(640px, 100vh);
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 160px 0 120px;
  }

  .what__steps {
    margin-top: 72px;
    gap: 48px;
  }
}

/* ---------- What we do, in motion (sprint 10) ----------
 * Every rule here hangs off a class motion.js puts on <html> once GSAP has loaded: .motion-pin-what in a
 * window at least as wide and high as What we do's pin-threshold: line (sprint 13's note, 1024 x 640),
 * .motion-reveal-what in a smaller one, neither under prefers-reduced-motion. Without them (the script
 * hasn't run, failed to load, or motion is reduced) What we do is the static end state above, every
 * word shown. The desktop prototype's numbers, docs/design/v10/design/desktop-v10.dc.html: its stage,
 * one screen high and 640 px at least; the headline at 50% - 250 px; the steps' box at 50% + 60 px,
 * 300 px tall, from --col - 78 px with a 78 px fade-in mask; each step 376 px wide at 1440, scaled
 * with --col (418 there). */

.opening__edge,
.hero__fill,
.hero__edge {
  display: none;
}

/* The stage motion.js pins: the hero, What we do over it (clipped to the growing triangle by the
   script), and the triangle's edge line over both. The header's mark and nav stay where they are, fixed,
   and the script clips them to what lies outside the triangle. */
.motion-pin-what .opening {
  position: relative;
  height: max(640px, 100vh);
  overflow: hidden;
}

.motion-pin-what .bar {
  position: fixed;
}

.motion-pin-what .hero {
  position: absolute;
  inset: 0;
  z-index: 0;
  min-height: 0;
}

.motion-pin-what .what {
  position: absolute;
  inset: 0;
  z-index: 1;
  min-height: 0;
  display: block;
  padding: 0;
  clip-path: polygon(0 0, 0 0, 0 0);
}

/* The edge, the desktop opening's and (sprint 19) the mobile one's inside the hero: the same line and the
   same glow, below. */
.motion-pin-top .hero__edge,
.motion-pin-what .opening__edge {
  display: block;
  position: absolute;
  inset: 0;
  z-index: 2;
  width: 100%;
  height: 100%;
  color: var(--edge-line);
  pointer-events: none;
  overflow: hidden;
}

.motion-pin-top .hero__edge polygon,
.motion-pin-what .opening__edge polygon {
  stroke-width: 1.5;
  stroke-linejoin: miter;
}

/* The prototype's glow, drop-shadow(0 0 6px #2EC4E6) on the line, drawn without a filter: a blur over
   the stage, re-rastered on every frame of the opening, was most of its cost (LiveQA, sprint 10 round 4).
   Chromium draws that shadow as a Gaussian of 6 px standard deviation, peaking at a tenth of --accent
   beside the line and gone 16 px out (measured: sprint-10_assets/edge-profile.js). Seven --accent strokes
   under the line, widest and faintest first, each adding one band of that falloff, composite to the same
   profile, so the glow reads the same and nothing is blurred. */
.motion-pin-top .hero__glow polygon,
.motion-pin-what .opening__glow polygon {
  stroke: var(--accent);
  /* A blur rounds the line's corners; a mitred 32 px stroke would put a spike at each instead. */
  stroke-linejoin: round;
}

.motion-pin-top .hero__glow polygon:nth-child(1),
.motion-pin-what .opening__glow polygon:nth-child(1) {
  stroke-width: 32;
  stroke-opacity: 0.006;
}

.motion-pin-top .hero__glow polygon:nth-child(2),
.motion-pin-what .opening__glow polygon:nth-child(2) {
  stroke-width: 26;
  stroke-opacity: 0.0118;
}

.motion-pin-top .hero__glow polygon:nth-child(3),
.motion-pin-what .opening__glow polygon:nth-child(3) {
  stroke-width: 21;
  stroke-opacity: 0.0185;
}

.motion-pin-top .hero__glow polygon:nth-child(4),
.motion-pin-what .opening__glow polygon:nth-child(4) {
  stroke-width: 17;
  stroke-opacity: 0.0235;
}

.motion-pin-top .hero__glow polygon:nth-child(5),
.motion-pin-what .opening__glow polygon:nth-child(5) {
  stroke-width: 13;
  stroke-opacity: 0.027;
}

.motion-pin-top .hero__glow polygon:nth-child(6),
.motion-pin-what .opening__glow polygon:nth-child(6) {
  stroke-width: 9;
  stroke-opacity: 0.026;
}

.motion-pin-top .hero__glow polygon:nth-child(7),
.motion-pin-what .opening__glow polygon:nth-child(7) {
  stroke-width: 5;
  stroke-opacity: 0.017;
}

/* Below 1024 px (sprint 19, mobile v12): the hero, pinned by motion.js, with the cyan fill over its copy,
   clipped by the script to the triangle growing out of the bar's A, and the edge over the fill. The hero
   clips both, so a triangle wider than the window never widens the page. The fill takes no taps: the
   copy under it does while it shows (motion.js). */
.motion-pin-top .hero {
  overflow: hidden;
}

.motion-pin-top .hero__fill {
  display: block;
  position: absolute;
  inset: 0;
  z-index: 2;
  background: var(--cyan);
  pointer-events: none;
  clip-path: polygon(0 0, 0 0, 0 0);
}

/* What we do's mark, inside the triangle: its logo the hero's light and its A cyan, one with the
   triangle, until the triangle covers the mark; then the whole mark black, as it is at rest. */
.motion-pin-what .rail--what .rail__mark {
  color: var(--text);
  transition: color var(--t1);
}

.motion-pin-what .rail--what .mark__a {
  color: var(--cyan);
  transition: color var(--t1);
}

.motion-pin-what .what.is-covered .rail--what .rail__mark,
.motion-pin-what .what.is-covered .rail--what .mark__a {
  color: var(--black);
}

/* The headline wipes in left to right past 0.7 x openDistance, and out again above it. */
.motion-pin-what .what h2 {
  position: absolute;
  left: var(--col);
  right: var(--rail);
  top: calc(50% - 250px);
  clip-path: inset(-0.3em 100% -0.3em 0);
  transition: clip-path var(--t2) var(--ease);
}

.motion-pin-what .what.is-headed h2 {
  clip-path: inset(-0.3em -0.3em -0.3em 0);
}

/* The steps' box fades in 0.7 s after the headline; the script slides and fades each step in it. */
.motion-pin-what .what__steps {
  position: absolute;
  left: calc(var(--col) - 78px);
  right: 0;
  top: calc(50% + 60px);
  height: 300px;
  margin: 0;
  display: block;
  overflow: hidden;
  -webkit-mask-image: linear-gradient(90deg, transparent 0, var(--black) 78px);
  mask-image: linear-gradient(90deg, transparent 0, var(--black) 78px);
  opacity: 0;
  transition: opacity var(--t1) var(--ease-out);
}

.motion-pin-what .what.is-headed .what__steps {
  opacity: 1;
  transition-delay: 0.7s;
}

.motion-pin-what .what__step {
  position: absolute;
  left: 0;
  top: 0;
  width: calc(var(--col) * 376 / 418);
  opacity: 0;
  will-change: transform;
}

/* Stacked (below 1024 px, or in a window shorter than What we do's line): the mobile prototype's reveal,
   once. The headline wipes in as its top passes 85% of the window; each step as its own does, the marker, then the title after --st, the body after 2 x --st. */
.motion-reveal-what .what h2,
.motion-reveal-what .what__step > * {
  clip-path: inset(-0.3em 100% -0.3em 0);
  transition: clip-path var(--t2) var(--ease);
}

.motion-reveal-what .what__step h3 {
  transition-delay: var(--st);
}

.motion-reveal-what .what__step p {
  transition-delay: calc(var(--st) * 2);
}

.motion-reveal-what .what h2.is-revealed,
.motion-reveal-what .what__step.is-revealed > * {
  clip-path: inset(-0.3em -0.3em -0.3em 0);
}

/* ---------- Where to start ---------- */

.start {
  padding: 96px 0;
  background: var(--bg-dark);
}

.start__paths {
  display: grid;
  gap: 64px;
}

.start__loop {
  position: relative;
  min-height: 128px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.start__loop svg {
  position: absolute;
  left: 0;
  top: 0;
  width: 100%;
  height: 128px;
  overflow: visible;
  color: var(--accent);
}

.start__label {
  position: relative;
  padding: 0 16px;
  color: var(--accent);
  font-family: var(--font-head);
  font-size: 22px;
  font-weight: 400;
  line-height: 1.2;
  text-align: center;
}

.start__path h3 {
  margin-top: 22px;
  font-size: 19px;
  font-weight: 500;
  line-height: 1.4;
}

.start__body {
  margin-top: 10px;
  color: var(--text-3);
}

.start__between {
  margin-top: 40px;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}

.start__arrow {
  display: block;
  width: 14px;
  height: 72px;
  color: var(--accent);
}

.start__between h3 {
  margin-top: 20px;
  color: var(--accent);
  font-family: var(--font-head);
  font-size: 24px;
  font-weight: 400;
  line-height: 30px;
}

.start__between p {
  margin-top: 4px;
  color: var(--text-4);
  line-height: 25px;
}

.start__between .cta {
  margin-top: 18px;
  padding: 12px 26px;
}

.start__drawing {
  display: none;
}

@media (min-width: 768px) {
  .start {
    padding: 120px 0 100px;
  }

  .start__paths {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 48px;
  }

  .start__label {
    font-size: clamp(22px, 1.95vw, 28px);
  }

  .start__path h3 {
    font-size: 20px;
    line-height: 30px;
  }

  .start__body {
    margin-top: 14px;
    line-height: 25px;
  }

  .start__between .cta {
    margin-top: 14px;
    padding: 11px 28px;
  }
}

/* From 1024 the prototype's own drawing in its 1440 x 560 box (sprint 11, Requirement 3). Every x offset
   and width is the prototype's scaled by --col / 418 (1 from 1440, where --col is 418; 0.711 at 1024);
   every y offset, the box's height and the type keep the prototype's, so the reading sizes never shrink.
   The drawing stretches across only (preserveAspectRatio="none", its strokes non-scaling); the labels
   take sprint 7's clamp, 28 px from 1436, each centred on its loop and one line wide. */
@media (min-width: 1024px) {
  .start .inner {
    max-width: none;
    margin: 0;
  }

  .start__stage {
    position: relative;
    height: 560px;
  }

  .start__drawing {
    display: block;
    position: absolute;
    left: calc(var(--col) * 348 / 418);
    top: 5px;
    width: calc(var(--col) * 1050 / 418);
    height: 546px;
    overflow: visible;
    color: var(--accent);
  }

  .start__paths {
    display: block;
  }

  .start__path {
    position: absolute;
    top: 192px;
    width: calc(var(--col) * 421 / 418);
  }

  .start__path--idea {
    left: var(--col);
  }

  .start__path--already {
    left: calc(var(--col) * 936 / 418);
  }

  .start__loop {
    position: static;
    min-height: 0;
    display: block;
  }

  .start__loop svg {
    display: none;
  }

  /* Centred where the prototype centres them: x 593 (443 + 300 / 2) and 1109 (939 + 340 / 2) at 1440. */
  .start__label {
    position: absolute;
    width: max-content;
    /* Room inside either loop for its words on one line (Jost's "You have something already" is 340 px at
       28 px, 267 at 1024's 22 px); past it, a label wraps rather than being cut. */
    max-width: calc(var(--col) * 400 / 418);
    padding: 0;
    line-height: 34px;
    transform: translateX(-50%);
  }

  .start__path--idea .start__label {
    left: calc(var(--col) * 176 / 418);
    top: -124px;
  }

  .start__path--already .start__label {
    left: calc(var(--col) * 173 / 418);
    top: -128px;
  }

  .start__path h3 {
    margin-top: 0;
  }

  .start__path--idea .start__body {
    max-width: calc(var(--col) * 400 / 418);
  }

  .start__between {
    position: absolute;
    left: calc(var(--col) * 624 / 418);
    top: 437px;
    width: calc(var(--col) * 460 / 418);
    margin: 0;
  }

  .start__arrow {
    display: none;
  }

  .start__between h3 {
    margin-top: 0;
  }
}

/* ---------- Where to start, in motion (sprint 11) ----------
 * Every rule here hangs off a class motion.js puts on <html> (.motion-pin-start in a window at least as
 * wide and high as Where to start's pin-threshold: line, sprint 13's note, 1024 x 640; .motion-reveal-start
 * in a smaller one; neither under prefers-reduced-motion), so without them Where to start is the static end
 * state above, every loop drawn and every word shown. Lines draw by stroke-dashoffset on pathLength="1"
 * paths; words wipe in left to right by clip-path, never by display, visibility or opacity, so assistive
 * technology reads them at every stage. Stacked from 1024 px, the drawing shows already drawn (only the
 * mobile loops and arrow draw in) and the words wipe in.
 *
 * Pinned: the desktop prototype's .ws. The section pins one screen high (640 px at least), the
 * 560 px box at 50% - 280 px, and motion.js toggles .is-stage-1 to .is-stage-3 on #start as the scroll
 * passes the prototype's three thresholds. The prototype's delays: d1 to d4 are 2 to 5 x --st. */
.motion-pin-start .start {
  position: relative;
  height: max(640px, 100vh);
  padding: 0;
  overflow: hidden;
}

.motion-pin-start .start__stage {
  position: absolute;
  left: 0;
  right: 0;
  top: max(0px, calc(50% - 280px));
}

.motion-pin-start .start__line {
  stroke-dasharray: 1;
  stroke-dashoffset: 1;
  transition: stroke-dashoffset var(--t3) var(--ease);
}

.motion-pin-start .start.is-stage-1 .start__line--idea,
.motion-pin-start .start.is-stage-2 .start__line--already,
.motion-pin-start .start.is-stage-3 .start__line--arrow {
  stroke-dashoffset: 0;
}

/* The arrow draws over --t2, as the prototype's .ws.s3 .ws-ln.g3 has it (and undraws over --t3). */
.motion-pin-start .start.is-stage-3 .start__line--arrow {
  transition-duration: var(--t2);
}

.motion-pin-start .start__label,
.motion-pin-start .start__path h3,
.motion-pin-start .start__body,
.motion-pin-start .start__between h3,
.motion-pin-start .start__between p {
  clip-path: inset(-0.3em 100% -0.3em 0);
  transition: clip-path var(--t2) var(--ease);
}

/* The button's wipe keeps 20 px of slack round it (the prototype's .rv-pad), so its focus ring isn't cut. */
.motion-pin-start .start__between .cta {
  clip-path: inset(-20px calc(100% + 20px) -20px -20px);
  transition: clip-path var(--t2) var(--ease);
}

.motion-pin-start .start__path h3 {
  transition-delay: calc(var(--st) * 2);
}

.motion-pin-start .start__body {
  transition-delay: calc(var(--st) * 3);
}

.motion-pin-start .start__between h3 {
  transition-delay: calc(var(--st) * 4);
}

.motion-pin-start .start__between p,
.motion-pin-start .start__between .cta {
  transition-delay: calc(var(--st) * 5);
}

.motion-pin-start .start.is-stage-1 .start__path--idea .start__label,
.motion-pin-start .start.is-stage-1 .start__path--idea h3,
.motion-pin-start .start.is-stage-1 .start__path--idea .start__body,
.motion-pin-start .start.is-stage-2 .start__path--already .start__label,
.motion-pin-start .start.is-stage-2 .start__path--already h3,
.motion-pin-start .start.is-stage-2 .start__path--already .start__body,
.motion-pin-start .start.is-stage-3 .start__between h3,
.motion-pin-start .start.is-stage-3 .start__between p {
  clip-path: inset(-0.3em -0.3em -0.3em 0);
}

.motion-pin-start .start.is-stage-3 .start__between .cta {
  clip-path: inset(-20px -20px -20px -20px);
}

/* Stacked (below 1024 px, or in a window shorter than Where to start's line): the mobile prototype's .hr
   blocks, each revealed once as its top passes 85% of the window. A loop draws over --t3, its label wiping in after 2 x --st; a column's title wipes in at once,
   its body after --st; the closing block's arrow draws over --t3, its words and button after 3 x --st. */
.motion-reveal-start .start__loop path,
.motion-reveal-start .start__arrow path {
  stroke-dasharray: 1;
  stroke-dashoffset: 1;
  transition: stroke-dashoffset var(--t3) var(--ease);
}

.motion-reveal-start .start__loop.is-revealed path,
.motion-reveal-start .start__between.is-revealed .start__arrow path {
  stroke-dashoffset: 0;
}

.motion-reveal-start .start__label,
.motion-reveal-start .start__path h3,
.motion-reveal-start .start__body,
.motion-reveal-start .start__between h3,
.motion-reveal-start .start__between p {
  clip-path: inset(-0.3em 100% -0.3em 0);
  transition: clip-path var(--t2) var(--ease);
}

.motion-reveal-start .start__between .cta {
  clip-path: inset(-20px calc(100% + 20px) -20px -20px);
  transition: clip-path var(--t2) var(--ease);
}

.motion-reveal-start .start__label {
  transition-delay: calc(var(--st) * 2);
}

.motion-reveal-start .start__body {
  transition-delay: var(--st);
}

.motion-reveal-start .start__between h3,
.motion-reveal-start .start__between p,
.motion-reveal-start .start__between .cta {
  transition-delay: calc(var(--st) * 3);
}

.motion-reveal-start .start__loop.is-revealed .start__label,
.motion-reveal-start .start__path h3.is-revealed,
.motion-reveal-start .start__body.is-revealed,
.motion-reveal-start .start__between.is-revealed h3,
.motion-reveal-start .start__between.is-revealed p {
  clip-path: inset(-0.3em -0.3em -0.3em 0);
}

.motion-reveal-start .start__between.is-revealed .cta {
  clip-path: inset(-20px -20px -20px -20px);
}

/* While motion.js builds a form, everything in Where to start takes its hidden state at once, rather
   than undrawing from sprint 7's drawn page; the stages reached then draw in from there. It outranks
   every transition above, and only ever stands for one frame. */
.motion-pin-start .start.is-instant *,
.motion-reveal-start .start.is-instant * {
  transition: none !important;
}

/* ---------- How it usually goes ---------- */

.how {
  padding: 24px 0 96px;
  background: var(--bg-dark);
}

.how h2 {
  margin-bottom: 20px;
  color: var(--accent);
  font-family: var(--font-head);
  font-size: 30px;
  font-weight: 500;
  line-height: 1.3;
}

.how__rows {
  padding: 0;
  list-style: none;
  border-bottom: 1px solid var(--rule);
}

.how__row {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 22px 0 24px;
  border-top: 1px solid var(--rule);
}

.how__row h3 {
  color: var(--accent);
  font-family: var(--font-head);
  font-size: 21px;
  font-weight: 500;
  line-height: 1.3;
}

.how__row p {
  color: var(--text-3);
  line-height: 25px;
}

@media (min-width: 768px) {
  .how {
    padding: 0 0 100px;
  }

  .how h2 {
    margin-bottom: 32px;
    font-size: 36px;
    line-height: 54px;
    letter-spacing: -0.007em;
  }

  .how__row {
    display: grid;
    grid-template-columns: 64px clamp(180px, 30.4%, 280px) minmax(0, 1fr);
    gap: 0;
    padding: 26px 0 28px;
  }

  .how__row .num {
    height: 30px;
  }

  .how__row h3 {
    padding-right: 16px;
    font-size: 22px;
    line-height: 30px;
  }

  .how__row p {
    max-width: 520px;
  }
}

/* ---------- What we've shipped ---------- */

.work {
  padding: 24px 0 72px;
  background: var(--bg-dark);
}

.work__head {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.work h2,
.who h2 {
  font-family: var(--font-head);
  font-size: 34px;
  font-weight: 500;
  line-height: 1.2;
  letter-spacing: -0.007em;
}

.work__sub {
  color: var(--text-2);
  line-height: 26px;
}

/* Below 768 px the cases are mobile v12's deck (sprint 20, deck.js; its rules are below, "the deck").
   Until deck.js has run, or without it, they are stacked one under another, each card's stat and image
   side by side with its number, title and description under it, 40 px apart, and the dots stay hidden. */
@media (max-width: 767.98px) {
  .cases {
    margin-top: 40px;
    display: grid;
    gap: 40px;
  }

  .case {
    display: flex;
    flex-direction: column;
    gap: 22px;
  }
}

/* The case image's own box, so its zoom (in motion, below) stays inside it. */
.case__frame {
  display: block;
  min-width: 0;
  overflow: hidden;
}

/* The deck's dots: 24 x 24 buttons, each a 7 px dot; the current one 20 px wide and cyan. They ship
   hidden, deck.js shows them, and there is no deck from 768 px. */
.dots {
  margin-top: 16px;
  display: flex;
  justify-content: center;
  gap: 4px;
}

.dots[hidden] {
  display: none;
}

.dot {
  width: 24px;
  height: 24px;
  padding: 0;
  border: 0;
  background: none;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

.dot span {
  display: block;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background-color: var(--dot);
  transition: width var(--t1) var(--ease), background-color var(--t1) var(--ease-out), border-radius var(--t1);
}

.dot[aria-current="true"] span {
  width: 20px;
  border-radius: 4px;
  background-color: var(--accent);
}

.case__media {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  max-width: 472px;
}

/* Positioned, so its visually hidden final value sits inside it, and inside the deck card's clip. */
.stat {
  position: relative;
  min-height: 150px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  padding: 8px 4px;
  border: 1px solid var(--card-border);
  background-image:
    radial-gradient(ellipse at 90% 0%, var(--panel-glow) 0%, transparent 60%),
    linear-gradient(180deg, var(--panel-top) 0%, var(--panel-bottom) 100%);
  text-align: center;
}

.stat__value {
  color: var(--stat-value);
  font-family: var(--font-head);
  font-size: 34px;
  font-weight: 400;
  line-height: 1.1;
  letter-spacing: 0.02em;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

/* 6→2 at the end of its animation: the 6 dimmed to 50%, the arrow drawn, the 2 risen. */
.stat__from {
  opacity: 0.5;
}

.stat__arrow {
  margin: 0 2px;
  font-size: 0.83em;
  font-weight: 700;
}

.stat__label {
  color: var(--stat-label);
  font-family: var(--font-head);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.02em;
  line-height: 1.3;
}

.case__image {
  width: 100%;
  height: 150px;
  object-fit: cover;
  background: var(--bg-dark);
}

.case__text {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.case__text .num {
  letter-spacing: 0.02em;
}

.case__text h3 {
  color: var(--accent);
  font-family: var(--font-head);
  font-size: 21px;
  font-weight: 600;
  line-height: 1.3;
}

.case__text p {
  color: var(--text-3);
  font-size: 15px;
  line-height: 24px;
}

@media (min-width: 768px) {
  /* From 768 px sprint 7's rows, stacked: no carousel, no dots. */
  .cases {
    margin: 36px 0 0;
    padding: 0;
    display: grid;
    gap: 56px;
    overflow: visible;
    scroll-snap-type: none;
  }

  .dots {
    display: none;
  }

  /* Each card as a row: media and text in the prototype's 472 : 420, the media halves at 236 : 181. */
  .case {
    width: auto;
    display: grid;
    grid-template-columns: minmax(0, 472fr) minmax(0, 420fr);
    align-items: start;
    gap: 30px;
  }

  .stat,
  .case__image {
    min-height: 0;
    height: auto;
    aspect-ratio: 236 / 181;
  }

  .stat {
    gap: 6px;
  }

  .stat__value {
    font-size: clamp(34px, 3.33vw, 48px);
  }

  .stat__label {
    font-size: clamp(11px, 0.97vw, 14px);
  }

  .case__text {
    gap: 15px;
  }

  .case__text .num {
    height: 30px;
  }

  .case__text h3 {
    font-size: 24px;
    line-height: 30px;
  }

  .case__text p {
    font-size: 16px;
    line-height: 25px;
  }
}

@media (min-width: 1024px) {
  .work {
    padding: 120px 0;
  }

  .work__head {
    gap: 8px;
  }

  .work h2,
  .who h2 {
    font-size: clamp(36px, 3.33vw, 48px);
  }

  .work__sub {
    line-height: 32px;
  }

  .cases {
    margin-top: 56px;
  }
}

/* ---------- What we've shipped below 768 px: the deck (sprint 20) ----------
 * Mobile v12's stacked deck (docs/design/v11/design/mobile-v12.dc.html's .cr, .dk and .ctx). Every rule
 * here hangs off a class deck.js puts on below 768 px (.has-deck on the section, .deck on .cases,
 * .deck__case, .deck__card and .deck__text on each case, its .case__media and its .case__text, and
 * .deck__dots), so without it the cases are the stack above, and from 768 px up nothing here applies.
 *
 * The section is a grid: the heading, then the deck and the dots in one row, the dots laid over the gap
 * the deck leaves for them between its cards and its text. Every case sits in the deck's one cell: its
 * card at the foot of the prototype's 226 px box, 40 px under the heading, and its text 62 px under that
 * box (16 px, the dots' 24, 22 px), so the text's spot is as tall as the tallest case's. Each case carries
 * the prototype's perspective (800 px, from 50% across and 60% of the box above it); the three are the
 * same size in the same place, so it is the one perspective the prototype's deck has. deck.js stacks them
 * (z-index), and places, dims and drags each card and text; the card's 1 px border is the prototype's
 * white at 12%, and the stat panel inside it keeps its gradient and drops its own. A card or text flying
 * off is clipped by the section, which never scrolls sideways. */
@media (max-width: 767.98px) {
  .has-deck {
    --deck-top: 40px;
    --deck-box: 226px;
    overflow-x: clip;
  }

  .has-deck > .inner {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
  }

  .has-deck .work__head {
    grid-row: 1;
    grid-column: 1;
  }

  .has-deck .cases,
  .has-deck .dots {
    grid-row: 2;
    grid-column: 1;
  }

  .deck {
    margin-top: var(--deck-top);
    grid-template-columns: minmax(0, 1fr);
    gap: 0;
    isolation: isolate;
  }

  .deck__case {
    grid-area: 1 / 1;
    display: grid;
    grid-template-rows: var(--deck-box) auto;
    row-gap: 62px;
    align-content: start;
    perspective: 800px;
    perspective-origin: 50% calc(var(--deck-box) * -0.6);
  }

  .deck__card {
    grid-row: 1;
    align-self: end;
    height: 176px;
    max-width: none;
    border: 1px solid var(--deck-border);
    background-color: var(--bg-dark);
    overflow: hidden;
    transform-origin: 50% 0;
    box-shadow: 0 -12px 28px var(--deck-shadow);
    touch-action: pan-y;
    user-select: none;
    -webkit-user-select: none;
    transition: transform 0.5s var(--ease-out), filter 0.5s var(--ease-out), opacity 0.4s var(--ease-out);
    will-change: transform;
  }

  /* The page's own focus ring, round the top card: 2 px --accent, 3 px out, the --bg-dark ring between. */
  .deck__card:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 3px;
    box-shadow: 0 0 0 3px var(--bg-dark), 0 -12px 28px var(--deck-shadow);
  }

  .deck__card .stat {
    min-height: 0;
    border: 0;
  }

  .deck__card .case__frame,
  .deck__card .case__image {
    height: 100%;
  }

  /* The text waits 14 px up at 94%, unseen, and comes forward when its case does. */
  .deck__text {
    grid-row: 2;
    opacity: 0;
    transform: translate3d(0, -14px, 0) scale(0.94);
    transform-origin: 50% 0;
    transition: transform 0.5s var(--ease-out), opacity 0.4s var(--ease-out);
    pointer-events: none;
  }

  .deck__text.is-current {
    opacity: 1;
    transform: none;
    pointer-events: auto;
  }

  /* A drag moves the card and its text with the finger, and a text that has flown off goes back unseen. */
  .deck__card.is-dragging,
  .deck__text.is-dragging {
    transition: none;
  }

  .deck__dots {
    position: relative;
    z-index: 1;
    align-self: start;
    margin-top: calc(var(--deck-top) + var(--deck-box) + 16px);
  }
}

/* ---------- What we've shipped, in motion (sprint 12) ----------
 * Every rule here hangs off a class motion.js puts on <html> (.motion-pin-work in a window at least as
 * wide and high as What we've shipped's pin-threshold: line, sprint 13's note, 1024 x 740;
 * .motion-reveal-work in a smaller one; neither under prefers-reduced-motion), so without them What we've
 * shipped is sprint 7's static page, every card whole and every stat its final value.
 *
 * Pinned: the desktop prototype's #work. The section pins one screen high (640 px at least) and
 * motion.js slides .cases, the track of three 472 px cards 105 px apart (1626 px), left as the scroll
 * runs through the pin, fading each card as it passes --col. The content box runs from --col to the
 * window's right edge at max(100px, 50% - 300px), and clips the track at both: a card leaving left is
 * cut at the heading column's edge, with the prototype's 40 px of slack below for a card's rise. */
.motion-pin-work .work {
  position: relative;
  height: max(640px, 100vh);
  padding: 0;
  overflow: hidden;
}

.motion-pin-work .work .inner {
  position: absolute;
  left: var(--col);
  right: 0;
  top: max(100px, calc(50% - 300px));
  max-width: none;
  margin: 0;
  padding-bottom: 40px;
  overflow: hidden;
}

.motion-pin-work .work__head {
  max-width: 922px;
  margin-right: var(--rail);
}

.motion-pin-work .work .cases {
  width: max-content;
  display: flex;
  gap: 105px;
  will-change: transform;
}

.motion-pin-work .work .case {
  flex: none;
  width: 472px;
  display: flex;
  flex-direction: column;
  gap: 28px;
}

.motion-pin-work .work .case__media {
  display: flex;
  width: 472px;
  max-width: none;
}

.motion-pin-work .work .stat,
.motion-pin-work .work .case__frame {
  flex: none;
  width: 236px;
  height: 181px;
}

.motion-pin-work .work .case__image {
  width: 236px;
  height: 181px;
  aspect-ratio: auto;
}

.motion-pin-work .work .stat__value {
  font-size: 48px;
}

.motion-pin-work .work .stat__label {
  font-size: 14px;
}

.motion-pin-work .work .case__text p {
  width: 420px;
}

/* Each card's sequence, at every width: the prototype's .hr[data-cs] rules. motion.js puts .is-on on a
 * card as its top passes 85% of the window, and takes it off when it drops back below. On: the stat panel
 * fades and rises 24 px, the image panel --st after it, its image zooming from 1.14 over --t-zoom; the
 * number wipes in at 2 x --st, the title at 3 x, the description at 4 x; in 6→2 the arrow wipes in at
 * 0.6 s, the 2 rises and the 6 dims to 50% at 1.05 s. Off, each part returns with its resting delay:
 * the panels and the number at once, the title after --st, the description after 2 x --st. */
.motion-pin-work .case .stat,
.motion-pin-work .case__frame,
.motion-reveal-work .case .stat,
.motion-reveal-work .case__frame {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity var(--t2) var(--ease-out), transform var(--t2) var(--ease-out);
}

.motion-pin-work .case.is-on .stat,
.motion-pin-work .case.is-on .case__frame,
.motion-reveal-work .case.is-on .stat,
.motion-reveal-work .case.is-on .case__frame {
  opacity: 1;
  transform: none;
}

.motion-pin-work .case.is-on .case__frame,
.motion-reveal-work .case.is-on .case__frame {
  transition-delay: var(--st);
}

.motion-pin-work .case__image,
.motion-reveal-work .case__image {
  transform: scale(1.14);
  transition: transform var(--t-zoom) var(--ease-out) var(--st);
}

.motion-pin-work .case.is-on .case__image,
.motion-reveal-work .case.is-on .case__image {
  transform: scale(1);
}

.motion-pin-work .case__text .num,
.motion-pin-work .case__text h3,
.motion-pin-work .case__text p,
.motion-reveal-work .case__text .num,
.motion-reveal-work .case__text h3,
.motion-reveal-work .case__text p {
  clip-path: inset(-0.3em 100% -0.3em 0);
  transition: clip-path var(--t2) var(--ease);
}

.motion-pin-work .case__text h3,
.motion-reveal-work .case__text h3 {
  transition-delay: var(--st);
}

.motion-pin-work .case__text p,
.motion-reveal-work .case__text p {
  transition-delay: calc(var(--st) * 2);
}

.motion-pin-work .case.is-on .case__text .num,
.motion-pin-work .case.is-on .case__text h3,
.motion-pin-work .case.is-on .case__text p,
.motion-reveal-work .case.is-on .case__text .num,
.motion-reveal-work .case.is-on .case__text h3,
.motion-reveal-work .case.is-on .case__text p {
  clip-path: inset(-0.3em -0.3em -0.3em 0);
}

.motion-pin-work .case.is-on .case__text .num,
.motion-reveal-work .case.is-on .case__text .num {
  transition-delay: calc(var(--st) * 2);
}

.motion-pin-work .case.is-on .case__text h3,
.motion-reveal-work .case.is-on .case__text h3 {
  transition-delay: calc(var(--st) * 3);
}

.motion-pin-work .case.is-on .case__text p,
.motion-reveal-work .case.is-on .case__text p {
  transition-delay: calc(var(--st) * 4);
}

.motion-pin-work .stat__from,
.motion-pin-work .stat__arrow,
.motion-pin-work .stat__to,
.motion-reveal-work .stat__from,
.motion-reveal-work .stat__arrow,
.motion-reveal-work .stat__to {
  display: inline-block;
}

.motion-pin-work .stat__arrow,
.motion-reveal-work .stat__arrow {
  clip-path: inset(0 100% 0 0);
  transition: clip-path var(--t1) var(--ease) 0.6s;
}

.motion-pin-work .case.is-on .stat__arrow,
.motion-reveal-work .case.is-on .stat__arrow {
  clip-path: inset(0 0 0 0);
}

.motion-pin-work .stat__to,
.motion-reveal-work .stat__to {
  opacity: 0;
  transform: translateY(10px);
  transition: opacity var(--t1) var(--ease-out) 1.05s, transform var(--t1) var(--ease-out) 1.05s;
}

.motion-pin-work .case.is-on .stat__to,
.motion-reveal-work .case.is-on .stat__to {
  opacity: 1;
  transform: none;
}

.motion-pin-work .stat__from,
.motion-reveal-work .stat__from {
  opacity: 1;
  transition: opacity var(--t1) var(--ease-out) 1.05s;
}

.motion-pin-work .case.is-on .stat__from,
.motion-reveal-work .case.is-on .stat__from {
  opacity: 0.5;
}

/* In the deck (below 768 px, stacked only; sprint 20). A card behind the top one comes on with it, its
 * stat panel and image fading in, but plays none of its sequence: its zoom and its 6→2 are at their end
 * at once (motion.js counts nothing on it either). A case coming forward plays its sequence again from the
 * start, as the prototype's .dk.rp restart does: motion.js puts .is-replaying on it for one style read,
 * taking its zoom and its 6→2 back to their start with no transition, then takes it off, so each plays
 * again with its own delay. Its stat panel and its words are already shown, and stay. */
.motion-reveal-work .case.is-behind .case__image,
.motion-reveal-work .case.is-behind .stat__arrow,
.motion-reveal-work .case.is-behind .stat__to,
.motion-reveal-work .case.is-behind .stat__from {
  transition: none;
}

.motion-reveal-work .case.is-replaying .case__image {
  transform: scale(1.14);
  transition: none;
}

.motion-reveal-work .case.is-replaying .stat__arrow {
  clip-path: inset(0 100% 0 0);
  transition: none;
}

.motion-reveal-work .case.is-replaying .stat__to {
  opacity: 0;
  transform: translateY(10px);
  transition: none;
}

.motion-reveal-work .case.is-replaying .stat__from {
  opacity: 1;
  transition: none;
}

/* While motion.js builds a form, every card takes its hidden state at once, rather than fading out of
   sprint 7's whole page; the cards already past the line then play from there. Only ever one frame. */
.motion-pin-work .work.is-instant *,
.motion-reveal-work .work.is-instant * {
  transition: none !important;
}

/* ---------- Who we are ---------- */

.who {
  padding: 32px 0 40px;
  background: var(--bg-dark);
}

.who__head {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.who__intro {
  color: var(--text-2);
  font-size: 17px;
  line-height: 28px;
}

.people {
  margin-top: 40px;
  display: grid;
  gap: 48px;
}

.person {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.person img {
  width: 50%;
  height: auto;
  aspect-ratio: 249 / 265;
  object-fit: cover;
  object-position: center top;
  clip-path: polygon(0 0, 82% 0, 100% 18%, 100% 100%, 0 100%);
  background: var(--bg-dark);
}

.person__text {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.person h3 {
  color: var(--accent);
  font-family: var(--font-head);
  font-size: 18px;
  font-weight: 500;
  line-height: 1.3;
}

.person p {
  color: var(--text-4);
  font-size: 14px;
  line-height: 22px;
}

@media (min-width: 768px) {
  .people {
    margin-top: 56px;
    grid-template-columns: repeat(3, minmax(0, 249px));
    gap: clamp(24px, 6.1vw, 88px);
  }

  .person {
    gap: 17px;
  }

  .person img {
    width: 100%;
  }
}

@media (min-width: 1024px) {
  .who {
    padding: 120px 0 40px;
  }

  .who h2 {
    line-height: 54px;
  }

  .who__intro {
    max-width: 560px;
    font-size: 20px;
    line-height: 32px;
  }
}

@media (min-width: 1280px) {
  .who__head {
    display: grid;
    grid-template-columns: 300px minmax(0, 1fr);
    align-items: start;
    gap: 40px;
  }
}

/* ---------- Contact us ---------- */

/* On black, under its triangle field; the fade from Who we are is the field's top layer (.tri-field__ground). */
.contact {
  position: relative;
  padding: 96px 0 88px;
  background-color: var(--bg-black);
}

.contact > .inner {
  position: relative;
  z-index: 1;
}

.contact__head {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.contact h2 {
  max-width: 862px;
  font-family: var(--font-head);
  font-size: 36px;
  font-weight: 500;
  line-height: 1.1;
  letter-spacing: -0.02em;
}

.contact__subline {
  color: var(--accent);
  font-family: var(--font-head);
  font-size: 20px;
  font-weight: 400;
  line-height: 27px;
}

.contact__side {
  max-width: 572px;
  margin-top: 40px;
}

.contact__form {
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 9px;
  color: var(--text);
  font-size: 13px;
  font-weight: 500;
  line-height: 18px;
}

.field input,
.field textarea {
  width: 100%;
  height: 48px;
  padding: 12px 14px;
  border: 1px solid var(--field-border);
  border-radius: 3px;
  background: var(--field-ground);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 16px; /* 16 px at every width, so iOS doesn't zoom on focus */
  font-weight: 400;
  line-height: 1.4;
}

.field textarea {
  height: 138px;
  resize: vertical;
}

/* The honeypot: off screen rather than display:none, so a bot filling every input finds it. */
.contact__trap {
  position: absolute;
  left: -10000px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

.contact__actions {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.contact__submit {
  width: 100%;
  height: 52px;
  border: 0;
  border-radius: 0;
  background: var(--accent);
  color: var(--black);
  font-family: var(--font-head);
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
}

/* Sending: the script disables the button; it keeps its cyan ground and black text. */
.contact__submit:disabled {
  background: var(--accent);
  color: var(--black);
  cursor: progress;
}

.contact__reply {
  color: var(--text-3);
  font-family: var(--font-head);
  font-size: 13px;
  line-height: 20px;
}

/* The two messages: hidden unless the URL names them (no script) or the script shows them. */
.contact .contact__notice {
  display: none;
  max-width: 572px;
  border-top: 2px solid var(--accent);
  color: var(--text);
  overflow-wrap: anywhere;
}

.contact .contact__notice:target,
.contact .contact__notice.is-shown {
  display: block;
}

.contact__notice:focus {
  outline: none;
}

/* A send without script lands on /#contact-sent: the message takes the form's place. */
#contact-sent:target ~ .contact__form {
  display: none;
}

#contact-sent {
  padding-top: 18px;
  font-family: var(--font-head);
  font-size: 24px;
  font-weight: 500;
  line-height: 30px;
}

#contact-failed {
  padding-top: 14px;
  line-height: 25px;
}

.contact__notice a {
  color: var(--accent);
  text-decoration: underline;
  overflow-wrap: anywhere;
}

@media (min-width: 768px) {
  .contact {
    padding: 114px 0 140px;
  }

  .contact__head {
    gap: 24px;
  }

  .contact h2 {
    font-size: clamp(36px, 4.44vw, 64px);
    line-height: 1.05;
  }

  .contact__subline {
    font-size: 24px;
    line-height: 30px;
  }

  .contact__side {
    margin-top: 48px;
  }

  .contact__form {
    gap: 28px;
  }

  .contact__actions {
    align-items: flex-start;
    gap: 29px;
  }

  .contact__submit {
    width: 204px;
    height: 51px;
  }

  .contact__actions .contact__notice {
    width: 100%;
  }
}

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

.footer {
  display: flex;
  flex-direction: column;
  gap: 24px;
  padding: 28px var(--gutter) 36px;
  border-top: 1px solid var(--footer-rule);
  background: var(--bg-black);
}

.footer__brand {
  display: flex;
  align-items: center;
  gap: 14px;
}

.footer__mark {
  flex: none;
  width: 36px;
  height: 25px;
  color: var(--text);
}

.footer__copy {
  color: var(--text-4);
  font-family: var(--font-head);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 1px;
  line-height: 1.5;
}

/* On mobile the nav comes first, as the prototype has it. */
.footer__nav {
  order: -1;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px 12px;
  font-family: var(--font-head);
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 2px;
  line-height: 1.4;
}

/* The side nav's underline hover (.rail__nav a, above), drawn under the word only: below 768 px each
   link is a grid item, so it starts at its column's left and is only as wide as its word. No padding:
   the line sits at the foot of the link's box, and the rows keep their spacing (sprint 17). The hover
   itself is in "Hover states" below. */
.footer__nav a {
  justify-self: start;
  color: var(--text-3);
  text-decoration: none;
  white-space: nowrap;
  background-image: linear-gradient(currentColor, currentColor);
  background-position: 0 100%;
  background-repeat: no-repeat;
  background-size: 0 1px;
  transition: background-size var(--t1) var(--ease);
}

@media (max-width: 359px) {
  .footer__nav {
    grid-template-columns: minmax(0, 1fr);
  }
}

@media (min-width: 768px) {
  .footer {
    flex-direction: row;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 20px 28px;
    padding-bottom: 32px;
  }

  .footer__brand {
    gap: 20px;
  }

  .footer__mark {
    width: 44px;
    height: 30px;
  }

  .footer__nav {
    order: 0;
    display: flex;
    flex-wrap: wrap;
    gap: 12px 28px;
  }
}

@media (min-width: 1024px) {
  .footer {
    padding-left: var(--rail);
    padding-right: var(--rail);
  }
}

/* ---------- Short pages (404) ---------- */

/* Holds the footer at the bottom of a window taller than the page. */
body.page--short {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

body.page--short main {
  flex: 1 0 auto;
  background: var(--bg-black);
}

.hero--short {
  min-height: 0;
  display: block;
  padding-top: 120px;
  padding-bottom: 96px;
}

@media (min-width: 1024px) {
  .hero--short {
    padding-top: 200px;
    padding-bottom: 120px;
  }
}

/* ---------- Hover states (sprint 17) ----------
 * Only where the pointer can hover, so nothing sticks after a tap. The footer's links draw the side nav's
 * underline (their at-rest declarations are with .footer__nav a, above). The three Contact us CTAs show
 * at 75% at once, the prototype's a:hover{opacity:0.75}; the form's button matches them, and shows no
 * hover while it's disabled sending. The 404 page's CTA is not one of the three. */
@media (hover: hover) {
  .footer__nav a:hover {
    background-size: 100% 1px;
  }

  .hero__more .cta:hover,
  .start__between .cta:hover,
  .contact__submit:not(:disabled):hover {
    opacity: 0.75;
  }
}

/* ---------- The loader (sprint 14) ----------
 * docs/design/v10/README.md's section 0, the prototypes' ld-* and .rv CSS (docs/design/v10/design/), and
 * the Designer's note, docs/sprints/design/sprint-14-note.md. index.html's inline script puts the overlay
 * in, the first thing in the body, and marks <html> .is-loading; with no script there is neither. One
 * clock, t = 0 the overlay's first paint: the mark plays Josephine's 3.6 s (sprint 17: flicker to 0.1 s,
 * counter to 1.1 s, fade and snap to 1.6 s, then held), drawn by the script from that t = 0, and lifts;
 * at --t-loader-push (2.6 s) the overlay leaves upward as the page arrives from below, done at 3.1 s; the hero's parts wipe in from
 * --L (2.9 s) + their --d, the last done at 4.75 s. Every one of these is a CSS animation that ends by
 * itself, so nothing here hides the page past then if the script stops.
 *
 * Where this departs from the prototype's CSS, on purpose: the push holds no transform before it starts
 * or after it ends (no fill), and each wipe holds its start through its delay and then leaves no clip-path
 * (backwards). The overlay covers both until 2.6 s, so it looks the same; but a transform, even
 * translateY(0), would make main the box its fixed descendants are laid out in, and a finished wipe's
 * inset(... 0) would cut the left of a focus ring. A pinned stage fixed when the push starts (the
 * opening's, at the top of the page from 1024 x 640; any pin's, on a reload inside it) moves by itself
 * instead of main, for the same reason (.loader-stage, put on by the script). */

.loader {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  background-color: var(--cyan);
  animation: ld-up var(--t-push) var(--ease) var(--t-loader-push) forwards, loader-gone 0s calc(var(--t-loader-push) + var(--t-push)) forwards;
}

/* Once it has left (3.1 s), hidden too, by the stylesheet alone: the script takes it out of the document
   then, but nothing is left over the page if the script has stopped. */
@keyframes loader-gone {
  to {
    visibility: hidden;
  }
}

/* The mark: the window's width less 24 px either side, at most 420 px wide, below 1024 (the mobile
   prototype); 640 x 360 from 1024 (the desktop prototype); never taller than the window less 48 px. */
.loader svg {
  flex: none;
  width: min(420px, 100% - 48px, (100vh - 48px) * 16 / 9);
  height: auto;
  aspect-ratio: 16 / 9;
  transform: translateY(23px);
  animation: ld-ctr var(--t-loader) linear forwards;
}

@media (min-width: 1024px) {
  .loader svg {
    width: min(640px, (100vh - 48px) * 16 / 9);
  }
}

/* The counter's digits, the prototypes' rule. */
.ah11-n {
  font-family: 'Jost', sans-serif;
  font-weight: 700;
  font-size: 31px;
  letter-spacing: 1px;
  font-variant-numeric: tabular-nums;
}

/* The push: what the browser has landed on rises into place. Below 1024 the bar is fixed and stays (as in
   the mobile prototype, where it sits outside .ld-push); from 1024 it sits in the hero and rides up with it. */
.is-loading main,
.is-loading .footer,
.is-loading-pinned .loader-stage {
  animation: ld-in var(--t-push) var(--ease) var(--t-loader-push);
}

.is-loading-pinned main {
  animation: none;
}

/* The hero's reveal: each part wipes in left to right with 0.3 em of slack above and below; the Contact
   us button keeps the prototype's 40 px all round (rv-b), so its focus ring isn't cut. Below 1024 the
   bar's mark and MENU are the first part; from 1024 the hero's nav is, and the mark shows with the page. */
.is-loading .bar__mark,
.is-loading .menu-button,
.is-loading .bar__nav,
.is-loading .hero__label,
.is-loading .hero h1,
.is-loading .hero__intro,
.is-loading .hero__more .cta {
  animation: rv-in var(--t2) var(--ease) calc(var(--L) + var(--d)) backwards;
}

.is-loading .bar__mark,
.is-loading .menu-button,
.is-loading .bar__nav {
  --d: 0.2s;
}

.is-loading .hero__label {
  --d: 0.35s;
}

.is-loading .hero h1 {
  --d: 0.5s;
}

.is-loading .hero__intro {
  --d: 0.75s;
}

.is-loading .hero__more .cta {
  --d: 0.95s;
  animation-name: rv-b;
}

@media (min-width: 1024px) {
  .is-loading .bar {
    animation: ld-in var(--t-push) var(--ease) var(--t-loader-push);
  }

  .is-loading .bar__mark {
    animation: none;
  }
}

/* The prototypes' keyframes, unchanged but for ld-ctr's times (below). */
@keyframes ld-up {
  from {
    transform: translateY(0);
  }

  to {
    transform: translateY(-100vh);
  }
}

@keyframes ld-in {
  from {
    transform: translateY(100vh);
  }

  to {
    transform: translateY(0);
  }
}

/* The mark's lift, on Josephine's timeline (sprint 17), not the prototype's 31.5% and 45.5%: held to
   1.3 s, eased up to 1 px by 1.6 s of --t-loader's 3.6 s, with "head" and the slide to centre. */
@keyframes ld-ctr {
  0%,
  36.111% {
    transform: translateY(23px);
    animation-timing-function: cubic-bezier(0.16, 1, 0.3, 1);
  }

  44.444%,
  100% {
    transform: translateY(1px);
  }
}

@keyframes rv-in {
  from {
    clip-path: inset(-0.3em 100% -0.3em 0);
  }

  to {
    clip-path: inset(-0.3em -0.3em -0.3em 0);
  }
}

@keyframes rv-b {
  from {
    clip-path: inset(-40px 100% -40px -40px);
  }

  to {
    clip-path: inset(-40px -40px -40px -40px);
  }
}

/* ---------- Reduced motion ----------
 * Everything the navigation moves, it stops moving: in-page links jump instead of scrolling, the
 * menu's panel appears and goes without its slide, its links without their wipe, its marker without
 * its slide, the X without its turn, the bar's ground and the underline without their fades.
 * menu.js reads the same query, so a closing panel is hidden at once rather than after a slide.
 * The triangle field's shimmer never plays (sprint 9); field.js reads the query too, and its glow
 * goes off at once rather than fading. There is no loader (sprint 14). */
@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  .bar::before,
  .bar__mark,
  .bar__mark .mark__a,
  .menu-button,
  .menu-button__icon path,
  .menu,
  .menu__nav a,
  .menu__nav a::before,
  .menu__name,
  .bar__nav a,
  .rail__nav a,
  .footer__nav a {
    transition: none;
  }

  .menu__nav a {
    clip-path: none;
  }

  /* The deck's current dot widens at once. The deck (sprint 20) is still drawn stacked, but its cards and
     its text change places at once: no fly-off, no snap back, no coming forward. deck.js doesn't move the
     card with the finger under this query either, and motion.js counts nothing. */
  .dot span,
  .deck__card,
  .deck__text {
    transition: none;
  }

  /* No loader (sprint 14): no overlay, no push, no reveal; the page shows at once at its end state. The
     loader's script never puts the overlay in under this query, and ends the loader for good when it's
     switched on while playing, so these only hold the line until it does. (The first sweep: below.) */
  .loader {
    display: none;
  }

  .loader,
  .loader svg,
  .is-loading main,
  .is-loading .footer,
  .is-loading .bar,
  .is-loading-pinned .loader-stage,
  .is-loading .bar__mark,
  .is-loading .menu-button,
  .is-loading .bar__nav,
  .is-loading .hero__label,
  .is-loading .hero h1,
  .is-loading .hero__intro,
  .is-loading .hero__more .cta {
    animation: none;
  }

  /* The shimmer never plays: the band stays at rest off the left edge, and the field shows still.
     field.js never starts a sweep under this query either, the first one included. */
  .tri-field__sweep,
  .tri-field__sweep.is-sweeping {
    animation: none;
  }

  /* The three scroll sequences' own draws, wipes, slides, zooms and fades (sprints 10 to 12). motion.js
     builds none of them under this query, and takes their classes off when it's switched on while the
     page is open; these rules hold the same line in the stylesheet itself, so none can run under it
     (sprint 13, Requirement 1). */
  .motion-pin-what .rail--what .rail__mark,
  .motion-pin-what .rail--what .mark__a,
  .motion-pin-what .what h2,
  .motion-pin-what .what__steps,
  .motion-reveal-what .what h2,
  .motion-reveal-what .what__step > *,
  .motion-pin-start .start__line,
  .motion-pin-start .start__label,
  .motion-pin-start .start__path h3,
  .motion-pin-start .start__body,
  .motion-pin-start .start__between h3,
  .motion-pin-start .start__between p,
  .motion-pin-start .start__between .cta,
  .motion-reveal-start .start__loop path,
  .motion-reveal-start .start__arrow path,
  .motion-reveal-start .start__label,
  .motion-reveal-start .start__path h3,
  .motion-reveal-start .start__body,
  .motion-reveal-start .start__between h3,
  .motion-reveal-start .start__between p,
  .motion-reveal-start .start__between .cta,
  .motion-pin-work .case .stat,
  .motion-pin-work .case__frame,
  .motion-reveal-work .case .stat,
  .motion-reveal-work .case__frame,
  .motion-pin-work .case__image,
  .motion-reveal-work .case__image,
  .motion-pin-work .case__text .num,
  .motion-pin-work .case__text h3,
  .motion-pin-work .case__text p,
  .motion-reveal-work .case__text .num,
  .motion-reveal-work .case__text h3,
  .motion-reveal-work .case__text p,
  .motion-pin-work .stat__arrow,
  .motion-reveal-work .stat__arrow,
  .motion-pin-work .stat__to,
  .motion-reveal-work .stat__to,
  .motion-pin-work .stat__from,
  .motion-reveal-work .stat__from {
    transition: none;
  }
}
