/**
 * Spendo - the home page at /
 *
 * Read after pages.css, which it builds on: the body, links, focus, .btn, .card, .rows
 * and the step marks are the sibling pages' own, so /, /install and /privacy read as
 * one site. Everything here comes from tokens.css. The only values of its own are the
 * display sizes, and those are derived from the app's type tokens rather than set
 * beside them.
 *
 * Unlike the app, this page is allowed to perform a little: it is read once, by
 * somebody deciding whether to use Spendo. The motion still only ever shows the
 * product doing what it does - an expense being added, a balance counting, bars
 * growing - and all of it stops under prefers-reduced-motion. Content is laid out in
 * its resting state; motion is something the script adds, and can lose, without
 * anything ending up hidden.
 *
 * The phone in the hero is the app's Home screen rebuilt at a scale, in units of the
 * phone's own width (--u is one pixel of a 360px-wide app), so it is the same picture
 * at any size.
 */

/* ----------------------------------------------------------------- page */

.home {
  /*
   * The page's motion curves. Measured from award sites (the taste-skill study): a
   * quart ease-out for things that rise and fade, an expo ease-out for long reveals and
   * lines climbing out of their masks. Neither overshoots - nothing on this page
   * bounces. Durations are multiples of the app's own tokens, so reduced motion, which
   * collapses those, collapses these too.
   */
  --ease-rise: cubic-bezier(0.22, 1, 0.36, 1);
  --ease-expo: cubic-bezier(0.16, 1, 0.3, 1);
  --t-fade: calc(var(--dur-reveal) * 1.15);
  --t-rise: calc(var(--dur-reveal) * 1.5);
  --t-open: calc(var(--dur-reveal) * 2.1);
  --top-h: 68px;
  --wrap: 72rem;
  --gutter: max(var(--space-4), env(safe-area-inset-left, 0px));
  --section-pad: clamp(4.5rem, 3rem + 6vw, 8rem);
  --phone-w: min(330px, 78vw);

  background-image:
    repeating-linear-gradient(45deg,  transparent 0 78px, var(--watermark) 78px 79px),
    repeating-linear-gradient(-45deg, transparent 0 78px, var(--watermark) 78px 79px);
  background-attachment: fixed;
  overflow-x: clip;
}

@media (min-width: 960px) {
  .home { --phone-w: 350px; }
}

html {
  scroll-behavior: smooth;
  scroll-padding-top: 88px;
}

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

/* No weight of its own, so every heading class below can set its own margins. */
:where(.home) :where(h1, h2, h3, h4) { margin: 0; }

.wrap {
  width: 100%;
  max-width: var(--wrap);
  margin-inline: auto;
  padding-inline: var(--gutter) max(var(--space-4), env(safe-area-inset-right, 0px));
}

.nowrap { white-space: nowrap; }

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

.skip {
  position: absolute;
  top: var(--space-2);
  left: var(--space-2);
  z-index: 60;
  padding: var(--space-3) var(--space-4);
  border-radius: var(--r-pill);
  background: var(--brand);
  color: var(--on-brand);
  font-weight: var(--weight-semibold);
  text-decoration: none;
  transform: translateY(-160%);
}

.skip:focus-visible { transform: none; }

main:focus { outline: none; }

/* What a browser that already holds a ledger is offered instead. home-boot.js sets the
   class before the first paint, so a button never shows one label and then the other. */
.for-known { display: none; }
.has-ledger .for-new { display: none; }
.has-ledger .for-known { display: inline; }

/* -------------------------------------------------------------- buttons */

.btn {
  cursor: pointer;
  border: 0;
  white-space: nowrap;
  transition:
    transform var(--dur-instant) var(--ease),
    background-color var(--dur-state) var(--ease),
    box-shadow var(--dur-state) var(--ease);
}

.btn[hidden] { display: none; }

.btn-sm {
  min-height: var(--tap-min);
  padding: 0 var(--space-5);
  font-size: var(--text-body);
}

.btn-lg {
  min-height: 56px;
  padding: 0 calc(var(--space-6) + var(--space-1));
  font-size: var(--text-row);
}

.btn-lg .glyph { width: 20px; height: 20px; }

.btn-ghost {
  background: transparent;
  color: var(--ink);
  box-shadow: inset 0 0 0 1px var(--line-strong);
}

.btn-ghost:hover {
  background: var(--surface);
  box-shadow: inset 0 0 0 1px var(--ink-3);
}

/* On the ink surfaces: the band, the signed-in card, the closing call. */
.btn-on-ink {
  background: var(--on-hero);
  color: var(--hero);
}

.btn-on-ink:hover { background: var(--on-hero-dim); }

.btn-ghost-ink {
  background: transparent;
  color: var(--on-hero);
  box-shadow: inset 0 0 0 1px var(--on-hero-track);
}

.btn-ghost-ink:hover {
  background: color-mix(in srgb, var(--on-hero) 8%, transparent);
  box-shadow: inset 0 0 0 1px var(--on-hero-dim);
}

.btn-on-ink:focus-visible,
.btn-ghost-ink:focus-visible,
.band a:focus-visible,
.plan-ink a:focus-visible { outline-color: var(--on-hero); }

.cta-row {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: var(--space-3);
}

/* ------------------------------------------------------------------ top */

.top {
  position: sticky;
  top: 0;
  z-index: 50;
  padding-top: var(--safe-top);
  background: var(--bg);
  transition: box-shadow var(--dur-state) var(--ease);
}

/* Set by an IntersectionObserver on the hero rather than a scroll listener. */
.top.is-stuck { box-shadow: 0 1px 0 var(--line); }

.top-in {
  display: flex;
  align-items: center;
  gap: var(--space-4);
  min-height: 68px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: var(--space-3);
  min-height: var(--tap-min);
  margin-right: auto;
  color: var(--ink);
  font-size: var(--text-row);
  font-weight: var(--weight-semibold);
  letter-spacing: -0.01em;
  text-decoration: none;
}

.brand img {
  width: 36px;
  height: 36px;
  border-radius: var(--r-field);
}

.top-nav { display: none; }

@media (min-width: 820px) {
  .top-nav {
    display: flex;
    gap: var(--space-1);
  }

  .top-nav a {
    display: inline-flex;
    align-items: center;
    min-height: var(--tap-min);
    padding: 0 var(--space-3);
    border-radius: var(--r-pill);
    color: var(--ink-2);
    font-weight: var(--weight-medium);
    text-decoration: none;
    transition: background-color var(--dur-state) var(--ease), color var(--dur-state) var(--ease);
  }

  .top-nav a:hover {
    background: var(--surface-sunken);
    color: var(--ink);
  }

  .top-nav + .btn { margin-left: var(--space-2); }
}

/* ----------------------------------------------------------------- hero */

.hero {
  position: relative;
  padding-top: clamp(var(--space-8), 2rem + 4vw, 5.5rem);
}

.hero-in {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}

.kicker {
  display: inline-flex;
  flex-wrap: wrap;
  justify-content: center;
  margin: 0;
  padding: 6px var(--space-4);
  border-radius: var(--r-pill);
  background: var(--surface);
  box-shadow: var(--shadow-card);
  color: var(--ink-2);
  font-size: var(--text-caption);
  font-weight: var(--weight-medium);
}

.kicker span + span::before {
  content: '·';
  margin: 0 var(--space-2);
  color: var(--ink-3);
}

.hero-title {
  max-width: 13ch;
  margin-top: var(--space-6);
  font-size: clamp(calc(var(--text-hero) * 0.92), 1.15rem + 6vw, calc(var(--text-hero) * 1.95));
  font-weight: var(--weight-semibold);
  line-height: 1;
  letter-spacing: -0.045em;
  text-wrap: balance;
}

.hero-lead {
  max-width: 36rem;
  margin: var(--space-6) 0 0;
  color: var(--ink-2);
  font-size: clamp(var(--text-row), 0.9rem + 0.45vw, 1.1875rem);
  line-height: 1.55;
  text-wrap: pretty;
}

.hero-in .cta-row { margin-top: var(--space-8); }

/* On a phone the two buttons stack and each takes the full width, rather than
   wrapping into two centred lumps of different lengths. */
@media (max-width: 479px) {
  .cta-row { width: 100%; }
  .cta-row .btn { flex: 1 1 100%; }
}

.hero-facts {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: var(--space-2) var(--space-5);
  margin: var(--space-5) 0 0;
  padding: 0;
  list-style: none;
  color: var(--ink-2);
  font-size: var(--text-caption);
  font-weight: var(--weight-medium);
}

