:root {
  --ink: #232326;
  --ink-soft: #4a4a4a;
  --bg: #fafaf9;
  --panel: #ffffff;
  --text: #232326;
  --muted: #6b6b6f;
  --border: #dcdcda;
  --border-light: #ececea;
  --accent: #00b368;
  --accent-dark: #00925570;
  --accent-soft: #e6f8ef;

  --radius-sm: 6px;
  --radius-md: 12px;

  --shadow-sm: 0 1px 2px rgba(20, 20, 20, 0.05);
  --shadow-md: 0 4px 16px rgba(20, 20, 20, 0.07);

  --drawer-bg: #23262b;
  --drawer-text: #f0f1f2;
  --drawer-text-dim: #b7bac0;
  --drawer-border: #383c43;

  --drawer-width: 288px;
  --header-height: 60px;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: "Pretendard", "Segoe UI", "Malgun Gothic", -apple-system, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.75;
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
}

/* ---------- Site header (always visible) ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 25;
  height: var(--header-height);
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 0 22px;
  background: rgba(250, 250, 249, 0.92);
  backdrop-filter: blur(6px);
  border-bottom: 1px solid var(--border-light);
}

.drawer-toggle {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  width: 36px;
  height: 36px;
  font-size: 1.05rem;
  color: var(--ink);
  cursor: pointer;
  flex-shrink: 0;
  transition: background 0.15s, box-shadow 0.15s;
}

.drawer-toggle:hover {
  background: var(--accent-soft);
  box-shadow: var(--shadow-sm);
}

.site-title {
  font-size: 1rem;
  font-weight: 700;
  letter-spacing: -0.01em;
  color: var(--ink);
  text-decoration: none;
}

.header-nav {
  margin-left: auto;
  display: flex;
  gap: 6px;
}

.header-nav a {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--muted);
  text-decoration: none;
  padding: 6px 10px;
  border-radius: var(--radius-sm);
}

.header-nav a:hover {
  color: var(--ink);
  background: var(--accent-soft);
}

/* ---------- Drawer (hidden until toggled, on every screen size) ---------- */
.drawer {
  position: fixed;
  top: 0;
  left: 0;
  width: var(--drawer-width);
  height: 100vh;
  overflow-y: auto;
  background: var(--drawer-bg);
  color: var(--drawer-text);
  z-index: 40;
  transform: translateX(-100%);
  transition: transform 0.28s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: var(--shadow-md);
}

.drawer.open {
  transform: translateX(0);
}

.drawer-header {
  padding: 22px 22px 16px;
  border-bottom: 1px solid var(--drawer-border);
}

.drawer-eyebrow {
  margin: 0;
  font-size: 0.68rem;
  letter-spacing: 0.16em;
  color: var(--drawer-text-dim);
  font-weight: 700;
}

/* 인프런 스타일 학습 진행률 표시 */
.drawer-progress {
  padding: 16px 22px;
  border-bottom: 1px solid var(--drawer-border);
}

.drawer-progress-label {
  display: flex;
  justify-content: space-between;
  font-size: 0.78rem;
  color: var(--drawer-text-dim);
  margin-bottom: 8px;
}

.drawer-progress-label strong {
  color: var(--accent);
  font-weight: 700;
}

.drawer-progress-track {
  height: 6px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.12);
  overflow: hidden;
}

.drawer-progress-fill {
  height: 100%;
  background: var(--accent);
  border-radius: 999px;
  transition: width 0.2s ease;
}

.drawer-nav {
  padding: 10px 12px 32px;
}

.nav-group + .nav-group {
  margin-top: 8px;
}

.nav-group-title {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 14px;
  border-radius: var(--radius-sm);
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--drawer-text);
  text-decoration: none;
  transition: background 0.15s, color 0.15s;
}

.nav-group-title:hover {
  color: #ffffff;
  background: rgba(255, 255, 255, 0.06);
}

.nav-group-title.current-group {
  color: #ffffff;
  background: var(--accent);
}

.nav-sublist {
  list-style: none;
  margin: 2px 0 0;
  padding: 4px 0 16px;
}

.nav-sublist li a {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 1px 0;
  padding: 7px 14px 7px 26px;
  border-radius: var(--radius-sm);
  font-size: 0.84rem;
  color: var(--drawer-text-dim);
  text-decoration: none;
  transition: background 0.15s, color 0.15s;
}

.nav-sublist li a::before {
  content: "✓";
  display: inline-block;
  width: 12px;
  flex-shrink: 0;
  color: transparent;
  font-size: 0.75rem;
  font-weight: 700;
}

.nav-sublist li a.visited::before {
  color: var(--accent);
}

.nav-sublist li a:hover {
  color: var(--drawer-text);
  background: rgba(255, 255, 255, 0.05);
}

.nav-sublist li a.active-link {
  color: #ffffff;
  font-weight: 700;
  background: rgba(0, 179, 104, 0.22);
}

.overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(20, 20, 18, 0.35);
  backdrop-filter: blur(1px);
  z-index: 30;
}

.overlay.open {
  display: block;
}

/* ---------- Page content ---------- */
main {
  max-width: 740px;
  margin: 0 auto;
  padding: 52px 24px 72px;
}

h2 {
  color: var(--ink);
  font-size: 1.5rem;
  font-weight: 800;
  letter-spacing: -0.01em;
  margin: 0 0 10px;
  padding-bottom: 16px;
  border-bottom: 3px solid var(--accent);
}

.section-intro {
  color: var(--muted);
  margin: 14px 0 32px;
  font-size: 0.96rem;
}

