/* ==========================================================================
   Lunra — landing page
   ========================================================================== */

/* --------------------------------------------------------------------------
   Tokens
   -------------------------------------------------------------------------- */
:root {
  --bg: #0a0a0a;
  --surface: #171717;
  --tertiary: #0a0a0a;
  --border: #262626;
  --border-subtle: #404040;

  --text: #ffffff;
  --text-2: #d4d4d4;
  --muted: #9ca3af;
  --faint: #525252;

  --accent: #10b981;
  --accent-hover: #0ea373;
  --accent-ink: #04150e;
  --accent-soft: rgba(16, 185, 129, 0.18);
  --danger: #ef4444;
  --info: #3b82f6;
  --warn: #f59e0b;

  --shadow-card: 0 1px 2px rgba(0, 0, 0, 0.4);
  --shadow-pop: 0 8px 24px rgba(0, 0, 0, 0.35);
  --shadow-accent: 0 8px 24px rgba(16, 185, 129, 0.2);

  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-pill: 9999px;

  --content: 1200px;
  --gutter: 24px;

  /* Duration of one full pass of the hero import animation. */
  --loop: 12s;

  color-scheme: dark;
}

/* Category accents. Shared by the transaction chips and the category bars,
   so a category reads the same colour everywhere it appears. */
:root {
  --cat-dining: #ff9800;
  --cat-dining-soft: rgba(255, 152, 0, 0.15);
  --cat-shopping: #9c27b0;
  --cat-shopping-ink: #b05fd4;
  --cat-shopping-soft: rgba(156, 39, 176, 0.15);
  --cat-travel: #00bcd4;
  --cat-travel-soft: rgba(0, 188, 212, 0.15);
  --cat-utilities: #607d8b;
  --cat-utilities-ink: #8fa6b1;
  --cat-utilities-soft: rgba(96, 125, 139, 0.18);
  --cat-fees: #f4685c;
  --cat-fees-soft: rgba(244, 67, 54, 0.15);
  --cat-groceries: #4caf50;
  --cat-transport: #2196f3;
}

/* Light theme — follows the OS by default, overridden by the header toggle. */
@media (prefers-color-scheme: light) {
  :root {
    --bg: #f5f5f5;
    --surface: #ffffff;
    --tertiary: #f5f5f5;
    --border: #e5e5e5;
    --border-subtle: #d4d4d4;
    --text: #171717;
    --text-2: #404040;
    --muted: #6b7280;
    --faint: #9ca3af;
    --accent-soft: rgba(16, 185, 129, 0.14);
    --warn: #d97706;
    --shadow-card: 0 1px 2px rgba(0, 0, 0, 0.08);
    --shadow-pop: 0 6px 20px rgba(0, 0, 0, 0.12);
    color-scheme: light;
  }
}

:root[data-theme="light"] {
  --bg: #f5f5f5;
  --surface: #ffffff;
  --tertiary: #f5f5f5;
  --border: #e5e5e5;
  --border-subtle: #d4d4d4;
  --text: #171717;
  --text-2: #404040;
  --muted: #6b7280;
  --faint: #9ca3af;
  --accent-soft: rgba(16, 185, 129, 0.14);
  --warn: #d97706;
  --shadow-card: 0 1px 2px rgba(0, 0, 0, 0.08);
  --shadow-pop: 0 6px 20px rgba(0, 0, 0, 0.12);
  color-scheme: light;
}

:root[data-theme="dark"] {
  --bg: #0a0a0a;
  --surface: #171717;
  --tertiary: #0a0a0a;
  --border: #262626;
  --border-subtle: #404040;
  --text: #ffffff;
  --text-2: #d4d4d4;
  --muted: #9ca3af;
  --faint: #525252;
  --accent-soft: rgba(16, 185, 129, 0.18);
  --warn: #f59e0b;
  --shadow-card: 0 1px 2px rgba(0, 0, 0, 0.4);
  --shadow-pop: 0 8px 24px rgba(0, 0, 0, 0.35);
  color-scheme: dark;
}

/* --------------------------------------------------------------------------
   Base
   -------------------------------------------------------------------------- */
* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text-2);
  font-family: Inter, system-ui, -apple-system, sans-serif;
  -webkit-font-smoothing: antialiased;
}

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

a:hover {
  text-decoration: underline;
}

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

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

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  border-radius: 4px;
}

::selection {
  background: var(--accent-soft);
}

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

summary {
  list-style: none;
}

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

table {
  border-collapse: collapse;
  width: 100%;
}

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

/* --------------------------------------------------------------------------
   Layout primitives
   -------------------------------------------------------------------------- */
.page {
  background: var(--bg);
  min-height: 100vh;
}

.wrap {
  max-width: var(--content);
  margin: 0 auto;
}

.section {
  padding: 120px var(--gutter) 0;
}

.section--hero {
  padding: 80px var(--gutter) 0;
}

.section--demo {
  padding: 48px var(--gutter) 0;
}

.section--cta {
  padding: 96px var(--gutter) 0;
}

/* --------------------------------------------------------------------------
   Type
   -------------------------------------------------------------------------- */
.eyebrow {
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--accent);
}

