:root {
  --bg: #0f1419;
  --surface: #1a2332;
  --surface-2: #243044;
  --border: #2d3a4f;
  --text: #e8edf4;
  --text-muted: #94a3b8;
  --accent: #6366f1;
  --accent-light: #818cf8;
  --success: #34d399;
  --warn: #fbbf24;
  --info: #38bdf8;
  --radius: 12px;
  --sidebar-w: 280px;
  --font: "DM Sans", system-ui, sans-serif;
  --mono: "JetBrains Mono", monospace;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }

body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  min-height: 100vh;
}

.sidebar {
  position: fixed;
  top: 0;
  left: 0;
  width: var(--sidebar-w);
  height: 100vh;
  background: var(--surface);
  border-right: 1px solid var(--border);
  padding: 1.5rem 1rem;
  display: flex;
  flex-direction: column;
  z-index: 100;
  overflow-y: auto;
}

.sidebar-brand {
  display: flex;
  gap: 0.75rem;
  align-items: center;
  padding: 0 0.5rem 1.5rem;
  border-bottom: 1px solid var(--border);
  margin-bottom: 1rem;
}

.lang-switcher {
  padding: 0 0.5rem 1rem;
  margin-bottom: 0.5rem;
  border-bottom: 1px solid var(--border);
}

.lang-switcher label {
  font-size: 0.75rem;
  color: var(--text-muted);
  display: block;
  margin-bottom: 0.5rem;
}

