/* ============================================================
   AI Fundamentals — Shared Stylesheet
   Edit this file to update all module pages at once.
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&family=JetBrains+Mono:wght@300;400;500;600&display=swap');

/* ─── TOKENS ─────────────────────────────────────────────── */
:root {
  --bg-primary: #080508;
  --bg-surface: #110a10;
  --bg-card: #160d15;
  --bg-code: #0e0009;
  --bg-nav: rgba(8, 5, 8, 0.85);
  --accent: #e74c3c;
  --accent-dim: #c0392b;
  --accent-bright: #ff6b5b;
  --accent-glow: rgba(231, 76, 60, 0.15);
  --accent-glow-strong: rgba(231, 76, 60, 0.3);
  --border: rgba(231, 76, 60, 0.2);
  --border-dim: rgba(231, 76, 60, 0.1);
  --text-primary: #f0e6ee;
  --text-secondary: #cdbdcb;
  --text-muted: #8a7a88;
  --text-code: #ffb3aa;
  --font-sans: 'Inter', system-ui, -apple-system, sans-serif;
  --font-mono: 'JetBrains Mono', 'Fira Code', 'Cascadia Code', monospace;
  --radius: 8px;
  --radius-lg: 12px;
}

/* ─── RESET ──────────────────────────────────────────────── */
* { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  background: var(--bg-primary);
  color: var(--text-primary);
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.7;
  overflow-x: hidden;
}

/* ─── SCROLLBAR ──────────────────────────────────────────── */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: var(--bg-primary); }
::-webkit-scrollbar-thumb { background: var(--accent-dim); border-radius: 3px; }

/* ─── NAV ────────────────────────────────────────────────── */
nav {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 100;
  background: var(--bg-nav);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border-dim);
  padding: 0 2rem;
  height: 56px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.nav-breadcrumb {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 8px;
}
.nav-breadcrumb .sep { color: var(--accent-dim); }
.nav-breadcrumb .current { color: var(--accent-bright); }
.nav-progress { display: flex; align-items: center; gap: 12px; }
.progress-label { font-family: var(--font-mono); font-size: 11px; color: var(--text-muted); }
.progress-bar { width: 120px; height: 3px; background: rgba(231,76,60,0.15); border-radius: 2px; overflow: hidden; }
.progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--accent-dim), var(--accent-bright));
  border-radius: 2px;
  width: 0%;
  transition: width 1.2s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 0 8px var(--accent);
}

/* ─── SCANLINE + GLOW ────────────────────────────────────── */
.scanlines {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  pointer-events: none;
  z-index: 999;
  background: repeating-linear-gradient(0deg, transparent, transparent 2px, rgba(0,0,0,0.03) 2px, rgba(0,0,0,0.03) 4px);
  opacity: 0.4;
}
.glow-accent {
  position: fixed;
  width: 600px; height: 600px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(231,76,60,0.04) 0%, transparent 70%);
  pointer-events: none;
  top: -200px; right: -200px;
  z-index: 0;
}

/* ─── LAYOUT ─────────────────────────────────────────────── */
.container { max-width: 860px; margin: 0 auto; padding: 0 2rem; }
section { padding: 4rem 0; }
.divider { height: 1px; background: linear-gradient(90deg, transparent, var(--border-dim), transparent); margin: 0; }

