/* Kawona landing — THE MIX.
   The passbook's cream paper is the ground and its book is the hero; the
   lorry-station boards carry the day, the ways to pay, the record and the
   questions; the highway hoarding carries the drivers; the asphalt road with
   its km marker runs between every section. One :root, one shadow (the hero
   book), no border above 1px, gold Start free the only saturated element. */

:root {
  /* the app's palette */
  --midnight: #0a1e3f;
  --navy: #1b3a6b;
  --link: #1e54ad;
  --gold: #c79a3a;
  --gold-soft: #e6c98a;
  --good: #1a7c4f;
  --good-bg: #dcf0e6;
  --amber: #9b600d;
  --bad: #c0362c;
  --bad-bg: #f6deda;
  --ink: #0c1424;
  --ink-soft: #3d4860;
  --muted: #687181;
  --canvas: #eceff4;
  --surface: #ffffff;
  --edge: #e4e8ef;

  /* the ground: cream ruled paper (the passbook) */
  --paper: #f6f1e6;

  /* the one extra material neutral: the road between sections */
  --asphalt: #18191c;

  /* rules, all from navy at an alpha */
  --rule: rgba(27, 58, 107, 0.22);
  --rule-strong: rgba(27, 58, 107, 0.42);
  --rule-faint: rgba(27, 58, 107, 0.11);
  --rule-on-dark: rgba(246, 241, 230, 0.22);

  /* stamp-pad inks */
  --stamp-paid: var(--amber);
  --stamp-missed: var(--bad);
  --stamp-office: var(--navy);
  --stamp-ground: var(--paper);

  /* chalk on the boards: canvas, and tints of the app's gold and red */
  --chalk: var(--canvas);
  --chalk-dim: rgba(236, 239, 244, 0.7);
  --chalk-faint: rgba(236, 239, 244, 0.14);
  --chalk-rule: rgba(236, 239, 244, 0.32);
  --chalk-gold: var(--gold-soft);
  --chalk-red: #dd8b84;

  /* a flap tile: the board's own paint, one shade lifted */
  --tile: #16335f;
  --tile-low: #112b52;
  --hinge: rgba(10, 30, 63, 0.9);

  --on-dark: var(--paper);
  --on-dark-soft: rgba(246, 241, 230, 0.82);
  --ink-18: rgba(12, 20, 36, 0.18);

  --display: "Hanken Grotesk", system-ui, -apple-system, "Segoe UI", sans-serif;
  --body: "Hanken Grotesk", system-ui, -apple-system, "Segoe UI", sans-serif;
  --mono: "Spline Sans Mono", ui-monospace, monospace, "Hanken Grotesk", sans-serif;

  --gutter: clamp(1.1rem, 4vw, 3rem);
  --band: clamp(4rem, 9vw, 7.5rem);
  --pad: clamp(1rem, 2.6vw, 2.25rem);
  --measure: 62ch;
  --lift: 0 24px 48px -22px rgba(10, 30, 63, 0.45), 0 2px 6px rgba(10, 30, 63, 0.1);
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
}

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

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
  scrollbar-color: var(--navy) var(--paper);
}

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--body);
  font-size: 1.0625rem;
  line-height: 1.55;
  overflow-x: hidden;
  caret-color: var(--navy);
}

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

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

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

picture {
  display: contents;
}

h1,
h2 {
  font-family: var(--display);
  font-weight: 800;
  letter-spacing: -0.028em;
  line-height: 1;
  margin: 0;
  text-wrap: balance;
}

/* one scale and one case for every section heading */
main h2 {
  font-size: clamp(2rem, 4.2vw, 3.2rem);
}

p,
dl,
dd,
dt,
ul,
ol,
figure {
  margin: 0;
  padding: 0;
}

ul,
ol {
  list-style: none;
}

a {
  color: inherit;
  text-underline-offset: 0.18em;
  text-decoration-thickness: 1px;
}

em {
  font-style: italic;
}

.figure {
  font-family: var(--mono);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
  letter-spacing: -0.01em;
}

.wrap {
  width: min(100% - 2 * var(--gutter), 76rem);
  margin-inline: auto;
}

/* the copy's second line, and the one label a world may add */

.line {
  margin-top: 1rem;
  font-size: clamp(1.1rem, 1.4vw, 1.3rem);
  line-height: 1.45;
  color: var(--ink-soft);
  max-width: var(--measure);
  text-wrap: pretty;
}

.line--dark {
  color: var(--on-dark-soft);
}

.label {
  margin-top: 1.1rem;
  font-size: 0.8125rem;
  color: var(--ink-soft);
}

/* ---------- buttons: solid fills, nothing outlined ---------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 2.9rem;
  padding: 0 1.3rem;
  font-family: var(--display);
  font-weight: 700;
  font-size: 1rem;
  letter-spacing: -0.005em;
  text-decoration: none;
  background: var(--navy);
  color: var(--paper);
  border-radius: 4px;
  white-space: nowrap;
  transition: background 140ms ease, color 140ms ease, transform 140ms ease;
}

.btn:hover {
  background: var(--midnight);
}

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

.btn--gold {
  background: var(--gold);
  color: var(--midnight);
}

.btn--gold:hover {
  background: var(--gold-soft);
}

.btn--lg {
  min-height: 3.5rem;
  padding: 0 1.9rem;
  font-size: 1.15rem;
}

/* Links: a gold rule drawn under the word from the left, and taken away to
   the right, like a pen run under a line in the book. */
.link,
.footer nav a {
  text-decoration: none;
  font-weight: 600;
  padding-bottom: 3px;
  background: linear-gradient(var(--gold), var(--gold)) no-repeat right 100% / 0 2px;
  transition: background-size 340ms cubic-bezier(0.16, 1, 0.3, 1);
}

.link:hover,
.link:focus-visible,
.footer nav a:hover,
.footer nav a:focus-visible {
  text-decoration: none;
  background-position: left 100%;
  background-size: 100% 2px;
}

/* ---------- top bar: the cover's edge ---------- */

.bar {
  position: sticky;
  top: 0;
  z-index: 30;
  background: var(--midnight);
  color: var(--paper);
  border-bottom: 1px solid var(--rule-on-dark);
}

.bar .wrap {
  display: flex;
  align-items: center;
  gap: 1.25rem;
  min-height: 3.75rem;
}

.mark {
  display: inline-flex;
  align-items: baseline;
  font-family: var(--display);
  font-weight: 800;
  font-size: 1.3rem;
  letter-spacing: -0.03em;
  text-decoration: none;
}

/* The logo tile IS the word's K (owner ruling 2026-11-24): [K]awona. Sized
   to Hanken's cap height plus a hair (its caps are 0.70em; the white K inside
   the tile is smaller than the tile) and seated on the baseline, which a
   replaced element in a baseline-aligned flex row does by its bottom edge.
   The space after it is a letter's kerning, not a word gap. */