.lang-buttons {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.lang-btn {
  padding: 0.45rem 0.65rem;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 6px;
  color: var(--text-muted);
  font-family: var(--font);
  font-size: 0.85rem;
  cursor: pointer;
  text-align: left;
  transition: border-color 0.2s, color 0.2s, background 0.2s;
}

.lang-btn:hover { border-color: var(--accent); color: var(--text); }
.lang-btn.active {
  background: rgba(99, 102, 241, 0.15);
  border-color: var(--accent);
  color: var(--accent-light);
  font-weight: 600;
}

.audio-panel {
  padding: 0 0.5rem 1rem;
  margin-bottom: 0.5rem;
  border-bottom: 1px solid var(--border);
}

.audio-panel label {
  font-size: 0.75rem;
  color: var(--text-muted);
  display: block;
  margin-bottom: 0.35rem;
}

.audio-hint {
  font-size: 0.72rem;
  color: var(--text-muted);
  line-height: 1.4;
  margin-bottom: 0.65rem;
}

.audio-status {
  min-height: 1.1rem;
  font-size: 0.78rem;
  color: var(--accent-light);
  margin-bottom: 0.5rem;
}

.audio-buttons {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.audio-btn {
  padding: 0.45rem 0.65rem;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 6px;
  color: var(--text);
  font-family: var(--font);
  font-size: 0.8rem;
  cursor: pointer;
  text-align: left;
  transition: border-color 0.2s, background 0.2s;
}

.audio-btn:hover:not(:disabled) { border-color: var(--accent); }
.audio-btn:disabled { opacity: 0.45; cursor: not-allowed; }

.audio-bar {
  position: fixed;
  left: var(--sidebar-w);
  right: 0;
  bottom: 0;
  z-index: 90;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem 1.25rem;
  background: rgba(26, 35, 50, 0.96);
  border-top: 1px solid var(--border);
  backdrop-filter: blur(8px);
}

.audio-bar.hidden { display: none; }

.audio-bar-icon { font-size: 1.1rem; }

.audio-bar-label {
  flex: 1;
  font-size: 0.85rem;
  color: var(--accent-light);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.audio-bar-btn {
  padding: 0.4rem 0.75rem;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 6px;
  color: var(--text);
  font-family: var(--font);
  font-size: 0.8rem;
  cursor: pointer;
}

.audio-bar-btn:hover:not(:disabled) { border-color: var(--accent); }
.audio-bar-btn:disabled { opacity: 0.45; cursor: not-allowed; }

.tts-inline-btn {
  margin-left: 0.5rem;
  padding: 0.15rem 0.45rem;
  background: rgba(99, 102, 241, 0.15);
  border: 1px solid rgba(99, 102, 241, 0.35);
  border-radius: 6px;
  cursor: pointer;
  font-size: 0.95rem;
  vertical-align: middle;
  line-height: 1;
}

.tts-inline-btn:hover {
  background: rgba(99, 102, 241, 0.25);
  border-color: var(--accent);
}

body.lang-devanagari {
  font-family: "Noto Sans Devanagari", var(--font), system-ui, sans-serif;
}

body.lang-devanagari code,
body.lang-devanagari .skill-card h4,
body.lang-devanagari .code-demo pre {
  font-family: var(--mono);
}

.brand-icon {
  font-size: 1.5rem;
  color: var(--accent-light);
}

.sidebar-brand strong { display: block; font-size: 0.95rem; }
.sidebar-brand small { color: var(--text-muted); font-size: 0.75rem; }

.nav-links { list-style: none; flex: 1; }

.nav-link {
  display: block;
  padding: 0.6rem 0.75rem;
  color: var(--text-muted);
  text-decoration: none;
  border-radius: 8px;
  font-size: 0.9rem;
  transition: background 0.2s, color 0.2s;
}

.nav-link:hover { background: var(--surface-2); color: var(--text); }
.nav-link.active { background: rgba(99, 102, 241, 0.15); color: var(--accent-light); }

.progress-wrap { padding: 1rem 0.5rem 0; }
.progress-wrap label { font-size: 0.75rem; color: var(--text-muted); display: block; margin-bottom: 0.5rem; }
.progress-bar { height: 6px; background: var(--surface-2); border-radius: 99px; overflow: hidden; }
#progressFill { height: 100%; width: 0%; background: linear-gradient(90deg, var(--accent), var(--accent-light)); transition: width 0.3s; border-radius: 99px; }

.menu-toggle {
  display: none;
  position: fixed;
  top: 1rem;
  right: 1rem;
  z-index: 200;
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--text);
  width: 44px;
  height: 44px;
  border-radius: 8px;
  font-size: 1.25rem;
  cursor: pointer;
}

.content {
  margin-left: var(--sidebar-w);
  max-width: 820px;
  padding: 2.5rem 2rem 4rem;
}

.hero { margin-bottom: 3rem; }

.eyebrow {
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--accent-light);
  margin-bottom: 0.75rem;
}

.hero h1 {
  font-size: clamp(1.75rem, 4vw, 2.5rem);
  line-height: 1.2;
  margin-bottom: 1rem;
  font-weight: 700;
}

.lead { font-size: 1.125rem; color: var(--text-muted); max-width: 640px; }

.hero-stats {
  display: flex;
  gap: 2rem;
  margin-top: 2rem;
  flex-wrap: wrap;
}

.stat { display: flex; flex-direction: column; }
.stat-num { font-size: 1.75rem; font-weight: 700; color: var(--accent-light); }
.stat-label { font-size: 0.85rem; color: var(--text-muted); }

.module {
  margin-bottom: 3.5rem;
  scroll-margin-top: 2rem;
}

.module-tag {
  display: inline-block;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--accent-light);
  background: rgba(99, 102, 241, 0.12);
  padding: 0.25rem 0.6rem;
  border-radius: 6px;
  margin-bottom: 0.75rem;
}

.module h2 { font-size: 1.75rem; margin-bottom: 1rem; }
.module h3 { font-size: 1.15rem; margin: 1.5rem 0 0.75rem; }
.module-intro { color: var(--text-muted); margin-bottom: 1.5rem; font-size: 1.05rem; }

.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1rem;
}

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.25rem;
}

.card-icon { font-size: 1.5rem; margin-bottom: 0.75rem; }
.card h3 { font-size: 1rem; margin-bottom: 0.5rem; }
.card p { font-size: 0.9rem; color: var(--text-muted); }

.analogy-box {
  background: var(--surface);
  border-left: 4px solid var(--accent);
  border-radius: var(--radius);
  padding: 1.25rem 1.5rem;
  margin: 1.5rem 0;
}

.analogy-box h4 { margin-bottom: 0.5rem; color: var(--accent-light); }
.analogy-hr { border-left-color: var(--success); }
.analogy-hr h4 { color: var(--success); }

.feature-list { padding-left: 1.25rem; margin: 1rem 0; }
.feature-list li { margin-bottom: 0.6rem; color: var(--text-muted); }
.feature-list strong { color: var(--text); }

.code-demo {
  background: #0d1117;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  margin: 1.5rem 0;
}

.code-header {
  padding: 0.5rem 1rem;
  background: var(--surface-2);
  font-size: 0.75rem;
  color: var(--text-muted);
}

