/* ============================================================
   Ledgerly — THEME / DESIGN SYSTEM  (shared by EVERY page)
   ------------------------------------------------------------
   Link this on every page BEFORE any page-specific stylesheet:
     <link rel="stylesheet" href="theme.css" />
   Fonts (load in <head>): Plus Jakarta Sans (headings) + Manrope (body)
   Do not redefine tokens, fonts or colors on individual pages —
   change them here so the whole site stays consistent.
   ============================================================ */

:root {
  /* brand — sampled from the real Ledgerly app */
  --ink: #102a24;
  --ink-soft: #2f4640;
  --muted: #5f756e;
  --bg: #ffffff;
  --bg-soft: #f4f9f7;
  --mint: #ccfbf1;
  --mint-50: #f0fdfa;
  --mint-100: #e3f7f1;
  --primary: #0f766e;
  --primary-dark: #0b5750;
  --primary-ink: #134e48;
  --amber: #b5640f;
  --red: #d2433d;
  --positive: #15803d;
  --line: #e4ede9;
  --line-strong: #d4e2dc;
  /* radii + shadows */
  --radius-xl: 28px;
  --radius-lg: 20px;
  --radius-md: 14px;
  --shadow-sm: 0 2px 8px rgba(16, 42, 36, 0.05);
  --shadow-md: 0 18px 40px rgba(16, 42, 36, 0.08);
  --shadow-lg: 0 30px 70px rgba(16, 42, 36, 0.12);
  /* layout + type */
  --max: 1140px;
  --font-head: "Plus Jakarta Sans", -apple-system, BlinkMacSystemFont, sans-serif;
  --font-body: "Manrope", -apple-system, BlinkMacSystemFont, sans-serif;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; font-size: 15px; -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: var(--font-body);
  color: var(--ink);
  background: var(--bg);
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }

.shell { width: min(var(--max), calc(100% - 40px)); margin: 0 auto; }

h1, h2, h3 {
  font-family: var(--font-head);
  letter-spacing: -0.03em;
  line-height: 1.08;
  margin: 0;
  font-weight: 700;
}
p { margin: 0; }

