/*
 * userstuck — one stylesheet.
 * A visit is a line, a user is a dot, stuck is the dip the dot cannot leave.
 * Colours are named by role; src/colour.ts carries the same values and a
 * test keeps the two together.
 */

@font-face {
  font-family: "Anybody";
  src: url("/fonts/anybody.woff2") format("woff2");
  font-weight: 100 900;
  font-stretch: 50% 150%;
  font-display: swap;
}

@font-face {
  font-family: "Instrument Sans";
  src: url("/fonts/instrument-sans.woff2") format("woff2");
  font-weight: 400 700;
  font-display: swap;
}

@font-face {
  font-family: "Instrument Sans";
  src: url("/fonts/instrument-sans-italic.woff2") format("woff2");
  font-weight: 400 700;
  font-style: italic;
  font-display: swap;
}

@font-face {
  font-family: "Geist Mono";
  src: url("/fonts/geist-mono.woff2") format("woff2");
  font-weight: 100 900;
  font-display: swap;
}

:root {
  --felt: #0c3a2d;
  --felt-deep: #082a20;
  --paper: #f6f0e4;
  --ink: #10201a;
  --dot: #ff6fae;
  --dot-ink: #b3125b;
  --mint: #bfe8d2;

  --display: "Anybody", "Arial Narrow", "Helvetica Neue", sans-serif;
  --text: "Instrument Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
  --mono: "Geist Mono", ui-monospace, "SF Mono", Menlo, monospace;

  --edge: max(1.25rem, calc((100vw - 76rem) / 2));
  --round: 1.25rem;
  --stroke: 2px;
}

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

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--felt);
  color: var(--paper);
  font-family: var(--text);
  font-size: 1.125rem;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  --line-ahead: rgb(246 240 228 / 0.38);
  --line-done: var(--mint);
  --quiet: var(--mint);
  --accent-text: var(--dot);
  --rule: rgb(246 240 228 / 0.18);
}

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

ol,
ul {
  list-style: none;
}

fieldset {
  border: 0;
  min-width: 0;
}

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

a {
  color: inherit;
}

:focus-visible {
  outline: 3px solid var(--dot);
  outline-offset: 3px;
}

code {
  font-family: var(--mono);
  font-size: 0.85em;
}

.skip {
  position: absolute;
  left: 1rem;
  top: -4rem;
  z-index: 10;
  padding: 0.5rem 1rem;
  border-radius: 999px;
  background: var(--paper);
  color: var(--ink);
}

.skip:focus {
  top: 1rem;
}

/* Words */

.display {
  font-family: var(--display);
  font-weight: 800;
  font-stretch: 80%;
  font-size: clamp(2.9rem, 9.2vw, 8rem);
  line-height: 0.9;
  letter-spacing: -0.015em;
  text-wrap: balance;
}

.display--2 {
  font-size: clamp(2.2rem, 5.4vw, 4.5rem);
  line-height: 0.95;
}

/* The word "stuck" never breaks, and its u is let out to full width to hold the dot. */
.stuck {
  white-space: nowrap;
}

.stuck-u {
  position: relative;
  display: inline-block;
  font-stretch: 150%;
  line-height: 1;
}

.stuck-u::after {
  content: "";
  position: absolute;
  left: 50%;
  bottom: 0.43em;
  width: 0.25em;
  height: 0.25em;
  margin-left: -0.125em;
  border-radius: 50%;
  background: var(--dot-here, var(--dot));
}

.label {
  font-family: var(--mono);
  font-size: 0.75rem;
  font-weight: 500;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: var(--quiet);
}

.lede {
  font-size: clamp(1.125rem, 1.6vw, 1.375rem);
  line-height: 1.45;
  max-width: 38em;
  text-wrap: pretty;
}

.small,
.aside {
  font-size: 0.9375rem;
  color: var(--quiet);
  max-width: 34em;
}

.site {
  font-family: var(--mono);
  font-size: 0.82em;
  font-weight: 500;
  letter-spacing: -0.02em;
  color: var(--accent-text);
  overflow-wrap: anywhere;
}

.pip {
  display: inline-block;
  width: 0.7em;
  height: 0.7em;
  border-radius: 50%;
  background: var(--dot);
}

/* Buttons */

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5em;
  min-height: 3rem;
  padding: 0.6rem 1.4rem;
  border: var(--stroke) solid currentColor;
  border-radius: 999px;
  background: none;
  color: inherit;
  font: 600 1.0625rem/1.2 var(--text);
  text-decoration: none;
  cursor: pointer;
  transition: transform 120ms ease;
}

.button:hover {
  transform: translateY(-2px);
}

.button:active {
  transform: translateY(1px);
}

