:root {
  --bg: #f7f1e8;
  --surface: #fffaf3;
  --surface-subtle: #efe7dc;
  --ink: #2b2622;
  --ink-muted: #5c534c;
  --accent: #2c5f4e;
  --accent-hover: #224b3d;
  --accent-soft: #e7f1ec;
  --border: #e6d9c8;
  --amber-bg: #fbf2e1;
  --amber-ink: #6e4b16;
  --amber-border: #e5cfa3;
  --focus-ring: #1f5c4a;

  /* Local-only font stacks. No WOFF2 is bundled yet; see README. */
  --font-display: Georgia, "Iowan Old Style", "Palatino Linotype", serif;
  --font-body: ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-mono: ui-monospace, SFMono-Regular, Menlo, monospace;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 88px; -webkit-text-size-adjust: 100%; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 17px;
  line-height: 1.65;
  overflow-x: hidden;
}
h1, h2, h3, p, ul { margin: 0; }
ul { padding: 0; list-style: none; }
svg { display: block; max-width: 100%; }

h1, h2 { font-family: var(--font-display); font-weight: 600; color: var(--ink); text-wrap: balance; }
h1 { font-size: clamp(2.25rem, 4.5vw, 3.5rem); letter-spacing: -0.02em; line-height: 1.12; }
h2 { font-size: clamp(1.6rem, 2.8vw, 2.15rem); letter-spacing: -0.015em; line-height: 1.2; }
h3 { font-family: var(--font-body); font-size: 1.06rem; font-weight: 650; line-height: 1.35; color: var(--ink); }

.code { font-family: var(--font-mono); font-variant-numeric: tabular-nums; font-size: 0.9em; white-space: nowrap; }

.wrap { width: 100%; max-width: 64rem; margin-inline: auto; padding-inline: 1.25rem; }
@media (min-width: 640px) { .wrap { padding-inline: 2rem; } }

:focus-visible { outline: 2px solid var(--focus-ring); outline-offset: 3px; border-radius: 6px; }

.skip-link {
  position: absolute; inset-inline-start: 0.75rem; top: -4rem; z-index: 100;
  min-height: 44px; display: inline-flex; align-items: center; padding: 0 1rem;
  background: var(--accent); color: #fff; font-weight: 600; text-decoration: none; border-radius: 10px;
}
.skip-link:focus { top: 0.75rem; }

/* Buttons & links */
.btn {
  display: inline-flex; align-items: center; justify-content: center; text-align: center;
  min-height: 48px; min-width: 44px; padding: 0.5rem 1.35rem;
  border-radius: 999px; font-weight: 600; font-size: 1rem; line-height: 1.3; text-decoration: none;
  border: 1.5px solid transparent;
  transition: background-color .15s ease, border-color .15s ease;
}
.btn-primary { background: var(--accent); color: #fff; }
.btn-primary:hover { background: var(--accent-hover); }
.btn-ghost { padding-inline: 0.25rem; justify-content: flex-start; color: var(--accent); border-color: transparent; text-decoration: underline; text-underline-offset: 4px; text-decoration-thickness: 1.5px; }
.btn-ghost:hover { color: var(--accent-hover); background: var(--accent-soft); }
.btn-pill { min-height: 44px; padding: 0.4rem 1.1rem; font-size: 0.95rem; white-space: nowrap; }
.btn-lg { min-height: 52px; padding-inline: 1.75rem; }

/* Header */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: color-mix(in srgb, var(--bg) 94%, transparent);
  border-bottom: 1px solid var(--border);
  backdrop-filter: blur(6px);
}
.nav { display: flex; align-items: center; justify-content: space-between; gap: 1rem; min-height: 68px; }
.brand { display: inline-flex; align-items: center; gap: 0.6rem; min-height: 44px; color: var(--ink); text-decoration: none; }
.wordmark { font-family: var(--font-display); font-weight: 600; font-size: 1.15rem; letter-spacing: -0.01em; }
.nav-right { display: flex; align-items: center; gap: 1.25rem; }
.nav-links { display: none; align-items: center; gap: 0.25rem; }
.nav-links a {
  display: inline-flex; align-items: center; min-height: 44px; padding: 0 0.7rem;
  color: var(--ink-muted); text-decoration: none; font-size: 0.95rem; font-weight: 500; border-radius: 8px;
}
.nav-links a:hover { color: var(--ink); background: var(--surface-subtle); }
@media (min-width: 900px) { .nav-links { display: flex; } }
@media (max-width: 380px) { .wordmark { font-size: 1.05rem; } .brand { gap: 0.45rem; } .btn-pill { padding-inline: 0.9rem; } }

