/* ============================================================
   Tally - Quiet Ledger · marketing site
   Design tokens mirror the app (lib/theme.dart):
   Fraunces (display), Geist (body), Geist Mono (numbers/labels)
   ============================================================ */

:root {
  --paper: #F1F2EE;
  --card: #FBFBF9;
  --ink: #1E2422;
  --evergreen: #15634A;
  --evergreen-deep: #114e3a;
  --mint: #CDE7D8;
  --clay: #BD6A45;
  --slate: #6B746F;
  --line: rgba(30, 36, 34, .12);
  --line-soft: rgba(30, 36, 34, .07);
  --ink-dark: #141715;
  --card-dark: #1c211c;
  --ink-on-dark: #ECEFEA;
  --slate-on-dark: #8A938E;

  --maxw: 1080px;
  --radius: 16px;
  --ease: cubic-bezier(.22, .61, .36, 1);

  /* category accents (from the app palette) */
  --cat-food: #8FA98A;
  --cat-transport: #7E97A8;
  --cat-groceries: #9AAE84;
  --cat-shopping: #A0879B;
  --cat-bills: #C2A24A;
  --cat-other: #A6A39B;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: 'Geist', system-ui, -apple-system, sans-serif;
  font-size: 17px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: .001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .001ms !important;
  }
}

/* ---------- typography helpers ---------- */
.serif { font-family: 'Fraunces', Georgia, serif; }
.mono {
  font-family: 'Geist Mono', ui-monospace, monospace;
  font-variant-numeric: tabular-nums;
}
.eyebrow {
  font-family: 'Geist Mono', ui-monospace, monospace;
  font-size: 12px;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: var(--slate);
}
a { color: var(--evergreen); text-decoration: none; }
a:hover { text-decoration: underline; }

h1, h2, h3 {
  font-family: 'Fraunces', Georgia, serif;
  font-weight: 600;
  color: var(--ink);
  letter-spacing: -.5px;
  line-height: 1.08;
  margin: 0;
  text-wrap: balance;
}

.wrap {
  width: 100%;
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 0 24px;
}

/* ---------- buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-family: 'Geist', system-ui, sans-serif;
  font-size: 15px;
  font-weight: 600;
  padding: 13px 22px;
  border-radius: 999px;
  border: 1px solid transparent;
  cursor: pointer;
  transition: background-color .2s var(--ease), border-color .2s var(--ease), color .2s var(--ease);
  white-space: nowrap;
}
.btn-primary { background: var(--evergreen); color: #fff; }
.btn-primary:hover { background: var(--evergreen-deep); text-decoration: none; }
.btn-ghost { background: transparent; color: var(--ink); border-color: var(--line); }
.btn-ghost:hover { background: rgba(30, 36, 34, .04); text-decoration: none; }
.btn-mint { background: var(--mint); color: var(--evergreen); }
.btn-mint:hover { background: #bfe0cc; text-decoration: none; }

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

/* ============================================================
   Nav
   ============================================================ */
.nav {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(241, 242, 238, .82);
  backdrop-filter: saturate(140%) blur(12px);
  border-bottom: 1px solid var(--line-soft);
}
.nav-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 64px;
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-family: 'Fraunces', Georgia, serif;
  font-weight: 600;
  font-size: 20px;
  color: var(--ink);
  letter-spacing: -.3px;
}
.brand:hover { text-decoration: none; }
.nav-links { display: flex; align-items: center; gap: 28px; }
.nav-links a {
  color: var(--slate);
  font-size: 15px;
  font-weight: 500;
}
.nav-links a:hover { color: var(--ink); text-decoration: none; }
.nav-cta { margin-left: 4px; }
@media (max-width: 720px) {
  .nav-links a:not(.nav-cta) { display: none; }
}

/* ============================================================
   Hero
   ============================================================ */
