/* XLeap marketing site — self-contained, system fonts only.
   Mirrors the XLeap design system (dark theme + ice accent), with
   web-font voices swapped for system equivalents:
   Instrument Serif → ui-serif / Georgia, Inter Tight → system sans,
   JetBrains Mono → ui-monospace. */

:root {
  /* dark theme surfaces */
  --bg: #0e0d0b;
  --bg-elev: #16140f;
  --bg-card: #1c1a14;
  --bg-sunken: #100f0c;

  /* ink ramp */
  --ink: #f5efdf;
  --ink-2: #c4bca9;
  --ink-3: #8c8474;
  --ink-4: #5a5447;

  --hairline: rgba(245, 239, 223, 0.08);
  --hairline-strong: rgba(245, 239, 223, 0.18);

  /* ice accent trio */
  --accent: oklch(0.78 0.10 248);
  --accent-soft: oklch(0.26 0.06 250);
  --accent-ink: oklch(0.88 0.08 248);

  --pos: oklch(0.78 0.12 158);
  --neg: oklch(0.72 0.13 25);

  --r-md: 14px;
  --r-lg: 20px;

  --font-display: ui-serif, Georgia, 'Times New Roman', serif;
  --font-ui: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Helvetica Neue', Helvetica, Arial, sans-serif;
  --font-mono: ui-monospace, 'SF Mono', 'Cascadia Mono', Menlo, Consolas, monospace;

  --ease: cubic-bezier(0.2, 0.7, 0.2, 1);
  --gutter: 24px;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; }

body {
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-ui);
  font-size: 16px;
  line-height: 1.6;
  letter-spacing: -0.005em;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

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

a { color: inherit; text-decoration: none; }

.wrap {
  max-width: 1040px;
  margin: 0 auto;
  padding-left: var(--gutter);
  padding-right: var(--gutter);
}

/* ---------- shared vocabulary ---------- */

.eyebrow {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--ink-3);
}
.eyebrow.accent { color: var(--accent); }

.serif {
  font-family: var(--font-display);
  font-weight: 400;
}

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

.pill {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  border-radius: 100px;
  padding: 14px 26px;
  font-size: 15px;
  font-weight: 600;
  letter-spacing: -0.005em;
  border: 1px solid transparent;
  transition: transform 0.2s var(--ease), opacity 0.2s var(--ease);
  cursor: default;
}
.pill:active { transform: scale(0.97); opacity: 0.85; }
.pill-accent { background: var(--accent); color: #0e1420; }
.pill-ghost { background: transparent; border-color: var(--hairline-strong); color: var(--ink); }
a.pill { cursor: pointer; }

.icon-tile {
  width: 38px;
  height: 38px;
  border-radius: 12px;
  background: var(--bg-sunken);
  border: 1px solid var(--hairline);
  display: grid;
  place-items: center;
  color: var(--ink-2);
  flex: none;
}
.icon-tile svg { width: 18px; height: 18px; }

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

.nav {
  position: sticky;
  top: 0;
  z-index: 10;
  background: color-mix(in srgb, var(--bg) 84%, transparent);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--hairline);
}
.nav-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 64px;
}
.brand {
  font-family: var(--font-display);
  font-size: 24px;
  letter-spacing: -0.02em;
  color: var(--ink);
}
.nav-links {
  display: flex;
  align-items: center;
  gap: 26px;
  font-size: 14px;
  color: var(--ink-2);
}
.nav-links a { transition: color 0.2s var(--ease); }
.nav-links a:hover { color: var(--ink); }
.nav-links a[aria-current="page"] { color: var(--ink); }

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

.hero {
  padding-top: 88px;
  padding-bottom: 72px;
  display: grid;
  grid-template-columns: 1fr;
  gap: 56px;
  align-items: center;
}
@media (min-width: 880px) {
  .hero { grid-template-columns: 1.05fr 0.95fr; padding-top: 120px; padding-bottom: 104px; }
}

.hero h1 {
  font-family: var(--font-display);
  font-weight: 400;
  font-size: clamp(40px, 6.4vw, 64px);
  line-height: 1.06;
  letter-spacing: -0.03em;
  margin: 18px 0 20px;
  text-wrap: balance;
}
.hero .lede {
  font-size: 17px;
  line-height: 1.65;
  color: var(--ink-2);
  max-width: 46ch;
  text-wrap: pretty;
}
.hero-ctas {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 14px;
  margin-top: 34px;
}
.coming-soon {
  font-size: 12px;
  color: var(--ink-3);
}

