/* ── Reset & Base ── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --bg: #F5F0EB;
  --bg-card: #FFFBF5;
  --bg-card-hover: #FFF8EF;
  --bg-soft: #EDE7E0;
  --text: #2C2420;
  --text-muted: #6B5E54;
  --text-dim: #9B8E84;
  --accent: #8b5cf6;
  --accent-hover: #7c3aed;
  --accent-soft: rgba(139, 92, 246, 0.08);
  --accent-soft-hover: rgba(139, 92, 246, 0.14);
  --border: #E8E0D8;
  --border-hover: #D4C9BF;
  --radius: 12px;
  --radius-lg: 16px;
  --max-w: 720px;
  --font: 'Pretendard', -apple-system, 'Noto Sans KR', system-ui, sans-serif;
  --mono: 'JetBrains Mono', 'Pretendard', monospace;
  --shadow-sm: 0 1px 3px rgba(44, 36, 32, 0.06);
  --shadow: 0 2px 8px rgba(44, 36, 32, 0.07);
  --shadow-lg: 0 4px 16px rgba(44, 36, 32, 0.09);
  --shadow-xl: 0 8px 32px rgba(44, 36, 32, 0.12);
}

html { font-size: 16px; scroll-behavior: smooth; }

body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  line-height: 1.75;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

a { color: var(--accent); text-decoration: none; transition: color .2s; }
a:hover { color: var(--accent-hover); }
img { max-width: 100%; height: auto; }
code { font-family: var(--mono); font-size: 0.88em; background: var(--bg-soft); padding: 0.15em 0.45em; border-radius: 5px; color: var(--text); }
pre { background: var(--bg-card); padding: 1.2em; border-radius: var(--radius); overflow-x: auto; border: 1px solid var(--border); box-shadow: var(--shadow-sm); }
pre code { background: none; padding: 0; }

::selection { background: var(--accent-soft); }

/* ── Header ── */
.header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(245, 240, 235, 0.82);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--border);
}
.nav {
  max-width: 900px;
  margin: 0 auto;
  padding: 0 1.5rem;
  height: 58px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.logo {
  font-weight: 700;
  font-size: 1.1rem;
  color: var(--text) !important;
  letter-spacing: -0.01em;
}
.nav-links { display: flex; gap: 1.5rem; }
.nav-links a { color: var(--text-muted) !important; font-size: 0.88rem; font-weight: 500; }
.nav-links a:hover { color: var(--text) !important; }

/* ── Main ── */
.main {
  flex: 1;
  max-width: 900px;
  width: 100%;
  margin: 0 auto;
  padding: 2rem 1.5rem 3rem;
}

/* ── Hero ── */
.hero {
  text-align: center;
  padding: 3.5rem 0 2.5rem;
}
.hero-emoji {
  font-size: 2.5rem;
  margin-bottom: 0.75rem;
  display: block;
}
.hero-title { font-size: 2.2rem; font-weight: 700; margin-bottom: 0.5rem; letter-spacing: -0.02em; }
.hero-desc { font-size: 1.15rem; color: var(--text-muted); }
.hero-sub { font-size: 0.95rem; color: var(--text-dim); margin-top: 0.5rem; }

/* ── Section ── */
.section { margin-bottom: 3rem; }
.section-title {
  font-size: 1.25rem;
  font-weight: 600;
  margin-bottom: 1rem;
  letter-spacing: -0.01em;
}
.section-desc { color: var(--text-muted); margin-bottom: 1rem; font-size: 0.95rem; }
.section-more { text-align: center; margin-top: 1.5rem; }
.section-cta {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 2.5rem 2rem;
  text-align: center;
  box-shadow: var(--shadow);
}
.section-cta .section-desc { max-width: 440px; margin: 0.5rem auto 1.25rem; }

/* ── Buttons ── */
.btn {
  display: inline-block;
  padding: 0.6rem 1.4rem;
  border-radius: 8px;
  font-weight: 600;
  font-size: 0.88rem;
  transition: all .2s;
  border: 1px solid var(--border);
  background: var(--bg-card);
  color: var(--text) !important;
  box-shadow: var(--shadow-sm);
}
.btn:hover { border-color: var(--accent); color: var(--accent) !important; box-shadow: var(--shadow); }
.btn-primary {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff !important;
  box-shadow: 0 2px 8px rgba(139, 92, 246, 0.25);
}
.btn-primary:hover { background: var(--accent-hover); border-color: var(--accent-hover); box-shadow: 0 4px 12px rgba(139, 92, 246, 0.35); }

/* ── Post Card ── */
.post-list { display: flex; flex-direction: column; gap: 0.35rem; }
.post-card { border-radius: var(--radius); }
.post-card-link {
  display: block;
  padding: 1rem 1.25rem;
  border-radius: var(--radius);
  transition: all .2s;
  border: 1px solid transparent;
}
.post-card-link:hover { background: var(--bg-card); border-color: var(--border); box-shadow: var(--shadow-sm); }
.post-card-meta { display: flex; align-items: center; gap: 0.75rem; margin-bottom: 0.25rem; }
.post-card-meta time { font-size: 0.78rem; color: var(--text-dim); font-family: var(--mono); }
.post-card-date { font-size: 0.78rem; color: var(--text-dim); font-family: var(--mono); }
.post-series { font-size: 0.78rem; color: var(--accent); font-weight: 500; }
.post-card-title { font-size: 1rem; font-weight: 600; line-height: 1.4; color: var(--text); }
.post-card-excerpt { font-size: 0.85rem; color: var(--text-muted); margin-top: 0.25rem; line-height: 1.5; }

/* ── Post ── */
.post { max-width: var(--max-w); }
.post-header { margin-bottom: 2rem; padding-bottom: 1.5rem; border-bottom: 1px solid var(--border); }
.post-meta { display: flex; align-items: center; gap: 0.75rem; margin-bottom: 0.5rem; }
.post-meta time { font-size: 0.83rem; color: var(--text-dim); font-family: var(--mono); }
.post-title { font-size: 1.75rem; font-weight: 700; line-height: 1.3; letter-spacing: -0.02em; }
.post-subtitle { font-size: 1.05rem; color: var(--text-muted); margin-top: 0.4rem; }

/* ── Post Content (typography) ── */
.post-content { line-height: 1.85; }
.post-content h2 {
  font-size: 1.35rem;
  font-weight: 700;
  margin: 2.25rem 0 0.75rem;
  letter-spacing: -0.01em;
  padding-top: 0.5rem;
}
.post-content h3 { font-size: 1.12rem; font-weight: 600; margin: 1.75rem 0 0.5rem; }
.post-content h4 { font-size: 1rem; font-weight: 600; margin: 1.5rem 0 0.4rem; color: var(--text-muted); }
.post-content p { margin-bottom: 1rem; color: var(--text); }
.post-content ul, .post-content ol { margin-bottom: 1rem; padding-left: 1.5rem; }
.post-content li { margin-bottom: 0.35rem; }
.post-content li::marker { color: var(--text-dim); }
.post-content strong { color: var(--text); font-weight: 600; }
.post-content blockquote {
  border-left: 3px solid var(--accent);
  padding: 0.75rem 1rem;
  margin: 1.5rem 0;
  background: var(--accent-soft);
  border-radius: 0 var(--radius) var(--radius) 0;
  color: var(--text-muted);
  font-style: italic;
}
.post-content hr {
  border: none;
  border-top: 1px solid var(--border);
  margin: 2rem 0;
}
.post-content img { border-radius: var(--radius); margin: 1.5rem 0; box-shadow: var(--shadow); }
.post-content a { font-weight: 500; }
.post-content table {
  width: 100%;
  border-collapse: collapse;
  margin: 1rem 0;
  font-size: 0.9rem;
}
.post-content th, .post-content td {
  padding: 0.6rem 0.75rem;
  border: 1px solid var(--border);
  text-align: left;
}
.post-content th { background: var(--bg-soft); font-weight: 600; }

.post-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-top: 2rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--border);
}
.tag {
  font-size: 0.78rem;
  padding: 0.2rem 0.55rem;
  background: var(--accent-soft);
  border-radius: 6px;
  color: var(--accent);
  font-weight: 500;
}

