/* shared/base.css */
/* Barlow and Barlow Condensed, cut down by scripts/site-fonts.py, under the SIL Open Font License (fonts/OFL.txt). */
@font-face { font-family: "Barlow"; src: url("fonts/Barlow-400.woff") format("woff"); font-weight: 400; font-display: swap; }
@font-face { font-family: "Barlow Condensed"; src: url("fonts/BarlowCondensed-500.woff") format("woff"); font-weight: 500; font-display: swap; }
@font-face { font-family: "Barlow Condensed"; src: url("fonts/BarlowCondensed-600.woff") format("woff"); font-weight: 600; font-display: swap; }

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  color: var(--text);
  font-family: "Barlow", system-ui, sans-serif;
  font-size: 17px;
  line-height: 1.5;
}

/* Blueprint paper: the app's grid colour every 32 px, on the page and on each sheet that slides up over it. */
body, .sheet-paper {
  background-color: var(--background);
  background-image:
    linear-gradient(var(--grid-line) 1px, transparent 1px),
    linear-gradient(90deg, var(--grid-line) 1px, transparent 1px);
  background-size: 32px 32px;
}
.sheet-paper { position: relative; border-top: 1px solid var(--border-strong); box-shadow: var(--sheet-edge); }

a { color: var(--primary); text-underline-offset: 3px; }
a:hover { color: var(--primary-hover); }
:focus-visible { outline: 2px solid var(--primary); outline-offset: 3px; }

/* Every band of the page keeps its content within 1200 px, while its paper runs the full width. */
.top-bar, .scene, .legal, .page-footer { padding-inline: max(16px, calc((100% - 1200px) / 2)); }

.top-bar { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 72px; }
.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  min-height: 48px;
  color: var(--text);
  text-decoration: none;
  font-family: "Barlow Condensed", system-ui, sans-serif;
  font-weight: 600;
  font-size: 24px;
  letter-spacing: 0.4px;
}
.brand:hover { color: var(--text); }
.brand-mark { width: 22px; height: 22px; fill: var(--logo); }
.top-actions { display: flex; align-items: center; gap: 12px; }
.theme-switch {
  display: inline-grid;
  place-items: center;
  width: 48px;
  height: 48px;
  padding: 0;
  border: 1px solid var(--border-strong);
  background: var(--surface);
  color: var(--text);
  cursor: pointer;
}
.theme-switch svg { width: 20px; height: 20px; }
.top-bar .play-badge { padding-block: 4px; }
.top-bar .play-badge img { height: 40px; }
/* On the smallest phones the start's own badge is enough. */
@media (max-width: 479px) { .top-bar .play-badge { display: none; } }

.scene { position: relative; padding-block: 64px; }

/* Each beat's own line, and the plain sentence under it where it has one. */
.beat-head { display: grid; gap: 20px; margin-bottom: 48px; }
.beat-title {
  max-width: 12em;
  margin: 0;
  font-family: "Barlow Condensed", system-ui, sans-serif;
  font-weight: 600;
  font-size: clamp(44px, 5vw + 16px, 88px);
  line-height: 0.95;
  letter-spacing: -0.01em;
  text-wrap: balance;
}
.beat-lead { max-width: 36em; margin: 0; color: var(--text-secondary); font-size: 18px; }

/* Google Play's badge as Google provides it (docs/website.md): never recoloured, redrawn or under 28 px high, with
   a quarter of its height kept clear around it by whatever holds it. */
.play-badge { display: inline-block; width: max-content; }
.play-badge img { display: block; width: auto; height: 56px; }

.page-footer {
  position: relative;
  padding-block: 32px 48px;
  border-top: 1px solid var(--border-strong);
  background: var(--background);
}
.footer-main {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px 32px;
  padding-bottom: 20px;
  border-bottom: 1px solid var(--border);
}
.footer-links { display: flex; flex-wrap: wrap; gap: 0 32px; }
.footer-links a {
  display: inline-flex;
  align-items: center;
  min-height: 48px;
  color: var(--text);
  font-family: "Barlow Condensed", system-ui, sans-serif;
  font-weight: 600;
  font-size: 20px;
  letter-spacing: 0.4px;
  text-decoration: none;
}
.footer-links a:hover { color: var(--primary); text-decoration: underline; }
/* On phones each link takes a line of its own, rather than wrapping where it happens to. */
@media (max-width: 559px) { .footer-links { flex-direction: column; } }
.footer-legal { display: grid; gap: 6px; padding-top: 20px; color: var(--text-muted); font-size: 14px; }
.footer-legal p { max-width: 72em; margin: 0; }

/* shared/charts.css */
/* The drawn charts' marks (scripts/site-charts.py): the app's chart colours in order, its axis and rules. */
.k0 { fill: var(--chart-1); }
.k1 { fill: var(--chart-2); }
.k2 { fill: var(--chart-3); }
.k3 { fill: var(--chart-4); }
.k4 { fill: var(--chart-5); }
.k5 { fill: var(--chart-6); }
.k6 { fill: var(--chart-7); }
.k7 { fill: var(--chart-8); }
.s0, .s1, .s2 { fill: none; stroke-width: 2.5; stroke-linejoin: round; stroke-linecap: round; }
.s0 { stroke: var(--chart-1); }
.s1 { stroke: var(--chart-2); }
.s2 { stroke: var(--chart-3); }
.axis { stroke: var(--border-strong); stroke-width: 1; }
.rule { stroke: var(--border); stroke-width: 1; }
.average { stroke: var(--text); stroke-width: 1; stroke-dasharray: 3 3; }
.chip { fill: var(--primary-tint); }

