/* ============================================================
   Netflix DevOps Interview Course — Design System
   ============================================================ */

:root {
  --font-sans: "DM Sans", system-ui, -apple-system, sans-serif;
  --font-display: "Fraunces", Georgia, serif;
  --font-mono: "JetBrains Mono", ui-monospace, monospace;

  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-xl: 24px;

  --shadow-sm: 0 1px 2px rgba(0,0,0,.06);
  --shadow-md: 0 8px 24px rgba(0,0,0,.08);
  --shadow-lg: 0 16px 48px rgba(0,0,0,.12);

  --sidebar-w: 300px;
  --topbar-h: 60px;
  --ease: cubic-bezier(.22, 1, .36, 1);
  --transition: 180ms var(--ease);

  /* Brand accents (shared) */
  --accent: #e50914;
  --accent-soft: rgba(229, 9, 20, .12);
  --accent-2: #7c5cfc;
  --accent-2-soft: rgba(124, 92, 252, .14);
  --success: #10b981;
  --success-soft: rgba(16, 185, 129, .12);
  --warning: #f59e0b;
  --warning-soft: rgba(245, 158, 11, .14);
  --info: #38bdf8;
  --info-soft: rgba(56, 189, 248, .12);
  --danger: #ef4444;
}

/* ---------- Light ---------- */
html[data-theme="light"] {
  --bg: #f4f1ec;
  --bg-elevated: #fffcf8;
  --bg-muted: #ebe6de;
  --bg-code: #1e1b18;
  --text: #1a1614;
  --text-secondary: #5c534c;
  --text-muted: #8a7f76;
  --border: rgba(26, 22, 20, .1);
  --border-strong: rgba(26, 22, 20, .16);
  --sidebar-bg: #fffaf5;
  --card-bg: #fffcf8;
  --card-hover: #fff;
  --code-text: #f5efe8;
  --code-keyword: #ff7b72;
  --code-string: #a5d6ff;
  --code-comment: #8b949e;
  --glow: rgba(229, 9, 20, .08);
  --selection: rgba(229, 9, 20, .18);
  --input-bg: #fff;
  color-scheme: light;
}

/* ---------- Dark ---------- */
html[data-theme="dark"] {
  --bg: #0d0b0c;
  --bg-elevated: #161214;
  --bg-muted: #1e1a1c;
  --bg-code: #0a0809;
  --text: #f5efe9;
  --text-secondary: #b5a99e;
  --text-muted: #7a7068;
  --border: rgba(245, 239, 233, .08);
  --border-strong: rgba(245, 239, 233, .14);
  --sidebar-bg: #120f11;
  --card-bg: #161214;
  --card-hover: #1c181a;
  --code-text: #e8e0d8;
  --code-keyword: #ff8b82;
  --code-string: #9dcf9d;
  --code-comment: #6b635c;
  --glow: rgba(229, 9, 20, .15);
  --selection: rgba(229, 9, 20, .28);
  --input-bg: #1a1618;
  color-scheme: dark;
}

/* ---------- Reset ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.65;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
}
::selection { background: var(--selection); }
img { max-width: 100%; }
button { font-family: inherit; cursor: pointer; }
a { color: var(--accent); text-decoration-thickness: 1px; text-underline-offset: 3px; }
a:hover { opacity: .9; }

/* ---------- Layout ---------- */
.app {
  display: flex;
  min-height: 100vh;
}

.sidebar {
  position: fixed;
  top: 0;
  left: 0;
  z-index: 40;
  width: var(--sidebar-w);
  height: 100vh;
  display: flex;
  flex-direction: column;
  background: var(--sidebar-bg);
  border-right: 1px solid var(--border);
  transform: translateX(0);
  transition: transform var(--transition);
}

.sidebar__brand {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 18px 16px;
  border-bottom: 1px solid var(--border);
}

