/* ── FONT ── */
@font-face {
  font-family: 'Geist';
  src: url('fonts/GeistVF.woff2') format('woff2');
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}

/* ── TOKENS ── */
:root {
  --bg: #07080F;
  --surface: #0E1019;
  --ink: #EDF0F7;
  --muted: #9BA3B5;
  --accent: #5B53D6;
  --accent-bright: #7C6FFF;
  --accent-soft: #C7C4FF;
  --glass-bg: rgba(255,255,255,0.04);
  --glass-border: rgba(255,255,255,0.09);
  --glass-blur: 18px;
  --radius: 20px;
  --radius-sm: 12px;
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --dur-fast: 200ms;
  --dur-med: 450ms;
  --dur-slow: 800ms;
}

/* ── RESET & BASE ── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  font-family: 'Geist', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  background: var(--bg);
  color: var(--ink);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
  line-height: 1.5;
}
img { display: block; max-width: 100%; height: auto; }
a { text-decoration: none; color: inherit; }
::selection { background: rgba(91,83,214,0.45); color: #fff; }

::-webkit-scrollbar { width: 10px; }
::-webkit-scrollbar-track { background: var(--bg); }
::-webkit-scrollbar-thumb { background: #262a3d; border-radius: 5px; }
::-webkit-scrollbar-thumb:hover { background: var(--accent); }

a:focus-visible, button:focus-visible {
  outline: 2px solid var(--accent-bright);
  outline-offset: 3px;
  border-radius: 4px;
}

/* ── SKIP LINK ── */
.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  z-index: 1000;
  background: var(--accent-bright);
  color: #fff;
  padding: 14px 22px;
  border-radius: 0 0 10px 0;
  font-weight: 700;
  font-size: 14px;
}
.skip-link:focus {
  left: 0;
}

/* ── GRAIN ── */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  z-index: 999;
  pointer-events: none;
  opacity: 0.35;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='0.05'/%3E%3C/svg%3E");
}

