@font-face {
  font-family: "Inter";
  font-weight: 400;
  font-style: normal;
  font-display: swap;
  src: url("/fonts/Inter-Regular.ttf") format("truetype");
}

@font-face {
  font-family: "Inter";
  font-weight: 500;
  font-style: normal;
  font-display: swap;
  src: url("/fonts/Inter-Medium.ttf") format("truetype");
}

@font-face {
  font-family: "Inter";
  font-weight: 600;
  font-style: normal;
  font-display: swap;
  src: url("/fonts/Inter-SemiBold.ttf") format("truetype");
}

:root {
  color-scheme: light dark;

  /* Raw theme palette aligned with apps/mobile/src/theme.ts */
  --bg-light: #F8F9FD;
  --surface-light: #FFFFFF;
  --surface-alt-light: #F1F4F9;
  --header-bg-light: rgba(248, 249, 253, 0.88);
  --ink-light: #0F172A;
  --ink-2-light: #334155;
  --mute-light: #475569;
  --line-light: #E2E8F0;
  --line-subtle-light: #F1F5F9;
  --control-border-light: #64748B;
  --brand-light: #6D28D9;
  --brand-hover-light: #5B21B6;
  --brand-ink-light: #FFFFFF;
  --brand-soft-light: #EDE9FE;
  --brand-tint-light: #F5F3FF;
  --gain-light: #047857;
  --gain-soft-light: #ECFDF5;
  --loss-light: #B91C1C;
  --loss-soft-light: #FEF2F2;
  --warn-light: #B45309;
  --warn-soft-light: #FFFBEB;
  --dot-light: #10B981;
  --focus-light: #6D28D9;
  --shadow-a-light: rgba(15, 23, 42, 0.04);
  --shadow-b-light: rgba(15, 23, 42, 0.08);

  --bg-dark: #0B0E14;
  --surface-dark: #151A24;
  --surface-alt-dark: #1D2433;
  --header-bg-dark: rgba(11, 14, 20, 0.88);
  --ink-dark: #F8FAFC;
  --ink-2-dark: #CBD5E1;
  --mute-dark: #94A3B8;
  --line-dark: rgba(255, 255, 255, 0.10);
  --line-subtle-dark: rgba(255, 255, 255, 0.06);
  --control-border-dark: #788496;
  --brand-dark: #A78BFA;
  --brand-hover-dark: #C4B5FD;
  --brand-ink-dark: #0B0E14;
  --brand-soft-dark: rgba(167, 139, 250, 0.16);
  --brand-tint-dark: rgba(167, 139, 250, 0.09);
  --gain-dark: #34D399;
  --gain-soft-dark: rgba(16, 185, 129, 0.15);
  --loss-dark: #F87171;
  --loss-soft-dark: rgba(248, 113, 113, 0.15);
  --warn-dark: #FBBF24;
  --warn-soft-dark: rgba(245, 158, 11, 0.15);
  --dot-dark: #10D794;
  --focus-dark: #C4B5FD;
  --shadow-a-dark: rgba(0, 0, 0, 0.35);
  --shadow-b-dark: rgba(0, 0, 0, 0.55);

  /* Light defaults for browsers without light-dark() */
  --bg: var(--bg-light);
  --surface: var(--surface-light);
  --surface-alt: var(--surface-alt-light);
  --header-bg: var(--header-bg-light);
  --ink: var(--ink-light);
  --ink-2: var(--ink-2-light);
  --mute: var(--mute-light);
  --line: var(--line-light);
  --line-subtle: var(--line-subtle-light);
  --control-border: var(--control-border-light);
  --brand: var(--brand-light);
  --brand-hover: var(--brand-hover-light);
  --brand-ink: var(--brand-ink-light);
  --brand-soft: var(--brand-soft-light);
  --brand-tint: var(--brand-tint-light);
  --gain: var(--gain-light);
  --gain-soft: var(--gain-soft-light);
  --loss: var(--loss-light);
  --loss-soft: var(--loss-soft-light);
  --warn: var(--warn-light);
  --warn-soft: var(--warn-soft-light);
  --dot: var(--dot-light);
  --focus: var(--focus-light);
  --shadow-a: var(--shadow-a-light);
  --shadow-b: var(--shadow-b-light);

  --shadow-sm: 0 1px 3px var(--shadow-a), 0 1px 2px var(--shadow-b);
  --shadow-md: 0 12px 32px -12px var(--shadow-b), 0 2px 6px var(--shadow-a);

  --radius-sm: 10px;
  --radius-md: 14px;
  --radius-lg: 20px;
  --radius-xl: 24px;
  --measure: 64ch;

  accent-color: var(--brand);
}

