:root {
  --text: #1f2933;
  --muted: #52606d;
  --line: #d9e2ec;
  --bg: #ffffff;
  --soft: #f5f7fa;
  --measure: 42rem;
  color-scheme: light;
}

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

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: "Pretendard", "Apple SD Gothic Neo", "Noto Sans KR", "Malgun Gothic", system-ui, sans-serif;
  font-size: 1.0625rem;
  line-height: 1.8;
  word-break: keep-all;
  overflow-wrap: anywhere;
}

.wrap { width: min(100% - 2.5rem, var(--measure)); margin-inline: auto; }

a { color: var(--accent); text-underline-offset: 0.2em; }
a:hover { text-decoration-thickness: 2px; }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }

.skip-link { position: absolute; left: 1rem; top: -3rem; padding: 0.5rem 1rem; background: var(--bg); border: 2px solid var(--accent); }
.skip-link:focus { top: 1rem; }

.site-header { border-top: 4px solid var(--accent); border-bottom: 1px solid var(--line); }
.site-header .wrap { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 0.5rem 1.5rem; padding-block: 1rem; }
.site-name { color: var(--text); font-weight: 700; font-size: 1.125rem; text-decoration: none; }
.site-name img { display: block; height: 2rem; width: auto; }
.site-header nav { display: flex; gap: 1rem; }

main { padding-block: 2.5rem 4rem; }

h1, h2, h3, h4 { line-height: 1.35; margin: 2.2em 0 0.6em; }
h1 { font-size: clamp(1.75rem, 1.4rem + 1.6vw, 2.25rem); margin-top: 0; }
h2 { font-size: 1.5rem; }
h3 { font-size: 1.25rem; }
p, ul, ol, blockquote, table, figure { margin: 0 0 1.2em; }

.lead { color: var(--muted); font-size: 1.125rem; }
.meta, .category { color: var(--muted); font-size: 0.9375rem; margin-bottom: 0.5rem; }

.post-header { margin-bottom: 2rem; }
.post-body img, .cover img, .profile img { max-width: 100%; height: auto; }
.cover { margin-inline: 0; }
figure { margin-inline: 0; }
figcaption { color: var(--muted); font-size: 0.875rem; margin-top: 0.4rem; }

blockquote { margin-inline: 0; padding: 0.2rem 1.2rem; border-left: 4px solid var(--line); color: var(--muted); }

.post-body table { display: block; max-width: 100%; overflow-x: auto; border-collapse: collapse; }
.post-body th, .post-body td { border: 1px solid var(--line); padding: 0.4rem 0.75rem; vertical-align: top; }
.post-body th { background: var(--soft); }
.post-body td p, .post-body th p { margin: 0; }

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

.tags { display: flex; flex-wrap: wrap; gap: 0.5rem; list-style: none; padding: 0; margin-top: 2.5rem; }
.tags a { display: inline-block; padding: 0.2rem 0.7rem; border: 1px solid var(--line); border-radius: 999px; text-decoration: none; font-size: 0.9375rem; }

.author { display: flex; gap: 1rem; align-items: flex-start; margin-top: 2.5rem; padding: 1.25rem; background: var(--soft); border-radius: 8px; }
.author img, .avatar { border-radius: 50%; flex: none; }
.author p { margin: 0 0 0.4rem; }
.author-name { font-weight: 700; }

.post-list { list-style: none; padding: 0; margin: 2rem 0 0; }
.post-list > li { padding-block: 1.5rem; border-top: 1px solid var(--line); }
.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 { text-decoration: underline; }
.post-list p { margin: 0 0 0.4rem; }
.post-list.compact > li { padding-block: 0.75rem; }
.post-list.compact time { color: var(--muted); font-size: 0.875rem; margin-left: 0.5rem; }

.pager { display: flex; justify-content: space-between; margin-top: 2rem; }

.site-footer { border-top: 1px solid var(--line); color: var(--muted); font-size: 0.9375rem; padding-block: 2rem; }
.site-footer p { margin: 0 0 0.3rem; }

.tc-red { color: #b42318; }
.tc-orange { color: #b54708; }
.tc-green { color: #067647; }
.tc-blue { color: #175cd3; }
.tc-purple { color: #6941c6; }
.tc-gray { color: #52606d; }
.fs-sm { font-size: 0.875rem; }
.fs-lg { font-size: 1.25rem; }
.fs-xl { font-size: 1.5rem; }
.ta-center { text-align: center; }
.ta-right { text-align: right; }

@media (max-width: 40rem) {
  body { font-size: 1rem; }
  main { padding-block: 1.75rem 3rem; }
  .author { flex-direction: column; }
}