.section-title {
  font-size: clamp(28px, 4vw, 40px);
  line-height: 1.1;
  letter-spacing: -0.03em;
  font-weight: 700;
  color: var(--text);
}

.section-lead {
  margin-top: 16px;
  max-width: 62ch;
  font-size: 16px;
  line-height: 1.55;
  color: var(--muted);
}

.section-lead--narrow {
  max-width: 56ch;
}

.section-lead--mid {
  max-width: 60ch;
}

/* --------------------------------------------------------------------------
   Buttons & pills
   -------------------------------------------------------------------------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: 44px;
  padding: 0 20px;
  border: 0;
  border-radius: var(--radius-sm);
  background: var(--accent);
  color: var(--accent-ink);
  font-family: inherit;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  box-shadow: var(--shadow-accent);
}

.btn:hover {
  background: var(--accent-hover);
  text-decoration: none;
}

.btn--sm {
  height: 32px;
  padding: 0 14px;
  font-size: 13px;
}

/* A button-shaped label for a channel that does not exist yet. It is a <span>,
   not a disabled <a>, so there is nothing to click, tab to, or mistake for a
   broken download. */
.btn--soon {
  background: transparent;
  border: 1px solid var(--border-subtle);
  color: var(--muted);
  font-weight: 500;
  cursor: default;
  box-shadow: none;
}

.btn--soon:hover {
  background: transparent;
}

.btn--block {
  width: 100%;
}

.pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 4px 10px;
  border-radius: var(--radius-pill);
  background: var(--accent-soft);
  color: var(--accent);
  font-size: 10px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.pill--sm {
  padding: 4px 8px;
}

.pill--muted {
  background: rgba(148, 163, 175, 0.15);
  color: var(--muted);
}

/* --------------------------------------------------------------------------
   Cards
   -------------------------------------------------------------------------- */
.card {
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--surface);
  padding: 24px;
}

.card--hoverable {
  transition: border-color 0.2s;
}

.card--hoverable:hover {
  border-color: var(--border-subtle);
}

.card__icon {
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border-radius: var(--radius-md);
  background: var(--accent-soft);
  color: var(--accent);
}

.card__icon--danger {
  background: rgba(239, 68, 68, 0.12);
  color: var(--danger);
}

.card__icon--warn {
  background: rgba(245, 158, 11, 0.12);
  color: var(--warn);
}

.card__icon--info {
  background: rgba(59, 130, 246, 0.12);
  color: var(--info);
}

.card__title {
  margin-top: 16px;
  font-size: 17px;
  font-weight: 600;
  color: var(--text);
}

.card__title--sm {
  font-size: 16px;
}

.card__body {
  margin-top: 8px;
  font-size: 14px;
  line-height: 1.5;
  color: var(--muted);
}

.card-grid {
  margin-top: 40px;
  display: grid;
  gap: 16px;
  grid-template-columns: repeat(auto-fit, minmax(min(260px, 100%), 1fr));
}

.card-grid--wide {
  grid-template-columns: repeat(auto-fit, minmax(min(280px, 100%), 1fr));
}

/* --------------------------------------------------------------------------
   Header
   -------------------------------------------------------------------------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
}

.site-header__inner {
  padding: 14px var(--gutter);
  display: flex;
  align-items: center;
  gap: var(--gutter);
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
}

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

.brand__mark {
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  border-radius: var(--radius-sm);
  background: var(--accent);
  box-shadow: var(--shadow-accent);
}

.brand__mark--sm {
  width: 28px;
  height: 28px;
  box-shadow: none;
}

.brand__name {
  font-size: 19px;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--text);
}

.nav-links {
  display: flex;
  gap: var(--gutter);
  margin-left: 8px;
  font-size: 14px;
}

.nav-links a {
  color: var(--muted);
}

.site-header__actions {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 10px;
}

.theme-toggle {
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  border-radius: var(--radius-sm);
  background: transparent;
  border: 1px solid var(--border);
  color: var(--muted);
  cursor: pointer;
}

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

/* --------------------------------------------------------------------------
   Hero
   -------------------------------------------------------------------------- */
.hero__title {
  margin-top: var(--gutter);
  max-width: 15ch;
  font-size: clamp(40px, 7vw, 68px);
  line-height: 1.02;
  letter-spacing: -0.035em;
  font-weight: 700;
  color: var(--text);
  text-wrap: balance;
}

.hero__lead {
  margin-top: var(--gutter);
  max-width: 58ch;
  font-size: 19px;
  line-height: 1.5;
  color: var(--text-2);
}

.hero__actions {
  margin-top: 32px;
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
}

.hero__note {
  margin-top: 16px;
  font-size: 13px;
  color: var(--faint);
}

/* --------------------------------------------------------------------------
   Hero demo — a looping mock of the import flow
   -------------------------------------------------------------------------- */
.demo {
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--surface);
  box-shadow: var(--shadow-pop);
  overflow: hidden;
}

.demo__chrome {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
}

.demo__dot {
  width: 11px;
  height: 11px;
  border-radius: var(--radius-pill);
}

.demo__dot--red {
  background: #ff5f57;
}

.demo__dot--amber {
  background: #febc2e;
}

.demo__dot--green {
  background: #28c840;
}

.demo__chrome-title {
  margin-left: 12px;
  font-size: 12px;
  font-weight: 500;
  color: var(--muted);
}

