/* ============================================================
   Balance — public landing page (served at /)
   Same design language as the app: Budget ONE palette, Inter,
   indigo accent, 16px cards, no gradients. Dark-first; the
   light counterpart follows the system. This page scrolls —
   it deliberately does NOT share styles.css, whose body is a
   fixed, non-scrolling app shell.
   ============================================================ */

:root {
  --bg: #0a0a0e;
  --card: #14141b;
  --fill: #1e1e28;
  --text: #f4f4f8;
  --text-2: #9a9ca8;
  --text-3: #5b5d6a;
  --hairline: rgba(244, 244, 248, 0.06);
  --accent: #6366f1;
  --accent-press: #4f52e0;
  --pos: #2ee27a;
  --neg: #e05252;
  --card-shadow: none;
  --phone-shadow: 0 24px 80px rgba(0, 0, 0, 0.55);
  /* per-person tint, same formula as the app */
  --av-bg-s: 40%;
  --av-bg-l: 16%;
  --av-fg-s: 75%;
  --av-fg-l: 70%;
}

@media (prefers-color-scheme: light) {
  :root {
    --bg: #f3f3f6;
    --card: #ffffff;
    --fill: #ebebf1;
    --text: #101015;
    --text-2: #696d7a;
    --text-3: #9fa2ad;
    --hairline: rgba(16, 16, 24, 0.09);
    --accent: #5457e6;
    --accent-press: #4346d4;
    --pos: #129c5c;
    --neg: #d03a30;
    --card-shadow: 0 1px 2px rgba(16, 16, 40, 0.04), 0 6px 20px rgba(16, 16, 40, 0.06);
    --phone-shadow: 0 24px 70px rgba(20, 20, 45, 0.22);
    --av-bg-s: 62%;
    --av-bg-l: 93%;
    --av-fg-s: 52%;
    --av-fg-l: 38%;
  }
}

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

html { scroll-behavior: smooth; }

body {
  font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
    "Helvetica Neue", Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
  -webkit-font-smoothing: antialiased;
  line-height: 1.5;
}

img { display: block; }

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

/* Transactor's mark in Balance's tokens, same trick as the login page. */
.brandmark { width: 20px; height: 20px; flex-shrink: 0; }
.brandmark circle { fill: var(--text); }
.brandmark path { stroke: var(--bg); }

.wordmark {
  font-family: "Caveat", cursive;
  font-weight: 600;
  font-size: 22px;
  color: var(--text);
  line-height: 1;
}

/* shared per-person tints (mockup avatars, feature icons) */
.hue-teal   { --h: 165; }
.hue-rose   { --h: 350; }
.hue-gold   { --h: 42; }
.hue-violet { --h: 262; }

.pos { color: var(--pos); }
.neg { color: var(--neg); }

/* ============ Nav ============ */

.nav {
  max-width: 1080px;
  margin: 0 auto;
  padding: 18px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.nav-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 18px;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.nav-brand img { border-radius: 8px; }

.nav-cta {
  height: 40px;
  padding: 0 20px;
  display: flex;
  align-items: center;
  border-radius: 20px;
  background: var(--accent);
  color: #fff;
  font-size: 14px;
  font-weight: 600;
  transition: background 0.15s, transform 0.12s;
}

.nav-cta:hover { background: var(--accent-press); }
.nav-cta:active { transform: scale(0.96); }

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

.hero {
  max-width: 1080px;
  margin: 0 auto;
  padding: 48px 24px 72px;
  display: grid;
  grid-template-columns: 1fr;
  gap: 56px;
  align-items: center;
}

.hero-brand {
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: 14px;
  color: var(--text-2);
  margin-bottom: 18px;
  /* a link to transactor.app, dressed as the byline it always was */
  text-decoration: none;
}

.hero h1 {
  font-size: clamp(38px, 6vw, 58px);
  font-weight: 780;
  letter-spacing: -0.035em;
  line-height: 1.06;
}

.hero-sub {
  margin-top: 20px;
  font-size: 17px;
  color: var(--text-2);
  max-width: 460px;
}

.hero-actions {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 30px;
  flex-wrap: wrap;
}

.btn-primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 52px;
  padding: 0 30px;
  border-radius: 26px;
  background: var(--accent);
  color: #fff;
  font-size: 16px;
  font-weight: 650;
  box-shadow: 0 6px 22px rgba(99, 102, 241, 0.35);
  transition: background 0.15s, transform 0.12s;
}

.btn-primary:hover { background: var(--accent-press); }
.btn-primary:active { transform: scale(0.97); }

.btn-ghost {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 52px;
  padding: 0 26px;
  border-radius: 26px;
  background: var(--card);
  box-shadow: var(--card-shadow);
  border: 1px solid var(--hairline);
  font-size: 16px;
  font-weight: 600;
  transition: background 0.15s, transform 0.12s;
}

.btn-ghost:hover { background: var(--fill); }
.btn-ghost:active { transform: scale(0.97); }

.hero-note {
  margin-top: 18px;
  font-size: 13px;
  color: var(--text-3);
}

/* ---- phone mockup ---- */

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

