/* ============================================================
   Ldgr — shared styles
   Visual language borrowed from the app: fern green, SF Rounded,
   the "left to spend" budget card, and ledger ruled lines.
   ============================================================ */

:root {
  /* Palette */
  --paper: #F5F6F1;       /* warm off-white with a faint green undertone */
  --paper-raised: #FFFFFF;
  --ink: #182016;
  --secondary: #5E6B58;
  --fern: #4F7942;
  --fern-deep: #3C5E32;
  --fern-soft: rgba(79, 121, 66, 0.10);
  --hairline: rgba(24, 32, 22, 0.12);
  --signal-orange: #E8863B;
  --signal-red: #D1453B;

  /* Type */
  --font-rounded: ui-rounded, "SF Pro Rounded", "Nunito", system-ui, -apple-system, "Segoe UI", sans-serif;

  /* Space + shape */
  --container: 1080px;
  --radius-lg: 28px;
  --radius-md: 18px;
  --radius-sm: 12px;
  --shadow-card: 0 1px 2px rgba(24, 32, 22, 0.05), 0 18px 40px -24px rgba(24, 32, 22, 0.35);
  --shadow-phone: 0 8px 24px -8px rgba(24, 32, 22, 0.25), 0 40px 80px -40px rgba(24, 32, 22, 0.45);
}

@media (prefers-color-scheme: dark) {
  :root {
    --paper: #10160F;
    --paper-raised: #1A231A;
    --ink: #EAF0E6;
    --secondary: #9BA894;
    --fern: #7CA86B;
    --fern-deep: #98C186;
    --fern-soft: rgba(124, 168, 107, 0.14);
    --hairline: rgba(234, 240, 230, 0.14);
    --shadow-card: 0 1px 2px rgba(0, 0, 0, 0.3), 0 18px 40px -24px rgba(0, 0, 0, 0.6);
    --shadow-phone: 0 8px 24px -8px rgba(0, 0, 0, 0.5), 0 40px 80px -40px rgba(0, 0, 0, 0.7);
  }
}

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

html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: var(--font-rounded);
  background: var(--paper);
  color: var(--ink);
  line-height: 1.6;
  font-size: 18px;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

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

h1, h2, h3 { line-height: 1.1; letter-spacing: -0.02em; font-weight: 800; margin: 0; }

a { color: var(--fern-deep); text-decoration-color: var(--hairline); text-underline-offset: 3px; }
a:hover { text-decoration-color: currentColor; }

p { margin: 0 0 1em; }

:focus-visible {
  outline: 3px solid var(--fern);
  outline-offset: 3px;
  border-radius: 6px;
}

.container {
  width: 100%;
  max-width: var(--container);
  margin-inline: auto;
  padding-inline: 24px;
}

.tnum { font-variant-numeric: tabular-nums; }

/* ---------- ledger hairline divider ---------- */
.rule {
  border: 0;
  height: 1px;
  background: var(--hairline);
  margin: 0;
}
/* a ledger "column tick" motif used to open a section */
.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--fern);
  margin: 0 0 18px;
}
.eyebrow::before {
  content: "";
  width: 22px;
  height: 2px;
  border-radius: 2px;
  background: var(--fern);
}

/* ---------- site header ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  background: color-mix(in srgb, var(--paper) 88%, transparent);
  backdrop-filter: saturate(140%) blur(12px);
  border-bottom: 1px solid var(--hairline);
}
.site-header .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 68px;
}
.wordmark {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-weight: 800;
  font-size: 1.25rem;
  letter-spacing: -0.03em;
  color: var(--ink);
  text-decoration: none;
}
.wordmark img { width: 30px; height: 30px; border-radius: 8px; display: block; }
.site-nav { display: flex; gap: 24px; font-size: 0.98rem; font-weight: 600; }
.site-nav a { color: var(--secondary); text-decoration: none; }
.site-nav a:hover { color: var(--ink); }
@media (max-width: 640px) { .site-nav { display: none; } }

/* ---------- buttons / badges ---------- */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 16px;
  border-radius: 999px;
  background: var(--fern-soft);
  color: var(--fern-deep);
  font-weight: 700;
  font-size: 0.9rem;
}
.badge .dot {
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--fern);
  box-shadow: 0 0 0 0 var(--fern);
  animation: pulse 2.4s ease-out infinite;
}
@keyframes pulse {
  0% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--fern) 55%, transparent); }
  70%, 100% { box-shadow: 0 0 0 10px transparent; }
}

/* ---------- hero ---------- */
.hero { padding: 72px 0 40px; }
.hero .container {
  display: grid;
  grid-template-columns: 1.05fr 0.95fr;
  gap: 56px;
  align-items: center;
}
.hero h1 {
  font-size: clamp(2.6rem, 6vw, 4.1rem);
  margin: 22px 0 20px;
}
.hero h1 .accent { color: var(--fern); }
.hero .lede {
  font-size: 1.2rem;
  color: var(--secondary);
  max-width: 30ch;
  margin-bottom: 28px;
}
.hero-actions { display: flex; align-items: center; gap: 18px; flex-wrap: wrap; }
.hero-sub { font-size: 0.92rem; color: var(--secondary); }

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