.button--dot {
  border-color: var(--dot);
  background: var(--dot);
  color: var(--ink);
}

.button--big {
  min-height: 3.75rem;
  padding-inline: 2rem;
  font-size: 1.25rem;
}

.button--small {
  min-height: 2.5rem;
  padding: 0.3rem 1.1rem;
  font-size: 0.9375rem;
}

.link {
  padding: 0;
  border: 0;
  background: none;
  color: inherit;
  font: inherit;
  text-decoration: underline;
  text-decoration-thickness: 2px;
  text-underline-offset: 0.2em;
  text-decoration-color: var(--dot);
  cursor: pointer;
}

/* Header and footer */

.top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1.25rem var(--edge);
  background: var(--felt);
  color: var(--paper);
}

.top-mark img {
  height: 1.75rem;
  width: auto;
}

.top-nav {
  display: flex;
  align-items: center;
  gap: clamp(0.9rem, 2.4vw, 2rem);
  font-size: 0.9375rem;
}

.top-nav a:not(.button) {
  text-decoration: none;
}

.top-nav a:not(.button):hover {
  text-decoration: underline;
  text-decoration-color: var(--dot);
  text-decoration-thickness: 2px;
  text-underline-offset: 0.3em;
}

.foot {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 1.5rem 2rem;
  padding: 2.5rem var(--edge);
  background: var(--felt-deep);
  color: var(--paper);
  font-size: 0.9375rem;
  --quiet: var(--mint);
}

.foot-mark {
  height: 3rem;
  width: auto;
}

.foot p {
  max-width: 26em;
  color: var(--mint);
}

.foot nav {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1.5rem;
}

/* The line */

.line {
  width: 100%;
  height: auto;
  overflow: visible;
}

.line-ahead,
.line-done,
.line-goal {
  fill: none;
  stroke-width: 6;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.line-ahead {
  stroke: var(--line-ahead);
  stroke-dasharray: 1 15;
}

.line-done {
  stroke: var(--line-done);
  stroke-dasharray: 59 100;
}

.line-goal {
  stroke: var(--line-ahead);
  stroke-width: 5;
  fill: var(--ground, var(--felt));
}

.line-dot {
  fill: var(--dot-here, var(--dot));
}

.rail--evidence .line-done {
  stroke-dasharray: 81.8 100;
}

.rail--audit .line-done {
  stroke-dasharray: 96.5 100;
}

.rail {
  position: relative;
  padding-bottom: 2rem;
}

.rail-stations {
  position: relative;
  height: 1.2rem;
  margin-top: 0.4rem;
}

.rail-station {
  position: absolute;
  top: 0;
  transform: translateX(-50%);
  font-family: var(--mono);
  font-size: clamp(0.5625rem, 1.3vw, 0.75rem);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  white-space: nowrap;
  color: var(--line-ahead);
}

.rail-station--site {
  left: 0;
  transform: none;
}

.rail-station--goal {
  left: 22%;
}

.rail-station--try {
  left: 41%;
}

.rail-station--stuck {
  left: 60%;
}

.rail-station--evidence {
  left: 80%;
}

.rail-station--audit {
  left: 100%;
  transform: translateX(-100%);
}

.rail-station[aria-current] {
  color: var(--accent-text);
  font-weight: 700;
}

.rail--stuck .rail-station:nth-child(-n + 3),
.rail--evidence .rail-station:nth-child(-n + 4),
.rail--audit .rail-station:nth-child(-n + 5) {
  color: var(--quiet);
}

/* Hero */

.hero {
  padding: clamp(1.5rem, 5vw, 4.5rem) var(--edge) clamp(3rem, 6vw, 5.5rem);
}

.hero h1 {
  max-width: 11em;
}

.hero-line {
  margin: clamp(1rem, 2.5vw, 2rem) calc(var(--edge) * -1) clamp(1.5rem, 3vw, 2.5rem);
  padding-right: var(--edge);
  overflow: hidden;
}

.line--travelling .line-dot {
  offset-path: path("M-20 19H557Q571 19 571 40V70A29 29 0 0 0 629 70V40");
  offset-rotate: 0deg;
  offset-distance: 90%;
}

.hero-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.05fr);
  gap: clamp(2rem, 5vw, 5rem);
  align-items: start;
}

.try {
  padding: clamp(1.25rem, 2.5vw, 2rem);
  border-radius: var(--round);
  background: var(--felt-deep);
}

.try-title {
  margin-bottom: 1.1rem;
  font: 800 clamp(1.8rem, 3vw, 2.5rem) / 1 var(--display);
  font-stretch: 80%;
}

.try .small {
  margin-top: 1rem;
}

.hero--page {
  display: grid;
  gap: 1.5rem;
  justify-items: start;
  padding-bottom: clamp(3rem, 8vw, 7rem);
}

