:root {
  --bg: #f7f7f4;
  --surface: #ffffff;
  --surface-2: #f1f1ed;
  --border: #e4e5e7;
  --text: #0d0f12;
  --text-secondary: #545b66;
  --text-muted: #8b93a1;
  --shadow: 0 4px 20px rgba(16, 24, 40, 0.07);
}

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

html { scroll-behavior: smooth; }

body {
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.7;
  font-size: 16px;
}

a { color: inherit; text-decoration: none; }

/* ── Progress bar ─────────────────────────────── */

.progress-bar {
  position: fixed;
  top: 0; left: 0;
  height: 2px;
  background: var(--text);
  width: 0%;
  z-index: 999;
  transition: width 0.1s linear;
}

/* ── Pill nav ─────────────────────────────────── */

.pill-nav {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  padding: 5px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--surface);
  width: fit-content;
  margin: 28px auto 0;
}

.pill-nav-item {
  padding: 9px 22px;
  border-radius: 999px;
  font-size: 0.9rem;
  color: var(--text-secondary);
  transition: background 0.2s, color 0.2s;
}

.pill-nav-item:hover { color: var(--text); }
.pill-nav-item.active { background: var(--surface-2); color: var(--text); }

/* ── Back link ────────────────────────────────── */

.post-back {
  max-width: 680px;
  margin: 32px auto 0;
  padding: 0 24px;
}

.post-back a {
  font-size: 0.85rem;
  color: var(--text-muted);
  transition: color 0.2s;
}

.post-back a:hover { color: var(--text); }

/* ── Post header ──────────────────────────────── */

.post-header {
  max-width: 680px;
  margin: 40px auto 0;
  padding: 0 24px 40px;
  border-bottom: 1px solid var(--border);
}

.post-label {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 20px;
}

.post-tag {
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 3px 10px;
  border-radius: 999px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  color: var(--text-secondary);
}

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

.post-header h1 {
  font-size: clamp(1.8rem, 4vw, 2.6rem);
  font-weight: 800;
  letter-spacing: -0.04em;
  line-height: 1.15;
  margin-bottom: 16px;
}

.post-subtitle {
  font-size: 1rem;
  color: var(--text-secondary);
  line-height: 1.65;
  max-width: 560px;
}

/* ── Post content ─────────────────────────────── */

.post-content {
  max-width: 680px;
  margin: 0 auto;
  padding: 56px 24px 100px;
}

/* ── Sections ─────────────────────────────────── */

.post-section {
  margin-bottom: 64px;
  scroll-margin-top: 24px;
}

.section-label {
  display: block;
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--text-muted);
  font-variant-numeric: tabular-nums;
  margin-bottom: 8px;
  font-family: ui-monospace, "SF Mono", "Fira Code", monospace;
}

.post-section h2 {
  font-size: clamp(1.3rem, 2.5vw, 1.7rem);
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1.2;
  margin-bottom: 18px;
}

.section-intro {
  font-size: 0.97rem;
  color: var(--text-secondary);
  line-height: 1.75;
  padding-left: 16px;
  border-left: 2px solid var(--border);
  margin-bottom: 32px;
}

hr.rule {
  border: none;
  border-top: 1px solid var(--border);
  margin: 56px 0;
}

/* ── Callout cards ────────────────────────────── */

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 22px 24px;
  margin-bottom: 16px;
}

.card h3 {
  font-size: 0.95rem;
  font-weight: 700;
  margin-bottom: 8px;
}

.card p, .card li {
  font-size: 0.9rem;
  color: var(--text-secondary);
  line-height: 1.7;
}

.card ul, .card ol {
  padding-left: 18px;
  margin-top: 8px;
}

.card li { margin-bottom: 5px; }

.card--note {
  background: var(--surface-2);
  border-color: var(--border);
}

.card--warn {
  background: #fef9ed;
  border-color: #f0d98a;
}

.card--tip {
  background: #f0faf4;
  border-color: #b5ddc5;
}

.card--danger {
  background: #fef2f2;
  border-color: #f5c0c0;
}

/* ── Prompt box ───────────────────────────────── */

.prompt-box {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-left: 3px solid var(--text-muted);
  border-radius: 0 10px 10px 0;
  padding: 18px 20px;
  margin: 14px 0;
}

.prompt-label {
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-muted);
  font-family: ui-monospace, "SF Mono", "Fira Code", monospace;
  margin-bottom: 8px;
  display: block;
}

.prompt-box p {
  font-size: 0.875rem;
  color: var(--text);
  line-height: 1.65;
  font-style: italic;
}

/* ── Code inline ──────────────────────────────── */

.code {
  font-family: ui-monospace, "SF Mono", "Fira Code", monospace;
  font-size: 0.82em;
  background: var(--surface-2);
  border: 1px solid var(--border);
  padding: 1px 6px;
  border-radius: 4px;
  color: var(--text);
}

/* ── Code block ───────────────────────────────── */

.code-block {
  background: #111113;
  border-radius: 12px;
  padding: 22px 24px;
  margin: 16px 0;
  overflow-x: auto;
  position: relative;
}

.code-block-label {
  position: absolute;
  top: 12px; right: 16px;
  font-family: ui-monospace, "SF Mono", monospace;
  font-size: 0.65rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: rgba(255,255,255,0.25);
}

.code-block code {
  font-family: ui-monospace, "SF Mono", "Fira Code", monospace;
  font-size: 0.85rem;
  color: #e2e4e9;
  line-height: 1.8;
  white-space: pre;
  display: block;
}

/* ── Step list ────────────────────────────────── */

.steps {
  display: flex;
  flex-direction: column;
  gap: 20px;
  margin-bottom: 24px;
}