/* The logo's K stands in for the capital K of the wordmark, bare and in the
   text colour (owner ruling 2026-11-24): drawn at twice the cap height and
   centred on the word rather than sat on its baseline. The viewBox is
   cropped to the ink, so 1.4em is exactly twice the display face's caps. */
.mark__k {
  flex: none;
  align-self: center;
  height: 1.4em;
  width: 1.534em;
  margin-right: 0.06em;
  fill: currentColor;
}

.bar nav {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 0.25rem;
}

.bar nav .link {
  padding: 0.55rem 0.7rem;
  display: none;
  color: var(--on-dark-soft);
}

.bar nav .link--in {
  display: inline-block;
  color: var(--paper);
}

.bar nav .btn {
  margin-left: 0.5rem;
}

@media (min-width: 720px) {
  .bar nav .link {
    display: inline-block;
  }
}

/* ---------- 1 · hero: the cover, then the book open ---------- */

.hero {
  padding-bottom: var(--band);
}

.cover {
  background: var(--midnight);
  color: var(--paper);
  padding: clamp(2.5rem, 6vw, 4.5rem) 0 clamp(7rem, 14vw, 11rem);
}

.cover-head {
  display: grid;
  gap: 1.5rem;
  align-items: end;
}

.hero h1 {
  font-size: clamp(2.6rem, 6vw, 5rem);
  max-width: 12ch;
}

.cover-side {
  display: grid;
  gap: 1.4rem;
  justify-items: start;
}

.cover-side .line {
  margin-top: 0;
  max-width: 30rem;
}

@media (min-width: 960px) {
  .cover-head {
    grid-template-columns: 1.15fr 0.85fr;
    gap: 3rem;
  }
  .cover-side {
    padding-bottom: 0.4rem;
  }
}

/* the open book: two cream pages on one sheet, lifted once */

.book {
  position: relative;
  margin-top: calc(-1 * clamp(5rem, 10vw, 8rem));
  display: grid;
  background: var(--paper);
  border: 1px solid var(--rule-strong);
  border-radius: 3px;
  box-shadow: var(--lift);
}

.page {
  position: relative;
  padding: clamp(1rem, 2.6vw, 1.9rem) clamp(0.9rem, 2.6vw, 1.9rem) clamp(1rem, 2.4vw, 1.6rem);
  min-width: 0;
}

.page--print {
  border-bottom: 1px solid var(--rule-strong);
  background: linear-gradient(to bottom, transparent 88%, var(--rule-faint));
  display: grid;
  gap: 0.8rem;
  align-content: start;
}

.page--ledger {
  background: linear-gradient(to top, transparent 90%, var(--rule-faint));
}

@media (min-width: 960px) {
  .book {
    grid-template-columns: 1fr 1fr;
  }
  .page--print {
    border-bottom: 0;
    border-right: 1px solid var(--rule-strong);
    background: linear-gradient(to right, transparent 90%, var(--rule-faint));
  }
  .page--ledger {
    background: linear-gradient(to left, transparent 90%, var(--rule-faint));
  }
}

/* the photograph, a print clipped into the page with paper corners */

.print {
  position: relative;
  width: 100%;
  padding: 8px;
  background: var(--surface);
  border: 1px solid var(--rule-strong);
  transform: rotate(var(--lean, 0deg));
}

.print img {
  width: 100%;
  height: clamp(14rem, 30vw, 24rem);
  object-fit: cover;
}

.print::before,
.print::after {
  content: "";
  position: absolute;
  width: 28px;
  height: 28px;
  background: var(--navy);
}

.print::before {
  top: -1px;
  left: -1px;
  clip-path: polygon(0 0, 100% 0, 0 100%);
}

.print::after {
  right: -1px;
  bottom: -1px;
  clip-path: polygon(100% 100%, 100% 0, 0 100%);
}

.print-date {
  font-size: 0.8125rem;
  color: var(--ink-soft);
  justify-self: end;
}

.page-head {
  display: grid;
  gap: 0.2rem;
  padding-bottom: 0.7rem;
  border-bottom: 1px solid var(--rule-strong);
  margin-bottom: 0.2rem;
}

.page-head--total {
  grid-template-columns: 1fr auto;
  align-items: end;
  gap: 1rem;
}

.page-title {
  font-family: var(--display);
  font-weight: 800;
  font-size: 1.05rem;
  letter-spacing: -0.01em;
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 1rem;
  min-width: 0;
}

.page-title .figure {
  font-weight: 500;
  font-size: 0.85rem;
  color: var(--ink-soft);
}

.page-head--total .page-title {
  justify-content: flex-start;
}

.page-foot {
  margin-top: 0.9rem;
  font-size: 0.8125rem;
  color: var(--ink-soft);
}

.figure--lg {
  font-size: clamp(1.7rem, 3vw, 2.35rem);
  font-weight: 600;
  color: var(--midnight);
  line-height: 1.05;
}

/* ---------- the ledger: real columns, real headings ---------- */

.ledger {
  width: 100%;
  border-collapse: collapse;
  table-layout: fixed;
  font-family: var(--mono);
  font-size: 0.875rem;
  line-height: 1.3;
}

.ledger th,
.ledger td {
  padding: 0.5rem 0.55rem;
  text-align: left;
  vertical-align: middle;
  border-bottom: 1px solid var(--rule);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: clip;
}

.ledger th + th,
.ledger td + td {
  border-left: 1px solid var(--rule);
}

.ledger th {
  font-family: var(--body);
  font-weight: 600;
  font-size: 0.72rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--ink-soft);
  border-bottom: 1px solid var(--rule-strong);
  padding-top: 0.6rem;
}

.ledger th:nth-child(2),
.ledger td:nth-child(2),
.ledger th:nth-child(4),
.ledger td:nth-child(4) {
  text-align: right;
}

.ledger th:nth-child(1),
.ledger td:nth-child(1) {
  width: 30%;
}

.ledger th:nth-child(2),
.ledger td:nth-child(2) {
  width: 20%;
}

.ledger th:nth-child(3),
.ledger td:nth-child(3) {
  width: 26%;
  text-align: center;
  padding-top: 0.3rem;
  padding-bottom: 0.3rem;
}

.ledger th:nth-child(4),
.ledger td:nth-child(4) {
  width: 24%;
}

.ledger tbody tr:last-child td {
  border-bottom: 1px solid var(--rule-strong);
}

.ledger .ink {
  color: var(--midnight);
  font-weight: 600;
}

/* names in the first column are words, not figures */

.ledger--names td:first-child {
  font-family: var(--body);
  font-weight: 500;
}

.ledger--names th:nth-child(1),
.ledger--names td:nth-child(1) {
  width: 42%;
}

.ledger--names th:nth-child(2),
.ledger--names td:nth-child(2) {
  width: 24%;
}

.ledger--names th:nth-child(3),
.ledger--names td:nth-child(3) {
  width: 34%;
}