.hero--page .rail {
  width: 100%;
}

.hero--page h1 {
  max-width: 16em;
}

/* The asking form */

.ask {
  display: grid;
  gap: 1.1rem;
}

.ask-site {
  display: grid;
  gap: 0.4rem;
}

.ask input[type="text"] {
  width: 100%;
  min-height: 3.75rem;
  padding: 0.6rem 1.1rem;
  border: var(--stroke) solid var(--paper);
  border-radius: 0.9rem;
  background: var(--paper);
  color: var(--ink);
  font: 500 1.25rem/1.2 var(--mono);
  letter-spacing: -0.02em;
}

.ask input[type="text"]::placeholder {
  color: rgb(16 32 26 / 0.45);
}

.ask-goals {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.ask-goals legend {
  margin-bottom: 0.5rem;
}

.pill {
  position: relative;
  cursor: pointer;
}

.pill input {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
}

.pill span {
  display: inline-flex;
  align-items: center;
  gap: 0.5em;
  min-height: 2.75rem;
  padding: 0.4rem 1.1rem;
  border: var(--stroke) solid var(--rule);
  border-radius: 999px;
  font-weight: 500;
}

.pill span::before {
  content: "";
  width: 0.7em;
  height: 0.7em;
  border: var(--stroke) solid currentColor;
  border-radius: 50%;
}

.pill input:checked + span {
  border-color: var(--paper);
}

.pill input:checked + span::before {
  border-color: var(--dot);
  background: var(--dot);
}

.pill input:focus-visible + span {
  outline: 3px solid var(--dot);
  outline-offset: 3px;
}

.ask .button {
  justify-self: start;
}

/* The stage: stuck in a sketch, then the evidence */

.stage-slot:empty {
  display: none;
}

.stage {
  padding: clamp(2rem, 5vw, 4rem) var(--edge) clamp(3rem, 6vw, 5rem);
  background: var(--felt-deep);
  --ground: var(--felt-deep);
}

.stage-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  grid-template-areas: "words phone" "exit phone";
  grid-template-rows: auto 1fr;
  gap: 1.5rem clamp(2rem, 6vw, 6rem);
  align-items: start;
  margin-top: 1.5rem;
}

.stage-words {
  grid-area: words;
  display: grid;
  gap: 1rem;
}

.stage-exit {
  grid-area: exit;
  display: grid;
  gap: 1rem;
  justify-items: start;
}

.stage .phone {
  grid-area: phone;
}

.stage h2 {
  font: 800 clamp(1.9rem, 4vw, 3.4rem) / 1 var(--display);
  font-stretch: 80%;
  letter-spacing: -0.01em;
  max-width: 14em;
  text-wrap: balance;
}

.misses {
  display: flex;
  align-items: baseline;
  gap: 0.6rem;
  font-family: var(--mono);
  font-size: 0.875rem;
  color: var(--quiet);
}

.misses-count {
  font: 800 2.75rem/1 var(--display);
  font-stretch: 80%;
  color: var(--paper);
}

.misses.has-misses .misses-count {
  color: var(--dot);
}

.stage-head {
  display: grid;
  gap: 0.75rem;
  margin-top: 1.5rem;
}

.stage-grid--evidence {
  grid-template-columns: auto minmax(0, 1fr);
  grid-template-areas: "phone finding";
  grid-template-rows: auto;
  margin-top: 2.5rem;
}

.stage-grid--evidence .finding {
  grid-area: finding;
}

.stage-next {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr);
  gap: 1.5rem clamp(2rem, 5vw, 4rem);
  align-items: center;
  margin-top: clamp(2.5rem, 5vw, 4rem);
  padding-top: clamp(2rem, 4vw, 3rem);
  border-top: var(--stroke) solid var(--rule);
}

.stage-next h3 {
  font: 800 clamp(1.5rem, 2.8vw, 2.3rem) / 1.02 var(--display);
  font-stretch: 80%;
  margin-bottom: 0.75rem;
  text-wrap: balance;
}

.stage-actions {
  display: grid;
  gap: 1.25rem;
  justify-items: start;
}

.again {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem 1.1rem;
  font-size: 0.9375rem;
  color: var(--quiet);
}

.again .link {
  color: var(--paper);
}

/* The phone and its sketches */

.phone {
  width: 19.5rem;
  max-width: 100%;
  justify-self: center;
  color: var(--ink);
  --sk: rgb(16 32 26 / 0.16);
}

.phone-body {
  position: relative;
  border: 3px solid var(--ink);
  border-radius: 2rem;
  background: var(--paper);
  box-shadow: 0 0 0 0.5rem rgb(246 240 228 / 0.08);
}

