:root {
  --bg: #f2f5f7;
  --surface: #ffffff;
  --text: #17232d;
  --muted: #4d5f6b;
  --rule: #cbd5db;
  --link: #0b5a8a;
  --fresh: #1b7f52;
  --warn: #8a6a00;
  --stale: #b4531a;
  --code-bg: #e6ecef;
  --focus: #0b5a8a;
  --serif: "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, serif;
  --sans: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, "SF Mono", Menlo, Consolas, "Liberation Mono", monospace;
  color-scheme: light dark;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0f171d;
    --surface: #16222a;
    --text: #e4ecf0;
    --muted: #9fb1bc;
    --rule: #2a3a45;
    --link: #6bb8e8;
    --fresh: #4cc38a;
    --warn: #e0b84a;
    --stale: #f0975a;
    --code-bg: #1b2a33;
    --focus: #6bb8e8;
  }
}

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

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--sans);
  font-size: 1.0625rem;
  line-height: 1.6;
}

a { color: var(--link); text-underline-offset: 0.18em; }
a:hover { text-decoration-thickness: 2px; }

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

.skip {
  position: absolute; left: -999px; top: 0;
  background: var(--surface); color: var(--text); padding: 0.5rem 1rem; z-index: 10;
}
.skip:focus { left: 0.5rem; top: 0.5rem; }

.wrap { max-width: 68rem; margin: 0 auto; padding: 0 1.25rem; }
.prose { max-width: 44rem; }

/* Header */
.site-head { border-bottom: 1px solid var(--rule); }
.site-head .wrap {
  display: flex; flex-wrap: wrap; align-items: center;
  justify-content: space-between; gap: 0.75rem 2rem; padding-top: 1rem; padding-bottom: 1rem;
}
.brand {
  font-family: var(--serif); font-size: 1.25rem; font-weight: 700;
  color: var(--text); text-decoration: none; letter-spacing: -0.01em;
}
.site-nav { display: flex; flex-wrap: wrap; gap: 0.25rem 1.5rem; }
.site-nav a { color: var(--text); text-decoration: none; padding: 0.25rem 0; border-bottom: 2px solid transparent; }
.site-nav a:hover { border-bottom-color: var(--rule); }
.site-nav a[aria-current="page"] { border-bottom-color: var(--text); font-weight: 600; }

/* Type */
h1, h2, h3 { font-family: var(--serif); line-height: 1.2; letter-spacing: -0.015em; margin: 0; }
h1 { font-size: clamp(2.1rem, 5.2vw, 3.4rem); font-weight: 700; }
h2 { font-size: clamp(1.5rem, 3vw, 2rem); font-weight: 700; margin-top: 3rem; margin-bottom: 0.75rem; }
h3 { font-size: 1.25rem; font-weight: 700; margin-top: 2rem; margin-bottom: 0.5rem; }
p { margin: 0 0 1rem; }
.lede { font-size: 1.2rem; color: var(--muted); max-width: 40rem; margin-top: 1.25rem; }
.muted { color: var(--muted); }
.small { font-size: 0.9rem; }

main { padding: 3rem 0 4rem; }

/* Buttons */
.actions { display: flex; flex-wrap: wrap; gap: 0.75rem; margin-top: 1.75rem; }
.btn {
  display: inline-block; padding: 0.7rem 1.25rem; border-radius: 4px;
  border: 2px solid var(--text); font-weight: 600; text-decoration: none; cursor: pointer;
  font-family: inherit; font-size: 1rem; line-height: 1.2;
}
.btn.primary { background: var(--text); color: var(--bg); }
.btn.secondary { background: transparent; color: var(--text); }
.btn:hover { text-decoration: none; opacity: 0.88; }

/* Hero */
.hero { display: grid; gap: 2.5rem; grid-template-columns: 1fr; align-items: start; }
@media (min-width: 60rem) { .hero { grid-template-columns: 1.1fr 1fr; gap: 3.5rem; } }

/* Freshness ledger: the one memorable element */
.ledger { background: var(--surface); border: 1px solid var(--rule); border-radius: 6px; overflow: hidden; }
.ledger caption {
  text-align: left; padding: 0.75rem 1rem; font-size: 0.9rem; color: var(--muted);
  border-bottom: 1px solid var(--rule); caption-side: top;
}
.ledger table { width: 100%; border-collapse: collapse; }
.ledger th, .ledger td { text-align: left; padding: 0.75rem 1rem; vertical-align: top; font-size: 0.95rem; }
.ledger thead th { font-weight: 600; font-size: 0.85rem; color: var(--muted); border-bottom: 1px solid var(--rule); }
.ledger tbody tr + tr td, .ledger tbody tr + tr th { border-top: 1px solid var(--rule); }
.ledger tbody th { font-weight: 400; }
.bar { display: block; height: 6px; background: var(--code-bg); border-radius: 3px; margin-top: 0.4rem; overflow: hidden; }
.bar > span { display: block; height: 100%; }
.s-fresh { color: var(--fresh); font-weight: 700; }
.s-warn { color: var(--warn); font-weight: 700; }
.s-stale { color: var(--stale); font-weight: 700; }
.bar .f-fresh { background: var(--fresh); }
.bar .f-warn { background: var(--warn); }
.bar .f-stale { background: var(--stale); }