.post-nav {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  margin-top: 2rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--border);
}
.post-nav a { color: var(--text-muted) !important; font-size: 0.88rem; font-weight: 500; }
.post-nav a:hover { color: var(--accent) !important; }
.post-nav .prev { max-width: 45%; }
.post-nav .next { max-width: 45%; text-align: right; }

/* ── Series Grid ── */
.series-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 0.75rem;
}
.series-card {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  padding: 1.1rem 1.2rem;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  transition: all .2s;
  color: var(--text) !important;
  box-shadow: var(--shadow-sm);
}
.series-card:hover { border-color: var(--accent); box-shadow: var(--shadow); background: var(--bg-card-hover); }
.series-card-icon { font-size: 1.4rem; flex-shrink: 0; margin-top: 0.1rem; }
.series-card-text { min-width: 0; }
.series-card h3 { font-size: 0.95rem; font-weight: 600; margin-bottom: 0.15rem; }
.series-card p { font-size: 0.78rem; color: var(--text-dim); }

/* ── Series List ── */
.series-group { margin-bottom: 2.5rem; }
.series-name {
  font-size: 1.15rem;
  font-weight: 600;
  margin-bottom: 0.75rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid var(--border);
}

/* ── About ── */
.about { max-width: var(--max-w); }
.about h1 { font-size: 1.75rem; font-weight: 700; margin-bottom: 1rem; letter-spacing: -0.02em; }
.about h2 { font-size: 1.2rem; font-weight: 600; margin: 2rem 0 0.75rem; }
.about p { color: var(--text-muted); margin-bottom: 0.75rem; line-height: 1.8; }
.about ul { list-style: none; padding: 0; }
.about li {
  padding: 0.65rem 0;
  border-bottom: 1px solid var(--border);
  display: flex;
  justify-content: space-between;
  align-items: center;
  color: var(--text-muted);
}
.about li strong { color: var(--text); }