/* Map the <meta name="color-scheme"> override back onto CSS color-scheme */
:root:has(> head > meta[name="color-scheme"][content="dark"]) {
  color-scheme: dark;
}

:root:has(> head > meta[name="color-scheme"][content="light"]) {
  color-scheme: light;
}

@supports (color: light-dark(white, black)) {
  :root {
    --bg: light-dark(var(--bg-light), var(--bg-dark));
    --surface: light-dark(var(--surface-light), var(--surface-dark));
    --surface-alt: light-dark(var(--surface-alt-light), var(--surface-alt-dark));
    --header-bg: light-dark(var(--header-bg-light), var(--header-bg-dark));
    --ink: light-dark(var(--ink-light), var(--ink-dark));
    --ink-2: light-dark(var(--ink-2-light), var(--ink-2-dark));
    --mute: light-dark(var(--mute-light), var(--mute-dark));
    --line: light-dark(var(--line-light), var(--line-dark));
    --line-subtle: light-dark(var(--line-subtle-light), var(--line-subtle-dark));
    --control-border: light-dark(var(--control-border-light), var(--control-border-dark));
    --brand: light-dark(var(--brand-light), var(--brand-dark));
    --brand-hover: light-dark(var(--brand-hover-light), var(--brand-hover-dark));
    --brand-ink: light-dark(var(--brand-ink-light), var(--brand-ink-dark));
    --brand-soft: light-dark(var(--brand-soft-light), var(--brand-soft-dark));
    --brand-tint: light-dark(var(--brand-tint-light), var(--brand-tint-dark));
    --gain: light-dark(var(--gain-light), var(--gain-dark));
    --gain-soft: light-dark(var(--gain-soft-light), var(--gain-soft-dark));
    --loss: light-dark(var(--loss-light), var(--loss-dark));
    --loss-soft: light-dark(var(--loss-soft-light), var(--loss-soft-dark));
    --warn: light-dark(var(--warn-light), var(--warn-dark));
    --warn-soft: light-dark(var(--warn-soft-light), var(--warn-soft-dark));
    --dot: light-dark(var(--dot-light), var(--dot-dark));
    --focus: light-dark(var(--focus-light), var(--focus-dark));
    --shadow-a: light-dark(var(--shadow-a-light), var(--shadow-a-dark));
    --shadow-b: light-dark(var(--shadow-b-light), var(--shadow-b-dark));
  }
}

