:root {
  --bg: #fbfaf8;
  --panel: #ffffff;
  --ink: #14120f;
  --muted: #6b6559;
  --line: #e6e1d8;
  --accent: #7a4a1f;
  --fence-bg: #14120f;
  --fence-ink: #f4f1ea;
  --fence-nb: #f0b366;
  color-scheme: light dark;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #100f0d;
    --panel: #1a1815;
    --ink: #f2efe8;
    --muted: #a09889;
    --line: #2c2924;
    --accent: #e0a56a;
    --fence-bg: #05050a;
    --fence-ink: #f4f1ea;
  }
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 16px/1.65 ui-sans-serif, -apple-system, "Segoe UI", Inter, system-ui, sans-serif;
  -webkit-font-smoothing: antialiased;
}

main { max-width: 46rem; margin: 0 auto; padding: 0 1.5rem 6rem; }

header.site {
  max-width: 46rem;
  margin: 0 auto;
  padding: 2rem 1.5rem 0;
  display: flex;
  align-items: baseline;
  gap: 0.75rem;
  font-size: 0.85rem;
}
header.site .mark { font-weight: 650; letter-spacing: -0.01em; }
header.site .sep { color: var(--line); }
header.site a { color: var(--muted); text-decoration: none; }
header.site a:hover { color: var(--accent); }

.fold { padding: 4rem 0 1rem; }

h1 {
  font-size: clamp(2rem, 6vw, 3rem);
  line-height: 1.08;
  letter-spacing: -0.03em;
  margin: 0 0 1rem;
  font-weight: 640;
}

.standfirst {
  font-size: 1.15rem;
  color: var(--muted);
  margin: 0 0 2.25rem;
  max-width: 34rem;
}

h2 {
  font-size: 1.3rem;
  letter-spacing: -0.02em;
  margin: 3.5rem 0 0.75rem;
  font-weight: 620;
}

h3 { font-size: 1rem; margin: 2rem 0 0.4rem; font-weight: 620; }

p { margin: 0 0 1rem; }
p.tight { margin-bottom: 0.35rem; }

a { color: var(--accent); }

.fence {
  background: var(--fence-bg);
  color: var(--fence-ink);
  border-radius: 12px;
  padding: 1.1rem 1.25rem;
  font: 0.95rem/1.5 ui-monospace, SFMono-Regular, "SF Mono", Menlo, monospace;
  display: flex;
  gap: 1rem;
  align-items: flex-start;
  justify-content: space-between;
  overflow-x: auto;
}
.fence .text { white-space: normal; }
.fence .nb { color: var(--fence-nb); }

.copy {
  flex: none;
  background: rgba(255, 255, 255, 0.1);
  color: var(--fence-ink);
  border: 0;
  border-radius: 7px;
  padding: 0.35rem 0.7rem;
  font: inherit;
  font-size: 0.8rem;
  cursor: pointer;
}
.copy:hover { background: rgba(255, 255, 255, 0.18); }

.caption { color: var(--muted); font-size: 0.9rem; margin: 0.6rem 0 0; }

pre.block {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 1.1rem 1.25rem;
  overflow-x: auto;
  font: 0.85rem/1.6 ui-monospace, SFMono-Regular, "SF Mono", Menlo, monospace;
  margin: 1rem 0;
}

.cards { display: grid; gap: 1px; background: var(--line); border: 1px solid var(--line); border-radius: 12px; overflow: hidden; margin-top: 1.25rem; }
@media (min-width: 40rem) { .cards.three { grid-template-columns: repeat(3, 1fr); } }
.card { background: var(--panel); padding: 1.25rem; }
.card h3 { margin: 0 0 0.4rem; }
.card p { margin: 0; color: var(--muted); font-size: 0.93rem; }

.rule { border: 0; border-top: 1px solid var(--line); margin: 3.5rem 0 0; }

ol.steps { counter-reset: step; list-style: none; padding: 0; margin: 2rem 0 0; }
ol.steps > li { counter-increment: step; position: relative; padding-left: 2.75rem; margin-bottom: 2.5rem; }
ol.steps > li::before {
  content: counter(step);
  position: absolute;
  left: 0;
  top: -0.1rem;
  width: 1.9rem;
  height: 1.9rem;
  border-radius: 50%;
  border: 1px solid var(--line);
  background: var(--panel);
  display: grid;
  place-items: center;
  font-size: 0.85rem;
  font-weight: 620;
  color: var(--muted);
}

dl.fields { margin: 1rem 0 0; }
dl.fields dt { font: 0.85rem ui-monospace, SFMono-Regular, Menlo, monospace; color: var(--muted); margin-top: 0.9rem; }
dl.fields dd { margin: 0.15rem 0 0; font: 0.95rem ui-monospace, SFMono-Regular, Menlo, monospace; }

footer.site {
  max-width: 46rem;
  margin: 0 auto;
  padding: 2rem 1.5rem 4rem;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 0.88rem;
}
footer.site a { color: var(--muted); }

.quiet { color: var(--muted); }
