:root {
  /* Paper Ledger — light by default. See ../../DESIGN.md.
     Variable NAMES kept stable from the prior dark system so page markup
     doesn't need per-property rewrites, only these token values changed. */
  --surface: oklch(98% 0.007 88);
  --panel: oklch(95.5% 0.011 88);
  --panel-hover: oklch(92.5% 0.013 88);
  --line: oklch(80% 0.018 88);
  --line-strong: oklch(64% 0.02 88);

  --text-base: oklch(23% 0.02 262);
  --text: oklch(23% 0.02 262); /* alias — some pages reference --text directly */
  --text-muted: oklch(40% 0.018 262);
  --text-dim: oklch(52% 0.015 262); /* ≥4.8:1 on --panel, ≥5.2:1 on --surface (WCAG AA) */

  /* Accents */
  --accent: oklch(48% 0.1 216);       /* Cyan — Pro / diligence product path */
  --accent-fill: oklch(92% 0.035 214);
  --premium: oklch(56% 0.15 62);      /* Amber — paid compliance/report path */
  --premium-fill: oklch(93% 0.045 68);
  --verified: oklch(46% 0.1 150);     /* Provenance/credibility signal only — never a CTA color */
  --warn: oklch(62% 0.14 80);         /* Tier-badge status only ("Developing") — never a CTA */
  --warn-fill: oklch(93% 0.05 82);
  --danger: oklch(52% 0.17 25);       /* Tier-badge status only ("Priority Review") — never a CTA */
  --danger-fill: oklch(93% 0.06 25);

  --radius: 6px;

  --font-sans: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --font-serif: Georgia, "Iowan Old Style", "Palatino Linotype", "Times New Roman", serif;
  --font-mono: "JetBrains Mono", "SF Mono", Consolas, monospace;
}

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

body {
  background-color: var(--surface);
  color: var(--text-base);
  font-family: var(--font-sans);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4 {
  font-family: var(--font-serif);
  font-weight: 700;
  letter-spacing: -0.01em;
  line-height: 1.15;
}

a { color: inherit; text-decoration: none; }
a:focus-visible, button:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible {
  outline: 3px solid var(--accent);
  outline-offset: 2px;
}

/* Layout */
.app-container {
  max-width: 1400px;
  margin: 0 auto;
  padding: 0 2rem;
}

/* Navigation */
.top-nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1.5rem 0;
  border-bottom: 1px solid var(--line);
}

.brand {
  font-family: var(--font-serif);
  font-weight: 700;
  font-size: 1.15rem;
  letter-spacing: 0;
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

.brand-indicator {
  width: 8px;
  height: 8px;
  background-color: var(--verified);
  border-radius: 50%;
}

.nav-links {
  display: flex;
  gap: 2rem;
  font-size: 0.9rem;
  font-family: var(--font-sans);
}

.nav-links a {
  color: var(--text-muted);
  transition: color 0.2s ease;
}

.nav-links a:hover {
  color: #fff;
}

/* Hero Section */
.hero {
  padding: 6rem 0;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4rem;
  align-items: center;
}

.hero-content h1 {
  font-size: clamp(2.5rem, 5vw, 4rem);
  margin-bottom: 1.5rem;
  color: var(--text-base);
  max-width: 15ch;
}

.hero-content p {
  font-family: var(--font-sans);
  color: var(--text-muted);
  font-size: 1.25rem;
  max-width: 45ch;
  margin-bottom: 3rem;
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font: 600 12px/1 var(--font-mono);
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: var(--verified);
  background: var(--premium-fill);
  border: 1px solid oklch(70% 0.07 150);
  background: oklch(93% 0.03 150);
  padding: 6px 10px;
  border-radius: 999px;
  margin-bottom: 1.25rem;
}
.eyebrow::before { content: "\2713"; font-weight: 800; }

/* Action Strip */
.action-strip {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
  margin-bottom: 3rem;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.875rem 1.5rem;
  border-radius: var(--radius);
  font-family: var(--font-sans);
  font-size: 0.95rem;
  font-weight: 700;
  transition: all 0.2s ease;
  cursor: pointer;
  border: 1px solid transparent;
}

/* Pro / diligence path — cyan */
.btn-primary {
  background-color: var(--accent);
  border-color: var(--accent);
  color: var(--surface);
}
.btn-primary:hover { background-color: oklch(42% 0.1 216); }

/* Report / compliance path — amber */
.btn-premium {
  background-color: var(--premium);
  border-color: var(--premium);
  color: var(--surface);
}
.btn-premium:hover { background-color: oklch(50% 0.15 62); }

/* Neutral outline */
.btn-secondary {
  background-color: transparent;
  border-color: var(--line-strong);
  color: var(--text-base);
}
.btn-secondary:hover { background-color: var(--panel); }

/* Terminal-style readout, now on paper (still monospaced/dense, just not dark) */
.hero-visual {
  background-color: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 2rem;
  font-family: var(--font-mono);
  font-size: 0.85rem;
  color: var(--text-muted);
  box-shadow: 0 12px 30px oklch(23% 0.02 262 / 0.08);
}

.terminal-header {
  display: flex;
  justify-content: space-between;
  margin-bottom: 1.5rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--line);
}

