:root {
  --bg: #fbfaf7;
  --fg: #1f1d1a;
  --muted: #6b6560;
  --rule: #e2ddd4;
  --accent: #8a4b2a;
  --code-bg: #f2efe8;
  --measure: 34rem;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #16151300;
    --bg: #161513;
    --fg: #e8e4dc;
    --muted: #9b948b;
    --rule: #2f2c28;
    --accent: #d99b6c;
    --code-bg: #201e1b;
  }
}

* { box-sizing: border-box; }

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

body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font-family: Iowan Old Style, Palatino Linotype, Palatino, Georgia, serif;
  line-height: 1.62;
}

.wrap {
  max-width: var(--measure);
  margin: 0 auto;
  padding: 0 1.4rem;
}

header.site {
  border-bottom: 1px solid var(--rule);
  padding: 2.4rem 0 1.1rem;
  margin-bottom: 2.6rem;
}

header.site .wrap {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.4rem 1.4rem;
}

.brand {
  font-size: 1.05rem;
  font-weight: 600;
  letter-spacing: 0.01em;
  color: var(--fg);
  text-decoration: none;
}

.brand span { color: var(--accent); }

nav.site {
  margin-left: auto;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.78rem;
  letter-spacing: 0.04em;
  text-transform: lowercase;
}

nav.site a {
  color: var(--muted);
  text-decoration: none;
  margin-left: 1.1rem;
}

nav.site a:hover,
nav.site a:focus { color: var(--accent); }

h1 {
  font-size: 1.85rem;
  line-height: 1.24;
  margin: 0 0 0.5rem;
  font-weight: 600;
  letter-spacing: -0.012em;
}

h2 {
  font-size: 1.18rem;
  margin: 2.4rem 0 0.7rem;
  font-weight: 600;
  letter-spacing: -0.008em;
}

p { margin: 0 0 1.15rem; }

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

.lede {
  color: var(--muted);
  font-size: 1.06rem;
}

.meta {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.72rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
  margin: 0 0 2rem;
}

ul.index {
  list-style: none;
  margin: 2rem 0 0;
  padding: 0;
}

ul.index li {
  padding: 1.15rem 0;
  border-top: 1px solid var(--rule);
}

ul.index li:last-child { border-bottom: 1px solid var(--rule); }

ul.index a {
  font-size: 1.12rem;
  text-decoration: none;
  color: var(--fg);
  display: inline-block;
  margin-bottom: 0.25rem;
}

ul.index a:hover,
ul.index a:focus {
  color: var(--accent);
  text-decoration: underline;
  text-underline-offset: 3px;
}

ul.index p {
  margin: 0;
  color: var(--muted);
  font-size: 0.94rem;
}

ul.index .when {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.7rem;
  letter-spacing: 0.06em;
  color: var(--muted);
  display: block;
  margin-bottom: 0.3rem;
}

blockquote {
  margin: 1.6rem 0;
  padding-left: 1.1rem;
  border-left: 2px solid var(--rule);
  color: var(--muted);
  font-style: italic;
}

code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.84em;
  background: var(--code-bg);
  padding: 0.12em 0.35em;
  border-radius: 3px;
}

pre {
  background: var(--code-bg);
  padding: 0.95rem 1.1rem;
  border-radius: 4px;
  overflow-x: auto;
  font-size: 0.8rem;
  line-height: 1.5;
}

pre code {
  background: none;
  padding: 0;
  font-size: inherit;
}

table {
  border-collapse: collapse;
  width: 100%;
  font-size: 0.9rem;
  margin: 1.4rem 0;
}

th, td {
  text-align: left;
  padding: 0.5rem 0.6rem 0.5rem 0;
  border-bottom: 1px solid var(--rule);
}

th {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.72rem;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--muted);
  font-weight: 500;
}

footer.site {
  margin: 4.5rem 0 3rem;
  padding-top: 1.2rem;
  border-top: 1px solid var(--rule);
  font-size: 0.84rem;
  color: var(--muted);
}

footer.site a { color: var(--muted); }

.notfound {
  padding: 3rem 0 1rem;
}

.notfound .code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 3.4rem;
  color: var(--rule);
  line-height: 1;
  margin: 0 0 1rem;
}

@media (max-width: 30rem) {
  html { font-size: 16px; }
  nav.site { margin-left: 0; width: 100%; }
  nav.site a { margin: 0 1.1rem 0 0; }
}