.t-small, .t-cell, .t-axis { font-family: "Barlow", system-ui, sans-serif; font-variant-numeric: tabular-nums; }
.t-big, .t-chip, .t-head { font-family: "Barlow Condensed", system-ui, sans-serif; }
.t-small { font-size: 11px; fill: var(--text-muted); }
.t-big { font-size: 34px; font-weight: 500; fill: var(--text); }
.t-chip { font-size: 13px; font-weight: 600; fill: var(--primary); }
.t-head { font-size: 11px; font-weight: 600; fill: var(--text-secondary); }
.t-cell { font-size: 10.5px; fill: var(--text); }
.t-axis { font-size: 10px; fill: var(--text-muted); }

/* shared/frame.css */
/* The blueprint frame, as in the app: square corners, a 1 px line, and a "+" just outside each corner. */
.frame {
  position: relative;
  border: 1px solid var(--border-strong);
  background: var(--surface);
  box-shadow: var(--card-shadow);
}
.frame::before {
  --mark: linear-gradient(var(--border-strong), var(--border-strong));
  content: "";
  position: absolute;
  inset: -7px;
  pointer-events: none;
  background:
    var(--mark) left 0 top 6px / 13px 1px,
    var(--mark) left 6px top 0 / 1px 13px,
    var(--mark) right 0 top 6px / 13px 1px,
    var(--mark) right 6px top 0 / 1px 13px,
    var(--mark) left 0 bottom 6px / 13px 1px,
    var(--mark) left 6px bottom 0 / 1px 13px,
    var(--mark) right 0 bottom 6px / 13px 1px,
    var(--mark) right 6px bottom 0 / 1px 13px;
  background-repeat: no-repeat;
}

/* shared/phone.css */
/* The phone is a drawing of a device, so its corners are round; the app inside keeps its square ones. Its parts are
   the preview video's, measured on a phone 456 px wide. A beat sets --phone-w where both the phone and anything
   placed beside it can read it. */
:root { --phone-w: 200px; }
.phone {
  position: relative;
  width: var(--phone-w);
  padding: calc(var(--phone-w) * 34 / 456) calc(var(--phone-w) * 16 / 456) calc(var(--phone-w) * 22 / 456);
  border-radius: calc(var(--phone-w) * 46 / 456);
  background: var(--phone-body);
  box-shadow: var(--card-shadow);
}
.phone::before {
  content: "";
  position: absolute;
  top: calc(var(--phone-w) * 13 / 456);
  inset-inline-start: calc(50% - var(--phone-w) * 32 / 456);
  width: calc(var(--phone-w) * 64 / 456);
  height: calc(var(--phone-w) * 8 / 456);
  border-radius: calc(var(--phone-w) * 4 / 456);
  background: var(--phone-notch);
}
.phone-screen { display: block; width: 100%; height: auto; border-radius: calc(var(--phone-w) * 14 / 456); }

/* shared/tokens.css */
/* The app's colours (src/shared/theme/palette.ts), teal accent; dark when page.html sets the dark theme, from the
   visitor's choice here or their device's setting. Then the website's own few. */
:root {
  color-scheme: light;
  --background: #F6F5F2;
  --surface: #FFFDFA;
  --surface-alt: #EFECE5;
  --border: #E3DFD6;
  --border-strong: #CDC8BB;
  --text: #191815;
  --text-secondary: #5D5850;
  --text-muted: #6C6759;
  --primary: #00655B;
  --primary-hover: #004B43;
  --primary-fill: #00655B;
  --on-primary: #FFFFFF;
  --primary-tint: #E5EFED;
  --primary-tint-strong: #CFE3DF;
  --on-primary-tint: #004B43;
  --danger-text: #C5161B;
  --logo: #00655B;
  --grid-line: #ECEAE2;
  --chart-1: #00655B;
  --chart-2: #3F6F94;
  --chart-3: #6F8F5E;
  --chart-4: #B5822F;
  --chart-5: #8A8072;
  --chart-6: #2F8F8A;
  --chart-7: #4A5A7A;
  --chart-8: #A06B4A;

  --phone-body: #191815;
  --phone-notch: #5D5850;
  --card-shadow: 8px 8px 0 rgb(25 24 21 / 0.12);
  /* The edge of a sheet sliding up over the one before it. */
  --sheet-edge: 0 -12px 0 rgb(25 24 21 / 0.06);
}

:root[data-theme="dark"] {
  color-scheme: dark;
  --background: #1B1A18;
  --surface: #232220;
  --surface-alt: #2B2A27;
  --border: #35332E;
  --border-strong: #4A473F;
  --text: #F1EFE9;
  --text-secondary: #A9A39A;
  --text-muted: #989289;
  --primary: #4FB3A4;
  --primary-hover: #6EC6B8;
  --primary-fill: #0B7D70;
  --on-primary: #FFFFFF;
  --primary-tint: #15302C;
  --primary-tint-strong: #1D443D;
  --on-primary-tint: #8FD6C9;
  --danger-text: #EF8A83;
  --logo: #4FB3A4;
  --grid-line: #2E2C28;
  --chart-1: #4FB3A4;
  --chart-2: #7AA6CC;
  --chart-3: #9DBD8B;
  --chart-4: #D8A95C;
  --chart-5: #B3AA9B;
  --chart-6: #5FC4B8;
  --chart-7: #8B9EC4;
  --chart-8: #CF9673;

  --phone-body: #0E0E0D;
  --phone-notch: #35332E;
  --card-shadow: 8px 8px 0 rgb(0 0 0 / 0.45);
  --sheet-edge: 0 -12px 0 rgb(0 0 0 / 0.3);
}

