/*
 *  mona.css
 *  Mona — marketing site
 *
 *  A direct port of the app's design system. Every value below is lifted from
 *  Mona/DesignSystem/*.swift rather than re-chosen by eye, so the site and the
 *  app cannot drift apart.
 *
 *  The three rules that invert between appearances (MonaColor.swift) hold here
 *  too:
 *    1. Cards stop being translucent. On black a 5.5% white fill reads as
 *       glass; on #F5F5F7 it is invisible, so light cards are opaque white with
 *       a hairline. Translucency survives only in chrome — the nav and the
 *       composer — where content genuinely passes behind.
 *    2. Borders halve, shadows appear. 1px + no shadow on dark; 0.5px + a soft
 *       shadow on light.
 *    3. Semantic colours split into --*-fill and --*-text. A hue legible on
 *       black can fail contrast as small type on white.
 */

/* ============================================================
   Foundations · tokens that do not change with appearance
   ============================================================ */

:root {
  /* Brand — the shipped app icon's violet. Stays the *brand* mark;
     --accent-fill stays the *interactive* colour. Deliberately not unified. */
  --brand: #6155f5;
  --brand-top: #7c72f8;
  --brand-bottom: #5044e3;

  /* Radius (MonaGeometry.swift) */
  --r-tile: 10px;
  --r-chip: 14px;
  --r-inner: 20px;
  --r-card: 28px;
  --r-sheet: 34px;

  /* The 4pt grid. A gap not on this scale is a mistake, not a refinement. */
  --s-xs: 4px;
  --s-sm: 8px;
  --s-md: 12px;
  --s-lg: 16px;
  --s-xl: 20px;
  --s-xxl: 24px;
  --s-section: 32px;

  /* Fixed metrics */
  --tap-target: 44px;
  --row-icon: 38px;
  --progress-track: 6px;

  /* Type. Rounded is reserved for money and titles — it is a signal, not a
     style. SF Pro Rounded exists on Apple platforms; elsewhere the stack falls
     back to the platform UI face. */
  --font-text: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Inter",
    "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --font-rounded: ui-rounded, "SF Pro Rounded", "Hiragino Maru Gothic ProN",
    "Varela Round", -apple-system, BlinkMacSystemFont, system-ui, sans-serif;

  /* Motion (MonaMotion.swift) — one curve, three durations. */
  --ease: cubic-bezier(0.22, 0.61, 0.36, 1);
  --dur-fast: 0.18s;
  --dur-base: 0.32s;
  --dur-slow: 0.55s;

  /* Layout */
  --page-max: 1080px;
  --gutter: var(--s-xl);
}

/* ============================================================
   Appearance · dark (the app's home appearance — true black, so
   glass has something to bend)
   ============================================================ */

:root,
:root[data-theme="dark"] {
  color-scheme: dark;

  --canvas: #000000;
  --card: rgba(255, 255, 255, 0.055);
  --raised: rgba(255, 255, 255, 0.1);
  --chrome: rgba(28, 28, 30, 0.82);

  --card-border: rgba(255, 255, 255, 0.09);
  --raised-border: rgba(255, 255, 255, 0.12);
  --chrome-border: rgba(255, 255, 255, 0.12);
  --separator: rgba(255, 255, 255, 0.07);

  --text-primary: #ffffff;
  --text-secondary: rgba(235, 235, 245, 0.62);
  --text-tertiary: rgba(235, 235, 245, 0.32);
  --text-quaternary: rgba(235, 235, 245, 0.2);
  --text-on-accent: #ffffff;

  --accent-fill: #0a84ff;
  --accent-text: #0a84ff;
  --positive-fill: #30d158;
  --positive-text: #30d158;
  --caution-fill: #ff9f0a;
  --caution-text: #ffb84d;
  --critical-fill: #ff453a;
  --critical-text: #ff6961;
  --intelligence-fill: #bf5af2;
  --intelligence-text: #da8fff;

  --chart-bar: rgba(255, 255, 255, 0.16);

  /* Rule 2 — 1pt border, no resting shadow. */
  --stroke: 1px;
  --elev-card: 0 0 0 rgba(0, 0, 0, 0);
  --elev-floating: 0 12px 30px rgba(0, 0, 0, 0.65);

  /* Tint wash — 18% on black. */
  --wash: 0.18;
  --wash-border: 0.24;

  --hero-glow: 0.5;
}

/* ============================================================
   Appearance · light
   ============================================================ */

