/*
 * Clair website.
 *
 * Two palettes live here, on purpose:
 *
 * - The page: cream paper, warm ink, one brand green, and three "pop"
 *   colours (sky, coral, sun) that are only ever flat decorative blocks
 *   behind the mockups, never states.
 * - The app: the mockups are drawn in the app's own "Paper" palette
 *   (src/constants/theme.ts, light mode), so they look like the real thing.
 *
 * Inside a mockup, sizes are in iOS points times --pt, so each one scales as
 * a whole with the viewport.
 */

/* ---------- Tokens ---------- */

:root {
  color-scheme: light;

  /* Page */
  --paper: #F4F0E5;
  --sand: #E2DCCD;
  --white: #FFFFFF;
  --ink: #2B2D29;
  --ink-2: #5E605B;      /* secondary text: 5.6:1 on paper, 6.4:1 on white */
  --stone: #7E807C;      /* large text and marks only */
  --line: #D6D4CE;

  --green: #8ED462;      /* big shapes */
  --green-deep: #168A4A; /* the icon's green, for small marks */
  --sky: #2BA0FF;
  --coral: #FF705D;
  --sun: #F5E211;

  --font: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;

  --r-xl: clamp(32px, 4.4vw, 48px);
  --r-chip: 12px;
  --gutter: clamp(16px, 4.4vw, 48px);
  --max: 1200px;
  --outline: 2px solid var(--ink);

  /* App ("Paper", light), for the mockups only */
  --bg: #F4F0E5;
  --card: #FFFFFF;
  --text: #2B2D29;
  --text-2: #5E605B;
  --text-3: #9C9D97;
  --border: rgba(43, 45, 41, 0.08);
  --border-strong: rgba(43, 45, 41, 0.12);
  --fill: rgba(43, 45, 41, 0.06);
  --fill-strong: rgba(43, 45, 41, 0.1);
  --thumb: #FFFFFF;
  --primary: #2B2D29;
  --on-primary: #FFFFFF;
  --tint: #168A4A;
  --system-blue: #007AFF; /* the Home Screen widget's bar, a system colour there */
  --income: #168A4A;
  --over: #D93F33;
  --signal-sun: #EDC55B;

  /* Overview's hero block: the finish picked in Settings, and the ink on it. */
  --brand: #8ED462;
  --on-brand: #2B2D29;

  /* Category hues: on icons only, never on surfaces. */
  --cat-purple: #9B51E0;
  --cat-orange: #F07A1A;
  --cat-blue: #3D7BFF;
  --cat-pink: #E5487A;
  --cat-indigo: #5B5BF0;

  --bezel: #1E201C;
  --lock-surface: #2B2D29;
  /* SF Pro Rounded for figures inside the mockups, as the app sets them. */
  --font-figure: ui-rounded, "SF Pro Rounded", var(--font);
}

/* ---------- Base ---------- */

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

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  background: var(--paper);
}

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font);
  font-size: clamp(17px, 16px + 0.25vw, 19px);
  line-height: 1.5;
  letter-spacing: -0.011em;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}

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

ol, ul {
  padding: 0;
  list-style: none;
}

img, svg {
  display: block;
}

a {
  color: var(--ink);
  text-decoration-thickness: 1.5px;
  text-underline-offset: 0.2em;
}

:focus-visible {
  outline: 3px solid var(--ink);
  outline-offset: 3px;
  border-radius: 8px;
}

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

.skip {
  position: absolute;
  top: 12px;
  left: 12px;
  z-index: 10;
  padding: 10px 18px;
  border-radius: 999px;
  background: var(--ink);
  color: var(--paper);
  font-weight: 600;
  text-decoration: none;
  transform: translateY(-200%);
}

.skip:focus {
  transform: none;
}

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

.icon {
  width: 1em;
  height: 1em;
  flex: none;
}

/* ---------- Type ---------- */

.display {
  font-size: clamp(3.5rem, 1.6rem + 8vw, 8.75rem);
  font-weight: 600;
  line-height: 0.95;
  letter-spacing: -0.058em;
  text-wrap: balance;
}

.h2 {
  font-size: clamp(3rem, 1.9rem + 4.2vw, 5rem);
  font-weight: 600;
  line-height: 0.98;
  letter-spacing: -0.045em;
  text-wrap: balance;
}

.h3 {
  font-size: clamp(1.5rem, 1.25rem + 0.8vw, 2rem);
  font-weight: 600;
  line-height: 1.1;
  letter-spacing: -0.035em;
  text-wrap: balance;
}

.lead {
  max-width: 32em;
  color: var(--ink-2);
  font-size: clamp(1.125rem, 1rem + 0.45vw, 1.3125rem);
  line-height: 1.5;
  text-wrap: pretty;
}

.body {
  max-width: 32em;
  color: var(--ink-2);
  text-wrap: pretty;
}

/* ---------- Floating nav ---------- */

.site-header {
  padding: clamp(12px, 2vw, 24px) var(--gutter) 0;
}

.nav-pill {
  display: flex;
  align-items: center;
  gap: 4px;
  width: min(100%, var(--max));
  margin-inline: auto;
  padding: 6px 6px 6px 10px;
  border-radius: 999px;
  background: var(--white);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-height: 44px;
  margin-right: auto;
  padding-right: 8px;
  color: var(--ink);
  font-size: 22px;
  font-weight: 600;
  letter-spacing: -0.045em;
  text-decoration: none;
}

.brand img {
  width: 32px;
  height: 32px;
  border-radius: 9px;
}

.nav {
  display: flex;
  gap: 2px;
}

.nav a {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 44px;
  padding: 0 16px;
  border-radius: 999px;
  color: var(--ink);
  font-size: 16px;
  font-weight: 500;
  text-decoration: none;
}

.nav a:hover {
  background: var(--paper);
}

.nav a[aria-current="page"]::before {
  content: "";
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--green-deep);
}

.nav-dot {
  display: grid;
  place-items: center;
  flex: none;
  width: 44px;
  height: 44px;
  margin-left: 2px;
  border-radius: 50%;
  background: var(--green);
  color: var(--ink);
}

.nav-dot svg {
  width: 20px;
  height: 20px;
}

.nav-dot:hover {
  background: var(--ink);
  color: var(--green);
}

@media (max-width: 430px) {
  .nav .nav-wide {
    display: none;
  }
}

/* ---------- Pills ---------- */