@supports not (color: light-dark(white, black)) {
  @media (prefers-color-scheme: dark) {
    :root {
      --bg: var(--bg-dark);
      --surface: var(--surface-dark);
      --surface-alt: var(--surface-alt-dark);
      --header-bg: var(--header-bg-dark);
      --ink: var(--ink-dark);
      --ink-2: var(--ink-2-dark);
      --mute: var(--mute-dark);
      --line: var(--line-dark);
      --line-subtle: var(--line-subtle-dark);
      --control-border: var(--control-border-dark);
      --brand: var(--brand-dark);
      --brand-hover: var(--brand-hover-dark);
      --brand-ink: var(--brand-ink-dark);
      --brand-soft: var(--brand-soft-dark);
      --brand-tint: var(--brand-tint-dark);
      --gain: var(--gain-dark);
      --gain-soft: var(--gain-soft-dark);
      --loss: var(--loss-dark);
      --loss-soft: var(--loss-soft-dark);
      --warn: var(--warn-dark);
      --warn-soft: var(--warn-soft-dark);
      --dot: var(--dot-dark);
      --focus: var(--focus-dark);
      --shadow-a: var(--shadow-a-dark);
      --shadow-b: var(--shadow-b-dark);
    }
  }

  :root:has(> head > meta[name="color-scheme"][content="dark"]) {
    --bg: var(--bg-dark);
    --surface: var(--surface-dark);
    --surface-alt: var(--surface-alt-dark);
    --header-bg: var(--header-bg-dark);
    --ink: var(--ink-dark);
    --ink-2: var(--ink-2-dark);
    --mute: var(--mute-dark);
    --line: var(--line-dark);
    --line-subtle: var(--line-subtle-dark);
    --control-border: var(--control-border-dark);
    --brand: var(--brand-dark);
    --brand-hover: var(--brand-hover-dark);
    --brand-ink: var(--brand-ink-dark);
    --brand-soft: var(--brand-soft-dark);
    --brand-tint: var(--brand-tint-dark);
    --gain: var(--gain-dark);
    --gain-soft: var(--gain-soft-dark);
    --loss: var(--loss-dark);
    --loss-soft: var(--loss-soft-dark);
    --warn: var(--warn-dark);
    --warn-soft: var(--warn-soft-dark);
    --dot: var(--dot-dark);
    --focus: var(--focus-dark);
    --shadow-a: var(--shadow-a-dark);
    --shadow-b: var(--shadow-b-dark);
  }

  :root:has(> head > meta[name="color-scheme"][content="light"]) {
    --bg: var(--bg-light);
    --surface: var(--surface-light);
    --surface-alt: var(--surface-alt-light);
    --header-bg: var(--header-bg-light);
    --ink: var(--ink-light);
    --ink-2: var(--ink-2-light);
    --mute: var(--mute-light);
    --line: var(--line-light);
    --line-subtle: var(--line-subtle-light);
    --control-border: var(--control-border-light);
    --brand: var(--brand-light);
    --brand-hover: var(--brand-hover-light);
    --brand-ink: var(--brand-ink-light);
    --brand-soft: var(--brand-soft-light);
    --brand-tint: var(--brand-tint-light);
    --gain: var(--gain-light);
    --gain-soft: var(--gain-soft-light);
    --loss: var(--loss-light);
    --loss-soft: var(--loss-soft-light);
    --warn: var(--warn-light);
    --warn-soft: var(--warn-soft-light);
    --dot: var(--dot-light);
    --focus: var(--focus-light);
    --shadow-a: var(--shadow-a-light);
    --shadow-b: var(--shadow-b-light);
  }
}

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

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

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

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 400 1.03125rem/1.62 "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  -webkit-font-smoothing: antialiased;
}

::selection {
  background: var(--brand-soft);
  color: var(--ink);
}

a {
  color: var(--brand);
  text-underline-offset: 3px;
}

a:hover {
  text-decoration-thickness: 2px;
}

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

.visually-hidden:where(:not(:focus-within, :active)) {
  position: absolute !important;
  clip-path: inset(50%) !important;
  overflow: hidden !important;
  width: 1px !important;
  height: 1px !important;
  margin: -1px !important;
  padding: 0 !important;
  border: 0 !important;
  white-space: nowrap !important;
}

.skip {
  display: inline-flex;
  align-items: center;
  min-block-size: 44px;
  padding: 0.65rem 1rem;
  font-weight: 600;
  text-decoration: none;
  border-radius: var(--radius-sm);
  background: var(--brand);
  color: var(--brand-ink);
  z-index: 40;
}