/* ─── HERO ───────────────────────────────────────────────── */
.hero { padding-top: 120px; padding-bottom: 3rem; }
.module-badge {
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.2em;
  color: var(--accent);
  text-transform: uppercase;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 1.5rem;
  opacity: 0;
  animation: fadeUp 0.6s ease forwards 0.1s;
}
.module-badge::before { content: ''; width: 20px; height: 1px; background: var(--accent); display: block; }
.module-badge .badge-num { background: var(--accent-glow); border: 1px solid var(--border); padding: 2px 10px; border-radius: 3px; }
h1 {
  font-size: clamp(2rem, 5vw, 3.2rem);
  font-weight: 700;
  line-height: 1.15;
  letter-spacing: -0.02em;
  color: var(--text-primary);
  margin-bottom: 1.5rem;
  opacity: 0;
  animation: fadeUp 0.6s ease forwards 0.2s;
}
h1 em { font-style: normal; color: var(--accent-bright); }
.hero-meta { display: flex; align-items: center; gap: 1rem; flex-wrap: wrap; margin-bottom: 2.5rem; opacity: 0; animation: fadeUp 0.6s ease forwards 0.35s; }
.pill { font-family: var(--font-mono); font-size: 11px; font-weight: 500; padding: 4px 12px; border-radius: 100px; border: 1px solid var(--border); color: var(--text-secondary); background: var(--bg-card); }
.pill.time { color: var(--accent-bright); border-color: var(--accent); background: var(--accent-glow); }
.hero-tagline { font-size: 1.1rem; color: var(--text-secondary); max-width: 620px; border-left: 2px solid var(--accent); padding-left: 1rem; opacity: 0; animation: fadeUp 0.6s ease forwards 0.45s; }

/* ─── SECTION HEADERS ────────────────────────────────────── */
.section-label {
  font-family: var(--font-mono);
  font-size: 11.5px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--accent-dim);
  margin-bottom: 0.75rem;
  display: flex;
  align-items: center;
  gap: 8px;
}
.section-label::after { content: ''; flex: 1; height: 1px; background: var(--border-dim); }
h2 { font-size: 1.5rem; font-weight: 600; color: var(--text-primary); margin-bottom: 1.5rem; letter-spacing: -0.01em; }
h3 { font-size: 1.05rem; font-weight: 600; color: var(--text-primary); margin-bottom: 0.75rem; }

/* ─── OUTCOMES ───────────────────────────────────────────── */
.outcomes-list { display: flex; flex-direction: column; gap: 0.75rem; }
.outcome-item {
  display: flex;
  align-items: flex-start;
  gap: 1rem;
  padding: 1rem 1.25rem;
  background: var(--bg-card);
  border: 1px solid var(--border-dim);
  border-radius: var(--radius);
  opacity: 0;
  transform: translateX(-20px);
  transition: border-color 0.3s, background 0.3s;
}
.outcome-item:hover { border-color: var(--border); background: var(--accent-glow); }
.outcome-item.visible { animation: slideInLeft 0.5s ease forwards; }
.outcome-item:nth-child(2) { animation-delay: 0.1s; }
.outcome-item:nth-child(3) { animation-delay: 0.2s; }
.outcome-item:nth-child(4) { animation-delay: 0.3s; }
.outcome-num { font-family: var(--font-mono); font-size: 10px; font-weight: 600; color: var(--accent); background: var(--accent-glow); border: 1px solid var(--border); padding: 2px 7px; border-radius: 3px; white-space: nowrap; margin-top: 2px; }
.outcome-text { font-size: 1rem; color: var(--text-secondary); line-height: 1.55; }

