/* Dockmule marketing site. Follows DESIGN.md (the Ticket Wallet), its marketing
   layer: ink bars, dock-yellow fields, paper grain, perforations, coupons that
   print and slide. Every DESIGN.md frontmatter token is a custom property of
   the same name. Motion is in the @media (prefers-reduced-motion:
   no-preference) blocks, so every move rests at its finished state without it. */

@font-face {
  font-family: "Barlow";
  font-weight: 400;
  font-display: swap;
  src: url("/fonts/Barlow-Regular.woff2") format("woff2");
}

@font-face {
  font-family: "Barlow";
  font-weight: 600;
  font-display: swap;
  src: url("/fonts/Barlow-SemiBold.woff2") format("woff2");
}

@font-face {
  font-family: "Barlow Condensed";
  font-weight: 600;
  font-display: swap;
  src: url("/fonts/BarlowCondensed-SemiBold.woff2") format("woff2");
}

@font-face {
  font-family: "Barlow Condensed";
  font-weight: 700;
  font-display: swap;
  src: url("/fonts/BarlowCondensed-Bold.woff2") format("woff2");
}

@font-face {
  font-family: "IBM Plex Mono";
  font-weight: 500;
  font-display: swap;
  src: url("/fonts/IBMPlexMono-Medium.woff2") format("woff2");
}

:root {
  /* colors */
  --ink: #1D1B16;
  --ink-2: #53524D;
  --on-ink: #E6E1D6;
  --stock: #F2F2F0;
  --coupon: #FFFFFF;
  --hair: #D5D4CF;
  --carbon: #4B2E83;
  --copy: #E3D8F5;
  --void: #C4301C;
  --dock: #FFC61A;
  --fresh: #FFF6D6;
  --ink-line: #3A3833;
  --ink-mute: #9C9A93;
  --dock-hi: #FFD24D;
  --dock-lo: #F2B800;
  --on-dock-2: #3A3628;

  /* typography, as font shorthands: weight size/line-height family */
  --display: 700 clamp(56px, 6.4vw, 96px) / 0.86 "Barlow Condensed", sans-serif;
  --headline: 700 21px / 1.2 "Barlow Condensed", sans-serif;
  --title: 600 18px / 1.5 Barlow, sans-serif;
  --lede: 400 20px / 1.5 Barlow, sans-serif;
  --body: 400 16px / 1.5 Barlow, sans-serif;
  --body-sm: 400 14px / 1.5 Barlow, sans-serif;
  --control: 600 16px / 1.2 "Barlow Condensed", sans-serif;
  --label: 600 13px / 1.2 "Barlow Condensed", sans-serif;
  --stamp: 700 17px / 1.2 "Barlow Condensed", sans-serif;
  --figure: 500 18px / 1.5 "IBM Plex Mono", monospace;
  --figure-total: 500 30px / 1.1 "IBM Plex Mono", monospace;
  --claim: 700 28px / 1.05 "Barlow Condensed", sans-serif;
  --section-title: 700 clamp(44px, 5vw, 72px) / 0.95 "Barlow Condensed", sans-serif;

  /* rounded and spacing */
  --none: 0px;
  --row: 10px;
  --cell: 18px;
  --gutter: 32px;
  --section: 56px;

  /* paper shadows by elevation, the ink button's hard key, the slot's edge */
  --shadow-coupon: 0 14px 34px -22px rgba(29, 27, 22, 0.55);
  --shadow-stub: 0 8px 20px -14px rgba(29, 27, 22, 0.5);
  --shadow-popover: 0 14px 34px -18px rgba(29, 27, 22, 0.6);
  --sheet-1: 0 1px 0 var(--hair), 0 8px 20px -14px rgba(29, 27, 22, 0.5);
  --sheet-2: 0 1px 0 rgba(29, 27, 22, 0.08), 0 14px 34px -22px rgba(29, 27, 22, 0.55);
  --sheet-3: 0 2px 0 rgba(29, 27, 22, 0.06), 0 28px 60px -30px rgba(29, 27, 22, 0.6), 0 10px 18px -12px rgba(29, 27, 22, 0.35);
  --key: 4px 4px 0 rgba(29, 27, 22, 0.22);
  --key-hover: 6px 6px 0 rgba(29, 27, 22, 0.26);
  --feeder-slot: 0 6px 10px -6px rgba(29, 27, 22, 0.7);

  /* easings */
  --ease-stamp: cubic-bezier(0.16, 1, 0.3, 1);
  --out-expo: cubic-bezier(0.16, 1, 0.3, 1);
  --out-quart: cubic-bezier(0.25, 1, 0.5, 1);
  --out-back-soft: cubic-bezier(0.34, 1.36, 0.64, 1);
  --in-out: cubic-bezier(0.65, 0, 0.35, 1);

  /* two colours the prose names without a token: the ISSUED stamp's translucent
     white ground, and the carbon copy's dot texture (carbon at 18% alpha) */
  --stamp-ground: rgba(255, 255, 255, 0.72);
  --carbon-dot: rgba(75, 46, 131, 0.18);

  color-scheme: light;
  accent-color: var(--carbon);
  caret-color: var(--carbon);
}

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

