:root {
  color-scheme: light;
  --bg: #f4f1eb;
  --text: #221f1b;
  --muted: #6f685f;
  --link: #6e3b2e;
  --line: #e3ddd3;
  --quote: #ebe6de;
  --code: #2a2420;
  --code-bg: #ebe4da;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --bg: #161513;
    --text: #ece7df;
    --muted: #a39c92;
    --link: #e0b48a;
    --line: #2c2a26;
    --quote: #221f1c;
    --code: #f0e6da;
    --code-bg: #2a2520;
  }
}

:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #161513;
  --text: #ece7df;
  --muted: #a39c92;
  --link: #e0b48a;
  --line: #2c2a26;
  --quote: #221f1c;
  --code: #f0e6da;
  --code-bg: #2a2520;
}

* { box-sizing: border-box; }

html { font-size: 18px; }

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

a { color: var(--link); text-underline-offset: 0.18em; }

a:hover { text-decoration-thickness: 2px; }

.wrap {
  max-width: 40rem;
  margin: 0 auto;
  padding: 4.5rem 1.5rem 3rem;
}

header {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: baseline;
  gap: 0.75rem 1.5rem;
}

.brand {
  color: var(--text);
  text-decoration: none;
  font-size: 1.65rem;
  letter-spacing: -0.02em;
}

nav {
  display: flex;
  flex-wrap: wrap;
  gap: 1.15rem;
  align-items: baseline;
}

nav a {
  color: var(--muted);
  text-decoration: none;
  font-size: 0.95rem;
}

nav a[aria-current="page"] { color: var(--text); }

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

.theme {
  background: none;
  border: 0;
  padding: 0;
  color: var(--muted);
  font: inherit;
  font-size: 0.95rem;
  cursor: pointer;
}

.theme:hover { color: var(--link); }

.portrait {
  display: block;
  width: 16rem;
  max-width: 100%;
  height: auto;
  margin: 2.75rem 0 0;
  border-radius: 6px;
}

.lede {
  margin: 1.75rem 0 0;
  font-size: 1.2rem;
  line-height: 1.55;
}

.social { margin: 1.35rem 0 0; }

.social a + a { margin-left: 1.15rem; }

h1 {
  font-size: 2rem;
  font-weight: 500;
  letter-spacing: -0.02em;
  line-height: 1.2;
  margin: 2.75rem 0 0;
}

.entry { margin-top: 2rem; }

.entry h2 {
  font-size: 1.35rem;
  font-weight: 500;
  letter-spacing: -0.015em;
  margin: 0;
}

.entry h2 a { color: var(--text); text-decoration: none; }

.entry h2 a:hover { color: var(--link); }

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

.summary { margin: 0.4rem 0 0; }

.summary p { margin: 0; }

.content h2,
.content h3 {
  font-weight: 500;
  letter-spacing: -0.015em;
  line-height: 1.25;
  margin: 1.75rem 0 0;
}

.content h2 { font-size: 1.35rem; }

.content h3 { font-size: 1.15rem; }

.content p,
.content ul,
.content ol,
.content pre,
.content blockquote { margin: 1rem 0 0; }

.content ul,
.content ol { padding-left: 1.25rem; }

.content li { margin: 0.35rem 0; }

.content img {
  max-width: 100%;
  height: auto;
}

.img-left {
  float: left;
  max-width: 45%;
  margin: 0.25rem 1rem 0.75rem 0;
}

.img-right {
  float: right;
  max-width: 45%;
  margin: 0.25rem 0 0.75rem 1rem;
}

.content::after {
  content: "";
  display: block;
  clear: both;
}

blockquote {
  padding: 0.15rem 0 0.15rem 1rem;
  border-left: 2px solid var(--line);
  color: var(--muted);
}

code {
  font-family: "Cascadia Code", "Source Code Pro", ui-monospace, monospace;
  font-size: 0.86em;
  background: var(--code-bg);
  color: var(--code);
  padding: 0.05em 0.3em;
  border-radius: 3px;
}

pre {
  background: var(--code-bg);
  color: var(--code);
  padding: 1rem;
  overflow-x: auto;
  border-radius: 6px;
  font-size: 0.86rem;
  line-height: 1.45;
}

pre code {
  background: none;
  padding: 0;
}

footer {
  margin-top: 4rem;
  padding-top: 1rem;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 0.85rem;
}

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