:root[data-theme="light"] {
  color-scheme: light;

  --canvas: #f5f5f7;
  --card: #ffffff; /* Rule 1 — opaque. */
  --raised: rgba(120, 120, 128, 0.14);
  --chrome: rgba(249, 249, 249, 0.9);

  --card-border: rgba(0, 0, 0, 0.05);
  --raised-border: rgba(0, 0, 0, 0.06);
  --chrome-border: rgba(0, 0, 0, 0.07);
  --separator: rgba(0, 0, 0, 0.08);

  --text-primary: #000000;
  --text-secondary: rgba(60, 60, 67, 0.6);
  --text-tertiary: rgba(60, 60, 67, 0.4);
  --text-quaternary: rgba(60, 60, 67, 0.26);
  --text-on-accent: #ffffff;

  --accent-fill: #007aff;
  --accent-text: #007aff;
  --positive-fill: #34c759;
  --positive-text: #248a3d; /* #34C759 fails contrast as small type on white. */
  --caution-fill: #ff9500;
  --caution-text: #b25000;
  --critical-fill: #ff3b30;
  --critical-text: #d70015;
  --intelligence-fill: #af52de;
  --intelligence-text: #8944ab;

  --chart-bar: rgba(60, 60, 67, 0.18);

  /* Rule 2 — 0.5pt hairline plus a soft shadow. */
  --stroke: 0.5px;
  --elev-card: 0 1px 3px rgba(0, 0, 0, 0.04);
  --elev-floating: 0 8px 26px rgba(0, 0, 0, 0.14);

  --wash: 0.13;
  --wash-border: 0.22;

  --hero-glow: 0.16;
}

@media (prefers-color-scheme: light) {
  :root:not([data-theme]) {
    color-scheme: light;

    --canvas: #f5f5f7;
    --card: #ffffff;
    --raised: rgba(120, 120, 128, 0.14);
    --chrome: rgba(249, 249, 249, 0.9);

    --card-border: rgba(0, 0, 0, 0.05);
    --raised-border: rgba(0, 0, 0, 0.06);
    --chrome-border: rgba(0, 0, 0, 0.07);
    --separator: rgba(0, 0, 0, 0.08);

    --text-primary: #000000;
    --text-secondary: rgba(60, 60, 67, 0.6);
    --text-tertiary: rgba(60, 60, 67, 0.4);
    --text-quaternary: rgba(60, 60, 67, 0.26);

    --accent-fill: #007aff;
    --accent-text: #007aff;
    --positive-fill: #34c759;
    --positive-text: #248a3d;
    --caution-fill: #ff9500;
    --caution-text: #b25000;
    --critical-fill: #ff3b30;
    --critical-text: #d70015;
    --intelligence-fill: #af52de;
    --intelligence-text: #8944ab;

    --chart-bar: rgba(60, 60, 67, 0.18);

    --stroke: 0.5px;
    --elev-card: 0 1px 3px rgba(0, 0, 0, 0.04);
    --elev-floating: 0 8px 26px rgba(0, 0, 0, 0.14);

    --wash: 0.13;
    --wash-border: 0.22;

    --hero-glow: 0.16;
  }
}

/* ============================================================
   Reset
   ============================================================ */

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

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

body {
  margin: 0;
  background: var(--canvas);
  color: var(--text-primary);
  font-family: var(--font-text);
  font-size: 17px; /* Mona.font.body */
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
  transition: background-color var(--dur-base) var(--ease),
    color var(--dur-base) var(--ease);
}

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