body {
  margin: 0;
  background: var(--stock);
  color: var(--ink);
  font: var(--body);
  font-variant-numeric: tabular-nums;
  -webkit-font-smoothing: antialiased;
}

/* Paper grain over the whole page: one raster tile made for Dockmule, laid
   over everything at multiply, never drawn by a filter. */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 60;
  pointer-events: none;
  background: url("/img/grain.png") repeat;
  background-size: 256px;
  mix-blend-mode: multiply;
  opacity: 0.26;
}

a {
  color: inherit;
}

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

/* Focus: a 3px carbon outline at 2px offset; on the ink bar it is dock. */
:focus-visible {
  outline: 3px solid var(--carbon);
  outline-offset: 2px;
}

.top-bar :focus-visible,
.claims :focus-visible {
  outline-color: var(--dock);
  outline-offset: 3px;
}

::selection {
  background: var(--dock);
  color: var(--ink);
}

/* Marketing top bar: 64px ink, the logo for dark grounds, nav links that
   underline in dock on hover, and a dock "Ask for a pilot" button. */
.top-bar {
  position: relative;
  z-index: 5;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px 24px;
  min-height: 64px;
  padding: 0 var(--gutter);
  background: var(--ink);
  color: var(--on-ink);
}

.top-bar-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 28px;
}

.top-bar nav {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 24px;
}

.top-bar nav a {
  padding: 6px 0;
  background: linear-gradient(var(--dock), var(--dock)) no-repeat 0 100% / 0 2px;
  color: var(--on-ink);
  font: var(--control);
  font-size: 17px;
  letter-spacing: 0.02em;
  text-decoration: none;
  transition: background-size 150ms var(--out-quart);
}

.top-bar nav a:hover {
  background-size: 100% 2px;
}

.top-bar .button {
  min-height: 40px;
  padding: 0 16px;
  font-size: 17px;
}

.logo {
  display: block;
  line-height: 0;
}

.logo img {
  display: block;
  width: 139px;
  height: auto;
}

/* Reading width for every section after the hero. */
.section {
  max-width: 1500px;
  margin: 0 auto;
}

/* The generic hero: the 404 page's two columns. The home page's own hero is
   #hero, further down. */
.hero {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr);
  column-gap: var(--section);
  row-gap: var(--gutter);
  align-items: start;
  max-width: 1500px;
  margin: 0 auto;
  padding: var(--section) 48px;
}

h1 {
  margin: 0 0 var(--gutter);
  max-width: 14ch;
  font: var(--display);
  letter-spacing: 0;
  text-transform: uppercase;
  text-wrap: balance;
}

.lede {
  margin: 0 0 var(--gutter);
  max-width: 46ch;
  font: var(--lede);
}

.cta-note {
  margin: 16px 0 0;
  max-width: 46ch;
  color: var(--ink-2);
  font: var(--body-sm);
}

/* ---------- the home page's hero: a dock-yellow field and the desk ---------- */
#hero {
  position: relative;
  max-width: none;
  margin: 0;
  padding: 0;
  grid-template-columns: 5fr 7fr;
  column-gap: 0;
  row-gap: 0;
  align-items: stretch;
  min-height: min(calc(100svh - 64px), 820px);
  overflow-x: clip;
}

