:root {
  --bg: #ffffff;
  --bg-soft: #f5f7fa;
  --ink: #16202c;
  --ink-soft: #4a5868;
  --line: #e2e7ee;
  --brand: #1e3a5f;
  --brand-ink: #ffffff;
  --accent: #188038;
  --accent-ink: #ffffff;
  --accent-soft: #e6f4ea;
  --highlight: #fef7e0;
  --radius: 12px;
  --shadow: 0 1px 2px rgba(16, 24, 40, 0.06), 0 12px 32px rgba(16, 24, 40, 0.08);
  --font: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0f151c;
    --bg-soft: #16202b;
    --ink: #e8edf3;
    --ink-soft: #a3b0bf;
    --line: #273342;
    --brand: #8fb4e3;
    --brand-ink: #0f151c;
    --accent: #5bb974;
    --accent-ink: #0f151c;
    --accent-soft: #173524;
    --highlight: #3a3218;
    --shadow: 0 1px 2px rgba(0, 0, 0, 0.3), 0 12px 32px rgba(0, 0, 0, 0.35);
    color-scheme: dark;
  }
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 16px/1.6 var(--font); -webkit-font-smoothing: antialiased; }
img, svg { max-width: 100%; }
a { color: var(--brand); }
h1, h2, h3 { line-height: 1.2; margin: 0 0 12px; letter-spacing: -0.01em; }
h1 { font-size: clamp(2rem, 5vw, 3.25rem); letter-spacing: -0.02em; }
h2 { font-size: clamp(1.6rem, 3.5vw, 2.25rem); }
h3 { font-size: 1.1rem; }
p { margin: 0 0 12px; }

.wrap { width: 100%; max-width: 1120px; margin: 0 auto; padding: 0 16px; }
@media (min-width: 720px) { .wrap { padding: 0 32px; } }

/* Header */
.site-header { position: sticky; top: 0; z-index: 10; background: color-mix(in srgb, var(--bg) 88%, transparent); backdrop-filter: blur(8px); border-bottom: 1px solid var(--line); }
.site-header .brand, .site-header .btn { flex-shrink: 0; }
.site-header .wrap { display: flex; align-items: center; justify-content: space-between; height: 64px; gap: 16px; }
.brand { display: flex; align-items: center; gap: 10px; font-weight: 700; color: var(--ink); text-decoration: none; }
.brand svg { width: 28px; height: 28px; }
.nav { display: flex; align-items: center; gap: 20px; }
.nav a { color: var(--ink-soft); text-decoration: none; font-size: 0.95rem; }
.nav a:hover { color: var(--ink); }
.nav a.btn-primary, .nav a.btn-primary:hover { color: var(--accent-ink); }
@media (max-width: 640px) { .nav .nav-link { display: none; } }