.skip:focus,
.skip:active {
  position: fixed;
  top: 0.75rem;
  left: 0.75rem;
  outline: 3px solid var(--focus);
  outline-offset: 2px;
}

.is-hidden {
  display: none !important;
}

.wrap {
  width: min(100% - 2rem, 68rem);
  margin-inline: auto;
}

/* Header */
.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  background: var(--header-bg);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--line);
}

.site-header .wrap {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem 1rem;
  min-block-size: 4.25rem;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.625rem;
  color: var(--ink);
  font-weight: 600;
  font-size: 1.25rem;
  letter-spacing: -0.025em;
  text-decoration: none;
  min-block-size: 44px;
  padding-right: 0.25rem;
}

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

.brand-wordmark {
  display: inline-flex;
  align-items: baseline;
  gap: 2px;
}

.brand-dot {
  display: inline-block;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--dot);
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 0.25rem;
}

.nav {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.125rem;
}

.nav a {
  color: var(--ink-2);
  font-weight: 500;
  font-size: 0.95rem;
  text-decoration: none;
  padding: 0.5rem 0.75rem;
  min-block-size: 44px;
  display: inline-flex;
  align-items: center;
  border-radius: var(--radius-sm);
  transition: color 0.15s ease, background-color 0.15s ease;
}

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

/* Theme toggle button */
.theme-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-inline-size: 44px;
  min-block-size: 44px;
  margin-left: 0.25rem;
  padding: 0;
  background: var(--surface);
  color: var(--ink-2);
  border: 1px solid var(--control-border);
  border-radius: 12px;
  cursor: pointer;
  transition: color 0.15s ease, border-color 0.15s ease, background-color 0.15s ease;
}

.theme-toggle:hover {
  color: var(--ink);
  background: var(--surface-alt);
  border-color: var(--ink-2);
}

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

/* Critical non-color branching for the theme toggle icon */
:root:not(.has-js) .theme-toggle {
  display: none;
}

.theme-to-dark {
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.theme-to-light {
  display: none;
  align-items: center;
  justify-content: center;
}

@media (prefers-color-scheme: dark) {
  :root:not(:has(> head > meta[name="color-scheme"][content="light"])) .theme-to-dark {
    display: none;
  }

  :root:not(:has(> head > meta[name="color-scheme"][content="light"])) .theme-to-light {
    display: inline-flex;
  }
}

:root:has(> head > meta[name="color-scheme"][content="dark"]) .theme-to-dark {
  display: none;
}

:root:has(> head > meta[name="color-scheme"][content="dark"]) .theme-to-light {
  display: inline-flex;
}

:root:has(> head > meta[name="color-scheme"][content="light"]) .theme-to-dark {
  display: inline-flex;
}

:root:has(> head > meta[name="color-scheme"][content="light"]) .theme-to-light {
  display: none;
}

/* Footer */
.site-footer {
  border-top: 1px solid var(--line);
  margin-top: 5.5rem;
  padding: 2.5rem 0 3.25rem;
  color: var(--mute);
  font-size: 0.925rem;
}

.site-footer .wrap {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

@media (min-width: 52rem) {
  .site-footer .wrap {
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
  }
}

.site-footer ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem 1.25rem;
}

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

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

/* Typography */
h1, h2, h3 {
  line-height: 1.14;
  letter-spacing: -0.025em;
  margin: 0;
  color: var(--ink);
  font-weight: 600;
}

h1 {
  font-size: clamp(2.25rem, 5.2vw, 3.5rem);
}

h2 {
  font-size: clamp(1.55rem, 3.2vw, 2.15rem);
}

h3 {
  font-size: 1.125rem;
  letter-spacing: -0.015em;
}

p {
  margin: 0;
}

.lede {
  font-size: 1.15rem;
  line-height: 1.6;
  color: var(--ink-2);
  max-width: 34rem;
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--brand);
  background: var(--brand-soft);
  padding: 0.3rem 0.75rem;
  border-radius: 9999px;
  letter-spacing: 0.01em;
}