#hero .hero-copy {
  position: relative;
  z-index: 2;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 22px;
  padding: clamp(32px, 3.6vw, 52px) clamp(24px, 4vw, 56px) 72px var(--gutter);
  background: var(--dock);
}

#hero h1 {
  margin: 0;
  max-width: none;
}

#hero .lede {
  margin: 0;
  max-width: min(34em, 440px);
}

#hero .cta-row {
  margin: 4px 0 0;
}

#hero .cta-note {
  margin: 0;
  max-width: 300px;
  color: var(--on-dock-2);
}

.hero-desk {
  position: relative;
  min-height: 640px;
  padding: 40px 32px 0 48px;
  background: linear-gradient(90deg, rgba(29, 27, 22, 0.07), transparent 22px), var(--stock);
  overflow: hidden;
}

/* The feeder: a ticket slot at the top; the coupon feeds down out of it. */
.feeder {
  position: relative;
  z-index: 2;
  width: min(404px, 100%);
}

.slot {
  position: relative;
  z-index: 3;
  height: 22px;
  margin: 0 -16px;
  background: var(--ink);
  box-shadow: var(--feeder-slot);
}

.slot span {
  position: absolute;
  right: 14px;
  bottom: 5px;
  left: 14px;
  height: 3px;
  background: #000;
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.12);
}

.feed-window {
  margin: 0 -48px -72px;
  padding: 0 48px 72px;
  overflow: hidden;
}

/* The hero coupon is the trace demo's sample sheet at feeder width: one line
   at a time, the working under the charge, a scalloped foot. */
#hero-coupon .demo-sheet {
  display: block;
  max-width: none;
}

#hero-coupon .invoice {
  border: 0;
  outline: 1.5px solid var(--ink);
  outline-offset: -1.5px;
  box-shadow: var(--sheet-3);
  padding-bottom: 6px;
}

#hero-coupon .invoice::after {
  content: "";
  position: absolute;
  right: 0;
  bottom: -7px;
  left: 0;
  height: 7px;
  background: radial-gradient(circle at 7px 0, transparent 4px, var(--coupon) 4.5px) repeat-x 0 0 / 14px 7px;
}

#hero-coupon .coupon-head {
  border-bottom: 1px solid var(--hair);
}

#hero-coupon .initials {
  width: 64px;
  color: var(--dock);
  font: 700 24px / 1 "Barlow Condensed", sans-serif;
  letter-spacing: 0.04em;
}

#hero-coupon .head-text {
  padding: 12px 16px;
}

#hero-coupon .client {
  font: 700 22px / 1.15 "Barlow Condensed", sans-serif;
  letter-spacing: 0;
  text-transform: none;
}

/* The stamp below says ISSUED, with the number, in text. */
#hero-coupon .status {
  display: none;
}

#hero-coupon .meta {
  padding: 10px 16px;
  border-bottom: 1px dashed var(--hair);
}

#hero-coupon .sample-label {
  border: 1px solid var(--hair);
  background: transparent;
  color: var(--ink-2);
}

#hero-coupon .stamp-issued {
  top: 100px;
  right: 18px;
  font-size: 30px;
}

#hero-coupon .lines,
#hero-coupon .lines tbody,
#hero-coupon .lines tfoot {
  display: block;
}

#hero-coupon .lines thead {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
}

#hero-coupon .lines tr {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  grid-template-areas:
    "charge net"
    "working working";
  border-bottom: 1px solid var(--hair);
}

#hero-coupon .lines tr > :nth-child(1) {
  grid-area: charge;
}

#hero-coupon .lines tr > :nth-child(2) {
  grid-area: working;
  padding-top: 0;
  font-size: 14px;
}

#hero-coupon .lines tr > :nth-child(3) {
  grid-area: net;
}

#hero-coupon .lines td,
#hero-coupon .lines tfoot th {
  padding: 10px 16px;
  border-bottom: 0;
}

#hero-coupon .lines tr > :nth-child(2) {
  padding-bottom: 12px;
}

/* One working at a time: a line's working shows once its trace is open. The
   others stay in the page for a screen reader, clipped, and open with the line. */