/* scenes/rows-in/scene.css */
.rows-in { display: grid; gap: 48px; padding-block: 32px 72px; }
.rows-in-words { display: grid; gap: 28px; align-items: end; }
.rows-in-title {
  margin: 0;
  font-family: "Barlow Condensed", system-ui, sans-serif;
  font-weight: 600;
  font-size: clamp(64px, 10vw + 16px, 156px);
  line-height: 0.9;
  letter-spacing: -0.01em;
}
.rows-in-title span { display: block; }
.rows-in-sentence { max-width: 34em; margin: 0; font-size: 18px; color: var(--text-secondary); }
.rows-in .play-badge { margin-top: 22px; }
.rows-in-facts { margin: 14px 0 0; color: var(--text-muted); font-size: 15px; }

/* The strip: the file's rows, the curve drawn from them, and the app that draws it. */
.rows-in-strip { display: grid; gap: 28px; margin: 0; padding: 20px; }
.strip-sheet { overflow: hidden; }
.cells { width: 100%; border-collapse: collapse; font-size: 13px; line-height: 1.3; font-variant-numeric: tabular-nums; white-space: nowrap; }
.cells th, .cells td { padding: 7px 10px; border: 1px solid var(--border); font-weight: 400; text-align: start; }
.cells thead th { background: var(--surface-alt); color: var(--text-secondary); }
.cells tbody th { width: 1%; background: var(--surface-alt); color: var(--text-muted); text-align: center; }
.cells .n { text-align: end; }
/* Revenue, the column the curve is drawn from. */
.cells td:last-child, .cells th:last-child { background: var(--primary-tint); }
.cells .wide { display: none; }

.flex-curve { display: block; width: 100%; height: auto; overflow: visible; }
.curve-title { font-family: "Barlow Condensed", system-ui, sans-serif; font-weight: 500; font-size: 17px; fill: var(--text); }
.curve-ruler, .curve-tick { stroke: var(--border-strong); stroke-width: 1; }
.curve-month { font-size: 13px; fill: var(--text-muted); text-anchor: middle; }
.curve-line { fill: none; stroke: var(--primary); stroke-width: 3; stroke-linejoin: round; }
.curve-point { fill: var(--surface); stroke: var(--primary); stroke-width: 2; }
.curve-value { font-family: "Barlow Condensed", system-ui, sans-serif; font-weight: 600; font-size: 16px; fill: var(--text); text-anchor: middle; }
.curve-ruler, .curve-tick { vector-effect: non-scaling-stroke; }
.curve-point { transform-box: fill-box; transform-origin: center; }

.strip-phone { display: grid; justify-items: center; }
.strip-caption { color: var(--text-muted); font-size: 14px; }

.rows-in .phone { --phone-w: 190px; }

/* One moment on arrival: the curve draws itself through the months, and each point lands as the line reaches it. */
@media (prefers-reduced-motion: no-preference) {
  .curve-line { stroke-dasharray: 1; stroke-dashoffset: 1; animation: curve-draws 1.65s linear 0.3s forwards; }
  .curve-point { opacity: 0; animation: point-lands 0.2s ease-out forwards; animation-delay: calc(0.3s + var(--at) * 0.15s); }
  .rows-in .phone-screen { opacity: 0; animation: point-lands 0.5s ease-out 1.9s forwards; }
}
@keyframes curve-draws { to { stroke-dashoffset: 0; } }
@keyframes point-lands { to { opacity: 1; } }

/* The curve is drawn 640 wide and shown at a phone's width, so its words, line and points are set larger there. */
@media (max-width: 559px) {
  .curve-title { font-size: 30px; }
  .curve-month { font-size: 23px; }
  .curve-value { font-size: 28px; }
  .curve-line { stroke-width: 6; }
  .curve-point { transform: scale(1.7); }
}
@media (min-width: 560px) {
  .cells .wide { display: table-cell; }
}
@media (min-width: 1000px) {
  .rows-in-words { grid-template-columns: minmax(0, 7fr) minmax(0, 5fr); column-gap: 48px; }
  .rows-in-strip { grid-template-columns: minmax(0, 5fr) minmax(0, 7fr) auto; align-items: center; gap: 36px; padding: 32px; }
  .strip-caption { grid-column: 1 / -1; }
  .rows-in .phone { --phone-w: 210px; }
}

/* scenes/pile-up/scene.css */
.pile-up { z-index: 1; display: grid; align-content: center; min-height: 100svh; overflow: hidden; overflow: clip; }

/* The file's rows behind the words, faint: a pile of numbers nobody has read yet. */
.pile-up-rows { position: absolute; inset: 0; overflow: hidden; opacity: 0.14; pointer-events: none; }
.pile-up-rows table { width: 100%; border-collapse: collapse; font-size: 20px; font-variant-numeric: tabular-nums; white-space: nowrap; }
.pile-up-rows td { padding: 12px 18px; border-bottom: 1px solid var(--text); color: var(--text); }