.eyebrow-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--dot);
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  min-block-size: 48px;
  padding: 0 1.35rem;
  font: inherit;
  font-weight: 600;
  font-size: 0.98rem;
  color: var(--brand-ink);
  background: var(--brand);
  border: 1px solid transparent;
  border-radius: 12px;
  cursor: pointer;
  transition: background-color 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}

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

.btn[disabled] {
  opacity: 0.6;
  cursor: progress;
}

.btn-secondary {
  color: var(--ink);
  background: var(--surface);
  border: 1px solid var(--control-border);
}

.btn-secondary:hover {
  background: var(--surface-alt);
  border-color: var(--ink);
}

/* Hero */
.hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 2.75rem;
  padding: 3.25rem 0 2rem;
  align-items: center;
}

@media (min-width: 54rem) {
  .hero {
    grid-template-columns: minmax(0, 1.08fr) minmax(0, 0.92fr);
    gap: 3.5rem;
    padding: 4.5rem 0 2.5rem;
  }
}

.hero-copy > * + * {
  margin-top: 1.25rem;
}

.cta-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.75rem;
  margin-top: 1.75rem;
}

.trust-line {
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--mute);
  margin-top: 1.15rem;
}

/* App Preview Showcase */
.preview-wrap {
  width: 100%;
  max-width: 24.5rem;
  justify-self: center;
}

.preview-shell {
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: 26px;
  padding: 1rem;
  box-shadow: var(--shadow-md);
}

.preview-switch {
  display: grid;
  grid-template-columns: 1fr 1fr;
  background: var(--surface-alt);
  border-radius: 9999px;
  padding: 4px;
  gap: 4px;
  margin-bottom: 0.75rem;
}

.preview-tab {
  appearance: none;
  border: 0;
  background: transparent;
  color: var(--mute);
  font: inherit;
  font-size: 0.875rem;
  font-weight: 500;
  min-block-size: 38px;
  padding: 0.35rem 0.75rem;
  border-radius: 9999px;
  cursor: pointer;
  transition: background-color 0.15s ease, color 0.15s ease;
}

.preview-tab:hover:not([disabled]) {
  color: var(--ink);
}

.preview-tab[aria-selected="true"] {
  background: var(--brand);
  color: var(--brand-ink);
  font-weight: 600;
  box-shadow: var(--shadow-sm);
}

.preview-tab[disabled] {
  cursor: default;
  opacity: 0.75;
}

.preview-panel {
  display: grid;
  gap: 0.75rem;
}

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

.app-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 1rem;
}

.today-hero {
  display: flex;
  align-items: center;
  gap: 0.95rem;
}

.ring-wrap {
  position: relative;
  width: 84px;
  height: 84px;
  flex: none;
}

.ring-svg {
  display: block;
  width: 84px;
  height: 84px;
}

.ring-track {
  stroke: var(--surface-alt);
}

.ring-fill {
  stroke: var(--brand);
  stroke-dasharray: 226.19;
  stroke-dashoffset: 95;
}

.ring-center {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  line-height: 1.1;
  font-variant-numeric: tabular-nums;
}

.ring-pct {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--ink);
}

.ring-sub {
  font-size: 0.72rem;
  color: var(--mute);
  margin-top: 1px;
}

.hero-metrics {
  min-width: 0;
  flex: 1;
}

.metric-label {
  font-size: 0.78rem;
  font-weight: 500;
  color: var(--mute);
}

.metric-big {
  font-size: 1.65rem;
  font-weight: 600;
  letter-spacing: -0.03em;
  line-height: 1.15;
  color: var(--ink);
  font-variant-numeric: tabular-nums;
  margin-top: 2px;
}

.metric-sub {
  font-size: 0.8rem;
  color: var(--mute);
  font-variant-numeric: tabular-nums;
  margin-top: 2px;
}