.demo__stage {
  position: relative;
  height: 440px;
  background: var(--tertiary);
  overflow: hidden;
}

.demo__scene {
  position: absolute;
  inset: 0;
}

/* Scene A — the drop zone */
.demo__scene--drop {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 20px;
  animation: sceneA var(--loop) linear infinite;
}

.dropzone {
  position: relative;
  width: min(560px, 80%);
  height: 220px;
  border: 2px dashed var(--border-subtle);
  border-radius: var(--radius-lg);
  display: grid;
  place-items: center;
  animation: zonePulse var(--loop) linear infinite;
}

.dropzone__title {
  font-size: 15px;
  font-weight: 600;
  color: var(--text);
}

.dropzone__hint {
  margin-top: 6px;
  font-size: 13px;
  color: var(--muted);
}

.dropfile {
  position: absolute;
  width: 118px;
  height: 150px;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--surface);
  box-shadow: var(--shadow-pop);
  padding: 12px;
  animation: dropIn var(--loop) linear infinite;
}

.dropfile__name {
  margin-top: 10px;
  font-size: 11px;
  font-weight: 600;
  color: var(--text);
}

.dropfile__meta {
  margin-top: 4px;
  font-size: 10px;
  color: var(--faint);
}

.dropfile__lines {
  margin-top: 12px;
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.dropfile__lines span {
  height: 4px;
  border-radius: 2px;
  background: var(--border);
  width: var(--w, 100%);
}

/* Scene B — parsing */
.demo__scene--parse {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 18px;
  animation: sceneB var(--loop) linear infinite;
}

.spinner {
  width: 44px;
  height: 44px;
  border-radius: var(--radius-pill);
  border: 2px solid var(--accent);
  border-top-color: transparent;
  animation: spinSlow 3s linear infinite;
}

.demo__status {
  font-size: 15px;
  font-weight: 600;
  color: var(--text);
}

.demo__substatus {
  font-size: 12px;
  color: var(--faint);
}

.progress {
  width: min(360px, 70%);
  height: 6px;
  border-radius: var(--radius-pill);
  background: var(--border);
  overflow: hidden;
}

.progress span {
  display: block;
  height: 100%;
  background: var(--accent);
  animation: progressFill var(--loop) linear infinite;
}

/* Scene C — the result */
.demo__scene--result {
  padding: var(--gutter);
  display: flex;
  flex-direction: column;
  gap: 14px;
  animation: sceneC var(--loop) linear infinite;
}

.demo__stats {
  display: grid;
  /* minmax(0,…) so a long amount cannot push the row past the stage. */
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.demo__stat {
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--surface);
  padding: 14px;
}

.demo__stat-label {
  font-size: 12px;
  font-weight: 500;
  color: var(--muted);
}

.demo__stat-value {
  margin-top: 6px;
  font-size: 24px;
  font-weight: 700;
  color: var(--text);
}

.demo__table {
  flex: 1;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--surface);
  overflow: hidden;
}

.demo__row {
  display: grid;
  grid-template-columns: 88px 1fr 120px 110px;
  gap: 12px;
  padding: 12px 16px;
  align-items: center;
  font-size: 13px;
}

.demo__row--head {
  padding: 10px 16px;
  border-bottom: 1px solid var(--border);
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--muted);
}

/* Staggered reveal of the result rows and stat cards. */
.reveal-1 { animation: reveal1 var(--loop) linear infinite; }
.reveal-2 { animation: reveal2 var(--loop) linear infinite; }
.reveal-3 { animation: reveal3 var(--loop) linear infinite; }
.reveal-4 { animation: reveal4 var(--loop) linear infinite; }
.reveal-5 { animation: reveal5 var(--loop) linear infinite; }

.demo__caption {
  margin-top: 18px;
  font-size: 17px;
  line-height: 1.5;
  color: var(--text-2);
}

/* --------------------------------------------------------------------------
   Shared table atoms (demo + review step)
   -------------------------------------------------------------------------- */
.t-date {
  color: var(--faint);
}

.t-merchant {
  color: var(--text);
  font-weight: 500;
}

.t-amount {
  text-align: right;
  color: var(--danger);
  font-weight: 500;
}

.chip {
  padding: 3px 8px;
  border-radius: var(--radius-pill);
  font-size: 10px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  background: var(--chip-bg);
  color: var(--chip-ink);
}

.chip--dining {
  --chip-bg: var(--cat-dining-soft);
  --chip-ink: var(--cat-dining);
}

.chip--shopping {
  --chip-bg: var(--cat-shopping-soft);
  --chip-ink: var(--cat-shopping-ink);
}

.chip--travel {
  --chip-bg: var(--cat-travel-soft);
  --chip-ink: var(--cat-travel);
}

.chip--utilities {
  --chip-bg: var(--cat-utilities-soft);
  --chip-ink: var(--cat-utilities-ink);
}

.chip--fees {
  --chip-bg: var(--cat-fees-soft);
  --chip-ink: var(--cat-fees);
}

/* --------------------------------------------------------------------------
   How it works
   -------------------------------------------------------------------------- */
.steps {
  margin-top: 56px;
  display: grid;
  gap: 56px;
}