@media (max-width: 480px) {
  .ledger {
    font-size: 0.78rem;
  }
  .ledger th,
  .ledger td {
    padding: 0.42rem 0.4rem;
  }
  .ledger th {
    font-size: 0.64rem;
    letter-spacing: 0.04em;
  }
  .ledger th:nth-child(1),
  .ledger td:nth-child(1) {
    width: 31%;
  }
  .ledger th:nth-child(2),
  .ledger td:nth-child(2) {
    width: 19%;
  }
  .ledger th:nth-child(3),
  .ledger td:nth-child(3) {
    width: 24%;
  }
  .ledger th:nth-child(4),
  .ledger td:nth-child(4) {
    width: 26%;
  }
  .ledger--names th:nth-child(1),
  .ledger--names td:nth-child(1) {
    width: 40%;
  }
  .ledger--names th:nth-child(2),
  .ledger--names td:nth-child(2) {
    width: 24%;
  }
  .ledger--names th:nth-child(3),
  .ledger--names td:nth-child(3) {
    width: 36%;
  }
}

/* ---------- stamps: one ink, two hairline rings, a tilt ---------- */

.stamp {
  --stamp: var(--stamp-paid);
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: 0.32em 0.62em 0.3em;
  color: var(--stamp);
  border: 1px solid var(--stamp);
  box-shadow: inset 0 0 0 2px var(--stamp-ground), inset 0 0 0 3px var(--stamp);
  border-radius: 3px;
  font-family: var(--display);
  font-weight: 800;
  font-size: 0.72rem;
  line-height: 1.05;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  white-space: nowrap;
  transform: rotate(var(--tilt, 0deg));
  transform-origin: center;
  mix-blend-mode: multiply;
  text-shadow: 0 0 0.5px var(--stamp);
  vertical-align: middle;
}

.stamp small {
  display: block;
  font-family: var(--body);
  font-weight: 600;
  font-size: 0.62em;
  letter-spacing: 0.05em;
  margin-top: 0.22em;
  text-transform: none;
}

.stamp small .figure {
  font-weight: 500;
}

.stamp--paid {
  --stamp: var(--stamp-paid);
}

.stamp--missed {
  --stamp: var(--stamp-missed);
}

.stamp--office {
  --stamp: var(--stamp-office);
}

.stamp--big {
  font-size: 1.05rem;
  padding: 0.45em 0.9em 0.4em;
  border-radius: 5px;
}

@media (max-width: 480px) {
  .ledger .stamp small {
    display: none;
  }
}

/* pending stamps exist only while the page is armed by script and motion is
   allowed; without either, every stamp is already down */

.is-armed [data-pending]:not(.landed),
.is-armed [data-stamp]:not(.landed) {
  opacity: 0;
  transform: rotate(var(--tilt, 0deg)) scale(1.35);
  filter: blur(1.5px);
}

.is-armed .stamp.landed {
  animation: thump 460ms cubic-bezier(0.2, 0.95, 0.3, 1) both;
}

@keyframes thump {
  0% {
    opacity: 0;
    transform: rotate(var(--tilt, 0deg)) scale(1.35);
    filter: blur(1.5px);
    text-shadow: 0 0 2px var(--stamp);
  }
  55% {
    opacity: 1;
    transform: rotate(var(--tilt, 0deg)) scale(0.965);
    filter: blur(0);
    text-shadow: 0 0 2.5px var(--stamp);
  }
  100% {
    opacity: 1;
    transform: rotate(var(--tilt, 0deg)) scale(1);
    filter: blur(0);
    text-shadow: 0 0 0.5px var(--stamp);
  }
}

/* ---------- the road between sections ---------- */

.road {
  position: relative;
  height: 2.5rem;
  background: var(--asphalt);
  color: rgba(236, 239, 244, 0.72);
  font-size: 0.75rem;
}

.road::before {
  /* the centre line, painted, one hairline high */
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  top: 50%;
  height: 1px;
  background: repeating-linear-gradient(
    to right,
    rgba(236, 239, 244, 0.5) 0 2rem,
    transparent 2rem 3.5rem
  );
  pointer-events: none;
}

.road .wrap {
  position: relative;
  height: 100%;
  display: flex;
  align-items: center;
}

.road span {
  position: relative;
  background: var(--asphalt);
  padding-inline: 0.6rem;
  margin-left: -0.6rem;
}

/* ---------- sections as pages ---------- */

.section {
  padding: var(--band) 0;
}

.section-head {
  max-width: var(--measure);
}

.section--tint {
  background: rgba(27, 58, 107, 0.05);
}

.section-head + .sheet,
.section-head + .steps,
.section-head + .fees,
.section-head + .faq,
.section-head + .pair,
.section-head + .board,
.section-head + .three {
  margin-top: clamp(2rem, 5vw, 3.25rem);
}

/* a sheet: a page of the book laid on the desk, tinted lighter */

.sheet {
  position: relative;
  background: rgba(255, 255, 255, 0.5);
  border: 1px solid var(--rule-strong);
  border-radius: 3px;
  padding: clamp(0.9rem, 2vw, 1.4rem);
  min-width: 0;
}

.sheet-end {
  display: flex;
  justify-content: flex-end;
  padding-top: 0.9rem;
}

/* the lines of a card, an agreement, a statement */

.copy-lines > div {
  display: grid;
  grid-template-columns: 8rem 1fr;
  gap: 0.6rem;
  padding: 0.6rem 0;
  border-bottom: 1px solid var(--rule);
  font-size: 0.9375rem;
}

.copy-lines dt {
  font-weight: 600;
}

.copy-lines dd.figure {
  font-weight: 600;
  text-align: right;
}

.copy-lines--statement > div {
  padding: 0.75rem 0;
  font-size: 1rem;
}

.copy-lines--statement dd.figure {
  font-size: 1.05rem;
}

@media (max-width: 420px) {
  .copy-lines > div {
    grid-template-columns: 6.5rem 1fr;
    font-size: 0.875rem;
  }
}

/* ---------- split sections ---------- */

.split {
  display: grid;
  gap: 2.5rem;
  align-items: center;
}

@media (min-width: 960px) {
  .split {
    grid-template-columns: 1fr 1fr;
    gap: 4rem;
  }
  .split--book-first > .sheet {
    order: -1;
  }
}

/* ---------- 3 · three steps, three frames ---------- */

.steps {
  display: grid;
  gap: 2rem;
  counter-reset: step;
}

.steps > li {
  display: grid;
  gap: 1rem;
  align-content: start;
  counter-increment: step;
}

.steps .line {
  margin-top: 0;
  font-size: 1.1rem;
  color: var(--ink-soft);
}

.steps .line::before {
  content: counter(step) ". ";
  font-family: var(--mono);
  font-weight: 600;
  color: var(--navy);
}

.steps .line strong {
  color: var(--ink);
  font-weight: 700;
}

.frame {
  font-size: 0.9rem;
}

.frame .copy-lines > div {
  grid-template-columns: 7rem 1fr;
}