.code-demo pre {
  padding: 1rem 1.25rem;
  overflow-x: auto;
  font-family: var(--mono);
  font-size: 0.85rem;
  line-height: 1.7;
}

.code-demo .comment { color: #6b7280; }

.callout {
  padding: 1rem 1.25rem;
  border-radius: var(--radius);
  margin: 1.5rem 0;
  font-size: 0.95rem;
}

.callout-info { background: rgba(56, 189, 248, 0.1); border: 1px solid rgba(56, 189, 248, 0.3); }
.callout-warn { background: rgba(251, 191, 36, 0.1); border: 1px solid rgba(251, 191, 36, 0.3); }
.callout-success { background: rgba(52, 211, 153, 0.1); border: 1px solid rgba(52, 211, 153, 0.3); }

.data-table {
  width: 100%;
  border-collapse: collapse;
  margin: 1.5rem 0;
  font-size: 0.9rem;
}

.data-table th,
.data-table td {
  padding: 0.75rem 1rem;
  text-align: left;
  border-bottom: 1px solid var(--border);
}

.data-table th { background: var(--surface); color: var(--text-muted); font-weight: 600; }
.data-table code {
  font-family: var(--mono);
  font-size: 0.8rem;
  background: var(--surface-2);
  padding: 0.15rem 0.4rem;
  border-radius: 4px;
}

.compare-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
  margin: 1.5rem 0;
}

.compare-col {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.25rem;
}

.compare-good { border-color: rgba(52, 211, 153, 0.4); }
.compare-col h4 { margin-bottom: 0.5rem; font-size: 0.95rem; }
.compare-col p { font-size: 0.95rem; }
.compare-col small { color: var(--text-muted); font-size: 0.8rem; display: block; margin-top: 0.5rem; }

.skill-flow {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin: 1.5rem 0;
}

.flow-step {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 0.75rem 1rem;
  text-align: center;
  flex: 1;
  min-width: 120px;
}

.flow-num {
  display: inline-block;
  width: 24px;
  height: 24px;
  line-height: 24px;
  background: var(--accent);
  border-radius: 50%;
  font-size: 0.75rem;
  font-weight: 700;
  margin-bottom: 0.35rem;
}

.flow-arrow { color: var(--text-muted); font-size: 1.25rem; }

.skill-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1rem;
  margin: 1rem 0;
}

.skill-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1rem;
}

.skill-card h4 {
  font-family: var(--mono);
  font-size: 0.85rem;
  color: var(--accent-light);
  margin-bottom: 0.5rem;
}

.skill-card p { font-size: 0.875rem; color: var(--text-muted); }

.checklist { list-style: none; margin: 1rem 0; }
.checklist li {
  display: flex;
  gap: 0.75rem;
  align-items: flex-start;
  padding: 0.6rem 0;
  border-bottom: 1px solid var(--border);
  color: var(--text-muted);
}

.check {
  flex-shrink: 0;
  width: 28px;
  height: 28px;
  background: rgba(99, 102, 241, 0.2);
  color: var(--accent-light);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
  font-weight: 700;
}

.quote {
  border-left: 4px solid var(--accent);
  padding: 1rem 1.5rem;
  margin: 1.5rem 0;
  background: var(--surface);
  border-radius: 0 var(--radius) var(--radius) 0;
  font-style: italic;
  color: var(--text-muted);
}

.quote cite { display: block; margin-top: 0.5rem; font-style: normal; font-size: 0.85rem; color: var(--text-muted); }

.workflow-diagram { margin: 2rem 0; text-align: center; }
.wf-row { display: flex; justify-content: center; gap: 1rem; flex-wrap: wrap; }
.wf-split .wf-box { flex: 1; min-width: 140px; max-width: 200px; }
.wf-connector { color: var(--text-muted); padding: 0.35rem 0; }

.wf-box {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1rem;
  font-weight: 600;
  font-size: 0.95rem;
}

.wf-box small { display: block; font-weight: 400; color: var(--text-muted); margin-top: 0.25rem; font-size: 0.8rem; }
.wf-start { border-color: var(--info); }
.wf-brain { border-color: var(--warn); }
.wf-super { border-color: var(--accent); }
.wf-cli, .wf-cmd { border-color: var(--success); }
.wf-end { border-color: var(--success); background: rgba(52, 211, 153, 0.08); }