.step {
  display: grid;
  gap: var(--gutter);
}

/* Grid items default to min-width:auto; without this the scrollable review
   table below widens the whole column instead of scrolling. */
.steps > *,
.step > * {
  min-width: 0;
}

.step__head {
  display: grid;
  gap: 12px 20px;
  grid-template-columns: 64px minmax(0, 1fr);
  align-items: baseline;
}

.step__title {
  font-size: 26px;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--text);
}

.step__body {
  grid-column: 2;
  max-width: 62ch;
  font-size: 15px;
  line-height: 1.55;
  color: var(--muted);
}

.panel {
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--surface);
  box-shadow: var(--shadow-card);
  padding: var(--gutter);
  margin: 0;
}

.panel--flush {
  padding: 0;
  overflow: hidden;
}

/* Step 01 — account summary */
.account {
  display: flex;
  align-items: center;
  gap: 14px;
}

.account__icon {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border-radius: var(--radius-md);
  background: var(--tertiary);
  border: 1px solid var(--border);
  color: var(--muted);
}

.account__name {
  font-size: 16px;
  font-weight: 600;
  color: var(--text);
}

.account__meta {
  margin-top: 2px;
  font-size: 13px;
  color: var(--muted);
}

.account__status {
  margin-left: auto;
}

.statements {
  margin-top: 20px;
  display: grid;
  gap: 8px;
}

.statements li {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  border-radius: var(--radius-md);
  background: var(--tertiary);
  font-size: 14px;
  color: var(--text-2);
}

.statements__count {
  margin-left: auto;
  color: var(--muted);
  font-size: 13px;
}

/* Step 02 — the review table */
.tx {
  display: grid;
  grid-template-columns: 110px 1fr 150px 130px 190px;
  gap: 16px;
  padding: 14px var(--gutter);
  align-items: center;
  border-bottom: 1px solid var(--border);
  font-size: 14px;
}

.tx:last-child {
  border-bottom: 0;
}

.tx--head {
  padding: 12px var(--gutter);
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--muted);
}

.tx__date {
  color: var(--faint);
  font-size: 13px;
}

.tx__name {
  display: block;
  color: var(--text);
  font-weight: 500;
}

.tx__raw {
  display: block;
  margin-top: 2px;
  font-size: 11px;
  letter-spacing: 0.02em;
  color: var(--faint);
}

.tx__account {
  font-size: 13px;
  color: var(--faint);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* Both mock tables use fixed column widths, so they scroll rather than
   squeeze the page sideways on narrow screens. */
.scroll-x {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.scroll-x > table {
  min-width: 720px;
}

/* Wider than the comparison table: the five fixed columns alone come to 692px,
   which would leave the merchant column too narrow to hold a raw statement line. */
.scroll-x > .scroll-x__inner {
  min-width: 860px;
}

/* Step 03 — dashboard */
.dash {
  display: grid;
  gap: 16px;
  margin: 0;
}

.stat-row {
  display: grid;
  gap: 16px;
  grid-template-columns: repeat(auto-fit, minmax(min(220px, 100%), 1fr));
}

.stat {
  position: relative;
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--surface);
  padding: var(--gutter);
}

.stat__ghost {
  position: absolute;
  top: 16px;
  right: 16px;
  opacity: 0.1;
}

.stat__head {
  display: flex;
  align-items: center;
  gap: 12px;
}

.stat__icon {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: var(--radius-md);
  background: var(--accent-soft);
  color: var(--accent);
}

.stat__icon--danger {
  background: rgba(239, 68, 68, 0.12);
  color: var(--danger);
}

.stat__icon--info {
  background: rgba(59, 130, 246, 0.12);
  color: var(--info);
}

.stat__label {
  font-size: 12px;
  font-weight: 500;
  color: var(--muted);
}

.stat__value {
  margin-top: 16px;
  font-size: 30px;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--text);
}

.stat__value--danger { color: var(--danger); }
.stat__value--accent { color: var(--accent); }
.stat__value--info { color: var(--info); }

.stat__delta {
  margin-top: 8px;
  font-size: 12px;
  color: var(--faint);
}

.stat__delta--down {
  color: var(--accent);
}

.dash-row {
  display: grid;
  gap: 16px;
  grid-template-columns: repeat(auto-fit, minmax(min(320px, 100%), 1fr));
}

.dash__title {
  font-size: 16px;
  font-weight: 600;
  color: var(--text);
}

.breakdown {
  margin-top: 20px;
  display: grid;
  gap: 14px;
}

.breakdown__head {
  display: flex;
  justify-content: space-between;
  font-size: 13px;
}

.breakdown__name {
  color: var(--text-2);
}

.breakdown__value {
  color: var(--muted);
}

.bar {
  margin-top: 6px;
  height: 6px;
  border-radius: var(--radius-pill);
  background: var(--tertiary);
  overflow: hidden;
}

.bar span {
  display: block;
  height: 100%;
  width: var(--w);
  background: var(--c);
}

.merchants {
  margin-top: 20px;
  display: grid;
  gap: 12px;
}

.merchants li {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  border-radius: var(--radius-md);
  background: var(--tertiary);
}

.merchants__name {
  font-size: 14px;
  color: var(--text);
}