#hero-coupon [data-line]:not(:has(details[open])) .working {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

#hero-coupon .trace ul {
  padding-left: 20px;
}

#hero-coupon .lines tbody {
  margin-top: 8px;
  border-top: 1px solid var(--hair);
}

#hero-coupon .lines .net {
  color: var(--ink);
  font-size: 18px;
}

#hero-coupon .lines tfoot tr {
  border-top: 2px solid var(--ink);
  border-bottom: 0;
}

#hero-coupon .lines tfoot .net {
  color: var(--carbon);
  font: 500 28px / 1.1 "IBM Plex Mono", monospace;
}

/* The traced line: filled with fresh, and its working open beneath it. */
#hero-coupon [data-line]:has(details[open]) {
  background: var(--fresh);
}

#hero-coupon .working {
  color: var(--carbon);
}

/* The source stubs the trace reaches: the events, and the rate card. */
.sources {
  position: absolute;
  top: 150px;
  right: 28px;
  z-index: 2;
  display: grid;
  gap: 96px;
  width: 184px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.src {
  position: relative;
  padding: 12px 14px 12px 22px;
  background: var(--coupon);
  box-shadow: var(--sheet-2);
  outline: 1.5px solid var(--ink);
  outline-offset: -1.5px;
  -webkit-mask: radial-gradient(circle at 0 50%, transparent 7px, #000 7.5px);
  mask: radial-gradient(circle at 0 50%, transparent 7px, #000 7.5px);
}

.src::before {
  content: "";
  position: absolute;
  top: 10px;
  bottom: 10px;
  left: 10px;
  width: 0;
  border-left: 2px dotted var(--hair);
}

.src p {
  margin: 0;
}

.src-kind {
  color: var(--carbon);
  font: 700 15px / 1.2 "Barlow Condensed", sans-serif;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.src-fig {
  margin-top: 2px;
  font: 500 17px / 1.5 "IBM Plex Mono", monospace;
}

.src-note {
  color: var(--ink-2);
  font-size: 13px;
}

/* The traced line's thread. demo.js-free: motion.js lays its path out. */
.thread {
  position: absolute;
  inset: 0;
  z-index: 3;
  width: 100%;
  height: 100%;
  overflow: visible;
  pointer-events: none;
  visibility: hidden;
}

.thread.is-laid-out {
  visibility: visible;
}

.thread .line {
  fill: none;
  stroke: var(--carbon);
  stroke-width: 2;
  stroke-dasharray: 6 5;
}

.thread .draw {
  stroke-dasharray: 1;
  stroke-dashoffset: 0;
}

.thread .knot {
  fill: var(--carbon);
}

/* The mule: logo geometry, deadpan, leaning in at the desk with the stamp. */
#hero .mule {
  position: absolute;
  bottom: 40px;
  left: calc(500% / 12 - 165px);
  z-index: 4;
  width: 260px;
  margin: 0;
  transform-origin: 30% 100%;
  pointer-events: none;
}

#hero .mule svg {
  display: block;
  width: 100%;
  height: auto;
  overflow: visible;
}

/* The pallet bar the desk stands on, across the whole hero. */
.pallet {
  position: absolute;
  right: 0;
  bottom: 12px;
  left: 0;
  z-index: 3;
  height: 30px;
  background:
    linear-gradient(var(--ink), var(--ink)) 0 0 / 100% 7px no-repeat,
    linear-gradient(90deg, var(--ink) 0 56px, transparent 56px) 40px 7px / 260px 17px repeat-x,
    linear-gradient(var(--ink), var(--ink)) 0 24px / 100% 6px no-repeat;
}

/* ---------- perforations between sections ---------- */
.perf {
  height: 14px;
}

.perf-ink {
  background: radial-gradient(circle at 7px 14px, var(--stock) 5px, var(--ink) 5.5px) repeat-x 0 0 / 14px 14px;
}

.perf-stock {
  background: radial-gradient(circle at 7px 0, var(--ink) 5px, var(--stock) 5.5px) repeat-x 0 0 / 14px 14px;
}

/* ---------- the claim strip: one coupon on an ink band, torn into four stubs ---------- */
.claims {
  padding: 40px var(--gutter) 44px;
  background: var(--ink);
  color: var(--on-ink);
}

.claim-strip {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  max-width: 1376px;
  margin: 0 auto;
  background: var(--coupon);
  color: var(--ink);
}

.claim {
  position: relative;
  padding: 28px 28px 32px;
}

.claim + .claim::before {
  content: "";
  position: absolute;
  top: 10px;
  bottom: 10px;
  left: 0;
  width: 0;
  border-left: 2px dashed var(--ink-mute);
}

.claim + .claim::after {
  content: "";
  position: absolute;
  top: 0;
  bottom: 0;
  left: -7px;
  width: 14px;
  background:
    radial-gradient(circle at 7px 0, var(--ink) 6.5px, transparent 7px) 0 0 / 14px 7px no-repeat,
    radial-gradient(circle at 7px 7px, var(--ink) 6.5px, transparent 7px) 0 100% / 14px 7px no-repeat;
}

.claim h2 {
  margin: 0 0 10px;
  color: var(--ink);
  font: var(--claim);
  text-wrap: balance;
}

.claim p {
  margin: 0;
  font: var(--body);
}

/* Reading sections. */
.section {
  padding: var(--section) 48px 0;
}

.section-heading {
  margin: 0 0 var(--gutter);
  font: 700 36px / 1 "Barlow Condensed", sans-serif;
  letter-spacing: -0.005em;
  text-transform: uppercase;
  text-wrap: balance;
}

.prose {
  margin: 0 0 var(--cell);
  max-width: 64ch;
  font: var(--lede);
}

.prose a,
.footer a,
.note a {
  text-underline-offset: 3px;
  transition: text-decoration-thickness 120ms var(--out-quart);
}

.prose a:hover,
.footer a:hover,
.note a:hover {
  text-decoration-thickness: 2px;
}

.section .button {
  margin-top: 14px;
}

/* ---------- how it works: three coupon legs slide out of the wallet ---------- */
#how-it-works {
  max-width: 1280px;
  padding: 72px var(--gutter) 96px;
}

#how-it-works .section-heading {
  margin-bottom: 40px;
  font: var(--section-title);
  letter-spacing: 0;
  text-transform: none;
}