.hero { padding: 76px 0 64px; overflow: hidden; }
.hero-grid {
  display: grid;
  grid-template-columns: 1.05fr .95fr;
  gap: 56px;
  align-items: center;
}
.hero h1 {
  font-size: clamp(40px, 6vw, 62px);
  margin-top: 20px;
}
.hero .lede {
  font-size: 19px;
  line-height: 1.55;
  color: var(--slate);
  max-width: 30ch;
  margin: 22px 0 0;
  text-wrap: pretty;
}
.hero-actions { display: flex; gap: 12px; margin-top: 32px; flex-wrap: wrap; }
.hero-note {
  margin-top: 18px;
  font-family: 'Geist Mono', ui-monospace, monospace;
  font-size: 12.5px;
  color: var(--slate);
  display: flex;
  align-items: center;
  gap: 8px;
}
.hero-note svg { flex: none; }

@media (max-width: 860px) {
  .hero-grid { grid-template-columns: 1fr; gap: 40px; }
  .hero { padding: 48px 0 40px; }
  .hero .lede { max-width: none; }
}

/* ---------- phone mockup ---------- */
.phone-stage { display: flex; justify-content: center; }
.phone {
  width: 300px;
  flex: none;
  background: #0e120f;
  border-radius: 46px;
  padding: 10px;
  box-shadow: 0 30px 60px -20px rgba(30, 36, 34, .35), 0 8px 24px rgba(30, 36, 34, .14);
  animation: settle .7s var(--ease) both;
}
@keyframes settle {
  0% { opacity: 0; transform: translateY(16px) scale(.985); }
  100% { opacity: 1; transform: translateY(0) scale(1); }
}
.phone-screen {
  background: var(--paper);
  border-radius: 38px;
  overflow: hidden;
  height: 600px;
  display: flex;
  flex-direction: column;
  position: relative;
}
.phone-notch {
  position: absolute;
  top: 12px; left: 50%;
  transform: translateX(-50%);
  width: 110px; height: 26px;
  background: #0e120f;
  border-radius: 999px;
  z-index: 3;
}
.app-head { padding: 44px 18px 0; flex: none; }
.app-head-row { display: flex; align-items: flex-start; justify-content: space-between; }
.app-month {
  font-family: 'Geist Mono', ui-monospace, monospace;
  font-size: 11px; letter-spacing: 1.5px; text-transform: uppercase;
  color: var(--slate);
}
.app-balance { display: flex; align-items: baseline; gap: 7px; margin-top: 3px; }
.app-balance .amt { font-family: 'Geist Mono', ui-monospace, monospace; font-size: 19px; font-weight: 600; }
.app-balance .lbl { font-size: 11px; color: var(--slate); }
.app-balance .left { font-family: 'Geist Mono', ui-monospace, monospace; font-size: 14px; color: var(--evergreen); }
.app-circ { width: 34px; height: 34px; border-radius: 999px; background: var(--card); border: 1px solid var(--line); display: flex; align-items: center; justify-content: center; }
.app-hair { height: 1px; background: var(--line); margin-top: 12px; }
.app-thread { flex: 1; overflow: hidden; padding: 16px 16px 8px; display: flex; flex-direction: column; gap: 11px; }
.bubble-me {
  align-self: flex-end; max-width: 80%;
  background: var(--mint); color: var(--ink);
  font-size: 14px; padding: 8px 13px;
  border-radius: 16px 16px 4px 16px;
}
.bubble-app {
  align-self: flex-start; max-width: 84%;
  background: #e7eae4; color: var(--ink);
  font-size: 14px; padding: 8px 13px;
  border-radius: 16px 16px 16px 4px;
}
.app-composer { padding: 8px 12px 22px; flex: none; }
.composer-bar {
  display: flex; align-items: center; gap: 9px;
  background: var(--card); border: 1px solid var(--line);
  border-radius: 24px; padding: 7px 8px 7px 12px;
}
.composer-bar .ph { flex: 1; font-size: 14px; color: var(--slate); }
.composer-send {
  width: 32px; height: 32px; border-radius: 999px;
  background: var(--evergreen); flex: none;
  display: flex; align-items: center; justify-content: center;
}

