:root {
  --bg: #F8F7F4;
  --surface: #FFFFFF;
  --fg: #1A1A1A;
  --fg-muted: #6B6B6B;
  --fg-subtle: #9A9A9A;
  --accent: #2D6A4F;
  --accent-amber: #D4A843;
  --border: #E5E4E0;
  --green: #2D6A4F;
  --amber: #D4A843;
  --red: #C0392B;
  --font-serif: 'Playfair Display', Georgia, serif;
  --font-sans: 'DM Sans', system-ui, sans-serif;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; }

body {
  background: var(--bg);
  color: var(--fg);
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

/* — NAV — */
.nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 24px 60px;
  border-bottom: 1px solid var(--border);
}
.nav-brand {
  font-family: var(--font-serif);
  font-size: 20px;
  font-weight: 700;
  color: var(--fg);
  letter-spacing: -0.3px;
}
.nav-tagline {
  font-size: 13px;
  color: var(--fg-muted);
  font-weight: 400;
}

/* — HERO — */
.hero {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 80px;
  padding: 100px 60px 80px;
  max-width: 1200px;
  margin: 0 auto;
  align-items: center;
}
.hero-eyebrow {
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 24px;
}
.hero-headline {
  font-family: var(--font-serif);
  font-size: clamp(36px, 4vw, 58px);
  font-weight: 700;
  line-height: 1.1;
  letter-spacing: -1px;
  color: var(--fg);
  margin-bottom: 28px;
}
.hero-lede {
  font-size: 18px;
  color: var(--fg-muted);
  line-height: 1.65;
  max-width: 480px;
  font-weight: 300;
}

/* Invoice Stack */
.invoice-stack {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.invoice-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 18px 22px;
  display: flex;
  align-items: center;
  gap: 14px;
  transition: box-shadow 0.2s;
}
.invoice-card:hover {
  box-shadow: 0 4px 20px rgba(0,0,0,0.06);
}
.invoice-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  flex-shrink: 0;
}
.invoice-dot.green { background: var(--green); }
.invoice-dot.amber { background: var(--amber); }
.invoice-dot.pulse {
  background: var(--accent);
  animation: pulse 2s infinite;
}
@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.4; }
}
.invoice-info {
  flex: 1;
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.invoice-company {
  font-size: 14px;
  font-weight: 500;
  color: var(--fg);
}
.invoice-amount {
  font-size: 14px;
  font-weight: 600;
  color: var(--fg);
}
.invoice-status {
  font-size: 12px;
  color: var(--fg-muted);
  font-weight: 400;
  white-space: nowrap;
}

/* — HOW IT WORKS — */
.howitworks {
  background: var(--surface);
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  padding: 80px 60px;
}
.how-header {
  text-align: center;
  margin-bottom: 60px;
}
.section-title {
  font-family: var(--font-serif);
  font-size: 32px;
  font-weight: 700;
  color: var(--fg);
  margin-bottom: 12px;
  letter-spacing: -0.5px;
}
.section-sub {
  font-size: 16px;
  color: var(--fg-muted);
  font-weight: 300;
}
.steps {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 48px;
  max-width: 1000px;
  margin: 0 auto;
}
.step-number {
  font-family: var(--font-serif);
  font-size: 48px;
  font-weight: 800;
  color: var(--border);
  margin-bottom: 16px;
  letter-spacing: -2px;
}
.step-title {
  font-size: 18px;
  font-weight: 600;
  color: var(--fg);
  margin-bottom: 10px;
}
.step-body {
  font-size: 15px;
  color: var(--fg-muted);
  line-height: 1.6;
  font-weight: 300;
}

/* — TRANSACTION STREAM — */
.txn-stream {
  padding: 80px 60px;
  max-width: 1200px;
  margin: 0 auto;
}
.txn-header {
  margin-bottom: 48px;
}
.txn-table {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  overflow: hidden;
}
.txn-row {
  display: grid;
  grid-template-columns: 80px 1fr 120px 150px 1fr;
  padding: 16px 24px;
  align-items: center;
  border-bottom: 1px solid var(--border);
  font-size: 14px;
}
.txn-row:last-child { border-bottom: none; }
.txn-header-row {
  background: var(--bg);
  font-size: 12px;
  font-weight: 500;
  color: var(--fg-subtle);
  letter-spacing: 0.5px;
  text-transform: uppercase;
}
.txn-pos { color: var(--green); font-weight: 600; }
.txn-neg { color: var(--fg); font-weight: 600; }
.txn-tag {
  display: inline-block;
  font-size: 11px;
  font-weight: 500;
  padding: 3px 8px;
  border-radius: 4px;
}
.matched { background: #D8F0E8; color: var(--green); }
.auto-tag { background: #F0EDE8; color: #6B5B2E; }
.flag-tag { background: #FAEAEA; color: var(--red); }

/* — PRINCIPLES — */
.principles {
  background: var(--surface);
  border-top: 1px solid var(--border);
  padding: 80px 60px;
}
.principles-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 48px;
  max-width: 1000px;
  margin: 0 auto;
}
.principle-icon {
  margin-bottom: 20px;
}
.principle-title {
  font-size: 17px;
  font-weight: 600;
  color: var(--fg);
  margin-bottom: 10px;
}
.principle-body {
  font-size: 15px;
  color: var(--fg-muted);
  line-height: 1.6;
  font-weight: 300;
}

/* — CLOSING — */
.closing {
  padding: 100px 60px 80px;
  max-width: 900px;
  margin: 0 auto;
  text-align: center;
}
.closing-mark {
  font-size: 48px;
  color: var(--accent);
  font-family: var(--font-serif);
  margin-bottom: 32px;
  line-height: 1;
}
.closing-headline {
  font-family: var(--font-serif);
  font-size: clamp(26px, 3vw, 42px);
  font-weight: 700;
  line-height: 1.2;
  color: var(--fg);
  margin-bottom: 24px;
  letter-spacing: -0.5px;
}
.closing-body {
  font-size: 18px;
  color: var(--fg-muted);
  line-height: 1.65;
  font-weight: 300;
  max-width: 560px;
  margin: 0 auto;
}

/* — FOOTER — */
.footer {
  border-top: 1px solid var(--border);
  padding: 40px 60px;
  text-align: center;
}
.footer-brand {
  font-family: var(--font-serif);
  font-size: 18px;
  font-weight: 700;
  color: var(--fg);
  margin-bottom: 6px;
}
.footer-sub {
  font-size: 14px;
  color: var(--fg-muted);
  margin-bottom: 8px;
}
.footer-legal {
  font-size: 12px;
  color: var(--fg-subtle);
}

/* — RESPONSIVE — */
@media (max-width: 900px) {
  .hero {
    grid-template-columns: 1fr;
    gap: 48px;
    padding: 60px 32px;
  }
  .hero-right { order: -1; }
  .nav { padding: 20px 32px; }
  .steps { grid-template-columns: 1fr; gap: 32px; }
  .principles-grid { grid-template-columns: 1fr; gap: 32px; }
  .howitworks, .principles { padding: 60px 32px; }
  .txn-stream { padding: 60px 32px; }
  .closing { padding: 60px 32px; }
  .txn-row { grid-template-columns: 70px 1fr 90px; }
  .txn-row span:nth-child(4),
  .txn-row span:nth-child(5) { display: none; }
  .txn-header-row span:nth-child(4),
  .txn-header-row span:nth-child(5) { display: none; }
}

@media (max-width: 480px) {
  .invoice-info { flex-direction: column; align-items: flex-start; gap: 4px; }
}