:root {
  color-scheme: light;
  --bg: #f6f4ef;
  --fg: #1a1814;
  --muted: #5c564c;
  --line: #e3ddd3;
  --accent: #8c3a2f;
  --focus: #8c3a2f;
  --code-bg: #efeae2;
}

@media (prefers-color-scheme: dark) {
  :root {
    color-scheme: dark;
    --bg: #141311;
    --fg: #f3efe6;
    --muted: #c2baad;
    --line: #2e2b26;
    --accent: #e3a08f;
    --focus: #e3a08f;
    --code-bg: #1e1c19;
  }
}

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

html {
  background: var(--bg);
  text-rendering: optimizeLegibility;
}

body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background: var(--bg);
  color: var(--fg);
  font-family: "Iowan Old Style", Palatino, "Palatino Linotype", "Book Antiqua", Georgia, serif;
  font-size: 1.125rem;
  line-height: 1.65;
}

.wrap {
  flex: 1;
  display: flex;
  flex-direction: column;
  width: 100%;
  max-width: 40rem;
  margin-inline: auto;
  padding: 1.5rem 1.25rem 2.5rem;
}

main {
  flex: 1;
}

:focus {
  outline: none;
}

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

.skip {
  position: absolute;
  left: 0.75rem;
  top: 0;
  transform: translateY(-120%);
  background: var(--bg);
  color: var(--fg);
  padding: 0.45rem 0.7rem;
  z-index: 1;
}

.skip:focus {
  transform: translateY(0.75rem);
}

.site-header {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.75rem 1.5rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--line);
}

.brand {
  margin: 0;
  font-size: 1.05rem;
  font-weight: 600;
  letter-spacing: -0.01em;
}

.brand a {
  color: inherit;
  text-decoration: none;
}

.brand a:hover {
  text-decoration: underline;
  text-underline-offset: 0.2em;
}

.nav ul {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem 1.1rem;
  list-style: none;
  margin: 0;
  padding: 0;
}

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

.nav a:visited,
.brand a:visited,
.work-item h2 a:visited,
.post-item h2 a:visited,
.link-list a:visited {
  color: inherit;
}

.nav a:hover,
.nav a[aria-current="page"],
.nav a[aria-current="page"]:visited {
  color: var(--accent);
  text-decoration: underline;
  text-underline-offset: 0.25em;
  text-decoration-thickness: 1px;
}

h1 {
  margin: 2rem 0 1.25rem;
  font-size: clamp(2rem, 5vw, 2.6rem);
  font-weight: 600;
  letter-spacing: -0.025em;
  line-height: 1.15;
  text-wrap: balance;
}

h2,
h3 {
  font-weight: 600;
  letter-spacing: -0.02em;
  line-height: 1.25;
  text-wrap: balance;
}

.prose h2 {
  margin: 2rem 0 0.6rem;
  font-size: 1.35rem;
}

.prose h3 {
  margin: 1.6rem 0 0.4rem;
  font-size: 1.15rem;
}

p {
  margin: 0 0 1rem;
}

.lede,
.meta {
  color: var(--muted);
}

.meta {
  font-size: 1rem;
  margin: 0 0 0.75rem;
}

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

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

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

.prose ul,
.prose ol {
  margin: 0 0 1rem;
  padding-left: 1.2rem;
}

.prose li + li {
  margin-top: 0.35rem;
}

.prose blockquote {
  margin: 1.25rem 0;
  padding-left: 1rem;
  border-left: 2px solid var(--accent);
  color: var(--muted);
}

.prose hr {
  border: 0;
  border-top: 1px solid var(--line);
  margin: 2rem 0;
}

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

.prose code {
  font-family: ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace;
  font-size: 0.88em;
  background: var(--code-bg);
  padding: 0.1em 0.3em;
}

.prose pre {
  overflow-x: auto;
  margin: 0 0 1rem;
  padding: 0.9rem 1rem;
  background: var(--code-bg);
  border: 1px solid var(--line);
}

.prose pre code {
  padding: 0;
  background: transparent;
  font-size: 0.85rem;
}

.prose table {
  width: 100%;
  border-collapse: collapse;
  margin: 0 0 1rem;
}

.prose th,
.prose td {
  text-align: left;
  vertical-align: top;
  padding: 0.4rem 0.75rem 0.4rem 0;
  border-bottom: 1px solid var(--line);
}

.stack {
  list-style: none;
  margin: 0;
  padding: 0;
}

.stack > li + li,
.post-item + .post-item,
.work-item + .work-item {
  margin-top: 1.75rem;
  padding-top: 1.75rem;
  border-top: 1px solid var(--line);
}

.work-item h2,
.post-item h2 {
  margin: 0 0 0.3rem;
  font-size: 1.3rem;
}

.work-item h2 a,
.post-item h2 a {
  color: inherit;
  text-decoration-thickness: 1px;
  text-underline-offset: 0.18em;
}

.post-item h2 a,
.post-item h2 a:visited {
  color: var(--accent);
}

.work-item h2 a:hover,
.post-item h2 a:hover {
  text-decoration-thickness: 2px;
}

.work-item .summary,
.post-item p:last-child {
  margin-bottom: 0;
}

.role-list {
  list-style: none;
  margin: 1rem 0 0;
  padding: 0;
}

.role-list > li + li {
  margin-top: 1.1rem;
}

.role-list h3 {
  margin: 0 0 0.2rem;
  font-size: 1.12rem;
  font-weight: 600;
}

.role-list .meta,
.role-list .summary {
  margin-bottom: 0;
}

.role-compact p,
.work-compact p {
  margin: 0;
  color: var(--muted);
  font-size: 1rem;
}

.role-compact a,
.work-compact a,
.role-compact a:visited,
.work-compact a:visited {
  color: inherit;
}

.stack > li.work-compact + li.work-compact {
  margin-top: 0.65rem;
  padding-top: 0;
  border-top: 0;
}

.role-list > li.role-compact {
  margin-top: 0.85rem;
}

.link-list {
  list-style: none;
  margin: 0.5rem 0 0;
  padding: 0;
}

.link-list a {
  display: grid;
  grid-template-columns: 7.5rem 1fr;
  gap: 0.25rem 1rem;
  align-items: baseline;
  padding: 0.8rem 0;
  border-top: 1px solid var(--line);
  color: inherit;
  text-decoration: none;
}

.link-list li:last-child a {
  border-bottom: 1px solid var(--line);
}

.link-label {
  color: var(--accent);
  text-decoration: underline;
  text-underline-offset: 0.18em;
}

.link-url {
  color: var(--muted);
  overflow-wrap: anywhere;
}

.link-list a:hover .link-label,
.link-list a:focus-visible .link-label {
  text-decoration-thickness: 2px;
}

.site-footer {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 0.5rem 1.5rem;
  margin-top: 3rem;
  padding-top: 1rem;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 1rem;
}

.site-footer p {
  margin: 0;
}

::selection {
  background: var(--accent);
  color: var(--bg);
}

@media (max-width: 36rem) {
  body {
    font-size: 1.0625rem;
  }

  .site-header {
    flex-direction: column;
    align-items: flex-start;
  }

  .link-list a {
    grid-template-columns: 1fr;
  }
}

@media (prefers-reduced-motion: reduce) {
  .skip {
    transition: none;
  }
}

@media print {
  body {
    background: #fff;
    color: #000;
  }

  .skip,
  .nav,
  .site-footer {
    display: none;
  }

  a {
    color: #000;
  }

  .prose a[href^="http"]::after,
  .link-list a::after {
    content: " (" attr(href) ")";
    font-size: 0.85em;
  }
}