.step {
  display: grid;
  grid-template-columns: 36px 1fr;
  gap: 16px;
  align-items: start;
}

.step-num {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--text);
  color: var(--bg);
  font-size: 0.85rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  margin-top: 2px;
  font-family: ui-monospace, monospace;
}

.step-body h3 {
  font-size: 0.95rem;
  font-weight: 700;
  margin-bottom: 5px;
}

.step-body p {
  font-size: 0.88rem;
  color: var(--text-secondary);
  line-height: 1.65;
}

/* ── Do / Don't ───────────────────────────────── */

.do-dont {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin: 16px 0;
}

.do, .dont {
  border-radius: 10px;
  padding: 18px 20px;
}

.do {
  background: #f0faf4;
  border: 1px solid #b5ddc5;
}

.dont {
  background: #fef2f2;
  border: 1px solid #f5c0c0;
}

.do-label, .dont-label {
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  display: block;
  margin-bottom: 8px;
  font-family: ui-monospace, monospace;
}

.do-label { color: #2a7d4f; }
.dont-label { color: #b33a3a; }

.do p, .dont p {
  font-size: 0.87rem;
  line-height: 1.6;
  color: var(--text-secondary);
}

/* ── Checklist ────────────────────────────────── */

.checklist {
  list-style: none;
  padding: 0;
  margin: 12px 0;
}

.checklist li {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 9px 0;
  border-bottom: 1px solid var(--border);
  font-size: 0.9rem;
  color: var(--text-secondary);
  line-height: 1.5;
}

.checklist li:last-child { border-bottom: none; }

.checklist li::before {
  content: '✓';
  color: var(--text-muted);
  flex-shrink: 0;
  margin-top: 1px;
  font-size: 0.85rem;
}

/* ── Mindset grid ─────────────────────────────── */

.mindset-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 12px;
  margin: 20px 0;
}

.grid-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin: 20px 0;
}

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

.mindset-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 20px;
}

.mindset-icon {
  font-size: 1.4rem;
  margin-bottom: 10px;
  display: block;
}

.mindset-card h4 {
  font-size: 0.88rem;
  font-weight: 700;
  margin-bottom: 5px;
}

.mindset-card p {
  font-size: 0.83rem;
  color: var(--text-muted);
  line-height: 1.6;
}

/* ── Pull quote ───────────────────────────────── */

.pullquote {
  font-size: clamp(1rem, 2vw, 1.2rem);
  font-weight: 600;
  letter-spacing: -0.02em;
  line-height: 1.5;
  color: var(--text);
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  padding: 24px 0;
  margin: 36px 0;
  text-align: center;
}

/* ── Comparison table ─────────────────────────── */

.compare-table {
  width: 100%;
  border-collapse: collapse;
  margin: 16px 0;
  font-size: 0.875rem;
}

.compare-table th {
  background: var(--text);
  color: var(--bg);
  padding: 10px 14px;
  text-align: left;
  font-weight: 600;
  font-size: 0.75rem;
  letter-spacing: 0.04em;
}

.compare-table th:first-child { border-radius: 8px 0 0 0; }
.compare-table th:last-child  { border-radius: 0 8px 0 0; }

.compare-table td {
  padding: 10px 14px;
  border-bottom: 1px solid var(--border);
  color: var(--text-secondary);
  vertical-align: top;
  line-height: 1.5;
}

.compare-table tr:nth-child(even) td { background: var(--surface-2); }
.compare-table tr:last-child td { border-bottom: none; }
.compare-table tr:last-child td:first-child { border-radius: 0 0 0 8px; }
.compare-table tr:last-child td:last-child  { border-radius: 0 0 8px 0; }

.rec-badge {
  background: var(--text);
  color: var(--bg);
  font-size: 0.62rem;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: 3px;
  letter-spacing: 0.05em;
  margin-left: 6px;
  vertical-align: middle;
}

/* ── Subsection heading ───────────────────────── */

.sub-heading {
  font-size: 1rem;
  font-weight: 700;
  margin: 32px 0 14px;
}

/* ── Final trio ───────────────────────────────── */

.final-trio {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 2px;
  border: 1px solid var(--border);
  border-radius: 16px;
  overflow: hidden;
  margin: 8px 0 0;
}

.final-trio-item {
  background: var(--surface);
  padding: 24px 22px;
}

.final-trio-item:not(:last-child) {
  border-right: 1px solid var(--border);
}

.final-trio-label {
  display: block;
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--text-muted);
  font-family: ui-monospace, "SF Mono", "Fira Code", monospace;
  margin-bottom: 10px;
}

.final-trio-item p {
  font-size: 1rem;
  font-weight: 600;
  color: var(--text);
  line-height: 1.4;
  letter-spacing: -0.02em;
  margin: 0;
}

@media (max-width: 640px) {
  .final-trio {
    grid-template-columns: 1fr;
  }
  .final-trio-item:not(:last-child) {
    border-right: none;
    border-bottom: 1px solid var(--border);
  }
}

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

footer {
  padding: 14px 0;
  text-align: center;
  position: sticky;
  bottom: 0;
  background: var(--bg);
}

.footer-copy {
  margin: 0;
  color: var(--text-muted);
  font-size: 0.78rem;
}

/* ── Mobile ───────────────────────────────────── */

@media (max-width: 640px) {
  .post-header { padding: 0 16px 32px; }
  .post-content { padding: 40px 16px 80px; }
  .post-back { padding: 0 16px; }
  .do-dont { grid-template-columns: 1fr; }
  .mindset-grid { grid-template-columns: 1fr 1fr; }
}
