:root {
  color-scheme: light dark;
  --background: #f7f5f0;
  --surface: #fffdf8;
  --text: #25231f;
  --muted: #777166;
  --line: #ded9ce;
  --accent: #8a4b32;
  --measure: 44rem;
}

@media (prefers-color-scheme: dark) {
  :root {
    --background: #1d1c1a;
    --surface: #24221f;
    --text: #ece8df;
    --muted: #aaa398;
    --line: #3d3933;
    --accent: #d89573;
  }
}

* { box-sizing: border-box; }

html { font-size: 17px; }

body {
  margin: 0;
  background: var(--background);
  color: var(--text);
  font-family: ui-serif, "Songti SC", "Noto Serif CJK SC", Georgia, serif;
  line-height: 1.8;
  text-rendering: optimizeLegibility;
}

a {
  color: inherit;
  text-decoration-color: color-mix(in srgb, var(--accent) 55%, transparent);
  text-underline-offset: 0.2em;
}

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

.site-header,
main,
.site-footer {
  width: min(calc(100% - 2.5rem), var(--measure));
  margin-inline: auto;
}

.site-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-block: 1.4rem;
  border-bottom: 1px solid var(--line);
}

.site-title {
  font-weight: 700;
  letter-spacing: 0.03em;
  text-decoration: none;
}

nav { display: flex; gap: 1.1rem; }
nav a { text-decoration: none; }

main { min-height: calc(100vh - 10rem); }

.intro { padding: 6rem 0 3.2rem; }
.intro h1,
.page-header h1,
.article-header h1 {
  margin: 0;
  line-height: 1.25;
  letter-spacing: -0.025em;
}

.intro h1 { font-size: clamp(2.6rem, 8vw, 4.6rem); }
.intro p { margin: 0.8rem 0 0; color: var(--muted); font-size: 1.08rem; }
.page-header { padding: 4rem 0 2rem; }

.post-list { border-top: 1px solid var(--line); }
.post-item { padding: 1.8rem 0; border-bottom: 1px solid var(--line); }
.post-item time,
.article-header time { color: var(--muted); font-size: 0.86rem; }
.post-item h2 { margin: 0.2rem 0 0.45rem; font-size: 1.45rem; line-height: 1.4; }
.post-item h2 a { text-decoration: none; }
.post-item p { margin: 0; color: var(--muted); }

.article { padding: 5rem 0 3rem; }
.article-header { margin-bottom: 3rem; }
.article-header h1 { margin-bottom: 0.8rem; font-size: clamp(2rem, 6vw, 3.2rem); }
.article-body { font-size: 1.04rem; }
.article-body h2,
.article-body h3 { margin: 2.4em 0 0.7em; line-height: 1.4; }
.article-body p { margin: 1.3em 0; }
.article-body img { display: block; max-width: 100%; height: auto; margin: 2rem auto; }
.article-body blockquote {
  margin: 1.8rem 0;
  padding-left: 1.2rem;
  border-left: 3px solid var(--accent);
  color: var(--muted);
}
.article-body pre {
  overflow-x: auto;
  padding: 1rem;
  border: 1px solid var(--line);
  border-radius: 0.35rem;
  background: var(--surface);
  font-size: 0.88rem;
  line-height: 1.55;
}
.article-body code { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 0.9em; }

.tags { display: flex; flex-wrap: wrap; gap: 0.75rem; margin-top: 0.8rem; }
.tags a { color: var(--accent); text-decoration: none; font-size: 0.9rem; }
.empty { padding: 2.5rem 0; color: var(--muted); }

.pagination {
  align-items: center;
  justify-content: space-between;
  padding: 1.8rem 0;
  color: var(--muted);
  font-size: 0.9rem;
}

.site-footer {
  padding: 2rem 0 2.5rem;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 0.86rem;
}

.not-found { padding: 7rem 0; text-align: center; }
.not-found p { margin: 0; color: var(--muted); font-size: 4rem; line-height: 1; }

@media (max-width: 34rem) {
  html { font-size: 16px; }
  .site-header { align-items: flex-start; gap: 1rem; }
  .site-header nav { gap: 0.75rem; font-size: 0.92rem; }
  .intro { padding-top: 4.5rem; }
  .article { padding-top: 3.5rem; }
}