/* ── BRAND ── */
.brand-gradient {
  background: linear-gradient(90deg, #f87171, #fb923c, #7c6fff, #4ade80);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}
.display {
  font-weight: 700;
  letter-spacing: -0.035em;
  line-height: 1.02;
}

/* ── BUTTONS ── */
.btn-primary {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  background: var(--accent);
  color: #fff;
  font-size: 16px;
  font-weight: 600;
  letter-spacing: -0.01em;
  padding: 15px 30px;
  border-radius: 999px;
  box-shadow: 0 0 0 1px rgba(255,255,255,0.08) inset, 0 4px 24px rgba(91,83,214,0.35);
  transition: transform var(--dur-fast) var(--ease-out),
              background-color var(--dur-fast) ease;
}
/* hover glow lives on a pseudo-element so only opacity animates (GPU) */
.btn-primary::after {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: inherit;
  box-shadow: 0 8px 40px rgba(91,83,214,0.55);
  opacity: 0;
  transition: opacity var(--dur-fast) ease;
}
.btn-primary:hover { background: #6a62e6; }
.btn-primary:hover::after { opacity: 1; }
.btn-primary:active { transform: scale(0.97); transition-duration: 120ms; }
.btn-primary svg { transition: transform var(--dur-fast) var(--ease-out); }
@media (hover: hover) and (pointer: fine) {
  .btn-primary:hover { transform: translateY(-1px); }
  .btn-primary:hover svg { transform: translateX(3px); }
}

.btn-ghost {
  display: inline-flex;
  align-items: center;
  font-size: 14px;
  font-weight: 500;
  color: var(--muted);
  padding: 9px 18px;
  border-radius: 999px;
  border: 1px solid var(--glass-border);
  background: var(--glass-bg);
  transition: color var(--dur-fast) ease, border-color var(--dur-fast) ease, transform var(--dur-fast) var(--ease-out);
}
.btn-ghost:hover { color: var(--ink); border-color: rgba(255,255,255,0.2); }
.btn-ghost:active { transform: scale(0.97); }

/* ── GOOGLE PLAY BADGE ── */
.badge-play {
  display: inline-flex;
  align-items: center;
  flex-shrink: 0;
  opacity: 0.94;
  transition: opacity var(--dur-fast) ease, transform var(--dur-fast) var(--ease-out);
}
.badge-play img { height: 40px; width: auto; }
.badge-play:hover { opacity: 1; }
@media (hover: hover) and (pointer: fine) {
  .badge-play:hover { transform: translateY(-1px); }
}
.badge-play:active { transform: scale(0.97); }
html.is-android .hero-cta .btn-primary { order: 2; }
html.is-android .hero-cta .badge-play { order: 1; }
html.is-android .hero-cta .hero-note { order: 3; }
html.is-android .cta-buttons .btn-primary { order: 2; }
html.is-android .cta-buttons .badge-play { order: 1; }

/* ── NAV ── */
nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 24px;
  padding: 14px 28px;
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(7,8,15,0.72);
  -webkit-backdrop-filter: blur(var(--glass-blur));
  backdrop-filter: blur(var(--glass-blur));
  border-bottom: 1px solid transparent;
  transition: border-color var(--dur-fast) ease;
}
nav.scrolled { border-bottom-color: var(--glass-border); }
.nav-logo {
  font-size: 22px;
  font-weight: 800;
  letter-spacing: -0.02em;
}
.nav-links {
  display: flex;
  align-items: center;
  gap: 6px;
  list-style: none;
}
.nav-links a:not(.btn-primary) {
  font-size: 14px;
  font-weight: 500;
  color: var(--muted);
  padding: 9px 14px;
  border-radius: 999px;
  transition: color var(--dur-fast) ease, background-color var(--dur-fast) ease;
}
.nav-links a:not(.btn-primary):hover { color: var(--ink); background: var(--glass-bg); }
.nav-links .btn-primary { font-size: 14px; padding: 9px 20px; margin-left: 8px; }

/* ── MOBILE NAV MENU ── */
.nav-menu-toggle {
  display: none;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: 10px;
  border: 1px solid var(--glass-border);
  background: var(--glass-bg);
  color: var(--ink);
  order: -1;
}
.nav-menu-toggle svg { width: 20px; height: 20px; }
.nav-menu-toggle .icon-close { display: none; }
.nav-menu-toggle[aria-expanded="true"] .icon-open { display: none; }
.nav-menu-toggle[aria-expanded="true"] .icon-close { display: block; }
.nav-mobile-panel {
  display: none;
  flex-direction: column;
  gap: 2px;
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  padding: 10px 20px 18px;
  background: rgba(7,8,15,0.97);
  -webkit-backdrop-filter: blur(var(--glass-blur));
  backdrop-filter: blur(var(--glass-blur));
  border-bottom: 1px solid var(--glass-border);
}
.nav-mobile-panel.open { display: flex; }
.nav-mobile-panel a {
  padding: 12px 10px;
  border-radius: 10px;
  font-size: 15px;
  font-weight: 500;
  color: var(--ink);
}
.nav-mobile-panel a:hover,
.nav-mobile-panel a:focus-visible { background: var(--glass-bg); }

@media (max-width: 720px) {
  .nav-links li.nav-hide-mobile { display: none; }
  .nav-menu-toggle { display: inline-flex; }
  nav { position: relative; }
}

/* ── HERO ── */
#hero {
  position: relative;
  overflow: hidden; /* #hero::before's glow bleeds past the right edge by design;
                        clip it here instead of relying on body{overflow-x:hidden},
                        which doesn't reliably stop the document itself from
                        registering horizontal scroll on mobile browsers */
  display: grid;
  grid-template-columns: 1.05fr 0.95fr;
  align-items: center;
  gap: 40px;
  max-width: 1200px;
  margin: 0 auto;
  padding: 90px 32px 110px;
  min-height: calc(100svh - 60px);
}
#hero::before {
  content: '';
  position: absolute;
  top: 5%;
  right: -10%;
  width: 720px;
  height: 720px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(91,83,214,0.16) 0%, transparent 65%);
  pointer-events: none;
}
.hero-title {
  font-size: clamp(46px, 7vw, 88px);
}
.hero-title .line { display: block; overflow: hidden; padding-bottom: 0.08em; margin-bottom: -0.08em; }
.hero-title .word {
  display: inline-block;
  transform: translateY(110%);
  opacity: 0;
  filter: blur(6px);
  animation: word-in var(--dur-slow) var(--ease-out) forwards;
  animation-delay: var(--d, 0s);
}
.hero-title .line-accent .word {
  background: linear-gradient(100deg, var(--accent-soft), var(--accent-bright));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}