.phone-bar {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  height: 2.6rem;
  padding: 0 1rem;
  border-bottom: var(--stroke) solid var(--sk);
  font-family: var(--mono);
  font-size: 0.75rem;
}

.phone-tag {
  padding: 0.1rem 0.5rem;
  border-radius: 999px;
  background: var(--ink);
  color: var(--paper);
  font-size: 0.625rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.phone-host {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.phone-screen {
  position: relative;
  height: 30rem;
  overflow: clip;
  border-radius: 0 0 1.8rem 1.8rem;
  font-size: 0.9375rem;
  user-select: none;
  -webkit-user-select: none;
  touch-action: manipulation;
}

.phone figcaption,
.phone-note {
  margin-top: 0.9rem;
  font-family: var(--mono);
  font-size: 0.75rem;
  line-height: 1.4;
  text-align: center;
}

.phone figcaption {
  color: var(--mint);
}

.phone-note {
  padding: 0.5rem 0.8rem;
  border-radius: 0.7rem;
  background: var(--dot);
  color: var(--ink);
  font-weight: 600;
}

.is-marked {
  outline: 3px solid var(--dot);
  outline-offset: 3px;
}

.tap {
  position: absolute;
  z-index: 5;
  width: 1.5rem;
  height: 1.5rem;
  margin: -0.75rem 0 0 -0.75rem;
  border-radius: 50%;
  background: var(--dot);
  pointer-events: none;
  opacity: 0;
}

.sk-title {
  font: 800 1.5rem/1.1 var(--display);
  font-stretch: 80%;
}

.sk-bars {
  display: grid;
  gap: 0.5rem;
  flex: 1;
}

.sk-bars i,
.sk-row i,
.sk-field {
  display: block;
  height: 0.6rem;
  border-radius: 999px;
  background: var(--sk);
}

.sk-bars i:nth-child(even) {
  width: 62%;
}

.sk-button {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.6rem;
  width: 100%;
  min-height: 3rem;
  border: 0;
  border-radius: 0.8rem;
  background: var(--ink);
  color: var(--paper);
  font: 600 1rem/1 var(--text);
  cursor: pointer;
}

/* Buy: a pinned banner covers the checkout button */

.sk-scroll {
  display: grid;
  align-content: start;
  gap: 1.1rem;
  height: 100%;
  padding: 1.1rem;
  overflow-y: auto;
  overscroll-behavior: contain;
}

.sk-item {
  display: flex;
  align-items: center;
  gap: 0.8rem;
}

.sk-thumb {
  width: 4.5rem;
  height: 4.5rem;
  border-radius: 0.7rem;
  background: var(--sk);
}

.sk-amount {
  font-family: var(--mono);
  font-size: 0.8125rem;
}

.sk-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 0.9rem;
  border-top: var(--stroke) solid var(--sk);
}

.sk-row i {
  width: 3.5rem;
}

.sk-row--total {
  font-weight: 700;
}

.sk-row--total i {
  height: 0.9rem;
  background: var(--ink);
}

.phone--buy .sk-scroll > .sk-bars {
  margin-block: 0.6rem 2.2rem;
}

.sk-banner {
  position: absolute;
  inset: auto 0 0 0;
  display: grid;
  gap: 0.35rem;
  height: 8.4rem;
  padding: 1rem 1.1rem;
  border-top: 3px solid var(--ink);
  background: rgb(191 232 210 / 0.9);
  cursor: default;
}

.sk-banner strong {
  font: 800 1.2rem/1.1 var(--display);
  font-stretch: 80%;
}

.sk-banner span {
  font-size: 0.8125rem;
}

.sk-field {
  height: 2rem;
  border: var(--stroke) solid var(--ink);
  border-radius: 0.5rem;
  background: var(--paper);
}

.sk-close {
  position: absolute;
  top: 0.5rem;
  right: -1.6rem;
  font-size: 1.5rem;
  line-height: 1;
}

.sk-banner.is-marked {
  outline-offset: -5px;
}

/* Book: the confirm button is below the screen and nothing scrolls */

.sk-behind {
  display: grid;
  gap: 1rem;
  padding: 1.1rem;
  opacity: 0.35;
}

.sk-dialog {
  position: absolute;
  inset: 2.6rem 0.75rem auto;
  display: grid;
  gap: 1rem;
  padding: 1rem;
  border: 3px solid var(--ink);
  border-radius: 1.1rem;
  background: var(--paper);
  box-shadow: 0 0 0 40rem rgb(16 32 26 / 0.35);
}

.sk-slots {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.6rem;
}

.sk-slot {
  min-height: 3.5rem;
  border: var(--stroke) solid var(--ink);
  border-radius: 0.7rem;
  background: none;
  color: var(--ink);
  font: 500 0.9375rem/1 var(--mono);
  cursor: pointer;
}

.sk-slot[aria-pressed="true"] {
  background: var(--ink);
  color: var(--paper);
}

.phone--book.is-revealed .phone-screen {
  overflow: visible;
}

.phone--book.is-revealed .phone-body {
  margin-bottom: 11rem;
}

.phone--book.is-revealed .sk-dialog {
  box-shadow: none;
}

/* Sign up: the button spins for ever */

.sk-form {
  display: grid;
  align-content: start;
  gap: 1rem;
  height: 100%;
  padding: 1.1rem;
}

.sk-input {
  display: grid;
  gap: 0.25rem;
}

.sk-input span {
  font-size: 0.75rem;
  font-weight: 600;
}

.sk-input b {
  display: flex;
  align-items: center;
  min-height: 2.75rem;
  padding: 0 0.8rem;
  border: var(--stroke) solid var(--ink);
  border-radius: 0.7rem;
  font: 500 0.8125rem/1 var(--mono);
}

.sk-spinner,
.sk-button-wait {
  display: none;
}

.sk-button.is-waiting {
  background: rgb(16 32 26 / 0.55);
  cursor: progress;
}

.sk-button.is-waiting .sk-button-label {
  display: none;
}

.sk-button.is-waiting .sk-button-wait {
  display: inline;
}

.sk-button.is-waiting .sk-spinner {
  display: block;
  width: 1.1rem;
  height: 1.1rem;
  border: 3px solid rgb(246 240 228 / 0.35);
  border-top-color: var(--paper);
  border-radius: 50%;
}

/* A finding */

.finding {
  padding: clamp(1.25rem, 3vw, 2.25rem);
  border-radius: var(--round);
  background: var(--paper);
  color: var(--ink);
  --quiet: rgb(16 32 26 / 0.68);
  --accent-text: var(--dot-ink);
}

.finding-head {
  display: grid;
  gap: 0.6rem;
  padding-bottom: 1.25rem;
}

.finding-head .label {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  color: var(--dot-ink);
}

.finding h3 {
  font: 800 clamp(1.7rem, 3vw, 2.5rem) / 1 var(--display);
  font-stretch: 80%;
}

.finding-parts > div {
  display: grid;
  grid-template-columns: 8.5rem minmax(0, 1fr);
  gap: 0.25rem 1rem;
  padding: 0.9rem 0;
  border-top: var(--stroke) solid rgb(16 32 26 / 0.12);
}

.finding dt {
  padding-top: 0.25em;
  font-family: var(--mono);
  font-size: 0.75rem;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: var(--quiet);
}

.trace {
  display: grid;
  gap: 0.3rem;
  font-family: var(--mono);
  font-size: 0.8125rem;
  line-height: 1.45;
}

.trace li {
  display: grid;
  grid-template-columns: 3.2rem minmax(0, 1fr);
  gap: 0.5rem;
}

.trace time {
  color: var(--quiet);
}

.trace .is-stuck {
  color: var(--dot-ink);
  font-weight: 600;
}

.trace .is-stuck time {
  color: inherit;
}

.finding-media {
  margin-top: 0.7rem;
  font-family: var(--mono);
  font-size: 0.75rem;
  color: var(--quiet);
}

.finding-foot {
  margin-top: 0.5rem;
  padding-top: 0.9rem;
  border-top: var(--stroke) dashed rgb(16 32 26 / 0.3);
  font-family: var(--mono);
  font-size: 0.75rem;
  color: var(--quiet);
}

/* Bands */

.band {
  padding: clamp(3.5rem, 8vw, 7.5rem) var(--edge);
}

.band--paper,
.ground-paper main {
  background: var(--paper);
  color: var(--ink);
  --quiet: rgb(16 32 26 / 0.68);
  --accent-text: var(--dot-ink);
  --rule: rgb(16 32 26 / 0.14);
  --line-ahead: rgb(16 32 26 / 0.4);
  --line-done: var(--felt);
  --ground: var(--paper);
}

.band--paper .label,
.ground-paper .hero .label {
  color: var(--dot-ink);
}

.band--paper + .band--paper {
  padding-top: 0;
}

.band--felt {
  background: var(--felt);
  color: var(--paper);
  --quiet: var(--mint);
  --accent-text: var(--dot);
  --rule: rgb(246 240 228 / 0.18);
  --line-ahead: rgb(246 240 228 / 0.38);
  --line-done: var(--mint);
  --ground: var(--felt);
}

.band--felt + .band--felt {
  padding-top: 0;
}

.band-head {
  display: grid;
  gap: 1rem;
  margin-bottom: clamp(2rem, 4vw, 3.5rem);
}

.band-head h2 {
  max-width: 14em;
}

/* How it works: four stations on a line, the last one in the dip */

.steps {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.step {
  position: relative;
  padding: 2.75rem 1.5rem 0 0;
  border-top: 5px solid var(--felt);
}

.step h3 {
  margin-bottom: 0.5rem;
  font: 800 1.5rem/1.05 var(--display);
  font-stretch: 80%;
}

.step p {
  font-size: 1rem;
  color: var(--quiet);
}

.step-mark {
  position: absolute;
  top: -0.9rem;
  left: 0;
  width: 1.5rem;
  height: 1.5rem;
  border: 5px solid var(--felt);
  border-radius: 50%;
  background: var(--paper);
}

.step--dip {
  border-top-style: dotted;
  border-top-color: rgb(16 32 26 / 0.4);
}

.step--dip .step-mark {
  top: -5px;
  left: -5px;
  width: 3.4rem;
  height: 2.5rem;
  border-top: 0;
  border-radius: 0 0 1.7rem 1.7rem;
}

.step--dip .step-mark::after {
  content: "";
  position: absolute;
  left: 50%;
  bottom: 0.15rem;
  width: 1.3rem;
  height: 1.3rem;
  margin-left: -0.65rem;
  border-radius: 50%;
  background: var(--dot);
}

/* The report */

.parts {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0 2rem;
  counter-reset: part;
}

.parts li {
  padding: 1.25rem 0 1.5rem;
  border-top: var(--stroke) solid var(--ink);
  counter-increment: part;
}

.parts li::before {
  content: "0" counter(part);
  font-family: var(--mono);
  font-size: 0.75rem;
  color: var(--dot-ink);
}

.parts h3 {
  margin: 0.3rem 0 0.35rem;
  font: 800 1.6rem/1.05 var(--display);
  font-stretch: 80%;
}

.parts p {
  font-size: 1rem;
  color: var(--quiet);
}

.endings {
  margin-top: clamp(2.5rem, 5vw, 4rem);
  padding: clamp(1.5rem, 3vw, 2.5rem);
  border-radius: var(--round);
  background: var(--felt);
  color: var(--paper);
}

.endings-title {
  margin-bottom: 1.5rem;
  font: 800 clamp(1.4rem, 2.4vw, 2rem) / 1.05 var(--display);
  font-stretch: 80%;
}

.endings dl {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 1.5rem 2rem;
}

.ending dt {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.4rem;
  font-weight: 700;
}

.ending dt::before {
  content: "";
  flex: none;
  width: 0.8rem;
  height: 0.8rem;
  border: var(--stroke) solid var(--mint);
  border-radius: 50%;
}

.ending--stuck dt::before {
  border-color: var(--dot);
  background: var(--dot);
}

.ending dd {
  font-size: 0.9375rem;
  color: var(--mint);
}

/* Manners and places */

.manners {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0 3rem;
}

.manners li {
  position: relative;
  padding: 1rem 0 1rem 2.4rem;
  border-top: var(--stroke) solid var(--rule);
}

.manners li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 1.75rem;
  width: 1.5rem;
  height: 0.25rem;
  border-radius: 999px;
  background: var(--mint);
}

.manners--short {
  grid-template-columns: minmax(0, 1fr);
  max-width: 40rem;
  width: 100%;
}

.places {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
}

.places li {
  display: flex;
  align-items: baseline;
  gap: 0.6rem;
  padding: 0.55rem 1.1rem;
  border: var(--stroke) solid var(--rule);
  border-radius: 999px;
}

.places em {
  font-family: var(--mono);
  font-size: 0.75rem;
  font-style: normal;
  color: var(--mint);
}

/* Closing */

.band--dot {
  background: var(--dot);
  color: var(--felt);
  --dot-here: var(--paper);
  --line-ahead: rgb(12 58 45 / 0.5);
  --line-done: var(--felt);
  --quiet: var(--ink);
  --ground: var(--dot);
}

.closing {
  display: grid;
  gap: clamp(1.5rem, 3vw, 2.5rem);
}

.closing .ask {
  grid-template-columns: minmax(0, 28rem) auto;
  justify-content: start;
  align-items: end;
}

.closing .ask input[type="text"] {
  border-color: var(--felt);
}

.closing .button--dot {
  border-color: var(--felt);
  background: var(--felt);
  color: var(--paper);
}

/* The brand guide */

.guide .rules {
  display: grid;
  gap: 0.5rem;
  max-width: 44rem;
  margin-top: 2rem;
}

.guide .rules li {
  position: relative;
  padding-left: 1.6rem;
}

.guide .rules li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.55em;
  width: 0.55rem;
  height: 0.55rem;
  border-radius: 50%;
  background: var(--dot);
}