.hero-facts li {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.hero-facts .glyph { width: 16px; height: 16px; }

/*
 * The opening, about 1.2 seconds, and nothing waits for the load event.
 *
 * home-boot.js puts .is-loading on <html> before the first paint; home.js takes it off
 * on its second frame. These are TRANSITIONS to the resting state, so one that never
 * runs still lands there, and home-boot.js takes the class off by itself after 2.5
 * seconds if this page's module never loads.
 *
 * In order: the bar drops in, the kicker, the headline climbs out of its baselines line
 * by line (home.js splits it), the lead and the buttons rise, and the phone comes up
 * from below while its screen switches on (home.js) - then the pieces round it.
 */
.top {
  transition:
    box-shadow var(--dur-state) var(--ease),
    opacity var(--t-fade) var(--ease-rise),
    transform var(--t-rise) var(--ease-expo);
}

[data-enter],
.stage .phone-figure,
.stage .float {
  transition:
    opacity var(--t-fade) var(--ease-rise),
    transform var(--t-rise) var(--ease-expo);
  transition-delay: var(--at, 0ms);
}

.is-loading .top {
  opacity: 0;
  transform: translateY(-14px);
}

.is-loading [data-enter] {
  opacity: 0;
  transform: translateY(14px);
}

/* Hidden until home.js has split it into lines, which then rise behind their masks. */
.is-loading .hero-title { opacity: 0; }

.is-loading .stage .phone-figure {
  opacity: 0;
  transform: translateY(16%) scale(0.94);
}

.is-loading .stage .float {
  opacity: 0;
  transform: translateY(44px) scale(0.96);
}

.kicker { --at: 60ms; }
.hero-title { --lines-at: 120ms; }
.hero-lead { --at: 440ms; }
.hero-in .cta-row { --at: 520ms; }
.hero-facts { --at: 600ms; }

.stage .phone-figure {
  --at: 240ms;
  transition-duration: var(--t-fade), var(--t-open);
}

.stage .float-1 { --at: 900ms; }
.stage .float-3 { --at: 980ms; }
.stage .float-2 { --at: 1060ms; }
.stage .float-4 { --at: 1140ms; }

/*
 * A heading split into lines by home.js, each line in a mask it climbs out of. The
 * masks are padded for descenders and the padding is given back, so the lines sit
 * exactly where the unsplit heading's did; home.js puts the plain heading back once
 * they have risen, so it rewraps with the window like any other text.
 */
.line {
  display: block;
  overflow: hidden;
  padding: 0.08em 0 0.12em;
  margin: -0.08em 0 -0.12em;
}

/* Down by its own height and the mask's padding below it, and then some: at 108% the
   tip of a tall letter showed through the descender room as a stray dash. */
.line-in {
  display: block;
  transform: translateY(calc(100% + 0.3em));
  transition: transform calc(var(--dur-reveal) * 1.35) var(--ease-expo);
  transition-delay: calc(var(--lines-at, 0ms) + var(--line, 0) * 90ms);
}

.is-up .line-in { transform: none; }

/* ----------------------------------------------------------- the stage */

/*
 * The phone stands with its feet in the ink band below. The band is this element's
 * own background, starting a little past halfway down the phone, so the page turns
 * from paper to ink behind it and carries on into the section after.
 */
.stage {
  position: relative;
  display: flex;
  justify-content: center;
  margin-top: clamp(var(--space-8) + var(--space-4), 2rem + 5vw, 5rem);
  padding: 0 var(--space-4) clamp(var(--space-8), 1.5rem + 3vw, 4rem);
  background: linear-gradient(to bottom, transparent calc(var(--phone-w) * 1.18), var(--hero) 0);
}

.phone-figure {
  position: relative;
  z-index: 2;
  margin: 0;
}

.phone-cap {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-2);
  margin-top: var(--space-5);
  color: var(--on-hero-dim);
  font-size: var(--text-caption);
  text-align: center;
}

/* Motion that starts by itself and runs longer than five seconds has to be stoppable
   (WCAG 2.2.2). Shown only while the demo is actually able to run. */
.demo-toggle {
  min-height: var(--tap-min);
  padding: 0 var(--space-5);
  border: 0;
  border-radius: var(--r-pill);
  background: transparent;
  box-shadow: inset 0 0 0 1px var(--on-hero-track);
  color: var(--on-hero);
  font: inherit;
  font-weight: var(--weight-semibold);
  cursor: pointer;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
  transition:
    background-color var(--dur-state) var(--ease),
    transform var(--dur-instant) var(--ease);
}

.demo-toggle[hidden] { display: none; }
.demo-toggle:hover { background: color-mix(in srgb, var(--on-hero) 8%, transparent); }
.demo-toggle:active { transform: scale(var(--press-scale)); }
.demo-toggle:focus-visible { outline-color: var(--on-hero); }

/* ---------------------------------------------------------- the phone */

.phone {
  position: relative;
  width: var(--phone-w);
  aspect-ratio: 9 / 19.5;
  padding: calc(var(--phone-w) * 0.028);
  border-radius: calc(var(--r-card) * 2.75);
  background: var(--hero-edge);
  box-shadow:
    0 0 0 1px var(--on-hero-track),
    inset 0 0 0 1px color-mix(in srgb, var(--on-hero) 8%, transparent),
    0 40px 80px -24px color-mix(in srgb, var(--hero-edge) 55%, transparent),
    0 24px 40px -20px color-mix(in srgb, var(--hero-edge) 40%, transparent);
}

.phone-screen {
  position: relative;
  height: 100%;
  overflow: hidden;
  border-radius: calc(var(--r-card) * 2.75 - var(--phone-w) * 0.028);
  background: var(--bg);
  container-type: inline-size;
  isolation: isolate;
  user-select: none;
}

/* The camera, so the rectangle reads as a phone at a glance. */
.phone-screen::before {
  content: '';
  position: absolute;
  top: calc(10 * var(--u));
  left: 50%;
  z-index: 6;
  width: calc(10 * var(--u));
  height: calc(10 * var(--u));
  margin-left: calc(-5 * var(--u));
  border-radius: var(--r-pill);
  background: var(--hero-edge);
}

.phone-screen,
.mock {
  --u: calc(100cqw / 360);
}

.m-app {
  padding-top: calc(32 * var(--u));
  transition: opacity var(--dur-sheet) var(--ease);
}

.m-app.is-resetting { opacity: 0; }

/* The screen switching on as the phone arrives: home.js lets go of these, and the
   balance counts up while each day's bar grows out of the baseline in turn. */
.is-booting .m-app { opacity: 0; }

.m-bars.is-from i { transform: scaleY(0); }

.m-ic {
  width: 1em;
  height: 1em;
  flex: none;
  fill: currentColor;
}

.m-top {
  display: flex;
  align-items: center;
  gap: calc(10 * var(--u));
  padding: 0 calc(16 * var(--u));
  min-height: calc(46 * var(--u));
  color: var(--ink-3);
  font-size: calc(18 * var(--u));
}

.m-month {
  color: var(--ink);
  font-size: calc(25 * var(--u));
  font-weight: var(--weight-semibold);
  letter-spacing: var(--track-tight);
}

/* The balance card. */
.m-hero {
  margin: calc(8 * var(--u)) calc(16 * var(--u)) 0;
  padding: calc(18 * var(--u));
  border-radius: var(--r-card);
  background: linear-gradient(150deg, var(--hero) 0%, var(--hero-edge) 100%);
  box-shadow: var(--shadow-hero);
  color: var(--on-hero);
}

.m-label {
  margin: 0;
  color: var(--on-hero-dim);
  font-size: calc(11 * var(--u));
  font-weight: var(--weight-semibold);
  letter-spacing: var(--track-label);
  text-transform: uppercase;
}

.m-balance {
  margin: calc(8 * var(--u)) 0 calc(14 * var(--u));
  font-size: calc(40 * var(--u));
  font-weight: var(--weight-semibold);
  line-height: 1;
  letter-spacing: var(--track-tight);
}

.m-meter {
  display: block;
  height: calc(5 * var(--u));
  overflow: hidden;
  border-radius: var(--r-pill);
  background: var(--on-hero-track);
}

.m-meter i {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: var(--on-hero);
  transform: scaleX(var(--fill));
  transform-origin: left center;
  transition: transform var(--dur-count) var(--ease);
}

.m-note {
  margin: calc(10 * var(--u)) 0 0;
  color: var(--on-hero-dim);
  font-size: calc(11.5 * var(--u));
}

.m-note .money { color: var(--on-hero); font-weight: var(--weight-medium); }

/* Spending per day. */
.m-card {
  margin: calc(12 * var(--u)) calc(16 * var(--u)) 0;
  padding: calc(14 * var(--u)) calc(16 * var(--u)) calc(10 * var(--u));
  border-radius: var(--r-card);
  background: var(--surface);
  box-shadow: var(--shadow-card);
}

.m-card-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: calc(8 * var(--u));
  margin: 0;
  font-size: calc(11 * var(--u));
  color: var(--ink-3);
  white-space: nowrap;
}

.m-card-head b {
  color: var(--ink);
  font-size: calc(14 * var(--u));
  font-weight: var(--weight-semibold);
}

.m-bars,
.k-bars {
  position: relative;
  display: flex;
  align-items: flex-end;
  border-bottom: 1px solid var(--line);
}

.m-bars {
  height: calc(64 * var(--u));
  gap: calc(2 * var(--u));
  margin-top: calc(14 * var(--u));
}

.m-bars i,
.k-bars i {
  flex: 1;
  height: 100%;
  border-radius: 2px 2px 0 0;
  background: var(--brand);
  transform: scaleY(var(--h));
  transform-origin: bottom;
  transition:
    transform var(--dur-count) var(--ease),
    opacity var(--dur-state) var(--ease);
}

/* The even pace: the month's pot spread over its days, the line a day should stay
   under. Dotted, and behind the bars, as in the app. */
.m-bars::after,
.k-bars::after {
  content: '';
  position: absolute;
  left: 0;
  right: 0;
  bottom: calc(var(--even) * 100%);
  border-top: 1.5px dotted var(--ink-3);
  opacity: 0.7;
  pointer-events: none;
}

.m-axis {
  display: flex;
  justify-content: space-between;
  margin: calc(6 * var(--u)) 0 0;
  color: var(--ink-3);
  font-size: calc(9.5 * var(--u));
  font-variant-numeric: tabular-nums;
}

.m-list-head {
  display: flex;
  align-items: center;
  gap: calc(8 * var(--u));
  margin: calc(18 * var(--u)) calc(16 * var(--u)) calc(8 * var(--u));
  font-size: calc(15 * var(--u));
  font-weight: var(--weight-semibold);
}

.m-list-head .m-ic { font-size: calc(18 * var(--u)); }

/* The ledger: lines inside one surface. */
.m-rows {
  margin: 0 calc(16 * var(--u));
  overflow: hidden;
  border-radius: var(--r-card);
  background: var(--surface);
  box-shadow: var(--shadow-card);
}

.m-row {
  display: flex;
  align-items: center;
  gap: calc(10 * var(--u));
  min-height: calc(56 * var(--u));
  padding: calc(8 * var(--u)) calc(12 * var(--u));
  background: var(--surface);
}

.m-row:not(:first-child) { border-top: 1px solid var(--line); }

.m-row.is-new {
  animation: m-flash calc(var(--dur-reveal) * 2) var(--ease);
}

@keyframes m-flash {
  from { background: var(--brand-tint); }
}