@keyframes word-in {
  to { transform: translateY(0); opacity: 1; filter: blur(0); }
}
.hero-sub {
  margin-top: 26px;
  max-width: 46ch;
  font-size: 18px;
  color: var(--muted);
  opacity: 0;
  animation: soft-in var(--dur-slow) var(--ease-out) 0.55s forwards;
}
.hero-category {
  margin-top: 14px;
  max-width: 50ch;
  font-size: 15px;
  color: var(--muted);
  opacity: 0;
  animation: soft-in var(--dur-slow) var(--ease-out) 0.6s forwards;
}
.hero-cta {
  margin-top: 36px;
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 18px;
  opacity: 0;
  animation: soft-in var(--dur-slow) var(--ease-out) 0.7s forwards;
}
.hero-note { font-size: 13px; color: var(--muted); }
@keyframes soft-in {
  from { opacity: 0; transform: translateY(14px); }
  to   { opacity: 1; transform: translateY(0); }
}

.magnet-wrap {
  position: relative;
  display: flex;
  justify-content: center;
  opacity: 0;
  animation: phone-in 1s var(--ease-out) 0.35s forwards;
}
@keyframes phone-in {
  from { opacity: 0; transform: translateY(30px) scale(0.96); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}
.hero-phone {
  width: min(360px, 78vw);
  border-radius: 36px;
  border: 1px solid var(--glass-border);
  box-shadow: 0 0 0 1px rgba(255,255,255,0.04),
              0 30px 80px rgba(0,0,0,0.55),
              0 0 120px rgba(91,83,214,0.18);
  will-change: transform;
}
@media (max-width: 900px) {
  #hero { grid-template-columns: 1fr; padding-top: 56px; text-align: left; min-height: auto; }
  .magnet-wrap { margin-top: 20px; }
}

/* ── SECTION SHARED ── */
.section-label {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--accent-bright);
}
.section-label::before {
  content: '';
  width: 22px;
  height: 1px;
  background: var(--accent-bright);
}

/* ── TABS STRIP ── */
#tabs {
  max-width: 1200px;
  margin: 0 auto;
  padding: 40px 32px 100px;
}
.tabs-head {
  display: flex;
  justify-content: center;
  margin-bottom: 40px;
}
.tabs-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 22px;
}
.tab-tile { margin: 0; }
.tabs-grid .tab-tile:nth-child(2) { transition-delay: 60ms; }
.tabs-grid .tab-tile:nth-child(3) { transition-delay: 120ms; }
.tabs-grid .tab-tile:nth-child(4) { transition-delay: 180ms; }
.tab-shot {
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid var(--glass-border);
  background: var(--glass-bg);
  aspect-ratio: 3 / 4.4;
}
.tab-shot img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: top;
}
.tab-tile figcaption {
  margin-top: 14px;
  text-align: center;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
}
@media (max-width: 860px) {
  .tabs-grid { grid-template-columns: repeat(2, 1fr); }
}

/* ── ABOUT ── */
#about {
  position: relative;
  max-width: 900px;
  margin: 0 auto;
  padding: 130px 32px 150px;
  text-align: center;
}
.about-heading {
  font-size: clamp(38px, 5vw, 64px);
  margin: 18px 0 30px;
}
.about-body {
  font-size: clamp(20px, 2.6vw, 28px);
  font-weight: 500;
  letter-spacing: -0.015em;
  line-height: 1.45;
  text-wrap: balance;
}
/* resting color is --muted (~8:1 against --bg), not the former #3A3F52 (~1.91:1) —
   the word-by-word scroll "lighting" effect must never be the only thing making
   this paragraph readable */