.part-header {
  margin: 0 0 26px;
}

.part-label {
  display: inline-block;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  color: #ffffff;
  background: var(--accent);
  border-radius: 999px;
  padding: 4px 12px;
  margin-bottom: 10px;
}

.part-header h2.part-title {
  margin: 0;
  padding: 0;
  border: none;
  font-size: 1.45rem;
  font-weight: 800;
  letter-spacing: -0.01em;
  color: var(--ink);
}

.card {
  background: var(--panel);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
  padding: 20px 24px;
  margin-bottom: 16px;
}

.card h3, .card h4 {
  margin: 0 0 10px;
  font-size: 1.05rem;
  font-weight: 800;
  color: var(--ink);
  display: flex;
  align-items: center;
  gap: 8px;
}

.card h3::before, .card h4::before {
  content: "";
  display: inline-block;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--accent);
  flex-shrink: 0;
}

.card p, .card ul, .card ol {
  margin: 8px 0;
}

.card p {
  color: var(--text);
}

.card table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 12px;
  font-size: 0.93rem;
}

.card th, .card td {
  border: 1px solid var(--border-light);
  padding: 10px 12px;
  text-align: left;
}

.card th {
  background: var(--accent-soft);
  font-weight: 700;
  color: var(--ink);
}

.card tr:nth-child(even) td {
  background: #f7f8f7;
}

code {
  background: #f2f2f0;
  border: 1px solid var(--border-light);
  padding: 1px 6px;
  border-radius: 4px;
  font-family: Consolas, monospace;
  font-size: 0.9em;
  color: var(--ink-soft);
}

pre {
  background: #24262a;
  color: #e9eae7;
  padding: 16px 18px;
  border-radius: var(--radius-md);
  overflow-x: auto;
  font-size: 0.87rem;
  box-shadow: var(--shadow-sm);
}

pre code {
  background: none;
  border: none;
  padding: 0;
  color: inherit;
}

/* ---------- Prev / next pager ---------- */
.page-pager {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  margin-top: 44px;
  padding-top: 24px;
  border-top: 1px solid var(--border-light);
}

.page-pager a {
  flex: 1;
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  background: var(--panel);
  padding: 14px 18px;
  text-decoration: none;
  color: var(--ink);
  font-size: 0.85rem;
  line-height: 1.5;
  box-shadow: var(--shadow-sm);
  transition: box-shadow 0.15s, transform 0.15s, border-color 0.15s;
}

.page-pager a:hover {
  border-color: var(--accent);
  box-shadow: var(--shadow-md);
  transform: translateY(-1px);
}

.page-pager .pager-next {
  text-align: right;
}

.page-pager .pager-spacer {
  visibility: hidden;
}

/* ---------- Landing page ---------- */
.hero {
  padding: 12px 0 8px;
}

.hero .eyebrow {
  margin: 0 0 12px;
  font-size: 0.75rem;
  letter-spacing: 0.18em;
  color: var(--accent);
  font-weight: 700;
}

.hero h1 {
  margin: 0 0 14px;
  font-size: 1.85rem;
  font-weight: 800;
  letter-spacing: -0.015em;
  color: var(--ink);
}

.hero p {
  color: var(--muted);
  max-width: 56ch;
}

.track-cards {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px;
  margin: 36px 0;
}

.track-card {
  display: block;
  background: var(--panel);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
  padding: 24px;
  text-decoration: none;
  color: var(--ink);
  transition: box-shadow 0.15s, transform 0.15s, border-color 0.15s;
}

.track-card:hover {
  box-shadow: var(--shadow-md);
  border-color: var(--accent);
  transform: translateY(-2px);
}

.track-card .track-label {
  font-size: 0.72rem;
  letter-spacing: 0.08em;
  color: var(--accent);
  font-weight: 700;
}

.track-card h3 {
  margin: 10px 0 6px;
  font-size: 1.15rem;
  font-weight: 800;
}

.track-card p {
  margin: 0;
  color: var(--muted);
  font-size: 0.88rem;
}

/* ---------- 학습 잔디 (컨트리뷰션 그래프) ---------- */
.contrib-card h4::before {
  display: none;
}

.contrib-graph {
  display: grid;
  grid-auto-flow: column;
  grid-template-rows: repeat(7, 1fr);
  gap: 3px;
  overflow-x: auto;
  padding-bottom: 4px;
}

.contrib-cell {
  width: 11px;
  height: 11px;
  border-radius: 2px;
  background: var(--border-light);
}

.contrib-cell[data-level="1"] { background: #bdeeda; }
.contrib-cell[data-level="2"] { background: #7ad9b3; }
.contrib-cell[data-level="3"] { background: #2fbf82; }
.contrib-cell[data-level="4"] { background: var(--accent); }

.contrib-empty {
  color: var(--muted);
  font-size: 0.85rem;
}

.contrib-name-form {
  display: flex;
  gap: 8px;
  margin-bottom: 14px;
}

.contrib-name-form input {
  flex: 1;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 8px 12px;
  font-family: inherit;
  font-size: 0.9rem;
}

.contrib-name-form button {
  background: var(--accent);
  color: #fff;
  border: none;
  border-radius: var(--radius-sm);
  padding: 8px 16px;
  font-weight: 700;
  cursor: pointer;
}

/* ---------- Footer (every page) ---------- */
.site-footer {
  text-align: center;
  color: var(--muted);
  padding: 32px;
  font-size: 0.82rem;
  border-top: 1px solid var(--border-light);
}

@media (max-width: 600px) {
  .track-cards {
    grid-template-columns: 1fr;
  }
}
