body {
  font-family: 'Noto Sans', sans-serif;
}

code, pre, .font-mono {
  font-family: 'Noto Sans Mono', monospace;
}

/* Sidebar nav items */
.nav-module {
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #9ca3af;
  padding: 0.75rem 0.5rem 0.25rem;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.45rem 0.75rem;
  border-radius: 0.5rem;
  font-size: 0.84rem;
  color: #4b5563;
  cursor: pointer;
  transition: all 0.15s;
  line-height: 1.35;
}

.nav-item:hover {
  background-color: #f3f4f6;
  color: #1f2937;
}

.nav-item.active {
  background-color: #ededfd;
  color: #605AEA;
  font-weight: 500;
}

.nav-item.completed .nav-check {
  color: #287d3c;
}

.nav-check {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  font-size: 0.65rem;
  border: 1.5px solid #d1d5db;
  color: transparent;
  transition: all 0.15s;
}

.nav-item.completed .nav-check {
  background: #edf9f0;
  border-color: #287d3c;
  color: #287d3c;
}

.nav-item.active .nav-check {
  border-color: #605AEA;
}

/* Lesson content */
.lesson-content h2 {
  font-size: 1.5rem;
  font-weight: 700;
  color: #20144C;
  margin-bottom: 0.5rem;
  line-height: 1.3;
}

.lesson-content h3 {
  font-size: 1.15rem;
  font-weight: 600;
  color: #374151;
  margin-top: 2rem;
  margin-bottom: 0.5rem;
}

.lesson-content p {
  color: #4b5563;
  line-height: 1.75;
  margin-bottom: 1rem;
}

.lesson-content ul, .lesson-content ol {
  color: #4b5563;
  line-height: 1.75;
  margin-bottom: 1rem;
  padding-left: 1.5rem;
}

.lesson-content ul { list-style-type: disc; }
.lesson-content ol { list-style-type: decimal; }

.lesson-content li { margin-bottom: 0.25rem; }

.lesson-content code {
  background: #f3f4f6;
  color: #605AEA;
  padding: 0.1rem 0.35rem;
  border-radius: 0.25rem;
  font-size: 0.85em;
}

.lesson-content pre {
  background: #1e1e2e;
  color: #cdd6f4;
  padding: 1rem 1.25rem;
  border-radius: 0.75rem;
  overflow-x: auto;
  margin-bottom: 1rem;
  font-size: 0.82rem;
  line-height: 1.6;
}

.lesson-content pre code {
  background: none;
  color: inherit;
  padding: 0;
  font-size: inherit;
}

/* Interactive exercise blocks */
.exercise-block {
  border: 1.5px solid #e5e7eb;
  border-radius: 0.75rem;
  overflow: hidden;
  margin: 1.5rem 0;
  background: white;
  box-shadow: 0 1px 3px rgba(0,0,0,0.04);
}