.m-date {
  display: flex;
  flex: none;
  flex-direction: column;
  align-items: center;
  width: calc(26 * var(--u));
  line-height: 1.1;
}

.m-date small {
  color: var(--ink-3);
  font-size: calc(9 * var(--u));
}

.m-date b {
  font-size: calc(16 * var(--u));
  font-weight: var(--weight-medium);
  font-variant-numeric: tabular-nums;
}

/* A category tile: the hue at 12% on the surface, the glyph in the hue itself. */
.tile {
  display: grid;
  flex: none;
  place-items: center;
  border-radius: var(--r-tile);
  background: color-mix(in srgb, var(--hue) 12%, var(--surface));
  color: var(--hue);
}

.tile svg {
  width: 55%;
  height: 55%;
  fill: currentColor;
}

.m-row .tile {
  width: calc(34 * var(--u));
  height: calc(34 * var(--u));
}

.m-what {
  display: flex;
  flex: 1;
  flex-direction: column;
  min-width: 0;
  line-height: 1.25;
}

.m-what b,
.m-what small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.m-what b {
  font-size: calc(13.5 * var(--u));
  font-weight: var(--weight-medium);
}

.m-what small {
  color: var(--ink-3);
  font-size: calc(11 * var(--u));
}

.m-amt {
  font-size: calc(13.5 * var(--u));
  font-weight: var(--weight-semibold);
  white-space: nowrap;
}

.is-out { color: var(--spend); }
.is-in { color: var(--receive); }

/* The Add button and the nav, over the bottom of the list as in the app. */
.m-fab {
  position: absolute;
  right: calc(14 * var(--u));
  bottom: calc(76 * var(--u));
  z-index: 3;
  display: flex;
  align-items: center;
  gap: calc(8 * var(--u));
  height: calc(50 * var(--u));
  padding: 0 calc(18 * var(--u));
  border-radius: var(--r-pill);
  background: var(--brand);
  box-shadow: var(--shadow-fab);
  color: var(--on-brand);
  font-size: calc(15 * var(--u));
  font-weight: var(--weight-semibold);
  transition: transform var(--dur-instant) var(--ease);
}

.m-fab .m-ic { font-size: calc(21 * var(--u)); }

.m-fab.is-pressed,
.m-save.is-pressed { transform: scale(0.94); }

.m-nav {
  position: absolute;
  inset: auto 0 0;
  z-index: 3;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  height: calc(64 * var(--u));
  padding-bottom: calc(6 * var(--u));
  border-top: 1px solid var(--line);
  background: var(--surface);
}

.m-nav span {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: calc(3 * var(--u));
  color: var(--ink-3);
  font-size: calc(10.5 * var(--u));
  font-weight: var(--weight-medium);
}

.m-nav i {
  display: grid;
  place-items: center;
  width: calc(52 * var(--u));
  height: calc(28 * var(--u));
  border-radius: var(--r-pill);
  font-size: calc(19 * var(--u));
}

.m-nav .is-on { color: var(--brand); }
.m-nav .is-on i { background: var(--brand-tint); }

/* The add sheet, rising over a scrim. */
.m-scrim {
  position: absolute;
  inset: 0;
  z-index: 4;
  background: color-mix(in srgb, var(--hero-edge) 40%, transparent);
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--dur-sheet) var(--ease);
}

.m-sheet {
  position: absolute;
  inset: auto 0 0;
  z-index: 5;
  padding: calc(10 * var(--u)) calc(16 * var(--u)) calc(20 * var(--u));
  border-radius: var(--r-card) var(--r-card) 0 0;
  background: var(--surface);
  box-shadow: var(--shadow-raised);
  transform: translateY(105%);
  transition: transform var(--dur-sheet) var(--ease-exit);
}

.is-adding .m-scrim { opacity: 1; }

.is-adding .m-sheet {
  transform: none;
  transition: transform calc(var(--dur-sheet) * 1.3) var(--ease-expo);
}

.m-grab {
  display: block;
  width: calc(36 * var(--u));
  height: calc(4 * var(--u));
  margin: 0 auto calc(12 * var(--u));
  border-radius: var(--r-pill);
  background: var(--line-strong);
}

.m-sheet-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin: 0;
}

.m-sheet-head b {
  font-size: calc(17 * var(--u));
  font-weight: var(--weight-semibold);
}

.m-sheet-head span {
  display: inline-flex;
  align-items: center;
  gap: calc(5 * var(--u));
  padding: calc(5 * var(--u)) calc(10 * var(--u));
  border-radius: var(--r-pill);
  background: var(--surface-sunken);
  font-size: calc(12 * var(--u));
  font-weight: var(--weight-medium);
}

.m-flabel {
  margin: calc(14 * var(--u)) 0 calc(6 * var(--u));
  color: var(--ink-3);
  font-size: calc(10 * var(--u));
  font-weight: var(--weight-semibold);
  letter-spacing: var(--track-label);
  text-transform: uppercase;
}

.m-field {
  display: flex;
  align-items: center;
  min-height: calc(40 * var(--u));
  margin: 0;
  padding: 0 calc(12 * var(--u));
  border-radius: var(--r-field);
  background: var(--surface-sunken);
  font-size: calc(14.5 * var(--u));
  white-space: nowrap;
  overflow: hidden;
}

.m-field-amount {
  min-height: calc(46 * var(--u));
  font-size: calc(22 * var(--u));
  font-weight: var(--weight-semibold);
  font-variant-numeric: tabular-nums;
}

.m-rupee {
  margin-right: calc(6 * var(--u));
  color: var(--ink-3);
}

/* One caret, in whichever field is being typed into. */
.m-caret {
  display: none;
  width: 1.5px;
  height: 1.1em;
  margin-left: 1px;
  background: var(--brand);
}

.is-active .m-caret {
  display: inline-block;
  animation: blink 1s steps(1) infinite;
}

@keyframes blink {
  50% { opacity: 0; }
}

.m-chips {
  display: flex;
  flex-wrap: wrap;
  gap: calc(6 * var(--u));
  margin: 0;
}

.m-chips span {
  display: inline-flex;
  align-items: center;
  gap: calc(5 * var(--u));
  height: calc(30 * var(--u));
  padding: 0 calc(11 * var(--u));
  border-radius: var(--r-pill);
  background: var(--surface-sunken);
  color: var(--on-sunken);
  font-size: calc(12 * var(--u));
  font-weight: var(--weight-medium);
  transition:
    background-color var(--dur-state) var(--ease),
    color var(--dur-state) var(--ease),
    transform var(--dur-state) var(--ease-expo);
}

.m-chips .m-ic { font-size: calc(14 * var(--u)); }

.m-chips .is-on {
  background: var(--brand);
  color: var(--on-brand);
}

.m-save {
  display: flex;
  align-items: center;
  justify-content: center;
  height: calc(44 * var(--u));
  margin-top: calc(16 * var(--u));
  border-radius: var(--r-pill);
  background: var(--brand);
  color: var(--on-brand);
  font-size: calc(14 * var(--u));
  font-weight: var(--weight-semibold);
  transition: transform var(--dur-instant) var(--ease);
}

/* The toast: the page's colours turned over, dropping in at the top, with the line
   that shrinks over the time Undo is on offer. */
.m-toast {
  position: absolute;
  top: calc(30 * var(--u));
  left: 0;
  right: 0;
  z-index: 7;
  display: flex;
  align-items: center;
  gap: calc(8 * var(--u));
  width: max-content;
  max-width: 88%;
  margin-inline: auto;
  padding: calc(9 * var(--u)) calc(14 * var(--u));
  overflow: hidden;
  border-radius: var(--r-pill);
  background: var(--ink);
  box-shadow: 0 0 0 1px color-mix(in srgb, var(--surface) 32%, transparent), var(--shadow-raised);
  color: var(--surface);
  font-size: calc(12.5 * var(--u));
  font-weight: var(--weight-medium);
  opacity: 0;
  transform: translateY(calc(-10 * var(--u)));
  transition:
    opacity var(--dur-sheet) var(--ease),
    transform var(--dur-sheet) var(--ease);
}

.m-toast.is-on {
  opacity: 1;
  transform: none;
}

.m-toast b {
  margin-left: calc(6 * var(--u));
  font-weight: var(--weight-semibold);
}

.m-toast .m-ic { font-size: calc(15 * var(--u)); }

.m-toast-line {
  position: absolute;
  left: calc(14 * var(--u));
  right: calc(14 * var(--u));
  bottom: calc(3 * var(--u));
  height: 2px;
  border-radius: var(--r-pill);
  background: var(--surface);
  opacity: 0.4;
  transform-origin: left center;
}

.m-toast.is-on .m-toast-line { animation: shrink 2s linear forwards; }

@keyframes shrink {
  to { transform: scaleX(0); }
}

/* ----------------------------------------------- pieces round the phone */

.float { display: none; }

@media (min-width: 1100px) {
  .float {
    position: absolute;
    z-index: 1;
    display: flex;
    align-items: center;
    gap: var(--space-3);
    width: 15.5rem;
    padding: var(--space-3) var(--space-4) var(--space-3) var(--space-3);
    border-radius: var(--r-card);
    background: var(--surface);
    box-shadow: var(--shadow-raised);
  }

  .float .tile { width: 40px; height: 40px; }

  .float-what {
    display: flex;
    flex: 1;
    flex-direction: column;
    min-width: 0;
    line-height: 1.3;
  }

  .float-what b { font-size: var(--text-body); font-weight: var(--weight-medium); }
  .float-what small { color: var(--ink-3); font-size: var(--text-caption); }

  .float-amt {
    font-size: var(--text-body);
    font-weight: var(--weight-semibold);
  }

  .float-1 { top: 9%;  right: calc(50% + var(--phone-w) / 2 + 3rem); }
  .float-2 { top: 50%; right: calc(50% + var(--phone-w) / 2 + 6.5rem); }
  .float-3 { top: 20%; left: calc(50% + var(--phone-w) / 2 + 4.5rem); }
  .float-4 { top: 60%; left: calc(50% + var(--phone-w) / 2 + 2.5rem); }

  .float-budget {
    flex-direction: column;
    align-items: stretch;
    gap: var(--space-3);
    padding: var(--space-4);
  }

  .float-meter {
    display: block;
    height: 6px;
    overflow: hidden;
    border-radius: var(--r-pill);
    background: var(--surface-sunken);
  }

  .float-meter i {
    display: block;
    height: 100%;
    border-radius: inherit;
    background: var(--brand);
    transform: scaleX(var(--fill));
    transform-origin: left center;
  }
}