.logo {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  background: linear-gradient(135deg, #e50914 0%, #b20710 100%);
  display: grid;
  place-items: center;
  box-shadow: 0 4px 16px rgba(229, 9, 20, .35);
  flex-shrink: 0;
}
.logo__n {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.25rem;
  color: #fff;
  line-height: 1;
}

.sidebar__brand-text {
  display: flex;
  flex-direction: column;
  min-width: 0;
  flex: 1;
}
.sidebar__brand-text strong {
  font-size: .92rem;
  letter-spacing: -.01em;
}
.sidebar__brand-text span {
  font-size: .72rem;
  color: var(--text-muted);
}

.sidebar-close { display: none; }

.sidebar__progress {
  padding: 16px;
  border-bottom: 1px solid var(--border);
}
.progress-meta {
  display: flex;
  justify-content: space-between;
  font-size: .78rem;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 8px;
}
.progress-bar {
  height: 6px;
  border-radius: 99px;
  background: var(--bg-muted);
  overflow: hidden;
}
.progress-bar__fill {
  height: 100%;
  width: 0%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--accent), #ff6b4a);
  transition: width 400ms var(--ease);
}
.progress-sub {
  margin: 8px 0 0;
  font-size: .72rem;
  color: var(--text-muted);
}

.sidebar__nav {
  flex: 1;
  overflow-y: auto;
  padding: 12px 10px 24px;
  scrollbar-width: thin;
}

.sidebar__footer {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 12px 16px;
  border-top: 1px solid var(--border);
}
a.btn { text-decoration: none; }

.nav-round {
  margin-bottom: 8px;
}
.nav-round__btn {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 10px;
  border: 0;
  border-radius: var(--radius-sm);
  background: transparent;
  color: var(--text);
  font-weight: 600;
  font-size: .82rem;
  text-align: left;
  transition: background var(--transition);
}
.nav-round__btn:hover { background: var(--bg-muted); }
.nav-round__chevron {
  margin-left: auto;
  transition: transform var(--transition);
  opacity: .5;
}
.nav-round.is-open .nav-round__chevron { transform: rotate(90deg); }
.nav-round__badge {
  font-size: .65rem;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 99px;
  background: var(--accent-soft);
  color: var(--accent);
}

.nav-lessons {
  list-style: none;
  margin: 0;
  padding: 0 0 8px 8px;
  display: none;
}
.nav-round.is-open .nav-lessons { display: block; }

.nav-lesson {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  width: 100%;
  padding: 8px 10px;
  border: 0;
  border-radius: var(--radius-sm);
  background: transparent;
  color: var(--text-secondary);
  font-size: .8rem;
  text-align: left;
  line-height: 1.35;
  transition: background var(--transition), color var(--transition);
}
.nav-lesson:hover {
  background: var(--bg-muted);
  color: var(--text);
}
.nav-lesson.is-active {
  background: var(--accent-soft);
  color: var(--text);
  font-weight: 600;
}
.nav-lesson__num {
  flex-shrink: 0;
  width: 22px;
  height: 22px;
  border-radius: 6px;
  display: grid;
  place-items: center;
  font-size: .68rem;
  font-weight: 700;
  background: var(--bg-muted);
  color: var(--text-muted);
}
.nav-lesson.is-active .nav-lesson__num {
  background: var(--accent);
  color: #fff;
}
.nav-lesson.is-done .nav-lesson__num {
  background: var(--success-soft);
  color: var(--success);
}
.nav-home {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 12px;
  margin-bottom: 8px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--card-bg);
  color: var(--text);
  font-size: .82rem;
  font-weight: 600;
}
.nav-home:hover { border-color: var(--border-strong); }
.nav-home.is-active {
  border-color: var(--accent);
  background: var(--accent-soft);
}

.sidebar-backdrop {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 35;
  background: rgba(0,0,0,.45);
  backdrop-filter: blur(2px);
}