/* ---------- phone mockup (the signature) ---------- */
.hero-figure { display: flex; justify-content: center; }
.phone {
  width: 300px;
  max-width: 82vw;
  background: var(--paper-raised);
  border-radius: 44px;
  padding: 14px;
  box-shadow: var(--shadow-phone);
  border: 1px solid var(--hairline);
}
.app-screen {
  background: linear-gradient(180deg, var(--paper) 0%, var(--paper-raised) 100%);
  border-radius: 32px;
  padding: 22px 18px 20px;
  overflow: hidden;
}
.app-topbar {
  display: flex; align-items: baseline; justify-content: space-between;
  margin-bottom: 18px;
}
.app-title { font-size: 1.4rem; font-weight: 800; letter-spacing: -0.03em; }
.app-topbar span { color: var(--secondary); font-size: 0.85rem; }

/* budget card — a faithful replica of BudgetSummaryCard */
.budget-card {
  background: var(--paper-raised);
  border: 1px solid var(--hairline);
  border-radius: var(--radius-md);
  padding: 18px;
  box-shadow: var(--shadow-card);
  margin-bottom: 16px;
}
.budget-card .amount-row { display: flex; align-items: baseline; gap: 8px; }
.budget-card .amount {
  font-size: 2.6rem; font-weight: 800; letter-spacing: -0.03em;
  color: var(--fern);
}
.budget-card .amount-label { color: var(--secondary); font-size: 1rem; }
.budget-card .caption { color: var(--secondary); font-size: 0.82rem; margin-top: 10px; }

.progress {
  height: 8px; border-radius: 999px;
  background: var(--fern-soft);
  overflow: hidden;
  margin-top: 14px;
}
.progress-fill {
  height: 100%; border-radius: 999px;
  background: var(--fern);
  width: var(--fill, 40%);
  transform-origin: left;
  animation: fill 1.3s cubic-bezier(.2,.7,.2,1) both;
}
.progress-fill.warn { background: var(--signal-orange); }
.progress-fill.over { background: var(--signal-red); }
@keyframes fill { from { transform: scaleX(0); } to { transform: scaleX(1); } }

/* small budget rows */
.budget-row {
  display: flex; align-items: center; gap: 12px;
  padding: 12px 4px;
}
.budget-row + .budget-row { border-top: 1px solid var(--hairline); }
.monogram {
  flex: none;
  width: 40px; height: 40px; border-radius: 12px;
  display: grid; place-items: center;
  color: #fff; font-weight: 700; font-size: 1.05rem;
  background: var(--m, var(--fern));
}
.budget-row .meta { flex: 1; min-width: 0; }
.budget-row .name { font-weight: 700; font-size: 0.98rem; }
.budget-row .left { color: var(--secondary); font-size: 0.8rem; }
.budget-row .mini {
  height: 5px; border-radius: 999px; background: var(--fern-soft);
  margin-top: 6px; overflow: hidden;
}
.budget-row .mini > i {
  display: block; height: 100%; border-radius: 999px; background: var(--m, var(--fern));
}

/* facepile — attribution / sharing */
.facepile { display: inline-flex; }
.facepile .avatar {
  width: 24px; height: 24px; border-radius: 50%;
  border: 2px solid var(--paper-raised);
  display: grid; place-items: center;
  color: #fff; font-size: 0.7rem; font-weight: 700;
}
.facepile .avatar + .avatar { margin-left: -8px; }

/* ---------- generic section ---------- */
.section { padding: 72px 0; }
.section h2 { font-size: clamp(1.8rem, 3.6vw, 2.6rem); max-width: 18ch; }
.section .intro { color: var(--secondary); font-size: 1.12rem; max-width: 56ch; margin-top: 16px; }

/* present vs past — the argument */
.contrast {
  display: grid; grid-template-columns: 1fr 1fr; gap: 20px;
  margin-top: 40px;
}
.contrast .card {
  border-radius: var(--radius-md);
  padding: 28px;
  border: 1px solid var(--hairline);
}
.contrast .past { background: transparent; }
.contrast .past h3 { color: var(--secondary); }
.contrast .present { background: var(--fern-soft); border-color: color-mix(in srgb, var(--fern) 30%, transparent); }
.contrast .present h3 { color: var(--fern-deep); }
.contrast .tag {
  font-size: 0.78rem; font-weight: 700; letter-spacing: 0.1em; text-transform: uppercase;
  color: var(--secondary); display: block; margin-bottom: 10px;
}
.contrast h3 { font-size: 1.3rem; margin-bottom: 10px; }
.contrast p { color: var(--secondary); margin: 0; }
.contrast .present p { color: var(--ink); }
@media (max-width: 720px) { .contrast { grid-template-columns: 1fr; } }