/* --------- kicker / eyebrow pill --------- */
.kicker {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  width: fit-content;
  padding: 7px 13px;
  border-radius: 999px;
  background: var(--mint-50);
  border: 1px solid var(--line);
  color: var(--primary);
  font-weight: 700;
  font-size: 0.78rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
.kicker::before { content: ""; width: 6px; height: 6px; border-radius: 999px; background: var(--primary); }

/* --------- buttons --------- */
.btn, .btn-ghost, .btn-light {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  min-height: 48px;
  padding: 0 22px;
  border-radius: 12px;
  font-family: var(--font-body);
  font-weight: 700;
  font-size: 0.96rem;
  cursor: pointer;
  transition: transform 0.18s ease, box-shadow 0.18s ease, background 0.18s ease, border-color 0.18s ease;
  white-space: nowrap;
}
.btn { background: var(--primary); color: #fff; box-shadow: 0 10px 22px rgba(15, 118, 110, 0.22); }
.btn:hover { background: var(--primary-dark); transform: translateY(-2px); }
.btn-ghost { background: #fff; color: var(--ink); border: 1px solid var(--line-strong); }
.btn-ghost:hover { border-color: var(--primary); color: var(--primary); transform: translateY(-2px); }
.btn-light { background: rgba(255,255,255,0.14); color: #eafdf8; border: 1px solid rgba(204, 251, 241, 0.22); }
.btn-light:hover { background: rgba(255,255,255,0.22); transform: translateY(-2px); }
.btn svg, .btn-ghost svg, .btn-light svg { width: 18px; height: 18px; }

/* ============ HEADER + NAV (shared) ============ */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(255,255,255,0.82);
  backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--line);
}
.nav-bar { display: flex; align-items: center; gap: 22px; min-height: 72px; }
.brand { display: inline-flex; align-items: center; gap: 10px; flex: 0 0 auto; }
.brand img { width: 34px; height: 34px; border-radius: 9px; }
.brand span { font-family: var(--font-head); font-weight: 800; font-size: 1.22rem; letter-spacing: -0.03em; color: var(--primary-ink); }
.nav-links {
  display: flex;
  align-items: center;
  gap: 6px;
  flex: 1 1 auto;
  justify-content: center;
  font-weight: 600;
  font-size: 0.92rem;
  color: var(--ink-soft);
}
.nav-links > a, .nav-parent { padding: 8px 12px; border-radius: 9px; white-space: nowrap; transition: background 0.15s ease, color 0.15s ease; }
.nav-links > a:hover, .nav-parent:hover { background: var(--mint-50); color: var(--primary); }
.nav-group { position: relative; }
.nav-parent { display: inline-flex; align-items: center; gap: 4px; cursor: default; user-select: none; }
.nav-parent::after { content: "⌄"; font-size: 0.9em; margin-top: -3px; opacity: 0.6; }
.nav-dropdown {
  display: none;
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  min-width: 230px;
  padding: 8px;
  border-radius: 16px;
  background: #fff;
  border: 1px solid var(--line);
  box-shadow: var(--shadow-md);
  flex-direction: column;
  gap: 2px;
}
.nav-group:hover .nav-dropdown, .nav-group:focus-within .nav-dropdown { display: flex; }
.nav-dropdown a { padding: 9px 12px; border-radius: 9px; font-size: 0.88rem; font-weight: 600; color: var(--ink-soft); }
.nav-dropdown a:hover { background: var(--mint-50); color: var(--primary); }
.nav-actions { display: flex; align-items: center; gap: 10px; flex: 0 0 auto; }
.nav-actions .btn, .nav-actions .btn-ghost { min-height: 42px; padding: 0 16px; font-size: 0.88rem; }
.nav-toggle { display: none; flex-direction: column; gap: 5px; background: none; border: none; cursor: pointer; padding: 8px; margin-left: auto; }
.nav-toggle span { width: 22px; height: 2px; background: var(--ink); border-radius: 2px; transition: 0.25s ease; }
.nav-toggle[aria-expanded="true"] span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.nav-toggle[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
.nav-toggle[aria-expanded="true"] span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* ============ SECTION SCAFFOLD (shared) ============ */
.section { padding: 70px 0; }
.section.tint { background: var(--bg-soft); }
.section-head { max-width: 680px; margin: 0 auto 44px; text-align: center; }
.section-head.left { margin-left: 0; text-align: left; }
.section-head h2 { font-size: clamp(1.5rem, 2.7vw, 2.15rem); margin: 13px 0 0; }
.section-head p { margin-top: 13px; color: var(--muted); font-size: 0.98rem; line-height: 1.6; }
.section-head .kicker { margin-bottom: 0; }
.section-head.center .kicker { margin: 0 auto; }

/* ============ DEVICE FRAMES (shared, reusable) ============ */
.phone {
  position: relative;
  width: 264px;
  aspect-ratio: 722 / 1600;
  border-radius: 36px;
  padding: 7px;
  background: linear-gradient(160deg, #16433b, #0c2a25);
  box-shadow: var(--shadow-lg);
  z-index: 1;
}
.phone img { width: 100%; height: 100%; object-fit: cover; border-radius: 29px; }

.browser {
  border-radius: 16px;
  overflow: hidden;
  border: 1px solid var(--line-strong);
  box-shadow: var(--shadow-lg);
  background: #fff;
}
.browser-bar { display: flex; align-items: center; gap: 14px; padding: 11px 16px; background: #eef4f2; border-bottom: 1px solid var(--line); }
.browser-dots { display: flex; gap: 7px; flex: 0 0 auto; }
.browser-dots i { width: 11px; height: 11px; border-radius: 999px; background: #cdd9d4; }
.browser-url {
  flex: 1 1 auto;
  max-width: 320px;
  padding: 6px 14px;
  border-radius: 999px;
  background: #fff;
  border: 1px solid var(--line);
  color: var(--muted);
  font-size: 0.8rem;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 7px;
}
.browser-url svg { width: 12px; height: 12px; color: var(--positive); }
.browser img { width: 100%; display: block; }

/* ============ FOOTER (shared) ============ */
.footer { padding: 64px 0 36px; background: var(--bg-soft); border-top: 1px solid var(--line); }
.footer-grid { display: grid; grid-template-columns: 1.6fr 1fr 1fr 1fr; gap: 36px; }
.footer-brand .brand { margin-bottom: 14px; }
.footer-brand p { color: var(--muted); line-height: 1.65; font-size: 0.92rem; max-width: 34ch; }
.footer-brand a { color: var(--primary); font-weight: 600; }
.footer-col h4 { font-family: var(--font-head); font-size: 0.78rem; text-transform: uppercase; letter-spacing: 0.06em; color: var(--primary-ink); margin: 0 0 14px; }
.footer-col a { display: block; padding: 5px 0; color: var(--muted); font-size: 0.9rem; font-weight: 600; }
.footer-col a:hover { color: var(--primary); }
.footer-col h4.mt { margin-top: 20px; }
.footer-bottom { margin-top: 40px; padding-top: 22px; border-top: 1px solid var(--line); color: var(--muted); font-size: 0.86rem; }

/* mobile sticky CTA (shared) */
.mobile-cta { display: none; }
.mobile-cta .btn { width: 100%; min-height: 54px; box-shadow: var(--shadow-lg); }

/* ============ REVEAL-ON-SCROLL (shared) ============ */
.reveal { opacity: 0; transform: translateY(22px); transition: opacity 0.6s ease, transform 0.6s ease; }
.reveal.in { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) { .reveal { opacity: 1; transform: none; transition: none; } }

/* ============ SHARED RESPONSIVE (nav / footer / cta) ============ */
@media (max-width: 1000px) {
  .nav-links, .nav-actions { display: none; }
  .nav-toggle { display: flex; }
  .nav-links.open {
    display: flex;
    position: absolute;
    top: 72px; left: 0; right: 0;
    flex-direction: column;
    align-items: stretch;
    gap: 2px;
    padding: 14px 20px 20px;
    background: #fff;
    border-bottom: 1px solid var(--line);
    box-shadow: var(--shadow-md);
  }
  .nav-links.open > a, .nav-links.open .nav-parent { padding: 12px 10px; }
  .nav-links.open .nav-group { width: 100%; }
  .nav-links.open .nav-dropdown { display: none; position: static; box-shadow: none; border: none; padding: 0 0 6px 14px; min-width: 0; }
  .nav-links.open .nav-group.open-sub .nav-dropdown { display: flex; }
  /* keep a reachable primary CTA once the desktop actions are hidden */
  .mobile-cta { display: block; position: fixed; left: 14px; right: 14px; bottom: 14px; z-index: 40; }
  .footer { padding-bottom: 96px; }
}
@media (max-width: 620px) {
  .shell { width: calc(100% - 32px); }
  .section { padding: 52px 0; }
  .footer-grid { grid-template-columns: 1fr; }
  .nav-bar { gap: 12px; }
}