.main {
  flex: 1;
  margin-left: var(--sidebar-w);
  min-width: 0;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  height: var(--topbar-h);
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 0 20px;
  background: color-mix(in srgb, var(--bg) 82%, transparent);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
}
.topbar__crumbs {
  flex: 1;
  font-size: .85rem;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.topbar__crumbs strong { color: var(--text); font-weight: 600; }
.topbar__actions { display: flex; align-items: center; gap: 8px; }
.hub-link {
  font-family: var(--font-mono);
  font-size: .72rem;
  font-weight: 600;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--text-muted);
  text-decoration: none;
  padding: 6px 10px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  white-space: nowrap;
}
.hub-link:hover {
  color: var(--text);
  background: var(--bg-muted);
  border-color: var(--border-strong);
}

#menuToggle { display: none; }

.content {
  flex: 1;
  padding: 28px 28px 80px;
  max-width: 880px;
  width: 100%;
  margin: 0 auto;
  outline: none;
}

/* ---------- Buttons ---------- */
.icon-btn {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--card-bg);
  color: var(--text);
  transition: background var(--transition), border-color var(--transition);
}
.icon-btn:hover {
  background: var(--bg-muted);
  border-color: var(--border-strong);
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 18px;
  border-radius: var(--radius-sm);
  border: 1px solid transparent;
  font-weight: 600;
  font-size: .9rem;
  transition: transform 120ms var(--ease), background var(--transition), border-color var(--transition), box-shadow var(--transition);
}
.btn:active { transform: scale(.98); }
.btn--primary {
  background: linear-gradient(135deg, #e50914, #c20812);
  color: #fff;
  box-shadow: 0 4px 16px rgba(229, 9, 20, .3);
}
.btn--primary:hover { box-shadow: 0 6px 22px rgba(229, 9, 20, .4); }
.btn--secondary {
  background: var(--card-bg);
  border-color: var(--border-strong);
  color: var(--text);
}
.btn--secondary:hover { background: var(--bg-muted); }
.btn--ghost {
  background: transparent;
  border-color: var(--border);
  color: var(--text-secondary);
}
.btn--ghost:hover { color: var(--text); background: var(--bg-muted); }
.btn--sm { padding: 6px 12px; font-size: .78rem; }
.btn--success {
  background: var(--success);
  color: #fff;
}
.btn:disabled {
  opacity: .5;
  cursor: not-allowed;
  transform: none;
}

/* Theme toggle */
.theme-toggle {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 4px 10px 4px 4px;
  border: 1px solid var(--border);
  border-radius: 99px;
  background: var(--card-bg);
  color: var(--text-secondary);
  font-size: .78rem;
  font-weight: 600;
}
.theme-toggle__track {
  width: 44px;
  height: 26px;
  border-radius: 99px;
  background: var(--bg-muted);
  position: relative;
  display: block;
}
.theme-toggle__thumb {
  position: absolute;
  top: 3px;
  left: 3px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--card-bg);
  border: 1px solid var(--border);
  display: grid;
  place-items: center;
  transition: transform var(--transition);
  color: var(--warning);
}
html[data-theme="dark"] .theme-toggle__thumb {
  transform: translateX(18px);
  color: var(--accent-2);
}
.theme-toggle .icon-sun { display: block; }
.theme-toggle .icon-moon { display: none; }
html[data-theme="dark"] .theme-toggle .icon-sun { display: none; }
html[data-theme="dark"] .theme-toggle .icon-moon { display: block; }

/* ---------- Home ---------- */
.hero {
  position: relative;
  padding: 36px 32px;
  border-radius: var(--radius-xl);
  background:
    radial-gradient(ellipse 80% 80% at 10% 0%, var(--glow), transparent 55%),
    radial-gradient(ellipse 60% 50% at 100% 100%, var(--accent-2-soft), transparent 50%),
    var(--card-bg);
  border: 1px solid var(--border);
  margin-bottom: 28px;
  overflow: hidden;
}
.hero__eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: .75rem;
  font-weight: 700;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 12px;
}
.hero h1 {
  font-family: var(--font-display);
  font-size: clamp(1.75rem, 4vw, 2.4rem);
  line-height: 1.15;
  letter-spacing: -.02em;
  margin: 0 0 14px;
  max-width: 16ch;
}
.hero__lead {
  margin: 0 0 22px;
  color: var(--text-secondary);
  font-size: 1.05rem;
  max-width: 48ch;
}
.hero__actions { display: flex; flex-wrap: wrap; gap: 10px; }

.stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  margin-bottom: 28px;
}
.stat-card {
  padding: 16px 18px;
  border-radius: var(--radius-md);
  background: var(--card-bg);
  border: 1px solid var(--border);
}
.stat-card__value {
  font-family: var(--font-display);
  font-size: 1.6rem;
  font-weight: 700;
  letter-spacing: -.02em;
  color: var(--text);
}
.stat-card__label {
  font-size: .78rem;
  color: var(--text-muted);
  margin-top: 2px;
}

.round-grid {
  display: grid;
  gap: 16px;
}
.round-card {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 16px;
  align-items: start;
  padding: 20px;
  border-radius: var(--radius-lg);
  background: var(--card-bg);
  border: 1px solid var(--border);
  text-align: left;
  color: inherit;
  transition: border-color var(--transition), transform 150ms var(--ease), box-shadow var(--transition);
  width: 100%;
  font: inherit;
}
.round-card:hover {
  border-color: var(--border-strong);
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
}
.round-card__icon {
  width: 48px;
  height: 48px;
  border-radius: 12px;
  display: grid;
  place-items: center;
  font-size: 1.35rem;
  flex-shrink: 0;
}
.round-card__icon--1 { background: var(--accent-soft); }
.round-card__icon--2 { background: var(--warning-soft); }
.round-card__icon--3 { background: var(--accent-2-soft); }
.round-card h2 {
  margin: 0 0 6px;
  font-size: 1.1rem;
  font-weight: 700;
}
.round-card p {
  margin: 0;
  font-size: .88rem;
  color: var(--text-secondary);
}
.round-card__meta {
  font-size: .75rem;
  font-weight: 600;
  color: var(--text-muted);
  white-space: nowrap;
  margin-top: 4px;
}
.round-card__arrow {
  align-self: center;
  color: var(--text-muted);
  font-size: 1.2rem;
}

.how-section {
  margin-top: 36px;
  padding: 24px;
  border-radius: var(--radius-lg);
  border: 1px dashed var(--border-strong);
  background: var(--bg-muted);
}
.how-section h2 {
  margin: 0 0 16px;
  font-size: 1.15rem;
}
.how-steps {
  display: grid;
  gap: 12px;
  margin: 0;
  padding: 0;
  list-style: none;
  counter-reset: how;
}
.how-steps li {
  display: grid;
  grid-template-columns: 32px 1fr;
  gap: 12px;
  align-items: start;
  counter-increment: how;
}
.how-steps li::before {
  content: counter(how);
  width: 28px;
  height: 28px;
  border-radius: 8px;
  background: var(--card-bg);
  border: 1px solid var(--border);
  display: grid;
  place-items: center;
  font-size: .75rem;
  font-weight: 700;
  color: var(--accent);
}
.how-steps strong { display: block; margin-bottom: 2px; }
.how-steps span { font-size: .88rem; color: var(--text-secondary); }

/* ---------- Lesson ---------- */
.lesson-header {
  margin-bottom: 28px;
}
.lesson-header__meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 12px;
}
.pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: 99px;
  font-size: .72rem;
  font-weight: 700;
  letter-spacing: .02em;
}
.pill--round { background: var(--accent-soft); color: var(--accent); }
.pill--time { background: var(--info-soft); color: var(--info); }
.pill--level { background: var(--accent-2-soft); color: var(--accent-2); }
.pill--done { background: var(--success-soft); color: var(--success); }