/* ---------- receipt card ---------- */
.receipt {
  width: 100%;
  background: var(--card);
  border-radius: 14px;
  box-shadow: 0 2px 12px rgba(30, 36, 34, .07);
  align-self: flex-start;
}
.receipt-tear {
  height: 7px;
  background: var(--card);
  border-radius: 14px 14px 0 0;
  -webkit-mask-image: radial-gradient(circle at 5px 0, transparent 0 4px, #000 4.5px);
  -webkit-mask-size: 10px 7px; -webkit-mask-repeat: repeat-x;
  mask-image: radial-gradient(circle at 5px 0, transparent 0 4px, #000 4.5px);
  mask-size: 10px 7px; mask-repeat: repeat-x;
}
.receipt-body { padding: 8px 16px 13px; }
.receipt-title { font-size: 14.5px; font-weight: 600; margin-bottom: 8px; }
.receipt-rule { height: 1px; background: var(--line); margin-bottom: 10px; }
.receipt-row { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.receipt-amt { font-family: 'Geist Mono', ui-monospace, monospace; font-size: 18px; font-weight: 500; }
.receipt-amt.income { color: var(--evergreen); }
.receipt-foot { display: flex; align-items: center; justify-content: space-between; margin-top: 9px; }
.receipt-time { font-size: 11.5px; color: var(--slate); }
.pill {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 3px 8px; border-radius: 999px;
}
.pill .dot { width: 7px; height: 7px; border-radius: 9px; }
.pill span:last-child { font-size: 12px; font-weight: 600; color: var(--ink); }

/* ============================================================
   Section scaffolding
   ============================================================ */
section { padding: 84px 0; }
.section-head { max-width: 640px; margin-bottom: 48px; }
.section-head h2 { font-size: clamp(30px, 4.4vw, 42px); margin-top: 12px; }
.section-head p { color: var(--slate); font-size: 18px; margin: 16px 0 0; text-wrap: pretty; }
.section-head.center { margin-left: auto; margin-right: auto; text-align: center; }

@media (max-width: 720px) { section { padding: 60px 0; } }

/* ---------- feature grid ---------- */
.features {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 18px;
}
.feature {
  background: var(--card);
  border: 1px solid var(--line-soft);
  border-radius: var(--radius);
  padding: 26px 24px;
  box-shadow: 0 2px 12px rgba(30, 36, 34, .04);
}
.feature .ficon {
  width: 44px; height: 44px; border-radius: 12px;
  background: var(--mint);
  display: flex; align-items: center; justify-content: center;
  margin-bottom: 18px;
}
.feature h3 { font-size: 21px; }
.feature p { color: var(--slate); font-size: 15.5px; line-height: 1.55; margin: 10px 0 0; }
@media (max-width: 860px) { .features { grid-template-columns: 1fr 1fr; } }
@media (max-width: 560px) { .features { grid-template-columns: 1fr; } }

/* ---------- alternating showcase rows ---------- */
.showcase {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 56px;
  align-items: center;
}
.showcase + .showcase { margin-top: 88px; }
.showcase.flip .showcase-media { order: 2; }
.showcase h3 { font-size: clamp(26px, 3.6vw, 34px); }
.showcase p { color: var(--slate); font-size: 17px; margin: 16px 0 0; }
.showcase ul { list-style: none; padding: 0; margin: 22px 0 0; display: flex; flex-direction: column; gap: 12px; }
.showcase li { display: flex; gap: 11px; align-items: flex-start; font-size: 15.5px; }
.showcase li svg { flex: none; margin-top: 3px; color: var(--evergreen); }
@media (max-width: 860px) {
  .showcase { grid-template-columns: 1fr; gap: 32px; }
  .showcase.flip .showcase-media { order: 0; }
}

/* statement / insight card mock used in showcase */
.statement-card {
  background: var(--card);
  border-radius: var(--radius);
  padding: 22px;
  box-shadow: 0 4px 24px rgba(30, 36, 34, .07);
  border: 1px solid var(--line-soft);
}
.stmt-top { display: flex; gap: 28px; margin-bottom: 18px; }
.stmt-top .k { font-size: 12px; color: var(--slate); margin-bottom: 4px; }
.stmt-top .v { font-family: 'Geist Mono', ui-monospace, monospace; font-size: 26px; font-weight: 600; letter-spacing: -1px; }
.stmt-top .v.earn { color: var(--evergreen); }
.legend { display: flex; flex-direction: column; gap: 9px; margin-top: 4px; }
.legend-row { display: flex; align-items: center; gap: 8px; }
.legend-row .dot { width: 9px; height: 9px; border-radius: 9px; flex: none; }
.legend-row .name { font-size: 13px; flex: 1; }
.legend-row .pct { font-family: 'Geist Mono', ui-monospace, monospace; font-size: 13px; color: var(--slate); }
.advice {
  background: var(--evergreen); border-radius: 14px; padding: 18px; margin-top: 16px;
}
.advice .k {
  font-family: 'Geist Mono', ui-monospace, monospace; font-size: 11px;
  letter-spacing: 1px; text-transform: uppercase; color: var(--mint); margin-bottom: 10px;
}
.advice p { color: var(--paper); font-size: 15px; line-height: 1.5; margin: 0; }
.advice .num { font-family: 'Geist Mono', ui-monospace, monospace; font-weight: 600; color: #fff; }

/* ---------- privacy band (dark) ---------- */
.band-dark {
  background: var(--ink-dark);
  color: var(--ink-on-dark);
}
.band-dark .eyebrow { color: var(--mint); }
.band-dark h2 { color: var(--ink-on-dark); }
.band-dark .section-head p { color: var(--slate-on-dark); }
.privacy-points { display: grid; grid-template-columns: repeat(2, 1fr); gap: 16px; }
.ppoint {
  background: var(--card-dark);
  border: 1px solid rgba(236, 239, 234, .08);
  border-radius: var(--radius);
  padding: 24px;
}
.ppoint .ficon { width: 40px; height: 40px; border-radius: 11px; background: rgba(205, 231, 216, .14); display: flex; align-items: center; justify-content: center; margin-bottom: 16px; }
.ppoint h3 { color: var(--ink-on-dark); font-size: 19px; }
.ppoint p { color: var(--slate-on-dark); font-size: 15px; line-height: 1.55; margin: 9px 0 0; }
@media (max-width: 720px) { .privacy-points { grid-template-columns: 1fr; } }

/* ---------- pricing ---------- */
.plans { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; max-width: 760px; margin: 0 auto; }
.plan {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 20px;
  padding: 30px 28px;
  display: flex;
  flex-direction: column;
}
.plan.pro { border: 1.5px solid var(--evergreen); box-shadow: 0 8px 30px rgba(21, 99, 74, .12); position: relative; }
.plan-badge {
  position: absolute; top: -12px; left: 28px;
  background: var(--evergreen); color: #fff;
  font-family: 'Geist Mono', ui-monospace, monospace;
  font-size: 11px; letter-spacing: 1px; text-transform: uppercase;
  padding: 4px 11px; border-radius: 999px;
}
.plan h3 { font-size: 24px; }
.plan .price { font-family: 'Geist Mono', ui-monospace, monospace; font-size: 17px; color: var(--slate); margin: 8px 0 0; }
.plan .price b { color: var(--ink); font-weight: 600; }
.plan ul { list-style: none; padding: 0; margin: 22px 0 26px; display: flex; flex-direction: column; gap: 12px; flex: 1; }
.plan li { display: flex; gap: 10px; align-items: flex-start; font-size: 15px; }
.plan li svg { flex: none; margin-top: 3px; color: var(--evergreen); }
.plan li.muted { color: var(--slate); }
.plan li.muted svg { color: var(--slate); }
@media (max-width: 620px) { .plans { grid-template-columns: 1fr; } }

/* ---------- final CTA ---------- */
.cta-band { text-align: center; }
.cta-band h2 { font-size: clamp(32px, 5vw, 48px); }
.cta-band p { color: var(--slate); font-size: 18px; margin: 16px auto 0; max-width: 48ch; }
.cta-actions { display: flex; gap: 12px; justify-content: center; margin-top: 32px; flex-wrap: wrap; }

/* ============================================================
   Footer
   ============================================================ */
.footer {
  border-top: 1px solid var(--line);
  padding: 56px 0 40px;
}
.footer-grid { display: flex; justify-content: space-between; gap: 40px; flex-wrap: wrap; }
.footer-brand { max-width: 280px; }
.footer-brand p { color: var(--slate); font-size: 14.5px; margin: 12px 0 0; }
.footer-cols { display: flex; gap: 64px; flex-wrap: wrap; }
.footer-col h4 {
  font-family: 'Geist Mono', ui-monospace, monospace;
  font-size: 11px; letter-spacing: 1px; text-transform: uppercase;
  color: var(--slate); margin: 0 0 14px;
}
.footer-col a { display: block; color: var(--ink); font-size: 14.5px; margin-bottom: 10px; }
.footer-col a:hover { color: var(--evergreen); text-decoration: none; }
.footer-base {
  margin-top: 44px; padding-top: 22px; border-top: 1px solid var(--line-soft);
  display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap;
  font-size: 13px; color: var(--slate);
}

/* ============================================================
   Legal pages (privacy / terms)
   ============================================================ */
/* padding-top/bottom only: these share the element with .wrap, whose 24px
   horizontal padding must survive (a `padding:` shorthand would zero it). */
.legal-hero { padding-top: 64px; padding-bottom: 8px; }
.legal-hero h1 { font-size: clamp(34px, 5vw, 50px); margin-top: 14px; }
.legal-hero .updated {
  font-family: 'Geist Mono', ui-monospace, monospace;
  font-size: 13px; color: var(--slate); margin-top: 16px;
}
.legal {
  display: grid;
  grid-template-columns: 220px 1fr;
  gap: 56px;
  padding-top: 40px;
  padding-bottom: 96px;
  align-items: start;
}
.toc {
  position: sticky; top: 88px;
  font-size: 14px;
}
.toc h4 {
  font-family: 'Geist Mono', ui-monospace, monospace;
  font-size: 11px; letter-spacing: 1px; text-transform: uppercase;
  color: var(--slate); margin: 0 0 14px;
}
.toc a { display: block; color: var(--slate); padding: 5px 0; line-height: 1.4; }
.toc a:hover { color: var(--ink); text-decoration: none; }
.legal-body { max-width: 70ch; }
.legal-body h2 {
  font-size: 26px;
  margin: 44px 0 0;
  scroll-margin-top: 88px;
}
.legal-body h2:first-child { margin-top: 0; }
.legal-body h3 { font-size: 19px; margin: 28px 0 0; }
.legal-body p { margin: 14px 0 0; color: #2c332f; }
.legal-body ul { margin: 14px 0 0; padding-left: 22px; color: #2c332f; }
.legal-body li { margin: 8px 0; }
.legal-body li::marker { color: var(--evergreen); }
.legal-body strong { color: var(--ink); }
.callout {
  background: var(--card);
  border: 1px solid var(--line);
  border-left: 3px solid var(--evergreen);
  border-radius: 12px;
  padding: 18px 20px;
  margin: 22px 0 0;
  font-size: 15.5px;
}
/* Mobile "On this page" disclosure - replaces the sidebar TOC. */
.toc-mobile {
  display: none;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 12px;
}
.toc-mobile summary {
  font-family: 'Geist Mono', ui-monospace, monospace;
  font-size: 11px; letter-spacing: 1px; text-transform: uppercase;
  color: var(--slate);
  padding: 13px 16px;
  cursor: pointer;
}
.toc-mobile[open] summary { border-bottom: 1px solid var(--line-soft); }
.toc-mobile-links { padding: 8px 16px 12px; }
.toc-mobile-links a {
  display: block; color: var(--slate);
  font-size: 14px; padding: 6px 0; line-height: 1.4;
}

@media (max-width: 820px) {
  .legal { grid-template-columns: 1fr; gap: 0; padding-top: 24px; padding-bottom: 64px; }
  .toc { display: none; }
  .toc-mobile { display: block; }
  .legal-hero { padding-top: 36px; padding-bottom: 0; }
  .legal-hero h1 { font-size: 32px; }
  .legal-hero .updated { margin-top: 12px; }
  .legal-body { padding-top: 24px; }
  .legal-body h2 { font-size: 22px; margin-top: 36px; scroll-margin-top: 76px; }
  .legal-body h3 { font-size: 17.5px; }
  .callout { padding: 16px; font-size: 15px; }
}