@media (min-width: 860px) {
  .steps {
    grid-template-columns: 1fr 1fr 1fr;
    gap: 2rem;
  }
  .steps > li {
    grid-template-rows: subgrid;
    grid-row: span 2;
  }
}

/* signature block */

.sig {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 1rem;
  align-items: end;
  padding-top: 2.9rem;
}

.sig-line {
  position: relative;
  border-top: 1px solid var(--ink);
  padding-top: 0.3rem;
  font-size: 0.8125rem;
  color: var(--ink-soft);
}

/* ---------- a board: midnight, chalk, a painted margin ---------- */

.board {
  position: relative;
  background: radial-gradient(120% 70% at 22% 10%, rgba(236, 239, 244, 0.07), transparent 62%),
    var(--midnight);
  color: var(--chalk);
  padding: var(--pad);
  text-shadow: 0 0 1px rgba(236, 239, 244, 0.3);
}

.board::before {
  /* the painted margin every station board carries */
  content: "";
  position: absolute;
  inset: 7px;
  border: 1px solid var(--chalk-faint);
  pointer-events: none;
}

.board-head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.25rem 1rem;
}

.board-title {
  font-weight: 800;
  font-size: clamp(1.15rem, 1.8vw, 1.45rem);
  line-height: 1;
  letter-spacing: 0.01em;
  text-transform: uppercase;
}

.board-sub {
  font-family: var(--mono);
  font-size: 0.85rem;
  line-height: 1.5;
  color: var(--chalk-dim);
}

.dim {
  color: var(--chalk-dim);
}

.gold {
  color: var(--chalk-gold);
}

.red {
  color: var(--chalk-red);
}

.big {
  font-size: clamp(1.7rem, 3vw, 2.3rem);
  font-weight: 600;
  line-height: 1;
}

.ex {
  display: inline-block;
  font-family: var(--body);
  font-weight: 600;
  font-size: 0.7rem;
  line-height: 1.2;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--chalk-dim);
}

.board > .ex {
  display: block;
  margin-top: 1rem;
}

/* ---------- the split flap ---------- */

.flap {
  position: relative;
  display: inline-block;
  vertical-align: baseline;
  padding: 0 0.45em;
  line-height: 1.5;
  background: var(--tile);
  text-shadow: none;
  white-space: nowrap;
}

.flap--st {
  font-family: var(--body);
  font-weight: 700;
  font-size: 0.68rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  line-height: 1.9;
  vertical-align: 0.1em;
}

.flap--name {
  font-family: var(--body);
  font-weight: 800;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  padding-inline: 0.35em;
}

.flap.live {
  perspective: 22rem;
}

.flap-size {
  visibility: hidden;
}

.flap .half,
.flap .leaf,
.flap .face {
  position: absolute;
  inset: 0;
}

.flap .half,
.flap .face {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 0.45em;
  background: var(--tile);
  white-space: nowrap;
}

.flap--name .half,
.flap--name .face {
  padding-inline: 0.35em;
}

.flap .top,
.flap .front {
  clip-path: inset(0 0 50% 0);
}

.flap .bottom,
.flap .back {
  /* the lower leaf sits a shade deeper: the hinge is read from tone */
  clip-path: inset(50% 0 0 0);
  background: var(--tile-low);
}

.flap .leaf {
  transform-style: preserve-3d;
  transform-origin: 50% 50%;
  will-change: transform;
}

.flap .face {
  backface-visibility: hidden;
}

.flap .back {
  transform: rotateX(180deg);
}

.flap.live::after {
  /* the hinge every flap turns on, kept to the tile's ends */
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  top: 50%;
  height: 1px;
  background: linear-gradient(
    90deg,
    var(--hinge) 0,
    var(--hinge) 0.3em,
    transparent 0.3em,
    transparent calc(100% - 0.3em),
    var(--hinge) calc(100% - 0.3em)
  );
  z-index: 2;
}

/* ---------- rows: strict columns ---------- */

.rows {
  margin-top: 1.1rem;
}

.row {
  display: grid;
  grid-template-columns: var(--cols, minmax(0, 1fr) 4.5rem 4.5rem);
  column-gap: 0.6rem;
  align-items: center;
  padding: 0.45rem 0;
  border-top: 1px solid var(--chalk-faint);
  font-family: var(--mono);
  font-size: clamp(0.8125rem, 1.05vw, 0.95rem);
  font-variant-numeric: tabular-nums;
}

.row--head {
  font-family: var(--body);
  font-weight: 600;
  font-size: 0.68rem;
  line-height: 1.2;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--chalk-dim);
  border-top: 0;
  padding-bottom: 0.3rem;
}

.row--total {
  border-top-color: var(--chalk-rule);
  font-weight: 600;
}

.cell {
  min-width: 0;
}

.cell.num {
  text-align: right;
  white-space: nowrap;
}

.cell.st {
  text-align: right;
}