.lesson-header h1 {
  font-family: var(--font-display);
  font-size: clamp(1.5rem, 3.5vw, 2rem);
  line-height: 1.2;
  letter-spacing: -.02em;
  margin: 0 0 12px;
}
.lesson-header__question {
  padding: 14px 16px;
  border-radius: var(--radius-md);
  border-left: 3px solid var(--accent);
  background: var(--accent-soft);
  font-style: italic;
  color: var(--text-secondary);
  margin: 0;
  font-size: .95rem;
}

/* Sections */
.section {
  margin-bottom: 32px;
}
.section__title {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 1.2rem;
  font-weight: 700;
  margin: 0 0 14px;
  letter-spacing: -.01em;
}
.section__title .emoji { font-size: 1.1em; }

.prose p { margin: 0 0 14px; color: var(--text); }
.prose p:last-child { margin-bottom: 0; }
.prose ul, .prose ol {
  margin: 0 0 14px;
  padding-left: 1.25rem;
  color: var(--text);
}
.prose li { margin-bottom: 6px; }
.prose li::marker { color: var(--accent); }
.prose strong { font-weight: 650; }

/* Callouts */
.callout {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 12px;
  padding: 14px 16px;
  border-radius: var(--radius-md);
  margin: 16px 0;
  border: 1px solid var(--border);
}
.callout__icon { font-size: 1.2rem; line-height: 1.4; }
.callout__body { font-size: .92rem; }
.callout__body strong { display: block; margin-bottom: 4px; }
.callout__body p { margin: 0; color: var(--text-secondary); }
.callout--tip { background: var(--success-soft); border-color: color-mix(in srgb, var(--success) 25%, transparent); }
.callout--warn { background: var(--warning-soft); border-color: color-mix(in srgb, var(--warning) 30%, transparent); }
.callout--info { background: var(--info-soft); border-color: color-mix(in srgb, var(--info) 30%, transparent); }
.callout--idea { background: var(--accent-2-soft); border-color: color-mix(in srgb, var(--accent-2) 30%, transparent); }
.callout--danger { background: color-mix(in srgb, var(--danger) 12%, transparent); border-color: color-mix(in srgb, var(--danger) 28%, transparent); }

/* Analogy box */
.analogy {
  margin: 18px 0;
  padding: 18px 20px;
  border-radius: var(--radius-md);
  background:
    linear-gradient(135deg, var(--accent-2-soft), transparent 60%),
    var(--card-bg);
  border: 1px solid var(--border);
}
.analogy__label {
  font-size: .7rem;
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--accent-2);
  margin-bottom: 8px;
}
.analogy p { margin: 0; color: var(--text-secondary); font-size: .95rem; }

/* Cards / grid */
.concept-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 12px;
  margin: 16px 0;
}
.concept-card {
  padding: 16px;
  border-radius: var(--radius-md);
  background: var(--card-bg);
  border: 1px solid var(--border);
}
.concept-card h3 {
  margin: 0 0 8px;
  font-size: .95rem;
}
.concept-card p {
  margin: 0;
  font-size: .85rem;
  color: var(--text-secondary);
}

/* Tables */
.table-wrap {
  overflow-x: auto;
  margin: 16px 0;
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
}
table {
  width: 100%;
  border-collapse: collapse;
  font-size: .85rem;
}
th, td {
  padding: 10px 14px;
  text-align: left;
  border-bottom: 1px solid var(--border);
  vertical-align: top;
}
th {
  background: var(--bg-muted);
  font-weight: 700;
  font-size: .75rem;
  text-transform: uppercase;
  letter-spacing: .04em;
  color: var(--text-muted);
}
tr:last-child td { border-bottom: 0; }
td { color: var(--text-secondary); }
td:first-child { color: var(--text); font-weight: 500; }