.phone {
  width: 320px;
  border-radius: 40px;
  background: var(--bg);
  border: 1px solid var(--hairline);
  outline: 8px solid var(--card);
  box-shadow: var(--phone-shadow);
  padding: 26px 20px 30px;
}

.phone-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 2px;
}

.phone-title {
  font-size: 17px;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.phone-dot {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: var(--card);
  box-shadow: var(--card-shadow);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  font-weight: 500;
  color: var(--text-2);
}

.m-card {
  margin-top: 16px;
  background: var(--card);
  box-shadow: var(--card-shadow);
  border-radius: 16px;
  padding: 18px 16px;
}

.m-label {
  display: block;
  text-align: center;
  font-size: 12px;
  font-weight: 500;
  color: var(--pos);
  margin-bottom: 8px;
}

.m-amount-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.m-amount {
  font-size: 30px;
  font-weight: 750;
  letter-spacing: -0.03em;
  font-variant-numeric: tabular-nums;
  line-height: 1;
}

.m-pct {
  font-size: 12px;
  font-weight: 500;
  color: var(--text-2);
  font-variant-numeric: tabular-nums;
}

.m-bar {
  height: 5px;
  border-radius: 4px;
  background: var(--neg);
  overflow: hidden;
  margin-top: 12px;
}

.m-fill {
  width: 35%;
  height: 100%;
  border-radius: 4px;
  background: var(--pos);
}

.m-legend {
  display: flex;
  justify-content: space-between;
  margin-top: 8px;
  font-size: 10.5px;
  font-weight: 500;
}

.m-legend span:first-child { color: var(--text-2); }

.m-row {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 12px 2px;
}

.m-row + .m-row { border-top: 1px solid var(--hairline); }

.m-card + .m-row { margin-top: 8px; }

.m-av {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12.5px;
  font-weight: 650;
  background: hsl(var(--h, 240) var(--av-bg-s) var(--av-bg-l));
  color: hsl(var(--h, 240) var(--av-fg-s) var(--av-fg-l));
}

.m-row-main {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.m-row-main b {
  font-size: 13.5px;
  font-weight: 600;
  letter-spacing: -0.01em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.m-row-main i, .m-row-right i {
  font-style: normal;
  font-size: 10.5px;
  color: var(--text-3);
}

.m-row-right {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 2px;
  flex-shrink: 0;
}

.m-row-right b {
  font-size: 13px;
  font-weight: 650;
  font-variant-numeric: tabular-nums;
}

.m-row-right b.settled { color: var(--text-3); font-weight: 500; }

/* ============ Features ============ */

.features {
  max-width: 1080px;
  margin: 0 auto;
  padding: 24px 24px 72px;
}

.features h2, .how h2 {
  font-size: clamp(26px, 4vw, 34px);
  font-weight: 750;
  letter-spacing: -0.03em;
  text-align: center;
  margin-bottom: 40px;
}

.feature-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 14px;
}

.feature {
  background: var(--card);
  box-shadow: var(--card-shadow);
  border-radius: 16px;
  padding: 26px 24px;
}

.feature-icon {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  margin-bottom: 16px;
  background: hsl(var(--h, 240) var(--av-bg-s) var(--av-bg-l));
  color: hsl(var(--h, 240) var(--av-fg-s) var(--av-fg-l));
}

.feature h3 {
  font-size: 16.5px;
  font-weight: 650;
  letter-spacing: -0.01em;
  margin-bottom: 7px;
}

.feature p {
  font-size: 14px;
  color: var(--text-2);
}

/* ============ How it works ============ */

.how {
  max-width: 1080px;
  margin: 0 auto;
  padding: 24px 24px 88px;
  text-align: center;
}

.steps {
  list-style: none;
  display: grid;
  grid-template-columns: 1fr;
  gap: 14px;
  text-align: left;
}

.steps li {
  background: var(--card);
  box-shadow: var(--card-shadow);
  border-radius: 16px;
  padding: 26px 24px;
}

.step-n {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: var(--fill);
  color: var(--accent);
  font-size: 15px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  margin-bottom: 14px;
}

.steps h3 {
  font-size: 16px;
  font-weight: 650;
  letter-spacing: -0.01em;
  margin-bottom: 6px;
}

.steps p {
  font-size: 14px;
  color: var(--text-2);
}

.how-cta { margin-top: 40px; }

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

.footer {
  border-top: 1px solid var(--hairline);
  padding: 34px 24px calc(env(safe-area-inset-bottom) + 40px);
  text-align: center;
}

.footer-brand {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-size: 15px;
  font-weight: 650;
  letter-spacing: -0.01em;
}

.footer-brand img { border-radius: 6px; }

.footer-by {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  font-weight: 400;
  color: var(--text-2);
  margin-left: 4px;
  /* same: a link to transactor.app in byline clothes */
  text-decoration: none;
}

.footer-note {
  margin-top: 10px;
  font-size: 12.5px;
  color: var(--text-3);
}

/* ============ Wide screens ============ */

@media (min-width: 880px) {
  .hero {
    grid-template-columns: 1.05fr 0.95fr;
    padding-top: 72px;
    padding-bottom: 96px;
  }
  .feature-grid { grid-template-columns: repeat(2, 1fr); }
  .steps { grid-template-columns: repeat(3, 1fr); }
}
