@import url('https://fonts.googleapis.com/css2?family=DM+Serif+Display&family=DM+Sans:ital,opsz,wght@0,9..40,300;0,9..40,400;0,9..40,500;1,9..40,400&display=swap');

:root {
  --bg: #F7F5F0;
  --surface: #FFFFFF;
  --primary: #4A5568;
  --accent: #8B9E8E;
  --text: #2D3748;
  --text-muted: #718096;
  --success: #68A678;
  --error: #C17B7B;
  --border: rgba(0, 0, 0, 0.08);
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-pill: 99px;
  --shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
  --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.08);
  --transition: 200ms ease;
}

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

html { scroll-behavior: smooth; }

body {
  font-family: 'DM Sans', sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.65;
  font-size: 15px;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3 { font-family: 'DM Serif Display', serif; line-height: 1.25; }
h1 { font-size: clamp(2rem, 5vw, 3rem); }
h2 { font-size: clamp(1.4rem, 3vw, 1.9rem); }
h3 { font-size: 1.2rem; }
h4 { font-size: 1rem; font-family: 'DM Sans', sans-serif; font-weight: 500; }

a { color: var(--primary); text-decoration: none; transition: opacity var(--transition); }
a:hover { opacity: 0.75; }

code, pre {
  font-family: 'Menlo', 'Monaco', 'Consolas', monospace;
  font-size: 0.85em;
}

pre {
  background: #F0EDE8;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 1rem 1.25rem;
  overflow-x: auto;
  line-height: 1.6;
}

code:not(pre code) {
  background: #ECEAE4;
  padding: 0.15em 0.45em;
  border-radius: 4px;
}

/* ── NAV ────────────────────────────────────────────── */
.nav {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 100;
  backdrop-filter: blur(8px);
}

.nav-inner {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 1.5rem;
  height: 56px;
  display: flex;
  align-items: center;
  gap: 2rem;
}

.nav-logo {
  font-family: 'DM Serif Display', serif;
  font-size: 1.1rem;
  color: var(--text);
  white-space: nowrap;
}

.nav-links {
  display: flex;
  gap: 0.25rem;
  list-style: none;
}

.nav-links a {
  display: block;
  padding: 0.35rem 0.75rem;
  border-radius: var(--radius-sm);
  color: var(--text-muted);
  font-size: 0.9rem;
  font-weight: 400;
  transition: all var(--transition);
}

.nav-links a:hover,
.nav-links a.active {
  background: var(--bg);
  color: var(--text);
  opacity: 1;
}

/* ── BUTTON ─────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.6rem 1.25rem;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  font-family: 'DM Sans', sans-serif;
  font-size: 0.9rem;
  font-weight: 500;
  cursor: pointer;
  transition: all var(--transition);
}

.btn:hover { background: var(--bg); opacity: 1; }

.btn-primary {
  background: var(--primary);
  color: white;
  border-color: var(--primary);
}

.btn-primary:hover { background: #3A4558; opacity: 1; }

.btn-accent {
  background: var(--accent);
  color: white;
  border-color: var(--accent);
}

/* ── BADGE / PILL ───────────────────────────────────── */
.badge {
  display: inline-block;
  padding: 0.2em 0.7em;
  border-radius: var(--radius-pill);
  font-size: 0.75rem;
  font-weight: 500;
  line-height: 1.5;
}

.badge-sage { background: #D8E8D8; color: #4A7A52; }
.badge-slate { background: #E2E6EE; color: #4A5568; }
.badge-warm { background: #EDE8DF; color: #7A6A52; }
.badge-error { background: #F0DADA; color: #9A4A4A; }

/* ── CARD ───────────────────────────────────────────── */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow);
  transition: box-shadow var(--transition);
}

.card:hover { box-shadow: var(--shadow-md); }

/* ── PROGRESS BAR ───────────────────────────────────── */
.progress-bar-wrap {
  background: var(--bg);
  border-radius: var(--radius-pill);
  height: 6px;
  overflow: hidden;
}

.progress-bar-fill {
  height: 100%;
  background: var(--accent);
  border-radius: var(--radius-pill);
  transition: width 400ms ease;
}

/* ── CHECKLIST ──────────────────────────────────────── */
.checklist { list-style: none; }

.checklist li {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.4rem 0;
  cursor: pointer;
  border-radius: var(--radius-sm);
  transition: background var(--transition);
}

.checklist li:hover { background: var(--bg); padding-left: 0.5rem; }

.checklist input[type=checkbox] {
  width: 16px;
  height: 16px;
  accent-color: var(--accent);
  cursor: pointer;
  flex-shrink: 0;
}

.checklist li.checked { color: var(--text-muted); text-decoration: line-through; }

/* ── EXPANDABLE ─────────────────────────────────────── */
.expand-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 1.25rem;
  cursor: pointer;
  user-select: none;
  border-radius: var(--radius-md);
  transition: background var(--transition);
}

.expand-header:hover { background: var(--bg); }

.expand-header .chevron {
  transition: transform var(--transition);
  color: var(--text-muted);
  font-size: 0.9rem;
}

.expand-header.open .chevron { transform: rotate(180deg); }

.expand-body {
  max-height: 0;
  overflow: hidden;
  transition: max-height 350ms ease;
}

.expand-body.open { max-height: 4000px; }

.expand-content { padding: 0 1.25rem 1.25rem; }

/* ── TABLE ──────────────────────────────────────────── */
table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
}

th {
  text-align: left;
  padding: 0.6rem 0.9rem;
  background: var(--bg);
  font-weight: 500;
  border-bottom: 1px solid var(--border);
  color: var(--text-muted);
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

td {
  padding: 0.6rem 0.9rem;
  border-bottom: 1px solid var(--border);
  vertical-align: top;
}

tr:last-child td { border-bottom: none; }
tr:hover td { background: #FAFAF8; }

/* ── UTILITY ────────────────────────────────────────── */
.container { max-width: 1100px; margin: 0 auto; padding: 0 1.5rem; }
.section-gap { padding: 4rem 0; }
.gap-1 { gap: 1rem; }
.gap-2 { gap: 1.5rem; }
.flex { display: flex; }
.flex-col { flex-direction: column; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.grid-2 { display: grid; grid-template-columns: repeat(2, 1fr); gap: 1.5rem; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1.5rem; }
.text-muted { color: var(--text-muted); }
.text-sm { font-size: 0.875rem; }
.text-center { text-align: center; }
.mb-1 { margin-bottom: 0.5rem; }
.mb-2 { margin-bottom: 1rem; }
.mb-3 { margin-bottom: 1.5rem; }
.mb-4 { margin-bottom: 2rem; }
.mt-1 { margin-top: 0.5rem; }
.mt-2 { margin-top: 1rem; }
.mt-3 { margin-top: 1.5rem; }
.p-1 { padding: 0.5rem; }
.p-2 { padding: 1rem; }
.p-3 { padding: 1.5rem; }
.p-4 { padding: 2rem; }
.w-full { width: 100%; }

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

/* ── RESPONSIVE ─────────────────────────────────────── */
@media (max-width: 768px) {
  .grid-2, .grid-3 { grid-template-columns: 1fr; }
  .nav-inner { gap: 1rem; }
  .nav-links a { padding: 0.35rem 0.5rem; font-size: 0.85rem; }
  .section-gap { padding: 2.5rem 0; }
}

@media (max-width: 480px) {
  .nav-logo { font-size: 0.95rem; }
}