/* Where a scroll timeline exists, the pieces drift at their own pace as the page
   moves past, which is what makes them read as layers rather than stickers. */
@supports (animation-timeline: view()) {
  @media (min-width: 1100px) and (prefers-reduced-motion: no-preference) {
    .float {
      animation: drift linear both;
      animation-timeline: view();
      animation-range: cover;
    }

    .float-2, .float-4 { --drift: 56px; }
  }
}

@keyframes drift {
  from { translate: 0 var(--drift, 32px); }
  to   { translate: 0 calc(var(--drift, 32px) * -1); }
}

/* ------------------------------------------------------------- the bands */

.band {
  background: var(--hero);
  color: var(--on-hero);
}

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

/*
 * One statement, in the page's largest type after the headline. Where scroll timelines
 * exist its words fill with ink one after another as it passes (home.js wraps them);
 * anywhere else, and under reduced motion, it is simply printed in full.
 */
.statement {
  max-width: 28ch;
  margin: 0;
  padding: clamp(3.5rem, 2rem + 5vw, 7rem) 0 clamp(3rem, 2rem + 4vw, 5.5rem);
  font-size: clamp(calc(var(--text-title) * 0.95), 0.9rem + 3.3vw, calc(var(--text-hero) * 1.2));
  font-weight: var(--weight-semibold);
  line-height: 1.12;
  letter-spacing: -0.03em;
  text-wrap: pretty;
}

.pillars {
  display: grid;
  margin: 0;
  padding: var(--space-6) 0 0;
  list-style: none;
  border-top: 1px solid color-mix(in srgb, var(--on-hero) 14%, transparent);
}

.pillars li {
  padding: var(--space-6) 0;
}

.pillars li + li { border-top: 1px solid color-mix(in srgb, var(--on-hero) 14%, transparent); }

@media (min-width: 760px) {
  .pillars { grid-template-columns: repeat(3, minmax(0, 1fr)); }

  .pillars li {
    padding: var(--space-2) var(--space-8);
  }

  .pillars li:first-child { padding-left: 0; }
  .pillars li:last-child { padding-right: 0; }

  .pillars li + li {
    border-top: 0;
    border-left: 1px solid color-mix(in srgb, var(--on-hero) 14%, transparent);
  }
}

.pillar-icon {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border-radius: var(--r-field);
  background: color-mix(in srgb, var(--on-hero) 10%, transparent);
}

.pillar-icon .glyph { width: 22px; height: 22px; }

.pillars h3 {
  margin: var(--space-4) 0 var(--space-2);
  font-size: calc(var(--text-section) * 0.95);
  font-weight: var(--weight-semibold);
  letter-spacing: -0.01em;
}

.pillars p {
  margin: 0;
  color: var(--on-hero-dim);
  text-wrap: pretty;
}

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

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

.section + .section { border-top: 1px solid var(--line); }

.intro {
  max-width: 46rem;
}

.eyebrow {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  margin: 0;
  color: var(--ink-3);
  font-size: var(--text-label);
  font-weight: var(--weight-semibold);
  letter-spacing: var(--track-label);
  text-transform: uppercase;
}

.eyebrow::before {
  content: '';
  width: 20px;
  height: 2px;
  border-radius: var(--r-pill);
  background: currentColor;
}

.band .eyebrow { color: var(--on-hero-dim); }

.h2 {
  margin-top: var(--space-4);
  font-size: clamp(calc(var(--text-display) * 0.94), 1.1rem + 3vw, calc(var(--text-hero) * 1.2));
  font-weight: var(--weight-semibold);
  line-height: 1.06;
  letter-spacing: -0.035em;
  text-wrap: balance;
}

.intro-lead {
  margin: var(--space-5) 0 0;
  color: var(--ink-2);
  font-size: clamp(var(--text-row), 0.92rem + 0.3vw, 1.125rem);
  text-wrap: pretty;
}

.h3 {
  font-size: clamp(calc(var(--text-section) * 1.2), 1rem + 1.4vw, var(--text-display));
  font-weight: var(--weight-semibold);
  line-height: 1.12;
  letter-spacing: -0.025em;
  text-wrap: balance;
}

/* -------------------------------------------------------------- the story */

/*
 * Four chapters and their four pictures.
 *
 * On a phone each picture follows its chapter: the stage and its frame are
 * display: contents, so the pictures are items of this grid, put in place by `order`.
 *
 * On a wide screen without the script, chapters are the left column and each picture
 * sits in the row beside its own. With it (.is-live, from home.js), the pictures are
 * held in one sticky stage while the chapters pass - position: sticky, never a hijacked
 * scroll - and the chapter crossing the middle of the screen chooses the picture.
 */
.story {
  display: grid;
  gap: var(--space-8);
  margin-top: clamp(3rem, 2rem + 4vw, 5.5rem);
}

.story-stage,
.story-frame { display: contents; }

.story-count { display: none; }

.chapter[data-step='0'] { order: 1; }
.mock[data-step='0']    { order: 2; }
.chapter[data-step='1'] { order: 3; }
.mock[data-step='1']    { order: 4; }
.chapter[data-step='2'] { order: 5; }
.mock[data-step='2']    { order: 6; }
.chapter[data-step='3'] { order: 7; }
.mock[data-step='3']    { order: 8; }

.chapter:not([data-step='0']) { margin-top: var(--space-8); }

@media (min-width: 960px) {
  .story {
    grid-template-columns: minmax(0, 5fr) minmax(0, 6fr);
    column-gap: clamp(3rem, 1rem + 4vw, 6rem);
    row-gap: clamp(4rem, 2.5rem + 6vw, 7.5rem);
    align-items: center;
  }

  .story .chapter {
    grid-column: 1;
    margin-top: 0;
  }

  .story .mock { grid-column: 2; }

  .chapter[data-step='0'], .mock[data-step='0'] { grid-row: 1; }
  .chapter[data-step='1'], .mock[data-step='1'] { grid-row: 2; }
  .chapter[data-step='2'], .mock[data-step='2'] { grid-row: 3; }
  .chapter[data-step='3'], .mock[data-step='3'] { grid-row: 4; }

  .story.is-live {
    row-gap: 0;
    align-items: stretch;
  }

  .story.is-live .chapter {
    grid-row: auto;
    display: flex;
    flex-direction: column;
    justify-content: center;
    min-height: 86svh;
    opacity: 0.4;
    transition: opacity var(--dur-sheet) var(--ease);
  }

  .story.is-live .chapter.is-active { opacity: 1; }

  .story.is-live .story-stage {
    position: sticky;
    top: var(--top-h);
    grid-column: 2;
    grid-row: 1 / span 4;
    align-self: start;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: var(--space-6);
    height: calc(100svh - var(--top-h));
  }

  .story.is-live .story-frame {
    display: grid;
    width: 100%;
    max-width: 28rem;
  }

  /* The pictures cross: the one leaving fades and lifts away, the one arriving rises
     into its place a beat later. */
  .story.is-live .mock {
    grid-area: 1 / 1;
    align-self: center;
    opacity: 0;
    transform: translateY(36px) scale(0.97);
    transition:
      opacity calc(var(--dur-reveal) * 0.6) var(--ease-rise),
      transform var(--t-rise) var(--ease-expo);
  }

  .story.is-live .mock.is-past { transform: translateY(-36px) scale(0.97); }
  .story.is-live .mock:not(.is-active) { pointer-events: none; }

  .story.is-live .mock.is-active {
    opacity: 1;
    transform: none;
    transition-delay: 120ms;
  }

  .story.is-live .story-count {
    display: flex;
    align-items: center;
    gap: var(--space-3);
    margin: 0;
    color: var(--ink-3);
    font-size: var(--text-caption);
    font-variant-numeric: tabular-nums;
  }

  .story-count b {
    color: var(--ink);
    font-weight: var(--weight-semibold);
  }

  .story-rail {
    display: flex;
    gap: 6px;
  }

  .story-rail i {
    width: 22px;
    height: 3px;
    border-radius: var(--r-pill);
    background: var(--line-strong);
    transition: background-color var(--dur-sheet) var(--ease);
  }

  .story-rail i.is-on { background: var(--brand); }
}

/* A laptop screen is not tall enough for the tallest picture at full size. */
@media (min-width: 960px) and (max-height: 820px) {
  .story.is-live .story-frame { scale: 0.86; }
}

.chapter .h3 { margin: var(--space-4) 0 var(--space-3); }

.chapter-copy > p:not(.eyebrow) {
  margin: 0;
  color: var(--ink-2);
  font-size: clamp(var(--text-body), 0.88rem + 0.25vw, 1.0625rem);
  text-wrap: pretty;
}

.ticks {
  display: grid;
  gap: var(--space-3);
  margin: var(--space-6) 0 0;
  padding: 0;
  list-style: none;
}

/* Not a flex row: an item holding a <q> would split into flex items with a gap in the
   middle of the sentence. */
.ticks li {
  position: relative;
  padding-left: 26px;
  color: var(--ink);
  font-weight: var(--weight-medium);
}

/* A tick drawn from two borders, so a list mark does not cost an icon each. */
.ticks li::before {
  content: '';
  position: absolute;
  top: 4px;
  left: 4px;
  width: 6px;
  height: 11px;
  border: solid var(--ink);
  border-width: 0 2px 2px 0;
  transform: rotate(45deg);
}

q { quotes: '“' '”'; }

/* ------------------------------------------------------- the small mocks */

