/* ── Base (matches site style.css) ──────────────────────────── */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: 'DM Sans', sans-serif;
  max-width: 700px;
  margin: 2rem auto;
  padding: 0 1rem;
  line-height: 1.6;
  color: #e0e0e0;
  background-color: #1e1e1e;
}

h1, h2 {
  font-weight: 600;
  margin-top: 2rem;
  color: #ffffff;
}

a {
  color: #8ab4f8;
  text-decoration: none;
}
a:hover {
  text-decoration: underline;
}

hr {
  border: none;
  border-top: 1px solid #444;
  margin: 1.5rem 0;
}

ul, ol {
  padding-left: 1.2rem;
}

strong {
  font-weight: 600;
}

nav {
  background-color: #2a2a2a;
  padding: 0.5rem 1rem;
  margin-bottom: 2rem;
  border-radius: 8px;
}

.nav-menu {
  list-style: none;
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 1.5rem;
  padding: 0;
  margin: 0;
}

.nav-menu li a {
  color: #e0e0e0;
  text-decoration: none;
  font-weight: 600;
}
.nav-menu li a:hover {
  text-decoration: underline;
}

/* ── Progress bar ────────────────────────────────────────────── */
#progress-bar-wrap {
  position: sticky;
  top: 0;
  z-index: 100;
  background: #1e1e1e;
  padding: 0.4rem 0;
  margin-bottom: 1.5rem;
}

#progress-bar-track {
  height: 4px;
  background: #333;
  border-radius: 2px;
  overflow: hidden;
}

#progress-bar-fill {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, #4ade80, #8ab4f8);
  border-radius: 2px;
  transition: width 0.2s ease;
}

#progress-label {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.7rem;
  color: #666;
  text-align: right;
  margin-top: 4px;
}

/* ── Lesson header ───────────────────────────────────────────── */
.lesson-header {
  border-left: 3px solid #4ade80;
  padding-left: 1rem;
  margin-bottom: 2rem;
}

.lesson-header h1 {
  font-size: 1.8rem;
  margin-top: 0;
  color: #fff;
}

.lesson-header .subtitle {
  color: #888;
  font-size: 0.9rem;
  font-family: 'JetBrains Mono', monospace;
}

.lesson-note {
  background: #2a2a2a;
  border: 1px solid #3a3a3a;
  border-left: 3px solid #facc15;
  border-radius: 6px;
  padding: 0.75rem 1rem;
  font-size: 0.9rem;
  color: #ccc;
  margin-bottom: 1.5rem;
}

/* ── Step sections ───────────────────────────────────────────── */
.step-section.locked * {
  color: #555 !important;
  border-color: #333 !important;
  background: transparent !important;
  pointer-events: none !important;
}

@keyframes fadeUp {
  from { opacity: 0; transform: translateY(12px); }
  to   { opacity: 1; transform: translateY(0); }
}

.step-header {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 1rem;
}

.step-badge {
  background: #4ade80;
  color: #111;
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.7rem;
  font-weight: 700;
  padding: 0.2rem 0.5rem;
  border-radius: 4px;
  white-space: nowrap;
}

.step-header h2 {
  margin-top: 0;
  font-size: 1.25rem;
  color: #fff;
}

/* ── Subheadings ─────────────────────────────────────────────── */
h3 {
  color: #8ab4f8;
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.85rem;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  margin: 1.5rem 0 0.5rem;
}

p {
  margin-bottom: 0.9rem;
}

/* ── Code blocks ─────────────────────────────────────────────── */
.code-block {
  background: #141414;
  border: 1px solid #333;
  border-radius: 8px;
  margin: 1rem 0;
  overflow: hidden;
}

.code-block-header {
  background: #252525;
  padding: 0.35rem 0.75rem;
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.7rem;
  color: #666;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.copy-btn {
  background: none;
  border: 1px solid #444;
  color: #8ab4f8;
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.65rem;
  padding: 0.15rem 0.5rem;
  border-radius: 3px;
  cursor: pointer;
  transition: background 0.15s;
}
.copy-btn:hover {
  background: #333;
}
.copy-btn.copied {
  color: #4ade80;
  border-color: #4ade80;
}

.code-block pre {
  padding: 0.75rem 1rem;
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.85rem;
  color: #4ade80;
  overflow-x: auto;
  white-space: pre;
}

/* ── Inline code ─────────────────────────────────────────────── */
code {
  font-family: 'JetBrains Mono', monospace;
  background: #2a2a2a;
  color: #4ade80;
  padding: 0.1em 0.35em;
  border-radius: 3px;
  font-size: 0.88em;
}

/* ── Command reference table ─────────────────────────────────── */
.cmd-table {
  width: 100%;
  border-collapse: collapse;
  margin: 1rem 0;
  font-size: 0.88rem;
}

.cmd-table th {
  background: #252525;
  color: #8ab4f8;
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.75rem;
  text-align: left;
  padding: 0.5rem 0.75rem;
  border-bottom: 1px solid #333;
}

.cmd-table td {
  padding: 0.55rem 0.75rem;
  border-bottom: 1px solid #2a2a2a;
  vertical-align: top;
}
.cmd-table tr:last-child td {
  border-bottom: none;
}
.cmd-table tr:hover td {
  background: #242424;
}
.cmd-table td:first-child {
  font-family: 'JetBrains Mono', monospace;
  color: #4ade80;
  white-space: nowrap;
}

/* ── Key term highlights ─────────────────────────────────────── */
.term {
  color: #fbbf24;
  border-bottom: 1px dashed #fbbf24;
  cursor: help;
  position: relative;
}

.term-tooltip {
  display: none;
}