.safe-line {
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--ink);
  font-variant-numeric: tabular-nums;
  margin-top: 6px;
}

.pace-pill {
  display: inline-block;
  margin-top: 6px;
  padding: 0.18rem 0.55rem;
  border-radius: 9999px;
  background: var(--gain-soft);
  color: var(--gain);
  font-size: 0.74rem;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

.quick-row {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.5rem;
}

.quick-chip {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 0.55rem 0.25rem;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.3rem;
  font-size: 0.78rem;
  font-weight: 500;
  color: var(--ink);
}

.quick-sym {
  font-weight: 600;
  font-size: 0.95rem;
}

.quick-sym.is-loss {
  color: var(--loss);
}

.quick-sym.is-gain {
  color: var(--gain);
}

.quick-sym.is-brand {
  color: var(--brand);
}

.app-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  margin-bottom: 0.65rem;
}

.app-card-title {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--ink);
}

.app-card-meta {
  font-size: 0.78rem;
  font-weight: 500;
  color: var(--mute);
  font-variant-numeric: tabular-nums;
}

.app-card-meta.is-loss {
  color: var(--loss);
}

.budget-list {
  display: grid;
  gap: 0.65rem;
}

.budget-row {
  display: grid;
  gap: 0.3rem;
}

.budget-top {
  display: flex;
  justify-content: space-between;
  gap: 0.5rem;
  font-size: 0.8rem;
  font-variant-numeric: tabular-nums;
}

.budget-cat {
  color: var(--ink);
  font-weight: 500;
}

.budget-nums {
  color: var(--mute);
}

.bar-track {
  height: 6px;
  border-radius: 9999px;
  background: var(--surface-alt);
  overflow: hidden;
}

.bar-fill {
  height: 100%;
  border-radius: 9999px;
  background: var(--brand);
}

.bar-fill.is-warn {
  background: var(--warn);
}

.bar-fill.w-66 {
  width: 66%;
}

.bar-fill.w-90 {
  width: 90%;
}

.bar-fill.w-54 {
  width: 54%;
}

/* Net worth preview panel */
.nw-change {
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--gain);
  margin-top: 4px;
  font-variant-numeric: tabular-nums;
}

.nw-chart {
  margin-top: 0.65rem;
}

.nw-svg {
  display: block;
  width: 100%;
  height: auto;
}

.nw-stop-top {
  stop-color: var(--brand);
  stop-opacity: 0.24;
}

.nw-stop-bottom {
  stop-color: var(--brand);
  stop-opacity: 0;
}

.nw-grid {
  stroke: var(--line);
  stroke-width: 1;
  stroke-dasharray: 3 3;
}

.nw-area {
  fill: url(#nw-grad);
}

.nw-line {
  fill: none;
  stroke: var(--brand);
  stroke-width: 2.25;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.nw-dot {
  fill: var(--brand);
  stroke: var(--surface);
  stroke-width: 2;
}

.nw-dates {
  display: flex;
  justify-content: space-between;
  font-size: 0.72rem;
  color: var(--mute);
  margin-top: 0.25rem;
}

.ref-chip {
  display: inline-block;
  margin-top: 0.6rem;
  padding: 0.2rem 0.55rem;
  border-radius: 8px;
  background: var(--surface-alt);
  color: var(--ink);
  font-size: 0.78rem;
  font-weight: 500;
  font-variant-numeric: tabular-nums;
}

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

.acct-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.5rem 0;
  border-bottom: 1px solid var(--line-subtle);
  font-size: 0.82rem;
  font-variant-numeric: tabular-nums;
}

.acct-row:last-child {
  border-bottom: 0;
  padding-bottom: 0;
}

.acct-row:first-child {
  padding-top: 0;
}

.acct-name {
  color: var(--ink);
  font-weight: 500;
}

.acct-sub {
  display: block;
  font-size: 0.74rem;
  font-weight: 400;
  color: var(--mute);
}

.acct-bal {
  color: var(--ink);
  font-weight: 600;
  white-space: nowrap;
}

.acct-bal.is-loss {
  color: var(--loss);
}

.preview-caption {
  margin-top: 0.7rem;
  text-align: center;
  font-size: 0.82rem;
  color: var(--mute);
}

/* Sections */
.section {
  padding-top: 5.5rem;
}

.section-head {
  max-width: 40rem;
}

.section-sub {
  margin-top: 0.65rem;
  color: var(--ink-2);
  font-size: 1.05rem;
}

/* Feature grid: calm hairline-separated editorial layout */
.feature-grid {
  list-style: none;
  margin: 2.25rem 0 0;
  padding: 0;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
}

@media (min-width: 48rem) {
  .feature-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    column-gap: 3rem;
  }
}

