:root {
  --text: #2c2c2c;
  --bg: #fafaf8;
  --muted: #8a8a8a;
  --rule: #e0ddd8;
  --measure: 38em;
}
@media (prefers-color-scheme: dark) {
  :root {
    --text: #d0d0d0;
    --bg: #1a1a19;
    --muted: #777;
    --rule: #333;
  }
}

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

body {
  font-family: Georgia, "Noto Serif CJK SC", "Source Han Serif SC", "Songti SC", serif;
  color: var(--text);
  background: var(--bg);
  font-size: 1.125rem;
  line-height: 1.8;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--text); }

/* — Nav — */
header nav {
  max-width: var(--measure);
  margin: 0 auto;
  padding: 2.5rem 1rem 0;
  display: flex;
  justify-content: space-between;
  align-items: baseline;
}
header nav a { text-decoration: none; }
header nav .brand {
  font-size: 1.05rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
header nav .nav-links a {
  color: var(--muted);
  font-size: 0.85rem;
  margin-left: 1.1em;
}
header nav .nav-links a:hover { color: var(--text); }

/* — Main — */
main {
  max-width: var(--measure);
  margin: 0 auto;
  padding: 2rem 1rem 4rem;
}

/* — Article list — */
.article-list { list-style: none; }
.article-list li {
  padding: 1.1rem 0;
  border-bottom: 1px solid var(--rule);
}
.article-list li:first-child { border-top: 1px solid var(--rule); }
.article-list .meta {
  font-size: 0.82rem;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
  margin-top: 0.15em;
}
.article-list .meta a { color: var(--muted); text-decoration: none; }
.article-list .meta a:hover { text-decoration: underline; }
.article-list a { text-decoration: none; }
.article-list a:hover { text-decoration: underline; }

/* — Article — */
article header {
  margin-bottom: 2rem;
  padding-bottom: 1.2rem;
  border-bottom: 1px solid var(--rule);
}
article h1 {
  font-size: 1.6rem;
  font-weight: 600;
  line-height: 1.35;
  margin-bottom: 0.4em;
}
article header .meta {
  color: var(--muted);
  font-size: 0.82rem;
  font-variant-numeric: tabular-nums;
}
article header .meta a { color: var(--muted); text-decoration: none; }
article header .meta a:hover { text-decoration: underline; }
article h2 { font-size: 1.25rem; margin: 2em 0 0.5em; }
article h3 { font-size: 1.1rem; margin: 1.5em 0 0.4em; }
article p { margin-bottom: 1em; }
article ul, article ol { margin: 0 0 1em; padding-left: 1.5em; }
article blockquote {
  border-left: 3px solid var(--rule);
  padding-left: 1em;
  color: var(--muted);
  margin: 1.2em 0;
}
article pre {
  background: color-mix(in srgb, var(--text) 8%, var(--bg));
  padding: 1em;
  overflow-x: auto;
  font-size: 0.88rem;
  line-height: 1.5;
  margin: 1.2em 0;
  border-radius: 3px;
}
article code { font-size: 0.88em; }
article img { max-width: 100%; height: auto; }
article hr {
  border: none;
  border-top: 1px solid var(--rule);
  margin: 2em 0;
}

/* — Footer — */
footer {
  max-width: var(--measure);
  margin: 0 auto;
  padding: 2rem 1rem;
  border-top: 1px solid var(--rule);
  color: var(--muted);
  font-size: 0.82rem;
}

/* — Home — */
.home h1 {
  font-size: 1.6rem;
  font-weight: 500;
  line-height: 1.35;
  margin: 1.5rem 0 1rem;
}
.home h2 {
  font-size: 0.9rem;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
  margin: 2.5em 0 0.5em;
}
.home p { margin-bottom: 1em; }
.home .all-link { font-size: 0.9rem; margin-top: 1.2em; }

/* — Index heading — */
main > h1 {
  font-size: 1.6rem;
  font-weight: 500;
  margin: 1rem 0 1.5rem;
}