/*
 * Each chapter's picture is a piece of the app at its own size, built from the same
 * tokens. Their resting state is the finished picture; home.js plays them in once,
 * the first time each scrolls into view.
 */
.mock {
  position: relative;
  justify-self: center;
  width: 100%;
  max-width: 28rem;
  padding: var(--space-5);
  border-radius: var(--r-card);
  background: var(--surface);
  box-shadow: var(--shadow-raised);
  container-type: inline-size;
}

.k-ic {
  width: 1em;
  height: 1em;
  flex: none;
  fill: currentColor;
}

.k-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin: 0;
}

.k-head b {
  font-size: calc(var(--text-section) * 0.9);
  font-weight: var(--weight-semibold);
}

.k-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 34px;
  padding: 0 var(--space-3);
  border-radius: var(--r-pill);
  background: var(--surface-sunken);
  font-size: var(--text-caption);
  font-weight: var(--weight-medium);
}

.k-seg {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-1);
  margin: var(--space-4) 0 var(--space-1);
  padding: var(--space-1);
  border-radius: var(--r-pill);
  background: var(--surface-sunken);
}

.k-seg > * {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 40px;
  border-radius: var(--r-pill);
  color: var(--ink-2);
  font-size: var(--text-body);
  font-weight: var(--weight-medium);
}

.k-seg .k-ic { font-size: 1.35rem; }

.k-seg .is-on {
  background: var(--brand);
  color: var(--on-brand);
}

.k-label {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  margin: var(--space-4) 0 6px;
  color: var(--ink-3);
  font-size: var(--text-label);
  font-weight: var(--weight-semibold);
  letter-spacing: var(--track-label);
  text-transform: uppercase;
}

.k-guess {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px var(--space-2);
  border-radius: var(--r-pill);
  background: var(--brand-tint);
  color: var(--ink-2);
  font-size: var(--text-label);
  letter-spacing: 0;
  text-transform: none;
  transition: opacity var(--dur-state) var(--ease), transform var(--dur-sheet) var(--ease-expo);
}

.k-guess.is-hidden {
  opacity: 0;
  transform: scale(0.8);
}

.k-field {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  min-height: 46px;
  margin: 0;
  padding: 0 var(--space-4);
  border-radius: var(--r-field);
  background: var(--surface-sunken);
  font-size: var(--text-row);
  white-space: nowrap;
  overflow: hidden;
}

.k-amount {
  min-height: 54px;
  font-size: calc(var(--text-title) * 0.95);
  font-weight: var(--weight-semibold);
  letter-spacing: var(--track-tight);
}

.k-amount span {
  color: var(--ink-3);
  font-size: 0.75em;
}

.k-amount b { font-weight: inherit; }

/* The fields take typing: an input where the text sat, inheriting its look. */
.k-field input {
  flex: 1;
  min-width: 0;
  height: 100%;
  min-height: inherit;
  padding: 0;
  border: 0;
  background: transparent;
  color: inherit;
  font: inherit;
  letter-spacing: inherit;
  outline: none;
}
.k-field input::placeholder { color: var(--ink-3); font-weight: var(--weight-regular); }
.k-field:focus-within,
.k-field.is-typing {
  outline: 2px solid var(--brand);
  outline-offset: -2px;
}

.k-error {
  margin: 6px 0 0;
  color: var(--spend);
  font-size: var(--text-caption);
  font-weight: var(--weight-medium);
}

[data-type].is-typing::after {
  content: '';
  display: inline-block;
  width: 1.5px;
  height: 1em;
  margin-left: 2px;
  vertical-align: -0.12em;
  background: var(--brand);
  animation: blink 1s steps(1) infinite;
}

.k-chips {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
  margin: 0;
}

.k-chips > * {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 36px;
  padding: 0 var(--space-4);
  border-radius: var(--r-pill);
  background: var(--surface-sunken);
  color: var(--on-sunken);
  font-size: var(--text-body);
  font-weight: var(--weight-medium);
  transition:
    background-color var(--dur-state) var(--ease),
    color var(--dur-state) var(--ease),
    transform var(--dur-sheet) var(--ease-expo);
}

.k-chips .k-ic { font-size: 1.05rem; }

.k-chips .is-on {
  background: var(--brand);
  color: var(--on-brand);
}

.k-chips .is-popping { transform: scale(1.08); }