a {
  color: var(--accent-text);
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

button {
  font: inherit;
  color: inherit;
  border: 0;
  background: none;
  cursor: pointer;
}

:focus-visible {
  outline: 2px solid var(--accent-fill);
  outline-offset: 3px;
  border-radius: var(--s-xs);
}

/* ============================================================
   Type ramp (MonaTypography.swift)
   Nothing on this page is smaller than 13px — the app's floor.
   ============================================================ */

.eyebrow {
  font-family: var(--font-rounded);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 1.32px; /* +12% of 11pt */
  text-transform: uppercase;
  color: var(--text-tertiary);
  margin: 0;
}

.title1 {
  font-family: var(--font-rounded);
  font-size: 28px;
  font-weight: 700;
  letter-spacing: -0.56px; /* −2% */
  line-height: 1.18;
  margin: 0;
}

.title3 {
  font-family: var(--font-rounded);
  font-size: 20px;
  font-weight: 600;
  line-height: 1.25;
  margin: 0;
}

.headline {
  font-size: 17px;
  font-weight: 600;
  margin: 0;
}

.body {
  font-size: 17px;
  margin: 0;
}

.subheadline {
  font-size: 15px;
  margin: 0;
}

.footnote {
  font-size: 13px; /* the floor */
  margin: 0;
}

.secondary {
  color: var(--text-secondary);
}
.tertiary {
  color: var(--text-tertiary);
}

/* Money — always monospaced digits so columns align. */
.money-hero,
.money-large,
.money-row {
  font-family: var(--font-rounded);
  font-variant-numeric: tabular-nums;
  font-feature-settings: "tnum" 1;
}

.money-hero {
  font-size: 56px;
  font-weight: 700;
  letter-spacing: -1.68px; /* −3% */
  line-height: 1;
}

.money-large {
  font-size: 34px;
  font-weight: 700;
  letter-spacing: -0.68px; /* −2% */
  line-height: 1.1;
}

.money-row {
  font-size: 17px;
  font-weight: 600;
}

/* ============================================================
   Surfaces (MonaSurface.swift)
   ============================================================ */

.card {
  background: var(--card);
  border: var(--stroke) solid var(--card-border);
  border-radius: var(--r-card);
  box-shadow: var(--elev-card);
}

.raised {
  background: var(--raised);
  border: var(--stroke) solid var(--raised-border);
  border-radius: var(--r-chip);
}

/* ============================================================
   Layout
   ============================================================ */

.wrap {
  width: 100%;
  max-width: var(--page-max);
  margin-inline: auto;
  padding-inline: var(--gutter);
}

section {
  padding-block: clamp(56px, 9vw, 112px);
}

.section-head {
  max-width: 34ch;
  margin-bottom: var(--s-section);
}

.section-head .title1 {
  margin-top: var(--s-md);
}

.section-head .lead {
  margin-top: var(--s-md);
  color: var(--text-secondary);
  font-size: 17px;
}

.skip-link {
  position: absolute;
  left: -9999px;
  top: var(--s-sm);
  padding: var(--s-sm) var(--s-lg);
  background: var(--accent-fill);
  color: var(--text-on-accent);
  border-radius: var(--r-chip);
  z-index: 100;
}

.skip-link:focus {
  left: var(--s-lg);
}

/* ============================================================
   Nav — chrome. Translucency survives here: content passes behind.
   ============================================================ */

.nav {
  position: sticky;
  top: 0;
  z-index: 50;
  background: var(--chrome);
  backdrop-filter: saturate(180%) blur(20px);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
  border-bottom: var(--stroke) solid var(--chrome-border);
}

.nav__inner {
  display: flex;
  align-items: center;
  gap: var(--s-lg);
  min-height: 56px;
  padding-block: var(--s-sm);
}

.nav__brand {
  display: flex;
  align-items: center;
  gap: var(--s-sm);
  font-family: var(--font-rounded);
  font-size: 20px;
  font-weight: 600;
  color: var(--text-primary);
  margin-right: auto;
}

.nav__brand:hover {
  text-decoration: none;
}

.nav__mark {
  width: 30px;
  height: 30px;
  border-radius: 7px;
  flex: none;
}

.nav__links {
  display: flex;
  align-items: center;
  gap: var(--s-xl);
}

.nav__links a {
  color: var(--text-secondary);
  font-size: 15px;
}

.nav__links a:hover {
  color: var(--text-primary);
  text-decoration: none;
}

@media (max-width: 720px) {
  .nav__links {
    display: none;
  }
}

/* Anything interactive and short is a capsule, never a 12pt rounded rect. */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--s-sm);
  min-height: var(--tap-target);
  padding: 0 var(--s-xl);
  border-radius: 999px;
  font-size: 17px;
  font-weight: 600;
  white-space: nowrap;
  transition: transform var(--dur-fast) var(--ease),
    opacity var(--dur-fast) var(--ease), background-color var(--dur-fast) var(--ease);
}

.btn:hover {
  text-decoration: none;
  transform: translateY(-1px);
}

.btn:active {
  transform: translateY(0) scale(0.98);
}

.btn--primary {
  background: var(--accent-fill);
  color: var(--text-on-accent);
}

.btn--primary:hover {
  opacity: 0.9;
}

.btn--secondary {
  background: var(--raised);
  border: var(--stroke) solid var(--raised-border);
  color: var(--text-primary);
}

.btn--sm {
  min-height: 36px;
  padding: 0 var(--s-lg);
  font-size: 15px;
}

.theme-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: 999px;
  background: var(--raised);
  border: var(--stroke) solid var(--raised-border);
  color: var(--text-secondary);
  flex: none;
  transition: color var(--dur-fast) var(--ease);
}

.theme-toggle:hover {
  color: var(--text-primary);
}

.theme-toggle svg {
  width: 18px;
  height: 18px;
}

/* The toggle shows the appearance it will switch *to*. */
.theme-toggle .icon-sun {
  display: none;
}
:root[data-theme="dark"] .theme-toggle .icon-sun {
  display: block;
}
:root[data-theme="dark"] .theme-toggle .icon-moon {
  display: none;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme]) .theme-toggle .icon-sun {
    display: block;
  }
  :root:not([data-theme]) .theme-toggle .icon-moon {
    display: none;
  }
}

/* ============================================================
   Hero
   ============================================================ */

.hero {
  position: relative;
  padding-top: clamp(40px, 7vw, 80px);
  padding-bottom: clamp(48px, 8vw, 96px);
  overflow: hidden;
}

/* Echoes the violet-to-black backdrop of the App Store frames. */
.hero::before {
  content: "";
  position: absolute;
  top: -30%;
  left: 50%;
  width: min(1100px, 150vw);
  aspect-ratio: 1;
  transform: translateX(-50%);
  background: radial-gradient(
    circle at 50% 50%,
    rgba(97, 85, 245, var(--hero-glow)) 0%,
    rgba(97, 85, 245, 0) 62%
  );
  pointer-events: none;
  z-index: 0;
}

.hero__inner {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: clamp(32px, 6vw, 72px);
  align-items: center;
}

@media (max-width: 940px) {
  .hero__inner {
    grid-template-columns: minmax(0, 1fr);
    justify-items: center;
    text-align: center;
  }
  .hero__copy {
    max-width: 34rem;
  }
}