.exercise-header {
  background: linear-gradient(135deg, #605AEA 0%, #8B87F0 100%);
  color: white;
  padding: 0.65rem 1rem;
  font-size: 0.82rem;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.exercise-header .badge {
  background: rgba(255,255,255,0.2);
  padding: 0.1rem 0.5rem;
  border-radius: 1rem;
  font-size: 0.7rem;
  font-weight: 500;
}

.exercise-description {
  padding: 0.75rem 1rem;
  font-size: 0.85rem;
  color: #6b7280;
  border-bottom: 1px solid #f3f4f6;
  line-height: 1.5;
}

.exercise-prompt {
  background: #fafafa;
  padding: 0.75rem 1rem;
  border-bottom: 1px solid #f3f4f6;
}

.exercise-prompt label {
  display: block;
  font-size: 0.72rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: #9ca3af;
  margin-bottom: 0.35rem;
}

.exercise-prompt .prompt-text {
  font-family: 'Noto Sans Mono', monospace;
  font-size: 0.82rem;
  color: #374151;
  background: white;
  border: 1px solid #e5e7eb;
  border-radius: 0.5rem;
  padding: 0.6rem 0.75rem;
  width: 100%;
  outline: none;
  resize: vertical;
  min-height: 2.5rem;
  line-height: 1.5;
  transition: border-color 0.15s;
}

.exercise-prompt .prompt-text:focus {
  border-color: #605AEA;
  box-shadow: 0 0 0 2px rgba(96, 90, 234, 0.1);
}

.exercise-actions {
  padding: 0.5rem 1rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  border-bottom: 1px solid #f3f4f6;
  background: #fafafa;
}

.exercise-actions button {
  font-size: 0.8rem;
  font-weight: 500;
  padding: 0.4rem 1rem;
  border-radius: 0.4rem;
  transition: all 0.15s;
}

.btn-run {
  background: #605AEA;
  color: white;
}
.btn-run:hover { background: #8B87F0; }
.btn-run:disabled { opacity: 0.5; cursor: not-allowed; }

.btn-reset {
  background: white;
  color: #6b7280;
  border: 1px solid #e5e7eb;
}
.btn-reset:hover { background: #f9fafb; }

.exercise-output {
  background: #1e1e2e;
  color: #cdd6f4;
  padding: 1rem;
  font-family: 'Noto Sans Mono', monospace;
  font-size: 0.78rem;
  line-height: 1.6;
  max-height: 400px;
  overflow-y: auto;
  white-space: pre-wrap;
  word-break: break-word;
}

.exercise-output.hidden { display: none; }

.exercise-output .output-success { color: #a6e3a1; }
.exercise-output .output-error { color: #f38ba8; }
.exercise-output .output-info { color: #89b4fa; }
.exercise-output .output-dim { color: #6c7086; }

/* Info boxes */
.info-box {
  border-radius: 0.75rem;
  padding: 1rem 1.25rem;
  margin: 1rem 0;
  font-size: 0.88rem;
  line-height: 1.6;
}

.info-box.tip {
  background: #edf9f0;
  border-left: 3px solid #287d3c;
  color: #1a5c2c;
}

.info-box.warning {
  background: #fff4ec;
  border-left: 3px solid #eeb102;
  color: #7a5b00;
}

.info-box.note {
  background: #eef2fa;
  border-left: 3px solid #2e5aac;
  color: #1e3a6e;
}

.info-box strong {
  font-weight: 600;
}

/* Concept cards */
.concept-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 1rem;
  margin: 1rem 0;
}

.concept-card {
  border: 1px solid #e5e7eb;
  border-radius: 0.75rem;
  padding: 1rem;
  background: white;
  transition: all 0.15s;
}

.concept-card:hover {
  border-color: #605AEA;
  box-shadow: 0 2px 8px rgba(96, 90, 234, 0.1);
}

.concept-card h4 {
  font-size: 0.9rem;
  font-weight: 600;
  color: #20144C;
  margin-bottom: 0.35rem;
}

.concept-card p {
  font-size: 0.8rem;
  color: #6b7280;
  line-height: 1.5;
  margin: 0;
}

/* Table styling */
.lesson-content table {
  width: 100%;
  border-collapse: collapse;
  margin: 1rem 0;
  font-size: 0.85rem;
}

.lesson-content th {
  background: #f9fafb;
  font-weight: 600;
  text-align: left;
  padding: 0.6rem 0.75rem;
  border: 1px solid #e5e7eb;
  color: #374151;
}

.lesson-content td {
  padding: 0.5rem 0.75rem;
  border: 1px solid #e5e7eb;
  color: #4b5563;
}

/* Navigation buttons */
.lesson-nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 3rem;
  padding-top: 1.5rem;
  border-top: 1px solid #e5e7eb;
}

.lesson-nav button {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.6rem 1.25rem;
  border-radius: 0.5rem;
  font-size: 0.85rem;
  font-weight: 500;
  transition: all 0.15s;
}

.lesson-nav .btn-prev {
  color: #6b7280;
  border: 1px solid #e5e7eb;
}
.lesson-nav .btn-prev:hover { background: #f9fafb; }

.lesson-nav .btn-next {
  background: #605AEA;
  color: white;
}
.lesson-nav .btn-next:hover { background: #8B87F0; }

/* Landing hero */
.hero-section {
  text-align: center;
  padding: 3rem 0;
}

.hero-section h1 {
  font-size: 2.25rem;
  font-weight: 700;
  color: #20144C;
  margin-bottom: 0.75rem;
}

.hero-section .subtitle {
  font-size: 1.1rem;
  color: #6b7280;
  max-width: 500px;
  margin: 0 auto 2rem;
  line-height: 1.6;
}

/* Module cards on landing */
.module-card {
  border: 1.5px solid #e5e7eb;
  border-radius: 0.75rem;
  padding: 1.25rem;
  background: white;
  cursor: pointer;
  transition: all 0.2s;
  text-align: left;
}

.module-card:hover {
  border-color: #605AEA;
  box-shadow: 0 4px 12px rgba(96, 90, 234, 0.12);
  transform: translateY(-1px);
}

.module-card .module-number {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: linear-gradient(135deg, #605AEA, #8B87F0);
  color: white;
  font-size: 0.75rem;
  font-weight: 700;
  margin-bottom: 0.65rem;
}

.module-card h3 {
  font-size: 1rem;
  font-weight: 600;
  color: #20144C;
  margin-bottom: 0.35rem;
}

.module-card p {
  font-size: 0.82rem;
  color: #6b7280;
  line-height: 1.5;
  margin: 0;
}

.module-card .lesson-count {
  font-size: 0.72rem;
  color: #9ca3af;
  margin-top: 0.65rem;
  font-weight: 500;
}

/* Scrollbar */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: #d1d5db; border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: #9ca3af; }

/* Spinner */
@keyframes spin { to { transform: rotate(360deg); } }
.spinner {
  display: inline-block;
  width: 14px;
  height: 14px;
  border: 2px solid rgba(255,255,255,0.3);
  border-top-color: white;
  border-radius: 50%;
  animation: spin 0.6s linear infinite;
}

.spinner-dark {
  border-color: rgba(96,90,234,0.2);
  border-top-color: #605AEA;
}

/* Prompt example blocks — the core visual element */
.prompt-example {
  border: 1.5px solid #e5e7eb;
  border-radius: 0.75rem;
  overflow: hidden;
  margin: 1.25rem 0;
  background: white;
  box-shadow: 0 1px 3px rgba(0,0,0,0.04);
}

.prompt-user {
  background: #f8f7ff;
  padding: 0.6rem 1rem 0.6rem 1rem;
  font-size: 0.88rem;
  color: #20144C;
  font-weight: 500;
  line-height: 1.5;
  border-bottom: 1px solid #ededfd;
  display: flex;
  align-items: baseline;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.prompt-user::before {
  content: 'You';
  font-size: 0.6rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: #605AEA;
  background: #ededfd;
  padding: 0.1rem 0.4rem;
  border-radius: 0.25rem;
  flex-shrink: 0;
  line-height: 1.4;
}

.prompt-user.bad {
  background: #fef2f2;
  border-bottom-color: #fecaca;
  text-decoration: line-through;
  color: #9ca3af;
}

.prompt-user.bad::before {
  content: 'Avoid';
  color: #da1414;
  background: #feefef;
}

.prompt-user.good {
  background: #f0fdf4;
  border-bottom-color: #bbf7d0;
}

.prompt-user.good::before {
  content: 'Better';
  color: #287d3c;
  background: #edf9f0;
}

.prompt-tool {
  padding: 0.5rem 1rem;
  font-size: 0.78rem;
  color: #6b7280;
  border-bottom: 1px solid #f3f4f6;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  background: #fafafa;
  flex-wrap: wrap;
}

.tool-badge {
  background: linear-gradient(135deg, #605AEA, #8B87F0);
  color: white;
  padding: 0.1rem 0.55rem;
  border-radius: 0.3rem;
  font-size: 0.7rem;
  font-weight: 600;
  font-family: 'Noto Sans Mono', monospace;
  white-space: nowrap;
  flex-shrink: 0;
}

.tool-action {
  font-family: 'Noto Sans Mono', monospace;
  font-size: 0.76rem;
  color: #4b5563;
}

.prompt-response {
  padding: 0.75rem 1rem;
  font-size: 0.84rem;
  color: #6b7280;
  line-height: 1.6;
}

.prompt-response pre {
  margin-top: 0.5rem;
  margin-bottom: 0;
}

.prompt-response code {
  background: #f3f4f6;
  color: #605AEA;
  padding: 0.1rem 0.3rem;
  border-radius: 0.2rem;
  font-size: 0.8em;
}

/* Mobile menu toggle */
#mobile-menu-btn {
  display: none;
}

/* Tables scroll horizontally on small screens */
.lesson-content .table-wrap {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

/* ─── Responsive ────────────────────────────────── */
@media (max-width: 768px) {
  /* Show hamburger */
  #mobile-menu-btn { display: flex; }

  /* Sidebar becomes a slide-over */
  #sidebar {
    transform: translateX(-100%);
    transition: transform 0.25s ease;
    width: 80vw;
    max-width: 320px;
    box-shadow: none;
  }
  #sidebar.open {
    transform: translateX(0);
    box-shadow: 4px 0 24px rgba(0,0,0,0.15);
  }

  /* Backdrop */
  #sidebar-backdrop {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.3);
    z-index: 35;
  }
  #sidebar-backdrop.open { display: block; }

  /* Content full-width */
  #content {
    margin-left: 0 !important;
    padding: 1.25rem 1rem;
  }

  /* Smaller hero */
  .hero-section { padding: 1.5rem 0; }
  .hero-section h1 { font-size: 1.6rem; }
  .hero-section .subtitle { font-size: 0.95rem; }

  /* Single-column module cards */
  .concept-grid {
    grid-template-columns: 1fr;
  }

  /* Tables: let them scroll */
  .lesson-content table {
    display: block;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    white-space: nowrap;
  }

  /* Pre blocks scroll */
  .lesson-content pre {
    font-size: 0.75rem;
    padding: 0.75rem 1rem;
  }

  /* Prompt blocks tighter */
  .prompt-user { font-size: 0.82rem; }
  .prompt-tool { font-size: 0.72rem; }
  .tool-action { font-size: 0.7rem; word-break: break-all; }
  .prompt-response { font-size: 0.8rem; }

  /* Lesson nav stack on narrow */
  .lesson-nav {
    flex-direction: column;
    gap: 0.75rem;
  }
  .lesson-nav button { width: 100%; justify-content: center; }

  /* Lesson heading */
  .lesson-content h2 { font-size: 1.25rem; }
  .lesson-content h3 { font-size: 1rem; }
}
