@font-face {
  font-family: "EB Garamond";
  font-style: normal;
  font-weight: 400 600;
  font-display: swap;
  src: url("/fonts/eb-garamond-latin.woff2") format("woff2");
}

:root {
  --paper: #f5f3ee;
  --card: #fbfaf7;
  --ink: #15171b;
  --muted: #555960;
  --rule: #dcd7cc;
  --accent: #24412f;
  --ok: #2f6b45;
  --warn: #93560f;
  --serif: "EB Garamond", "Iowan Old Style", "Palatino Linotype", Georgia, serif;
  --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", "Helvetica Neue", Arial, sans-serif;
  --wide: 70rem;
  color-scheme: light dark;
}

@media (prefers-color-scheme: dark) {
  :root {
    --paper: #121315;
    --card: #1a1b1e;
    --ink: #ebe8e1;
    --muted: #a5a39d;
    --rule: #2c2d30;
    --accent: #a9c2ae;
    --ok: #8fc29f;
    --warn: #e0a95f;
  }
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; scroll-padding-top: 1rem; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 1.0625rem;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

a { color: inherit; text-decoration-color: var(--rule); text-underline-offset: 0.2em; text-decoration-thickness: 1px; }
a:hover { text-decoration-color: currentColor; }
a:focus-visible, button:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 2px; }
h3 { font-family: var(--serif); font-weight: 500; font-size: 1.45rem; line-height: 1.2; margin: 0 0 0.5rem; }
h1, .headline, h3 { text-wrap: balance; }

.wrap { max-width: var(--wide); margin: 0 auto; padding: 0 1.25rem; }
@media (min-width: 48rem) { .wrap { padding: 0 2.5rem; } }

/* Header */
.site-header { padding: 1.5rem 0; }
.site-header .wrap { display: flex; align-items: center; justify-content: space-between; gap: 1rem; }
.wordmark {
  font-family: var(--serif);
  font-weight: 500;
  font-size: 1.05rem;
  letter-spacing: 0.32em;
  margin-right: -0.32em;
  text-decoration: none;
  text-transform: uppercase;
}
.nav { display: flex; align-items: center; gap: 1.6rem; font-size: 0.9rem; }
.nav a { color: var(--muted); text-decoration: none; }
.nav a:hover { color: var(--ink); }
.nav a:not(.nav-cta) { display: none; }
@media (min-width: 54rem) { .nav a:not(.nav-cta) { display: inline; } }
.nav .nav-cta { color: var(--ink); border: 1px solid var(--ink); padding: 0.4rem 0.8rem; border-radius: 2px; }

