/* paper: Charter serif on white, 20px body text, left-aligned posts,
   and an author note after each post. */

:root {
  color-scheme: light dark;
  --serif: Charter, "Bitstream Charter", "Sitka Text", Cambria, Georgia, serif;
  --mono: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  --accent: #9c3d1f;
  /* White, with the warmth carried by the accent, rules and code blocks. */
  --bg: #ffffff;
  --text: #1a1a1a;
  --muted: #625b54;
  --rule: #ece4d8;
  --code-bg: #f8f4ed;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #1c1a17;
    --text: #ece6dc;
    --muted: #a39a8e;
    --rule: #3a3530;
    --accent: #e39a74;
    --code-bg: #26231f;
  }
}

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

html {
  font-size: 112.5%;
  -webkit-text-size-adjust: 100%;
  background: var(--bg);
}

body {
  margin: 0 auto;
  max-width: 39rem;
  padding: 3rem 1.25rem 4rem;
  background: var(--bg);
  color: var(--text);
  font-family: var(--serif);
  line-height: 1.65;
  text-rendering: optimizeLegibility;
}


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

/* Header and footer */

.site-header {
  text-align: center;
  margin-bottom: 3.5rem;
}
.site-title {
  color: var(--text);
  text-decoration: none;
  font-size: 1.5rem;
  letter-spacing: 0.01em;
}
.site-header nav {
  margin-top: 0.35rem;
  font-variant: small-caps;
  letter-spacing: 0.06em;
}
.site-header nav a {
  color: var(--muted);
  text-decoration: none;
  margin: 0 0.6rem;
  text-transform: lowercase;
}
.site-header nav a:hover { color: var(--accent); }

.site-footer {
  margin-top: 4rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--rule);
  text-align: center;
  color: var(--muted);
  font-size: 0.85rem;
}

/* Lists of posts */

.page-title { font-size: 2rem; font-weight: normal; margin: 0 0 2rem; }

.list-heading {
  font-size: 0.85rem;
  font-weight: normal;
  font-variant: small-caps;
  text-transform: lowercase;
  letter-spacing: 0.08em;
  color: var(--muted);
  margin: 2.5rem 0 1rem;
  padding-bottom: 0.4rem;
  border-bottom: 1px solid var(--rule);
}

.post-list { list-style: none; padding: 0; margin: 0; }
.post-list li { margin-bottom: 1.4rem; }
.post-link { color: var(--text); text-decoration: none; font-size: 1.25rem; }
.post-link:hover { color: var(--accent); }
.post-list time {
  display: block;
  color: var(--muted);
  font-size: 0.85rem;
  font-style: italic;
}
.post-list p { margin: 0.25rem 0 0; color: var(--muted); }

.intro { font-size: 1.15rem; }
.more, .back { margin-top: 2.5rem; }

/* Single post */

.post-header { margin-bottom: 2.75rem; }
.post-header h1 {
  font-size: 2.3rem;
  font-weight: normal;
  line-height: 1.18;
  margin: 0 0 0.6rem;
}
.subtitle {
  font-size: 1.2rem;
  font-style: italic;
  line-height: 1.45;
  color: var(--muted);
  margin: 0 0 1rem;
}
.post-header .meta { color: var(--muted); margin: 0; font-size: 0.85rem; letter-spacing: 0.02em; }

/* Prose: 20px body text */

.prose { font-size: 1.111rem; line-height: 1.6; }

.prose h2, .prose h3 { font-weight: bold; line-height: 1.3; margin: 2.5rem 0 0.75rem; }
.prose h2 { font-size: 1.3rem; }
.prose h3 { font-size: 1.1rem; }
.prose h2 a, .prose h3 a { color: inherit; text-decoration: none; }

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

.prose blockquote {
  margin: 1.75rem 0;
  padding: 0 1.25rem;
  border-left: 2px solid var(--accent);
  font-style: italic;
}

.prose hr {
  border: 0;
  margin: 2.5rem 0;
  text-align: center;
}
.prose hr::after { content: "⁂"; color: var(--muted); }

code { font-family: var(--mono); font-size: 0.82em; }
:not(pre) > code { background: var(--code-bg); padding: 0.1em 0.3em; border-radius: 3px; }

pre {
  font-size: 0.8rem;
  line-height: 1.55;
  padding: 1rem 1.25rem;
  overflow-x: auto;
  border-radius: 4px;
  border: 1px solid var(--rule);
  /* The highlighter inlines a white background; blend with the page instead. */
  background-color: var(--code-bg) !important;
}
pre code { font-size: 1em; }

table { border-collapse: collapse; width: 100%; font-size: 0.9em; margin: 1.5rem 0; }
th, td { padding: 0.4rem 0.6rem; border-bottom: 1px solid var(--rule); text-align: left; }
th { font-weight: bold; }

.footnotes {
  margin-top: 3rem;
  padding-top: 1rem;
  border-top: 1px solid var(--rule);
  font-size: 0.85rem;
  color: var(--muted);
}
.footnote-reference { font-size: 0.75em; }
.footnote-reference a { text-decoration: none; }

/* Author note after each post */

.author-note {
  margin-top: 3.5rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--rule);
  font-style: italic;
  color: var(--muted);
}
.author-note p { margin: 0; }