.merchants__count {
  margin-left: auto;
  font-size: 13px;
  color: var(--faint);
}

.merchants__total {
  min-width: 96px;
  text-align: right;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-2);
}

/* --------------------------------------------------------------------------
   Feature cards
   -------------------------------------------------------------------------- */
.kbd {
  display: inline-block;
  padding: 2px 6px;
  border-radius: 4px;
  border: 1px solid var(--border-subtle);
  background: var(--tertiary);
  font-size: 12px;
  color: var(--text-2);
}

/* --------------------------------------------------------------------------
   Bring your own key
   -------------------------------------------------------------------------- */
.byok {
  display: grid;
  gap: 48px;
  align-items: start;
}

/* Grid items default to min-width:auto, which would let the masked key string
   below push the whole column past the viewport. */
.byok > * {
  min-width: 0;
}

.byok__title {
  margin-top: 16px;
}

.byok__para {
  margin-top: 16px;
  max-width: 52ch;
  font-size: 16px;
  line-height: 1.6;
  color: var(--text-2);
}

.byok__para:first-of-type {
  margin-top: 20px;
}

.byok__para--muted {
  font-size: 15px;
  color: var(--muted);
}

.byok__para--wide {
  margin-top: var(--gutter);
  font-size: 15px;
  line-height: 1.6;
  color: var(--muted);
}

.byok__footnote {
  margin-top: var(--gutter);
  font-size: 13px;
  line-height: 1.5;
  color: var(--faint);
}

.settings {
  max-width: 820px;
  padding: 28px;
}

.settings__legend {
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--muted);
}

.settings__fields {
  margin-top: 20px;
  display: grid;
  gap: 20px;
}

.settings__fields > * {
  min-width: 0;
}

.field__label {
  font-size: 13px;
  color: var(--muted);
}

.field__control {
  margin-top: 8px;
  display: flex;
  align-items: center;
  height: 40px;
  padding: 0 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--tertiary);
  font-size: 14px;
  color: var(--text);
}

.field__caret {
  margin-left: auto;
}

.field__hint {
  margin-top: 8px;
  font-size: 13px;
  color: var(--faint);
}

.field__hint--valid {
  color: var(--accent);
}

.field__row {
  margin-top: 8px;
  display: flex;
  gap: 10px;
  align-items: center;
}

.keyfield {
  flex: 1;
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 10px;
  height: 40px;
  padding: 0 14px;
  border: 1px solid var(--accent);
  border-radius: var(--radius-sm);
  background: var(--tertiary);
}

.keyfield__dot {
  width: 7px;
  height: 7px;
  border-radius: var(--radius-pill);
  background: var(--accent);
  flex: none;
}

.keyfield__value {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  white-space: nowrap;
  font-size: 13px;
  letter-spacing: 0.12em;
  color: var(--text-2);
}

.keyfield__reveal {
  font-size: 13px;
  color: var(--muted);
}

.keyfield__action {
  display: grid;
  place-items: center;
  height: 40px;
  padding: 0 16px;
  border-radius: var(--radius-sm);
  background: var(--accent);
  color: var(--accent-ink);
  font-size: 14px;
  font-weight: 600;
  box-shadow: var(--shadow-accent);
}

/* --------------------------------------------------------------------------
   Privacy
   -------------------------------------------------------------------------- */
.privacy-cols {
  margin-top: 40px;
  display: grid;
  gap: 48px;
  grid-template-columns: repeat(auto-fit, minmax(min(320px, 100%), 1fr));
}

.privacy__title {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 17px;
  font-weight: 600;
  color: var(--text);
}

.privacy__list {
  margin-top: 20px;
  display: grid;
  gap: 14px;
}

.privacy__list li {
  font-size: 14px;
  line-height: 1.5;
  color: var(--muted);
}

.privacy__list strong {
  color: var(--text-2);
  font-weight: 500;
}

/* --------------------------------------------------------------------------
   Comparison table
   -------------------------------------------------------------------------- */
.compare {
  margin-top: 40px;
}

.compare table {
  font-size: 14px;
}

.compare caption {
  text-align: left;
  font-size: 13px;
  color: var(--faint);
  padding-bottom: 16px;
}

.compare th,
.compare td {
  border-bottom: 1px solid var(--border);
}

.compare thead th {
  text-align: left;
  padding: 12px 16px;
  font-size: 12px;
  font-weight: 500;
  color: var(--muted);
}

.compare thead th:first-child {
  padding: 12px 16px 12px 0;
  font-size: 10px;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.compare thead th.is-us {
  font-size: 12px;
  font-weight: 600;
  color: var(--accent);
}

.compare tbody th {
  text-align: left;
  padding: 14px 16px 14px 0;
  font-weight: 500;
  color: var(--text-2);
}

.compare tbody td {
  padding: 14px 16px;
  color: var(--muted);
}

.compare tbody td.is-us {
  color: var(--accent);
  font-weight: 500;
}

/* --------------------------------------------------------------------------
   Pricing
   -------------------------------------------------------------------------- */
.plans {
  margin-top: 40px;
  display: grid;
  gap: 16px;
  grid-template-columns: repeat(auto-fit, minmax(min(300px, 100%), 1fr));
  align-items: start;
}

.plan {
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--surface);
  padding: 32px;
}