.k-seg > button,
.k-chips > button,
.k-save {
  border: 0;
  font-family: inherit;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
.k-chips > button { font-size: var(--text-body); }
.k-seg > button { background: transparent; }
.k-seg > button.is-on { background: var(--brand); }
.k-seg > button:active,
.k-chips > button:active,
.k-save:active { transform: scale(var(--press-scale)); }
.k-seg > button:focus-visible,
.k-chips > button:focus-visible,
.k-save:focus-visible {
  outline: 2px solid var(--brand);
  outline-offset: 2px;
}
@media (hover: hover) {
  .k-chips > button:not(.is-on):hover { background: var(--surface-hover); }
  .k-seg > button:not(.is-on):hover { color: var(--ink); }
}

/* The category row, once it holds every category: one line that scrolls sideways, as
   the app's does, with its end fading so the next chip shows it is there. */
.k-chips.is-scroll {
  flex-wrap: nowrap;
  overflow-x: auto;
  overscroll-behavior-x: contain;
  scrollbar-width: none;
  margin-inline: calc(var(--space-5) * -1);
  padding-inline: var(--space-5);
  -webkit-mask-image: linear-gradient(to right, transparent 0, #000 var(--space-4), #000 calc(100% - var(--space-6)), transparent);
  mask-image: linear-gradient(to right, transparent 0, #000 var(--space-4), #000 calc(100% - var(--space-6)), transparent);
}
.k-chips.is-scroll::-webkit-scrollbar { display: none; }
.k-chips.is-scroll > * { flex: none; }

.k-save {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  min-height: 50px;
  margin-top: var(--space-5);
  border-radius: var(--r-pill);
  background: var(--brand);
  color: var(--on-brand);
  font-size: var(--text-body);
  font-weight: var(--weight-semibold);
  transition: transform var(--dur-instant) var(--ease);
}
.k-save.is-done { animation: saved var(--dur-sheet) var(--ease-expo); }
@keyframes saved {
  40% { transform: scale(0.96); }
}

/* What a picture that can be used says under itself. */
.k-try {
  margin: var(--space-3) 0 0;
  color: var(--ink-3);
  font-size: var(--text-caption);
  text-align: center;
}

/*
 * The save's toast, as the app's drops in: the page's colours turned over, at the top
 * of the sheet. It says what was saved and, in the same breath, that nothing was kept.
 * Shown by a class and a transition, so a toast that never animates still lands.
 */
.k-toast {
  position: absolute;
  top: var(--space-3);
  left: var(--space-3);
  right: var(--space-3);
  z-index: 2;
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-3) var(--space-4);
  border-radius: var(--r-card);
  background: var(--ink);
  color: var(--surface);
  box-shadow: var(--shadow-raised);
  opacity: 0;
  visibility: hidden;
  transform: translateY(-10px);
  transition:
    opacity var(--dur-state) var(--ease),
    transform var(--dur-sheet) var(--ease-expo),
    visibility 0s linear var(--dur-state);
}
.k-toast.is-on {
  opacity: 1;
  visibility: visible;
  transform: none;
  transition:
    opacity var(--dur-state) var(--ease),
    transform var(--dur-sheet) var(--ease-expo),
    visibility 0s;
}
.k-toast-mark {
  display: grid;
  place-items: center;
  flex: none;
  width: 28px;
  height: 28px;
  border-radius: var(--r-pill);
  box-shadow: inset 0 0 0 1.5px currentColor;
  font-size: 0.95rem;
}
.k-toast-text { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.k-toast-text b { font-weight: var(--weight-semibold); }
.k-toast-text small { opacity: 0.8; font-size: var(--text-caption); line-height: 1.35; }
.k-toast-go {
  flex: none;
  margin-left: auto;
  padding: var(--space-2) var(--space-3);
  border-radius: var(--r-pill);
  color: inherit;
  font-size: var(--text-caption);
  font-weight: var(--weight-semibold);
  text-decoration: none;
  box-shadow: inset 0 0 0 1px currentColor;
}
.k-toast-go:focus-visible { outline: 2px solid var(--surface); outline-offset: 2px; }

/* Balance and chart. */
.k-hero {
  padding: var(--space-5);
  border-radius: var(--r-card);
  background: linear-gradient(150deg, var(--hero) 0%, var(--hero-edge) 100%);
  box-shadow: var(--shadow-hero);
  color: var(--on-hero);
}

.k-hero-label {
  margin: 0;
  color: var(--on-hero-dim);
  font-size: var(--text-label);
  font-weight: var(--weight-semibold);
  letter-spacing: var(--track-label);
  text-transform: uppercase;
}

.k-hero-figure {
  margin: var(--space-2) 0 var(--space-4);
  font-size: clamp(var(--text-display), 11cqw, var(--text-hero));
  font-weight: var(--weight-semibold);
  line-height: 1;
  letter-spacing: var(--track-tight);
}

.k-meter {
  display: block;
  height: 6px;
  overflow: hidden;
  border-radius: var(--r-pill);
  background: var(--on-hero-track);
}

.k-meter i {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: var(--on-hero);
  transform: scaleX(var(--fill));
  transform-origin: left center;
  transition: transform calc(var(--dur-count) * 1.8) var(--ease);
}

.k-meter.is-from i { transform: scaleX(0.2); }

.k-hero-note {
  margin: var(--space-3) 0 0;
  color: var(--on-hero-dim);
  font-size: var(--text-caption);
}

.k-hero-note .money { color: var(--on-hero); font-weight: var(--weight-medium); }

.k-chart { margin-top: var(--space-5); }

.k-chart-head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: var(--space-1) var(--space-3);
  margin: 0;
  color: var(--ink-3);
  font-size: var(--text-caption);
}

.k-chart-head b {
  color: var(--ink);
  font-size: var(--text-row);
  font-weight: var(--weight-semibold);
}

.k-bars-wrap {
  position: relative;
  margin-top: 52px;
}

.k-bars {
  height: 120px;
  gap: 3px;
}

/* A pinned day, as a tap on the app's chart leaves it: the rest drop to 32%. */
.k-bars.has-pin i:not(.is-pin) { opacity: 0.32; }

.k-bars.is-from i { transform: scaleY(0); }

.k-bars-wrap { cursor: pointer; }
.k-bars:focus-visible { outline: 2px solid var(--brand); outline-offset: 6px; border-radius: 2px; }

.k-tip {
  position: absolute;
  bottom: calc(120px * 0.86 + 10px);
  left: calc(13.5 / 30 * 100%);
  pointer-events: none;
  display: flex;
  gap: var(--space-2);
  margin: 0;
  padding: 6px var(--space-3);
  border-radius: var(--r-field);
  background: var(--ink);
  color: var(--surface);
  font-size: var(--text-caption);
  white-space: nowrap;
  transform: translateX(-50%);
  transition:
    opacity var(--dur-state) var(--ease),
    transform var(--dur-sheet) var(--ease-expo),
    left var(--dur-state) var(--ease),
    bottom var(--dur-state) var(--ease);
}

.k-tip span { opacity: 0.8; }

.k-tip.is-hidden {
  opacity: 0;
  transform: translate(-50%, 6px);
}

.k-axis {
  display: flex;
  justify-content: space-between;
  margin: 6px 0 0;
  color: var(--ink-3);
  font-size: var(--text-label);
  font-variant-numeric: tabular-nums;
}

/* Insights. */
.k-seg-split { margin-top: 0; }

.k-seg-split > * {
  flex-wrap: wrap;
  column-gap: 6px;
  min-height: 44px;
  font-size: var(--text-body);
}

.k-seg-split b { font-weight: var(--weight-medium); opacity: 0.85; }

/*
 * The ring sweeps round clockwise from twelve, the order its slices are laid out in,
 * through a conic mask on a registered angle - the app's own way, because a property
 * that is not registered does not interpolate. Resting at 360deg: if the sweep never
 * runs, the ring is whole.
 */
@property --sweep {
  syntax: '<angle>';
  inherits: false;
  initial-value: 360deg;
}

.k-donut {
  position: relative;
  width: min(15rem, 72%);
  aspect-ratio: 1;
  margin: var(--space-5) auto var(--space-2);
}

.k-ring {
  display: block;
  width: 100%;
  height: 100%;
  -webkit-mask-image: conic-gradient(#000 var(--sweep), transparent 0);
  mask-image: conic-gradient(#000 var(--sweep), transparent 0);
}

.k-ring circle {
  fill: none;
  stroke-width: 15;
}

/*
 * A picked category, as in the app: its slice steps out along its own radius - two
 * hundredths, which the ring's box still holds - and the others drop to 32%, read
 * against the whole rather than gone. The focus ring is the step itself and a thicker
 * slice: an outline on an SVG stroke would draw round the whole ring's box.
 */
.k-ring circle[data-cat] {
  cursor: pointer;
  outline: none;
  transition: transform var(--dur-state) var(--ease), opacity var(--dur-state) var(--ease), stroke-width var(--dur-state) var(--ease);
}
.k-ring.has-pick circle:not(.is-on) { opacity: 0.32; }
.k-ring circle.is-on,
.k-ring circle[data-cat]:focus-visible { transform: translate(calc(var(--mx) * 2px), calc(var(--my) * 2px)); }
.k-ring circle[data-cat]:focus-visible { stroke-width: 17; }

/* Over the ring's whole box, so a tap on a slice must go through it. */
.k-hole {
  position: absolute;
  inset: 0;
  pointer-events: none;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  margin: 0;
  line-height: 1.2;
}

.k-hole small {
  color: var(--ink-3);
  font-size: var(--text-label);
  font-weight: var(--weight-semibold);
  letter-spacing: var(--track-label);
  text-transform: uppercase;
}

.k-hole b {
  margin: 4px 0 2px;
  font-size: clamp(var(--text-section), 7.5cqw, calc(var(--text-title) * 1.05));
  font-weight: var(--weight-semibold);
  letter-spacing: var(--track-tight);
}

.k-hole span {
  color: var(--ink-3);
  font-size: var(--text-caption);
}

.k-paid { margin-top: var(--space-4); }

.k-paid-head {
  margin: 0;
  font-weight: var(--weight-semibold);
}

.k-stack {
  display: flex;
  gap: 3px;
  height: 10px;
  margin: var(--space-3) 0;
}

.k-stack i {
  flex: var(--w) 1 0;
  border-radius: var(--r-pill);
  background: var(--hue);
  transform-origin: left center;
  transition: transform calc(var(--dur-count) * 1.4) var(--ease);
}

.k-legend {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-1) var(--space-4);
  margin: 0;
  color: var(--ink-2);
  font-size: var(--text-caption);
}

.k-legend span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.k-legend span::before {
  content: '';
  width: 9px;
  height: 9px;
  border-radius: var(--r-pill);
  background: var(--hue);
}

.k-legend b { color: var(--ink); font-weight: var(--weight-semibold); }

.k-cats {
  margin: var(--space-4) 0 0;
  padding: 0;
  list-style: none;
  border-top: 1px solid var(--line);
}

.k-cats li,
.k-cats .k-row {
  display: grid;
  grid-template-columns: 10px minmax(0, 1fr) auto;
  grid-template-rows: auto auto;
  column-gap: var(--space-3);
  align-items: center;
  padding: var(--space-3) 0;
}

.k-cats li + li { border-top: 1px solid var(--line); }

/* A row that is a button: the same grid, the whole width, and a tint with the brand's
   stripe when its category is the one picked. */
.k-cats li:has(> .k-row) { display: block; padding: 0; }
.k-cats .k-row {
  width: calc(100% + var(--space-4));
  margin-inline: calc(var(--space-2) * -1);
  padding: var(--space-3) var(--space-2);
  border: 0;
  border-radius: var(--r-field);
  background: transparent;
  color: inherit;
  font: inherit;
  text-align: left;
  cursor: pointer;
  transition: background-color var(--dur-state) var(--ease), box-shadow var(--dur-state) var(--ease);
}
.k-cats .k-row.is-on {
  background: var(--brand-tint);
  box-shadow: inset 3px 0 0 var(--brand);
}
.k-cats .k-row:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; }
@media (hover: hover) {
  .k-cats .k-row:not(.is-on):hover { background: var(--surface-sunken); }
}

.k-dot {
  grid-row: 1 / 3;
  width: 10px;
  height: 10px;
  border-radius: var(--r-pill);
  background: var(--hue);
}

.k-cat-name {
  display: flex;
  flex-direction: column;
  gap: 6px;
  grid-row: 1 / 3;
  font-weight: var(--weight-medium);
}

.k-share {
  display: block;
  width: calc(var(--share) * 100%);
  height: 4px;
  border-radius: var(--r-pill);
  background: var(--hue);
  transform-origin: left center;
  transition: transform calc(var(--dur-count) * 1.4) var(--ease);
}

/* A budget is a meter against its limit, not a share of the month. */
.has-budget .k-share {
  width: 100%;
  background: linear-gradient(to right, var(--hue) calc(var(--share) * 100%), var(--surface-sunken) 0);
}

.k-cats b {
  justify-self: end;
  font-weight: var(--weight-semibold);
}

.k-cats small {
  justify-self: end;
  color: var(--ink-3);
  font-size: var(--text-caption);
}

.mock-insights.is-from .k-stack i,
.mock-insights.is-from .k-share { transform: scaleX(0); }

/* Several at once. */
.k-mic {
  display: flex;
  justify-content: center;
  margin: var(--space-5) 0 var(--space-3);
}

.k-orb {
  position: relative;
  display: grid;
  place-items: center;
  width: 72px;
  height: 72px;
  border-radius: var(--r-pill);
  background: var(--spend);
  color: var(--on-brand);
  font-size: 1.75rem;
}

.k-orb::before {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: var(--spend);
  opacity: 0;
}

.mock-several.is-listening .k-orb::before {
  animation: halo 1.4s var(--ease) infinite;
}

@keyframes halo {
  from { opacity: 0.35; transform: scale(1); }
  to   { opacity: 0;    transform: scale(1.6); }
}

.k-said {
  min-height: 3.1em;
  margin: 0;
  color: var(--ink);
  font-size: calc(var(--text-row) * 1.08);
  font-weight: var(--weight-medium);
  text-align: center;
  text-wrap: balance;
}

.k-said span::before { content: '“'; }
.k-said span::after { content: '”'; }
.k-said span.is-typing::after { content: ''; }

.k-review {
  display: grid;
  gap: var(--space-2);
  margin: var(--space-3) 0 0;
  padding: 0;
  list-style: none;
}

.k-review li {
  display: grid;
  grid-template-columns: auto auto minmax(0, 1fr) auto;
  align-items: center;
  gap: var(--space-3);
  min-height: 52px;
  padding: var(--space-2) var(--space-3);
  border-radius: var(--r-field);
  background: var(--surface-sunken);
  transition:
    opacity var(--dur-sheet) var(--ease),
    transform calc(var(--dur-sheet) * 1.3) var(--ease-expo);
  transition-delay: calc(var(--i, 0) * 90ms);
}

.k-review li:nth-child(2) { --i: 1; }
.k-review li:nth-child(3) { --i: 2; }

.mock-several.is-from .k-review li {
  opacity: 0;
  transform: translateY(12px);
  transition-delay: 0s;
}

.k-tick {
  display: grid;
  place-items: center;
  width: 24px;
  height: 24px;
  border-radius: var(--r-tile);
  background: var(--brand);
  color: var(--on-brand);
  font-size: 0.8rem;
}

.k-review b { font-weight: var(--weight-semibold); }

.k-review-what {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.k-tag {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  min-height: 30px;
  padding: 0 var(--space-3);
  border-radius: var(--r-pill);
  background: var(--surface);
  font-size: var(--text-caption);
  font-weight: var(--weight-medium);
}

.k-tag .k-ic { color: var(--hue); font-size: 0.95rem; }

.mock-several .k-save {
  transition: opacity var(--dur-sheet) var(--ease);
  transition-delay: 300ms;
}

.mock-several.is-from .k-save {
  opacity: 0.4;
  transition-delay: 0s;
}

@container (max-width: 22rem) {
  .k-tag { padding: 0 var(--space-2); }
  .k-tag .k-ic { display: none; }
}

/* ------------------------------------------------------------- the rest */

.more {
  margin-top: clamp(5rem, 3rem + 6vw, 8rem);
}

.more-list {
  display: grid;
  margin: var(--space-6) 0 0;
  padding: 0;
  list-style: none;
  border-top: 1px solid var(--line);
}

.more-list li {
  display: flex;
  gap: var(--space-4);
  padding: var(--space-5) 0;
  border-bottom: 1px solid var(--line);
}

@media (min-width: 760px) {
  .more-list { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .more-list li:nth-child(odd) { padding-right: var(--space-8); }
  .more-list li:nth-child(even) {
    padding-left: var(--space-8);
    border-left: 1px solid var(--line);
  }
}

.more-icon {
  display: grid;
  flex: none;
  place-items: center;
  width: 44px;
  height: 44px;
  border-radius: var(--r-field);
  background: var(--surface);
  box-shadow: var(--shadow-card);
}

.more-icon .glyph { width: 22px; height: 22px; }

.more-list h4 {
  margin: 2px 0 var(--space-1);
  font-size: var(--text-row);
  font-weight: var(--weight-semibold);
}

.more-list p {
  margin: 0;
  color: var(--ink-2);
  text-wrap: pretty;
}

/* --------------------------------------------------------------- account */

.plans {
  display: grid;
  gap: var(--space-5);
  margin-top: clamp(2.5rem, 2rem + 2vw, 3.5rem);
}

@media (min-width: 860px) {
  .plans {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    align-items: stretch;
  }
}

.plan {
  position: relative;
  display: flex;
  flex-direction: column;
  padding: clamp(var(--space-6), 1rem + 2vw, 2.5rem);
  border-radius: var(--r-card);
  background: var(--surface);
  box-shadow: var(--shadow-card);
}

.plan-head {
  display: flex;
  align-items: center;
  gap: var(--space-4);
}

.plan-icon {
  display: grid;
  flex: none;
  place-items: center;
  width: 52px;
  height: 52px;
  border-radius: var(--r-field);
  background: var(--surface-sunken);
}

.plan-icon .glyph { width: 26px; height: 26px; }

.plan h3 {
  font-size: calc(var(--text-section) * 1.1);
  font-weight: var(--weight-semibold);
  letter-spacing: -0.015em;
}

.plan-head p {
  margin: 2px 0 0;
  color: var(--ink-3);
}

.plan-list {
  display: grid;
  flex: 1;
  align-content: start;
  gap: var(--space-3);
  margin: var(--space-6) 0 var(--space-8);
  padding: var(--space-6) 0 0;
  border-top: 1px solid var(--line);
  list-style: none;
}

.plan-list li {
  display: flex;
  gap: var(--space-3);
  text-wrap: pretty;
}

.plan-list .glyph {
  width: 18px;
  height: 18px;
  margin-top: 3px;
}

.plan-list .is-no { color: var(--ink-3); }

.plan-ink {
  background: linear-gradient(150deg, var(--hero) 0%, var(--hero-edge) 100%);
  box-shadow: var(--shadow-hero);
  color: var(--on-hero);
}

.plan-ink .plan-icon { background: color-mix(in srgb, var(--on-hero) 10%, transparent); }
.plan-ink .plan-head p { color: var(--on-hero-dim); }
.plan-ink .plan-list { border-top-color: color-mix(in srgb, var(--on-hero) 14%, transparent); }

.plan-tag {
  position: absolute;
  top: var(--space-5);
  right: var(--space-5);
  margin: 0;
  padding: 4px var(--space-3);
  border-radius: var(--r-pill);
  background: var(--on-hero);
  color: var(--hero);
  font-size: var(--text-label);
  font-weight: var(--weight-semibold);
  letter-spacing: var(--track-label);
  text-transform: uppercase;
}

.steps-inline {
  display: grid;
  gap: var(--space-4);
  margin: var(--space-8) 0 0;
  padding: 0;
  list-style: none;
}

@media (min-width: 860px) {
  .steps-inline {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: var(--space-6);
  }
}

.steps-inline li {
  display: flex;
  gap: var(--space-3);
}

.steps-inline p {
  margin: 4px 0 0;
  color: var(--ink-2);
}

.steps-inline b { color: var(--ink); font-weight: var(--weight-semibold); }

/* --------------------------------------------------------------- install */

.tab-list {
  display: flex;
  gap: var(--space-1);
  width: fit-content;
  max-width: 100%;
  margin: var(--space-8) 0 var(--space-6);
  padding: var(--space-1);
  overflow-x: auto;
  border-radius: var(--r-pill);
  background: var(--surface-sunken);
  scrollbar-width: none;
}

.tab-list::-webkit-scrollbar { display: none; }

.tab-list[hidden] { display: none; }

.tab-list button {
  flex: none;
  min-height: var(--tap-min);
  padding: 0 var(--space-5);
  border: 0;
  border-radius: var(--r-pill);
  background: transparent;
  color: var(--ink-2);
  font: inherit;
  font-weight: var(--weight-medium);
  cursor: pointer;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
  transition:
    background-color var(--dur-state) var(--ease),
    color var(--dur-state) var(--ease),
    transform var(--dur-instant) var(--ease);
}

.tab-list button:hover { color: var(--ink); }
.tab-list button:active { transform: scale(var(--press-scale)); }

.tab-list button[aria-selected='true'] {
  background: var(--brand);
  color: var(--on-brand);
}

/* Four choices do not fit one row on a phone, and a row that scrolls can hide the one
   that is chosen. Two by two, all of them in sight. */
@media (max-width: 599px) {
  .tab-list {
    display: grid;
    grid-template-columns: 1fr 1fr;
    width: 100%;
    overflow: visible;
    border-radius: var(--r-card);
  }

  .tab-list button { padding: 0 var(--space-3); }
}

/* Without the script, every panel is on the page under its own heading. With it,
   they become tabs, and the heading is said rather than shown. */
.tab-panel + .tab-panel { margin-top: var(--space-8); }

.tab-panel[hidden] { display: none; }

.panel-title {
  margin: var(--space-8) 0 var(--space-4) !important;
  font-size: var(--text-section);
  font-weight: var(--weight-semibold);
}

.is-tabbed .tab-panel + .tab-panel { margin-top: 0; }

.is-tabbed .panel-title {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px !important;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

.is-tabbed .tab-panel:focus-visible {
  outline-offset: 6px;
  border-radius: var(--r-card);
}

.panel-grid {
  display: grid;
  gap: var(--space-5);
  align-items: start;
}

@media (min-width: 860px) {
  .panel-grid { grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); }
}

.download-card {
  display: grid;
  gap: var(--space-4);
}

.download-lead {
  margin: 0;
  color: var(--ink-2);
  text-wrap: pretty;
}

.download-card .download-facts { margin: 0; }

.download-more {
  margin: 0;
  font-size: var(--text-caption);
  text-align: center;
}

.step-body h4 {
  margin: 4px 0 var(--space-1);
  font-size: var(--text-row);
  font-weight: var(--weight-semibold);
  text-wrap: balance;
}

.step-body b { color: var(--ink); font-weight: var(--weight-semibold); }

/* --------------------------------------------------------------- privacy */

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

.privacy-in {
  display: grid;
  gap: var(--space-8);
}

@media (min-width: 960px) {
  .privacy-in {
    grid-template-columns: minmax(0, 5fr) minmax(0, 7fr);
    gap: clamp(3rem, 1rem + 4vw, 6rem);
    align-items: start;
  }
}

.privacy-copy p:not(.eyebrow) {
  margin: var(--space-5) 0 0;
  color: var(--on-hero-dim);
  font-size: clamp(var(--text-row), 0.92rem + 0.3vw, 1.125rem);
  text-wrap: pretty;
}

.band-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: var(--tap-min);
  margin-top: var(--space-3);
  color: var(--on-hero);
  font-weight: var(--weight-semibold);
  text-decoration-color: var(--on-hero-track);
}

.band-link:hover { text-decoration-color: var(--on-hero); }

.band-link .glyph {
  width: 16px;
  height: 16px;
  transition: transform var(--dur-state) var(--ease);
}

.band-link:hover .glyph { transform: translateX(3px); }

.privacy-list {
  margin: 0;
  padding: 0;
  list-style: none;
}

.privacy-list li {
  display: flex;
  gap: var(--space-4);
  padding: var(--space-5) 0;
  border-top: 1px solid color-mix(in srgb, var(--on-hero) 14%, transparent);
}

.privacy-list li:last-child {
  border-bottom: 1px solid color-mix(in srgb, var(--on-hero) 14%, transparent);
}

.privacy-list .glyph {
  width: 22px;
  height: 22px;
  margin-top: 2px;
}

.privacy-list h3 {
  font-size: calc(var(--text-row) * 1.06);
  font-weight: var(--weight-semibold);
}

.privacy-list p {
  margin: var(--space-1) 0 0;
  color: var(--on-hero-dim);
  text-wrap: pretty;
}

/* ------------------------------------------------------------------- faq */

.faq-in {
  display: grid;
  gap: var(--space-8);
}

@media (min-width: 960px) {
  .faq-in {
    grid-template-columns: minmax(0, 4fr) minmax(0, 8fr);
    gap: clamp(3rem, 1rem + 4vw, 6rem);
    align-items: start;
  }

  .faq-in .intro {
    position: sticky;
    top: 104px;
  }
}

.faq-list { border-top: 1px solid var(--line); }

.faq { border-bottom: 1px solid var(--line); }

.faq summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-4);
  min-height: 64px;
  padding: var(--space-4) 0;
  font-size: calc(var(--text-row) * 1.06);
  font-weight: var(--weight-semibold);
  list-style: none;
  cursor: pointer;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
}

.faq summary::-webkit-details-marker { display: none; }

.faq summary .glyph {
  width: 20px;
  height: 20px;
  color: var(--ink-3);
  transition: transform var(--dur-sheet) var(--ease);
}

.faq[open] summary .glyph { transform: rotate(180deg); }

.faq summary:hover .glyph { color: var(--ink); }

.faq summary:focus-visible { outline-offset: 4px; }

.faq p {
  max-width: 62ch;
  margin: 0;
  padding: 0 var(--space-8) var(--space-5) 0;
  color: var(--ink-2);
  text-wrap: pretty;
}

/* Where the browser can animate to auto, an answer opens rather than appearing. */
@supports (interpolate-size: allow-keywords) {
  .faq {
    interpolate-size: allow-keywords;
  }

  .faq::details-content {
    height: 0;
    overflow: clip;
    transition:
      height var(--dur-sheet) var(--ease),
      content-visibility var(--dur-sheet) allow-discrete;
  }

  .faq[open]::details-content { height: auto; }
}

/* ------------------------------------------------------------- the close */

.final {
  padding: calc(var(--section-pad) * 1.1) 0;
  background: var(--hero);
  color: var(--on-hero);
  text-align: center;
}

.final-in {
  display: flex;
  flex-direction: column;
  align-items: center;
}

.final-title {
  max-width: 15ch;
  font-size: clamp(calc(var(--text-display) * 1.05), 1.2rem + 4.4vw, calc(var(--text-hero) * 1.5));
  font-weight: var(--weight-semibold);
  line-height: 1.03;
  letter-spacing: -0.04em;
  text-wrap: balance;
}

.final-in > p {
  margin: var(--space-5) 0 var(--space-8);
  color: var(--on-hero-dim);
  font-size: clamp(var(--text-row), 0.92rem + 0.3vw, 1.125rem);
}

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

.foot {
  padding-top: var(--space-8);
  overflow: clip;
}

.foot-in {
  display: grid;
  gap: var(--space-6);
  padding-top: var(--space-4);
}

@media (min-width: 760px) {
  .foot-in {
    grid-template-columns: minmax(0, 1fr) auto;
    gap: var(--space-8);
  }
}

.foot-brand p {
  max-width: 34ch;
  margin: var(--space-2) 0 0;
  color: var(--ink-3);
  font-size: var(--text-caption);
}

.foot-nav {
  display: flex;
  gap: clamp(var(--space-8), 2rem + 2vw, 4rem);
}

.foot-nav div {
  display: flex;
  flex-direction: column;
}

.foot-head {
  margin: 0 0 var(--space-1);
  color: var(--ink-3);
  font-size: var(--text-label);
  font-weight: var(--weight-semibold);
  letter-spacing: var(--track-label);
  text-transform: uppercase;
}

.foot-nav a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  color: var(--ink-2);
  text-decoration: none;
}