.hero h1 {
  font-family: var(--font-rounded);
  font-size: clamp(40px, 6.4vw, 68px);
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1.04;
  margin: var(--s-lg) 0 0;
  text-wrap: balance;
}

.hero__lead {
  margin: var(--s-xl) 0 0;
  font-size: clamp(17px, 2.1vw, 21px);
  line-height: 1.5;
  color: var(--text-secondary);
  max-width: 40ch;
  text-wrap: pretty;
}

@media (max-width: 940px) {
  .hero__lead {
    margin-inline: auto;
  }
}

.hero__cta {
  display: flex;
  flex-wrap: wrap;
  gap: var(--s-md);
  margin-top: var(--s-section);
}

@media (max-width: 940px) {
  .hero__cta {
    justify-content: center;
  }
}

.hero__note {
  margin-top: var(--s-lg);
  color: var(--text-tertiary);
  font-size: 13px;
}

.free-pill {
  display: inline-flex;
  align-items: center;
  gap: var(--s-sm);
  padding: 6px var(--s-md);
  border-radius: 999px;
  font-size: 13px;
  font-weight: 600;
  background: color-mix(in srgb, var(--positive-fill) calc(var(--wash) * 100%), transparent);
  border: var(--stroke) solid
    color-mix(in srgb, var(--positive-fill) calc(var(--wash-border) * 100%), transparent);
  color: var(--positive-text);
}

.free-pill::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 999px;
  background: var(--positive-fill);
}

/* ============================================================
   Phone — the app screen rebuilt from the same tokens rather than
   pasted in as a screenshot, so it stays crisp and theme-aware.
   ============================================================ */

/* Frame proportions come from the hardware, not from taste.
 *
 * An iPhone 16 Pro is 402 x 874pt of screen — 2.174 : 1 — with a 55pt display
 * corner radius, which is 13.7% of the screen's width. The width below is
 * chosen so the natural height of the content lands on that ratio; height is
 * deliberately NOT pinned with `aspect-ratio`, because SF Pro is missing off
 * Apple platforms and the substitute metrics would push content into a
 * clipped tab bar. This way an unexpected extra line makes the frame slightly
 * taller instead of cutting the bottom off.
 *
 * Bezel is 7px on a 406px body — thin, as the hardware is. The two radii are
 * concentric in the app's own sense (Mona.radius.concentric): the outer
 * radius is the screen's plus the bezel between them, so the gap stays even
 * the whole way round.
 */
.phone {
  --bezel: 7px;
  width: min(406px, 100%);
  flex: none;
  border-radius: calc(54px + var(--bezel));
  padding: var(--bezel);
  background: var(--card);
  border: var(--stroke) solid var(--card-border);
  box-shadow: var(--elev-floating);
}

.phone__screen {
  background: var(--canvas);
  border-radius: 54px; /* 13.7% of the 392px screen */
  padding: var(--s-lg) var(--s-md) var(--s-md);
  overflow: hidden;
}

.status-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 var(--s-sm) var(--s-md);
  font-size: 13px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

.status-bar__icons {
  display: flex;
  align-items: center;
  gap: 5px;
  color: var(--text-primary);
}

.status-bar__icons svg {
  height: 11px;
  width: auto;
}

.phone__topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--s-sm);
  margin-bottom: var(--s-md);
}

.month-pill {
  display: inline-flex;
  align-items: center;
  gap: var(--s-md);
  padding: var(--s-sm) var(--s-md);
  border-radius: 999px;
  background: var(--raised);
  border: var(--stroke) solid var(--raised-border);
  font-size: 15px;
  font-weight: 600;
}

.month-pill svg {
  width: 12px;
  height: 12px;
  color: var(--text-tertiary);
}

.avatar-btn {
  width: 34px;
  height: 34px;
  border-radius: 999px;
  background: var(--raised);
  border: var(--stroke) solid var(--raised-border);
  display: grid;
  place-items: center;
  color: var(--text-secondary);
}

.avatar-btn svg {
  width: 18px;
  height: 18px;
}

/* Safe to spend card */
.sts {
  padding: var(--s-xl);
  margin-bottom: var(--s-md);
}

.sts__amount {
  margin: var(--s-sm) 0 0;
  font-size: 50px;
  letter-spacing: -1.5px;
}

.sts__sub {
  margin: var(--s-md) 0 0;
  font-size: 15px;
  color: var(--text-secondary);
  line-height: 1.35;
}

.sts__sub strong {
  color: var(--positive-text);
  font-weight: 600;
}

/* One bar carrying two things: how much is spent, and how much of the
   month has gone. Fill behind the marker means pacing is good. */
.pace {
  margin-top: var(--s-lg);
  position: relative;
  height: var(--progress-track);
  border-radius: 999px;
  background: var(--chart-bar);
  overflow: visible;
}

.pace__fill {
  position: absolute;
  inset: 0 auto 0 0;
  width: 31.5%; /* $1,416 of $4,500 */
  border-radius: 999px;
  background: var(--positive-fill);
}