/* Buttons */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 44px; padding: 10px 20px; border-radius: 999px; font-weight: 600; text-decoration: none; border: 1px solid transparent; transition: transform 0.15s ease, background 0.15s ease; }
.btn:focus-visible { outline: 3px solid color-mix(in srgb, var(--accent) 50%, transparent); outline-offset: 2px; }
.btn-primary { background: var(--accent); color: var(--accent-ink); }
.btn-primary:hover { transform: translateY(-1px); background: color-mix(in srgb, var(--accent) 88%, #000); }
.btn-ghost { background: transparent; color: var(--ink); border-color: var(--line); }
.btn-ghost:hover { background: var(--bg-soft); }
.btn-sm { min-height: 36px; padding: 6px 14px; font-size: 0.9rem; }

/* Hero */
.hero { padding: 56px 0 72px; }
.hero .wrap { display: grid; gap: 48px; align-items: center; }
.hero .wrap > * { min-width: 0; }
@media (min-width: 960px) { .hero .wrap { grid-template-columns: minmax(0, 1fr) minmax(0, 1.05fr); } }
.eyebrow { display: inline-block; background: var(--accent-soft); color: var(--accent); font-weight: 600; font-size: 0.85rem; padding: 4px 12px; border-radius: 999px; margin-bottom: 16px; }
.lede { font-size: 1.15rem; color: var(--ink-soft); max-width: 36em; }
.cta-row { display: flex; flex-wrap: wrap; gap: 12px; margin: 24px 0 12px; }
.fineprint { color: var(--ink-soft); font-size: 0.875rem; }

/* Hero demo: sheet row -> invoice */
.demo { position: relative; display: grid; gap: 16px; }
.sheet { background: var(--bg); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); overflow: hidden; font-size: 0.8rem; }
.sheet table { width: 100%; border-collapse: collapse; }
.sheet th { background: var(--brand); color: var(--brand-ink); text-align: left; padding: 8px 10px; font-weight: 600; white-space: nowrap; }
.sheet td { padding: 8px 10px; border-top: 1px solid var(--line); white-space: nowrap; }
.sheet tr.selected td { background: var(--highlight); }
.sheet .num { text-align: right; font-variant-numeric: tabular-nums; }
.sheet .link { color: var(--accent); font-weight: 600; }
.sheet .scroll { overflow-x: auto; }
@media (max-width: 520px) { .sheet .hide-sm { display: none; } }
.pill { display: inline-block; padding: 1px 8px; border-radius: 999px; font-size: 0.75rem; font-weight: 600; background: #fef7e0; color: #b06000; }
.pill.paid { background: #e6f4ea; color: #137333; }

.invoice { background: #fff; color: #1f2933; border-radius: var(--radius); box-shadow: var(--shadow); overflow: hidden; max-width: 420px; justify-self: end; width: 100%; font-size: 0.8rem; }
.invoice .band { background: #1e3a5f; color: #fff; padding: 16px 20px; display: flex; justify-content: space-between; align-items: center; }
.invoice .band strong { font-size: 1rem; }
.invoice .band span { color: #c8d6e5; }
.invoice .body { padding: 16px 20px; }
.invoice .meta { display: flex; justify-content: space-between; gap: 12px; color: #52606d; margin-bottom: 12px; }
.invoice .label { display: block; font-size: 0.65rem; text-transform: uppercase; letter-spacing: 0.08em; color: #7b8794; }
.invoice table { width: 100%; border-collapse: collapse; }
.invoice td { padding: 6px 0; border-bottom: 1px solid #e4e7eb; }
.invoice td:last-child { text-align: right; font-variant-numeric: tabular-nums; }
.invoice .total td { border: 0; font-weight: 700; font-size: 0.95rem; padding-top: 10px; }
.arrow { justify-self: center; color: var(--ink-soft); font-size: 0.85rem; display: flex; align-items: center; gap: 8px; }
.arrow svg { width: 20px; height: 20px; }

/* Sections */
section { padding: 72px 0; }
.soft { background: var(--bg-soft); }
.section-head { max-width: 640px; margin-bottom: 40px; }
.section-head p { color: var(--ink-soft); font-size: 1.05rem; }
.center { text-align: center; margin-left: auto; margin-right: auto; }

.steps { display: grid; gap: 20px; counter-reset: step; }
@media (min-width: 800px) { .steps { grid-template-columns: repeat(3, 1fr); } }
.step { background: var(--bg); border: 1px solid var(--line); border-radius: var(--radius); padding: 24px; }
.step::before { counter-increment: step; content: counter(step); display: inline-grid; place-items: center; width: 32px; height: 32px; border-radius: 50%; background: var(--brand); color: var(--brand-ink); font-weight: 700; margin-bottom: 12px; }
.step p { color: var(--ink-soft); margin: 0; }

.features { display: grid; gap: 28px; }
@media (min-width: 640px) { .features { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 960px) { .features { grid-template-columns: repeat(3, 1fr); } }
.feature svg { width: 28px; height: 28px; color: var(--accent); margin-bottom: 8px; }
.feature p { color: var(--ink-soft); margin: 0; }

/* Pricing */
.billing-toggle { display: inline-flex; border: 1px solid var(--line); border-radius: 999px; padding: 4px; margin-bottom: 32px; background: var(--bg); }
.billing-toggle button { font: inherit; font-size: 0.9rem; border: 0; background: transparent; color: var(--ink-soft); padding: 6px 16px; border-radius: 999px; cursor: pointer; min-height: 36px; }
.billing-toggle button[aria-pressed="true"] { background: var(--brand); color: var(--brand-ink); }
.plans { display: grid; gap: 20px; max-width: 820px; margin: 0 auto; text-align: left; }
@media (min-width: 720px) { .plans { grid-template-columns: 1fr 1fr; } }
.plan { background: var(--bg); border: 1px solid var(--line); border-radius: var(--radius); padding: 28px; display: flex; flex-direction: column; }
.plan.featured { border: 2px solid var(--accent); box-shadow: var(--shadow); }
.plan .price { font-size: 2.5rem; font-weight: 700; letter-spacing: -0.02em; margin: 8px 0 0; }
.plan .price small { font-size: 1rem; font-weight: 500; color: var(--ink-soft); }
.plan .note { color: var(--ink-soft); font-size: 0.9rem; min-height: 1.6em; }
.plan ul { list-style: none; padding: 0; margin: 20px 0 24px; flex: 1; }
.plan li { padding: 6px 0 6px 28px; position: relative; }
.plan li::before { content: ""; position: absolute; left: 0; top: 11px; width: 16px; height: 16px; border-radius: 50%; background: var(--accent-soft) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='M4 8.5l2.5 2.5L12 5.5' fill='none' stroke='%23188038' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center/12px no-repeat; }
.badge { display: inline-block; background: var(--accent); color: var(--accent-ink); font-size: 0.75rem; font-weight: 700; padding: 2px 10px; border-radius: 999px; margin-left: 8px; vertical-align: middle; }

/* FAQ */
.faq { max-width: 760px; margin: 0 auto; }
.faq details { border-bottom: 1px solid var(--line); padding: 16px 0; }
.faq summary { cursor: pointer; font-weight: 600; list-style: none; display: flex; justify-content: space-between; gap: 16px; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; color: var(--ink-soft); font-size: 1.25rem; line-height: 1; }
.faq details[open] summary::after { content: "–"; }
.faq details p { color: var(--ink-soft); margin: 12px 0 0; }

.final-cta { text-align: center; }
.final-cta .cta-row { justify-content: center; }

/* Footer */
.site-footer { border-top: 1px solid var(--line); padding: 32px 0; color: var(--ink-soft); font-size: 0.9rem; }
.site-footer .wrap { display: flex; flex-wrap: wrap; gap: 16px; justify-content: space-between; align-items: center; }
.site-footer nav { display: flex; gap: 20px; flex-wrap: wrap; }
.site-footer a { color: var(--ink-soft); }

/* Legal pages */
.legal { max-width: 760px; padding: 48px 16px 72px; }
.legal h1 { font-size: clamp(1.8rem, 4vw, 2.5rem); }
.legal h2 { font-size: 1.3rem; margin-top: 36px; }
.legal p, .legal li { color: var(--ink-soft); }
.legal ul { padding-left: 20px; }
.legal .updated { color: var(--ink-soft); font-size: 0.9rem; }
.legal table { width: 100%; border-collapse: collapse; margin: 12px 0; font-size: 0.95rem; }
.legal th, .legal td { text-align: left; border-bottom: 1px solid var(--line); padding: 8px 8px 8px 0; vertical-align: top; }
.legal th { color: var(--ink); }
mark.todo { background: #ffe58f; color: #3c2a00; padding: 0 4px; border-radius: 4px; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .btn { transition: none; }
}