/* ─── ARTIFACT BOX ───────────────────────────────────────── */
.artifact-box {
  background: var(--bg-code);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  position: relative;
}
.artifact-box::before { content: ''; position: absolute; top: 0; left: 0; right: 0; height: 1px; background: linear-gradient(90deg, transparent, var(--accent), transparent); }
.artifact-header { display: flex; align-items: center; gap: 10px; padding: 10px 16px; background: rgba(231,76,60,0.08); border-bottom: 1px solid var(--border-dim); }
.artifact-dots { display: flex; gap: 5px; }
.artifact-dots span { width: 10px; height: 10px; border-radius: 50%; background: var(--accent-dim); opacity: 0.5; }
.artifact-dots span:first-child { background: #e74c3c; opacity: 0.8; }
.artifact-title { font-family: var(--font-mono); font-size: 11px; color: var(--text-muted); margin-left: 4px; }
.artifact-tag { margin-left: auto; font-family: var(--font-mono); font-size: 10px; font-weight: 600; letter-spacing: 0.15em; color: var(--accent-bright); background: var(--accent-glow); border: 1px solid var(--border); padding: 2px 8px; border-radius: 3px; }
.artifact-body { padding: 1.5rem; font-family: var(--font-mono); font-size: 13.5px; color: var(--text-code); line-height: 1.75; }
.artifact-body strong { color: var(--accent-bright); font-weight: 500; }

/* ─── RULE / STEP CARDS ──────────────────────────────────── */
.rule-cards, .step-cards { display: flex; flex-direction: column; gap: 1.5rem; }
.rule-card, .step-card {
  background: var(--bg-card);
  border: 1px solid var(--border-dim);
  border-radius: var(--radius-lg);
  padding: 2rem;
  position: relative;
  overflow: hidden;
  opacity: 0;
  transform: translateX(-30px);
  transition: border-color 0.3s, transform 0.3s, box-shadow 0.3s;
}
.rule-card:nth-child(even), .step-card:nth-child(even) { transform: translateX(30px); }
.rule-card.visible, .step-card.visible {
  opacity: 1;
  transform: translateX(0) !important;
  transition: opacity 0.5s ease, transform 0.5s ease, border-color 0.3s, box-shadow 0.3s;
}
.rule-card:hover, .step-card:hover { border-color: var(--border); box-shadow: 0 0 30px var(--accent-glow), inset 0 0 30px rgba(231,76,60,0.02); }
.rule-card::before, .step-card::before { content: ''; position: absolute; top: 0; left: 0; bottom: 0; width: 3px; background: linear-gradient(180deg, var(--accent-bright), var(--accent-dim)); border-radius: 3px 0 0 3px; }
.rule-number, .step-number { font-family: var(--font-mono); font-size: 3rem; font-weight: 600; color: rgba(231,76,60,0.12); position: absolute; top: 1.25rem; right: 1.5rem; line-height: 1; user-select: none; }
.rule-label, .step-label { font-family: var(--font-mono); font-size: 10px; letter-spacing: 0.2em; color: var(--accent-dim); text-transform: uppercase; margin-bottom: 0.5rem; }
.rule-title, .step-title { font-family: var(--font-mono); font-size: 1.1rem; font-weight: 600; color: var(--accent-bright); margin-bottom: 1rem; padding: 6px 12px; background: var(--accent-glow); border: 1px solid var(--border); border-radius: 4px; display: inline-block; }
.rule-body, .step-body { font-size: 1rem; color: var(--text-secondary); line-height: 1.8; }
.rule-body strong, .step-body strong { color: var(--text-primary); font-weight: 600; }
.rule-body em, .step-body em { font-style: italic; color: var(--text-muted); }
.rule-mandate, .step-note {
  margin-top: 1rem;
  padding: 0.75rem 1rem;
  background: rgba(231,76,60,0.06);
  border-left: 2px solid var(--accent-dim);
  border-radius: 0 4px 4px 0;
  font-size: 0.875rem;
  color: var(--text-secondary);
  font-style: italic;
}

/* ─── PROMPT BLOCK ───────────────────────────────────────── */
.prompt-wrapper {
  background: var(--bg-code);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  position: relative;
}
.prompt-wrapper::before { content: ''; position: absolute; top: 0; left: 0; right: 0; height: 1px; background: linear-gradient(90deg, transparent, var(--accent-bright), transparent); animation: shimmer 3s ease-in-out infinite; }
.prompt-header { display: flex; align-items: center; justify-content: space-between; padding: 10px 16px; background: rgba(231,76,60,0.06); border-bottom: 1px solid var(--border-dim); }
.prompt-file { display: flex; align-items: center; gap: 10px; }
.file-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 6px var(--accent); animation: pulse 2s ease-in-out infinite; }
.file-name { font-family: var(--font-mono); font-size: 12px; color: var(--text-muted); }
.copy-btn { font-family: var(--font-mono); font-size: 11px; font-weight: 500; color: var(--accent-bright); background: var(--accent-glow); border: 1px solid var(--border); border-radius: 4px; padding: 4px 14px; cursor: pointer; transition: background 0.2s, transform 0.1s, color 0.2s; white-space: nowrap; }
.copy-btn:hover { background: rgba(231,76,60,0.25); }
.copy-btn:active { transform: scale(0.96); }
.copy-btn.copied { color: #5effa0; border-color: #5effa0; background: rgba(94,255,160,0.08); }
.code-block { padding: 1.5rem; overflow-x: auto; max-height: 520px; overflow-y: auto; }
.code-block pre { font-family: var(--font-mono); font-size: 13.5px; line-height: 1.75; color: #c9b8c7; white-space: pre-wrap; word-break: break-word; }

/* XML syntax highlighting */
.xml-tag { color: var(--accent-bright); }
.xml-attr { color: #f0c674; }
.xml-val { color: #b5e853; }
.xml-comment { color: var(--text-muted); font-style: italic; }
.xml-text { color: #c9b8c7; }

/* ─── CHECKLIST ──────────────────────────────────────────── */
.checklist { display: flex; flex-direction: column; gap: 0.6rem; margin-bottom: 1.5rem; }
.check-item { display: flex; align-items: flex-start; gap: 0.875rem; padding: 0.75rem 1rem; background: var(--bg-card); border: 1px solid var(--border-dim); border-radius: var(--radius); cursor: pointer; transition: border-color 0.2s, background 0.2s; user-select: none; }
.check-item:hover { border-color: var(--border); }
.check-item.done { background: rgba(231,76,60,0.04); border-color: rgba(231,76,60,0.25); }
.check-box { width: 18px; height: 18px; min-width: 18px; border: 1px solid var(--border); border-radius: 3px; display: flex; align-items: center; justify-content: center; margin-top: 1px; transition: background 0.2s, border-color 0.2s; }
.check-item.done .check-box { background: var(--accent-dim); border-color: var(--accent); }
.check-icon { display: none; color: white; font-size: 11px; font-weight: 700; }
.check-item.done .check-icon { display: block; }
.check-label { font-size: 0.9rem; color: var(--text-secondary); line-height: 1.5; }
.check-item.done .check-label { color: var(--text-muted); text-decoration: line-through; text-decoration-color: var(--accent-dim); }

/* ─── QUICK REF CARD ─────────────────────────────────────── */
.qr-card { background: var(--bg-code); border: 1px solid var(--border); border-radius: var(--radius-lg); overflow: hidden; margin-top: 2rem; }
.qr-header { display: flex; align-items: center; gap: 10px; padding: 10px 16px; background: rgba(231,76,60,0.08); border-bottom: 1px solid var(--border-dim); }
.qr-title { font-family: var(--font-mono); font-size: 11px; color: var(--text-muted); font-weight: 500; }
.qr-body { padding: 1.5rem; font-family: var(--font-mono); font-size: 13.5px; color: var(--text-code); line-height: 1.85; }
.qr-section-title { color: var(--accent-bright); font-weight: 600; font-size: 11px; letter-spacing: 0.1em; margin: 1rem 0 0.4rem; text-transform: uppercase; }
.qr-section-title:first-child { margin-top: 0; }
.qr-rule { color: #f0e6ee; padding: 3px 0; }
.qr-rule span { color: var(--accent-bright); font-weight: 600; }
.qr-item { color: var(--text-secondary); padding: 2px 0; }
.qr-item::before { content: '□ '; color: var(--accent-dim); }
.qr-note { margin-top: 0.75rem; padding: 0.75rem; background: rgba(231,76,60,0.06); border-left: 2px solid var(--accent-dim); color: var(--text-muted); font-size: 12px; font-style: italic; }

/* ─── AFTER / BRIDGE ─────────────────────────────────────── */
.bridge-text {
  padding: 1.5rem;
  background: var(--bg-card);
  border: 1px solid var(--border-dim);
  border-radius: var(--radius-lg);
  font-size: 0.95rem;
  color: var(--text-secondary);
  line-height: 1.7;
  margin-top: 2rem;
  position: relative;
  overflow: hidden;
}
.bridge-text::before { content: 'NEXT →'; position: absolute; top: 1rem; right: 1rem; font-family: var(--font-mono); font-size: 10px; font-weight: 600; letter-spacing: 0.15em; color: var(--accent-dim); }
.bridge-text strong { color: var(--accent-bright); font-weight: 600; }

/* ─── FOOTER NAV ─────────────────────────────────────────── */
.footer-nav { border-top: 1px solid var(--border-dim); padding: 2rem 0 3rem; display: flex; justify-content: space-between; align-items: center; gap: 1rem; flex-wrap: wrap; }
.nav-btn { font-family: var(--font-mono); font-size: 12px; font-weight: 500; color: var(--text-secondary); background: var(--bg-card); border: 1px solid var(--border-dim); border-radius: var(--radius); padding: 0.75rem 1.5rem; cursor: pointer; text-decoration: none; display: flex; align-items: center; gap: 8px; transition: border-color 0.2s, color 0.2s, background 0.2s; }
.nav-btn:hover { border-color: var(--border); color: var(--accent-bright); background: var(--accent-glow); }
.nav-btn.next { color: var(--accent-bright); border-color: var(--border); background: var(--accent-glow); }
.nav-btn.next:hover { background: rgba(231,76,60,0.25); }
.footer-tag { font-family: var(--font-mono); font-size: 10px; color: var(--text-muted); }

/* ─── INTRO TEXT ─────────────────────────────────────────── */
.rules-intro, .concept-intro { font-size: 1.05rem; color: var(--text-secondary); margin-bottom: 2rem; line-height: 1.8; }
.concept-sub { font-size: 1.05rem; font-weight: 600; color: var(--text-primary); margin: 1.5rem 0 0.75rem; }
.concept-body { font-size: 1rem; color: var(--text-secondary); line-height: 1.8; margin-bottom: 1rem; }
.concept-body strong { color: var(--text-primary); font-weight: 600; }
.concept-callout { padding: 1rem 1.25rem; background: rgba(231,76,60,0.06); border-left: 2px solid var(--accent-dim); border-radius: 0 4px 4px 0; font-size: 0.9rem; color: var(--text-secondary); margin: 1rem 0; font-style: italic; }
.concept-code { font-family: var(--font-mono); color: var(--accent-bright); font-size: 0.875em; }

/* ─── FOLDER TREE ────────────────────────────────────────── */
.folder-tree { background: var(--bg-code); border: 1px solid var(--border); border-radius: var(--radius-lg); overflow: hidden; margin: 1.5rem 0; }
.folder-tree-header { display: flex; align-items: center; gap: 10px; padding: 10px 16px; background: rgba(231,76,60,0.08); border-bottom: 1px solid var(--border-dim); }
.folder-tree-title { font-family: var(--font-mono); font-size: 11px; color: var(--text-muted); }
.folder-tree pre { font-family: var(--font-mono); font-size: 12.5px; line-height: 1.7; color: #c9b8c7; padding: 1.25rem 1.5rem; white-space: pre; overflow-x: auto; }
.folder-tree .dir { color: var(--accent-bright); }
.folder-tree .comment { color: var(--text-muted); }

/* ─── ANIMATIONS ─────────────────────────────────────────── */
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(20px); }
  to { opacity: 1; transform: translateY(0); }
}
@keyframes slideInLeft {
  from { opacity: 0; transform: translateX(-20px); }
  to { opacity: 1; transform: translateX(0); }
}
@keyframes slideInRight {
  from { opacity: 0; transform: translateX(20px); }
  to { opacity: 1; transform: translateX(0); }
}
@keyframes shimmer {
  0%, 100% { opacity: 0.3; }
  50% { opacity: 1; }
}
@keyframes pulse {
  0%, 100% { opacity: 1; box-shadow: 0 0 6px var(--accent); }
  50% { opacity: 0.6; box-shadow: 0 0 12px var(--accent); }
}

/* ─── READING PROGRESS BAR ───────────────────────────────── */
#readingBar {
  position: fixed;
  top: 0; left: 0;
  height: 2px;
  width: 0%;
  background: linear-gradient(90deg, var(--accent-dim), var(--accent-bright));
  z-index: 200;
  pointer-events: none;
  box-shadow: 0 0 6px var(--accent);
}

/* ─── BACK TO TOP ────────────────────────────────────────── */
.back-to-top {
  position: fixed;
  bottom: 1.5rem;
  right: 1.5rem;
  z-index: 95;
  width: 36px; height: 36px;
  border-radius: 50%;
  background: var(--bg-card);
  border: 1px solid var(--border);
  color: var(--accent-bright);
  font-size: 14px;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s, background 0.2s;
  box-shadow: 0 4px 20px rgba(0,0,0,0.5);
  line-height: 1;
}
.back-to-top.visible { opacity: 1; pointer-events: auto; }
.back-to-top:hover { background: var(--accent-glow); }

/* ─── SIDENAV ────────────────────────────────────────────── */
.sidenav {
  position: fixed;
  left: 0; top: 56px; bottom: 0;
  width: 220px;
  background: var(--bg-surface);
  border-right: 1px solid var(--border-dim);
  z-index: 90;
  transform: translateX(-220px);
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}
.sidenav.open { transform: translateX(0); }
.sidenav-scroll {
  height: 100%;
  overflow-y: auto;
  padding: 1rem 0 3rem;
}
.sidenav-scroll::-webkit-scrollbar { width: 3px; }
.sidenav-scroll::-webkit-scrollbar-thumb { background: var(--border-dim); border-radius: 2px; }

.sn-home {
  display: block;
  font-family: var(--font-mono);
  font-size: 12.5px;
  color: var(--text-muted);
  padding: 0.6rem 1.25rem;
  text-decoration: none;
  transition: color 0.2s;
  border-bottom: 1px solid var(--border-dim);
  margin-bottom: 0.5rem;
}
.sn-home:hover { color: var(--accent-bright); }

.sn-part {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--accent-dim);
  padding: 1rem 1.25rem 0.35rem;
}
.sn-item {
  display: block;
  font-family: var(--font-mono);
  font-size: 13px;
  color: var(--text-secondary);
  padding: 0.4rem 1.25rem;
  text-decoration: none;
  border-left: 2px solid transparent;
  transition: color 0.2s, background 0.2s, border-color 0.2s;
  line-height: 1.4;
  cursor: pointer;
}
.sn-item:hover { color: var(--accent-bright); border-left-color: var(--accent-dim); background: var(--accent-glow); }
.sn-item.sn-active { color: var(--accent-bright); border-left-color: var(--accent); background: var(--accent-glow); font-weight: 600; }
.sn-item.sn-locked { color: var(--text-muted); opacity: 0.45; cursor: default; font-style: italic; }
.sn-item.sn-locked:hover { color: var(--text-muted); border-left-color: transparent; background: none; }

/* Toggle button (visible on narrow screens) */
.sidenav-toggle {
  position: fixed;
  left: 0.875rem;
  bottom: 1.5rem;
  z-index: 95;
  background: var(--bg-card);
  border: 1px solid var(--border);
  color: var(--accent-bright);
  font-size: 17px;
  width: 38px; height: 38px;
  border-radius: 50%;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: background 0.2s;
  box-shadow: 0 4px 20px rgba(0,0,0,0.5);
  line-height: 1;
  padding: 0;
}
.sidenav-toggle:hover { background: var(--accent-glow); }

/* Overlay (mobile) */
.sidenav-overlay {
  display: none;
  position: fixed; inset: 0;
  background: rgba(0,0,0,0.55);
  z-index: 85;
}
.sidenav-overlay.active { display: block; }

/* Wide screens: sidebar always visible, content shifts right */
@media (min-width: 1200px) {
  .sidenav { transform: translateX(0); }
  .sidenav-toggle { display: none; }
  body { padding-left: 220px; }
}

/* ─── RESPONSIVE ─────────────────────────────────────────── */
@media (max-width: 640px) {
  nav { padding: 0 1rem; }
  .container { padding: 0 1rem; }
  h1 { font-size: 1.75rem; }
  .rule-number, .step-number { font-size: 2rem; }
  .footer-nav { flex-direction: column; }
  .nav-btn { width: 100%; justify-content: center; }
  .progress-bar { width: 80px; }
}