/* Feature list: ruled definition list, not cards */
.feature-list { margin: 1.5rem 0 0; padding: 0; border-top: 1px solid var(--rule); }
.feature-list > div {
  display: grid; gap: 0.25rem 2rem; grid-template-columns: 1fr;
  padding: 1.1rem 0; border-bottom: 1px solid var(--rule);
}
@media (min-width: 48rem) { .feature-list > div { grid-template-columns: 15rem 1fr; } }
.feature-list dt { font-family: var(--serif); font-weight: 700; font-size: 1.1rem; }
.feature-list dd { margin: 0; color: var(--muted); }

/* Ordered steps (a true sequence) */
.steps { padding-left: 1.25rem; }
.steps li { margin-bottom: 0.75rem; padding-left: 0.25rem; }

/* Code */
code, pre { font-family: var(--mono); font-size: 0.9rem; }
code { background: var(--code-bg); padding: 0.1em 0.35em; border-radius: 3px; }
pre {
  background: var(--code-bg); border: 1px solid var(--rule); border-radius: 6px;
  padding: 1rem; overflow-x: auto; line-height: 1.5; margin: 0 0 1.25rem; tab-size: 2;
}
pre code { background: none; padding: 0; }

/* Tables */
.table-scroll { overflow-x: auto; margin-bottom: 1.5rem; }
table.data { border-collapse: collapse; width: 100%; min-width: 30rem; }
table.data th, table.data td { text-align: left; padding: 0.6rem 0.75rem; border-bottom: 1px solid var(--rule); vertical-align: top; }
table.data thead th { border-bottom: 2px solid var(--text); font-weight: 600; }

/* Pricing */
.tiers { margin-top: 1.5rem; border-top: 1px solid var(--rule); }
.tier {
  display: grid; gap: 0.5rem 2rem; grid-template-columns: 1fr;
  padding: 1.5rem 0; border-bottom: 1px solid var(--rule);
}
@media (min-width: 48rem) { .tier { grid-template-columns: 14rem 1fr auto; align-items: start; } }
.tier h3 { margin: 0; }
.price { font-family: var(--serif); font-size: 1.9rem; font-weight: 700; line-height: 1.1; }
.price small { font-family: var(--sans); font-size: 0.9rem; font-weight: 400; color: var(--muted); }
.tier ul { margin: 0; padding-left: 1.1rem; color: var(--muted); }

/* Docs layout */
.docs { display: grid; gap: 2rem; grid-template-columns: 1fr; }
@media (min-width: 60rem) { .docs { grid-template-columns: 13rem minmax(0, 1fr); gap: 3rem; } }
.toc { font-size: 0.95rem; }
@media (min-width: 60rem) { .toc { position: sticky; top: 1rem; align-self: start; } }
.toc ul { list-style: none; margin: 0; padding: 0; }
.toc li { margin-bottom: 0.4rem; }
.toc strong { display: block; margin-bottom: 0.5rem; }
.docs h2:first-child { margin-top: 0; }
.method { font-family: var(--mono); font-size: 0.95rem; font-weight: 600; margin: 2rem 0 0.5rem; }
.method span { color: var(--muted); font-weight: 400; }
.note { border-left: 4px solid var(--rule); padding: 0.25rem 1rem; margin: 1rem 0 1.25rem; color: var(--muted); }

/* Form */
form { max-width: 34rem; }
label { display: block; font-weight: 600; margin: 1rem 0 0.3rem; }
input, select, textarea {
  width: 100%; padding: 0.6rem 0.7rem; font: inherit; color: var(--text);
  background: var(--surface); border: 1px solid var(--muted); border-radius: 4px;
}
textarea { min-height: 8rem; resize: vertical; }
.hp { position: absolute; left: -9999px; height: 0; overflow: hidden; }
.status { margin-top: 1rem; padding: 0.75rem 1rem; border-left: 4px solid var(--fresh); background: var(--surface); }
.status.error { border-left-color: var(--stale); }

/* Footer */
.site-foot { border-top: 1px solid var(--rule); padding: 2rem 0 3rem; font-size: 0.95rem; color: var(--muted); }
.site-foot .wrap { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 1rem 2rem; }
.site-foot nav { display: flex; flex-wrap: wrap; gap: 0.25rem 1.25rem; }
.site-foot a { color: var(--muted); }

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; animation: none !important; scroll-behavior: auto !important; }
}

.bar .w92 { width: 92%; }
.bar .w74 { width: 74%; }
.bar .w58 { width: 58%; }