/* store badge — original, unbranded */
.store-badge {
  display: inline-flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 2px;
  border-radius: 100px;
  padding: 12px 28px;
  background: var(--accent);
  color: #0e1420;
  line-height: 1.25;
}
.store-badge .small {
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  opacity: 0.75;
}
.store-badge .big { font-size: 16px; font-weight: 600; letter-spacing: -0.01em; }

/* ---------- phone mock — mirrors the app's dashboard ---------- */

.phone-col { display: flex; justify-content: center; }

.phone {
  width: min(340px, 88vw);
  border-radius: 44px;
  background: var(--bg-elev);
  border: 1px solid var(--hairline-strong);
  box-shadow: 0 40px 80px rgba(0, 0, 0, 0.5);
  padding: 12px;
}
.phone-screen {
  border-radius: 34px;
  background: var(--bg);
  border: 1px solid var(--hairline);
  overflow: hidden;
  padding: 18px 0 0;
  display: flex;
  flex-direction: column;
}
.phone .statusrow {
  display: flex;
  justify-content: space-between;
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--ink-4);
  padding: 0 22px;
  margin-bottom: 14px;
}

/* app header: entity chip + round icon buttons */
.app-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0 22px;
}
.entity-chip { display: flex; align-items: center; gap: 8px; }
.entity-chip .avatar {
  width: 30px;
  height: 30px;
  border-radius: 100px;
  background: var(--accent);
  color: var(--bg);
  display: grid;
  place-items: center;
  font-family: var(--font-display);
  font-size: 15px;
}
.entity-chip .en { font-size: 12.5px; font-weight: 500; line-height: 1.2; }
.entity-chip .eh { font-size: 9.5px; color: var(--ink-3); }
.app-header .hbtns { display: flex; gap: 7px; }
.app-header .iconbtn {
  width: 30px;
  height: 30px;
  border-radius: 100px;
  background: var(--bg-sunken);
  border: 1px solid var(--hairline);
  display: grid;
  place-items: center;
  color: var(--ink-2);
  position: relative;
}
.app-header .iconbtn svg { width: 14px; height: 14px; }
.app-header .iconbtn .dot {
  position: absolute;
  top: 5px;
  right: 6px;
  width: 5px;
  height: 5px;
  border-radius: 100px;
  background: var(--accent);
}

/* hero figure */
.nw-block { padding: 18px 22px 0; }
.networth-label { margin-bottom: 7px; font-size: 10px; }
.networth {
  font-family: var(--font-display);
  font-size: 40px;
  letter-spacing: -0.03em;
  line-height: 1;
}
.networth .cents { color: var(--ink-4); font-size: 24px; }
.delta {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 9px;
  font-size: 11.5px;
}
.delta .pos-part {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  color: var(--pos);
  font-family: var(--font-mono);
}
.delta .pos-part svg { width: 11px; height: 11px; }
.delta .pct { opacity: 0.7; }
.delta .muted { color: var(--ink-3); font-family: var(--font-ui); }

.mock-chart { margin: 14px 0 0; display: block; width: 100%; height: auto; }

/* segmented control */
.mock-seg { display: flex; justify-content: center; margin-top: 10px; }
.segmented {
  display: inline-flex;
  background: var(--bg-sunken);
  border: 1px solid var(--hairline);
  border-radius: 100px;
  padding: 2px;
  gap: 2px;
}
.seg-btn {
  padding: 5px 13px;
  font-size: 10.5px;
  font-weight: 500;
  color: var(--ink-3);
  border-radius: 100px;
}
.seg-btn.active { background: var(--bg-card); color: var(--ink); border: 1px solid var(--hairline); }

/* breakdown tiles */
.mock-tiles {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 7px;
  padding: 16px 16px 14px;
}
.mock-tile {
  background: var(--bg-card);
  border: 1px solid var(--hairline);
  border-radius: 14px;
  padding: 11px 13px;
  display: flex;
  flex-direction: column;
  gap: 3px;
}
.mock-tile .tl {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 10px;
  color: var(--ink-3);
}
.mock-tile .tl svg { width: 11px; height: 11px; }
.mock-tile.accent .tl { color: var(--accent); }
.mock-tile .tv { font-family: var(--font-mono); font-size: 13px; color: var(--ink); }

/* tab bar */
.mock-tabbar {
  display: flex;
  justify-content: space-around;
  align-items: center;
  border-top: 1px solid var(--hairline);
  padding: 11px 18px 16px;
  color: var(--ink-4);
  margin-top: auto;
}
.mock-tabbar svg { width: 20px; height: 20px; }
.mock-tabbar .active { color: var(--accent); }

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