.foot-nav a:hover {
  color: var(--ink);
  text-decoration: underline;
}

.foot-legal {
  margin: var(--space-6) auto 0;
  color: var(--ink-3);
  font-size: var(--text-caption);
}

/* Drawn inside the gutters, where the content's edges are, not across them. */
.foot-legal::before {
  content: '';
  display: block;
  height: 1px;
  margin-bottom: var(--space-5);
  background: var(--line);
}

/* The name the page ends on, whole, with room under the "p". Cut off by the bottom
   edge it read as a mistake rather than a flourish (owner, 2026-10-24). Decoration in
   the quietest ink there is; the brand above it is the link. */
.foot-mark {
  margin: var(--space-6) 0 0;
  padding-bottom: calc(clamp(var(--space-6), 4vw, 3.5rem) + var(--safe-bottom));
  color: var(--line-strong);
  font-size: clamp(5.5rem, 25vw, 20rem);
  font-weight: var(--weight-semibold);
  line-height: 1;
  letter-spacing: -0.065em;
  text-align: center;
  white-space: nowrap;
  user-select: none;
}

/* ----------------------------------------------------------- scroll reveal */

/*
 * Set by home.js only on things below the fold when the page loads, and taken off as
 * each scrolls into view, a little before it reaches the middle. Transitions, so a
 * reveal that never runs still ends with the thing on screen. Three kinds, so a section
 * does not arrive the way the last one did:
 *
 *   [data-reveal]          rises 24px and fades in
 *   [data-reveal='lines']  a heading, climbing out of its baselines line by line
 *   [data-reveal='card']   a card, rising further and settling from 97%
 */