.about-body .w {
  color: var(--muted);
  transition: color 0.35s ease;
}
.about-body .w.lit { color: var(--ink); }
.deco-icon {
  position: absolute;
  width: 44px;
  height: 44px;
  opacity: 0.5;
}
.deco-icon svg {
  width: 100%;
  height: 100%;
  fill: none;
  stroke: var(--accent);
  stroke-width: 1.5;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.deco-1 { top: 100px; left: 4%; transform: rotate(-12deg); }
.deco-2 { top: 200px; right: 6%; transform: rotate(9deg); }
.deco-3 { bottom: 140px; left: 8%; transform: rotate(6deg); }
.deco-4 { bottom: 90px; right: 10%; transform: rotate(-8deg); }
@media (max-width: 720px) { .deco-icon { display: none; } }

/* ── FEATURES (inverted) ── */
#features {
  background: #fff;
  color: var(--bg);
  padding: 130px 32px 140px;
}
.features-inner { max-width: 1000px; margin: 0 auto; }
#features .section-label { color: var(--accent); }
#features .section-label::before { background: var(--accent); }
.features-heading {
  font-size: clamp(38px, 5vw, 64px);
  margin: 18px 0 60px;
  color: var(--bg);
}
.features-list { list-style: none; }
.feature-item {
  display: grid;
  grid-template-columns: 80px 240px 1fr;
  gap: 24px;
  align-items: baseline;
  padding: 30px 12px;
  border-top: 1px solid rgba(7,8,15,0.12);
  transition: background-color var(--dur-fast) ease;
}
.feature-item:last-child { border-bottom: 1px solid rgba(7,8,15,0.12); }
/* reveal via keyframes so the stagger delay never touches the hover transition */
.feature-item.visible {
  animation: rise-in var(--dur-med) var(--ease-out) both;
  animation-delay: var(--stagger, 0ms);
}
@keyframes rise-in {
  from { opacity: 0; transform: translateY(24px); }
  to   { opacity: 1; transform: translateY(0); }
}
.feature-item:hover { background: rgba(91,83,214,0.05); }
.feature-num {
  font-size: 15px;
  font-weight: 600;
  color: var(--accent);
  font-variant-numeric: tabular-nums;
}
.feature-name {
  font-size: 22px;
  font-weight: 700;
  letter-spacing: -0.02em;
}
.feature-desc {
  font-size: 16px;
  color: #4A4F63;
  max-width: 52ch;
}
@media (max-width: 760px) {
  .feature-item { grid-template-columns: 48px 1fr; }
  .feature-desc { grid-column: 2; }
}