/* Hero */
.hero { padding: 4rem 1.25rem 4.5rem; }
@media (min-width: 48rem) { .hero { padding: 6.5rem 2.5rem 6rem; } }
.eyebrow { font-size: 0.9rem; color: var(--muted); margin: 0 0 1.4rem; max-width: 34rem; }
.hero h1 {
  font-family: var(--serif);
  font-weight: 400;
  font-size: clamp(2.15rem, 1.4rem + 3.2vw, 3.85rem);
  line-height: 1.1;
  letter-spacing: -0.01em;
  margin: 0;
  max-width: 17em;
}
.hero .lede { margin: 1.6rem 0 0; max-width: 33rem; font-size: 1.15rem; color: var(--muted); }
.cta { margin-top: 2.25rem; display: flex; flex-wrap: wrap; align-items: center; gap: 0.75rem 1.5rem; }
.button {
  display: inline-block;
  background: var(--ink);
  color: var(--paper);
  text-decoration: none;
  padding: 0.85rem 1.35rem;
  border-radius: 2px;
  font-size: 0.95rem;
}
.button:hover { background: var(--accent); }
@media (prefers-color-scheme: dark) { .button:hover { color: #121315; } }
.cta-note { color: var(--muted); font-size: 0.95rem; margin: 0; }

/* Sections */
section { border-top: 1px solid var(--rule); padding: 4rem 0; }
@media (min-width: 48rem) { section { padding: 5.5rem 0; } }
.tag { font-size: 0.78rem; letter-spacing: 0.14em; text-transform: uppercase; color: var(--muted); margin: 0 0 0.9rem; font-weight: 500; }
.headline {
  font-family: var(--serif);
  font-weight: 400;
  font-size: clamp(1.75rem, 1.3rem + 1.7vw, 2.6rem);
  line-height: 1.15;
  margin: 0 0 2.25rem;
  max-width: 20em;
}
.intro { color: var(--muted); max-width: 34rem; margin: -1rem 0 1.5rem; }

/* What you get */
.cards { list-style: none; margin: 0; padding: 0; display: grid; gap: 1rem; }
@media (min-width: 56rem) { .cards { grid-template-columns: repeat(3, 1fr); } }
.cards li { background: var(--card); border: 1px solid var(--rule); border-radius: 3px; padding: 1.5rem; }
.cards .n { display: block; font-family: var(--serif); font-size: 1rem; color: var(--muted); margin-bottom: 1.5rem; }
.cards p { margin: 0; color: var(--muted); }

/* How it works */
.timeline { list-style: none; margin: 0; padding: 0; display: grid; gap: 0; }
.timeline li { position: relative; padding: 0 0 2rem 1.75rem; border-left: 1px solid var(--rule); margin-left: 0.4rem; }
.timeline li:last-child { padding-bottom: 0; }
.timeline li::before { content: ""; position: absolute; left: -0.4rem; top: 0.35rem; width: 0.8rem; height: 0.8rem; border-radius: 50%; background: var(--paper); border: 1px solid var(--ink); }
.timeline li:last-child::before { background: var(--ink); }
@media (min-width: 56rem) {
  .timeline { grid-template-columns: repeat(4, 1fr); }
  .timeline li { border-left: 0; margin: 0; padding: 1.75rem 1.5rem 0 0; border-top: 1px solid var(--rule); }
  .timeline li::before { left: 0; top: -0.42rem; }
}
.when { font-size: 0.78rem; letter-spacing: 0.12em; text-transform: uppercase; color: var(--muted); margin: 0 0 0.5rem; font-weight: 500; }
.timeline p:last-child { margin: 0; color: var(--muted); }

/* Example */
.tabs { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0.4rem; margin: 0 0 1.25rem; }
@media (min-width: 48rem) { .tabs { display: flex; gap: 0.5rem; } }
.tabs button {
  font: inherit;
  font-size: 0.95rem;
  color: var(--muted);
  background: transparent;
  border: 1px solid var(--rule);
  border-radius: 2px;
  padding: 0.6rem 1rem;
  cursor: pointer;
  text-align: left;
  line-height: 1.3;
}
.tabs button span { display: block; font-size: 0.8rem; opacity: 0.8; }
.tabs button:hover { color: var(--ink); border-color: var(--muted); }
.tabs button[aria-selected="true"] { color: var(--paper); background: var(--ink); border-color: var(--ink); }
@media (max-width: 30rem) { .tabs button { font-size: 0.82rem; padding: 0.55rem 0.6rem; } .tabs button span { font-size: 0.72rem; } }
html:not(.js) .tabs { display: none; }
html:not(.js) .panel + .panel { margin-top: 1.5rem; }

.panel { border: 1px solid var(--rule); background: var(--card); border-radius: 3px; padding: 1.25rem; }
@media (min-width: 48rem) { .panel { padding: 1.75rem; } }
.flow { display: grid; gap: 1.5rem; }
@media (min-width: 60rem) {
  .flow { grid-template-columns: 1fr 1.1fr 1fr; gap: 0; }
  .flow .col { padding-right: 1.5rem; }
  .flow .col + .col { border-left: 1px solid var(--rule); padding-left: 1.5rem; }
  .flow .col:last-child { padding-right: 0; }
}
.col-head { font-size: 0.75rem; letter-spacing: 0.12em; text-transform: uppercase; color: var(--muted); margin: 0 0 0.85rem; font-weight: 500; }
.msg { background: var(--paper); border: 1px solid var(--rule); border-radius: 10px 10px 10px 2px; padding: 0.9rem 1rem; font-size: 0.95rem; }
.msg p { margin: 0; }
.msg .msg-meta { font-size: 0.75rem; color: var(--muted); margin-bottom: 0.4rem; }
.mini { width: 100%; border-collapse: collapse; font-size: 0.85rem; font-variant-numeric: tabular-nums; }
.mini th { text-align: left; font-weight: 500; color: var(--muted); padding: 0.2rem 0.4rem 0.3rem 0; border-bottom: 1px solid var(--rule); }
.mini td { padding: 0.35rem 0.4rem 0.35rem 0; border-bottom: 1px solid var(--rule); }
.mini tr:last-child td { border-bottom: 0; }
.checks { list-style: none; margin: 0; padding: 0; font-size: 0.93rem; }
.checks li { position: relative; padding: 0 0 0.6rem 1.6rem; line-height: 1.45; }
.checks li::before { position: absolute; left: 0; top: 0.05rem; width: 1.05rem; height: 1.05rem; border-radius: 50%; font-size: 0.7rem; line-height: 1.05rem; text-align: center; font-weight: 700; }
.checks .ok::before { content: "✓"; color: var(--ok); border: 1px solid var(--ok); }
.checks .warn::before { content: "!"; color: var(--warn); border: 1px solid var(--warn); }
.draft { border: 1px solid var(--ink); border-radius: 3px; padding: 1rem; background: var(--paper); }
.draft p { margin: 0; }
.draft .draft-title { font-weight: 600; font-size: 0.9rem; margin-bottom: 0.5rem; }
.draft-body { font-size: 0.93rem; }
.draft .draft-actions { display: flex; gap: 0.5rem; margin-top: 0.9rem; flex-wrap: wrap; }
.pill { font-size: 0.8rem; border: 1px solid var(--rule); border-radius: 2px; padding: 0.35rem 0.7rem; color: var(--muted); }
.pill-primary { background: var(--ink); color: var(--paper); border-color: var(--ink); }
.measured { margin: 1.4rem 0 0; padding-top: 1rem; border-top: 1px solid var(--rule); font-family: var(--serif); font-size: 1.15rem; }
.measured span { font-family: var(--sans); font-size: 0.75rem; letter-spacing: 0.12em; text-transform: uppercase; color: var(--muted); margin-right: 0.75rem; }
.note { color: var(--muted); font-size: 0.85rem; margin: 0.9rem 0 0; }

/* Example animation: rows land one after another */
.js .panel.play .msg, .js .panel.play .checks li, .js .panel.play .draft { animation: land 0.45s ease both; }
.js .panel.play .checks li:nth-child(1) { animation-delay: 0.35s; }
.js .panel.play .checks li:nth-child(2) { animation-delay: 0.6s; }
.js .panel.play .checks li:nth-child(3) { animation-delay: 0.85s; }
.js .panel.play .checks li:nth-child(4) { animation-delay: 1.1s; }
.js .panel.play .checks li:nth-child(5) { animation-delay: 1.35s; }
.js .panel.play .draft { animation-delay: 1.75s; }
.js #example.waiting .msg, .js #example.waiting .checks li, .js #example.waiting .draft { opacity: 0; animation: none; }
@keyframes land { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) {
  .js .panel.play .msg, .js .panel.play .checks li, .js .panel.play .draft { animation: none; }
  .js #example.waiting .msg, .js #example.waiting .checks li, .js #example.waiting .draft { opacity: 1; }
}

/* Terms */
.spec { margin: 0; border-top: 1px solid var(--ink); max-width: 52rem; }
.spec > div { display: grid; gap: 0.2rem; padding: 1rem 0; border-bottom: 1px solid var(--rule); }
@media (min-width: 40rem) { .spec > div { grid-template-columns: 13rem 1fr; gap: 1.5rem; } }
.spec dt { font-weight: 600; }
.spec dd { margin: 0; color: var(--muted); }

/* Contact */
.contact .email { font-family: var(--serif); font-size: clamp(1.6rem, 1.2rem + 1.5vw, 2.2rem); }

/* Footer */
.site-footer { border-top: 1px solid var(--rule); padding: 2rem 0 3rem; color: var(--muted); font-size: 0.85rem; }
.site-footer .wrap { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 0.75rem 2rem; }
.footer-links { display: flex; gap: 1.5rem; }
.site-footer a { color: inherit; }

/* Prose pages (privacy, 404) */
.prose { max-width: 40rem; padding: 4rem 0 5rem; }
.prose h1 { font-family: var(--serif); font-weight: 400; font-size: 2.6rem; line-height: 1.1; margin: 0 0 0.5rem; }
.prose .updated { color: var(--muted); font-size: 0.9rem; margin: 0 0 2.5rem; }
.prose h2 { font-family: var(--serif); font-weight: 500; font-size: 1.45rem; margin: 2.4rem 0 0.6rem; }
.prose p, .prose ul { margin: 0 0 1rem; }
.prose ul { padding-left: 1.2rem; }
.prose li { margin-bottom: 0.4rem; }

/* Print: the page prints as the one-pager; the interactive example stays on screen */
@page { size: A4; margin: 12mm 16mm; }
@media print {
  :root { --paper: #fff; --card: #fff; --ink: #111; --muted: #444; --rule: #ccc; }
  body { font-size: 9.2pt; line-height: 1.38; background: #fff; }
  .wrap { padding: 0 !important; max-width: none; }
  .nav, .cta .button, #example, .footer-links { display: none !important; }
  .site-header { padding: 0 0 4mm; }
  .hero { padding: 1mm 0 5mm !important; }
  .eyebrow { font-size: 8.6pt; margin-bottom: 3mm; max-width: none; }
  .hero h1 { font-size: 20pt; max-width: none; }
  .hero .lede { font-size: 10.5pt; margin-top: 3mm; max-width: none; }
  .cta { margin-top: 3mm; }
  .cta-note { font-size: 9.4pt; }
  section { padding: 3.2mm 0; }
  .tag { font-size: 7pt; margin-bottom: 1.5mm; }
  .headline { font-size: 13.5pt; margin-bottom: 3mm; max-width: none; }
  .contact .intro { display: none; }
  .contact p { margin: 0; }
  h3 { font-size: 12pt; margin-bottom: 1mm; }
  .cards { grid-template-columns: repeat(3, 1fr); gap: 4mm; }
  .cards li { padding: 3mm 0 0; border: 0; border-top: 1px solid #111; border-radius: 0; }
  .cards .n { margin-bottom: 1.5mm; font-size: 9pt; }
  .timeline { grid-template-columns: repeat(4, 1fr); }
  .timeline li { border-left: 0; margin: 0; padding: 4mm 3mm 0 0; border-top: 1px solid #ccc; }
  .timeline li::before { left: 0; top: -1.6mm; width: 3mm; height: 3mm; }
  .when { font-size: 7pt; }
  .spec > div { grid-template-columns: 38mm 1fr; gap: 4mm; padding: 1.6mm 0; }
  .contact .email { font-size: 13pt; }
  .site-footer { padding: 4mm 0 0; font-size: 8pt; }
  a { text-decoration: none; }
}