/* ── About Profile Card ── */
.profile-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 2rem;
  box-shadow: var(--shadow);
  text-align: center;
  margin-bottom: 2rem;
}
.profile-emoji { font-size: 3rem; margin-bottom: 0.75rem; }
.profile-name { font-size: 1.25rem; font-weight: 700; margin-bottom: 0.25rem; }
.profile-bio { font-size: 0.9rem; color: var(--text-muted); }

/* ── Page Title ── */
.page-title { font-size: 1.75rem; font-weight: 700; margin-bottom: 1.5rem; letter-spacing: -0.02em; }
.empty { color: var(--text-dim); font-style: italic; }

/* ── Pagination ── */
.pagination {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 1.5rem;
  margin-top: 2rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--border);
}
.page-num { color: var(--text-dim); font-size: 0.88rem; }
.pagination a { color: var(--text-muted) !important; font-weight: 500; }
.pagination a:hover { color: var(--accent) !important; }

/* ── Footer ── */
.footer {
  text-align: center;
  padding: 2rem 1rem;
  border-top: 1px solid var(--border);
  color: var(--text-dim);
  font-size: 0.82rem;
}
.footer a { color: var(--text-muted) !important; }

/* ── Responsive ── */
@media (max-width: 640px) {
  .hero { padding: 2.5rem 0 2rem; }
  .hero-title { font-size: 1.7rem; }
  .hero-desc { font-size: 1rem; }
  .nav-links { gap: 1rem; }
  .nav-links a { font-size: 0.82rem; }
  .main { padding: 1.25rem 1rem 2rem; }
  .post-title { font-size: 1.4rem; }
  .series-grid { grid-template-columns: 1fr; }
  .section-cta { padding: 1.75rem 1.25rem; }
  .post-nav { flex-direction: column; gap: 0.75rem; }
  .post-nav .prev, .post-nav .next { max-width: 100%; text-align: left; }
}