.terminal-row {
  display: grid;
  grid-template-columns: 100px 1fr 100px;
  padding: 0.75rem 0;
  border-bottom: 1px solid var(--line);
}

.term-key { color: var(--text-dim); }
.term-val { color: var(--text-base); }
.term-status { color: var(--accent); text-align: right; }
.term-status.alert { color: var(--premium); }

/* Stat strip (metrics-grid) */
.metrics-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1rem;
  margin-bottom: -1rem;
}

/* The Funnels */
.funnels {
  padding: 5rem 0;
  border-top: 1px solid var(--line);
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2rem;
}

.funnel-card {
  padding: 3rem;
  background-color: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  position: relative;
  transition: border-color 0.3s ease;
}

.funnel-card:hover { border-color: var(--line-strong); }

.funnel-card:has(.btn-premium) { border-color: oklch(72% 0.09 66); background: linear-gradient(180deg, var(--premium-fill), var(--panel) 60%); }
.funnel-card:has(.btn-primary) { border-color: oklch(70% 0.07 214); background: linear-gradient(180deg, var(--accent-fill), var(--panel) 60%); }

.funnel-label {
  position: absolute;
  top: -0.75rem;
  left: 2rem;
  background-color: var(--surface);
  padding: 0 0.75rem;
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.funnel-card h3 {
  font-size: 1.75rem;
  margin-bottom: 1rem;
}

.funnel-card p {
  font-family: var(--font-sans);
  color: var(--text-muted);
  margin-bottom: 2.5rem;
}

/* Feature Grid */
.feature-section {
  padding: 6rem 0;
  border-top: 1px solid var(--line);
}

.feature-header {
  font-size: 2rem;
  margin-bottom: 4rem;
  max-width: 25ch;
}

.feature-grid {
  display: grid;
  grid-template-columns: 1fr 2fr;
  gap: 4rem;
  align-items: center;
}

.feature-text h4 {
  font-size: 1.25rem;
  margin-bottom: 1rem;
}

.feature-text p {
  font-family: var(--font-sans);
  color: var(--text-muted);
  margin-bottom: 2rem;
}

/* Open Library Search */
.search-section {
  padding: 6rem 0;
  text-align: center;
  border-top: 1px solid var(--line);
}

.search-input-wrapper {
  max-width: 600px;
  margin: 2rem auto;
  position: relative;
}

.search-input {
  width: 100%;
  padding: 1.25rem 1.5rem;
  background-color: var(--surface);
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  color: var(--text-base);
  font-size: 1.1rem;
  font-family: var(--font-sans);
}

.search-input:focus {
  border-color: var(--accent);
}
.search-input:focus:not(:focus-visible) {
  outline: none;
}

/* Billing Toggle */
.billing-toggle {
  display: inline-flex;
  background-color: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 4px;
}

.toggle-btn {
  background: transparent;
  border: none;
  border-radius: calc(var(--radius) - 2px);
  padding: 8px 16px;
  font-family: var(--font-sans);
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text-muted);
  cursor: pointer;
  transition: all 0.2s ease;
}

.toggle-btn.active {
  background-color: var(--surface);
  color: var(--accent);
  box-shadow: 0 1px 3px oklch(23% 0.02 262 / 0.05);
  border: 1px solid var(--line);
}