/* ── PROOF / CARD STACK ── */
#proof {
  padding: 130px 32px 80px;
  max-width: 1100px;
  margin: 0 auto;
}
.proof-head { text-align: center; margin-bottom: 70px; }
.stack-container { position: relative; }
.proof-heading {
  font-size: clamp(38px, 5vw, 64px);
  margin-top: 18px;
}
.stack-card {
  position: sticky;
  top: 90px;
  /* scroll-scrubbed element: more opaque fill + light blur keeps the glass look
     without re-sampling an 18px backdrop blur every frame */
  background: linear-gradient(180deg, rgba(30,33,52,0.72), rgba(16,18,29,0.80));
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
  border: 1px solid var(--glass-border);
  border-radius: 28px;
  padding: 40px;
  margin-bottom: 60px;
  transform-origin: center top;
  will-change: transform;
  box-shadow: 0 24px 60px rgba(0,0,0,0.4);
}
#card2 { top: 110px; }
#card3 { top: 130px; }
.card-grid {
  display: grid;
  grid-template-columns: 1fr 0.8fr;
  gap: 56px;
  align-items: center;
}
.card-num {
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.16em;
  color: var(--accent-bright);
  margin-bottom: 18px;
}
.card-name {
  font-size: clamp(30px, 3.5vw, 46px);
  margin-bottom: 16px;
}
.card-desc {
  font-size: 17px;
  color: var(--muted);
  max-width: 44ch;
  margin-bottom: 28px;
}
.card-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 13px;
}
.card-list li {
  display: flex;
  align-items: center;
  gap: 11px;
  font-size: 15px;
}
.card-list svg {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
  fill: none;
  stroke: var(--accent-bright);
  stroke-width: 2.5;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.card-phone {
  border-radius: 26px;
  overflow: hidden;
  border: 1px solid var(--glass-border);
  height: 540px;
  box-shadow: 0 20px 50px rgba(0,0,0,0.35);
}
.card-phone img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
/* crop each phone to the part that sells the tab, not the app header */
#card1 .card-phone img { object-position: 50% 92%; }  /* expense list + bars */
/* goals screen has empty space at its bottom, so this card gets a shorter frame
   whose window runs exactly from the tab bar to just past the goal card */
#card2 .card-phone { height: 450px; }
#card2 .card-phone img { object-position: 50% 72%; }
#card3 .card-phone img { object-position: 50% 88%; }  /* loan card + debt free date */
@media (max-width: 860px) {
  .stack-card { padding: 26px; }
  .card-grid { grid-template-columns: 1fr; gap: 30px; }
  .card-phone { height: 420px; }
}

/* ── CTA ── */
#cta {
  position: relative;
  text-align: center;
  padding: 150px 32px 170px;
  overflow: hidden;
}
#cta::before {
  content: '';
  position: absolute;
  left: 50%;
  bottom: -320px;
  transform: translateX(-50%);
  width: 900px;
  height: 640px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(91,83,214,0.22) 0%, transparent 65%);
  pointer-events: none;
}
.cta-heading { font-size: clamp(44px, 6.5vw, 84px); }
.cta-sub {
  margin: 26px auto 38px;
  max-width: 46ch;
  font-size: 18px;
  color: var(--muted);
}
.cta-buttons {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 18px;
  flex-wrap: wrap;
}

/* ── FOOTER ── */
footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 20px;
  flex-wrap: wrap;
  max-width: 1200px;
  margin: 0 auto;
  padding: 34px 32px;
  border-top: 1px solid var(--glass-border);
}
.footer-copy { font-size: 13px; color: var(--muted); }
.footer-links {
  display: flex;
  align-items: center;
  gap: 4px;
}
.footer-links a {
  font-size: 13px;
  color: var(--muted);
  padding: 8px 12px;
  border-radius: 999px;
  transition: color var(--dur-fast) ease, background-color var(--dur-fast) ease;
}
.footer-links a:hover { color: var(--ink); background: var(--glass-bg); }
.footer-links .social {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 8px;
}
.footer-links .social svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

/* ── SCROLL REVEAL ──
   Visible by default (no-JS / JS-blocked users see everything). The hidden
   resting state only applies once `js-anim` is set on <html> by the tiny
   blocking script in <head> — i.e. JS adds the animation, it never gates
   content visibility. */
.fade-in {
  opacity: 1;
  transform: none;
}
html.js-anim .fade-in {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity var(--dur-med) var(--ease-out), transform var(--dur-med) var(--ease-out);
}
html.js-anim .fade-in.visible { opacity: 1; transform: translateY(0); }

html.js-anim .feature-item { opacity: 0; }
html.js-anim .feature-item.visible { opacity: 1; }

/* ── REDUCED MOTION (gentler, not zero: keep opacity, drop movement) ── */
@keyframes soft-fade {
  from { opacity: 0; }
  to   { opacity: 1; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .hero-title .word {
    transform: none;
    filter: none;
    animation: soft-fade 200ms ease-out forwards;
    animation-delay: 0s;
  }
  .hero-sub, .hero-category, .hero-cta, .magnet-wrap {
    transform: none;
    animation: soft-fade 200ms ease-out forwards;
    animation-delay: 0s;
  }
  html.js-anim .fade-in { transform: none; transition: opacity 200ms ease; }
  html.js-anim .feature-item.visible { animation: soft-fade 200ms ease-out both; }
  .about-body .w { color: var(--ink); transition: none; }
  .stack-card, .hero-phone { transform: none !important; }
}