.status-pill,
.ghost-pill {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  min-height: 56px;
  padding: 0 26px 0 22px;
  border-radius: 999px;
  color: var(--ink);
  font-size: 17px;
  font-weight: 500;
  letter-spacing: -0.015em;
  white-space: nowrap;
}

.status-pill {
  background: var(--white);
}

.pill-dot {
  flex: none;
  width: 14px;
  height: 14px;
  border: 1.5px solid var(--ink);
  border-radius: 50%;
  background: var(--green);
}

.ghost-pill {
  padding: 0 22px 0 26px;
  border: 1.5px solid var(--ink);
  text-decoration: none;
}

.ghost-pill .icon {
  font-size: 18px;
  transition: transform 160ms ease-out;
}

.ghost-pill:hover {
  background: var(--ink);
  color: var(--paper);
}

.ghost-pill:hover .icon {
  transform: translateX(2px);
}

.ghost-pill[href^="#"]:hover .icon {
  transform: translateY(2px);
}

/* ---------- Layout ---------- */

.section {
  padding-block: clamp(88px, 11vw, 160px) 0;
}

.section-head {
  display: grid;
  gap: 24px;
  margin-bottom: clamp(40px, 5vw, 72px);
}

.section-head .h2 {
  max-width: 11em;
}

.split {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 48px;
  align-items: center;
}

@media (min-width: 920px) {
  .split {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    gap: clamp(48px, 6vw, 96px);
  }

  .split-flip .split-visual {
    order: -1;
  }
}

.split-copy {
  display: grid;
  gap: 24px;
  align-content: center;
}

.split .h2 {
  max-width: 9em;
  font-size: clamp(3rem, 1.9rem + 3.4vw, 4.25rem);
}

.split-copy .lead + .lead {
  margin-top: -8px;
}

.split-visual {
  display: flex;
  justify-content: center;
}

/* Flat colour blocks: the paper-cut shapes the mockups sit on. */
.block {
  position: relative;
  display: grid;
  place-items: center;
  border-radius: var(--r-xl);
}

.block-green { background: var(--green); }
.block-sky { background: var(--sky); }
.block-coral { background: var(--coral); }
.block-sun { background: var(--sun); }
.block-sand { background: var(--sand); }

.card {
  border-radius: var(--r-xl);
  background: var(--white);
}

.card-outline {
  border: var(--outline);
}

/* Stickers: flat, outlined, a little tilted. Two on the page, no more. */
.sticker {
  position: absolute;
  z-index: 2;
  pointer-events: none;
}

.sticker-coin {
  top: clamp(-36px, -3vw, -20px);
  left: clamp(-28px, -2vw, -4px);
  width: clamp(72px, 9vw, 120px);
  transform: rotate(-12deg);
}

.sticker-receipt {
  right: clamp(-20px, -1.6vw, -8px);
  bottom: clamp(32px, 5vw, 64px);
  width: clamp(56px, 6.5vw, 84px);
  transform: rotate(9deg);
}

/* ---------- Hero ---------- */

.hero {
  padding-top: clamp(48px, 7vw, 104px);
}

.hero-grid {
  display: grid;
  gap: clamp(48px, 8vw, 72px);
}

.hero-copy {
  display: grid;
  gap: 32px;
  align-content: start;
}

.hero .display {
  font-size: clamp(3.5rem, 1rem + 9vw, 7.5rem);
}

.hero .lead {
  max-width: 26em;
}

@media (min-width: 1040px) {
  /* Short enough that the phone and its colours fit in one screen. */
  .hero .phone {
    --pw: clamp(270px, (100svh - 340px) * 0.476, 348px);
  }

  .hero-grid {
    grid-template-columns: minmax(0, 7fr) minmax(0, 5fr);
    gap: clamp(40px, 4vw, 64px);
    align-items: center;
  }

  .hero .display {
    font-size: clamp(5.5rem, 1rem + 7.4vw, 7.5rem);
  }
}

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.hero-stage {
  gap: 24px;
  padding: clamp(32px, 5vw, 56px) clamp(20px, 4vw, 48px) clamp(24px, 3.5vw, 36px);
}

/* The finishes from Settings. Picking one repaints the phone's hero, as in the app. */
.finishes {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 10px 16px;
  margin: 0;
  padding: 0;
  border: 0;
}

.finishes legend {
  float: left;
  padding: 0;
  color: var(--ink-2);
  font-size: 15px;
  font-weight: 500;
}

.swatches {
  display: flex;
  margin-inline: -7px;
}

/* A 44px target round each 30px dot. */
.swatches label {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  cursor: pointer;
}

.swatches label::before {
  content: "";
  width: 30px;
  height: 30px;
  border: 2px solid var(--sand);
  border-radius: 50%;
  background: var(--sw);
  box-shadow: 0 0 0 1.5px transparent;
  transition: box-shadow 160ms ease, transform 160ms ease-out;
}

.swatches label:hover::before {
  transform: translateY(-2px);
}

.swatches input:checked + label::before {
  box-shadow: 0 0 0 2px var(--ink);
}

.swatches input:focus-visible + label::before {
  outline: 3px solid var(--ink);
  outline-offset: 3px;
}

/* With a mouse the dots sit closer, so the row fits beside its legend. */
@media (min-width: 1040px) and (hover: hover) and (pointer: fine) {
  .swatches {
    margin-inline: -3px;
  }

  .swatches label {
    width: 36px;
    height: 36px;
  }
}