/* pillars */
.pillars { display: grid; grid-template-columns: repeat(3, 1fr); gap: 28px; margin-top: 48px; }
.pillar .ico {
  width: 46px; height: 46px; border-radius: 13px;
  display: grid; place-items: center;
  background: var(--fern-soft); color: var(--fern);
  margin-bottom: 16px;
}
.pillar .ico svg { width: 24px; height: 24px; }
.pillar h3 { font-size: 1.22rem; margin-bottom: 8px; }
.pillar p { color: var(--secondary); margin: 0; font-size: 1rem; }
@media (max-width: 760px) { .pillars { grid-template-columns: 1fr; gap: 32px; } }

/* how it works — a real sequence, so numbers carry meaning */
.steps { margin-top: 44px; display: grid; gap: 0; }
.step {
  display: grid; grid-template-columns: 60px 1fr; gap: 24px;
  padding: 26px 0;
  align-items: start;
}
.step + .step { border-top: 1px solid var(--hairline); }
.step .n {
  font-size: 1.1rem; font-weight: 800; color: var(--fern);
  font-variant-numeric: tabular-nums;
  padding-top: 2px;
}
.step h3 { font-size: 1.28rem; margin-bottom: 6px; }
.step p { color: var(--secondary); margin: 0; }
@media (max-width: 560px) { .step { grid-template-columns: 40px 1fr; gap: 16px; } }

/* why ldgr — founder note */
.founder {
  background: var(--fern-soft);
  border: 1px solid color-mix(in srgb, var(--fern) 22%, transparent);
}
.founder .container { max-width: 760px; }
.founder blockquote { margin: 0; }
.founder p { font-size: 1.18rem; color: var(--ink); }
.founder .signoff {
  display: flex; align-items: center; gap: 14px; margin-top: 28px;
  font-size: 0.98rem;
}
.founder .signoff .avatar {
  width: 44px; height: 44px; border-radius: 50%;
  background: var(--fern); color: #fff;
  display: grid; place-items: center; font-weight: 800;
}
.founder .signoff .who strong { display: block; }
.founder .signoff .who span { color: var(--secondary); font-size: 0.88rem; }

/* private by design */
.private { text-align: center; }
.private .container { max-width: 640px; }
.private .lock {
  width: 56px; height: 56px; border-radius: 16px;
  display: grid; place-items: center; margin: 0 auto 22px;
  background: var(--fern-soft); color: var(--fern);
}
.private .lock svg { width: 28px; height: 28px; }
.private .points {
  display: flex; flex-wrap: wrap; justify-content: center; gap: 10px;
  margin-top: 26px;
}
.private .points li {
  list-style: none;
  padding: 8px 16px; border-radius: 999px;
  border: 1px solid var(--hairline);
  font-size: 0.92rem; font-weight: 600; color: var(--secondary);
}

/* ---------- footer ---------- */
.site-footer {
  border-top: 1px solid var(--hairline);
  padding: 48px 0 56px;
  margin-top: 24px;
}
.site-footer .container {
  display: flex; justify-content: space-between; gap: 32px; flex-wrap: wrap;
  align-items: start;
}
.site-footer .fnav { display: flex; gap: 28px; flex-wrap: wrap; }
.site-footer a { color: var(--secondary); text-decoration: none; font-weight: 600; }
.site-footer a:hover { color: var(--ink); }
.site-footer .copyright { color: var(--secondary); font-size: 0.9rem; }

/* ============================================================
   Legal / support pages
   ============================================================ */
.legal { padding: 56px 0 80px; }
.legal .container { max-width: 720px; }
.legal .back { font-size: 0.92rem; font-weight: 600; text-decoration: none; color: var(--secondary); }
.legal .back:hover { color: var(--ink); }
.legal h1 { font-size: clamp(2rem, 5vw, 2.8rem); margin: 24px 0 8px; }
.legal .updated { color: var(--secondary); font-size: 0.92rem; margin-bottom: 8px; }
.legal .lead { font-size: 1.14rem; color: var(--secondary); margin: 20px 0 8px; }
.legal h2 { font-size: 1.4rem; margin: 40px 0 12px; }
.legal h3 { font-size: 1.1rem; margin: 24px 0 8px; }
.legal p, .legal li { color: var(--ink); }
.legal ul { padding-left: 22px; }
.legal li { margin-bottom: 8px; }
.legal .callout {
  background: var(--fern-soft);
  border: 1px solid color-mix(in srgb, var(--fern) 22%, transparent);
  border-radius: var(--radius-md);
  padding: 20px 24px;
  margin: 28px 0;
}
.legal .callout p:last-child { margin-bottom: 0; }

/* FAQ (support) */
.faq details {
  border-top: 1px solid var(--hairline);
  padding: 8px 0;
}
.faq details:last-of-type { border-bottom: 1px solid var(--hairline); }
.faq summary {
  cursor: pointer; padding: 14px 0;
  font-weight: 700; font-size: 1.08rem;
  list-style: none;
  display: flex; justify-content: space-between; align-items: center; gap: 16px;
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; color: var(--fern); font-size: 1.4rem; font-weight: 700; }
.faq details[open] summary::after { content: "–"; }
.faq details[open] summary { color: var(--fern-deep); }
.faq .answer { color: var(--secondary); padding: 0 0 16px; }
.faq .answer p:last-child { margin-bottom: 0; }