/* Pricing table (Pro subscriptions page) */
.pricing-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1.5rem;
  padding: 3rem 0;
}

.pricing-card {
  background-color: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 2rem;
  display: flex;
  flex-direction: column;
}

.pricing-card.featured {
  border-color: oklch(70% 0.07 214);
  background: linear-gradient(180deg, var(--accent-fill), var(--panel) 55%);
  box-shadow: 0 16px 40px oklch(23% 0.02 262 / 0.1);
}

.pricing-tier-label {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-dim);
  margin-bottom: 0.5rem;
}

.pricing-price {
  font-family: var(--font-mono);
  font-size: 2.25rem;
  font-weight: 700;
  color: var(--text-base);
  margin-bottom: 1.5rem;
}

.pricing-price span {
  font-size: 0.95rem;
  font-weight: 400;
  color: var(--text-muted);
}

.pricing-features {
  list-style: none;
  margin: 0 0 2rem;
  padding: 0;
  flex: 1;
}

.pricing-features li {
  font-family: var(--font-sans);
  font-size: 0.92rem;
  color: var(--text-muted);
  padding: 0.6rem 0;
  border-bottom: 1px solid var(--line);
}

.pricing-features li:last-child { border-bottom: none; }
.pricing-features li strong { color: var(--text-base); }

/* Config form (report configurator, contact form) */
.config-form {
  background-color: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 2rem;
}

.form-field { margin-bottom: 1.25rem; }
.form-field label {
  display: block;
  font-family: var(--font-sans);
  font-weight: 650;
  font-size: 0.85rem;
  color: var(--text-base);
  margin-bottom: 0.4rem;
}

.form-field select,
.form-field input,
.form-field textarea {
  width: 100%;
  min-height: 46px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--text-base);
  padding: 0 12px;
  font-size: 1rem;
  font-family: var(--font-sans);
}

.form-field textarea { min-height: 120px; padding: 12px; }

/* Numbered/step diagram (about page data engine) */
.step-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1.5rem;
  padding: 2rem 0;
}

.step-card {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel);
  padding: 1.75rem;
}

.step-number {
  font-family: var(--font-mono);
  font-size: 0.85rem;
  color: var(--verified);
  margin-bottom: 0.75rem;
}

.step-card h4 { font-size: 1.15rem; margin-bottom: 0.6rem; }
.step-card p { font-family: var(--font-sans); color: var(--text-muted); font-size: 0.92rem; }

/* Verification stamp — provenance signal, not a CTA */
.stamp {
  display: inline-flex;
  align-items: center;
  border: 1.5px solid var(--verified);
  color: var(--verified);
  font: 700 10.5px/1 var(--font-mono);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 5px 12px;
  border-radius: 3px;
  background: oklch(97% 0.01 150);
}

/* Footer */
.site-footer {
  padding: 3rem 0;
  border-top: 1px solid var(--line);
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1rem;
  color: var(--text-dim);
  font-size: 0.85rem;
  font-family: var(--font-sans);
}

@media (max-width: 900px) {
  .hero, .funnels, .feature-grid, .pricing-grid, .step-grid, .metrics-grid { grid-template-columns: 1fr; }
  .app-container { padding: 0 1.25rem; }
}

/* Small phones: nav wraps instead of overflowing, sections lose their
   desktop-scale padding, and CTAs go full-width for easier tapping. */
@media (max-width: 640px) {
  .top-nav {
    flex-wrap: wrap;
    row-gap: 0.75rem;
  }

  .nav-links {
    width: 100%;
    flex-wrap: wrap;
    gap: 0.6rem 1.25rem;
    font-size: 0.85rem;
  }

  .nav-links a {
    display: inline-flex;
    align-items: center;
    min-height: 44px;
    padding: 0.25rem 0;
  }

  .hero { padding: 3rem 0; gap: 2.5rem; }
  .funnels, .feature-section, .search-section { padding: 3rem 0; }

  .funnel-card, .config-form, .pricing-card, .step-card, .hero-visual {
    padding: 1.5rem;
  }

  .action-strip { flex-direction: column; align-items: stretch; }
  .action-strip .btn { width: 100%; }
}