.pile-up-words { position: relative; }
.pile-up-lines {
  margin: 0;
  font-family: "Barlow Condensed", system-ui, sans-serif;
  font-weight: 600;
  font-size: clamp(52px, 8vw + 12px, 132px);
  line-height: 0.95;
  letter-spacing: -0.01em;
}
.pile-up-line { display: block; }
.pile-up-answer {
  max-width: 18em;
  margin: 36px 0 0;
  font-family: "Barlow Condensed", system-ui, sans-serif;
  font-weight: 500;
  font-size: clamp(28px, 2.5vw + 16px, 46px);
  line-height: 1.1;
  letter-spacing: 0.2px;
  color: var(--primary);
}

/* scenes/four-moves/scene.css */
.four-moves { z-index: 2; overflow: hidden; overflow: clip; padding-block: 72px; }
.four-moves-title { margin-bottom: 48px; }

/* The moves are a sequence, so each carries its number. */
.moves { counter-reset: move; display: grid; gap: 56px; margin: 0; padding: 0; list-style: none; }
.move { counter-increment: move; display: grid; gap: 10px; align-content: start; }
.move-picture { margin: 0 0 14px; }
.move-picture img { display: block; width: 100%; height: auto; }
.move-name {
  display: flex;
  align-items: center;
  gap: 14px;
  margin: 0;
  font-family: "Barlow Condensed", system-ui, sans-serif;
  font-weight: 600;
  font-size: 34px;
  line-height: 1;
}
.move-name::before {
  content: counter(move);
  display: inline-grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border: 1px solid var(--text);
  font-size: 22px;
}
.move-line { max-width: 22em; margin: 0; color: var(--text-secondary); font-size: 18px; }

/* The shared files, fanned out like pages on a desk. */
.move-pages { position: relative; aspect-ratio: 640 / 715; }
.move-pages .page {
  position: absolute;
  width: 76%;
  height: auto;
  border: 1px solid var(--border-strong);
  box-shadow: var(--card-shadow);
}
.move-pages .page:nth-child(1) { inset-inline-start: 0; top: 0; }
.move-pages .page:nth-child(2) { inset-inline-start: 8%; top: 17%; }
.move-pages .page:nth-child(3) { inset-inline-start: 16%; top: 36%; }
.move-pages .page:nth-child(4) { inset-inline-start: 24%; top: 52%; }

.moves-ruler { display: none; }

@media (min-width: 700px) {
  .moves { grid-template-columns: repeat(2, minmax(0, 1fr)); column-gap: 40px; }
}
@media (min-width: 1100px) {
  .moves { grid-template-columns: repeat(4, minmax(0, 1fr)); column-gap: 32px; }
}

/* While it moves, on wide screens: the four moves sit in one row wider than the screen and slide past while the
   section holds still, a ruler underneath showing how far along they are. */
.four-moves.is-moving { display: grid; align-content: center; min-height: 100svh; padding-block: 40px; }
.four-moves.is-moving .four-moves-title { margin-bottom: 36px; }
.four-moves.is-moving .moves { display: flex; gap: 72px; width: max-content; }
.four-moves.is-moving .move { width: min(400px, 30vw); }
.four-moves.is-moving .moves-ruler { display: block; height: 1px; margin-top: 40px; background: var(--border-strong); }
.moves-ruler span { display: block; height: 3px; margin-top: -1px; background: var(--primary); transform-origin: left center; }
[dir="rtl"] .moves-ruler span { transform-origin: right center; }

/* scenes/eighteen-kinds/scene.css */
.eighteen-kinds { padding-block: 88px; }

/* The kinds as a sheet of cells: a row for each of Add chart's groups, its name in the first cell. */
.kinds { border-top: 1px solid var(--border-strong); border-inline-start: 1px solid var(--border-strong); background: var(--surface); }
.kind-group { display: grid; }
.kind-group-name {
  margin: 0;
  padding: 14px 16px;
  border-inline-end: 1px solid var(--border-strong);
  border-bottom: 1px solid var(--border-strong);
  background: var(--surface-alt);
  font-family: "Barlow Condensed", system-ui, sans-serif;
  font-weight: 600;
  font-size: 21px;
  line-height: 1.1;
}
.kind-row { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); margin: 0; padding: 0; list-style: none; }
.kind {
  display: grid;
  gap: 10px;
  align-content: start;
  padding: 14px 14px 16px;
  border-inline-end: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}
.kind-empty { display: none; }
.kind-chart { display: block; width: 100%; height: auto; overflow: visible; }
.kind-name { font-family: "Barlow Condensed", system-ui, sans-serif; font-weight: 500; font-size: 18px; line-height: 1.2; }

