:root {
  --bg: #f5f1e8;
  --surface: #fffdf8;
  --text: #1f2933;
  --muted: #52606d;
  --accent: #b45309;
  --accent-light: #fef3c7;
  --border: #e6dccd;
  --code-bg: #f0ebe1;
  --transition: 0.18s ease;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: "Segoe UI", "Noto Sans KR", sans-serif;
  background:
    radial-gradient(circle at top left, rgba(180, 83, 9, 0.10), transparent 24rem),
    linear-gradient(180deg, #f7f3eb 0%, var(--bg) 100%);
  color: var(--text);
  line-height: 1.7;
}

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

a:hover {
  text-decoration: underline;
}

.container {
  width: min(56rem, calc(100% - 2rem));
  margin: 0 auto;
}

/* ── Header / Footer ─────────────────────────────── */

.site-header,
.site-footer {
  background: rgba(255, 253, 248, 0.92);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
}

.site-footer {
  border-top: 1px solid var(--border);
  border-bottom: none;
}

.nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  padding: 1rem 0;
}

.nav nav {
  display: flex;
  gap: 0.25rem;
  flex-wrap: wrap;
}

.nav nav a {
  padding: 0.3rem 0.65rem;
  border-radius: 8px;
  color: var(--muted);
  font-size: 0.95rem;
  transition: background var(--transition), color var(--transition);
}

.nav nav a:hover {
  background: var(--accent-light);
  color: var(--accent);
  text-decoration: none;
}

.nav nav a.active {
  color: var(--accent);
  font-weight: 700;
  background: var(--accent-light);
}

.brand {
  font-weight: 700;
  font-size: 1.1rem;
  color: var(--text);
  letter-spacing: -0.01em;
}

.brand:hover {
  color: var(--accent);
  text-decoration: none;
}

/* ── Main ────────────────────────────────────────── */

main {
  padding: 3rem 0 5rem;
}

/* ── Hero ────────────────────────────────────────── */

.hero {
  margin-bottom: 3rem;
}

.hero h1 {
  font-size: clamp(2rem, 5vw, 3rem);
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1.15;
  margin: 0.25rem 0 0.75rem;
}

.hero p {
  font-size: 1.1rem;
  color: var(--muted);
  max-width: 34rem;
  margin: 0;
}

.eyebrow {
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--accent);
  font-size: 0.78rem;
  font-weight: 600;
  margin: 0 0 0.4rem;
}

/* ── Section Grid (home page) ────────────────────── */

.section-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem;
  margin-bottom: 3rem;
}

.section-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 1.25rem 1.4rem;
  transition: box-shadow var(--transition), transform var(--transition), border-color var(--transition);
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
  color: var(--text);
}

.section-card:hover {
  box-shadow: 0 8px 24px rgba(180, 83, 9, 0.10);
  border-color: rgba(180, 83, 9, 0.3);
  transform: translateY(-2px);
  text-decoration: none;
}

.section-card .sc-icon {
  font-size: 1.4rem;
  line-height: 1;
  margin-bottom: 0.2rem;
}

.section-card .sc-title {
  font-weight: 700;
  font-size: 1rem;
  color: var(--text);
}

.section-card .sc-desc {
  font-size: 0.88rem;
  color: var(--muted);
  line-height: 1.5;
}

/* ── Post Cards ──────────────────────────────────── */

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 18px;
  padding: 1.5rem;
  margin-bottom: 1rem;
  box-shadow: 0 2px 8px rgba(31, 41, 51, 0.04);
  transition: box-shadow var(--transition), transform var(--transition), border-color var(--transition);
}

.card:hover {
  box-shadow: 0 10px 28px rgba(31, 41, 51, 0.09);
  transform: translateY(-2px);
  border-color: rgba(180, 83, 9, 0.25);
}

.card h2,
.card h3 {
  margin: 0 0 0.3rem;
  font-size: 1.1rem;
}

.card h2 a,
.card h3 a {
  color: var(--text);
}

.card h2 a:hover,
.card h3 a:hover {
  color: var(--accent);
  text-decoration: none;
}

/* ── Meta & Tags ─────────────────────────────────── */

.meta {
  color: var(--muted);
  font-size: 0.9rem;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.4rem;
  margin: 0.25rem 0 0.6rem;
}

a.tag-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.2em;
  background: var(--accent-light);
  color: var(--accent);
  font-size: 0.78rem;
  font-weight: 600;
  padding: 0.18em 0.65em;
  border-radius: 999px;
  border: 1px solid rgba(180, 83, 9, 0.18);
  transition: background var(--transition), border-color var(--transition);
  text-decoration: none;
  white-space: nowrap;
}

a.tag-pill:hover {
  background: rgba(180, 83, 9, 0.18);
  border-color: rgba(180, 83, 9, 0.4);
  text-decoration: none;
}

/* ── Tag Cloud (taxonomy list page) ─────────────── */

.tag-cloud {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  margin-top: 1.5rem;
}

.tag-cloud a.tag-pill {
  font-size: 0.88rem;
  padding: 0.3em 0.9em;
}

.tag-count {
  background: rgba(180, 83, 9, 0.12);
  color: var(--accent);
  border-radius: 999px;
  padding: 0 0.45em;
  font-size: 0.75em;
  font-weight: 700;
  margin-left: 0.15em;
}

/* ── Page Header ─────────────────────────────────── */

.page-header {
  margin-bottom: 2rem;
}

.page-header h1 {
  font-size: clamp(1.6rem, 4vw, 2.2rem);
  font-weight: 800;
  letter-spacing: -0.02em;
  margin: 0 0 0.4rem;
}

.page-intro {
  color: var(--muted);
  font-size: 1rem;
  margin-top: 0.4rem;
}

/* ── Single Post ─────────────────────────────────── */

.card.post {
  padding: 2rem 2.25rem;
}

.card.post h1 {
  font-size: clamp(1.5rem, 4vw, 2rem);
  font-weight: 800;
  letter-spacing: -0.025em;
  margin: 0 0 0.5rem;
}

.content pre,
.content code {
  background: var(--code-bg);
}

.content pre {
  padding: 1rem 1.25rem;
  overflow-x: auto;
  border-radius: 12px;
  line-height: 1.6;
}

.content code {
  padding: 0.1em 0.35em;
  border-radius: 5px;
  font-size: 0.88em;
}

.content pre code {
  padding: 0;
  background: none;
  font-size: 0.9em;
}

.content h2 {
  margin-top: 2rem;
  font-size: 1.35rem;
  border-bottom: 1px solid var(--border);
  padding-bottom: 0.3rem;
}

.content h3 {
  margin-top: 1.5rem;
  font-size: 1.1rem;
}

/* ── Footer ──────────────────────────────────────── */

.site-footer {
  padding: 1.25rem 0;
  color: var(--muted);
  font-size: 0.9rem;
}

/* ── Responsive ──────────────────────────────────── */

@media (max-width: 720px) {
  .section-grid {
    grid-template-columns: 1fr 1fr;
  }
}

@media (max-width: 480px) {
  .nav {
    flex-direction: column;
    align-items: flex-start;
  }

  .section-grid {
    grid-template-columns: 1fr;
  }

  .card.post {
    padding: 1.25rem;
  }
}
