:root {
  color-scheme: light;
  --bg: #fbfaf7;
  --ink: #171412;
  --muted: #625a51;
  --faint: #8a8175;
  --line: #d8d0c5;
  --soft: #f1ece4;
  --code: #f7f1e8;
  --accent: #9b4d2e;
  --accent-2: #1f5f70;
  --blueprint: #1d3448;
  --max: 760px;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  color: var(--ink);
  background:
    linear-gradient(90deg, rgba(29, 52, 72, 0.025) 1px, transparent 1px),
    linear-gradient(rgba(29, 52, 72, 0.02) 1px, transparent 1px),
    var(--bg);
  background-size: 32px 32px;
  font-family: Charter, "Iowan Old Style", Georgia, serif;
  font-size: 19px;
  line-height: 1.66;
}

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

.site {
  min-height: 100vh;
}

.nav {
  display: flex;
  justify-content: space-between;
  gap: 24px;
  width: min(var(--max), calc(100vw - 36px));
  margin: 0 auto;
  padding: 18px 0;
  font-family: ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 14px;
}

.nav a {
  color: var(--muted);
  text-decoration: none;
}

.nav a:hover {
  color: var(--ink);
}

.article {
  width: min(var(--max), calc(100vw - 36px));
  margin: 0 auto;
  padding: 54px 0 90px;
}

.kicker {
  margin: 0 0 12px;
  color: var(--accent);
  font-family: ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

h1,
h2,
h3 {
  line-height: 1.12;
  letter-spacing: 0;
}

h1 {
  max-width: 900px;
  margin: 0;
  font-size: clamp(42px, 7vw, 76px);
  font-weight: 700;
}

.dek {
  max-width: 660px;
  margin: 24px 0 0;
  color: var(--muted);
  font-size: 24px;
  line-height: 1.45;
}

.meta {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 28px;
  color: var(--faint);
  font-family: ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 14px;
}

.meta span:not(:last-child)::after {
  padding-left: 10px;
  color: var(--line);
  content: "/";
}

.toc {
  margin: 38px 0 52px;
  padding: 18px 22px;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  font-family: ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 15px;
}

.toc strong {
  display: block;
  margin-bottom: 8px;
  color: var(--muted);
  font-size: 13px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.toc ol {
  display: grid;
  gap: 4px;
  margin: 0;
  padding-left: 22px;
}

h2 {
  margin: 60px 0 16px;
  font-size: 34px;
}

h3 {
  margin: 34px 0 10px;
  font-size: 23px;
}

p {
  margin: 18px 0;
}

.lede {
  font-size: 22px;
}

.callout {
  margin: 34px 0;
  padding: 18px 22px;
  background: var(--soft);
  border-left: 4px solid var(--accent);
}

.callout p {
  margin: 0;
}

.figure {
  margin: 36px 0;
}

.figure img {
  display: block;
  width: 100%;
  height: auto;
  border: 1px solid var(--line);
  background: #fbf8f1;
}

figcaption {
  margin-top: 10px;
  color: var(--muted);
  font-family: ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 14px;
  line-height: 1.45;
}

.table-wrap {
  margin: 26px 0;
  overflow-x: auto;
  border: 1px solid var(--line);
}

table {
  width: 100%;
  border-collapse: collapse;
  font-family: ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 14px;
  line-height: 1.35;
  background: rgba(255, 255, 255, 0.45);
}

th,
td {
  padding: 10px 12px;
  border-bottom: 1px solid var(--line);
  text-align: left;
}

th {
  color: var(--muted);
  background: var(--soft);
  font-size: 12px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

td.number,
th.number {
  text-align: right;
}

tr:last-child td {
  border-bottom: 0;
}

code,
pre {
  font-family: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
}

code {
  padding: 0.1em 0.25em;
  background: var(--code);
  border-radius: 4px;
  font-size: 0.86em;
}

pre {
  margin: 22px 0;
  padding: 18px 20px;
  overflow-x: auto;
  color: #201b17;
  background: var(--code);
  border: 1px solid var(--line);
  font-size: 14px;
  line-height: 1.55;
}

pre code {
  padding: 0;
  background: transparent;
  border-radius: 0;
  font-size: inherit;
}

.sample-grid {
  display: grid;
  gap: 16px;
  margin: 24px 0;
}

.sample {
  padding: 18px 20px;
  background: #fffdf8;
  border: 1px solid var(--line);
}

.sample h3 {
  margin: 0 0 12px;
  color: var(--blueprint);
  font-family: ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 15px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.sample pre {
  margin: 0;
  padding: 0;
  white-space: pre-wrap;
  background: transparent;
  border: 0;
}

ul {
  padding-left: 24px;
}

li {
  margin: 8px 0;
}

.foot {
  margin-top: 72px;
  padding-top: 22px;
  color: var(--muted);
  border-top: 1px solid var(--line);
  font-family: ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 14px;
}

@media (max-width: 640px) {
  body {
    font-size: 18px;
  }

  .article {
    padding-top: 28px;
  }

  .dek {
    font-size: 21px;
  }

  h2 {
    font-size: 29px;
  }
}
