:root {
  color-scheme: light dark;
  --background: #f8f6f1;
  --text: #302f2b;
  --muted: #6b6860;
  --line: #dedad1;
  --accent: #66543e;
  --focus: #755329;
  /* Neo-Grotesque stack: https://modernfontstacks.com/
     Use installed fonts only; no webfont downloads. */
  --font-sans: Inter, Roboto, 'Helvetica Neue', 'Arial Nova', 'Nimbus Sans', Arial, sans-serif;
  /* Monospace Code stack from Modern Font Stacks; installed fonts only. */
  --font-mono: ui-monospace, 'Cascadia Code', 'Source Code Pro', Menlo, Consolas, 'DejaVu Sans Mono', monospace;
  font-family: var(--font-sans);
  font-size: 100%;
  line-height: 1.5;
}

@media (prefers-color-scheme: dark) {
  :root {
    --background: #242523;
    --text: #e7e4dc;
    --muted: #b5b1a7;
    --line: #44453e;
    --accent: #d1b994;
    --focus: #dfbb84;
  }
}

* { box-sizing: border-box; }
html { background: var(--background); }

body {
  margin: 0;
  color: var(--text);
  font-size: 1rem;
  -webkit-text-size-adjust: 100%;
}

.site-shell {
  width: min(100% - 3rem, 65ch);
  margin-inline: auto;
  padding-block: clamp(2rem, 6vw, 4.5rem) 5rem;
}

a {
  color: var(--accent);
  text-decoration: none;
  text-decoration-thickness: 1px;
  text-underline-offset: 0.2em;
  overflow-wrap: anywhere;
}

a:hover, a:focus-visible { text-decoration-line: underline; }

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

.site-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem 2rem;
  margin-bottom: clamp(3.5rem, 9vw, 6rem);
}

.wordmark {
  display: inline-flex;
  align-items: center;
  gap: 0.3em;
  color: var(--text);
  font-size: clamp(2.25rem, 6vw, 2.75rem);
  font-weight: 600;
  line-height: 1.1;
  letter-spacing: -0.035em;
  text-decoration: none;
  white-space: nowrap;
}

.wordmark-divider {
  flex: none;
  letter-spacing: 0;
}

.wordmark:hover, .wordmark:focus-visible {
  color: var(--accent);
  text-decoration: none;
}

nav {
  display: flex;
  flex-wrap: wrap;
  margin-inline-start: auto;
  gap: 0.3rem 1.3rem;
  font-size: 0.9375rem;
}

nav a {
  display: inline-flex;
  align-items: center;
  min-height: 2.75rem;
  color: var(--muted);
  text-decoration: none;
}

nav a[aria-current], nav a:hover {
  color: var(--text);
}

main:focus { outline: none; }

h1, h2, h3 {
  line-height: 1.3;
  font-weight: 550;
  letter-spacing: -0.025em;
  overflow-wrap: anywhere;
}

h1 {
  margin: 0 0 1rem;
  font-size: clamp(1.5rem, 4vw, 1.875rem);
}

h2 { font-size: 1.4rem; }
h3 { font-size: 1.15rem; }
p { margin: 0 0 1.35rem; }
.introduction {
  margin-bottom: 4rem;
  font-family: var(--font-sans);
  font-size: 1.125rem;
}

.section-heading {
  margin: 0 0 1.15rem;
  color: var(--muted);
  font-size: 0.9375rem;
  font-weight: 500;
  letter-spacing: 0;
}

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

.post-list-item {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: baseline;
  gap: 0.25rem 1.5rem;
  border-bottom: 1px solid var(--line);
  padding-block: 1rem;
}

.post-list-item:first-child { padding-top: 0; }
.post-list-item a { color: var(--text); }

.archive-link {
  margin: 1.5rem 0 0;
  font-size: 0.9375rem;
}

time {
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 0.8125rem;
  white-space: nowrap;
}

.article-header { margin-bottom: 2.5rem; }
.article-image {
  width: 80%;
  margin: 0 auto 2rem;
}

.article-image img { width: 100%; }

.article .prose img {
  width: 80%;
  margin-inline: auto;
}

.about-correspondence, .keep-in-touch {
  margin-top: 3.5rem;
}

.correspondence-links {
  display: flex;
  align-items: baseline;
  gap: 0.6rem;
  font-size: 0.9375rem;
}

.keep-in-touch {
  color: var(--muted);
  font-size: 0.875rem;
}

.keep-in-touch h2 {
  margin: 0 0 0.75rem;
  font-size: 0.9375rem;
  font-weight: 500;
  letter-spacing: 0;
}

.keep-in-touch p { margin-bottom: 0; }

.site-footer {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1rem 2rem;
  margin-top: clamp(4rem, 10vw, 6rem);
  padding-top: 1.5rem;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 0.875rem;
}

.footer-links {
  display: flex;
  gap: 1.25rem;
  margin-inline-start: auto;
}

.site-footer a { color: var(--muted); }
.site-footer a:hover, .site-footer a:focus-visible { color: var(--accent); }
.footer-copyright, .footer-wordmark { white-space: nowrap; }
.footer-wordmark:hover, .footer-wordmark:focus-visible { text-decoration: none; }

img, video {
  display: block;
  max-width: 100%;
  height: auto;
}

.prose {
  font-family: var(--font-sans);
  font-size: 1rem;
  line-height: 1.5;
  overflow-wrap: anywhere;
}
.prose h2, .prose h3, .prose h4, .prose h5, .prose h6 { font-family: var(--font-sans); }
.prose h2, .prose h3 { margin: 2.5rem 0 1rem; }
.prose ul, .prose ol { padding-inline-start: 1.5rem; }
.prose li + li { margin-top: 0.5rem; }

blockquote {
  margin: 2rem 0;
  padding-inline-start: 1.25rem;
  border-inline-start: 2px solid var(--line);
  color: var(--muted);
}

pre {
  max-width: 100%;
  overflow-x: auto;
  padding: 1rem;
  border: 1px solid var(--line);
  font-size: 0.875rem;
}

code { font-family: var(--font-mono); font-size: 0.9em; }
table { display: block; max-width: 100%; overflow-x: auto; border-collapse: collapse; }
th, td { padding: 0.5rem 0.75rem; border-bottom: 1px solid var(--line); text-align: left; }
hr { margin-block: 2.5rem; border: 0; border-top: 1px solid var(--line); }

.visually-hidden, .skip-link:not(:focus) {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

.skip-link:focus {
  position: absolute;
  top: 0.75rem;
  left: 1.5rem;
  z-index: 1;
  padding: 0.5rem 0.75rem;
  background: var(--background);
}

@media (max-width: 40rem) {
  .site-shell { width: calc(100% - 2.5rem); }
  .site-header { flex-wrap: wrap; gap: 0.5rem 1.5rem; }
  .post-list-item { grid-template-columns: minmax(0, 1fr); }
}