.section { padding: 72px 0; border-top: 1px solid var(--hairline); }
.section-head { max-width: 560px; margin-bottom: 44px; }
.section-head h2 {
  font-family: var(--font-display);
  font-weight: 400;
  font-size: clamp(28px, 4vw, 38px);
  letter-spacing: -0.02em;
  line-height: 1.15;
  margin: 14px 0 12px;
  text-wrap: balance;
}
.section-head p { color: var(--ink-2); font-size: 16px; text-wrap: pretty; }

.feature-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 14px;
}
@media (min-width: 640px) { .feature-grid { grid-template-columns: 1fr 1fr; } }
@media (min-width: 960px) { .feature-grid { grid-template-columns: 1fr 1fr 1fr; } }

.feature {
  background: var(--bg-card);
  border: 1px solid var(--hairline);
  border-radius: var(--r-lg);
  padding: 26px 24px 28px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.feature h3 { font-size: 16px; font-weight: 600; letter-spacing: -0.01em; }
.feature .fh { display: flex; align-items: center; gap: 12px; }
.feature .fh h3 { margin: 0; }
.feature p { font-size: 14px; color: var(--ink-2); text-wrap: pretty; }

/* ---------- feature vignettes — paywall-style mini graphics ---------- */

.vignette {
  min-height: 118px;
  display: flex;
  align-items: center;
  width: 100%;
}

/* accounts — stacked rows */
.vg-accounts { display: flex; flex-direction: column; gap: 7px; width: 100%; }
.vg-accounts .vrow {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  border-radius: 10px;
  background: var(--bg-sunken);
  border: 1px solid var(--hairline);
}
.vg-accounts .vrow:nth-child(2) { opacity: 0.82; }
.vg-accounts .vrow:nth-child(3) { opacity: 0.64; }
.vg-accounts .vrow svg { width: 13px; height: 13px; color: var(--accent); flex: none; }
.vg-accounts .vname { font-size: 12px; font-weight: 500; flex: 1; }
.vg-accounts .vamt { font-family: var(--font-mono); font-size: 11.5px; color: var(--ink-2); }

/* charts drawn with SVG — shared bits */
.vg-chart { width: 100%; display: block; }
.vg-axis {
  display: flex;
  justify-content: space-between;
  margin-top: 8px;
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--ink-3);
}
.vg-axis .accent { color: var(--accent); }
.vg-axis .pos { color: var(--pos); }

/* goals — ring + bars */
.vg-goals { display: flex; align-items: center; gap: 18px; width: 100%; }
.vg-goals .ring { width: 64px; height: 64px; flex: none; }
.vg-goals .ring text { font: 600 12px var(--font-mono); fill: var(--ink); }
.vg-goals .gr { flex: 1; min-width: 0; }
.vg-goals .gl { display: flex; justify-content: space-between; margin-bottom: 8px; align-items: baseline; }
.vg-goals .gl .t { font-size: 12px; font-weight: 500; }
.vg-goals .gl .v { font-family: var(--font-mono); font-size: 10.5px; color: var(--ink-3); }
.vg-goals .bars { display: flex; align-items: flex-end; gap: 4px; height: 36px; }
.vg-goals .bars i {
  flex: 1;
  border-radius: 3px;
  background: var(--accent);
  transform-origin: bottom;
}

/* privacy — shield + checklist */
.vg-privacy { display: flex; align-items: center; gap: 16px; width: 100%; }
.vg-privacy .shield-tile {
  width: 56px;
  height: 56px;
  border-radius: 18px;
  background: var(--accent-soft);
  border: 1px solid var(--hairline-strong);
  display: grid;
  place-items: center;
  color: var(--accent);
  flex: none;
}
.vg-privacy .shield-tile svg { width: 26px; height: 26px; }
.vg-privacy .checks { display: flex; flex-direction: column; gap: 8px; }
.vg-privacy .checks span { display: flex; align-items: center; gap: 8px; font-size: 12px; font-weight: 500; }
.vg-privacy .checks svg { width: 13px; height: 13px; color: var(--ink-2); flex: none; }

/* cash flow — mirrored in/out bars around a baseline */
.vg-cashflow { width: 100%; }
.vg-cashflow .cf { display: grid; grid-template-columns: repeat(6, 1fr); gap: 8px; }
.vg-cashflow .m { display: flex; flex-direction: column; align-items: stretch; }
.vg-cashflow .in-bar {
  height: 42px;
  display: flex;
  align-items: flex-end;
}
.vg-cashflow .in-bar i {
  width: 100%;
  border-radius: 3px 3px 0 0;
  background: var(--pos);
  opacity: 0.8;
  transform-origin: bottom;
}
.vg-cashflow .base { display: block; height: 1px; background: var(--hairline-strong); margin: 2px 0; }
.vg-cashflow .out-bar { display: block; height: 26px; }
.vg-cashflow .out-bar i {
  display: block;
  width: 100%;
  border-radius: 0 0 3px 3px;
  background: var(--neg);
  opacity: 0.55;
  transform-origin: top;
}

