:root {
  --paper: #fbfaf6;
  --ink: #211f1c;
  --muted: #7c766c;
  --accent: #94402f;
  --rule: #e6e2d8;
}

@media (prefers-color-scheme: dark) {
  :root {
    --paper: #171614;
    --ink: #d9d5cc;
    --muted: #8d877c;
    --accent: #c97f66;
    --rule: #2c2a26;
  }
}

* { box-sizing: border-box; }

html {
  background: var(--paper);
}

body {
  margin: 0;
  color: var(--ink);
  font-family: "Source Serif 4", "Noto Serif KR", "Apple SD Gothic Neo", Georgia, serif;
  font-size: 1.0625rem;
  line-height: 1.72;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

:lang(ko) body,
body :lang(ko) {
  line-height: 1.9;
  word-break: keep-all;
  overflow-wrap: break-word;
}

main {
  max-width: 41rem;
  margin: 0 auto;
  padding: 4.5rem 1.4rem 3rem;
}

/* 한글은 전각 글자라 같은 폭에서 글줄이 더 짧게 느껴짐 — 한 뼘 넓힌다 */
html:lang(ko) main,
html:lang(ko) footer {
  max-width: 45rem;
}

h1 {
  font-size: 1.85rem;
  font-weight: 700;
  line-height: 1.35;
  letter-spacing: -0.012em;
  margin: 0 0 0.5rem;
}

h1 + p {
  margin-top: 0.2rem;
}

h2 {
  font-size: 1.26rem;
  font-weight: 600;
  line-height: 1.45;
  margin: 3.4rem 0 1.1rem;
}

p {
  margin: 1.35em 0;
}

small {
  color: var(--muted);
  font-size: 0.87em;
}

a {
  color: var(--accent);
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 0.22em;
  text-decoration-color: color-mix(in srgb, var(--accent) 42%, transparent);
  transition: text-decoration-color 120ms ease;
}

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

ul {
  padding-left: 1.3rem;
}

li {
  margin: 0.45em 0;
}

/* 참고 문헌 — 마지막 h2 이후의 목록은 한 급 낮춰 조용하게 */
h2:last-of-type {
  border-top: 1px solid var(--rule);
  padding-top: 2.2rem;
  font-size: 1.05rem;
}

h2:last-of-type ~ ul {
  font-size: 0.885rem;
  line-height: 1.65;
  color: var(--muted);
}

h2:last-of-type ~ ul a {
  color: inherit;
}

blockquote {
  margin: 1.6em 0;
  padding-left: 1.1rem;
  border-left: 2px solid var(--rule);
  color: var(--muted);
}

img {
  max-width: 100%;
}

::selection {
  background: color-mix(in srgb, var(--accent) 18%, transparent);
}

footer {
  max-width: 41rem;
  margin: 0 auto;
  padding: 1.6rem 1.4rem 4rem;
  border-top: 1px solid var(--rule);
  font-size: 0.85rem;
  color: var(--muted);
}

footer a {
  color: inherit;
}

@media (max-width: 480px) {
  main { padding-top: 3rem; }
  body { font-size: 1rem; }
  h1 { font-size: 1.55rem; }
}