.is-pending {
  opacity: 0;
  transform: translateY(24px);
}

[data-reveal] {
  transition:
    opacity var(--t-fade) var(--ease-rise),
    transform var(--t-rise) var(--ease-rise);
  transition-delay: calc(var(--stagger, 0) * 80ms);
}

/* Shown at once: its lines are what move, inside their masks. */
[data-reveal='lines'] { transition: none; }
[data-reveal='lines'].is-pending { transform: none; }

[data-reveal='card'] {
  transform-origin: 50% 100%;
  transition-duration: var(--t-fade), var(--t-open);
  transition-timing-function: var(--ease-rise), var(--ease-expo);
}

[data-reveal='card'].is-pending { transform: translateY(56px) scale(0.97); }

@media print {
  .is-pending,
  .is-loading [data-enter],
  .is-loading .hero-title {
    opacity: 1 !important;
    transform: none !important;
  }

  .top, .stage, .float, .foot-mark { display: none; }
}

/* ------------------------------------------------------ tied to the scroll */

/*
 * Motion locked to the scrollbar, on the browser's own scroll timelines: no scroll
 * listener, nothing on the main thread for the transforms, and linear, because the
 * reader's hand is the easing. Where timelines do not exist (Firefox, for now) and under
 * reduced motion, none of this applies and every element simply rests where it is.
 */
@supports (animation-timeline: view()) {
  @media (prefers-reduced-motion: no-preference) {
    /* How far down the page the reader is, as a hairline under the bar. */
    .top::after {
      content: '';
      position: absolute;
      inset: auto 0 0;
      height: 2px;
      background: var(--brand);
      transform: scaleX(0);
      transform-origin: 0 50%;
      animation: progress linear both;
      animation-timeline: scroll(root block);
    }

    /* The headline steps back as the reader moves on from it. */
    .hero-in {
      animation: recede linear both;
      animation-timeline: view();
      animation-range: exit 0% exit 85%;
    }

    /* The phone arrives lying back and stands up as it comes into full view. */
    .phone {
      transform-origin: 50% 85%;
      animation: stand linear both;
      animation-timeline: view();
      animation-range: entry 0% cover 42%;
    }

    /* Words of the statement take their ink one after another. */
    .statement { view-timeline-name: --statement; }

    .statement .fw {
      animation: ink linear both;
      animation-timeline: --statement;
      animation-range:
        cover calc(18% + var(--i) / var(--n) * 30%)
        cover calc(24% + var(--i) / var(--n) * 30%);
    }

    /* The ink sections arrive as a card and open out to the full width. */
    .band-privacy,
    .final {
      animation: open-out linear both;
      animation-timeline: view();
      animation-range: entry 0% entry 90%;
    }

    .foot-mark {
      animation: mark-up linear both;
      animation-timeline: view();
      animation-range: entry 0% entry 100%;
    }
  }
}

@keyframes progress { to { transform: scaleX(1); } }

@keyframes recede {
  to { opacity: 0; transform: translateY(-12%) scale(0.97); }
}

@keyframes stand {
  from { transform: perspective(1400px) rotateX(16deg) scale(0.94); }
}

@keyframes ink {
  from { opacity: 0.22; }
}

@keyframes open-out {
  from { clip-path: inset(0 clamp(12px, 4vw, 56px) round var(--r-card)); }
  to   { clip-path: inset(0 0 round 0); }
}

@keyframes mark-up {
  from { opacity: 0.3; transform: translateY(45%) scale(0.92); }
}

/* --------------------------------------------------- dark: edges, not shadows */

@media (prefers-color-scheme: dark) {
  :root:not([data-theme='light']) .mock,
  :root:not([data-theme='light']) .plan:not(.plan-ink),
  :root:not([data-theme='light']) .float,
  :root:not([data-theme='light']) .kicker,
  :root:not([data-theme='light']) .more-icon,
  :root:not([data-theme='light']) .m-card,
  :root:not([data-theme='light']) .m-rows {
    box-shadow: 0 0 0 1px var(--line), var(--shadow-card);
  }

  :root:not([data-theme='light']) .plan-ink,
  :root:not([data-theme='light']) .k-hero,
  :root:not([data-theme='light']) .m-hero {
    box-shadow: 0 0 0 1px var(--line-strong), var(--shadow-hero);
  }
}

:root[data-theme='dark'] .mock,
:root[data-theme='dark'] .plan:not(.plan-ink),
:root[data-theme='dark'] .float,
:root[data-theme='dark'] .kicker,
:root[data-theme='dark'] .more-icon,
:root[data-theme='dark'] .m-card,
:root[data-theme='dark'] .m-rows {
  box-shadow: 0 0 0 1px var(--line), var(--shadow-card);
}

:root[data-theme='dark'] .plan-ink,
:root[data-theme='dark'] .k-hero,
:root[data-theme='dark'] .m-hero {
  box-shadow: 0 0 0 1px var(--line-strong), var(--shadow-hero);
}

/* --------------------------------------------------------- reduced motion */

/* tokens.css already collapses every duration; these are the loops and the drift,
   which are not durations. */
@media (prefers-reduced-motion: reduce) {
  .is-active .m-caret,
  [data-type].is-typing::after,
  .mock-several.is-listening .k-orb::before,
  .m-toast.is-on .m-toast-line,
  .m-row.is-new {
    animation: none;
  }

  [data-enter],
  [data-reveal],
  .stage .phone-figure,
  .stage .float,
  .line-in,
  .story.is-live .mock.is-active {
    transition-delay: 0s;
  }
}