.feature-item {
  display: flex;
  align-items: flex-start;
  gap: 1rem;
  padding: 1.75rem 0;
  border-top: 1px solid var(--line);
}

.feature-icon {
  flex: none;
  width: 38px;
  height: 38px;
  border-radius: 12px;
  background: var(--brand-soft);
  color: var(--brand);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-top: 2px;
}

.feature-icon.is-gain {
  background: var(--gain-soft);
  color: var(--gain);
}

.feature-icon svg {
  width: 19px;
  height: 19px;
}

.feature-body h3 {
  margin-bottom: 0.45rem;
}

.feature-body p {
  color: var(--ink-2);
  font-size: 0.97rem;
  line-height: 1.62;
  max-width: 46ch;
}

/* Privacy split */
.privacy-split {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 2.25rem;
  align-items: start;
}

@media (min-width: 52rem) {
  .privacy-split {
    grid-template-columns: minmax(0, 1.1fr) minmax(0, 0.9fr);
    gap: 3.5rem;
  }
}

.privacy-copy > * + * {
  margin-top: 1rem;
}

.privacy-copy p {
  color: var(--ink-2);
  max-width: var(--measure);
}

.status-note {
  margin-top: 1.25rem;
  padding: 0.9rem 1.1rem;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  font-size: 0.92rem;
  color: var(--ink-2);
}

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

.never-card {
  background: var(--brand-tint);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 1.65rem 1.75rem;
}

.never-card h3 {
  margin-bottom: 0.9rem;
}

.never-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 0.7rem;
}

.never-list li {
  display: flex;
  align-items: flex-start;
  gap: 0.65rem;
  color: var(--ink);
  font-size: 0.97rem;
}

.never-mark {
  flex: none;
  color: var(--brand);
  font-weight: 600;
  line-height: 1.5;
}

/* Early access form */
.signup {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-xl);
  padding: clamp(1.5rem, 4vw, 3rem);
  box-shadow: var(--shadow-sm);
  display: grid;
  gap: 1.75rem;
  grid-template-columns: minmax(0, 1fr);
}

@media (min-width: 52rem) {
  .signup {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    align-items: center;
    gap: 3rem;
  }
}

.signup-copy > * + * {
  margin-top: 0.75rem;
}

.signup-copy p {
  color: var(--ink-2);
}

.field label {
  display: block;
  font-weight: 600;
  font-size: 0.95rem;
  margin-bottom: 0.3rem;
  color: var(--ink);
}

.field .hint {
  display: block;
  font-size: 0.875rem;
  color: var(--mute);
  margin-bottom: 0.65rem;
}

.field-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem;
}

.field input[type="email"] {
  flex: 1 1 14rem;
  min-width: 0;
  max-width: 100%;
  min-block-size: 48px;
  padding: 0 1rem;
  font: inherit;
  color: var(--ink);
  background: var(--bg);
  border: 1.5px solid var(--control-border);
  border-radius: 12px;
  transition: border-color 0.15s ease, background-color 0.15s ease;
}