.hero-stage:has(#f-racing:checked) { --brand: #0B5D3B; --on-brand: #F4F0E5; }
.hero-stage:has(#f-cherry:checked) { --brand: #7C1A2E; --on-brand: #F4F0E5; }
.hero-stage:has(#f-blue:checked) { --brand: #1F3B66; --on-brand: #F4F0E5; }
.hero-stage:has(#f-desert:checked) { --brand: #D2B48C; }
.hero-stage:has(#f-sky:checked) { --brand: #A9D1F5; }
.hero-stage:has(#f-graphite:checked) { --brand: #3A3B36; --on-brand: #F4F0E5; }

/* ---------- Mockup building blocks (sizes in pt × --pt) ---------- */

.num {
  font-family: var(--font-figure);
  font-variant-numeric: tabular-nums;
}

.m-card {
  border: 1px solid var(--border);
  border-radius: calc(var(--pt) * 24);
  background: var(--card);
  overflow: hidden;
}

.m-tile {
  display: grid;
  place-items: center;
  flex: none;
  width: calc(var(--pt) * 40);
  height: calc(var(--pt) * 40);
  border-radius: calc(var(--pt) * 12.8);
  background: var(--fill);
}

.m-tile svg {
  width: calc(var(--pt) * 19);
  height: calc(var(--pt) * 19);
}

.c-purple { color: var(--cat-purple); }
.c-orange { color: var(--cat-orange); }
.c-blue { color: var(--cat-blue); }
.c-pink { color: var(--cat-pink); }
.c-indigo { color: var(--cat-indigo); }

.m-text {
  display: flex;
  flex: 1;
  flex-direction: column;
  min-width: 0;
  gap: calc(var(--pt) * 1);
}

.m-name {
  overflow: hidden;
  font-size: calc(var(--pt) * 17);
  font-weight: 600;
  line-height: 1.3;
  letter-spacing: -0.024em;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.m-sub {
  overflow: hidden;
  color: var(--text-2);
  font-size: calc(var(--pt) * 13);
  line-height: 1.38;
  letter-spacing: -0.006em;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.m-amt {
  flex: none;
  font-family: var(--font-figure);
  font-size: calc(var(--pt) * 17);
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.02em;
  white-space: nowrap;
}

.m-amt.is-paid {
  color: var(--text-2);
}

.m-row {
  display: flex;
  align-items: center;
  gap: calc(var(--pt) * 12);
  min-height: calc(var(--pt) * 62);
  padding-left: calc(var(--pt) * 16);
  padding-right: calc(var(--pt) * 12);
}

.m-check {
  display: grid;
  place-items: center;
  flex: none;
  width: calc(var(--pt) * 32);
  height: calc(var(--pt) * 44);
  color: var(--text-3);
}

.m-check svg {
  width: calc(var(--pt) * 26);
  height: calc(var(--pt) * 26);
}

.m-check .is-done {
  color: var(--text);
}

.m-sh {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: calc(var(--pt) * 8);
  padding: 0 calc(var(--pt) * 4) calc(var(--pt) * 12);
}

.m-sh-title {
  font-size: calc(var(--pt) * 22);
  font-weight: 700;
  line-height: 1.27;
  letter-spacing: -0.024em;
}

.m-sh-action {
  color: var(--text-2);
  font-family: var(--font-figure);
  font-size: calc(var(--pt) * 15);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

/* The app's money figure: units heavy, cents smaller and top-aligned. */
.m-money {
  display: flex;
  align-items: flex-start;
  font-family: var(--font-figure);
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  line-height: 1.1;
  white-space: nowrap;
}

.m-money .cents {
  font-size: 0.55em;
  margin-top: 0.262em;
  letter-spacing: -0.01em;
}

/* ---------- Phone ---------- */

.phone {
  --pw: min(348px, 100vw - 2 * var(--gutter) - 40px);
  --pt: calc(var(--pw) / 417);
  position: relative;
  flex: none;
  width: var(--pw);
  aspect-ratio: 417 / 876;
  margin-inline: auto;
  padding: calc(var(--pt) * 12);
  border-radius: calc(var(--pt) * 67);
  background: var(--bezel);
}

.screen {
  position: relative;
  height: 100%;
  overflow: hidden;
  border-radius: calc(var(--pt) * 55);
  background: var(--bg);
  color: var(--text);
  letter-spacing: -0.02em;
  user-select: none;
}

.m-status {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: calc(var(--pt) * 54);
  padding: calc(var(--pt) * 6) calc(var(--pt) * 32) 0 calc(var(--pt) * 52);
  font-size: calc(var(--pt) * 17);
  font-weight: 600;
}

.m-island {
  position: absolute;
  top: calc(var(--pt) * 11);
  left: 50%;
  width: calc(var(--pt) * 124);
  height: calc(var(--pt) * 36);
  border-radius: 999px;
  background: #000000;
  transform: translateX(-50%);
}

.m-status-icons {
  display: flex;
  align-items: center;
  gap: calc(var(--pt) * 6);
}

.m-status-icons svg {
  height: calc(var(--pt) * 12);
  fill: currentColor;
}

.m-status-icons .sig { width: calc(var(--pt) * 18); }
.m-status-icons .wifi { width: calc(var(--pt) * 16); }
.m-status-icons .batt { width: calc(var(--pt) * 27); height: calc(var(--pt) * 13); }

.m-nav {
  display: flex;
  justify-content: space-between;
  padding: calc(var(--pt) * 2) calc(var(--pt) * 16) 0;
}

.m-navbtn {
  display: grid;
  place-items: center;
  width: calc(var(--pt) * 44);
  height: calc(var(--pt) * 44);
  border: 1px solid var(--border-strong);
  border-radius: 50%;
  background: var(--card);
}

.m-navbtn svg {
  width: calc(var(--pt) * 21);
  height: calc(var(--pt) * 21);
}

.m-title {
  padding: calc(var(--pt) * 8) calc(var(--pt) * 16) 0;
  font-size: calc(var(--pt) * 40);
  font-weight: 800;
  line-height: 1.15;
  letter-spacing: -0.025em;
}

.m-content {
  display: flex;
  flex-direction: column;
  gap: calc(var(--pt) * 30);
  padding: calc(var(--pt) * 12) calc(var(--pt) * 16) 0;
}

/* Overview's hero: a block in the picked finish, with its own ink. */
.m-hero {
  --ink-soft: color-mix(in srgb, var(--on-brand) 70%, transparent);
  padding: calc(var(--pt) * 20);
  border-radius: calc(var(--pt) * 34);
  background: var(--brand);
  color: var(--on-brand);
  transition: background-color 320ms ease, color 320ms ease;
}

.m-hero .m-label,
.m-hero .m-k,
.m-hero .m-foot {
  color: var(--ink-soft);
}

.m-label {
  color: var(--text-2);
  font-size: calc(var(--pt) * 15);
  font-weight: 600;
  line-height: 1.33;
}

.m-hero .m-money {
  margin-top: calc(var(--pt) * -2);
  font-size: calc(var(--pt) * 64);
  letter-spacing: -0.03em;
}

.m-bar {
  position: relative;
  height: calc(var(--pt) * 10);
  margin-top: calc(var(--pt) * 8);
  overflow: hidden;
  border-radius: calc(var(--pt) * 5);
  background: color-mix(in srgb, var(--on-brand) 12%, transparent);
}

.m-bar span {
  position: absolute;
  top: 0;
  bottom: 0;
  left: 0;
}

/* $1,888.99 spent and $18.99 of bills due, out of $2,400. */
.m-bar .spent {
  width: 78.708%;
  background: var(--on-brand);
  transform-origin: left center;
}

.m-bar .bills {
  left: 78.708%;
  width: 0.791%;
  min-width: 3px;
  background: color-mix(in srgb, var(--on-brand) 40%, transparent);
}

.m-legend {
  display: flex;
  gap: calc(var(--pt) * 16);
  margin-top: calc(var(--pt) * 12);
}

.m-legend > div {
  display: flex;
  flex: 1;
  flex-direction: column;
  min-width: 0;
  gap: calc(var(--pt) * 2);
}

.m-k {
  display: flex;
  align-items: center;
  gap: calc(var(--pt) * 6);
  color: var(--text-2);
  font-size: calc(var(--pt) * 13);
  line-height: 1.38;
}

.dot {
  flex: none;
  width: 7px;
  height: 7px;
  border-radius: 50%;
}

.m-k .dot {
  width: calc(var(--pt) * 7);
  height: calc(var(--pt) * 7);
}

.dot-spent { background: var(--on-brand); }
.dot-bills { background: color-mix(in srgb, var(--on-brand) 40%, transparent); }
.dot-left { box-shadow: inset 0 0 0 1.5px var(--on-brand); }

.m-legend .m-amt {
  font-size: calc(var(--pt) * 17);
}

.m-foot {
  margin-top: calc(var(--pt) * 12);
  color: var(--text-2);
  font-size: calc(var(--pt) * 13);
  font-variant-numeric: tabular-nums;
}

.m-breakdown {
  padding: calc(var(--pt) * 12) 0;
}

.m-cat {
  display: flex;
  align-items: center;
  gap: calc(var(--pt) * 12);
  padding: calc(var(--pt) * 10) calc(var(--pt) * 16);
}

.m-cat-body {
  display: flex;
  flex: 1;
  flex-direction: column;
  min-width: 0;
  gap: calc(var(--pt) * 6);
}

.m-line {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: calc(var(--pt) * 8);
}

.m-share {
  height: calc(var(--pt) * 4);
  overflow: hidden;
  border-radius: 999px;
  background: var(--fill);
}

.m-share i {
  display: block;
  width: var(--w);
  height: 100%;
  border-radius: inherit;
  background: currentColor;
}

/* iOS 26's add bar floating over the tab bar. */
.m-bottom {
  position: absolute;
  right: 0;
  bottom: 0;
  left: 0;
  z-index: 1;
  display: flex;
  flex-direction: column;
  gap: calc(var(--pt) * 8);
  padding: 0 calc(var(--pt) * 20) calc(var(--pt) * 28);
  isolation: isolate;
}

.m-bottom::before {
  content: "";
  position: absolute;
  inset: calc(var(--pt) * -14) 0 0;
  z-index: -1;
  background: var(--bg);
}

.m-accessory {
  display: flex;
  align-items: center;
  height: calc(var(--pt) * 50);
  padding: 0 calc(var(--pt) * 8);
  border: 1px solid var(--border-strong);
  border-radius: 999px;
  background: var(--card);
}

.m-acc-main {
  display: flex;
  flex: 1;
  align-items: center;
  gap: calc(var(--pt) * 10);
  padding: 0 calc(var(--pt) * 8);
  font-size: calc(var(--pt) * 17);
  font-weight: 600;
}

.m-plus {
  display: grid;
  place-items: center;
  width: calc(var(--pt) * 26);
  height: calc(var(--pt) * 26);
  border-radius: 50%;
  background: var(--primary);
  color: var(--on-primary);
}

.m-plus svg {
  width: calc(var(--pt) * 14);
  height: calc(var(--pt) * 14);
}

.m-divider {
  width: 1px;
  height: calc(var(--pt) * 22);
  background: var(--border-strong);
}

.m-income {
  padding: 0 calc(var(--pt) * 12);
  color: var(--income);
  font-size: calc(var(--pt) * 15);
  font-weight: 600;
}

.m-tabs {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  height: calc(var(--pt) * 62);
  padding: calc(var(--pt) * 4);
  border: 1px solid var(--border-strong);
  border-radius: 999px;
  background: var(--card);
}

.m-tab {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: calc(var(--pt) * 1);
  border-radius: 999px;
  color: var(--text-3);
  font-size: calc(var(--pt) * 10);
  font-weight: 600;
  letter-spacing: 0;
}

.m-tab span {
  color: var(--text-2);
}

.m-tab.is-on {
  background: var(--fill);
  color: var(--text);
}

.m-tab.is-on span {
  color: var(--text);
}

.m-tab svg {
  width: calc(var(--pt) * 25);
  height: calc(var(--pt) * 25);
}

.m-home {
  position: absolute;
  bottom: calc(var(--pt) * 8);
  left: 50%;
  z-index: 2;
  width: calc(var(--pt) * 134);
  height: calc(var(--pt) * 5);
  border-radius: 999px;
  background: var(--text);
  transform: translateX(-50%);
}


/* ---------- Add sheet ---------- */

.sheet {
  --sw: min(100vw - 2 * var(--gutter) - 2 * clamp(16px, 4vw, 56px), 372px);
  --pt: calc(var(--sw) / 393);
  width: var(--sw);
  padding: calc(var(--pt) * 8) calc(var(--pt) * 16) calc(var(--pt) * 20);
  border-radius: calc(var(--pt) * 40);
  background: var(--card);
  letter-spacing: -0.02em;
  user-select: none;
}

/* Beside the copy, the sheet fits its half of the row. */
@media (min-width: 920px) {
  .sheet {
    --sw: min(372px, (100vw - 2 * var(--gutter) - clamp(48px, 6vw, 96px)) / 2 - 2 * clamp(16px, 4vw, 56px));
  }
}

.s-grab {
  width: calc(var(--pt) * 36);
  height: calc(var(--pt) * 5);
  margin: 0 auto calc(var(--pt) * 10);
  border-radius: 999px;
  background: var(--fill-strong);
}

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

.s-close,
.s-spacer {
  display: grid;
  place-items: center;
  width: calc(var(--pt) * 44);
  height: calc(var(--pt) * 44);
  border-radius: 50%;
}

.s-close {
  background: var(--fill);
}

.s-close svg {
  width: calc(var(--pt) * 16);
  height: calc(var(--pt) * 16);
}

.s-seg {
  display: grid;
  grid-template-columns: 1fr 1fr;
  width: calc(var(--pt) * 190);
  height: calc(var(--pt) * 38);
  padding: calc(var(--pt) * 3);
  border-radius: 999px;
  background: var(--fill);
}

.s-seg span {
  display: grid;
  place-items: center;
  border-radius: 999px;
  color: var(--text-2);
  font-size: calc(var(--pt) * 15);
  font-weight: 600;
}

.s-seg .is-on {
  background: var(--thumb);
  color: var(--text);
  box-shadow: inset 0 0 0 1px var(--border-strong);
}

.s-hero {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: calc(var(--pt) * 8);
  padding: calc(var(--pt) * 40) 0 calc(var(--pt) * 36);
}

.s-hero .m-money {
  font-size: calc(var(--pt) * 56);
  letter-spacing: -0.03em;
}

.s-note {
  color: var(--text-3);
  font-size: calc(var(--pt) * 17);
}

.s-pills {
  display: flex;
  gap: calc(var(--pt) * 8);
  margin-top: calc(var(--pt) * 4);
}

.s-pill {
  display: inline-flex;
  align-items: center;
  gap: calc(var(--pt) * 6);
  height: calc(var(--pt) * 34);
  padding: 0 calc(var(--pt) * 14);
  border-radius: 999px;
  background: var(--fill);
  font-size: calc(var(--pt) * 15);
}

.s-pill svg {
  width: calc(var(--pt) * 17);
  height: calc(var(--pt) * 17);
}

.s-cats {
  display: flex;
  justify-content: space-between;
  padding-bottom: calc(var(--pt) * 18);
}

.s-chip {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: calc(var(--pt) * 4);
  width: calc(var(--pt) * 64);
  color: var(--text-2);
  font-size: calc(var(--pt) * 12);
  letter-spacing: 0;
}

.s-ring {
  display: grid;
  place-items: center;
  width: calc(var(--pt) * 46);
  height: calc(var(--pt) * 46);
  border: calc(var(--pt) * 2) solid transparent;
  border-radius: calc(var(--pt) * 15.6);
}

.s-chip .m-tile {
  width: calc(var(--pt) * 36);
  height: calc(var(--pt) * 36);
  border-radius: calc(var(--pt) * 11.5);
}

.s-chip .m-tile svg {
  width: calc(var(--pt) * 17);
  height: calc(var(--pt) * 17);
}

.s-chip.is-on {
  color: var(--text);
}

.s-chip.is-on .s-ring {
  border-color: var(--text);
}

.s-keys {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: calc(var(--pt) * 4);
  max-width: calc(var(--pt) * 330);
  margin: 0 auto;
}

.s-keys span {
  display: grid;
  place-items: center;
  height: calc(var(--pt) * 46);
  font-family: var(--font-figure);
  font-size: calc(var(--pt) * 26);
  font-weight: 400;
  letter-spacing: 0;
}

.s-keys svg {
  width: calc(var(--pt) * 26);
  height: calc(var(--pt) * 26);
}

.s-save {
  display: grid;
  place-items: center;
  height: calc(var(--pt) * 56);
  margin-top: calc(var(--pt) * 14);
  border-radius: 999px;
  background: var(--primary);
  color: var(--on-primary);
  font-size: calc(var(--pt) * 17);
  font-weight: 600;
}


/* ---------- One number ---------- */

.sum {
  display: grid;
  gap: clamp(28px, 4vw, 44px);
  padding: clamp(24px, 5.5vw, 64px);
}

.sum-label {
  color: var(--ink-2);
  font-size: clamp(16px, 0.9rem + 0.3vw, 19px);
  font-weight: 500;
}

.sum-fig {
  display: flex;
  align-items: flex-start;
  margin-top: 6px;
  font-size: clamp(4rem, 2rem + 8vw, 10rem);
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  line-height: 0.9;
  letter-spacing: -0.06em;
  white-space: nowrap;
}

.sum-fig .cents {
  margin-top: 0.08em;
  font-size: 0.45em;
  letter-spacing: -0.04em;
}

.sum-bar {
  position: relative;
  height: clamp(14px, 1.6vw, 20px);
  overflow: hidden;
  border-radius: 999px;
  background: var(--sand);
}

.sum-bar span {
  position: absolute;
  top: 0;
  bottom: 0;
  left: 0;
}

.sum-bar .spent {
  width: 78.708%;
  background: var(--ink);
}

.sum-bar .bills {
  left: 78.708%;
  width: 0.791%;
  min-width: 5px;
  background: var(--stone);
}

.sum .dot {
  width: 10px;
  height: 10px;
}

.sum .dot-spent { background: var(--ink); }
.sum .dot-bills { background: var(--stone); }
.sum .dot-left { background: var(--sand); }

.eq {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 16px clamp(16px, 2.4vw, 36px);
}

.eq-term {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.eq-k {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--ink-2);
  font-size: 16px;
}

.eq-v,
.eq-op {
  font-size: clamp(1.5rem, 1.1rem + 1.1vw, 2.25rem);
  font-variant-numeric: tabular-nums;
  line-height: 1.1;
  letter-spacing: -0.04em;
  white-space: nowrap;
}

.eq-v {
  font-weight: 600;
}

.eq-op {
  padding-bottom: 1px;
  color: var(--stone);
  font-weight: 400;
}

.eq-total .eq-v {
  padding: 2px 12px;
  margin-left: -12px;
  border-radius: var(--r-chip);
  background: var(--green);
}

@media (max-width: 700px) {
  .eq {
    display: grid;
    gap: 0;
  }

  .eq-op {
    display: none;
  }

  .eq-term {
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    padding-block: 10px;
  }

  .eq-v {
    font-size: 22px;
  }

  .eq-total {
    margin-top: 6px;
    padding-top: 16px;
    border-top: 1.5px solid var(--ink);
  }

  .eq-total .eq-v {
    margin: 0 -8px 0 0;
    padding: 2px 8px;
  }
}

.states {
  display: grid;
  gap: 20px;
  padding-top: clamp(24px, 3vw, 36px);
  border-top: 1px solid var(--line);
}

@media (min-width: 900px) {
  .states {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 32px;
  }
}

.state {
  display: grid;
  gap: 12px;
}

.state p {
  color: var(--ink-2);
  font-size: 16px;
}

/* The hero keeps its colour; how things stand is a small label on it, as in the app. */
.state-chip {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  min-height: 64px;
  padding: 12px 14px 12px 18px;
  border-radius: 20px;
  background: var(--brand);
  color: var(--on-brand);
}

.state-fig {
  font-family: var(--font-figure);
  font-size: 28px;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.03em;
}

.state-tag {
  padding: 4px 10px;
  border-radius: 999px;
  color: var(--ink);
  font-size: 13px;
  font-weight: 600;
  white-space: nowrap;
}

.tag-sun { background: var(--signal-sun); }
.tag-coral { background: var(--coral); }

/* ---------- Log it ---------- */

.sheet-stage {
  padding: clamp(32px, 6vw, 72px) clamp(16px, 4vw, 56px);
}

/* On a phone the sheet fills its block, so the receipt moves up to the
   empty corner beside the Expense / Income switch. */
@media (max-width: 600px) {
  .sticker-receipt {
    top: -24px;
    right: 4px;
    bottom: auto;
  }
}

/* ---------- Pay period ---------- */

.period {
  min-inline-size: 0;
  margin: 0;
  padding: clamp(24px, 5.5vw, 64px);
  border: 0;
  border-radius: var(--r-xl);
  background: var(--white);
}

.period-grid {
  display: grid;
  gap: 48px;
}

/* Side by side only once the switcher and the figures have room beside the calendar. */
@media (min-width: 1080px) {
  .period-grid {
    grid-template-columns: minmax(0, 1fr) minmax(0, 400px);
    gap: clamp(48px, 6vw, 80px);
    align-items: center;
  }
}

.period-side {
  display: grid;
  gap: 36px;
  align-content: start;
}

/* Radios sit next to their labels, so focusing one never scrolls the page. */
.seg {
  position: relative;
  display: inline-grid;
  grid-template-columns: repeat(3, auto);
  justify-self: start;
  max-width: 100%;
  padding: 5px;
  border-radius: 999px;
  background: var(--paper);
}

.seg label {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 46px;
  padding: 0 clamp(14px, 3vw, 22px);
  border: 1.5px solid transparent;
  border-radius: 999px;
  color: var(--ink-2);
  font-size: 16px;
  font-weight: 500;
  white-space: nowrap;
  cursor: pointer;
  transition: background-color 200ms ease, color 200ms ease, border-color 200ms ease;
}

.seg label::before {
  content: "";
  width: 0;
  height: 10px;
  border-radius: 50%;
  background: var(--green-deep);
  transition: width 200ms ease;
}

.seg label:hover {
  color: var(--ink);
}

.seg input:checked + label {
  border-color: var(--ink);
  background: var(--white);
  color: var(--ink);
}

.seg input:checked + label::before {
  width: 10px;
}

.seg input:focus-visible + label {
  outline: 3px solid var(--ink);
  outline-offset: 2px;
}

@media (max-width: 400px) {
  .seg label {
    padding: 0 11px;
    font-size: 15px;
  }

  .seg input:checked + label::before {
    width: 8px;
    height: 8px;
  }
}

/*
 * Only the chosen period's words show. "2 weeks" is the default, so a
 * browser without :has() still shows one complete, correct example.
 */
.v-month,
.v-week {
  display: none;
}

.period:has(#p-month:checked) .v-month,
.period:has(#p-week:checked) .v-week {
  display: inline;
}

.period:has(#p-month:checked) .v-2w,
.period:has(#p-week:checked) .v-2w {
  display: none;
}

.period .sum-label {
  color: var(--ink-2);
  font-size: 17px;
  font-weight: 500;
}

.period-fig {
  display: flex;
  align-items: flex-start;
  margin-top: 8px;
  font-size: clamp(3.5rem, 2rem + 4.6vw, 6rem);
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  line-height: 0.95;
  letter-spacing: -0.055em;
  white-space: nowrap;
}

.period-fig .cents {
  margin-top: 0.08em;
  font-size: 0.45em;
  letter-spacing: -0.04em;
}

.period-range {
  margin-top: 14px;
  color: var(--ink-2);
  font-size: 17px;
}

.plan {
  display: grid;
  max-width: 26em;
  border-top: 1.5px solid var(--ink);
}

.plan div {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
  padding-block: 14px;
  border-bottom: 1px solid var(--line);
}

.plan dt {
  color: var(--ink-2);
}

.plan dd {
  font-variant-numeric: tabular-nums;
  font-weight: 600;
  letter-spacing: -0.02em;
  white-space: nowrap;
}

.plan .plan-total {
  border-bottom: 0;
}

.plan .plan-total dt {
  color: var(--ink);
  font-weight: 600;
}

.cal {
  display: grid;
  gap: 18px;
  width: 100%;
  max-width: 420px;
  justify-self: center;
  padding: clamp(18px, 3vw, 28px);
  border-radius: 32px;
  background: var(--paper);
}

.cal-head {
  font-size: 19px;
  font-weight: 600;
  letter-spacing: -0.03em;
}

.cal-grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 4px;
  font-variant-numeric: tabular-nums;
}

.cal-dow {
  padding-bottom: 6px;
  color: var(--ink-2);
  font-size: 12px;
  font-weight: 600;
  text-align: center;
}

.d {
  position: relative;
  display: grid;
  place-items: center;
  aspect-ratio: 1;
  border-radius: var(--r-chip);
  color: var(--ink-2);
  font-size: 15px;
  font-weight: 500;
  transition: background-color 200ms ease, color 200ms ease;
}

/* The days in the chosen period: b is the two weeks, w the week. */
.d.b,
.period:has(#p-month:checked) .d {
  background: var(--green);
  color: var(--ink);
}

.period:has(#p-week:checked) .d.b:not(.w) {
  background: transparent;
  color: var(--ink-2);
}

.d.t {
  box-shadow: inset 0 0 0 2px var(--ink);
  color: var(--ink);
  font-weight: 700;
}

/* Payday: a dot under the date, in the views that start from it. */
.d::after {
  content: "";
  position: absolute;
  bottom: 7%;
  left: 50%;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--ink);
  opacity: 0;
  transform: translateX(-50%);
  transition: opacity 200ms ease;
}

.d.pb::after,
.period:has(#p-week:checked) .d.pw::after {
  opacity: 1;
}

.period:has(#p-month:checked) .d::after {
  opacity: 0;
}

.cal-key {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 20px;
  color: var(--ink-2);
  font-size: 14px;
}

.cal-key span {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.cal-key i {
  display: block;
  flex: none;
}

.key-period {
  width: 14px;
  height: 14px;
  border-radius: 4px;
  background: var(--green);
}

.key-pay {
  width: 5px;
  height: 5px;
  margin-inline: 4px;
  border-radius: 50%;
  background: var(--ink);
}

.key-today {
  width: 14px;
  height: 14px;
  border-radius: 4px;
  box-shadow: inset 0 0 0 2px var(--ink);
}

.period:has(#p-month:checked) .k-pay {
  display: none;
}

/* ---------- Bills and card ---------- */

.duo {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 64px;
}

@media (min-width: 960px) {
  .duo {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 32px;
  }
}

.duo-item {
  display: grid;
  grid-template-rows: auto 1fr;
  gap: 32px;
}

.duo-copy {
  display: grid;
  gap: 12px;
  align-content: start;
  padding-inline: 8px;
}

.stage {
  /* Points shrink a little on the narrowest phones, so the bill rows fit. */
  --pt: min(1px, (100vw - 2 * var(--gutter)) / 364);
  padding: clamp(24px, 5vw, 56px) clamp(16px, 4vw, 48px);
}

@media (min-width: 960px) {
  .stage {
    min-height: 480px;
  }
}

/* A piece of the app, on the app's own background, set on the colour block. */
.app-frag {
  width: 100%;
  max-width: 400px;
  padding: 20px 14px 16px;
  border-radius: 32px;
  background: var(--bg);
  color: var(--text);
  letter-spacing: -0.02em;
}

.tick {
  position: relative;
  cursor: pointer;
  border-radius: 50%;
}

/* Widen the target to 44px without moving the row. */
.tick::after {
  content: "";
  position: absolute;
  inset: -2px -7px;
}

.tick .is-done,
.tick input:checked ~ .is-open {
  display: none;
}

.tick input:checked ~ .is-done {
  display: block;
}

.tick input:focus-visible ~ svg {
  outline: 3px solid var(--ink);
  outline-offset: 2px;
  border-radius: 50%;
}

.tick:hover .is-open {
  color: var(--text-2);
}

/* Ticking Streaming pays the last bill; the header and the row say so. */
.when-paid {
  display: none;
}

.bills-demo:has(#tick-streaming:checked) .when-paid {
  display: inline;
}

.bills-demo:has(#tick-streaming:checked) .when-due {
  display: none;
}

.bills-demo:has(#tick-streaming:checked) .m-amt.is-live {
  color: var(--text-2);
}

.money-row {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 68px;
  padding: 10px 12px 10px 18px;
}

.money-fig {
  font-family: var(--font-figure);
  font-size: 22px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.02em;
  white-space: nowrap;
}

.tinted-btn {
  display: inline-grid;
  place-items: center;
  min-height: 44px;
  padding: 0 18px;
  border-radius: 999px;
  background: var(--fill);
  color: var(--text);
  font-size: 15px;
  font-weight: 600;
  white-space: nowrap;
}

.money-note {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 16px;
  padding: 0 4px;
  color: var(--text-2);
  font-size: 13px;
}


/* ---------- Widgets ---------- */

.widgets {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
  width: 100%;
  max-width: 600px;
}

@media (max-width: 520px) {
  .widgets {
    grid-template-columns: 1fr;
    max-width: 340px;
  }

  .widgets .w-panel {
    min-height: 260px;
  }
}

.w-panel {
  display: grid;
  align-content: center;
  justify-items: center;
  gap: 16px;
  min-height: 380px;
  padding: 28px 16px;
  border-radius: var(--r-xl);
}

.w-home {
  background: var(--sand);
}

.w-small {
  display: flex;
  flex-direction: column;
  width: min(170px, 100%);
  aspect-ratio: 1;
  padding: 16px;
  border-radius: 24px;
  background: var(--card);
}

.w-label {
  color: var(--text-2);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0;
}

.w-fig {
  font-family: var(--font-figure);
  font-size: 34px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  line-height: 1.1;
  letter-spacing: -0.02em;
}

.w-bar {
  height: 4px;
  margin-top: auto;
  overflow: hidden;
  border-radius: 999px;
  background: var(--fill-strong);
}

.w-bar i {
  display: block;
  width: var(--w);
  height: 100%;
  border-radius: inherit;
  background: var(--system-blue);
}

.w-cap {
  margin-top: 8px;
  color: var(--text-2);
  font-size: 11px;
  font-variant-numeric: tabular-nums;
  letter-spacing: 0;
}

.w-where {
  color: var(--ink-2);
  font-size: 14px;
  font-weight: 500;
}

.w-lock {
  background: var(--lock-surface);
  color: #F5F7FA;
  text-align: center;
}

.w-date {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0 8px;
  color: rgba(245, 247, 250, 0.82);
  font-size: 15px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

.w-date span {
  white-space: nowrap;
}

.w-clock {
  margin-top: -10px;
  font-family: var(--font-figure);
  font-size: 76px;
  font-weight: 700;
  line-height: 1;
  letter-spacing: -0.02em;
  font-variant-numeric: tabular-nums;
}

.w-rect {
  display: grid;
  gap: 2px;
  width: min(160px, 100%);
  padding: 10px 12px;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.1);
  text-align: left;
}

.w-rect .w-label {
  color: #F5F7FA;
}

.w-rect .w-fig {
  font-size: 24px;
}

.w-rect .w-bar {
  margin-top: 4px;
  background: rgba(255, 255, 255, 0.24);
}

.w-rect .w-bar i {
  background: #F5F7FA;
}

.w-lock .w-where {
  color: rgba(245, 247, 250, 0.72);
}

/* ---------- Privacy ---------- */

.privacy-card {
  display: grid;
  gap: 40px;
  justify-items: start;
  padding: clamp(8px, 2vw, 24px) clamp(24px, 5.5vw, 64px) clamp(32px, 5vw, 56px);
}

.facts {
  width: 100%;
}

.facts > div {
  display: grid;
  gap: 6px;
  padding-block: 24px;
  border-bottom: 1px solid var(--line);
}

@media (min-width: 760px) {
  .facts > div {
    grid-template-columns: minmax(0, 5fr) minmax(0, 7fr);
    gap: 32px;
    align-items: baseline;
    padding-block: 32px;
  }
}

.facts dt {
  display: flex;
  align-items: baseline;
  gap: 14px;
  font-size: clamp(1.5rem, 1.2rem + 1vw, 2.125rem);
  font-weight: 600;
  line-height: 1.1;
  letter-spacing: -0.04em;
}

.facts dt::before {
  content: "";
  flex: none;
  width: 0.42em;
  height: 0.42em;
  border: 1.5px solid var(--ink);
  border-radius: 50%;
  background: var(--green);
  transform: translateY(-0.06em);
}

.facts dd {
  max-width: 34em;
  color: var(--ink-2);
  text-wrap: pretty;
}

/* ---------- Closing band and footer ---------- */

.closing {
  margin-top: clamp(88px, 11vw, 160px);
  padding-block: clamp(72px, 10vw, 144px) clamp(56px, 7vw, 96px);
  border-radius: var(--r-xl) var(--r-xl) 0 0;
  background: var(--sun);
}

.closing-inner {
  display: grid;
  gap: 48px;
  align-items: center;
}

.closing-copy {
  display: grid;
  justify-items: start;
  gap: clamp(32px, 4vw, 48px);
}

/* The app icon, set like a sticker. */
.closing-icon {
  order: -1;
  width: clamp(88px, 18vw, 240px);
  height: auto;
  border-radius: 22.5%;
  outline: 2px solid var(--ink);
  outline-offset: 0;
  transform: rotate(-8deg);
}

@media (min-width: 820px) {
  .closing-inner {
    grid-template-columns: minmax(0, 1fr) auto;
  }

  .closing-icon {
    order: 0;
    margin-right: clamp(0px, 4vw, 64px);
  }
}

.closing-title {
  max-width: 7.4em;
}

.site-footer {
  margin-top: clamp(64px, 8vw, 112px);
  padding-block: 40px 48px;
  border-radius: var(--r-xl) var(--r-xl) 0 0;
  background: var(--sun);
}

.home .site-footer {
  margin-top: 0;
  padding-top: 0;
  border-radius: 0;
}

.footer-inner {
  display: grid;
  gap: 20px;
}

.home .footer-inner {
  padding-top: 32px;
  border-top: 1.5px solid var(--ink);
}

.footer-top {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 16px 32px;
}

.footer-links {
  display: flex;
  flex-wrap: wrap;
  gap: 0 28px;
  font-size: 16px;
  font-weight: 500;
}

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

.footer-links a:hover {
  text-decoration: underline;
}

.fine {
  max-width: 60em;
  color: var(--ink);
  font-size: 13px;
  line-height: 1.5;
  opacity: 0.82;
}

/* ---------- Privacy policy page ---------- */

.legal-page {
  padding-top: clamp(56px, 9vw, 112px);
}

.legal-page .display {
  font-size: clamp(3.5rem, 1.8rem + 6.4vw, 7.5rem);
}

.legal-meta {
  margin-top: 20px;
  color: var(--ink-2);
  font-size: 17px;
}

.legal-summary {
  display: grid;
  gap: 12px;
  margin-top: clamp(32px, 4vw, 56px);
  padding: clamp(24px, 4vw, 40px);
  border-radius: var(--r-xl);
  background: var(--green);
}

.legal-summary p {
  max-width: 40em;
  font-size: clamp(1.125rem, 1rem + 0.45vw, 1.375rem);
  line-height: 1.45;
  letter-spacing: -0.02em;
}

.legal {
  margin-top: 16px;
  padding: clamp(8px, 2vw, 24px) clamp(24px, 6vw, 80px) clamp(40px, 6vw, 72px);
}

.legal h2 {
  margin-top: 48px;
  font-size: clamp(1.5rem, 1.25rem + 0.8vw, 2rem);
  font-weight: 600;
  line-height: 1.15;
  letter-spacing: -0.035em;
}

.legal h2 + p,
.legal p + p,
.legal p + ul,
.legal ul + p {
  margin-top: 12px;
}

.legal p,
.legal li {
  max-width: 62ch;
  color: var(--ink-2);
  text-wrap: pretty;
}

.legal ul {
  display: grid;
  gap: 8px;
  padding-left: 1.2em;
  list-style: disc;
}

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

.legal strong {
  color: var(--ink);
  font-weight: 600;
}

/* ---------- 404 ---------- */

.missing {
  display: grid;
  justify-items: start;
  align-content: center;
  gap: 20px;
  min-height: 100svh;
  padding-block: 64px;
}

.missing-fig {
  display: flex;
  align-items: flex-start;
  color: var(--stone);
  font-family: var(--font-figure);
  font-size: clamp(5rem, 3rem + 10vw, 11rem);
  font-weight: 800;
  line-height: 0.9;
  letter-spacing: -0.05em;
}

.missing-fig .cents {
  margin-top: 0.08em;
  font-size: 0.45em;
  letter-spacing: -0.01em;
}

.missing .ghost-pill {
  margin-top: 12px;
  padding-inline: 26px;
}

/* ---------- Motion ---------- */

@media (prefers-reduced-motion: no-preference) {
  html {
    scroll-behavior: smooth;
  }

  .phone .m-bar .spent {
    animation: grow 900ms cubic-bezier(0.2, 0.8, 0.2, 1) 250ms both;
  }

  .phone .m-bar .bills {
    animation: appear 300ms ease-out 1050ms both;
  }

  @keyframes grow {
    from { transform: scaleX(0); }
  }

  @keyframes appear {
    from { opacity: 0; }
  }

  /* The hero settles in once, on load. */
  .hero-copy > *,
  .hero-stage {
    animation: rise 700ms cubic-bezier(0.2, 0.8, 0.2, 1) backwards;
  }

  .hero-copy > :nth-child(2) { animation-delay: 80ms; }
  .hero-copy > :nth-child(3) { animation-delay: 160ms; }
  .hero-stage { animation-delay: 120ms; }

  .sticker-coin {
    animation: drop 900ms cubic-bezier(0.3, 1.4, 0.5, 1) 500ms backwards;
  }

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

  @keyframes drop {
    from { opacity: 0; transform: translateY(-24px) rotate(-40deg); }
  }

  /* Further down, sections lift into place as they scroll in. No script:
     browsers without scroll timelines just show them. */
  @supports (animation-timeline: view()) {
    .section-head,
    .sum,
    .split > *,
    .period,
    .duo-item,
    .privacy-card,
    .closing-copy,
    .closing-icon {
      animation: rise linear both;
      animation-timeline: view();
      animation-range: entry 0% entry 40%;
    }

    .stage .app-frag,
    .sheet {
      animation: tilt linear both;
      animation-timeline: view();
      animation-range: entry 10% cover 45%;
    }

    @keyframes tilt {
      from { transform: rotate(-4deg) translateY(32px); }
    }
  }

  /* The stickers lean in when you point at their block. */
  .block .sticker {
    transition: transform 400ms cubic-bezier(0.3, 1.4, 0.5, 1);
  }

  .hero-stage:hover .sticker-coin { transform: rotate(-24deg) scale(1.06); }
  .sheet-stage:hover .sticker-receipt { transform: rotate(16deg) translateY(-6px); }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    transition-duration: 0.01ms !important;
    animation: none !important;
  }
}
