@import url('https://fonts.googleapis.com/css2?family=Noto+Sans+KR:wght@400;500;700&family=Inter:wght@400;500;600;700&display=swap');

:root {
  --bg: #0a0a0a;
  --bg-card: #111111;
  --bg-hover: #1a1a1a;
  --text: #e8e8e8;
  --text-muted: #888;
  --accent: #6366f1;
  --accent-hover: #818cf8;
  --border: #222;
  --font-en: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  --font-ko: 'Noto Sans KR', sans-serif;
  --max-width: 720px;
}

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

html {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-en);
  font-size: 17px;
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
}

body {
  min-height: 100vh;
  padding: 0;
}

/* ── Layout ── */
.container {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 2rem 1.5rem;
}

/* ── Header ── */
header {
  border-bottom: 1px solid var(--border);
  padding: 1.5rem 0;
  margin-bottom: 3rem;
}

header .inner {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 1.5rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

header .site-title {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--text);
  text-decoration: none;
  letter-spacing: -0.02em;
}

header .site-title:hover { color: var(--accent-hover); }

header nav a {
  color: var(--text-muted);
  text-decoration: none;
  font-size: 0.9rem;
  margin-left: 1.5rem;
  transition: color 0.15s;
}
header nav a:hover { color: var(--text); }

/* ── Footer ── */
footer {
  border-top: 1px solid var(--border);
  margin-top: 5rem;
  padding: 2rem 1.5rem;
  text-align: center;
  color: var(--text-muted);
  font-size: 0.85rem;
}

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

/* ── Homepage post list ── */
.post-list {
  display: flex;
  flex-direction: column;
  gap: 0;
}

.post-item {
  display: flex;
  align-items: baseline;
  gap: 1.5rem;
  padding: 1rem 0;
  border-bottom: 1px solid var(--border);
  text-decoration: none;
  color: inherit;
  transition: background 0.15s;
}

.post-item:hover .post-title {
  color: var(--accent-hover);
}

.post-date {
  color: var(--text-muted);
  font-size: 0.8rem;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
  min-width: 90px;
}

.post-title {
  font-size: 1rem;
  font-weight: 500;
  color: var(--text);
  transition: color 0.15s;
  line-height: 1.4;
}

.post-lang-badge {
  font-size: 0.7rem;
  padding: 0.15rem 0.4rem;
  border-radius: 4px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  color: var(--text-muted);
  white-space: nowrap;
  margin-left: auto;
}

/* ── Article ── */
article {
  max-width: var(--max-width);
}

.article-header {
  margin-bottom: 2.5rem;
  padding-bottom: 1.5rem;
  border-bottom: 1px solid var(--border);
}

.article-header h1 {
  font-size: 1.9rem;
  font-weight: 700;
  line-height: 1.25;
  letter-spacing: -0.025em;
  margin-bottom: 0.75rem;
}

.article-meta {
  color: var(--text-muted);
  font-size: 0.85rem;
}

/* ── Body content typography ── */
.prose {
  font-size: 1rem;
  line-height: 1.8;
}

.prose.lang-ko {
  font-family: var(--font-ko);
  word-break: keep-all;
}

.prose h1, .prose h2, .prose h3, .prose h4 {
  font-weight: 700;
  margin: 2rem 0 0.75rem;
  line-height: 1.3;
  letter-spacing: -0.015em;
}

.prose h1 { font-size: 1.6rem; }
.prose h2 { font-size: 1.35rem; }
.prose h3 { font-size: 1.15rem; }
.prose h4 { font-size: 1rem; }

.prose p { margin: 1.25rem 0; }

.prose a {
  color: var(--accent);
  text-decoration: underline;
  text-underline-offset: 3px;
  transition: color 0.15s;
}
.prose a:hover { color: var(--accent-hover); }

.prose blockquote {
  border-left: 3px solid var(--accent);
  margin: 1.75rem 0;
  padding: 0.5rem 0 0.5rem 1.25rem;
  color: var(--text-muted);
  font-style: italic;
}

.prose blockquote p { margin: 0.25rem 0; }

.prose ul, .prose ol {
  padding-left: 1.5rem;
  margin: 1.25rem 0;
}

.prose li { margin: 0.4rem 0; }

.prose strong { font-weight: 600; color: var(--text); }
.prose em { font-style: italic; }

.prose img {
  max-width: 100%;
  height: auto;
  border-radius: 8px;
  margin: 1.5rem 0;
  border: 1px solid var(--border);
}

.prose code {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 0.1em 0.4em;
  font-size: 0.88em;
}

.prose pre {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 1.25rem;
  overflow-x: auto;
  margin: 1.5rem 0;
}

.prose pre code {
  background: none;
  border: none;
  padding: 0;
  font-size: 0.88em;
}

.prose hr {
  border: none;
  border-top: 1px solid var(--border);
  margin: 2.5rem 0;
}

/* ── Back link ── */
.back-link {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  color: var(--text-muted);
  text-decoration: none;
  font-size: 0.9rem;
  margin-bottom: 2rem;
  transition: color 0.15s;
}
.back-link:hover { color: var(--text); }

/* ── Home hero ── */
.home-hero {
  margin-bottom: 3rem;
  padding-bottom: 2rem;
  border-bottom: 1px solid var(--border);
}

.home-hero h1 {
  font-size: 2rem;
  font-weight: 700;
  letter-spacing: -0.03em;
  margin-bottom: 0.5rem;
}

.home-hero p {
  color: var(--text-muted);
  font-size: 1rem;
}

.home-hero .social-links {
  margin-top: 1rem;
  display: flex;
  gap: 1rem;
}

.home-hero .social-links a {
  color: var(--text-muted);
  text-decoration: none;
  font-size: 0.9rem;
  transition: color 0.15s;
}

.home-hero .social-links a:hover { color: var(--accent-hover); }

/* ── Lang filter ── */
.lang-filter {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 1.5rem;
}

.lang-btn {
  padding: 0.3rem 0.8rem;
  border-radius: 20px;
  border: 1px solid var(--border);
  background: transparent;
  color: var(--text-muted);
  font-size: 0.8rem;
  cursor: pointer;
  transition: all 0.15s;
  font-family: inherit;
}

.lang-btn:hover,
.lang-btn.active {
  background: var(--accent);
  border-color: var(--accent);
  color: white;
}

/* ── Responsive ── */
@media (max-width: 640px) {
  html { font-size: 16px; }
  .article-header h1 { font-size: 1.5rem; }
  .home-hero h1 { font-size: 1.5rem; }
  .post-item { flex-wrap: wrap; gap: 0.25rem; }
  .post-date { min-width: auto; }
  .post-lang-badge { margin-left: 0; }
}