.field input[type="email"]::placeholder {
  color: var(--mute);
}

.field input[type="email"]:user-valid {
  border-color: var(--gain);
}

.field :is(input[type="email"]:user-invalid, input[type="email"].is-invalid) {
  border-color: var(--loss);
  background: var(--loss-soft);
}

.field-error {
  display: none;
  align-items: center;
  gap: 0.45rem;
  margin-top: 0.55rem;
  font-size: 0.88rem;
  font-weight: 500;
  color: var(--loss);
}

.field:has(input[type="email"]:user-invalid) .field-error {
  display: flex;
}

.field:has(.live.err:not(:empty)) .field-error {
  display: none;
}

.error-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.15rem;
  height: 1.15rem;
  border-radius: 50%;
  background: var(--loss);
  color: var(--brand-ink);
  font-size: 0.75rem;
  font-weight: 600;
  flex: none;
}

.privacy-note {
  margin-top: 0.65rem;
  font-size: 0.875rem;
  color: var(--mute);
}

.hp {
  position: absolute;
  left: -9999px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

.status {
  display: none;
  margin-top: 0.9rem;
  padding: 0.8rem 1rem;
  border-radius: 12px;
  font-weight: 500;
  font-size: 0.94rem;
}

.status:target,
.status.show {
  display: block;
}

.status.ok,
.live.ok {
  background: var(--gain-soft);
  border: 1px solid var(--gain);
  color: var(--ink);
}

.status.err,
.live.err:not(:empty) {
  background: var(--loss-soft);
  border: 1.5px solid var(--loss);
  color: var(--ink);
}

.live {
  margin: 0;
  border-radius: 12px;
  font-weight: 500;
  font-size: 0.94rem;
}

.live:not(:empty) {
  margin-top: 0.9rem;
  padding: 0.8rem 1rem;
}

/* Document pages (privacy, terms, delete-account, support, 404) */
.doc {
  padding: 3.25rem 0 0;
  max-width: 46rem;
}

.doc > * + * {
  margin-top: 1rem;
}

.doc h1 {
  font-size: clamp(2rem, 4.8vw, 2.75rem);
}

.doc h2 {
  font-size: 1.38rem;
  margin-top: 2.5rem;
}

.doc h3 {
  margin-top: 1.5rem;
}

.doc p,
.doc li {
  color: var(--ink-2);
}

.doc ul,
.doc ol {
  padding-left: 1.3rem;
}

.doc li + li {
  margin-top: 0.45rem;
}

.doc strong {
  color: var(--ink);
}

.doc .meta {
  color: var(--mute);
  font-size: 0.92rem;
}

.doc .callout {
  background: var(--brand-tint);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  padding: 1.15rem 1.4rem;
  color: var(--ink);
}

.doc table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.96rem;
}

.doc th,
.doc td {
  text-align: left;
  vertical-align: top;
  padding: 0.75rem 0.75rem 0.75rem 0;
  border-bottom: 1px solid var(--line);
}

.doc th {
  color: var(--mute);
  font-weight: 600;
}

.doc td {
  color: var(--ink-2);
}

@media (prefers-reduced-motion: reduce) {
  .nav a,
  .theme-toggle,
  .btn,
  .preview-tab,
  .field input[type="email"] {
    transition: none;
  }
}

/* Forced Colors Mode support */
@media (forced-colors: active) {
  .preview-shell,
  .app-card,
  .quick-chip,
  .never-card,
  .signup,
  .status-note,
  .doc .callout,
  .theme-toggle,
  .btn {
    border: 1px solid CanvasText;
  }

  .preview-tab[aria-selected="true"] {
    outline: 2px solid Highlight;
    background: Highlight;
    color: HighlightText;
  }

  .bar-track {
    border: 1px solid CanvasText;
  }

  .bar-fill {
    background: Highlight;
  }

  .ring-fill,
  .nw-line {
    stroke: Highlight;
  }
}
