:root {
  --bg: #faf8f4;
  --bg-raised: #ffffff;
  --text: #24261f;
  --text-muted: #5b5d54;
  --accent: #2f6f5e;
  --accent-strong: #1e4d40;
  --border: #e4e0d6;
  --quote-bg: #f1ede2;
  --code-bg: #f1ede2;
  --link-visited: #4a6f8a;
  --max-width: 42rem;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #17181a;
    --bg-raised: #1f2123;
    --text: #e8e6df;
    --text-muted: #a4a79c;
    --accent: #7fc8ac;
    --accent-strong: #a6e0c8;
    --border: #33352f;
    --quote-bg: #202220;
    --code-bg: #202220;
    --link-visited: #9db8cc;
  }
}

:root[data-theme="dark"] {
  --bg: #17181a;
  --bg-raised: #1f2123;
  --text: #e8e6df;
  --text-muted: #a4a79c;
  --accent: #7fc8ac;
  --accent-strong: #a6e0c8;
  --border: #33352f;
  --quote-bg: #202220;
  --code-bg: #202220;
  --link-visited: #9db8cc;
}

:root[data-theme="light"] {
  --bg: #faf8f4;
  --bg-raised: #ffffff;
  --text: #24261f;
  --text-muted: #5b5d54;
  --accent: #2f6f5e;
  --accent-strong: #1e4d40;
  --border: #e4e0d6;
  --quote-bg: #f1ede2;
  --code-bg: #f1ede2;
  --link-visited: #4a6f8a;
}

* {
  box-sizing: border-box;
}

html {
  color-scheme: light dark;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: Georgia, "Iowan Old Style", "Palatino Linotype", "Book Antiqua", serif;
  font-size: 1.125rem;
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
}

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

header.site {
  border-bottom: 1px solid var(--border);
  padding: 2.5rem 0 1.75rem;
}

header.site .wrap {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}

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

.site-nav {
  display: flex;
  gap: 1.1rem;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif;
  font-size: 0.9rem;
}

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

.site-nav a:hover {
  color: var(--accent-strong);
  text-decoration: underline;
}

.brand {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif;
  font-size: 1.5rem;
  font-weight: 700;
  letter-spacing: -0.01em;
  color: var(--text);
  text-decoration: none;
}

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

.strapline {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif;
  color: var(--text-muted);
  font-size: 0.95rem;
  max-width: 34rem;
}

nav.crumbs {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif;
  font-size: 0.9rem;
}

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

nav.crumbs a:hover {
  color: var(--accent-strong);
  text-decoration: underline;
}

main {
  padding: 2.5rem 0 3rem;
}

h1, h2, h3 {
  font-weight: 700;
  line-height: 1.25;
  letter-spacing: -0.01em;
}

h1 {
  font-size: 2rem;
  margin: 0 0 0.6rem;
}

article h2 {
  font-size: 1.4rem;
  margin: 2.2rem 0 0.8rem;
}

article h3 {
  font-size: 1.15rem;
  margin: 1.8rem 0 0.6rem;
}

p {
  margin: 0 0 1.15rem;
}

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

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

.meta {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif;
  color: var(--text-muted);
  font-size: 0.9rem;
  margin-bottom: 2rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem 0.9rem;
  align-items: center;
}

.tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}

.tag {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif;
  font-size: 0.78rem;
  color: var(--text-muted);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 0.15rem 0.65rem;
  text-decoration: none;
}

blockquote {
  margin: 1.5rem 0;
  padding: 0.9rem 1.25rem;
  background: var(--quote-bg);
  border-left: 3px solid var(--accent);
  border-radius: 0 4px 4px 0;
  font-style: italic;
  color: var(--text);
}

blockquote p:last-child {
  margin-bottom: 0;
}

ul, ol {
  margin: 0 0 1.15rem;
  padding-left: 1.4rem;
}

li {
  margin-bottom: 0.4rem;
}

hr {
  border: none;
  border-top: 1px solid var(--border);
  margin: 2.5rem 0;
}

article > p:last-of-type em,
article > hr + p em {
  color: var(--text-muted);
  font-size: 0.95rem;
}

code {
  background: var(--code-bg);
  border-radius: 3px;
  padding: 0.1rem 0.35rem;
  font-size: 0.9em;
}

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

.post-list li {
  margin: 0 0 2.2rem;
  padding-bottom: 2.2rem;
  border-bottom: 1px solid var(--border);
}

.post-list li:last-child {
  border-bottom: none;
}

.post-list h2 {
  font-size: 1.3rem;
  margin: 0 0 0.4rem;
}

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

.post-list h2 a:hover {
  color: var(--accent-strong);
}

.post-list .desc {
  color: var(--text-muted);
  font-size: 1rem;
  margin: 0 0 0.6rem;
}

.intro {
  margin-bottom: 2.8rem;
  color: var(--text-muted);
  font-size: 1.05rem;
}

footer.site {
  border-top: 1px solid var(--border);
  padding: 2rem 0 3rem;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif;
  color: var(--text-muted);
  font-size: 0.85rem;
}

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

.back-link {
  display: inline-block;
  margin-bottom: 2rem;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif;
  font-size: 0.9rem;
  text-decoration: none;
  color: var(--text-muted);
}

.back-link:hover {
  color: var(--accent-strong);
}

.not-found {
  padding: 4rem 0;
  text-align: center;
}