.quiz-module { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 2rem; }

.quiz-q { margin-bottom: 1.5rem; padding-bottom: 1.5rem; border-bottom: 1px solid var(--border); }
.quiz-q:last-child { border-bottom: none; }
.quiz-q h4 { margin-bottom: 0.75rem; font-size: 1rem; }

.quiz-options { display: flex; flex-direction: column; gap: 0.5rem; }

.quiz-opt {
  text-align: left;
  padding: 0.75rem 1rem;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text);
  cursor: pointer;
  font-family: var(--font);
  font-size: 0.9rem;
  transition: border-color 0.2s;
}

.quiz-opt:hover:not(:disabled) { border-color: var(--accent); }
.quiz-opt.correct { border-color: var(--success); background: rgba(52, 211, 153, 0.15); }
.quiz-opt.wrong { border-color: #f87171; background: rgba(248, 113, 113, 0.1); }
.quiz-opt:disabled { cursor: default; }

.quiz-feedback {
  margin-top: 0.75rem;
  padding: 0.75rem;
  border-radius: 8px;
  font-size: 0.875rem;
  display: none;
}

.quiz-feedback.show { display: block; }
.quiz-feedback.ok { background: rgba(52, 211, 153, 0.1); color: var(--success); }
.quiz-feedback.no { background: rgba(248, 113, 113, 0.1); color: #f87171; }

.quiz-result { text-align: center; padding: 2rem; }
.quiz-result.hidden { display: none; }

.quiz-identity {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.25rem 1.5rem;
  margin-bottom: 1.5rem;
  background: var(--surface);
}

.quiz-identity legend {
  font-weight: 600;
  padding: 0 0.5rem;
}

.quiz-identity .form-row {
  margin-bottom: 1rem;
}

.quiz-identity .form-row:last-child {
  margin-bottom: 0;
}

.quiz-identity label {
  display: block;
  margin-bottom: 0.35rem;
  font-size: 0.9rem;
  color: var(--text-muted);
}

.quiz-identity input {
  width: 100%;
  padding: 0.65rem 0.85rem;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--surface-2);
  color: var(--text);
  font-family: var(--font);
}

.quiz-identity input:focus {
  outline: none;
  border-color: var(--accent);
}

.btn {
  padding: 0.75rem 1.5rem;
  border-radius: 8px;
  border: none;
  font-family: var(--font);
  font-weight: 600;
  cursor: pointer;
  margin-top: 1rem;
}

.btn-primary { background: var(--accent); color: white; }
.btn-primary:hover { background: var(--accent-light); }
.btn-secondary {
  background: var(--surface-2);
  color: var(--text);
  border: 1px solid var(--border);
}
.btn-secondary:hover { border-color: var(--accent); color: var(--accent-light); }

.feedback-module {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 2rem;
}

.feedback-form { margin-top: 1rem; }
.feedback-form.hidden { display: none; }

.feedback-fieldset {
  border: none;
  padding: 0;
  margin: 0 0 2rem;
}

.feedback-fieldset legend {
  font-weight: 600;
  font-size: 1rem;
  margin-bottom: 1rem;
  color: var(--text);
}

.optional {
  font-weight: 400;
  color: var(--text-muted);
  font-size: 0.85rem;
}

.form-row { margin-bottom: 1rem; }

.form-row label {
  display: block;
  font-size: 0.9rem;
  margin-bottom: 0.4rem;
  color: var(--text-muted);
}

.form-row input,
.form-row textarea {
  width: 100%;
  padding: 0.75rem 1rem;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text);
  font-family: var(--font);
  font-size: 0.95rem;
  transition: border-color 0.2s;
}

.form-row input:focus,
.form-row textarea:focus {
  outline: none;
  border-color: var(--accent);
}

.form-row textarea { resize: vertical; min-height: 100px; }

.rating-hint {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-bottom: 1.25rem;
}

.rating-question {
  padding: 1rem 0;
  border-bottom: 1px solid var(--border);
}

.rating-question:last-child { border-bottom: none; }

.rating-label {
  font-size: 0.95rem;
  margin-bottom: 0.75rem;
  color: var(--text);
}