.marks {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1.5rem;
}

.marks li {
  display: grid;
  gap: 0.6rem;
}

.mark {
  position: relative;
  display: block;
  aspect-ratio: 16 / 9;
  border: var(--stroke) solid var(--rule);
  border-radius: var(--round);
}

.mark img {
  position: absolute;
  inset: 18% 14%;
  width: 72%;
  height: 64%;
  object-fit: contain;
}

.mark--felt {
  background: var(--felt);
}

.mark--paper {
  background: var(--paper);
}

.mark--dot {
  background: var(--dot);
}

.swatches {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(9.5rem, 1fr));
  gap: 1.25rem;
}

.swatch {
  display: grid;
  gap: 0.2rem;
  align-content: start;
}

.swatch-chip {
  height: 7rem;
  margin-bottom: 0.5rem;
  border: var(--stroke) solid var(--rule);
  border-radius: var(--round);
}

.swatch p {
  font-size: 0.875rem;
  color: var(--quiet);
}

.swatch--felt .swatch-chip {
  background: var(--felt);
}

.swatch--feltDeep .swatch-chip {
  background: var(--felt-deep);
}

.swatch--paper .swatch-chip {
  background: var(--paper);
}

.swatch--ink .swatch-chip {
  background: var(--ink);
}

.swatch--dot .swatch-chip {
  border-radius: 50%;
  width: 7rem;
  background: var(--dot);
}