.plan--featured {
  border-color: var(--accent);
}

.plan__name {
  margin-top: 16px;
  font-size: 20px;
  font-weight: 600;
  color: var(--text);
}

.plan__price {
  margin-top: 12px;
  font-size: 36px;
  font-weight: 700;
  letter-spacing: -0.03em;
  color: var(--text);
}

.plan__price--muted {
  color: var(--muted);
}

.plan__note {
  margin-top: 8px;
  font-size: 13px;
  color: var(--faint);
}

.plan__list {
  margin-top: var(--gutter);
  display: grid;
  gap: 12px;
}

.plan__list li {
  display: flex;
  gap: 10px;
  font-size: 14px;
  line-height: 1.5;
  color: var(--muted);
}

.plan__list--planned li {
  color: var(--faint);
}

.plan__check {
  flex: none;
  margin-top: 2px;
}

.plan__dash {
  flex: none;
  margin-top: 9px;
  width: 8px;
  height: 1px;
  background: var(--faint);
}

.plan__cta {
  margin-top: 28px;
}

/* --------------------------------------------------------------------------
   Waitlist
   -------------------------------------------------------------------------- */
.signup {
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--surface);
  padding: clamp(32px, 5vw, 56px);
}

.signup__inner {
  display: grid;
  gap: 32px;
  grid-template-columns: repeat(auto-fit, minmax(min(300px, 100%), 1fr));
  align-items: center;
}

.signup__title {
  font-size: clamp(24px, 3vw, 32px);
  line-height: 1.15;
  letter-spacing: -0.03em;
  font-weight: 700;
  color: var(--text);
}

.signup__lead {
  margin-top: 12px;
  max-width: 44ch;
  font-size: 15px;
  line-height: 1.55;
  color: var(--muted);
}

.signup__form {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.signup__input {
  flex: 1 1 220px;
  height: 44px;
  padding: 0 14px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--tertiary);
  color: var(--text);
  font-family: inherit;
  font-size: 15px;
}

.signup__note {
  flex: 1 0 100%;
  font-size: 13px;
  color: var(--muted);
}

/* --------------------------------------------------------------------------
   Waitlist channel picker

   Two builds on two schedules, so the visitor says which one they are waiting
   on. Each option is a real checkbox with the input visually hidden — the label
   is the hit area, so a click, a tap, Tab and Space all work without a line of
   script, and :checked does the styling.
   -------------------------------------------------------------------------- */
.signup__wait .pill {
  margin-bottom: 14px;
}

.signup__wait .signup__form {
  margin-top: 22px;
}

/* The grid lives on a child, not on the fieldset: a <legend> is a grid item like
   any other and lands in the first column, which drops the first option into the
   second one. */
.channels {
  flex: 1 0 100%;
  border: 0;
  padding: 0;
  margin: 0;
}

.channels__grid {
  display: grid;
  gap: 10px;
  grid-template-columns: repeat(auto-fit, minmax(min(200px, 100%), 1fr));
}

.channels__legend {
  padding: 0;
  margin-bottom: 10px;
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--faint);
}

.channel {
  cursor: pointer;
}

/* Off-screen rather than display:none, which drops the input out of the tab
   order and takes the keyboard path with it. */
.channel__input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}

.channel__face {
  display: flex;
  align-items: center;
  gap: 12px;
  height: 100%;
  padding: 12px 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--tertiary);
  transition: border-color 0.15s, background 0.15s;
}

.channel:hover .channel__face {
  border-color: var(--border-subtle);
}

.channel__icon {
  flex: none;
  color: var(--muted);
}