.pace__marker {
  position: absolute;
  top: -3px;
  bottom: -3px;
  left: 45.2%; /* day 14 of 31 */
  width: 3px;
  border-radius: 999px;
  background: var(--text-primary);
}

.sts__footer {
  display: flex;
  justify-content: space-between;
  gap: var(--s-md);
  margin-top: var(--s-md);
  font-size: 13px;
  color: var(--text-tertiary);
  font-variant-numeric: tabular-nums;
}

/* Tri-stat */
.tristat {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  margin-bottom: var(--s-lg);
  overflow: hidden;
}

.tristat__cell {
  padding: var(--s-md) var(--s-sm);
  text-align: center;
}

.tristat__cell + .tristat__cell {
  border-left: var(--stroke) solid var(--separator);
}

.tristat__label {
  font-size: 13px;
  color: var(--text-secondary);
  margin: 0 0 2px;
}

.tristat__value {
  font-size: 17px;
  font-weight: 600;
  font-family: var(--font-rounded);
  font-variant-numeric: tabular-nums;
}

.is-positive {
  color: var(--positive-text);
}

.is-caution {
  color: var(--caution-text);
}

/* Section header inside the phone */
.phone__section {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  padding: 0 var(--s-xs);
  margin-bottom: var(--s-sm);
}

.phone__section h4 {
  font-family: var(--font-rounded);
  font-size: 20px;
  font-weight: 700;
  margin: 0;
}

.phone__section span {
  font-size: 15px;
  color: var(--text-secondary);
  font-variant-numeric: tabular-nums;
}

/* Transaction rows */
.rows {
  padding: var(--s-xs) 0;
  margin-bottom: var(--s-md);
}

.row {
  display: flex;
  align-items: center;
  gap: var(--s-md);
  padding: var(--s-md) var(--s-lg);
}

.row + .row {
  border-top: var(--stroke) solid var(--separator);
  margin-left: 64px; /* separatorInset.withIconTile */
  padding-left: 0;
}

.row + .row .row__tile {
  margin-left: calc(-1 * 64px + var(--s-lg));
}

.row__tile {
  width: var(--row-icon);
  height: var(--row-icon);
  border-radius: var(--r-tile);
  display: grid;
  place-items: center;
  flex: none;
}

.row__tile svg {
  width: 19px;
  height: 19px;
}

.row__text {
  min-width: 0;
  flex: 1;
}