.cell.name {
  font-family: var(--body);
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.02em;
  font-size: clamp(0.85rem, 1.3vw, 1.1rem);
  line-height: 1.15;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* the same day, kept */
.row--kept {
  --cols: minmax(0, 1fr) 4rem 6.2rem;
  grid-template-areas:
    "name amt st"
    "how how how";
  row-gap: 0.1rem;
}

.row--kept .name {
  grid-area: name;
}

.row--kept .how {
  grid-area: how;
  color: var(--chalk-dim);
  font-size: 0.78rem;
}

.row--kept .num {
  grid-area: amt;
}

.row--kept .st {
  grid-area: st;
}

.row--kept.row--head .how {
  display: none;
}

@media (min-width: 640px) {
  .row--kept {
    --cols: minmax(0, 1.1fr) minmax(0, 1fr) 4rem 6.2rem;
    grid-template-areas: "name how amt st";
  }

  .row--kept .how {
    color: var(--chalk);
    font-size: inherit;
  }

  .row--kept.row--head .how {
    display: block;
  }
}

/* behind, worst first */
.row--behind {
  --cols: minmax(0, 1fr) 3.5rem 6rem;
  padding: 0.5rem 0;
}

/* the ledger */
.row--ledger {
  --cols: minmax(0, 1fr) 5.5rem;
  grid-template-areas:
    "when amt"
    "how how"
    "ref ref";
  row-gap: 0.15rem;
}

.row--ledger .when {
  grid-area: when;
}

.row--ledger .how {
  grid-area: how;
  color: var(--chalk-dim);
}

.row--ledger .ref {
  grid-area: ref;
  color: var(--chalk-dim);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.row--ledger .amt {
  grid-area: amt;
}

.row--ledger.row--head .how,
.row--ledger.row--head .ref {
  display: none;
}

@media (min-width: 760px) {
  .row--ledger {
    --cols: 11rem 6rem minmax(0, 1fr) 6rem;
    grid-template-areas: "when how ref amt";
    column-gap: 1rem;
  }

  .row--ledger .how,
  .row--ledger .ref {
    color: var(--chalk);
  }

  .row--ledger.row--head .how,
  .row--ledger.row--head .ref {
    display: block;
  }
}

.row--reversal .cell {
  color: var(--chalk-dim);
}

/* ---------- the foot of a board ---------- */

.foot {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 1rem 2rem;
  margin-top: 0.75rem;
  padding-top: 1.1rem;
  border-top: 1px solid var(--chalk-rule);
}

.foot--top {
  margin-top: 0;
  padding-top: 0;
  padding-bottom: 1rem;
  border-top: 0;
  border-bottom: 1px solid var(--chalk-rule);
}

.tot {
  display: grid;
  gap: 0.35rem;
}

.tot--end {
  margin-left: auto;
}

.lbl {
  font-family: var(--body);
  font-weight: 600;
  font-size: 0.68rem;
  line-height: 1;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--chalk-dim);
}

.tot .figure {
  font-size: clamp(1.35rem, 2.2vw, 2rem);
  font-weight: 600;
  line-height: 1;
}

/* ---------- 2 · the notebook page and the board beside it ---------- */

.pair {
  display: grid;
  gap: 1.5rem;
  align-items: start;
}

@media (min-width: 800px) {
  .pair {
    grid-template-columns: minmax(0, 0.8fr) minmax(0, 1.2fr);
    gap: clamp(1.5rem, 3vw, 2.5rem);
  }
}

.notebook-page {
  --pitch: 1.85rem;
  position: relative;
  background: repeating-linear-gradient(
      to bottom,
      transparent 0,
      transparent calc(var(--pitch) - 1px),
      rgba(27, 58, 107, 0.2) calc(var(--pitch) - 1px),
      rgba(27, 58, 107, 0.2) var(--pitch)
    )
    var(--surface);
  background-position: 0 calc(var(--pitch) * 0.55);
  padding: calc(var(--pitch) * 0.55) 1.5rem calc(var(--pitch) * 1.4) 3.25rem;
  color: var(--ink-soft);
  font-weight: 500;
  font-size: 1.05rem;
  line-height: var(--pitch);
  border: 1px solid var(--rule);
}

.notebook-page::before {
  /* the exercise-book margin */
  content: "";
  position: absolute;
  top: 0;
  bottom: 0;
  left: 2.5rem;
  width: 1px;
  background: rgba(192, 54, 44, 0.4);
}

.notebook-date {
  font-weight: 700;
  color: var(--ink);
}

.board--kept .rows {
  margin-top: 0;
}

/* ---------- 4 · behind, worst first ---------- */

.board--behind {
  max-width: 56rem;
}

.board--behind .rows {
  margin-top: 1.1rem;
}

.board--behind .foot--top {
  gap: 1rem 1.75rem;
}

/* ---------- 5 · three ways ---------- */

.three {
  display: grid;
  gap: 1.25rem;
}

@media (min-width: 720px) {
  .three {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: clamp(1rem, 2.5vw, 2rem);
  }
}

.board--way {
  display: grid;
  gap: 0.75rem;
  justify-items: start;
}

.markline {
  width: 4rem;
  height: 2.5rem;
  fill: none;
  stroke: var(--chalk-dim);
  stroke-width: 1;
  stroke-linecap: round;
}

.markline .fill {
  fill: var(--chalk-gold);
  stroke: none;
}

.way {
  font-weight: 800;
  font-size: 1.2rem;
  line-height: 1;
  letter-spacing: 0.01em;
  text-transform: uppercase;
}

.board--way .big {
  font-size: clamp(1.5rem, 2.4vw, 1.9rem);
}

.board--way .big .flap {
  padding: 0.1em 0.4em;
}

.way-ref {
  font-size: 0.8rem;
  color: var(--chalk-dim);
  white-space: normal;
  overflow-wrap: anywhere;
}

/* ---------- 6 · the ledger ---------- */

.board--ledger .rows {
  margin-top: 1.1rem;
}

/* ---------- 7 · the hoarding: the street, the drawn phone, the poster ---------- */

.hoarding {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 44rem);
  align-items: stretch;
  min-height: clamp(26rem, 70svh, 40rem);
  overflow: hidden;
  color: var(--ink);
}

/* the photograph is the left column of the board, not a ground under it:
   the rider and the tricycle stay in view, nothing sits on them */
.hoarding__photo {
  grid-column: 1;
  width: 100%;
  height: 100%;
  min-height: clamp(26rem, 70svh, 40rem);
  object-fit: cover;
  object-position: 62% 50%;
}

.poster {
  position: relative;
  z-index: 1;
  grid-column: 2;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: clamp(2.5rem, 6vh, 4.5rem) var(--gutter);
  background: var(--canvas);
  color: var(--ink);
}

/* the phone sits on the photograph, over the empty road at its left, so the
   rider and the tricycle on the right stay in view */
.phone {
  --phone-w: clamp(13rem, 17vw, 15.5rem);
  position: absolute;
  z-index: 2;
  left: clamp(1.5rem, 5vw, 4.5rem);
  top: 50%;
  translate: 0 -50%;
  width: var(--phone-w);
  padding: 0.55rem;
  background: var(--midnight);
  border-radius: 1.6rem;
}

.phone__screen {
  background: var(--canvas);
  color: var(--ink);
  border-radius: 1.15rem;
  padding: 1.1rem 1rem 1rem;
  display: grid;
  gap: 0.45rem;
  font-size: 0.8125rem;
}

.phone__top {
  display: flex;
  justify-content: space-between;
  gap: 0.5rem;
  font-weight: 600;
  padding-bottom: 0.6rem;
  box-shadow: 0 1px 0 var(--ink-18);
  margin-bottom: 0.25rem;
}