/* Pills & chips */
.pill {
  display: inline-flex; align-items: center; min-height: 32px; padding: 0.15rem 0.85rem;
  border-radius: 999px; font-size: 0.875rem; font-weight: 600; line-height: 1.3; border: 1px solid transparent;
}
.pill-amber { background: var(--amber-bg); color: var(--amber-ink); border-color: var(--amber-border); }
.pill-sage { background: var(--accent-soft); color: var(--accent); border-color: #c4dccf; }
.chip {
  display: inline-flex; align-items: center; padding: 0.3rem 0.8rem; border-radius: 999px;
  background: var(--surface-subtle); color: var(--ink); border: 1px solid var(--border);
  font-size: 0.875rem; font-weight: 500; line-height: 1.35;
}
.chip-mono { font-family: var(--font-mono); font-variant-numeric: tabular-nums; font-size: 0.85rem; }

/* Hero */
.hero { padding-block: 2.75rem 3.25rem; }
.hero-grid { display: grid; gap: 2.5rem; }
.hero-copy { display: flex; flex-direction: column; align-items: flex-start; gap: 1.25rem; }
.lede { font-size: 1.1rem; color: var(--ink-muted); max-width: 62ch; }
.cta-row { width: 100%; display: flex; flex-wrap: wrap; align-items: center; gap: 0.5rem 1rem; }
.micro { font-size: 14px; line-height: 1.5; color: var(--ink-muted); max-width: 62ch; }
.preview-card {
  background: var(--surface); border: 1px solid var(--border); border-radius: 20px;
  padding: 1.25rem; box-shadow: 0 1px 2px rgba(80, 56, 28, .06), 0 14px 32px -14px rgba(80, 56, 28, .22);
  max-width: 26rem; margin-inline: auto;
}
.preview-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 0.5rem; }
.preview-diagram { margin-block: 1rem; padding: 1rem; background: var(--surface-subtle); border-radius: 14px; border: 1px solid var(--border); }
.fractions { width: 100%; height: auto; }
.preview-chips { display: flex; flex-wrap: wrap; gap: 0.5rem; }
@media (min-width: 1024px) {
  .hero { padding-block: 4.5rem 5rem; }
  .hero-grid { grid-template-columns: repeat(12, minmax(0, 1fr)); align-items: center; gap: 2rem; }
  .hero-copy { grid-column: span 7; }
  .hero-preview { grid-column: span 5; }
  .preview-card { margin-inline: 0; max-width: none; }
}

/* Sections */
.section { padding-block: 3.5rem; }
.section-recessed { background: var(--surface-subtle); border-block: 1px solid var(--border); }
.section-surface { background: var(--surface); border-block: 1px solid var(--border); }
.section .wrap > h2 { margin-top: 0.5rem; max-width: 36ch; }
.eyebrow { font-size: 0.8125rem; font-weight: 700; letter-spacing: 0.1em; color: var(--accent); line-height: 1.4; }
.prose { max-width: 62ch; color: var(--ink-muted); margin-top: 1rem; }
.grid { display: grid; gap: 1rem; margin-top: 2rem; }
.card {
  background: var(--surface); border: 1px solid var(--border); border-radius: 16px; padding: 1.4rem 1.4rem 1.5rem;
  display: flex; flex-direction: column; gap: 0.6rem;
}
.section-recessed .card { background: var(--surface); }
.card p { color: var(--ink-muted); }
.status { font-weight: 600; color: var(--accent); font-size: 0.9rem; white-space: nowrap; }
@media (min-width: 640px) {
  .section { padding-block: 4.5rem; }
  .grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1.25rem; }
}
@media (min-width: 1024px) {
  .grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

/* Privacy checklist */
.checklist li { display: flex; gap: 0.9rem; align-items: flex-start; padding: 1.2rem 1.25rem; background: var(--bg); border: 1px solid var(--border); border-radius: 16px; }
.checklist .tick { flex: none; margin-top: 2px; }
.checklist p { color: var(--ink-muted); margin-top: 0.25rem; }

/* CTA band */
.cta-band { text-align: center; }
.cta-inner { display: flex; flex-direction: column; align-items: center; gap: 1.1rem; }
.cta-inner h2 { max-width: 28ch; margin-top: 0; }
.cta-inner .prose { margin-top: 0; }
.place { font-size: 0.95rem; color: var(--ink-muted); }
.btn-lg { max-width: 100%; overflow-wrap: anywhere; }

/* Footer */
.site-footer { background: var(--surface-subtle); border-top: 1px solid var(--border); padding-block: 2rem 2.5rem; }
.footer-row { display: flex; flex-wrap: wrap; align-items: center; gap: 0.25rem 1.5rem; }
.footer-mail { display: inline-flex; align-items: center; min-height: 44px; color: var(--accent); font-weight: 600; text-underline-offset: 3px; }
.footer-mail:hover { color: var(--accent-hover); }
.copy { color: var(--ink-muted); font-size: 0.95rem; }
.fine { font-size: 13px; line-height: 1.55; color: var(--ink-muted); max-width: 70ch; margin-top: 0.6rem; }
.footer-row + .fine { margin-top: 0.75rem; }
@media (min-width: 900px) { .copy { margin-inline-start: auto; } }