.wallet-stage {
  position: relative;
  display: grid;
  grid-template-columns: 236px minmax(0, 1fr);
  gap: 28px;
  align-items: end;
  view-timeline-name: --wallet;
}

.wallet {
  position: relative;
  z-index: 3;
  align-self: end;
  height: 300px;
}

.wallet-back {
  position: absolute;
  top: 52px;
  right: 22px;
  left: 22px;
  height: 120px;
  background: var(--coupon);
  box-shadow: var(--sheet-1);
}

.wallet-back::before {
  content: "";
  position: absolute;
  top: 16px;
  right: 14px;
  left: 14px;
  height: 10px;
  background: var(--hair);
}

.wallet-front {
  position: absolute;
  right: 0;
  bottom: 0;
  left: 0;
  display: grid;
  place-items: center;
  height: 200px;
  background: var(--ink);
  box-shadow: var(--sheet-2);
  -webkit-mask: radial-gradient(circle at 50% 0, transparent 26px, #000 26.5px);
  mask: radial-gradient(circle at 50% 0, transparent 26px, #000 26.5px);
}

.wallet-front::after {
  content: "";
  position: absolute;
  inset: 10px;
  border: 2px dashed rgba(230, 225, 214, 0.26);
  pointer-events: none;
}

.wallet-front img {
  width: 56px;
  height: auto;
  opacity: 0.5;
}

.legs {
  position: relative;
  z-index: 2;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 24px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.leg {
  --r: 0deg;
  position: relative;
  background: var(--coupon);
  box-shadow: var(--sheet-2);
  outline: 1.5px solid var(--ink);
  outline-offset: -1.5px;
  transform: rotate(var(--r));
  transition: box-shadow 150ms var(--out-quart);
}

.leg:nth-child(1) {
  --i: 0;
  --r: -2deg;
}

.leg:nth-child(2) {
  --i: 1;
  --r: 1.2deg;
}

.leg:nth-child(3) {
  --i: 2;
  --r: -0.8deg;
}

/* Each leg opens with its illustration: the rate card, the events, the invoice. */
.leg-art {
  display: block;
  width: 100%;
  height: auto;
  border-bottom: 1px solid var(--hair);
}

.leg-head {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 18px 22px 0;
}

.leg-no {
  display: grid;
  flex: none;
  place-items: center;
  width: 36px;
  height: 36px;
  background: var(--ink);
  color: var(--dock);
  font: 700 22px / 1 "Barlow Condensed", sans-serif;
}

.leg-head h3 {
  margin: 0;
  font: 700 26px / 1.1 "Barlow Condensed", sans-serif;
  letter-spacing: 0;
  text-transform: none;
}

.leg p {
  margin: 0;
  padding: 10px 22px 26px;
  color: var(--ink-2);
}

@media (hover: hover) {
  .leg:hover {
    box-shadow: var(--sheet-3);
  }
}

/* ---------- the 404 page: the hero's field and desk, with the mule beside an empty pallet ---------- */
.hero.not-found {
  position: relative;
  max-width: none;
  margin: 0;
  padding: 0;
  grid-template-columns: 5fr 7fr;
  column-gap: 0;
  row-gap: 0;
  align-items: stretch;
  min-height: max(calc(100svh - 64px), 560px);
  overflow-x: clip;
}

.not-found .hero-copy {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 22px;
  padding: 48px clamp(24px, 4vw, 56px) 72px var(--gutter);
  background: var(--dock);
}

.not-found h1 {
  margin: 0;
  max-width: none;
}

.not-found .lede,
.not-found .cta-row {
  margin: 0;
}

.not-found-desk {
  display: grid;
  place-items: end center;
  padding: 40px 32px 46px;
  background: linear-gradient(90deg, rgba(29, 27, 22, 0.07), transparent 22px), var(--stock);
}

.not-found-desk img {
  display: block;
  width: min(480px, 100%);
  height: auto;
}

@media (prefers-reduced-motion: no-preference) {
  .not-found-desk img {
    animation: lean 300ms var(--out-back-soft) 200ms both;
  }
}

/* Buttons: square, framed, condensed caps. 13px 22px and 18px type on the
   marketing page. The ink and dock buttons are the DESIGN.md ones. */
.button {
  display: inline-block;
  padding: 13px 22px;
  border: 1.5px solid var(--ink);
  border-radius: var(--none);
  font: var(--control);
  font-size: 18px;
  letter-spacing: 0.07em;
  text-decoration: none;
  text-transform: uppercase;
  transition: background-color 0.15s;
}

.button-primary,
.button-dock {
  display: inline-flex;
  align-items: center;
  min-height: 48px;
  padding: 0 22px;
  border: 0;
  letter-spacing: 0.02em;
  text-transform: none;
}

/* Ink: the one committing action. It moves like a keycap. */
.button-primary {
  background: var(--ink);
  color: var(--dock);
  box-shadow: var(--key);
  transition:
    transform 150ms var(--out-quart),
    box-shadow 150ms var(--out-quart),
    background-color 90ms linear;
}

.button-primary:hover {
  background: var(--ink);
  transform: translate(-2px, -2px);
  box-shadow: var(--key-hover);
}

.button-primary:active {
  transform: translate(2px, 2px);
  box-shadow: 0 0 0 rgba(29, 27, 22, 0);
  transition-duration: 90ms;
}

/* Dock: on ink bars. Hover and pressed are the lighter and darker dock. */
.button-dock {
  background: var(--dock);
  color: var(--ink);
  transition: background-color 90ms linear;
}

.button-dock:hover {
  background: var(--dock-hi);
}

.button-dock:active {
  background: var(--dock-lo);
}

.button-secondary {
  background: var(--coupon);
  color: var(--ink);
}

.button-secondary:hover {
  background: var(--fresh);
}

.button-secondary:active {
  background: var(--dock);
}

/* ---------- hero motion: the coupon prints, the trace is drawn, the stamp lands.
   Everything settles by 1000 ms. Class "play" starts it; motion.js takes it off
   on a phone until the feeder is on screen, and puts "settled" on once it has
   run, so a re-render never plays it again. ---------- */
@media (prefers-reduced-motion: no-preference) {
  #hero.play:not(.settled) .feed-window #hero-coupon {
    animation: print 560ms var(--out-expo) both;
  }

  #hero.play:not(.settled) #hero-coupon [data-line]:first-child details[open] ul {
    animation: unfold 240ms var(--out-quart) 360ms both;
  }

  #hero.play:not(.settled) #hero-coupon [data-line]:first-child {
    animation: fresh 240ms linear 360ms both;
  }

  #hero.play:not(.settled) .src {
    animation: slide 300ms var(--out-expo) both;
  }

  #hero.play:not(.settled) #src-events {
    animation-delay: 520ms;
  }

  #hero.play:not(.settled) #src-rate {
    animation-delay: 600ms;
  }

  #hero.play:not(.settled) .draw {
    animation: trace 360ms var(--out-quart) 420ms both;
  }

  #hero.play:not(.settled) .draw-b {
    animation-delay: 480ms;
  }

  #hero.play:not(.settled) .knot {
    animation: knot 120ms linear 420ms both;
  }

  #hero.play:not(.settled) #hero-coupon .stamp-issued {
    animation: stamp 300ms var(--ease-stamp) 640ms both;
  }

  #hero.play:not(.settled) .mule {
    animation: lean 300ms var(--out-back-soft) 700ms both;
  }

  #hero .mule.droop .lid {
    animation: droop 1200ms var(--in-out) both;
  }

  #hero-coupon .stamp-issued:hover {
    animation: reink 240ms var(--ease-stamp);
  }

  @keyframes print {
    from {
      transform: translateY(-101%);
    }

    to {
      transform: none;
    }
  }

  @keyframes unfold {
    from {
      clip-path: inset(0 0 100% 0);
    }

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

  @keyframes fresh {
    from {
      background-color: var(--coupon);
    }
  }

  @keyframes slide {
    from {
      opacity: 0;
      transform: translateX(16px);
    }

    to {
      opacity: 1;
      transform: none;
    }
  }

  @keyframes trace {
    from {
      stroke-dashoffset: 1;
    }

    to {
      stroke-dashoffset: 0;
    }
  }

  @keyframes knot {
    from {
      opacity: 0;
    }

    to {
      opacity: 1;
    }
  }

  @keyframes stamp {
    from {
      opacity: 0;
      transform: scale(1.6) rotate(-14deg);
      filter: blur(2px);
    }

    60% {
      opacity: 1;
    }

    to {
      opacity: 1;
      transform: rotate(-6deg);
      filter: blur(0);
    }
  }

  @keyframes reink {
    0% {
      transform: rotate(-6deg);
    }

    40% {
      transform: scale(1.06) rotate(-7deg);
    }

    100% {
      transform: rotate(-6deg);
    }
  }

  @keyframes lean {
    from {
      opacity: 0;
      transform: translateY(24px) rotate(3deg);
    }

    to {
      opacity: 1;
      transform: none;
    }
  }

  @keyframes droop {
    0% {
      transform: translateY(0);
    }

    25%,
    80% {
      transform: translateY(6px);
    }

    100% {
      transform: translateY(0);
    }
  }

  /* The wallet hands out its legs as the section scrolls into view, one after
     another. Where the browser cannot link an animation to scrolling, motion.js
     sets "io" on the page and each leg slides out once it is in view. */
  @supports (animation-timeline: view()) {
    html:not(.io) .leg {
      animation: wallet-out linear both;
      animation-timeline: --wallet;
      animation-range: entry calc(10% + var(--i) * 12%) cover calc(26% + var(--i) * 4%);
    }
  }

  html.io .leg {
    transform: translate(var(--back), 40px) scale(0.82);
    transition:
      transform 520ms var(--out-expo) calc(var(--i) * 120ms),
      box-shadow 150ms var(--out-quart);
  }

  html.io .leg.out {
    transform: rotate(var(--r));
  }

  @keyframes wallet-out {
    from {
      transform: translate(var(--back), 40px) scale(0.82);
    }

    to {
      transform: rotate(var(--r));
    }
  }

  @keyframes rise {
    from {
      opacity: 0;
      transform: translateY(24px) rotate(var(--r));
    }

    to {
      opacity: 1;
      transform: rotate(var(--r));
    }
  }
}