.channel__text {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.channel__name {
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
}

.channel__status {
  font-size: 12px;
  color: var(--muted);
}

/* The tick holds its space unchecked, so selecting one does not reflow the row. */
.channel__tick {
  flex: none;
  margin-left: auto;
  color: var(--accent);
  opacity: 0;
  transform: scale(0.8);
  transition: opacity 0.15s, transform 0.15s;
}

.channel__input:checked + .channel__face {
  border-color: var(--accent);
  background: var(--accent-soft);
}

.channel__input:checked + .channel__face .channel__icon {
  color: var(--accent);
}

.channel__input:checked + .channel__face .channel__tick {
  opacity: 1;
  transform: scale(1);
}

.channel__input:focus-visible + .channel__face {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

/* Raised when the visitor submits without picking a build. */
.channels.is-error .channel__face {
  border-color: var(--danger);
}

.signup__note.is-success {
  color: var(--accent);
}

.signup__note.is-error {
  color: var(--danger);
}

.signup__input:disabled,
.signup__form .btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

/* Honeypot. Positioned off-screen rather than display:none, which some bots
   check for before deciding whether to fill a field. */
.honeypot {
  position: absolute;
  left: -9999px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

/* --------------------------------------------------------------------------
   FAQ
   -------------------------------------------------------------------------- */
.faq {
  margin-top: 32px;
  max-width: 760px;
  display: grid;
}

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

.faq summary {
  display: flex;
  justify-content: space-between;
  gap: var(--gutter);
  padding: 20px 0;
  font-size: 16px;
  font-weight: 600;
  color: var(--text);
  cursor: pointer;
}

.faq__sign {
  color: var(--accent);
  font-size: 20px;
  line-height: 1;
  transition: transform 0.2s;
}

.faq details[open] .faq__sign {
  transform: rotate(45deg);
}

.faq p {
  padding: 0 0 20px;
  max-width: 64ch;
  font-size: 14px;
  line-height: 1.6;
  color: var(--muted);
}

/* --------------------------------------------------------------------------
   Footer
   -------------------------------------------------------------------------- */
.site-footer {
  margin-top: 120px;
  border-top: 1px solid var(--border);
}

.site-footer__inner {
  padding: 40px var(--gutter);
  display: flex;
  flex-wrap: wrap;
  gap: var(--gutter);
  align-items: center;
}

.site-footer__brand {
  display: flex;
  align-items: center;
  gap: 12px;
}

.site-footer__name {
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
}

.site-footer__version {
  font-size: 13px;
  color: var(--faint);
}

.site-footer__links {
  display: flex;
  flex-wrap: wrap;
  gap: 20px;
  margin-left: auto;
  font-size: 14px;
}

.site-footer__links a {
  color: var(--muted);
}

.site-footer__legal {
  padding: 0 var(--gutter) 40px;
}

.site-footer__legal p {
  font-size: 12px;
  color: var(--faint);
}

/* --------------------------------------------------------------------------
   Legal pages (privacy policy)
   -------------------------------------------------------------------------- */
.legal {
  max-width: 760px;
  padding: 64px var(--gutter) 0;
}

.legal__meta {
  margin-top: 16px;
  font-size: 13px;
  color: var(--faint);
}

.legal__summary {
  margin-top: 32px;
  border: 1px solid var(--border);
  border-left: 3px solid var(--accent);
  border-radius: var(--radius-md);
  background: var(--surface);
  padding: 20px 24px;
}

.legal__summary p {
  font-size: 15px;
  line-height: 1.6;
  color: var(--text-2);
}

.legal__summary p + p {
  margin-top: 12px;
}

.legal h2 {
  margin-top: 48px;
  font-size: 22px;
  line-height: 1.25;
  letter-spacing: -0.02em;
  font-weight: 700;
  color: var(--text);
}

.legal h3 {
  margin-top: 28px;
  font-size: 16px;
  font-weight: 600;
  color: var(--text);
}

.legal p,
.legal li {
  margin-top: 12px;
  font-size: 15px;
  line-height: 1.65;
  color: var(--muted);
}

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

.legal ul {
  margin-top: 8px;
  display: grid;
  gap: 4px;
}

.legal ul li {
  position: relative;
  padding-left: 20px;
}

.legal ul li::before {
  content: "";
  position: absolute;
  left: 4px;
  top: 11px;
  width: 5px;
  height: 5px;
  border-radius: var(--radius-pill);
  background: var(--border-subtle);
}

/* Callout for the one thing a reader most needs to notice. */
.legal__note {
  margin-top: 20px;
  border: 1px solid var(--border);
  border-left: 3px solid var(--warn);
  border-radius: var(--radius-md);
  background: var(--surface);
  padding: 16px 20px;
}

.legal__note p {
  margin-top: 0;
  color: var(--text-2);
}

.legal__note p + p {
  margin-top: 10px;
}

/* Where-your-data-goes table */
.legal__table {
  margin-top: 20px;
}

.legal__table table {
  min-width: 640px;
  font-size: 14px;
}

.legal__table th {
  text-align: left;
  padding: 10px 16px 10px 0;
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--muted);
  border-bottom: 1px solid var(--border);
}

.legal__table td {
  padding: 14px 16px 14px 0;
  color: var(--muted);
  border-bottom: 1px solid var(--border);
  line-height: 1.5;
  vertical-align: top;
}

.legal__table td:first-child {
  color: var(--text-2);
  font-weight: 500;
  white-space: nowrap;
}

/* --------------------------------------------------------------------------
   Changelog
   -------------------------------------------------------------------------- */
.changelog {
  max-width: 860px;
  padding: 64px var(--gutter) 0;
}

.releases {
  margin-top: 56px;
  display: grid;
  gap: 8px;
}

.release {
  display: grid;
  grid-template-columns: 140px minmax(0, 1fr);
  gap: 32px;
  padding: 32px 0;
  border-top: 1px solid var(--border);
}

.release:first-child {
  border-top: 0;
  padding-top: 0;
}

.release__version {
  font-size: 20px;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--text);
}

.release__date {
  margin-top: 6px;
  font-size: 13px;
  color: var(--faint);
}

.release__status {
  margin-top: 12px;
}

.release__title {
  font-size: 17px;
  font-weight: 600;
  color: var(--text);
}

.release__summary {
  margin-top: 10px;
  font-size: 15px;
  line-height: 1.6;
  color: var(--muted);
}

.release__group {
  margin-top: 24px;
}

/* Change-type label: Added / Changed / Fixed. */
.release__label {
  display: inline-block;
  padding: 3px 8px;
  border-radius: var(--radius-pill);
  font-size: 10px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  background: var(--label-bg);
  color: var(--label-ink);
}

.release__label--added {
  --label-bg: var(--accent-soft);
  --label-ink: var(--accent);
}

.release__label--changed {
  --label-bg: rgba(59, 130, 246, 0.14);
  --label-ink: var(--info);
}

.release__label--fixed {
  --label-bg: rgba(245, 158, 11, 0.14);
  --label-ink: var(--warn);
}

.release__list {
  margin-top: 12px;
  display: grid;
  gap: 10px;
}

.release__list li {
  position: relative;
  padding-left: 20px;
  font-size: 15px;
  line-height: 1.6;
  color: var(--muted);
}

.release__list li::before {
  content: "";
  position: absolute;
  left: 4px;
  top: 10px;
  width: 5px;
  height: 5px;
  border-radius: var(--radius-pill);
  background: var(--border-subtle);
}

.release__list strong {
  color: var(--text-2);
  font-weight: 600;
}

@media (max-width: 699px) {
  .release {
    grid-template-columns: minmax(0, 1fr);
    gap: 16px;
  }

  .release__status {
    display: inline-block;
    margin-top: 0;
    margin-left: 12px;
  }

  .release__date {
    display: inline-block;
    margin-top: 0;
    margin-left: 12px;
  }
}

/* --------------------------------------------------------------------------
   Utilities — last, so they win over the component rules they modify
   -------------------------------------------------------------------------- */
.is-danger { color: var(--danger); }
.is-accent { color: var(--accent); }

/* --------------------------------------------------------------------------
   Animation
   -------------------------------------------------------------------------- */
@keyframes spinSlow {
  to { transform: rotate(360deg); }
}

/* Scene cross-fades across one --loop cycle. */
@keyframes sceneA {
  0%, 24% { opacity: 1; }
  30%, 100% { opacity: 0; }
}

@keyframes sceneB {
  0%, 24% { opacity: 0; }
  30%, 46% { opacity: 1; }
  52%, 100% { opacity: 0; }
}

@keyframes sceneC {
  0%, 46% { opacity: 0; }
  52%, 95% { opacity: 1; }
  100% { opacity: 0; }
}

@keyframes dropIn {
  0% { transform: translate(-140px, -170px) rotate(-9deg); opacity: 0; }
  6% { opacity: 1; }
  16% { transform: translate(0, 0) rotate(0deg); opacity: 1; }
  21% { transform: translate(0, 6px) scale(0.97); opacity: 0.7; }
  24%, 100% { transform: translate(0, 10px) scale(0.94); opacity: 0; }
}

@keyframes zonePulse {
  0%, 13% { border-color: var(--border-subtle); background: transparent; }
  17%, 23% { border-color: var(--accent); background: var(--accent-soft); }
  30%, 100% { border-color: var(--border-subtle); background: transparent; }
}

@keyframes progressFill {
  0%, 26% { width: 0%; }
  34% { width: 34%; }
  40% { width: 72%; }
  46%, 100% { width: 100%; }
}

@keyframes reveal1 {
  0%, 50% { opacity: 0; transform: translateY(10px); }
  56%, 100% { opacity: 1; transform: none; }
}

@keyframes reveal2 {
  0%, 53% { opacity: 0; transform: translateY(10px); }
  59%, 100% { opacity: 1; transform: none; }
}

@keyframes reveal3 {
  0%, 56% { opacity: 0; transform: translateY(10px); }
  62%, 100% { opacity: 1; transform: none; }
}

@keyframes reveal4 {
  0%, 59% { opacity: 0; transform: translateY(10px); }
  65%, 100% { opacity: 1; transform: none; }
}

@keyframes reveal5 {
  0%, 62% { opacity: 0; transform: translateY(10px); }
  68%, 100% { opacity: 1; transform: none; }
}

/* --------------------------------------------------------------------------
   Responsive
   -------------------------------------------------------------------------- */
@media (max-width: 899px) {
  .nav-links {
    display: none;
  }

  .section {
    padding-top: 88px;
  }

  .steps {
    gap: 48px;
  }
}

@media (max-width: 599px) {
  :root {
    --gutter: 20px;
  }

  .demo__stage {
    height: 400px;
  }

  /* The mock's fixed columns do not fit a phone. Drop the category column and
     tighten the rest so the scene stays legible instead of being clipped. */
  .demo__scene--result {
    padding: 14px;
  }

  .demo__stats {
    gap: 8px;
  }

  .demo__stat {
    padding: 10px;
  }

  .demo__stat-label {
    font-size: 10px;
  }

  .demo__stat-value {
    font-size: clamp(11px, 3.3vw, 15px);
  }

  .demo__row {
    grid-template-columns: 52px 1fr 84px;
    gap: 8px;
    padding: 10px 12px;
    font-size: 12px;
  }

  .demo__row > :nth-child(3) {
    display: none;
  }

  .step__head {
    grid-template-columns: minmax(0, 1fr);
  }

  .step__body {
    grid-column: 1;
  }

  .merchants__total {
    min-width: 0;
  }

  .site-footer__links {
    margin-left: 0;
  }
}

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

  * {
    animation: none !important;
  }

  /* Without the loop animation the three scenes would stack on top of each
     other, so pin the finished state and hide the two earlier ones. */
  .demo__scene--drop,
  .demo__scene--parse {
    display: none;
  }

  .demo__scene--result {
    opacity: 1;
  }
}