/* vignette entrance animation — keyed off scroll reveal (.reveal.in) */
@media (prefers-reduced-motion: no-preference) {
  .js .vg-grow-y i, .js .vg-cashflow i { transform: scaleY(0); transition: transform 0.7s var(--ease); }
  .js .reveal.in .vg-grow-y i, .js .reveal.in .vg-cashflow i { transform: scaleY(1); }
  .vg-grow-y i:nth-child(1), .cf .m:nth-child(1) i { transition-delay: 0.05s; }
  .vg-grow-y i:nth-child(2), .cf .m:nth-child(2) i { transition-delay: 0.12s; }
  .vg-grow-y i:nth-child(3), .cf .m:nth-child(3) i { transition-delay: 0.19s; }
  .vg-grow-y i:nth-child(4), .cf .m:nth-child(4) i { transition-delay: 0.26s; }
  .vg-grow-y i:nth-child(5), .cf .m:nth-child(5) i { transition-delay: 0.33s; }
  .vg-grow-y i:nth-child(6), .cf .m:nth-child(6) i { transition-delay: 0.40s; }
  .vg-grow-y i:nth-child(7) { transition-delay: 0.47s; }

  .js .vg-line { stroke-dasharray: 340; stroke-dashoffset: 340; transition: stroke-dashoffset 1.4s var(--ease) 0.15s; }
  .js .reveal.in .vg-line { stroke-dashoffset: 0; }
  .js .vg-fill { opacity: 0; transition: opacity 0.8s var(--ease) 1s; }
  .js .reveal.in .vg-fill { opacity: 1; }
  .js .vg-dot { opacity: 0; transition: opacity 0.4s var(--ease) 1.3s; }
  .js .reveal.in .vg-dot { opacity: 1; }

  .js .vg-ringfill { stroke-dashoffset: 144.5; transition: stroke-dashoffset 1.1s var(--ease) 0.2s; }
  .js .reveal.in .vg-ringfill { stroke-dashoffset: 40.5; }

  .js .vg-accounts .vrow { opacity: 0; transform: translateY(8px); transition: opacity 0.5s var(--ease), transform 0.5s var(--ease); }
  .js .reveal.in .vg-accounts .vrow:nth-child(1) { opacity: 1; transform: none; transition-delay: 0.05s; }
  .js .reveal.in .vg-accounts .vrow:nth-child(2) { opacity: 0.82; transform: none; transition-delay: 0.15s; }
  .js .reveal.in .vg-accounts .vrow:nth-child(3) { opacity: 0.64; transform: none; transition-delay: 0.25s; }

  .js .vg-privacy .checks span { opacity: 0; transform: translateY(6px); transition: opacity 0.5s var(--ease), transform 0.5s var(--ease); }
  .js .reveal.in .vg-privacy .checks span:nth-child(1) { opacity: 1; transform: none; transition-delay: 0.1s; }
  .js .reveal.in .vg-privacy .checks span:nth-child(2) { opacity: 1; transform: none; transition-delay: 0.2s; }
  .js .reveal.in .vg-privacy .checks span:nth-child(3) { opacity: 1; transform: none; transition-delay: 0.3s; }
}

/* privacy strip */
.privacy-strip {
  display: flex;
  flex-direction: column;
  gap: 22px;
  background: var(--bg-card);
  border: 1px solid var(--hairline);
  border-radius: var(--r-lg);
  padding: 36px 30px;
}
@media (min-width: 760px) {
  .privacy-strip { flex-direction: row; align-items: center; justify-content: space-between; }
}
.privacy-strip .pt { display: flex; gap: 18px; align-items: flex-start; max-width: 58ch; }
.privacy-strip h3 {
  font-family: var(--font-display);
  font-weight: 400;
  font-size: 24px;
  letter-spacing: -0.02em;
  margin-bottom: 6px;
}
.privacy-strip p { font-size: 14px; color: var(--ink-2); text-wrap: pretty; }
.textlink {
  color: var(--accent);
  font-size: 14px;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  white-space: nowrap;
}
.textlink svg { width: 14px; height: 14px; transition: transform 0.2s var(--ease); }
.textlink:hover svg { transform: translateX(3px); }

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

