/* SmartlyLedger website — same palette and type as the app
   (lib/app/theme). One memorable element: the ruled ledger page in the
   hero. Everything else stays quiet. */

:root {
  --ink: #1a237e;          /* brand indigo: headings, ruled ink */
  --ink-deep: #000666;
  --teal: #00897b;         /* actions */
  --teal-soft: #8df5e4;
  --in: #2e7d32;           /* cash in */
  --out: #c62828;          /* cash out */
  --paper: #ffffff;
  --page: #f6f7fb;         /* cool page background */
  --rule: #d6dcf2;         /* ledger rule lines */
  --margin: #e57373;       /* account-book margin line */
  --text: #1b1c22;
  --muted: #4f5160;
  --line: #e3e5ee;
  --radius-s: 8px;
  --radius-l: 20px;
  --wrap: 1120px;
  --display: "Manrope", system-ui, sans-serif;
  --body: "Public Sans", system-ui, sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

body {
  margin: 0;
  background: var(--page);
  color: var(--text);
  font: 400 1.0625rem/1.6 var(--body);
  -webkit-font-smoothing: antialiased;
}

img { max-width: 100%; display: block; }
a { color: var(--ink); }
a:focus-visible, button:focus-visible {
  outline: 3px solid var(--teal);
  outline-offset: 3px;
  border-radius: 4px;
}

.wrap { width: min(var(--wrap), 100% - 32px); margin-inline: auto; }

.skip {
  position: absolute; left: -999px; top: 8px;
  background: var(--ink); color: #fff; padding: 8px 12px; border-radius: 6px;
}
.skip:focus { left: 16px; z-index: 10; }

/* ── Header ─────────────────────────────────────────────── */
.site-head {
  position: sticky; top: 0; z-index: 5;
  background: color-mix(in srgb, var(--page) 88%, transparent);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}
.site-head .wrap {
  display: flex; align-items: center; justify-content: space-between;
  gap: 16px; height: 64px;
}
.brand {
  display: flex; align-items: center; gap: 10px;
  font: 800 1.125rem/1 var(--display); color: var(--ink);
  text-decoration: none; letter-spacing: -0.01em;
}
.brand img { width: 32px; height: 32px; border-radius: 8px; }
.nav { display: flex; gap: 28px; align-items: center; }
.nav a {
  color: var(--muted); text-decoration: none; font-weight: 500;
  font-size: 0.95rem;
}
.nav a:hover { color: var(--ink); }

.btn {
  display: inline-flex; align-items: center; justify-content: center;
  gap: 8px; min-height: 48px; padding: 0 22px;
  border-radius: 999px; border: 0; cursor: pointer;
  font: 600 1rem/1 var(--body); text-decoration: none;
}
.btn-primary { background: var(--teal); color: #fff; }
.btn-primary:hover { background: #00796b; }
.btn-quiet {
  background: transparent; color: var(--ink);
  border: 1.5px solid var(--rule);
}
.btn-quiet:hover { border-color: var(--ink); }
.site-head .btn { min-height: 40px; padding: 0 18px; font-size: 0.95rem; }
.nav a.btn-primary, .nav a.btn-primary:hover { color: #fff; }

/* ── Hero ───────────────────────────────────────────────── */
.hero { padding: 72px 0 88px; }
.hero .wrap {
  display: grid; grid-template-columns: 1fr 1.05fr;
  gap: 48px; align-items: center;
}
.hero h1 {
  font: 800 clamp(2.4rem, 5.2vw, 4rem)/1.04 var(--display);
  letter-spacing: -0.035em; color: var(--ink); margin: 0 0 20px;
  max-width: 12ch;
}
.hero .lede { font-size: 1.2rem; color: var(--muted); max-width: 46ch; margin: 0 0 32px; }
.hero .actions { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; }
.hero .note { margin: 18px 0 0; font-size: 0.95rem; color: var(--muted); }

/* The ledger page: ruled lines, red margin, running balance. */
.ledger {
  position: relative;
  margin: 0;
  background:
    linear-gradient(90deg, transparent 52px, var(--margin) 52px, var(--margin) 54px, transparent 54px),
    repeating-linear-gradient(180deg, var(--paper) 0 47px, var(--rule) 47px 48px);
  border-radius: var(--radius-l);
  box-shadow: 0 1px 0 var(--line), 0 24px 60px -28px rgba(26, 35, 126, 0.35);
  padding: 0 24px 24px 72px;
  transform: rotate(-1.2deg);
}
.ledger-head {
  display: flex; justify-content: space-between; align-items: baseline;
  height: 96px; padding-top: 30px;
  font-family: var(--display);
}
.ledger-head strong { font-size: 1.35rem; color: var(--ink); letter-spacing: -0.02em; }
.ledger-head span { color: var(--muted); font-size: 0.9rem; font-family: var(--body); }
.ledger ol { list-style: none; margin: 0; padding: 0; }
.ledger li {
  display: grid; grid-template-columns: minmax(0, 1fr) auto 6.2rem;
  gap: 12px; align-items: center; height: 48px;
  font-variant-numeric: tabular-nums;
}
.ledger .what { overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.ledger .what small { color: var(--muted); margin-left: 6px; font-size: 0.85rem; }
.ledger .amt { font-weight: 600; }
.ledger .in { color: var(--in); }
.ledger .out { color: var(--out); }
.ledger .bal { text-align: right; color: var(--ink); font-weight: 600; }
.ledger .total {
  height: 56px; border-top: 2px solid var(--ink);
  font: 800 1.15rem/1 var(--display);
}
.ledger .total .bal { font-size: 1.25rem; }
.offline-chip {
  position: absolute; right: 20px; bottom: -18px;
  display: inline-flex; align-items: center; gap: 8px;
  background: var(--ink); color: #fff; border-radius: 999px;
  padding: 10px 16px; font-size: 0.9rem; font-weight: 500;
  transform: rotate(1.2deg);
}
.offline-chip svg { flex: none; }

/* Entries are written in one by one, once, on load. */
@media (prefers-reduced-motion: no-preference) {
  .ledger li { animation: write 0.5s cubic-bezier(.2,.7,.2,1) both; }
  .ledger li:nth-child(1) { animation-delay: .25s; }
  .ledger li:nth-child(2) { animation-delay: .55s; }
  .ledger li:nth-child(3) { animation-delay: .85s; }
  .ledger li:nth-child(4) { animation-delay: 1.15s; }
  .ledger li:nth-child(5) { animation-delay: 1.45s; }
  .ledger li:nth-child(6) { animation-delay: 1.85s; }
  .offline-chip { animation: write .5s 2.3s both; }
  @keyframes write {
    from { opacity: 0; clip-path: inset(0 100% 0 0); }
    to { opacity: 1; clip-path: inset(0 0 0 0); }
  }
}

/* ── Sections ───────────────────────────────────────────── */
section { padding: 88px 0; }
.section-head { max-width: 640px; margin-bottom: 48px; }
h2 {
  font: 800 clamp(1.9rem, 3.6vw, 2.75rem)/1.1 var(--display);
  letter-spacing: -0.03em; color: var(--ink); margin: 0 0 14px;
}
.section-head p { color: var(--muted); font-size: 1.125rem; margin: 0; }
h3 { font: 700 1.2rem/1.3 var(--display); color: var(--ink); margin: 0 0 6px; letter-spacing: -0.01em; }

/* Features as a ledger index: name | what it does, ruled rows. */
.index { border-top: 2px solid var(--ink); }
.index-row {
  display: grid; grid-template-columns: 44px 260px 1fr;
  gap: 24px; padding: 26px 0; border-bottom: 1px solid var(--rule);
  align-items: start;
}
.index-row svg { color: var(--teal); margin-top: 2px; }
.index-row p { margin: 0; color: var(--muted); max-width: 60ch; }
.langs { font-family: var(--display); font-weight: 700; color: var(--ink); }

/* Offline band */
.offline { background: var(--ink); color: #e8eaf6; }
.offline h2 { color: #fff; }
.offline .section-head p { color: #c5cae9; }
.steps {
  list-style: none; margin: 0; padding: 0; counter-reset: step;
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 32px;
}
.steps li { counter-increment: step; border-top: 1px solid rgba(255,255,255,.25); padding-top: 20px; }
.steps li::before {
  content: counter(step);
  display: inline-grid; place-items: center; width: 32px; height: 32px;
  border-radius: 50%; background: var(--teal-soft); color: var(--ink-deep);
  font: 800 0.95rem/1 var(--display); margin-bottom: 14px;
}
.steps h3 { color: #fff; }
.steps p { margin: 0; color: #c5cae9; }

/* Coming next */
.next .wrap { display: grid; grid-template-columns: 1fr 1fr; gap: 56px; align-items: center; }
.next ul { margin: 0; padding: 0; list-style: none; display: grid; gap: 18px; }
.next li { display: grid; grid-template-columns: 40px 1fr; gap: 14px; }
.next li svg { color: var(--teal); }
.next li p { margin: 0; color: var(--muted); }
.chat {
  background: var(--paper); border-radius: var(--radius-l);
  border: 1px solid var(--line); padding: 24px; display: grid; gap: 12px;
}
.bubble { max-width: 85%; padding: 12px 16px; border-radius: 18px; font-size: 0.98rem; }
.bubble.me { justify-self: end; background: var(--ink); color: #fff; border-bottom-right-radius: 6px; }
.bubble.ai { background: #eef0f8; color: var(--text); border-bottom-left-radius: 6px; }
.draft {
  border: 1.5px dashed var(--rule); border-radius: 12px; padding: 14px 16px;
  display: grid; grid-template-columns: 1fr auto; gap: 4px 12px; font-size: 0.95rem;
}
.draft b { font-family: var(--display); color: var(--ink); }
.draft .out { color: var(--out); font-weight: 600; font-variant-numeric: tabular-nums; }
.draft small { grid-column: 1 / -1; color: var(--muted); }
.tag { display: inline-block; font-size: 0.85rem; font-weight: 600; color: var(--teal); margin-bottom: 10px; }

/* Plans */
.plans { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; }
.plan {
  background: var(--paper); border: 1px solid var(--line);
  border-radius: var(--radius-l); padding: 32px;
}
.plan.later { background: transparent; border-style: dashed; border-color: var(--rule); }
.plan .price { font: 800 2.25rem/1 var(--display); color: var(--ink); margin: 8px 0 6px; letter-spacing: -0.03em; }
.plan .price small { font: 500 1rem var(--body); color: var(--muted); letter-spacing: 0; }
.plan ul { margin: 20px 0 0; padding-left: 20px; color: var(--muted); }
.plan li + li { margin-top: 6px; }

/* Contact */
.contact { padding-top: 24px; }
.contact .box {
  background: var(--paper); border: 1px solid var(--line);
  border-radius: var(--radius-l); padding: 48px;
  display: grid; grid-template-columns: 1.4fr 1fr; gap: 32px; align-items: center;
}
.contact .box p { color: var(--muted); margin: 0; }
.contact .actions { display: flex; flex-wrap: wrap; gap: 12px; justify-content: flex-end; }

/* Footer */
.site-foot { padding: 40px 0 56px; color: var(--muted); font-size: 0.95rem; }
.site-foot .wrap { display: flex; flex-wrap: wrap; gap: 16px 32px; justify-content: space-between; }
.site-foot nav { display: flex; gap: 24px; flex-wrap: wrap; }
.site-foot a { color: var(--muted); }

/* Legal pages */
.doc { padding: 56px 0 80px; }
.doc .wrap { max-width: 720px; }
.doc h1 { font: 800 2.5rem/1.1 var(--display); color: var(--ink); letter-spacing: -0.03em; margin: 0 0 8px; }
.doc h2 { font-size: 1.4rem; margin: 36px 0 8px; }
.doc .updated { color: var(--muted); margin: 0 0 24px; }

/* ── Responsive ─────────────────────────────────────────── */
@media (max-width: 900px) {
  .nav a:not(.btn) { display: none; }
  .hero { padding: 40px 0 72px; }
  .hero .wrap, .next .wrap, .contact .box { grid-template-columns: 1fr; }
  .hero .wrap { gap: 48px; }
  .ledger { transform: none; }
  .offline-chip { transform: none; }
  .steps { grid-template-columns: 1fr; gap: 24px; }
  .plans { grid-template-columns: 1fr; }
  .index-row { grid-template-columns: 36px 1fr; gap: 6px 16px; }
  .index-row p { grid-column: 2; }
  .contact .actions { justify-content: flex-start; }
  .contact .box { padding: 32px 24px; }
  section { padding: 64px 0; }
}
@media (max-width: 520px) {
  /* Phone: entry + amount per line; the balance shows on the total. */
  .ledger {
    padding: 0 16px 28px 44px;
    background:
      linear-gradient(90deg, transparent 28px, var(--margin) 28px, var(--margin) 30px, transparent 30px),
      repeating-linear-gradient(180deg, var(--paper) 0 47px, var(--rule) 47px 48px);
  }
  .ledger-head span { display: none; }
  .ledger-head strong { font-size: 1.1rem; }
  .ledger li { grid-template-columns: minmax(0, 1fr) auto; }
  .ledger li .bal { display: none; }
  .ledger .total .bal { display: block; }
  .ledger .total span:nth-child(2) { display: none; }
  .offline-chip { right: 12px; font-size: 0.85rem; }
  .site-head .btn { padding: 0 14px; }
}
