:root {
  --bg: #ffffff;
  --surface: #f8f9fb;
  --border: #e5e8eb;
  --text: #191f28;
  --text-muted: #4e5968;
  --accent: #1b64da;
  --accent-soft: #eaf2ff;
  --warn-bg: #fff8eb;
  --warn-border: #f5d28c;
  --max-w: 740px;
}

* {
  box-sizing: border-box;
}

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

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Apple SD Gothic Neo", "Noto Sans KR",
    "Malgun Gothic", sans-serif;
  line-height: 1.75;
  word-break: keep-all;
}

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

a:hover {
  text-decoration: underline;
}

.container {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 0 20px;
}

/* Header */
.site-header {
  border-bottom: 1px solid var(--border);
  background: var(--bg);
  position: sticky;
  top: 0;
  z-index: 10;
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: 58px;
}

.site-brand {
  font-size: 1.125rem;
  font-weight: 800;
  color: var(--text);
  letter-spacing: -0.02em;
}

.site-brand:hover {
  text-decoration: none;
}

.site-nav {
  display: flex;
  gap: 16px;
  font-size: 0.94rem;
}

.site-nav a {
  color: var(--text-muted);
  font-weight: 500;
}

.site-nav a:hover {
  color: var(--text);
}

/* Main */
.main-content {
  padding-top: 28px;
  padding-bottom: 56px;
  min-height: calc(100vh - 180px);
}

.home-hero {
  padding-bottom: 20px;
  margin-bottom: 24px;
  border-bottom: 1px solid var(--border);
}

.home-title {
  margin: 0 0 6px;
  font-size: 1.6rem;
  letter-spacing: -0.03em;
}

.home-subtitle {
  margin: 0;
  color: var(--text-muted);
  font-size: 0.96rem;
}

.section-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin-bottom: 12px;
}

.section-head h2 {
  margin: 0;
  font-size: 1.05rem;
  color: var(--text-muted);
}

.count-label {
  font-size: 0.875rem;
  color: var(--text-muted);
}

/* Title-first Post List */
.post-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.post-card {
  padding: 20px 0;
  border-bottom: 1px solid var(--border);
}

.post-meta {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-bottom: 8px;
}

.category-badge {
  display: inline-block;
  padding: 2px 9px;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent);
  font-weight: 600;
  font-size: 0.8rem;
}

.category-badge:hover {
  text-decoration: none;
  opacity: 0.85;
}

.post-card-title {
  margin: 0 0 8px;
  font-size: 1.28rem;
  line-height: 1.4;
  letter-spacing: -0.02em;
}

.post-card-title a {
  color: var(--text);
}

.post-card-title a:hover {
  color: var(--accent);
  text-decoration: none;
}

.post-card-desc {
  margin: 0;
  color: var(--text-muted);
  font-size: 0.94rem;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.post-card-tags,
.post-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 10px;
}

.tag-chip {
  font-size: 0.8rem;
  color: var(--text-muted);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 2px 8px;
}

.tag-chip:hover {
  color: var(--accent);
  border-color: var(--accent);
  text-decoration: none;
}

/* Post Detail */
.post-header,
.page-header,
.archive-header {
  margin-bottom: 24px;
  padding-bottom: 18px;
  border-bottom: 1px solid var(--border);
}

.post-title,
.page-header h1,
.archive-header h1 {
  margin: 0;
  font-size: 1.7rem;
  line-height: 1.35;
  letter-spacing: -0.03em;
}

.archive-kicker {
  margin: 0 0 4px;
  font-size: 0.85rem;
  color: var(--text-muted);
}

.post-hero {
  margin: 0 0 24px;
}

.post-hero img {
  display: block;
  width: 100%;
  height: auto;
  border-radius: 10px;
  border: 1px solid var(--border);
}

.post-body {
  font-size: 1.02rem;
}

.post-body h2 {
  margin-top: 2em;
  margin-bottom: 0.6em;
  font-size: 1.32rem;
  line-height: 1.4;
  letter-spacing: -0.02em;
}

.post-body h3 {
  margin-top: 1.6em;
  margin-bottom: 0.5em;
  font-size: 1.12rem;
}

.post-body p {
  margin: 0 0 1.1em;
}

.post-body img {
  display: block;
  max-width: min(100%, 560px);
  width: auto;
  height: auto;
  margin: 1.4em auto;
  border-radius: 10px;
  border: 1px solid var(--border);
}

.post-body ul,
.post-body ol {
  padding-left: 1.4em;
  margin: 0 0 1.2em;
}

.post-body li {
  margin-bottom: 0.4em;
}

.post-body blockquote {
  margin: 1.2em 0;
  padding: 12px 16px;
  border-left: 4px solid var(--accent);
  background: var(--surface);
  color: var(--text-muted);
}

.post-body code {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 0.9em;
  background: var(--surface);
  padding: 2px 5px;
  border-radius: 4px;
}

.post-body pre {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 14px;
  overflow-x: auto;
}

.post-body pre code {
  background: none;
  padding: 0;
}

.post-body table {
  width: 100%;
  border-collapse: collapse;
  margin: 1.2em 0;
  font-size: 0.92rem;
  display: block;
  overflow-x: auto;
}

.post-body th,
.post-body td {
  border: 1px solid var(--border);
  padding: 8px 12px;
  text-align: left;
}

.post-body th {
  background: var(--surface);
  font-weight: 700;
}

.notice-draft {
  padding: 10px 14px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 0.9rem;
  color: var(--text-muted);
}

/* Disclaimer Box */
.disclaimer-box {
  margin-top: 36px;
  padding: 16px 18px;
  background: var(--warn-bg);
  border: 1px solid var(--warn-border);
  border-radius: 10px;
  font-size: 0.9rem;
  line-height: 1.6;
}

.disclaimer-box strong {
  display: block;
  margin-bottom: 4px;
}

.disclaimer-box p {
  margin: 0;
}

/* Prev / Next Navigation */
.post-nav {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-top: 28px;
  padding-top: 20px;
  border-top: 1px solid var(--border);
}

.post-nav-link {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 12px 14px;
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text);
}

.post-nav-link:hover {
  border-color: var(--accent);
  text-decoration: none;
}

.post-nav-link.next {
  text-align: right;
}

.post-nav-label {
  font-size: 0.8rem;
  color: var(--text-muted);
}

.post-nav-title {
  font-weight: 600;
  font-size: 0.94rem;
}

/* Taxonomy Grid */
.taxonomy-grid {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 12px;
}

.taxonomy-link {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 14px;
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text);
  font-weight: 600;
}

.taxonomy-link:hover {
  border-color: var(--accent);
  color: var(--accent);
  text-decoration: none;
}

.taxonomy-count {
  font-size: 0.82rem;
  color: var(--text-muted);
  background: var(--surface);
  padding: 2px 8px;
  border-radius: 999px;
}

.empty-state {
  color: var(--text-muted);
  padding: 24px 0;
}

/* Footer */
.site-footer {
  border-top: 1px solid var(--border);
  background: var(--surface);
  padding: 24px 0;
  font-size: 0.86rem;
  color: var(--text-muted);
}

.footer-inner {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.footer-copy {
  margin: 0;
}

.footer-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
}

.footer-nav a {
  color: var(--text-muted);
}

@media (max-width: 600px) {
  .post-title,
  .page-header h1,
  .archive-header h1 {
    font-size: 1.42rem;
  }

  .post-card-title {
    font-size: 1.15rem;
  }

  .post-nav {
    grid-template-columns: 1fr;
  }

  .post-nav-link.next {
    text-align: left;
  }
}