.swatch--dotInk .swatch-chip {
  background: var(--dot-ink);
}

.swatch--mint .swatch-chip {
  background: var(--mint);
}

.pairings,
.voice {
  width: 100%;
  margin-top: 2.5rem;
  border-collapse: collapse;
  font-size: 1rem;
  text-align: left;
}

.pairings caption {
  margin-bottom: 0.75rem;
  text-align: left;
}

.pairings th,
.pairings td,
.voice th,
.voice td {
  padding: 0.6rem 1rem 0.6rem 0;
  border-top: var(--stroke) solid var(--rule);
  font-weight: 400;
  vertical-align: middle;
}

.pairing {
  display: inline-block;
  padding: 0.3rem 0.9rem;
  border-radius: 0.5rem;
  font-weight: 600;
}

.pairing--paper-on-felt { background: var(--felt); color: var(--paper); }
.pairing--paper-on-feltDeep { background: var(--felt-deep); color: var(--paper); }
.pairing--mint-on-felt { background: var(--felt); color: var(--mint); }
.pairing--dot-on-felt { background: var(--felt); color: var(--dot); }
.pairing--dot-on-feltDeep { background: var(--felt-deep); color: var(--dot); }
.pairing--ink-on-paper { background: var(--paper); color: var(--ink); box-shadow: inset 0 0 0 2px var(--rule); }
.pairing--felt-on-paper { background: var(--paper); color: var(--felt); box-shadow: inset 0 0 0 2px var(--rule); }
.pairing--dotInk-on-paper { background: var(--paper); color: var(--dot-ink); box-shadow: inset 0 0 0 2px var(--rule); }
.pairing--felt-on-dot { background: var(--dot); color: var(--felt); }
.pairing--ink-on-dot { background: var(--dot); color: var(--ink); }
.pairing--ink-on-mint { background: var(--mint); color: var(--ink); }