@media (min-width: 760px) {
  .kind-row { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (min-width: 1100px) {
  .kind-group { grid-template-columns: 168px minmax(0, 1fr); }
  .kind-row { grid-template-columns: repeat(5, minmax(0, 1fr)); }
  .kind-empty { display: block; }
}

/* While it moves: the kinds stay undrawn until the sheet comes into view, then draw themselves one after another. */
.eighteen-kinds.is-moving .grow { transform: scaleY(0); transform-box: fill-box; transform-origin: bottom; }
.eighteen-kinds.is-moving .grow-x { transform: scaleX(0); transform-box: fill-box; transform-origin: left; }
.eighteen-kinds.is-moving .draw { stroke-dasharray: 1; stroke-dashoffset: 1; }
.eighteen-kinds.is-moving .pop { opacity: 0; }
.eighteen-kinds.is-drawn .kind .grow,
.eighteen-kinds.is-drawn .kind .grow-x { animation: kind-grows 0.6s cubic-bezier(0.2, 0.7, 0.2, 1) forwards; }
.eighteen-kinds.is-drawn .kind .draw { animation: kind-draws 0.9s ease-in-out forwards; }
.eighteen-kinds.is-drawn .kind .pop { animation: kind-appears 0.5s ease-out forwards; }
.eighteen-kinds.is-drawn .kind :is(.grow, .grow-x, .draw, .pop) { animation-delay: calc(var(--at) * 70ms); }
@keyframes kind-grows { to { transform: none; } }
@keyframes kind-draws { to { stroke-dashoffset: 0; } }
@keyframes kind-appears { to { opacity: 1; } }

/* scenes/try-it/scene.css */
/* The app's number font, IBM Plex Mono, cut down by scripts/site-fonts.py and renamed, as its licence asks of a changed
   copy (fonts/OFL-IBM-Plex-Mono.txt). */
@font-face { font-family: "Flex Curve Mono"; src: url("fonts/FlexCurveMono-400.woff") format("woff"); font-weight: 400; font-display: swap; }
@font-face { font-family: "Flex Curve Mono"; src: url("fonts/FlexCurveMono-500.woff") format("woff"); font-weight: 500; font-display: swap; }

.try-it { padding-block: 88px; }
.try-it-note { max-width: 44em; margin: 20px 0 0; color: var(--text-muted); font-size: 15px; }

/* The sample's dashboard as the app draws it: the file and its count, the tip or the tapped value's chip, and the four
   charts the sample opens with, each on its own card. */
/* The demo takes its mono font once it's live, near its beat: loading it at the start held back the page's own fonts
   until after its scripts, and every word of the page was measured again. */
.demo {
  --mono: ui-monospace, "Cascadia Mono", Consolas, monospace;
  --plot-h: 150px;
  --ease: cubic-bezier(0.3, 0.7, 0.2, 1);
  position: relative;
  border: 1px solid var(--border-strong);
  background: var(--background);
  box-shadow: var(--card-shadow);
}
.demo.has-mono { --mono: "Flex Curve Mono", ui-monospace, "Cascadia Mono", Consolas, monospace; }
.demo:focus { outline: none; }
/* Plain buttons, weightless so each control's own look wins. */
:where(.demo) button { margin: 0; padding: 0; border: 0; background: none; color: inherit; font: inherit; text-align: inherit; cursor: pointer; }
:where(.demo) button:disabled { cursor: default; }
.demo-icon { flex: none; width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; }

.demo-head { display: grid; gap: 10px; padding: 14px 16px; border-bottom: 1px solid var(--border); background: var(--surface); }
.demo-file { margin: 0; font-family: var(--mono); font-size: 15px; overflow-wrap: anywhere; }
.demo-count { margin: 0; color: var(--text-secondary); font-size: 16px; }
.demo-matching { font-family: var(--mono); color: var(--text); }
.demo-matching.is-filtered { color: var(--primary); }
.demo-filters { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 16px; min-height: 48px; margin: 0; }
.demo-tip {
  gap: 10px;
  padding: 8px 14px;
  border: 1px solid var(--primary-tint-strong);
  background: var(--primary-tint);
  color: var(--on-primary-tint);
  font-size: 15px;
}
.demo-tip strong { font-weight: 600; }
.demo-chip { display: inline-flex; align-items: center; gap: 8px; min-height: 48px; padding-inline: 12px; background: var(--primary-fill); color: var(--on-primary); font-size: 16px; }
.demo-chip-label { opacity: 0.85; }
.demo-clear {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 48px;
  color: var(--danger-text);
  font-family: "Barlow Condensed", system-ui, sans-serif;
  font-weight: 600;
  font-size: 18px;
}

.demo-cards { display: grid; gap: 22px; padding: 22px 16px 26px; }
/* A card fills its row, the single number centred in the height a chart beside it takes. */
.demo-card { display: flex; flex-direction: column; min-width: 0; }
.demo-card > :last-child { flex: 1; }
.demo-card-title {
  margin: 0;
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
  font-family: "Barlow Condensed", system-ui, sans-serif;
  font-weight: 600;
  font-size: 19px;
  line-height: 1.2;
}

.demo-total { display: grid; align-content: center; gap: 12px; padding: 20px; }
.demo-total-value { margin: 0; font-family: var(--mono); font-weight: 500; font-size: 46px; line-height: 1; letter-spacing: -0.5px; }
.demo-total-foot { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 0; color: var(--text-muted); font-family: var(--mono); font-size: 13px; }
.demo-total-note { padding: 3px 8px; background: var(--primary-tint); color: var(--on-primary-tint); }

/* A chart's plot, its scale's lines across it and their labels at its start. */
.demo-chart { position: relative; padding: 18px 14px 10px; padding-inline-start: 58px; }
.demo-scale { position: absolute; top: 18px; inset-inline: 58px 14px; height: var(--plot-h); pointer-events: none; }
.demo-tick { position: absolute; inset-inline: 0; bottom: calc(var(--at) * 100%); border-top: 1px solid var(--border); }
.demo-tick span { position: absolute; inset-inline-end: calc(100% + 8px); top: 0; transform: translateY(-50%); color: var(--text-muted); font-family: var(--mono); font-size: 11px; white-space: nowrap; }
.demo-plot { position: relative; }

.demo-bars { display: flex; gap: 10px; }
.demo-bar { flex: 1 1 0; display: grid; grid-template-rows: var(--plot-h) auto; min-width: 0; }
.demo-bar-fill, .demo-bar-value { grid-row: 1; grid-column: 1; align-self: end; }
.demo-bar-fill { height: 100%; background: var(--colour); transform: scaleY(var(--share)); transform-origin: bottom; }
.demo-bar-value { justify-self: center; transform: translateY(calc(var(--share) * var(--plot-h) * -1 - 4px)); font-family: var(--mono); font-size: 11px; color: var(--text-secondary); }
.demo-bar-name { padding-top: 6px; overflow: hidden; color: var(--text-secondary); font-size: 13px; text-align: center; text-overflow: ellipsis; white-space: nowrap; }
.demo-bar.is-faded .demo-bar-fill { opacity: 0.3; }

/* The line stretches to its plot; its dots and month names sit on top, a column of the plot for each month to tap. */
.demo-line { height: calc(var(--plot-h) + 26px); container-type: inline-size; }
.demo-drawing { position: absolute; top: 0; inset-inline: 0; width: 100%; height: var(--plot-h); overflow: visible; }
.demo-area { fill: var(--chart-1); opacity: 0.13; }
.demo-trace { fill: none; stroke: var(--chart-1); stroke-width: 1.8; stroke-linejoin: round; vector-effect: non-scaling-stroke; }
.demo-point { position: absolute; top: 0; inset-inline-start: calc(var(--x) * 100%); width: calc(100% / 11); height: 100%; transform: translateX(-50%); }
/* The tapped month's band lets the line show through it. */
.demo-point.is-picked {
  --band: color-mix(in srgb, var(--primary) 14%, transparent);
  background: linear-gradient(var(--band), var(--band)) top / 100% var(--plot-h) no-repeat;
}
.demo-dot {
  position: absolute;
  top: var(--plot-h);
  left: 50%;
  width: 9px;
  height: 9px;
  margin: -4.5px;
  border: 1.6px solid var(--chart-1);
  border-radius: 50%;
  background: var(--surface);
  transform: translateY(calc(var(--y) * var(--plot-h) * -1));
}
.demo-point.is-picked .demo-dot { width: 12px; height: 12px; margin: -6px; background: var(--chart-1); }
.demo-point-name { position: absolute; top: calc(var(--plot-h) + 6px); inset-inline: 0; color: var(--text-secondary); font-size: 12px; text-align: center; }
[dir="rtl"] .demo-point { transform: translateX(50%); }
[dir="rtl"] .demo-drawing { transform: scaleX(-1); }
/* Where twelve names can't sit side by side, every other month is named. */
@container (max-width: 360px) {
  .demo-point:nth-child(odd) .demo-point-name { visibility: hidden; }
}

.demo-pie { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 20px; padding-inline-start: 16px; }
.demo-ring { position: relative; flex: none; width: 150px; height: 150px; }
.demo-ring svg { display: block; width: 100%; height: 100%; }
.demo-slice { fill: var(--colour); stroke: var(--surface); stroke-width: 1.5; cursor: pointer; }
.demo-slice.is-faded { opacity: 0.28; }
.demo-ring-total { position: absolute; inset: 0; display: grid; place-content: center; margin: 0; text-align: center; line-height: 1.2; }
.demo-ring-number { font-family: var(--mono); font-weight: 500; font-size: 18px; }
.demo-ring-word { color: var(--text-muted); font-size: 12px; }
.demo-key { flex: 1 1 160px; min-width: 0; margin: 0; padding: 0; list-style: none; }
.demo-key-row { display: flex; align-items: center; gap: 10px; width: 100%; min-height: 48px; padding-inline: 10px; font-size: 16px; }
.demo-key-row.is-picked { background: var(--primary-tint); }
.demo-swatch { flex: none; width: 10px; height: 10px; background: var(--colour); }
.demo-key-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.demo-key-value { color: var(--text-secondary); font-family: var(--mono); font-size: 13px; }

/* A tap eases the bars, the line and the dots to their new places; the rest changes at once. */
@media (prefers-reduced-motion: no-preference) {
  .demo-bar-fill, .demo-bar-value, .demo-dot { transition: transform 0.45s var(--ease), opacity 0.25s ease; }
  .demo-area, .demo-trace { transition: d 0.45s var(--ease); }
  .demo-slice { transition: opacity 0.25s ease; }
}

/* On phones the plots take every pixel they can, so each month's column stays wide enough to tap. */
@media (max-width: 759px) {
  .demo-cards { padding-inline: 12px; }
  .demo-chart { padding-inline-start: 46px; }
  .demo-scale { inset-inline-start: 46px; }
}
@media (min-width: 760px) {
  .demo { --plot-h: 170px; }
  .demo-cards { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 26px; padding: 26px 24px 30px; }
  .demo-head { grid-template-columns: minmax(0, 1fr) auto; align-items: center; padding: 14px 24px; }
  .demo-filters { grid-column: 1 / -1; }
}

/* scenes/stays-on-phone/scene.css */
.stays-on-phone { display: grid; gap: 56px; padding-block: 88px; }
.stays-facts { display: grid; gap: 20px; max-width: 30em; margin: 36px 0 0; padding: 0; list-style: none; font-size: 19px; }
.stays-facts strong {
  display: block;
  font-family: "Barlow Condensed", system-ui, sans-serif;
  font-weight: 600;
  font-size: 30px;
  line-height: 1.05;
}
.stays-policy { margin: 24px 0 0; }
.stays-policy a { display: inline-flex; align-items: center; min-height: 48px; font-size: 18px; }

.stays-visual { --phone-w: 220px; --leader: 28px; display: grid; justify-items: center; gap: var(--leader); }

/* The phone's own setting, drawn above it and tied to it by a leader line, as a drawing labels a part: on, and the
   dashboard is still there. */
.flight-switch { display: flex; align-items: center; gap: 14px; width: max-content; padding: 14px 18px; }
.flight-switch::after {
  content: "";
  position: absolute;
  top: 100%;
  inset-inline-start: 50%;
  height: var(--leader);
  border-inline-start: 1px solid var(--border-strong);
}
.flight-plane { width: 24px; height: 24px; fill: var(--text); }
.flight-name { font-family: "Barlow Condensed", system-ui, sans-serif; font-weight: 600; font-size: 22px; }
.flight-toggle { position: relative; width: 54px; height: 30px; border: 1px solid var(--border-strong); background: var(--primary-fill); }
.flight-toggle span { position: absolute; top: 3px; inset-inline-start: 26px; width: 22px; height: 22px; background: var(--on-primary); }

.stays-on-phone.is-moving .flight-toggle { background: var(--surface-alt); transition: background 0.35s ease; }
.stays-on-phone.is-moving .flight-toggle span {
  inset-inline-start: 3px;
  background: var(--text-muted);
  transition: inset-inline-start 0.35s cubic-bezier(0.3, 0.7, 0.2, 1), background 0.35s ease;
}
.stays-on-phone.is-on .flight-toggle { background: var(--primary-fill); }
.stays-on-phone.is-on .flight-toggle span { inset-inline-start: 26px; background: var(--on-primary); }

@media (min-width: 1000px) {
  .stays-on-phone { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); align-items: center; }
  .stays-visual { --phone-w: 250px; }
}
/* Beside the phone once its column holds both, the leader line running across to the phone's edge. */
@media (min-width: 1180px) {
  .stays-visual { --leader: 40px; display: flex; justify-content: center; align-items: flex-start; }
  .flight-switch { margin-top: calc(var(--phone-w) * 0.3); }
  .flight-switch::after { top: 50%; inset-inline-start: 100%; width: var(--leader); height: 0; border-inline-start: 0; border-top: 1px solid var(--border-strong); }
}

/* scenes/files-people-open/scene.css */
.files-people-open { padding-block: 88px; }
.examples { display: grid; gap: 44px 28px; }
.example { margin: 0; }

/* Each file as the app opens it: its name, its rows, a single number and a chart. */
.example-screen { display: grid; gap: 10px; padding: 14px; background: var(--background); }
.example-file { margin: 0; font-size: 14px; font-variant-numeric: tabular-nums; }
.example-rows { margin: 0; color: var(--text-secondary); font-size: 14px; }
.example-rows span { color: var(--text); font-variant-numeric: tabular-nums; }
.example-card { display: flex; flex-direction: column; padding: 10px 12px; border: 1px solid var(--border); background: var(--surface); }
/* A card's number or chart stands on its floor, so they line up beside cards whose names take two lines. */
.example-card > :last-child { margin-top: auto; }
.example-card-name { margin: 0 0 6px; font-family: "Barlow Condensed", system-ui, sans-serif; font-weight: 600; font-size: 16px; line-height: 1.2; }
.example-number {
  margin: 0;
  font-family: "Barlow Condensed", system-ui, sans-serif;
  font-weight: 500;
  font-size: 36px;
  line-height: 1;
  font-variant-numeric: tabular-nums;
}
.example-chart { display: block; width: 100%; height: auto; overflow: visible; }
.example-chart .t-axis { font-size: 9px; }
.example-caption { margin-top: 14px; font-family: "Barlow Condensed", system-ui, sans-serif; font-weight: 600; font-size: 22px; }

/* Each part of the four files on one line across them: file names, cards, charts and captions. */
@supports (grid-template-rows: subgrid) {
  .example { display: grid; grid-row: span 5; grid-template-rows: subgrid; row-gap: 14px; }
  .example-screen { grid-row: span 4; grid-template-rows: subgrid; }
  .example-caption { margin-top: 0; }
}

@media (min-width: 700px) {
  .examples { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (min-width: 1100px) {
  .examples { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}

/* scenes/one-purchase/scene.css */
.one-purchase { padding-block: 88px; }

/* A ledger, ruled like a sheet: what's asked for on the start, what Flex Curve asks on the end, and the total line
   doubled underneath as an account book draws it. */
.ledger { max-width: 860px; }
.ledger-table { width: 100%; border-collapse: collapse; }
.ledger-table th, .ledger-table td { padding: 14px 18px; border-bottom: 1px solid var(--border); text-align: start; vertical-align: baseline; }
.ledger-table thead th {
  background: var(--surface-alt);
  color: var(--text-secondary);
  font-size: 15px;
  font-weight: 400;
}
.ledger-table tbody th { font-weight: 400; font-size: 18px; }
.ledger-table td {
  font-family: "Barlow Condensed", system-ui, sans-serif;
  font-weight: 600;
  font-size: 26px;
  line-height: 1.1;
}
.ledger-table tbody tr:last-child :is(th, td) { border-bottom: 0; }
.ledger-table tfoot :is(th, td) { position: relative; border-bottom: 0; }
.ledger-table tfoot :is(th, td)::before {
  content: "";
  position: absolute;
  inset-inline: 0;
  top: 0;
  height: 3px;
  border-block: 1px solid var(--text);
  transform: scaleX(var(--ruled, 1));
  transform-origin: left center;
}
.ledger-table tfoot th { font-family: "Barlow Condensed", system-ui, sans-serif; font-weight: 600; font-size: 22px; }
.ledger-table tfoot td { color: var(--primary); font-size: 30px; }

/* Checked as a bookkeeper checks a list: what other apps ask for struck off, what every buyer gets ticked, and the
   total stamped. */
.ledger-answer { display: inline-block; baseline-source: first; }
/* The strike is a background so it runs on through every line of an ask that wraps. */
.ledger-ask {
  margin-inline: -4px;
  padding-inline: 4px;
  color: var(--text-secondary);
  background: linear-gradient(var(--text), var(--text)) no-repeat 0 55% / calc(var(--struck, 1) * 100%) 2px;
}
.ledger-ticked td { color: var(--primary); }
.ledger-ticked .ledger-answer { padding-inline-start: 1.05em; text-indent: -1.05em; }
.ledger-ticked .ledger-answer::before {
  content: "";
  display: inline-block;
  width: 0.55em;
  height: 0.3em;
  margin-inline-end: 0.5em;
  border: solid currentColor;
  border-width: 0 0 3px 3px;
  transform: translateY(-0.2em) rotate(-45deg) scale(var(--ticked, 1));
}
.ledger-stamp { display: inline-block; padding: 4px 12px; border: 2px solid currentColor; }
[dir="rtl"] .ledger-ask { background-position: 100% 55%; }
[dir="rtl"] .ledger-table tfoot :is(th, td)::before { transform-origin: right center; }

/* Before the check: nothing struck, ticked, written in or ruled. */
.one-purchase.is-moving .ledger-ask { --struck: 0; }
.one-purchase.is-moving .ledger-ticked .ledger-answer { --ticked: 0; }
.one-purchase.is-moving .ledger-answer { clip-path: inset(0 100% 0 0); }
.one-purchase.is-moving tfoot :is(th, td) { --ruled: 0; }
.one-purchase.is-moving .ledger-stamp { opacity: 0; transform: scale(1.35); }
[dir="rtl"] .one-purchase.is-moving .ledger-answer { clip-path: inset(0 0 0 100%); }

/* Held still for the check, the beat fills the window. */
.one-purchase.is-moving { min-height: 100svh; align-content: center; }

@media (max-width: 599px) {
  .ledger-table th, .ledger-table td { padding: 12px; }
  .ledger-table td { font-size: 22px; }
}
@media (min-width: 1100px) {
  .one-purchase { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); gap: 56px; align-items: center; }
  .one-purchase .beat-head { margin-bottom: 0; }
  .ledger { max-width: none; }
}

/* scenes/before-you-ask/scene.css */
.before-you-ask { padding-block: 88px; }
.before-you-ask .beat-head { margin-bottom: 32px; }
.questions { display: grid; border-top: 1px solid var(--border-strong); }
.question { border-bottom: 1px solid var(--border-strong); }
.question summary {
  position: relative;
  display: flex;
  align-items: center;
  min-height: 64px;
  padding-block: 12px;
  padding-inline: 0 44px;
  cursor: pointer;
  list-style: none;
  font-family: "Barlow Condensed", system-ui, sans-serif;
  font-weight: 600;
  font-size: 24px;
  line-height: 1.15;
}
.question summary::-webkit-details-marker { display: none; }
/* The blueprint's "+" opens a question, and loses its upright line once it's open. */
.question summary::before,
.question summary::after {
  content: "";
  position: absolute;
  top: 50%;
  inset-inline-end: 10px;
  width: 18px;
  height: 2px;
  margin-top: -1px;
  background: var(--text);
}
.question summary::after { transform: rotate(90deg); transition: transform 0.2s ease; }
.question[open] summary::after { transform: rotate(0deg); }
.question p { max-width: 40em; margin: 0 0 20px; color: var(--text-secondary); font-size: 18px; }

@media (min-width: 1000px) {
  .questions { grid-template-columns: repeat(2, minmax(0, 1fr)); column-gap: 48px; }
}
@media (prefers-reduced-motion: reduce) {
  .question summary::after { transition: none; }
}

/* scenes/open-first-file/scene.css */
.open-first-file { display: grid; justify-items: start; gap: 28px; padding-block: 104px 96px; }
.end-mark { width: 72px; height: 72px; fill: var(--logo); }
.end-title {
  margin: 0;
  font-family: "Barlow Condensed", system-ui, sans-serif;
  font-weight: 600;
  font-size: clamp(60px, 9vw + 12px, 144px);
  line-height: 0.92;
  letter-spacing: -0.01em;
  text-wrap: balance;
}
.end-facts { margin: 0; color: var(--text-muted); font-size: 15px; }