/* Code */
.pre-wrap {
  position: relative;
  margin: 16px 0;
  border-radius: var(--radius-md);
  overflow: hidden;
  border: 1px solid var(--border);
  background: var(--bg-code);
}
.pre-wrap__bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 12px;
  background: rgba(255,255,255,.04);
  border-bottom: 1px solid rgba(255,255,255,.06);
}
.pre-wrap__lang {
  font-size: .7rem;
  font-weight: 600;
  color: #9a9088;
  text-transform: uppercase;
  letter-spacing: .06em;
}
.pre-wrap__copy {
  border: 0;
  background: transparent;
  color: #9a9088;
  font-size: .72rem;
  font-weight: 600;
  padding: 4px 8px;
  border-radius: 6px;
}
.pre-wrap__copy:hover { background: rgba(255,255,255,.08); color: #fff; }
.pre-wrap__copy.is-copied { color: var(--success); }
pre {
  margin: 0;
  padding: 14px 16px;
  overflow-x: auto;
  font-family: var(--font-mono);
  font-size: .8rem;
  line-height: 1.55;
  color: var(--code-text);
}
code {
  font-family: var(--font-mono);
  font-size: .88em;
}
:not(pre) > code {
  padding: 2px 6px;
  border-radius: 5px;
  background: var(--bg-muted);
  color: var(--text);
  font-size: .84em;
  border: 1px solid var(--border);
}
.token-comment { color: var(--code-comment); }
.token-string { color: var(--code-string); }
.token-keyword { color: var(--code-keyword); }

/* Flow diagram */
.flow {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin: 18px 0;
  padding: 16px;
  border-radius: var(--radius-md);
  background: var(--bg-muted);
  border: 1px solid var(--border);
}
.flow__step {
  padding: 8px 12px;
  border-radius: 8px;
  background: var(--card-bg);
  border: 1px solid var(--border);
  font-size: .8rem;
  font-weight: 600;
  font-family: var(--font-mono);
}
.flow__arrow {
  color: var(--accent);
  font-weight: 700;
  font-size: .9rem;
}

/* Accordion */
.accordion {
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  overflow: hidden;
  margin: 16px 0;
  background: var(--card-bg);
}
.accordion + .accordion { margin-top: 8px; }
.accordion__trigger {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 16px;
  border: 0;
  background: transparent;
  color: var(--text);
  font-weight: 600;
  font-size: .92rem;
  text-align: left;
}
.accordion__trigger:hover { background: var(--bg-muted); }
.accordion__chevron {
  margin-left: auto;
  transition: transform var(--transition);
  opacity: .5;
}
.accordion.is-open .accordion__chevron { transform: rotate(180deg); }
.accordion__panel {
  display: none;
  padding: 0 16px 16px;
  font-size: .92rem;
  color: var(--text-secondary);
  border-top: 1px solid var(--border);
}
.accordion.is-open .accordion__panel {
  display: block;
  padding-top: 14px;
}
.accordion__panel p { margin: 0 0 10px; }
.accordion__panel p:last-child { margin-bottom: 0; }

/* Framework steps */
.framework {
  counter-reset: fw;
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 10px;
}
.framework li {
  counter-increment: fw;
  display: grid;
  grid-template-columns: 36px 1fr;
  gap: 12px;
  padding: 14px;
  border-radius: var(--radius-md);
  background: var(--card-bg);
  border: 1px solid var(--border);
}
.framework li::before {
  content: counter(fw);
  width: 32px;
  height: 32px;
  border-radius: 9px;
  background: linear-gradient(135deg, var(--accent), #ff4d4d);
  color: #fff;
  display: grid;
  place-items: center;
  font-weight: 700;
  font-size: .85rem;
}
.framework strong { display: block; margin-bottom: 4px; color: var(--text); }
.framework span { font-size: .88rem; color: var(--text-secondary); }

/* Cheat sheet */
.cheat {
  margin: 20px 0;
  padding: 18px;
  border-radius: var(--radius-md);
  background: var(--bg-code);
  border: 1px solid rgba(255,255,255,.08);
  color: var(--code-text);
}
.cheat__title {
  font-size: .72rem;
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: #c4b8ac;
  margin-bottom: 12px;
}
.cheat pre {
  padding: 0;
  background: transparent;
  font-size: .78rem;
  white-space: pre-wrap;
}

/* Interview mode */
.interview-box {
  margin: 20px 0;
  padding: 20px;
  border-radius: var(--radius-lg);
  border: 2px dashed color-mix(in srgb, var(--accent) 40%, transparent);
  background: var(--accent-soft);
}
.interview-box h3 { margin: 0 0 8px; font-size: 1rem; }
.interview-box p { margin: 0 0 14px; font-size: .9rem; color: var(--text-secondary); }
.timer-row {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}
.timer-display {
  font-family: var(--font-mono);
  font-size: 1.4rem;
  font-weight: 600;
  min-width: 4ch;
}
.timer-display.is-running { color: var(--accent); }

/* Quiz */
.quiz {
  margin: 24px 0;
  padding: 20px;
  border-radius: var(--radius-lg);
  background: var(--card-bg);
  border: 1px solid var(--border);
}
.quiz h3 {
  margin: 0 0 6px;
  font-size: 1.05rem;
}
.quiz__intro {
  margin: 0 0 18px;
  font-size: .88rem;
  color: var(--text-muted);
}
.quiz-q {
  padding: 16px 0;
  border-top: 1px solid var(--border);
}
.quiz-q:first-of-type { border-top: 0; padding-top: 0; }
.quiz-q__text {
  font-weight: 600;
  margin: 0 0 12px;
  font-size: .95rem;
}
.quiz-options {
  display: grid;
  gap: 8px;
}
.quiz-option {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 12px 14px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--bg);
  color: var(--text);
  text-align: left;
  font-size: .88rem;
  transition: border-color var(--transition), background var(--transition);
}
.quiz-option:hover:not(:disabled) {
  border-color: var(--border-strong);
  background: var(--bg-muted);
}
.quiz-option__marker {
  flex-shrink: 0;
  width: 22px;
  height: 22px;
  border-radius: 6px;
  border: 1px solid var(--border-strong);
  display: grid;
  place-items: center;
  font-size: .7rem;
  font-weight: 700;
  color: var(--text-muted);
}
.quiz-option.is-selected {
  border-color: var(--accent-2);
  background: var(--accent-2-soft);
}
.quiz-option.is-correct {
  border-color: var(--success);
  background: var(--success-soft);
}
.quiz-option.is-wrong {
  border-color: var(--danger);
  background: color-mix(in srgb, var(--danger) 12%, transparent);
}
.quiz-option:disabled { cursor: default; }
.quiz-feedback {
  margin-top: 10px;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  font-size: .85rem;
  display: none;
}
.quiz-feedback.is-visible { display: block; }
.quiz-feedback.is-ok {
  background: var(--success-soft);
  color: var(--text);
}
.quiz-feedback.is-bad {
  background: color-mix(in srgb, var(--danger) 12%, transparent);
  color: var(--text);
}
.quiz-score {
  margin-top: 16px;
  padding: 14px;
  border-radius: var(--radius-md);
  background: var(--bg-muted);
  font-weight: 600;
  display: none;
}
.quiz-score.is-visible { display: block; }

/* Tabs */
.tabs {
  margin: 16px 0;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  overflow: hidden;
  background: var(--card-bg);
}
.tabs__list {
  display: flex;
  flex-wrap: wrap;
  gap: 0;
  border-bottom: 1px solid var(--border);
  background: var(--bg-muted);
}
.tabs__btn {
  padding: 10px 16px;
  border: 0;
  background: transparent;
  color: var(--text-muted);
  font-weight: 600;
  font-size: .82rem;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
}
.tabs__btn:hover { color: var(--text); }
.tabs__btn.is-active {
  color: var(--text);
  border-bottom-color: var(--accent);
  background: var(--card-bg);
}
.tabs__panel {
  display: none;
  padding: 16px;
  font-size: .9rem;
  color: var(--text-secondary);
}
.tabs__panel.is-active { display: block; }
.tabs__panel p { margin: 0 0 10px; }
.tabs__panel p:last-child { margin-bottom: 0; }

/* Reveal / progressive */
.reveal {
  margin: 18px 0;
}
.reveal__hidden {
  filter: blur(5px);
  user-select: none;
  pointer-events: none;
  opacity: .55;
  transition: filter 300ms, opacity 300ms;
}
.reveal.is-shown .reveal__hidden {
  filter: none;
  user-select: auto;
  pointer-events: auto;
  opacity: 1;
}
.reveal__btn { margin-bottom: 10px; }

/* Lesson footer nav */
.lesson-nav {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-top: 40px;
  padding-top: 24px;
  border-top: 1px solid var(--border);
  flex-wrap: wrap;
}
.lesson-nav__btn {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 2px;
  padding: 14px 18px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
  background: var(--card-bg);
  color: var(--text);
  max-width: 48%;
  min-width: 140px;
  text-align: left;
  transition: border-color var(--transition), box-shadow var(--transition);
}
.lesson-nav__btn:hover {
  border-color: var(--border-strong);
  box-shadow: var(--shadow-sm);
}
.lesson-nav__btn--next { align-items: flex-end; text-align: right; margin-left: auto; }
.lesson-nav__dir {
  font-size: .72rem;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: .04em;
}
.lesson-nav__title {
  font-size: .9rem;
  font-weight: 600;
}

.mark-done-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  margin-top: 28px;
  padding: 16px 18px;
  border-radius: var(--radius-md);
  background: var(--bg-muted);
  border: 1px solid var(--border);
}