.footer { border-top: 1px solid var(--hairline); padding: 44px 0 56px; }
.footer-inner {
  display: flex;
  flex-direction: column;
  gap: 22px;
}
@media (min-width: 640px) {
  .footer-inner { flex-direction: row; align-items: baseline; justify-content: space-between; }
}
.footer .brand { font-size: 20px; }
.footer-links { display: flex; gap: 22px; font-size: 13px; color: var(--ink-3); flex-wrap: wrap; }
.footer-links a:hover { color: var(--ink); }
.footer .fine { font-size: 12px; color: var(--ink-4); margin-top: 10px; }

/* ---------- document pages (privacy / support) ---------- */

.doc { max-width: 680px; margin: 0 auto; padding: 72px var(--gutter) 96px; }
.doc header { margin-bottom: 40px; }
.doc h1 {
  font-family: var(--font-display);
  font-weight: 400;
  font-size: clamp(34px, 5vw, 46px);
  letter-spacing: -0.02em;
  line-height: 1.1;
  margin: 14px 0 10px;
}
.doc .meta { font-size: 13px; color: var(--ink-3); }
.doc h2 {
  font-family: var(--font-display);
  font-weight: 400;
  font-size: 24px;
  letter-spacing: -0.015em;
  margin: 44px 0 12px;
}
.doc p, .doc li { font-size: 15px; color: var(--ink-2); text-wrap: pretty; }
.doc p + p { margin-top: 12px; }
.doc ul { padding-left: 20px; margin: 12px 0; display: grid; gap: 8px; }
.doc a { color: var(--accent); }
.doc .placeholder {
  font-family: var(--font-mono);
  font-size: 13px;
  color: var(--accent-ink);
  background: var(--accent-soft);
  border-radius: 6px;
  padding: 1px 6px;
  white-space: nowrap;
}

.contact-card {
  display: flex;
  align-items: center;
  gap: 18px;
  background: var(--bg-card);
  border: 1px solid var(--hairline);
  border-radius: var(--r-lg);
  padding: 24px;
  margin: 28px 0 8px;
}
.contact-card .cc-label { font-size: 12px; color: var(--ink-3); }
.contact-card .cc-mail {
  font-family: var(--font-mono);
  font-size: 16px;
  color: var(--accent);
}

/* FAQ */
.faq { border-top: 1px solid var(--hairline); margin-top: 20px; }
.faq details { border-bottom: 1px solid var(--hairline); }
.faq summary {
  list-style: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 18px 2px;
  font-size: 15px;
  font-weight: 500;
  color: var(--ink);
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after {
  content: "+";
  font-family: var(--font-mono);
  color: var(--ink-3);
  font-size: 16px;
  transition: transform 0.25s var(--ease);
  flex: none;
}
.faq details[open] summary::after { transform: rotate(45deg); }
.faq .faq-body { padding: 0 2px 20px; }

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

@keyframes fade-up {
  from { opacity: 0; transform: translateY(14px); }
  to { opacity: 1; transform: translateY(0); }
}
@keyframes draw {
  from { stroke-dashoffset: 620; }
  to { stroke-dashoffset: 0; }
}
@keyframes area-in {
  from { opacity: 0; }
  to { opacity: 1; }
}

@media (prefers-reduced-motion: no-preference) {
  .fade-up { animation: fade-up 0.55s var(--ease) both; }
  .fade-up.d1 { animation-delay: 0.08s; }
  .fade-up.d2 { animation-delay: 0.16s; }
  .fade-up.d3 { animation-delay: 0.24s; }
  .fade-up.d4 { animation-delay: 0.34s; }

  /* phone internals stagger in like the app's own screens */
  .phone .app-fade { animation: fade-up 0.5s var(--ease) both; }
  .phone .app-fade.p1 { animation-delay: 0.45s; }
  .phone .app-fade.p2 { animation-delay: 0.55s; }
  .phone .app-fade.p3 { animation-delay: 0.65s; }
  .phone .app-fade.p4 { animation-delay: 0.9s; }
  .phone .app-fade.p5 { animation-delay: 1.05s; }

  .chart-line {
    stroke-dasharray: 620;
    animation: draw 1.6s var(--ease) 0.7s both;
  }
  .chart-area { animation: area-in 0.9s var(--ease) 1.6s both; }

  /* scroll reveal — hidden state applied only when JS is running */
  .js .reveal {
    opacity: 0;
    transform: translateY(16px);
    transition: opacity 0.6s var(--ease), transform 0.6s var(--ease);
  }
  .js .reveal.in { opacity: 1; transform: translateY(0); }
  .js .reveal.d1 { transition-delay: 0.06s; }
  .js .reveal.d2 { transition-delay: 0.12s; }
  .js .reveal.d3 { transition-delay: 0.18s; }
}