/* ── Floating tooltip (escapes overflow:hidden on accordions) ── */
#floating-tooltip {
  display: none;
  position: fixed;
  background: #2a2a2a;
  border: 1px solid #fbbf24;
  border-radius: 6px;
  padding: 0.5rem 0.75rem;
  font-size: 0.8rem;
  color: #e0e0e0;
  width: 220px;
  z-index: 9999;
  line-height: 1.4;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.5);
  font-family: 'DM Sans', sans-serif;
  pointer-events: none;
}

/* ── Accordion ───────────────────────────────────────────────── */
.accordion {
  border: 1px solid #333;
  border-radius: 8px;
  margin: 1rem 0;
  overflow: hidden;
}

.accordion-btn {
  width: 100%;
  background: #252525;
  border: none;
  color: #e0e0e0;
  padding: 0.75rem 1rem;
  text-align: left;
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-family: 'DM Sans', sans-serif;
  font-size: 0.92rem;
  font-weight: 500;
  transition: background 0.15s;
}
.accordion-btn:hover {
  background: #2e2e2e;
}

.accordion-btn .chevron {
  transition: transform 0.25s ease;
  color: #8ab4f8;
  font-size: 0.75rem;
}
.accordion-btn.open .chevron {
  transform: rotate(180deg);
}

.accordion-body {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.3s ease;
}
.accordion-body.open {
  max-height: 2000px;
}

.accordion-inner {
  padding: 0.75rem 1rem;
  font-size: 0.9rem;
  color: #ccc;
}

/* ── Quiz ────────────────────────────────────────────────────── */
.quiz-block {
  background: #1a2035;
  border: 1px solid #2d3a5e;
  border-radius: 10px;
  padding: 1.25rem;
  margin: 1.5rem 0;
}

.quiz-block h4 {
  color: #8ab4f8;
  font-size: 0.8rem;
  font-family: 'JetBrains Mono', monospace;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: 0.75rem;
}

.quiz-question {
  color: #e0e0e0;
  font-weight: 500;
  margin-bottom: 0.75rem;
}

.quiz-options {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.quiz-options li button {
  width: 100%;
  text-align: left;
  background: #252535;
  border: 1px solid #3a3a5a;
  border-radius: 6px;
  color: #ccc;
  padding: 0.55rem 0.85rem;
  cursor: pointer;
  font-family: 'DM Sans', sans-serif;
  font-size: 0.88rem;
  transition: background 0.15s, border-color 0.15s;
}
.quiz-options li button:hover {
  background: #2e2e4e;
  border-color: #8ab4f8;
}
.quiz-options li button.correct {
  background: #1a3a2a;
  border-color: #4ade80;
  color: #4ade80;
}
.quiz-options li button.wrong {
  background: #3a1a1a;
  border-color: #f87171;
  color: #f87171;
}
.quiz-options li button:disabled {
  cursor: default;
}

.quiz-feedback {
  margin-top: 0.75rem;
  font-size: 0.85rem;
  min-height: 1.4em;
  font-style: italic;
  color: #aaa;
}
.quiz-feedback.correct {
  color: #4ade80;
}
.quiz-feedback.wrong {
  color: #f87171;
}

/* ── Step checklist ──────────────────────────────────────────── */
.checklist {
  list-style: none;
  padding-left: 0;
  margin: 0.75rem 0;
}

.checklist li {
  display: flex;
  gap: 0.6rem;
  align-items: flex-start;
  padding: 0.35rem 0;
  color: #ccc;
  font-size: 0.9rem;
  cursor: pointer;
  border-radius: 4px;
  transition: color 0.2s;
}
.checklist li:hover {
  color: #e0e0e0;
}
.checklist li.done {
  color: #4ade80;
  text-decoration: line-through;
}

.checklist li .check-icon {
  width: 16px;
  height: 16px;
  border: 1.5px solid #555;
  border-radius: 3px;
  flex-shrink: 0;
  margin-top: 3px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.6rem;
  transition: background 0.2s, border-color 0.2s;
}
.checklist li.done .check-icon {
  background: #4ade80;
  border-color: #4ade80;
  color: #111;
}

/* ── Optional badge ──────────────────────────────────────────── */
.optional-badge {
  background: #2a2a2a;
  border: 1px solid #555;
  color: #888;
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.65rem;
  padding: 0.15rem 0.4rem;
  border-radius: 3px;
  margin-left: 0.5rem;
  vertical-align: middle;
}

/* ── Lesson footer ───────────────────────────────────────────── */
.lesson-footer {
  text-align: center;
  padding: 2rem 0 3rem;
  color: #555;
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.8rem;
}

/* ── Responsive ──────────────────────────────────────────────── */
@media (max-width: 640px) {
  .lesson-header h1 {
    font-size: 1.4rem;
  }
  .cmd-table {
    font-size: 0.8rem;
  }
}

/* ── Screenshots ─────────────────────────────────────────────── */
.screenshot-wrap {
  margin: 1rem 0 1.25rem;
  border-radius: 8px;
  overflow: hidden;
  border: 1px solid #333;
}

.screenshot {
  width: 100%;
  height: auto;
  display: block;
}

.screenshot-caption {
  background: #252525;
  color: #888;
  font-size: 0.75rem;
  font-family: 'JetBrains Mono', monospace;
  padding: 0.4rem 0.75rem;
  margin: 0;
  border-top: 1px solid #333;
}

/* ── Reset button ────────────────────────────────────────── */
.reset-btn {
  background: none;
  border: 1px solid #444;
  color: #666;
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.7rem;
  padding: 0.3rem 0.75rem;
  border-radius: 4px;
  cursor: pointer;
  transition: border-color 0.15s, color 0.15s;
}

.reset-btn:hover {
  border-color: #f87171;
  color: #f87171;
}