.phone__top > span:first-child {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.phone__off {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  flex: none;
  font-weight: 500;
  color: var(--ink-soft);
}

.phone__off i {
  width: 0.45rem;
  height: 0.45rem;
  background: var(--muted);
  border-radius: 50%;
}

.phone__label {
  color: var(--ink-soft);
  font-weight: 500;
}

.phone__due {
  font-size: clamp(1.5rem, 2.4vw, 2rem);
  font-weight: 600;
  line-height: 1;
  letter-spacing: -0.02em;
  margin-top: -0.25rem;
  padding-bottom: 0.65rem;
  box-shadow: 0 1px 0 var(--ink-18);
  margin-bottom: 0.25rem;
}

.phone__row {
  display: flex;
  justify-content: space-between;
  gap: 0.5rem;
  color: var(--ink-soft);
}

.phone__row .figure {
  color: var(--ink);
  font-weight: 500;
}

.phone__btn {
  /* a drawn control on the driver's screen: solid navy, so Start free
     stays the page's one gold */
  margin-top: 0.6rem;
  background: var(--navy);
  color: var(--canvas);
  font-weight: 700;
  text-align: center;
  padding: 0.7rem 0.75rem;
  border-radius: 0.5rem;
}

.phone__foot {
  color: var(--ink-soft);
  font-size: 0.75rem;
  text-align: center;
  padding-top: 0.25rem;
}

/* the phone rises once, when the hoarding is driven past */

.pre .phone {
  clip-path: inset(100% 0 0 0);
}

.live .phone {
  clip-path: inset(0 0 0 0);
  transition: clip-path 720ms var(--ease-out) 240ms;
}

@media (max-width: 880px) {
  .hoarding {
    grid-template-columns: minmax(0, 1fr);
    min-height: 0;
    background: var(--canvas);
  }

  /* on a phone the photograph is the top strip of the board; the crop shows
     the rider and the street */
  .hoarding__photo {
    grid-column: 1;
    height: 48svh;
    min-height: 0;
    object-position: 62% 55%;
  }

  .poster {
    grid-column: 1;
    width: 100%;
    padding-block: 2.25rem 2.5rem;
  }

  /* on a phone the drawn phone sits low on the photograph's left, over the
     road, below the tricycle */
  .phone {
    --phone-w: 12rem;
    position: relative;
    left: auto;
    top: auto;
    translate: none;
    margin: -3.5rem auto 0;
  }

  .phone__row > span:first-child {
    white-space: nowrap;
  }

  .phone__screen {
    font-size: 0.75rem;
    padding: 0.9rem 0.85rem 0.85rem;
    gap: 0.35rem;
  }

  .phone__due {
    font-size: 1.375rem;
  }

  .phone__btn {
    padding: 0.55rem;
  }
}

/* ---------- 9 · inside the back cover: the prices ---------- */

.back-cover {
  background: var(--midnight);
  color: var(--paper);
  --rule: var(--rule-on-dark);
  --rule-strong: rgba(246, 241, 230, 0.38);
}

.back-cover h2 {
  max-width: 18ch;
}

/* The plan ladder (2026-11-24). Phones: a ledger of rows, plan on the left
   and its cost on the right. From 1000px: five columns side by side. */
.fees {
  display: grid;
  border-top: 1px solid var(--rule-strong);
  border-bottom: 1px solid var(--rule-strong);
}

.fee {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: start;
  gap: 0.25rem 1rem;
  padding: 1.15rem 0;
  min-width: 0;
}

.fee + .fee {
  border-top: 1px solid var(--rule);
}

.fee__name,
.fee__cost {
  display: grid;
  gap: 0.3rem;
  align-content: start;
}

.fee__cost {
  justify-items: end;
  text-align: right;
}

.fee strong {
  font-family: var(--display);
  font-weight: 800;
  font-size: 1.2rem;
  letter-spacing: -0.015em;
}

.fee__cap,
.fee__per,
.fee__year {
  font-size: 0.875rem;
  color: var(--on-dark-soft);
}

.fee__year .figure {
  color: var(--paper);
}

/* The yearly line is a link into sign-up on the yearly price. */
a.fee__year {
  text-decoration: underline;
  text-decoration-color: var(--rule-strong);
  text-underline-offset: 3px;
  transition: text-decoration-color 140ms ease, color 140ms ease;
}

a.fee__year:hover,
a.fee__year:focus-visible {
  color: var(--paper);
  text-decoration-color: var(--gold);
}

/* Each plan's "Try <Plan> free": under the row on phones, at the foot of the
   column from 1000px so the five columns' buttons sit on one line. */
.fee__go {
  grid-column: 1 / -1;
  justify-self: start;
  margin-top: 0.6rem;
  min-height: 2.6rem;
  padding: 0 1.05rem;
  font-size: 0.95rem;
}

.back-cover .fee .fee__go {
  margin-top: 0.35rem;
}

.btn--plan {
  background: rgba(246, 241, 230, 0.12);
  color: var(--paper);
}

.btn--plan:hover {
  background: rgba(246, 241, 230, 0.22);
}

.fee__name {
  grid-template-columns: auto 1fr;
  column-gap: 0.5rem;
}

.fee__cap {
  grid-column: 1 / -1;
}

.fee__flag {
  grid-row: 1;
  grid-column: 2;
  align-self: center;
  justify-self: start;
  padding: 0.15rem 0.5rem;
  border-radius: 999px;
  background: var(--gold);
  color: var(--midnight);
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.02em;
}

.price {
  font-weight: 600;
  font-size: clamp(1.5rem, 2.6vw, 2.2rem);
  color: var(--gold-soft);
  line-height: 1.1;
}

.price--word {
  font-family: var(--display);
  font-weight: 800;
  letter-spacing: -0.02em;
}

.founding {
  margin-top: 1.6rem;
  padding: 1rem 1.15rem;
  border: 1px solid var(--gold);
  border-radius: 0.5rem;
  max-width: var(--measure);
  color: var(--paper);
  text-wrap: pretty;
}

.founding strong {
  color: var(--gold-soft);
}

.founding {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.85rem 1.25rem;
}

.founding p {
  flex: 1 1 22ch;
}

.back-cover .founding .founding__go {
  margin-top: 0;
  min-height: 2.6rem;
  padding: 0 1.05rem;
  font-size: 0.95rem;
}

.back-cover .line {
  margin-top: 1rem;
}

.back-cover .btn {
  margin-top: 1.6rem;
}

@media (min-width: 1000px) {
  .fees {
    grid-template-columns: repeat(5, 1fr);
  }
  .fee {
    grid-template-columns: 1fr;
    grid-template-rows: auto 1fr auto;
    gap: 1.1rem;
    padding: 1.6rem 1.25rem 1.5rem;
  }
  .fee__go,
  .back-cover .fee .fee__go {
    margin-top: 0.4rem;
    white-space: normal;
    text-align: center;
  }
  .fee:first-child {
    padding-left: 0;
  }
  .fee + .fee {
    border-top: 0;
    border-left: 1px solid var(--rule);
  }
  .fee__cost {
    justify-items: start;
    text-align: left;
  }
}

/* ---------- 10 · questions, two columns on the wall ---------- */

.faq {
  display: grid;
}

.faq > div {
  display: grid;
  gap: 0.35rem 2rem;
  padding: 1.1rem 0;
  border-top: 1px solid var(--rule);
}

.faq > div:first-child {
  border-top-color: var(--rule-strong);
}

.faq > div:last-child {
  border-bottom: 1px solid var(--rule-strong);
}

.faq dt {
  font-family: var(--display);
  font-weight: 700;
  font-size: 1.1rem;
  letter-spacing: -0.01em;
  color: var(--ink);
  text-wrap: balance;
}

.faq dd {
  color: var(--ink-soft);
  max-width: 60ch;
  text-wrap: pretty;
}

@media (min-width: 760px) {
  .faq > div {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1.4fr);
    padding: 1.3rem 0;
  }
}

/* ---------- 11 · close: the street, full width, the words on it ---------- */

.close {
  position: relative;
  display: grid;
  align-items: center;
  min-height: min(80vh, 42rem);
  padding: var(--band) 0;
  color: var(--paper);
  overflow: hidden;
  isolation: isolate;
}

