:root {
  --bg: #fbfaf7;
  --fg: #1f1d1a;
  --fg-muted: #6b665d;
  --fg-subtle: #9a958b;
  --border: #e8e4dc;
  --accent: #7a5af8;
  --code-bg: #f3f1ec;
  --content-width: 720px;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #15141a;
    --fg: #e8e6e1;
    --fg-muted: #9a958b;
    --fg-subtle: #6b665d;
    --border: #2a2830;
    --accent: #a78bfa;
    --code-bg: #1e1d24;
  }
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  font-family: 'Inter', 'Noto Sans KR', -apple-system, BlinkMacSystemFont, sans-serif;
  background: var(--bg);
  color: var(--fg);
  line-height: 1.65;
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

.container {
  max-width: var(--content-width);
  margin: 0 auto;
  padding: 0 1.5rem;
}

/* Header */
.site-header {
  padding: 3rem 0 2rem;
  border-bottom: 1px solid var(--border);
  margin-bottom: 3rem;
}
.site-title {
  display: inline-block;
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--fg);
  text-decoration: none;
  letter-spacing: -0.01em;
}
.site-title:hover { color: var(--accent); }
.site-tagline {
  margin: 0.25rem 0 0;
  color: var(--fg-muted);
  font-size: 0.95rem;
}

/* Post list */
.post-list { display: flex; flex-direction: column; gap: 2.5rem; padding-bottom: 4rem; }
.post-item {
  padding-bottom: 2.5rem;
  border-bottom: 1px solid var(--border);
}
.post-item:last-child { border-bottom: none; }
.post-date {
  display: block;
  font-size: 0.85rem;
  color: var(--fg-subtle);
  margin-bottom: 0.4rem;
  font-variant-numeric: tabular-nums;
}
.post-title {
  margin: 0 0 0.6rem;
  font-size: 1.5rem;
  font-weight: 600;
  letter-spacing: -0.015em;
  line-height: 1.3;
}
.post-title a {
  color: var(--fg);
  text-decoration: none;
}
.post-title a:hover { color: var(--accent); }
.post-summary {
  margin: 0 0 0.8rem;
  color: var(--fg-muted);
  font-size: 1rem;
}
.post-tags { display: flex; flex-wrap: wrap; gap: 0.4rem; }
.tag {
  font-size: 0.78rem;
  color: var(--fg-subtle);
}

/* Back link */
.back-link {
  display: inline-block;
  margin-bottom: 2rem;
  color: var(--fg-muted);
  text-decoration: none;
  font-size: 0.9rem;
}
.back-link:hover { color: var(--accent); }

/* Single post */
.post { padding-bottom: 4rem; }
.post-header {
  margin-bottom: 2.5rem;
  padding-bottom: 1.5rem;
  border-bottom: 1px solid var(--border);
}
.post-header h1 {
  margin: 0.3rem 0 0.5rem;
  font-size: 2.2rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.2;
}

/* Markdown content */
.post-content {
  font-family: 'Lora', 'Noto Sans KR', Georgia, serif;
  font-size: 1.05rem;
  line-height: 1.8;
  color: var(--fg);
}
.post-content > * { margin: 0 0 1.2rem; }
.post-content h1,
.post-content h2,
.post-content h3,
.post-content h4 {
  font-family: 'Inter', 'Noto Sans KR', sans-serif;
  font-weight: 600;
  letter-spacing: -0.015em;
  line-height: 1.3;
  margin: 2rem 0 0.8rem;
}
.post-content h1 { font-size: 1.7rem; }
.post-content h2 { font-size: 1.4rem; }
.post-content h3 { font-size: 1.2rem; }
.post-content h4 { font-size: 1.05rem; }
.post-content p { margin: 0 0 1.2rem; }
.post-content a {
  color: var(--accent);
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
}
.post-content a:hover { text-decoration-thickness: 2px; }
.post-content strong { font-weight: 600; color: var(--fg); }
.post-content em { font-style: italic; }
.post-content ul,
.post-content ol { padding-left: 1.5rem; }
.post-content li { margin-bottom: 0.3rem; }
.post-content blockquote {
  margin: 1.5rem 0;
  padding: 0.5rem 1.2rem;
  border-left: 3px solid var(--accent);
  color: var(--fg-muted);
  font-style: italic;
}
.post-content code {
  font-family: 'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 0.9em;
  background: var(--code-bg);
  padding: 0.15em 0.4em;
  border-radius: 4px;
}
.post-content pre {
  background: var(--code-bg);
  padding: 1rem 1.2rem;
  border-radius: 8px;
  overflow-x: auto;
  font-size: 0.9rem;
  line-height: 1.55;
}
.post-content pre code {
  background: transparent;
  padding: 0;
  font-size: inherit;
}
.post-content hr {
  border: none;
  border-top: 1px solid var(--border);
  margin: 2.5rem 0;
}
.post-content img {
  max-width: 100%;
  height: auto;
  border-radius: 6px;
}
.post-content table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.95rem;
}
.post-content th,
.post-content td {
  padding: 0.6rem 0.8rem;
  border: 1px solid var(--border);
  text-align: left;
}
.post-content th {
  background: var(--code-bg);
  font-weight: 600;
}

/* Loading / empty states */
.loading, .empty {
  color: var(--fg-muted);
  text-align: center;
  padding: 2rem 0;
}

/* Footer */
.site-footer {
  margin-top: 4rem;
  padding: 2rem 0;
  border-top: 1px solid var(--border);
  color: var(--fg-subtle);
  font-size: 0.85rem;
  text-align: center;
}
.site-footer p { margin: 0; }

/* Responsive */
@media (max-width: 640px) {
  body { font-size: 15px; }
  .site-header { padding: 2rem 0 1.5rem; margin-bottom: 2rem; }
  .site-title { font-size: 1.3rem; }
  .post-header h1 { font-size: 1.7rem; }
  .post-title { font-size: 1.3rem; }
}