/* Round overview */
.round-overview h1 {
  font-family: var(--font-display);
  font-size: 1.8rem;
  margin: 0 0 10px;
}
.round-overview__lead {
  color: var(--text-secondary);
  margin: 0 0 24px;
}
.lesson-list {
  display: grid;
  gap: 10px;
}
.lesson-list__item {
  display: grid;
  grid-template-columns: 40px 1fr auto;
  gap: 12px;
  align-items: center;
  padding: 14px 16px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
  background: var(--card-bg);
  color: inherit;
  text-align: left;
  font: inherit;
  width: 100%;
  transition: border-color var(--transition), transform 120ms var(--ease);
}
.lesson-list__item:hover {
  border-color: var(--border-strong);
  transform: translateX(3px);
}
.lesson-list__num {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  display: grid;
  place-items: center;
  font-weight: 700;
  font-size: .85rem;
  background: var(--bg-muted);
  color: var(--text-muted);
}
.lesson-list__item.is-done .lesson-list__num {
  background: var(--success-soft);
  color: var(--success);
}
.lesson-list__title { font-weight: 600; font-size: .95rem; }
.lesson-list__desc {
  font-size: .8rem;
  color: var(--text-muted);
  margin-top: 2px;
}
.lesson-list__time {
  font-size: .75rem;
  color: var(--text-muted);
  font-weight: 600;
}

/* ---------- Responsive ---------- */
@media (max-width: 900px) {
  .sidebar {
    transform: translateX(-100%);
  }
  .sidebar.is-open {
    transform: translateX(0);
  }
  .sidebar-close { display: grid; }
  .sidebar-backdrop.is-visible {
    display: block;
  }
  .main { margin-left: 0; }
  #menuToggle { display: grid; }
  .content { padding: 20px 16px 64px; }
  .stats { grid-template-columns: 1fr; }
  .round-card { grid-template-columns: auto 1fr; }
  .round-card__arrow { display: none; }
  .lesson-nav__btn { max-width: 100%; }
  .theme-toggle__label { display: none; }
}

@media (max-width: 520px) {
  .hero { padding: 24px 18px; }
  .hero h1 { max-width: none; }
}

/* Print */
@media print {
  .sidebar, .topbar, .lesson-nav, .theme-toggle, .mark-done-row, .interview-box { display: none !important; }
  .main { margin: 0; }
  .content { max-width: none; }
}