.close > img,
.close > picture > img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  z-index: -2;
}

.close::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background: linear-gradient(
    to right,
    rgba(10, 30, 63, 0.9) 0%,
    rgba(10, 30, 63, 0.72) 55%,
    rgba(10, 30, 63, 0.45) 100%
  );
}

.close h2 {
  font-size: clamp(2.2rem, 4.8vw, 3.8rem);
  max-width: 14ch;
}

.close .line {
  max-width: 34rem;
}

.close .btn {
  margin-top: 1.8rem;
}

/* ---------- footer ---------- */

.footer {
  background: var(--midnight);
  color: var(--on-dark-soft);
  font-size: 0.875rem;
  padding: 2rem 0 2.5rem;
}

.footer .wrap {
  display: grid;
  gap: 0.9rem;
}

.footer strong {
  color: var(--paper);
}

.footer__brand {
  font-size: 1em;
  letter-spacing: 0;
}

.footer nav {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1.2rem;
}

.footer nav a {
  color: var(--paper);
  text-decoration: none;
  font-weight: 600;
}

.footer .credit {
  color: rgba(246, 241, 230, 0.7);
  max-width: 60ch;
}

@media (min-width: 760px) {
  .footer .wrap {
    grid-template-columns: auto auto 1fr;
    gap: 2rem;
    align-items: start;
  }
  .footer .credit {
    justify-self: end;
    text-align: right;
  }
}

/* ---------- motion: the opening, the buttons, the pen ---------- */

/* Buttons: on hover the label rolls up and a fresh copy rolls in from below.
   main.js builds the roll; without it the label simply sits still. */
.btn__roll {
  position: relative;
  display: inline-block;
  overflow: hidden;
  vertical-align: top;
}

.btn__roll > span {
  display: block;
  transition: transform 380ms cubic-bezier(0.16, 1, 0.3, 1);
}

.btn__roll > span + span {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
}

.btn:hover .btn__roll > span,
.btn:focus-visible .btn__roll > span {
  transform: translateY(-100%);
}

/* The opening. `.intro` is set in <head> only when motion is allowed, so the
   finished page is the default and nothing here can hide it for good. */
.intro .hero h1:not(.split) {
  opacity: 0;
  animation: show-anyway 0s 1.6s forwards;
}

/* Split into words, the heading flows as ordinary text again: as a grid its
   one wrapper shrank to the longest word and set a word per line. */
.hero h1.split {
  display: block;
}

.hero h1 .w {
  display: inline-block;
  overflow: hidden;
  vertical-align: bottom;
  padding-bottom: 0.1em;
  margin-bottom: -0.1em;
}

.hero h1 .w > span {
  display: inline-block;
}

.intro .hero h1 .w > span {
  animation: word-rise 720ms cubic-bezier(0.16, 1, 0.3, 1) both;
  animation-delay: calc(80ms + var(--i, 0) * 55ms);
}

.intro .cover-side > * {
  animation: rise 640ms cubic-bezier(0.16, 1, 0.3, 1) both;
  animation-delay: 420ms;
}

.intro .cover-side > * + * {
  animation-delay: 520ms;
}

.intro .book {
  animation: rise-far 820ms cubic-bezier(0.16, 1, 0.3, 1) 380ms both;
}

/* The yard photo is a poster: it unrolls from the top as it is hung, swings
   a little past its lean and settles; then its two corner mounts press it
   to the page. */
.intro .print {
  transform-origin: 50% 0;
  animation: hang 900ms cubic-bezier(0.22, 0.8, 0.24, 1) 720ms both;
}

.intro .print::before,
.intro .print::after {
  animation: mount 260ms cubic-bezier(0.16, 1, 0.3, 1) 1560ms both;
}

.print::before {
  transform-origin: 0 0;
}

.print::after {
  transform-origin: 100% 100%;
}

.intro .print-date {
  animation: rise 500ms cubic-bezier(0.16, 1, 0.3, 1) 1500ms both;
}

@keyframes word-rise {
  from {
    transform: translateY(108%);
  }
}

@keyframes rise {
  from {
    opacity: 0;
    transform: translateY(14px);
  }
}

@keyframes rise-far {
  from {
    opacity: 0;
    transform: translateY(36px);
  }
}

@keyframes hang {
  0% {
    clip-path: inset(0 0 100% 0);
    transform: translateY(-16px) rotate(calc(var(--lean, 0deg) - 2.4deg));
  }
  62% {
    clip-path: inset(0 0 0 0);
    transform: translateY(3px) rotate(calc(var(--lean, 0deg) + 0.7deg));
  }
  100% {
    clip-path: inset(-6px);
    transform: translateY(0) rotate(var(--lean, 0deg));
  }
}

@keyframes mount {
  from {
    opacity: 0;
    transform: scale(0);
  }
}

@keyframes show-anyway {
  to {
    opacity: 1;
  }
}

/* The notebook is handwritten: main.js draws each line in a single-stroke
   script (EMS Allure, handwriting.js) and a pen writes it stroke by stroke
   when the page is seen; then the board beside it flaps into the kept
   version. The words stay in the page, hidden visually, for every reader;
   without the script they show as plain text. */