.types {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 2rem;
}

.type {
  display: grid;
  gap: 0.75rem;
  align-content: start;
  padding-top: 1.25rem;
  border-top: var(--stroke) solid var(--ink);
}

.type > p:last-child {
  font-size: 1rem;
  color: var(--quiet);
}

.type-display {
  font: 800 3rem/0.95 var(--display);
  font-stretch: 80%;
}

.type-wide {
  font-stretch: 150%;
  color: var(--dot-ink);
}

.type-text {
  font-size: 1.5rem;
  line-height: 1.3;
}

.type-mono {
  font-family: var(--mono);
  font-size: 1.125rem;
}

.lines {
  display: grid;
  gap: 1.5rem;
}

.voice th {
  font-family: var(--mono);
  font-size: 0.75rem;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: var(--dot-ink);
  border-top: 0;
}

.voice td {
  width: 50%;
  vertical-align: top;
}

.voice td:last-child {
  color: var(--quiet);
  text-decoration: line-through;
  text-decoration-color: var(--dot);
}

/* Narrow screens */

@media (max-width: 60rem) {
  .hero-grid,
  .stage-next,
  .types {
    grid-template-columns: minmax(0, 1fr);
  }

  .stage-grid {
    grid-template-columns: minmax(0, 1fr);
    grid-template-areas: "words" "phone" "exit";
  }

  .stage-grid--evidence {
    grid-template-areas: "phone" "finding";
  }

  .steps {
    grid-template-columns: minmax(0, 1fr);
    padding-left: 1rem;
  }

  .step {
    padding: 0 0 2.25rem 2.25rem;
    border-top: 0;
    border-left: 5px solid var(--felt);
  }

  .step-mark {
    top: 0;
    left: -0.9rem;
  }

  .step--dip {
    padding-bottom: 0;
    border-left-style: dotted;
    border-left-color: rgb(16 32 26 / 0.4);
  }

  .step--dip .step-mark {
    top: -0.3rem;
    left: -1.85rem;
  }

  .step--dip h3 {
    padding-top: 2.6rem;
  }

  .parts,
  .endings dl,
  .marks {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .manners {
    grid-template-columns: minmax(0, 1fr);
  }

  .foot {
    grid-template-columns: minmax(0, 1fr);
  }
}

@media (max-width: 40rem) {
  body {
    font-size: 1.0625rem;
  }

  .top-nav a:not(.button) {
    display: none;
  }

  .rail-station:not([aria-current]) {
    display: none;
  }

  .rail-station {
    font-size: 0.6875rem;
  }

  .hero-line .line {
    width: 190%;
    max-width: none;
    margin-left: -78%;
  }

  .parts,
  .endings dl,
  .marks {
    grid-template-columns: minmax(0, 1fr);
  }

  .finding-parts > div {
    grid-template-columns: minmax(0, 1fr);
  }

  .closing .ask {
    grid-template-columns: minmax(0, 1fr);
  }

  .pairings td:nth-child(2) {
    display: none;
  }
}

/* Motion: one story. The dot rolls, drops, tries to climb out, and is released. */

@media (prefers-reduced-motion: no-preference) {
  .line--travelling .line-dot {
    animation: travel 7s linear 0.4s both;
  }

  .line--travelling .line-done {
    animation: trail 7s linear 0.4s both;
  }

  .rail--stuck .line-dot {
    animation: drop 0.9s cubic-bezier(0.5, 0, 0.7, 0.4) both;
  }

  .rail--stuck.is-bumping .line-dot {
    animation: bump 0.5s ease-out;
  }

  .rail--evidence .line-dot,
  .rail--audit .line-dot {
    animation: release 1.1s cubic-bezier(0.2, 0.7, 0.2, 1) both;
  }

  .rail--evidence .line-done {
    animation: mend 1.1s ease-out both;
  }

  .tap {
    animation: tap 0.6s ease-out;
  }

  .sk-button.is-waiting .sk-spinner {
    animation: spin 0.9s linear infinite;
  }

  .misses.is-counting .misses-count {
    animation: count 0.3s ease-out;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  .button {
    transition: none;
  }
}

@keyframes travel {
  0% { offset-distance: 0%; animation-timing-function: cubic-bezier(0.3, 0.1, 0.6, 1); }
  52% { offset-distance: 76%; animation-timing-function: cubic-bezier(0.6, 0, 0.9, 0.5); }
  60% { offset-distance: 90%; animation-timing-function: ease-out; }
  68% { offset-distance: 97.5%; animation-timing-function: ease-in; }
  75% { offset-distance: 90%; animation-timing-function: ease-out; }
  81% { offset-distance: 95%; animation-timing-function: ease-in; }
  87% { offset-distance: 90%; animation-timing-function: ease-out; }
  91% { offset-distance: 92.5%; animation-timing-function: ease-in; }
  95%, 100% { offset-distance: 90%; }
}

@keyframes trail {
  0% { stroke-dasharray: 0 100; animation-timing-function: cubic-bezier(0.3, 0.1, 0.6, 1); }
  52% { stroke-dasharray: 50 100; }
  60%, 100% { stroke-dasharray: 59 100; }
}

@keyframes drop {
  0% { transform: translate(-70px, -80px); }
  60% { transform: translate(-29px, -55px); }
  100% { transform: translate(0, 0); }
}

@keyframes bump {
  0% { transform: translate(0, 0); }
  40% { transform: translate(27px, -22px); }
  100% { transform: translate(0, 0); }
}

@keyframes release {
  0% { transform: translate(-200px, 80px); }
  30% { transform: translate(-171px, 50px); }
  50% { transform: translate(-160px, 0); }
  100% { transform: translate(0, 0); }
}

@keyframes mend {
  0% { stroke-dasharray: 59 100; }
  100% { stroke-dasharray: 81.8 100; }
}

@keyframes tap {
  0% { opacity: 0.9; transform: scale(0.4); }
  100% { opacity: 0; transform: scale(2.2); }
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

@keyframes count {
  0% { transform: translateY(-0.2em); }
  100% { transform: translateY(0); }
}