.row__title {
  font-size: 15px;
  font-weight: 600;
  margin: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.row__sub {
  font-size: 13px;
  color: var(--text-secondary);
  margin: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.row__amount {
  font-family: var(--font-rounded);
  font-size: 15px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  flex: none;
}

/* Category washes — the tile is the true hue at --wash, the glyph is the hue. */
.tile-red {
  background: color-mix(in srgb, #ff453a calc(var(--wash) * 100%), transparent);
  color: #ff453a;
}
.tile-purple {
  background: color-mix(in srgb, #bf5af2 calc(var(--wash) * 100%), transparent);
  color: #bf5af2;
}
.tile-brown {
  background: color-mix(in srgb, #ac8e68 calc(var(--wash) * 100%), transparent);
  color: #ac8e68;
}
.tile-orange {
  background: color-mix(in srgb, var(--caution-fill) calc(var(--wash) * 100%), transparent);
  color: var(--caution-text);
}
.tile-green {
  background: color-mix(in srgb, var(--positive-fill) calc(var(--wash) * 100%), transparent);
  color: var(--positive-text);
}
.tile-blue {
  background: color-mix(in srgb, var(--accent-fill) calc(var(--wash) * 100%), transparent);
  color: var(--accent-text);
}

/* Composer — chrome, so it keeps its translucency in both appearances. */
.composer {
  display: flex;
  align-items: center;
  gap: var(--s-sm);
  padding: var(--s-sm) var(--s-sm) var(--s-sm) var(--s-lg);
  border-radius: 999px;
  background: var(--chrome);
  border: var(--stroke) solid var(--chrome-border);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  box-shadow: var(--elev-floating);
  margin-bottom: var(--s-md);
}

.composer__placeholder {
  flex: 1;
  font-size: 15px;
  color: var(--text-quaternary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.composer__mic,
.composer__add {
  width: 36px;
  height: 36px;
  border-radius: 999px;
  display: grid;
  place-items: center;
  flex: none;
}

.composer__mic {
  background: var(--raised);
  color: var(--text-secondary);
}

.composer__add {
  background: var(--accent-fill);
  color: var(--text-on-accent);
}

.composer__mic svg,
.composer__add svg {
  width: 17px;
  height: 17px;
}

/* Tab bar */
.tabbar {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  padding: var(--s-md) var(--s-sm);
  border-radius: var(--r-card);
  background: var(--chrome);
  border: var(--stroke) solid var(--chrome-border);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
}

.tab {
  display: grid;
  justify-items: center;
  gap: var(--s-xs);
  font-size: 11px;
  font-weight: 500;
  color: var(--text-tertiary);
}

.tab svg {
  width: 21px;
  height: 21px;
}

.tab.is-active {
  color: var(--accent-text);
}

/* ============================================================
   The one number — a worked example of the subtraction
   ============================================================ */

.maths {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 0.95fr);
  gap: clamp(24px, 4vw, 56px);
  /* Top-aligned, not centred: the two columns are rarely the same height, and
     a short card floating in the middle of its own row reads as a mistake. */
  align-items: start;
}

@media (max-width: 860px) {
  .maths {
    grid-template-columns: minmax(0, 1fr);
  }
}

.ledger {
  padding: var(--s-xl);
}

.ledger__row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: var(--s-lg);
  padding: var(--s-md) 0;
}

.ledger__row + .ledger__row {
  border-top: var(--stroke) solid var(--separator);
}

.ledger__row--total {
  border-top: var(--stroke) solid var(--card-border) !important;
  margin-top: var(--s-sm);
  padding-top: var(--s-lg);
}

.ledger__label {
  font-size: 15px;
  color: var(--text-secondary);
}

.ledger__label strong {
  display: block;
  font-size: 17px;
  font-weight: 600;
  color: var(--text-primary);
}

.ledger__value {
  font-family: var(--font-rounded);
  font-size: 17px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  flex: none;
}

.ledger__row--total .ledger__label strong {
  font-family: var(--font-rounded);
  font-size: 20px;
}

.ledger__row--total .ledger__value {
  font-size: 34px;
  letter-spacing: -0.68px;
  color: var(--positive-text);
}

/* ============================================================
   Feature grid
   ============================================================ */

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: var(--s-lg);
}

.feature {
  padding: var(--s-xl);
  display: flex;
  flex-direction: column;
  gap: var(--s-md);
}

.feature__icon {
  width: 44px;
  height: 44px;
  border-radius: var(--r-chip);
  display: grid;
  place-items: center;
  flex: none;
}

.feature__icon svg {
  width: 22px;
  height: 22px;
}

.feature h3 {
  font-family: var(--font-rounded);
  font-size: 20px;
  font-weight: 600;
  margin: 0;
}

.feature p {
  margin: 0;
  font-size: 15px;
  color: var(--text-secondary);
  line-height: 1.5;
}

/* ============================================================
   Capture — three ways in
   ============================================================ */

.capture {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: var(--s-lg);
}

.capture__card {
  padding: var(--s-xl);
  display: flex;
  flex-direction: column;
  gap: var(--s-lg);
}

.capture__card h3 {
  font-family: var(--font-rounded);
  font-size: 20px;
  font-weight: 600;
  margin: 0;
}

.capture__card p {
  margin: 0;
  font-size: 15px;
  color: var(--text-secondary);
}

/* Centred in the leftover space rather than pinned to the bottom — the keypad
   sets the row height, and a one-line demo pinned under it leaves a hole. */
.capture__demo {
  margin-block: auto;
  padding-top: var(--s-sm);
}

/* keypad */
.keypad {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--s-sm);
}

.keypad span {
  height: var(--tap-target);
  border-radius: var(--r-chip);
  background: var(--raised);
  border: var(--stroke) solid var(--raised-border);
  display: grid;
  place-items: center;
  font-family: var(--font-rounded);
  font-size: 20px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

/* typed line */
.typed {
  display: flex;
  align-items: center;
  gap: var(--s-sm);
  padding: var(--s-md) var(--s-lg);
  border-radius: 999px;
  background: var(--raised);
  border: var(--stroke) solid var(--raised-border);
  font-size: 15px;
}

.typed__caret {
  width: 2px;
  height: 17px;
  background: var(--accent-fill);
  border-radius: 1px;
  animation: blink 1.1s steps(1, end) infinite;
}

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

.typed__chip {
  margin-left: auto;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px var(--s-sm);
  border-radius: 999px;
  font-size: 13px;
  font-weight: 600;
  background: color-mix(in srgb, var(--caution-fill) calc(var(--wash) * 100%), transparent);
  color: var(--caution-text);
}

/* waveform */
.wave {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  height: var(--tap-target);
}

.wave i {
  display: block;
  width: 4px;
  border-radius: 999px;
  background: var(--accent-fill);
  animation: pulse 1.2s var(--ease) infinite;
}

.wave i:nth-child(1) { height: 14px; animation-delay: 0s; }
.wave i:nth-child(2) { height: 28px; animation-delay: 0.1s; }
.wave i:nth-child(3) { height: 20px; animation-delay: 0.2s; }
.wave i:nth-child(4) { height: 34px; animation-delay: 0.3s; }
.wave i:nth-child(5) { height: 18px; animation-delay: 0.4s; }
.wave i:nth-child(6) { height: 26px; animation-delay: 0.5s; }
.wave i:nth-child(7) { height: 12px; animation-delay: 0.6s; }

@keyframes pulse {
  0%, 100% { transform: scaleY(0.5); opacity: 0.55; }
  50% { transform: scaleY(1); opacity: 1; }
}

/* ============================================================
   Insight — the only place purple is allowed, because this is the
   only content the model writes.
   ============================================================ */

.insight {
  padding: var(--s-xl);
  border-radius: var(--r-card);
  background: color-mix(in srgb, var(--intelligence-fill) calc(var(--wash) * 100%), transparent);
  border: var(--stroke) solid
    color-mix(in srgb, var(--intelligence-fill) calc(var(--wash-border) * 100%), transparent);
}

.insight__label {
  display: flex;
  align-items: center;
  gap: 6px;
  color: var(--intelligence-text);
  font-family: var(--font-rounded);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 1.32px;
  text-transform: uppercase;
  margin: 0 0 var(--s-md);
}

.insight__label svg {
  width: 14px;
  height: 14px;
}

.insight p {
  margin: 0;
  font-size: 17px;
  line-height: 1.5;
}

.insight p strong {
  font-weight: 600;
}

.insight__note {
  margin-top: var(--s-lg);
  padding-top: var(--s-md);
  border-top: var(--stroke) solid
    color-mix(in srgb, var(--intelligence-fill) calc(var(--wash-border) * 100%), transparent);
  font-size: 13px;
  color: var(--text-tertiary);
}

/* Unusual / recurring lists */
.stack {
  display: grid;
  gap: var(--s-lg);
}

.mini-card {
  padding: var(--s-lg) var(--s-xl);
}

.mini-card__head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: var(--s-md);
  margin-bottom: var(--s-md);
}

.mini-card__head h3 {
  font-family: var(--font-rounded);
  font-size: 17px;
  font-weight: 600;
  margin: 0;
}

.mini-card__head span {
  font-size: 13px;
  color: var(--text-tertiary);
  font-variant-numeric: tabular-nums;
  text-align: right;
}

/* Rows sit flush inside a mini-card, which already carries the padding.
   The separator then insets by tile + gap so it starts under the text. */
.mini-card .row {
  padding-inline: 0;
}

.mini-card .row + .row {
  margin-left: calc(var(--row-icon) + var(--s-md));
}

.mini-card .row + .row .row__tile {
  margin-left: calc(-1 * (var(--row-icon) + var(--s-md)));
}

/* ============================================================
   Privacy / promises
   ============================================================ */

/* 280px rather than 210px so six promises land as 3 + 3 on a wide screen
   instead of 4 + 2 with two orphans. */
.promises {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: var(--s-md);
}

.promise {
  display: flex;
  align-items: flex-start;
  gap: var(--s-md);
  padding: var(--s-lg);
  border-radius: var(--r-inner);
  background: var(--card);
  border: var(--stroke) solid var(--card-border);
  box-shadow: var(--elev-card);
}

.promise svg {
  width: 20px;
  height: 20px;
  flex: none;
  margin-top: 2px;
  color: var(--positive-text);
}

.promise p {
  margin: 0;
  font-size: 15px;
}

.promise p span {
  display: block;
  color: var(--text-secondary);
  font-size: 13px;
  margin-top: 2px;
}

/* ============================================================
   Languages
   ============================================================ */

.langs {
  display: flex;
  flex-wrap: wrap;
  gap: var(--s-sm);
}

.lang {
  padding: var(--s-sm) var(--s-lg);
  border-radius: 999px;
  background: var(--raised);
  border: var(--stroke) solid var(--raised-border);
  font-size: 15px;
}

/* ============================================================
   Closing CTA
   ============================================================ */

.closer {
  text-align: center;
  padding: clamp(48px, 8vw, 88px) var(--s-xl);
  border-radius: var(--r-sheet);
  background: linear-gradient(180deg, var(--brand-top), var(--brand-bottom));
  color: #fff;
  position: relative;
  overflow: hidden;
}

.closer h2 {
  font-family: var(--font-rounded);
  font-size: clamp(30px, 4.6vw, 46px);
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1.08;
  margin: 0;
  text-wrap: balance;
}

.closer p {
  margin: var(--s-lg) auto 0;
  max-width: 44ch;
  font-size: 17px;
  color: rgba(255, 255, 255, 0.82);
}

.closer .btn--primary {
  margin-top: var(--s-section);
  background: #fff;
  color: var(--brand-bottom);
}

.closer .btn--primary:hover {
  opacity: 1;
  background: rgba(255, 255, 255, 0.92);
}

/* ============================================================
   Footer
   ============================================================ */

.footer {
  border-top: var(--stroke) solid var(--separator);
  padding-block: var(--s-section);
  margin-top: clamp(48px, 8vw, 96px);
}

.footer__inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--s-lg) var(--s-xxl);
}

.footer__brand {
  display: flex;
  align-items: center;
  gap: var(--s-sm);
  font-family: var(--font-rounded);
  font-weight: 600;
  color: var(--text-primary);
  margin-right: auto;
}

.footer__brand:hover {
  text-decoration: none;
}

.footer__brand img {
  width: 26px;
  height: 26px;
  border-radius: 6px;
}

.footer nav {
  display: flex;
  flex-wrap: wrap;
  gap: var(--s-lg);
}

.footer nav a {
  color: var(--text-secondary);
  font-size: 15px;
}

.footer nav a:hover {
  color: var(--text-primary);
  text-decoration: none;
}

.footer__legal {
  width: 100%;
  color: var(--text-tertiary);
  font-size: 13px;
  margin: 0;
}

/* ============================================================
   Document pages — privacy, FAQ
   ============================================================ */

.doc {
  max-width: 46rem;
  margin-inline: auto;
}

.doc__header {
  margin-bottom: var(--s-section);
}

.doc__header h1 {
  font-family: var(--font-rounded);
  font-size: clamp(32px, 5vw, 46px);
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1.1;
  margin: var(--s-md) 0 0;
  text-wrap: balance;
}

.doc__updated {
  margin-top: var(--s-md);
  font-size: 13px;
  color: var(--text-tertiary);
}

/* The honest summary, before the detail. */
.doc__tldr {
  padding: var(--s-xl);
  margin-bottom: var(--s-section);
}

.doc__tldr ul {
  margin: var(--s-md) 0 0;
  padding: 0;
  list-style: none;
  display: grid;
  gap: var(--s-md);
}

.doc__tldr li {
  display: flex;
  gap: var(--s-md);
  font-size: 15px;
  line-height: 1.5;
}

.doc__tldr li svg {
  width: 19px;
  height: 19px;
  flex: none;
  margin-top: 2px;
}

.doc__tldr li.yes svg {
  color: var(--positive-text);
}

.doc__tldr li.no svg {
  color: var(--text-tertiary);
}

.doc section {
  padding-block: 0;
  margin-bottom: var(--s-section);
}

.doc h2 {
  font-family: var(--font-rounded);
  font-size: 24px;
  font-weight: 600;
  letter-spacing: -0.4px;
  margin: 0 0 var(--s-md);
  scroll-margin-top: 80px;
}

.doc h3 {
  font-size: 17px;
  font-weight: 600;
  margin: var(--s-xl) 0 var(--s-sm);
}

.doc p {
  margin: 0 0 var(--s-md);
  font-size: 17px;
  line-height: 1.55;
  color: var(--text-secondary);
  text-wrap: pretty;
}

.doc p strong,
.doc li strong {
  color: var(--text-primary);
  font-weight: 600;
}

.doc ul:not(.doc__tldr ul) {
  margin: 0 0 var(--s-md);
  padding-left: var(--s-xl);
  color: var(--text-secondary);
}

.doc li:not(.doc__tldr li) {
  font-size: 17px;
  line-height: 1.55;
  margin-bottom: var(--s-sm);
}

/* A quiet aside for the "here is exactly what the manifest declares" detail. */
.doc__note {
  padding: var(--s-lg) var(--s-xl);
  border-radius: var(--r-inner);
  background: var(--raised);
  border: var(--stroke) solid var(--raised-border);
  margin-bottom: var(--s-md);
}

.doc__note p:last-child {
  margin-bottom: 0;
}

.doc__note p {
  font-size: 15px;
}

/* FAQ */
.faq h2 + details {
  border-top: var(--stroke) solid var(--separator);
}

/* Group headings need air above them; the first one already sits under the
   page header, so it keeps its own spacing. */
.faq h2 {
  margin-top: var(--s-section);
}

.faq > h2:first-child {
  margin-top: 0;
}

.faq details {
  border-bottom: var(--stroke) solid var(--separator);
}

.faq details[open] summary {
  color: var(--text-primary);
}

.faq summary {
  cursor: pointer;
  list-style: none;
  padding: var(--s-lg) var(--tap-target) var(--s-lg) 0;
  position: relative;
  font-size: 17px;
  font-weight: 600;
  transition: color var(--dur-fast) var(--ease);
}

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

.faq summary::after {
  content: "";
  position: absolute;
  right: var(--s-md);
  top: 50%;
  width: 9px;
  height: 9px;
  border-right: 2px solid var(--text-tertiary);
  border-bottom: 2px solid var(--text-tertiary);
  transform: translateY(-70%) rotate(45deg);
  transition: transform var(--dur-fast) var(--ease);
}

.faq details[open] summary::after {
  transform: translateY(-30%) rotate(-135deg);
}

.faq details > div {
  padding-bottom: var(--s-lg);
}

.faq details > div p:last-child {
  margin-bottom: 0;
}

/* ============================================================
   Reveal on scroll
   ============================================================ */

/* Driven by the scroll position in CSS, with no JavaScript involved.
 *
 * The rule is deliberately additive: `.reveal` on its own has no styles, so
 * the content is visible by default. Only a browser that supports
 * `animation-timeline` — and only a reader who has not asked for reduced
 * motion — ever opts into the fade. Nothing here can leave a section stuck
 * invisible, which an observer-driven version can if the observer never fires.
 */
@keyframes reveal-in {
  from {
    opacity: 0;
    transform: translateY(14px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

@supports (animation-timeline: view()) {
  @media (prefers-reduced-motion: no-preference) {
    .reveal {
      animation: reveal-in linear both;
      animation-timeline: view();
      /* Finishes well before the element reaches the middle of the screen —
         anything already on screen at load is past its range and simply
         starts visible. */
      animation-range: entry 0% entry 55%;
    }
  }
}