.notebook-page .hand-text {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

.notebook-page .hand {
  display: block;
  height: var(--pitch);
  width: auto;
  overflow: visible;
}

.notebook-page .hand path {
  fill: none;
  stroke: var(--navy);
  stroke-width: 64;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.notebook-page .notebook-date .hand path {
  stroke: var(--ink);
  stroke-width: 86;
}

/* the pen: a slim barrel and a nib, its tip on the end of the ink */
.notebook-page .hand .nib {
  fill: var(--navy);
  stroke: none;
  opacity: 0;
}

.notebook-page .hand.is-writing .nib {
  opacity: 1;
}

/* "Out of the notebook" as a story: only the notebook first; once it is
   written, the board opens beside it, a scan sweeps the page and each line
   flies off the paper into its row; then the emptied paper goes and the
   board takes its place. Armed by main.js only when motion is allowed;
   without it the two sit side by side. */
.pair.is-story {
  position: relative;
}

.pair.is-story > .board {
  opacity: 0;
}

/* the board alone, where the notebook was */
.pair.is-replaced {
  grid-template-columns: minmax(0, 1fr);
}

.pair.is-replaced > .notebook-page {
  display: none;
}

.pair.is-story .row--kept:not(.row--head) .cell {
  opacity: 0;
  transition: opacity 260ms cubic-bezier(0.16, 1, 0.3, 1);
}

.pair.is-story .row--kept:not(.row--head) .cell.is-in {
  opacity: 1;
}

/* the capture: a gold band swept down the page, as a phone reads it */
.scan {
  position: absolute;
  left: -0.5rem;
  right: -0.5rem;
  top: 0;
  height: 2px;
  background: var(--gold);
  box-shadow: 0 0 0 1px rgba(199, 154, 58, 0.25), 0 0 18px 4px rgba(199, 154, 58, 0.45);
  pointer-events: none;
  z-index: 3;
}

.scan::after {
  /* the light the band leaves behind it */
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 2px;
  height: 3.5rem;
  background: linear-gradient(to top, rgba(199, 154, 58, 0.22), transparent);
}

/* a line in flight, from the paper to its row */
.hand-flight {
  position: absolute;
  left: 0;
  top: 0;
  z-index: 4;
  overflow: visible;
  transform-origin: 0 0;
  pointer-events: none;
}

.hand-flight path {
  fill: none;
  stroke: currentColor;
  stroke-width: 64;
  stroke-linecap: round;
  stroke-linejoin: round;
}

/* The signature on the agreement line, drawn in ink before the office
   stamps it Signed. */
.sig-mark {
  position: absolute;
  left: 0.2rem;
  bottom: calc(100% + 0.15rem);
  width: min(11.5rem, 92%);
  height: auto;
  overflow: visible;
}

.sig-mark path {
  fill: none;
  stroke: var(--navy);
  stroke-width: 1.7;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-dasharray: 1;
  stroke-dashoffset: 0;
}

.is-signing .sig-mark path {
  stroke-dashoffset: 1;
}

/* ---------- still: everything finished ---------- */

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
  .is-armed [data-pending]:not(.landed),
  .is-armed [data-stamp]:not(.landed) {
    opacity: 1;
    transform: rotate(var(--tilt, 0deg));
    filter: none;
  }
  .is-armed .stamp.landed {
    animation: none;
  }
  .pre .phone {
    clip-path: inset(0 0 0 0);
  }
  .live .phone {
    transition: none;
  }
  .btn__roll > span {
    transition: none;
  }
  .btn:hover .btn__roll > span,
  .btn:focus-visible .btn__roll > span {
    transform: none;
  }
  .link,
  .footer nav a {
    transition: none;
  }
}

/* ---------- legal pages: /privacy and /terms ----------
   A document, not a poster: the passbook's paper, one reading column, the
   section heads at the page's one heading scale, and a midnight summary
   board at the top so the short version is read first. */

.legal {
  padding: clamp(2.5rem, 7vh, 4.5rem) 0 clamp(3rem, 8vh, 5rem);
}

.legal .wrap {
  max-width: 46rem;
}

.legal h1 {
  margin: 0;
  font-family: var(--display);
  font-weight: 800;
  font-size: clamp(2.1rem, 5vw, 3rem);
  line-height: 1.05;
  letter-spacing: -0.03em;
  text-wrap: balance;
}

.legal__meta {
  margin: 0.75rem 0 0;
  font-family: var(--mono);
  font-size: 0.8125rem;
  letter-spacing: 0.02em;
  color: var(--muted);
}

.legal__summary {
  margin: 2rem 0 0;
  padding: 1.4rem 1.5rem;
  background: var(--midnight);
  color: var(--on-dark-soft);
  border-radius: 6px;
}

.legal .legal__summary h2 {
  margin: 0 0 0.6rem;
  font-family: var(--mono);
  font-weight: 500;
  font-size: 0.75rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--chalk-gold);
}

.legal__summary ul {
  margin: 0;
  padding-left: 1.1rem;
  display: grid;
  gap: 0.45rem;
}

.legal__summary strong {
  color: var(--paper);
}

.legal__toc {
  margin: 2rem 0 0;
  padding: 1rem 0;
  border-block: 1px solid var(--rule);
  font-size: 0.9375rem;
}

.legal__toc ol {
  margin: 0;
  padding-left: 1.4rem;
  columns: 2 14rem;
  column-gap: 2rem;
}

.legal__toc li {
  padding: 0.15rem 0;
  break-inside: avoid;
}

.legal section {
  scroll-margin-top: 4.5rem;
}

.legal h2 {
  margin: 2.75rem 0 0.75rem;
  font-family: var(--display);
  font-weight: 800;
  font-size: 1.45rem;
  line-height: 1.2;
  letter-spacing: -0.02em;
  text-wrap: balance;
}

.legal h3 {
  margin: 1.6rem 0 0.4rem;
  font-family: var(--display);
  font-weight: 700;
  font-size: 1.0625rem;
}

.legal p,
.legal li {
  max-width: 68ch;
}

.legal p {
  margin: 0.7rem 0 0;
}

.legal ul,
.legal ol {
  margin: 0.6rem 0 0;
  padding-left: 1.3rem;
}

.legal li + li {
  margin-top: 0.3rem;
}

.legal a {
  color: var(--link);
  text-underline-offset: 0.18em;
}

.legal__summary a {
  color: var(--paper);
}

.legal__table {
  margin-top: 1rem;
  overflow-x: auto;
  border: 1px solid var(--rule);
  border-radius: 6px;
  background: var(--surface);
}

.legal__table table {
  width: 100%;
  min-width: 34rem;
  border-collapse: collapse;
  font-size: 0.9375rem;
  line-height: 1.45;
}

.legal__table th,
.legal__table td {
  padding: 0.65rem 0.85rem;
  text-align: left;
  vertical-align: top;
  border-bottom: 1px solid var(--rule-faint);
}

.legal__table tr:last-child td {
  border-bottom: 0;
}

.legal__table th {
  font-family: var(--mono);
  font-weight: 500;
  font-size: 0.75rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
  background: var(--canvas);
}

.legal__table td:first-child {
  font-weight: 700;
  white-space: nowrap;
}

.legal__contact {
  margin-top: 1rem;
  padding: 1rem 1.25rem;
  border-left: 3px solid var(--gold);
  background: var(--surface);
}

/* the site's reset strips list markers; legal text needs them back */
.legal ul {
  list-style: disc;
}

.legal ol {
  list-style: decimal;
}

.legal li::marker {
  color: var(--muted);
}

.legal__summary li::marker {
  color: var(--chalk-gold);
}

/* phones: each service becomes a small block, name first, then its two facts */
@media (max-width: 640px) {
  .legal__table {
    overflow-x: visible;
  }

  .legal__table table {
    min-width: 0;
  }

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

  .legal__table tr {
    display: grid;
    gap: 0.2rem;
    padding: 0.8rem 0.9rem;
    border-bottom: 1px solid var(--rule-faint);
  }

  .legal__table tbody tr:last-child {
    border-bottom: 0;
  }

  .legal__table td {
    padding: 0;
    border: 0;
  }

  .legal__table td:first-child {
    white-space: normal;
  }

  .legal__table td:nth-child(2)::before,
  .legal__table td:nth-child(3)::before {
    display: block;
    font-family: var(--mono);
    font-size: 0.6875rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--muted);
  }

  .legal__table td:nth-child(2)::before {
    content: "What it does";
  }

  .legal__table td:nth-child(3)::before {
    content: "What it receives";
    margin-top: 0.3rem;
  }
}
