.hero.compact h1 {
  font-size: clamp(2rem, 2.6vw, 3rem);
}

.course-layout {
  display: grid;
  grid-template-columns: minmax(240px, 280px) minmax(0, 1fr);
  gap: 48px;
  position: relative;
  z-index: 1;
  align-items: start;
}

.course-sidebar {
  position: sticky;
  top: 100px;
  align-self: start;
  background: var(--panel);
  border: 1px solid var(--panel-border);
  border-radius: 20px;
  padding: 20px;
  box-shadow: var(--shadow);
  max-height: calc(100vh - 140px);
  overflow-y: auto;
}

.nav-title {
  font-weight: 700;
  font-size: 1.1rem;
  margin-bottom: 16px;
  color: var(--ink);
}

.nav-group {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin-bottom: 20px;
}

.nav-group-title {
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--accent);
  margin-bottom: 8px;
  font-weight: 600;
}

.nav-link {
  color: var(--ink);
  text-decoration: none;
  font-size: 0.85rem;
  padding: 6px 10px;
  border-radius: 8px;
  transition: all 0.15s ease;
  display: block;
}

.nav-link:hover {
  color: var(--accent);
  background: rgba(0, 0, 0, 0.04);
}

.nav-link.muted {
  color: #b0a89a;
  cursor: default;
  opacity: 0.7;
}

.nav-link.muted:hover {
  background: none;
  color: #b0a89a;
}

.course {
  max-width: 820px;
  display: flex;
  flex-direction: column;
  gap: 64px;
}

.lesson {
  display: flex;
  flex-direction: column;
  gap: 16px;
  padding-bottom: 48px;
  border-bottom: 1px solid var(--panel-border);
}

.lesson:last-child {
  border-bottom: none;
}

.lesson h2 {
  margin: 0;
  font-family: var(--font-serif);
  font-size: 1.75rem;
  color: var(--ink);
  line-height: 1.3;
}

.lesson p {
  margin: 0;
  color: var(--muted);
  line-height: 1.6;
}

/* Markdown-rendered lesson text */
.lesson-text {
  color: var(--ink);
  line-height: 1.75;
  font-size: 1.05rem;
}

.lesson-text p {
  margin: 0 0 1em 0;
  color: var(--ink);
}

.lesson-text p:last-child {
  margin-bottom: 0;
}

.lesson-text strong {
  color: var(--accent);
  font-weight: 600;
}

.lesson-text em {
  font-style: italic;
  color: var(--muted);
}

.lesson-text code {
  background: rgba(0, 0, 0, 0.06);
  padding: 0.2em 0.5em;
  border-radius: 4px;
  font-family: "SFMono-Regular", "Menlo", monospace;
  font-size: 0.88em;
  color: #c25;
}

.lesson-text ul, .lesson-text ol {
  margin: 0.75em 0;
  padding-left: 1.75em;
}

.lesson-text li {
  margin: 0.4em 0;
  line-height: 1.6;
}

.lesson-text li::marker {
  color: var(--accent);
}

.lesson-text h2, .lesson-text h3 {
  margin: 1.5em 0 0.75em 0;
  font-family: var(--font-serif);
  color: var(--ink);
}

.lesson-text h2 {
  font-size: 1.4rem;
}

.lesson-text h3 {
  font-size: 1.2rem;
}

.lesson-text blockquote {
  border-left: 3px solid var(--accent);
  margin: 1em 0;
  padding: 0.5em 0 0.5em 1.25em;
  color: var(--muted);
  background: rgba(0, 0, 0, 0.02);
  border-radius: 0 8px 8px 0;
}

.lesson-text pre {
  background: #1a1a1a;
  padding: 1em;
  border-radius: 8px;
  overflow-x: auto;
  font-size: 0.9em;
}

.lesson-text pre code {
  background: none;
  padding: 0;
  color: #e0e0e0;
}

.inline-example {
  background: #0d0f0d;
  border-radius: 16px;
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  border: 1px solid rgba(255, 255, 255, 0.06);
}

.inline-header {
  display: flex;
  align-items: center;
  gap: 12px;
  color: #a0a0a0;
  font-size: 0.85rem;
  font-weight: 500;
}

.inline-header span:first-child {
  color: #f6f3ea;
}

.inline-header .inline-status {
  margin-left: auto;
  background: rgba(255, 255, 255, 0.08);
  padding: 5px 12px;
  border-radius: 999px;
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-weight: 600;
}

.inline-header .inline-status.running {
  background: rgba(80, 200, 120, 0.2);
  color: #50c878;
}

.inline-header .inline-status.done {
  background: rgba(80, 150, 255, 0.2);
  color: #5096ff;
}

.inline-example textarea {
  min-height: 200px;
  background: #0d0f0d;
  color: #f6f3ea;
  border-radius: 12px;
  padding: 14px;
  font-family: "SFMono-Regular", "Menlo", monospace;
  font-size: 13px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  resize: vertical;
}

.inline-example pre {
  background: #faf8f4;
  border-radius: 12px;
  padding: 16px;
  color: #1b1a17;
  font-size: 13px;
  min-height: 60px;
  font-family: "SFMono-Regular", "Menlo", monospace;
  line-height: 1.5;
  overflow-x: auto;
  border: 1px solid rgba(0, 0, 0, 0.06);
}

.inline-example pre:empty::before {
  content: "Output will appear here...";
  color: #999;
  font-style: italic;
}

.inline-example .editor-cm {
  min-height: 200px;
  border-radius: 12px;
  overflow: hidden;
}

.inline-example .cm-editor {
  min-height: 200px;
  font-size: 13px;
}

.inline-example .cm-editor .cm-scroller {
  font-family: "SFMono-Regular", "Menlo", monospace;
}

/* Run button styling */
.inline-example button.ghost {
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.15);
  color: #f6f3ea;
  padding: 6px 16px;
  border-radius: 8px;
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s ease;
}

.inline-example button.ghost:hover {
  background: rgba(255, 255, 255, 0.15);
  border-color: rgba(255, 255, 255, 0.25);
}

.inline-example button.ghost:active {
  transform: scale(0.98);
}

@media (max-width: 1000px) {
  .course-layout {
    grid-template-columns: 1fr;
    gap: 32px;
  }

  .course-sidebar {
    position: static;
    max-height: none;
  }

  .course {
    gap: 48px;
  }

  .lesson {
    padding-bottom: 32px;
  }
}