.rating-scale {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.rating-scale label {
  cursor: pointer;
}

.rating-scale input {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
}

.rating-scale span {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 8px;
  font-weight: 600;
  font-size: 0.95rem;
  transition: background 0.2s, border-color 0.2s, color 0.2s;
}

.rating-scale label:hover span { border-color: var(--accent); }

.rating-scale input:checked + span {
  background: rgba(99, 102, 241, 0.2);
  border-color: var(--accent);
  color: var(--accent-light);
}

.rating-scale input:focus-visible + span {
  outline: 2px solid var(--accent-light);
  outline-offset: 2px;
}

.feedback-actions { text-align: center; }

.feedback-result {
  text-align: center;
  padding: 2.5rem 1rem;
}

.feedback-result.hidden { display: none; }

.feedback-success-icon {
  width: 56px;
  height: 56px;
  line-height: 56px;
  margin: 0 auto 1rem;
  background: rgba(52, 211, 153, 0.15);
  color: var(--success);
  border-radius: 50%;
  font-size: 1.5rem;
  font-weight: 700;
}

.feedback-result h3 { margin-bottom: 0.5rem; }
.feedback-result p { color: var(--text-muted); margin-bottom: 1rem; }

.site-footer {
  margin-top: 3rem;
  padding-top: 2rem;
  border-top: 1px solid var(--border);
  color: var(--text-muted);
  font-size: 0.875rem;
}

.footer-note { margin-top: 0.5rem; font-size: 0.8rem; }

.checklist-module {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 2rem;
}

.checklist-summary {
  display: flex;
  align-items: center;
  gap: 1.25rem;
  padding: 1.25rem;
  background: var(--surface-2);
  border-radius: var(--radius);
  margin-bottom: 1.5rem;
}

.checklist-progress-ring {
  flex-shrink: 0;
  width: 72px;
  height: 72px;
  border-radius: 50%;
  background: rgba(99, 102, 241, 0.15);
  border: 3px solid var(--accent);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  color: var(--accent-light);
}

.checklist-progress-ring small { font-size: 0.75rem; color: var(--text-muted); font-weight: 500; }

.checklist-summary p { font-size: 0.9rem; color: var(--text-muted); margin-top: 0.25rem; }

.checklist-group { margin-bottom: 1.75rem; }

.checklist-group-title {
  font-size: 1rem;
  color: var(--accent-light);
  margin-bottom: 0.75rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid var(--border);
}

.module-checklist { list-style: none; }

.module-checklist li { margin-bottom: 0.5rem; }

.checklist-item {
  display: flex;
  gap: 0.75rem;
  align-items: flex-start;
  padding: 0.75rem 1rem;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 8px;
  cursor: pointer;
  transition: border-color 0.2s, background 0.2s;
}

.checklist-item:hover { border-color: var(--accent); }

.checklist-item.checked {
  border-color: rgba(52, 211, 153, 0.4);
  background: rgba(52, 211, 153, 0.08);
}

.checklist-item input {
  margin-top: 0.2rem;
  width: 18px;
  height: 18px;
  accent-color: var(--accent);
  flex-shrink: 0;
  cursor: pointer;
}

.checklist-item span {
  font-size: 0.925rem;
  color: var(--text-muted);
  line-height: 1.5;
}

.checklist-item.checked span {
  color: var(--text);
  text-decoration: line-through;
  text-decoration-color: rgba(148, 163, 184, 0.5);
}

.checklist-actions {
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
  margin-top: 1.5rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--border);
}

.checklist-actions .btn { margin-top: 0; }

@media print {
  .sidebar, .menu-toggle, .checklist-actions, .feedback-module, .lang-switcher, .audio-panel, .audio-bar, .tts-inline-btn { display: none !important; }
  .content { margin-left: 0; max-width: 100%; }
  body { background: white; color: black; }
  .checklist-item { break-inside: avoid; border: 1px solid #ccc; }
  .checklist-item.checked span { text-decoration: line-through; }
}

@media (max-width: 900px) {
  .sidebar { transform: translateX(-100%); transition: transform 0.3s; }
  .sidebar.open { transform: translateX(0); }
  .menu-toggle { display: block; }
  .content { margin-left: 0; padding: 1.5rem 1rem 3rem; padding-top: 4rem; padding-bottom: 5rem; }
  .audio-bar { left: 0; }
  .compare-grid { grid-template-columns: 1fr; }
  .skill-flow { flex-direction: column; }
  .flow-arrow { transform: rotate(90deg); }
}