/* Where each leg starts: back over the wallet, by its own width and the gap. */
.leg {
  --back: calc(-1 * (var(--i, 0) + 1) * (100% + 24px) + 40px);
}

/* ---------- narrow screens: stacked, transitions scaled down ---------- */
@media (max-width: 960px) {
  .hero {
    grid-template-columns: minmax(0, 1fr);
  }

  .hero.not-found {
    min-height: 0;
  }

  .not-found .hero-copy {
    padding: 40px 20px 44px;
  }

  .not-found h1 {
    font-size: clamp(48px, 14vw, 80px);
  }

  .not-found-desk {
    padding: 28px 24px 46px;
  }

  #hero {
    grid-template-columns: minmax(0, 1fr);
    min-height: 0;
  }

  #hero .hero-copy {
    padding: 40px 20px 44px;
  }

  #hero h1 {
    font-size: clamp(48px, 14vw, 80px);
  }

  #hero .lede {
    font-size: 17px;
  }

  .hero-desk {
    min-height: 0;
    padding: 28px 24px 210px;
  }

  .feeder {
    width: 100%;
    max-width: 440px;
  }

  /* Stacked, the source stubs sit in flow below the coupon. */
  .sources {
    position: relative;
    top: auto;
    right: auto;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    width: auto;
    max-width: 440px;
    margin-top: 52px;
  }

  .src {
    padding-left: 18px;
  }

  #hero .mule {
    bottom: 30px;
    left: 4px;
    width: 200px;
  }

  .claims {
    padding: 32px 20px;
  }

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

  .claim {
    padding: 24px 22px 26px;
  }

  .claim + .claim::before {
    top: 0;
    right: 10px;
    bottom: auto;
    left: 10px;
    width: auto;
    height: 0;
    border-top: 2px dashed var(--ink-mute);
    border-left: 0;
  }

  .claim + .claim::after {
    top: -7px;
    right: 0;
    bottom: auto;
    left: 0;
    width: auto;
    height: 14px;
    background:
      radial-gradient(circle at 0 7px, var(--ink) 6.5px, transparent 7px) 0 0 / 7px 14px no-repeat,
      radial-gradient(circle at 7px 7px, var(--ink) 6.5px, transparent 7px) 100% 0 / 7px 14px no-repeat;
  }

  #how-it-works {
    padding: 56px 20px 72px;
  }

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

  .wallet {
    display: none;
  }

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

  @media (prefers-reduced-motion: no-preference) {
    @supports (animation-timeline: view()) {
      html:not(.io) .leg {
        animation: rise linear both;
        animation-timeline: view();
        animation-range: entry 0% entry 70%;
      }
    }

    html.io .leg {
      opacity: 0;
      transform: translateY(24px) rotate(var(--r));
      transition:
        transform 360ms var(--out-expo),
        opacity 360ms linear,
        box-shadow 150ms var(--out-quart);
    }

    html.io .leg.out {
      opacity: 1;
      transform: rotate(var(--r));
    }
  }
}

@media (max-width: 760px) {
  .top-bar {
    padding: 8px 16px;
  }

  .section {
    padding: var(--gutter) 16px 0;
  }

  .section-heading {
    font-size: 30px;
  }

  .prose {
    font-size: 18px;
  }

  .hero {
    padding: var(--gutter) 16px;
  }

  .hero-desk {
    padding-right: 16px;
    padding-left: 16px;
  }

  #hero-coupon .stamp-issued {
    position: absolute;
    top: 112px;
    right: 12px;
    margin: 0;
    font-size: 22px;
  }

  #hero-coupon .meta {
    min-height: 110px;
  }
}

@media (max-width: 560px) {
  .top-bar nav {
    display: none;
  }

  .leg {
    --r: 0deg !important;
  }
}

/* A visitor who asked for less motion gets every move at its finished state:
   the keyframes above sit inside no-preference, and nothing may transition. */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation: none !important;
    transition: none !important;
  }
}
