:root {
  --accent: #2563eb;
  --accent-2: #1d4ed8;
  --bg: #f5f7fb;
  --border: #dbe3f0;
  --danger: #b91c1c;
  --muted: #64748b;
  --panel: #ffffff;
  --radius: 16px;
  --shadow: 0 10px 28px rgba(15, 23, 42, 0.08);
  --success: #15803d;
  --text: #1e293b;
  --topbar-bg: rgba(17, 24, 39, 0.88);
  --topbar-border: rgba(255, 255, 255, 0.08);
  --topbar-link: #c7d2fe;
  --topbar-link-active: #93c5fd;
  --topbar-link-hover: #f8fafc;
  --warning: #b45309;
}

/* ==========================================
   Base
   ========================================== */

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--text);
  font-family: Arial, Helvetica, sans-serif;
}

a {
  color: var(--accent);
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

/* ==========================================
   Layout
   ========================================== */

.container {
  max-width: 980px;
  margin: 0 auto;
  padding: 32px 18px 64px;
}

.hidden {
  display: none !important;
}

.sep {
  height: 1px;
  margin: 20px 0;
  background: var(--border);
}

.stack>*+* {
  margin-top: 14px;
}

/* ==========================================
   Shared Site Topbar
   ========================================== */

.site-topbar {
  position: sticky;
  top: 0;
  z-index: 1100;
  background: var(--topbar-bg);
  border-bottom: 1px solid var(--topbar-border);
  backdrop-filter: blur(12px);
}

.site-topbar .site-wrap {
  width: min(calc(100% - 2rem), 1180px);
  margin: 0 auto;
  padding: 1rem 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.site-brand {
  color: #eef2ff;
  font-size: 1rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-decoration: none;
  text-transform: uppercase;
}

.site-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
}

.site-nav a {
  color: var(--topbar-link);
  font-size: 0.95rem;
  text-decoration: none;
}

.site-nav a:hover,
.site-nav a:focus {
  color: var(--topbar-link-hover);
}

.site-nav a.current {
  color: var(--topbar-link-active);
  font-weight: 700;
}

/* ==========================================
   Hero / Intro
   ========================================== */

.hero {
  margin-bottom: 28px;
}

.hero h1 {
  margin: 0 0 10px;
  font-size: 2.55rem;
  line-height: 1.08;
  letter-spacing: -0.02em;
}

.hero p {
  margin: 0;
  color: var(--muted);
  font-size: 1.04rem;
  line-height: 1.55;
}

.hero-intro {
  max-width: 760px;
}

.kicker {
  display: inline-block;
  margin-bottom: 12px;
  color: var(--accent-2);
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.01em;
  text-transform: uppercase;
}

.title-note,
#platform-subtitle {
  margin: 0 0 12px;
  color: var(--muted);
  font-size: 0.95rem;
  font-style: italic;
}

.eyebrow {
  margin-bottom: 8px;
  color: var(--accent-2);
  font-size: 0.9rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

/* ==========================================
   Cards / Panels
   ========================================== */

.card,
.lesson-card,
.practice-question {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.card {
  margin: 18px 0;
  padding: 28px;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.card:hover {
  transform: translateY(-2px);
  box-shadow: 0 14px 32px rgba(15, 23, 42, 0.1);
}

.card h2,
.card h3 {
  margin-top: 0;
}

.lesson-card,
.practice-question {
  padding: 18px;
}

.practice-question-panel {
  display: block;
}

/* ==========================================
   Grid / Lists
   ========================================== */

.grid {
  display: grid;
  gap: 18px;
}

.grid.two {
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
}

.nav {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  margin-bottom: 20px;
}

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 18px;
}

.breadcrumbs {
  display: flex;
  gap: 12px;
  margin: 20px 0;
  font-size: 0.95rem;
}

.breadcrumbs a {
  color: var(--accent);
}

.breadcrumbs span {
  color: var(--muted);
}

ul.clean {
  margin: 12px 0 0 20px;
  padding: 0;
}

ul.clean li,
.topic-list li {
  margin: 8px 0;
}

/* ==========================================
   Buttons / Badges / Pills
   ========================================== */

.button {
  display: inline-block;
  padding: 12px 16px;
  background: var(--accent);
  border: none;
  border-radius: 10px;
  color: #ffffff;
  cursor: pointer;
  font-weight: 700;
  text-decoration: none;
}

.button:hover {
  background: var(--accent-2);
  text-decoration: none;
}

.button.secondary {
  background: #e8eefc;
  border: 1px solid var(--border);
  color: var(--accent-2);
}

.button.good {
  background: var(--success);
}

.button.hard {
  background: var(--warning);
}

.button.again {
  background: var(--danger);
}

.button.disabled {
  opacity: 0.6;
  pointer-events: none;
  cursor: default;
}

.badge,
.pill {
  display: inline-block;
  padding: 5px 10px;
  border-radius: 999px;
  font-size: 0.82rem;
}

.badge {
  margin-right: 8px;
  background: #eff6ff;
  border: 1px solid #bfdbfe;
  color: var(--accent-2);
}

.pill {
  margin-right: 8px;
  margin-bottom: 8px;
  background: #e8f0ff;
  color: var(--accent-2);
}

/* ==========================================
   Text / Utility Content
   ========================================== */

.meta,
.small,
.footer {
  color: var(--muted);
}

.meta {
  font-size: 0.95rem;
}

.small,
.footer {
  font-size: 0.92rem;
}

.footer {
  margin-top: 30px;
}

.stat {
  margin: 4px 0;
  font-size: 1.8rem;
  font-weight: 700;
}

.code {
  overflow: auto;
  padding: 14px;
  background: #0f172a;
  border-radius: 12px;
  color: #e2e8f0;
  font-family: Consolas, Monaco, monospace;
  font-size: 0.95rem;
}

.answer {
  margin-top: 16px;
  padding: 14px;
  background: #f8fafc;
  border: 1px solid var(--border);
  border-radius: 12px;
}

/* ==========================================
   Catalog
   ========================================== */

.course-catalog {
  display: block;
}

.catalog-category {
  margin-top: 2.4rem;
}

.catalog-category:first-child {
  margin-top: 1rem;
}

.catalog-category h3 {
  margin-bottom: 0.95rem;
  font-size: 1.05rem;
  letter-spacing: -0.01em;
}

.course-row {
  padding: 1rem 0 0.95rem;
  border-bottom: 1px solid var(--border);
}

.course-title {
  margin-bottom: 0.3rem;
  font-size: 1.02rem;
  line-height: 1.3;
}

.course-description {
  margin-bottom: 0.38rem;
  color: #475569;
  font-size: 0.96rem;
  line-height: 1.5;
}

.course-meta {
  color: #46748b;
  font-size: 0.86rem;
  line-height: 1.45;
}

.course-link,
.course-status {
  font-weight: 700;
}

/* ==========================================
   Questions / Practice
   ========================================== */

.question {
  margin-bottom: 10px;
  font-size: 1.15rem;
  line-height: 1.5;
}

.question-card {
  color: var(--text);
  max-width: 760px;
  margin: 0 auto;
}

.question-card h2 {
  margin-top: 0;
  margin-bottom: 0.75rem;
  font-size: 1.5rem;
  line-height: 1.25;
  letter-spacing: -0.01em;
}

.question-card h3 {
  margin-top: 0;
  margin-bottom: 0.85rem;
  font-size: 1.18rem;
  line-height: 1.4;
  letter-spacing: -0.01em;
}

.question-card p,
.question-card h2,
.question-card h3,
.question-card .question-text,
.question-card .feedback {
  color: var(--text);
}

.lesson-text {
  color: var(--text);
  font-size: 1.12rem;
  line-height: 1.75;
}

.lesson-progress {
  margin-top: 4px;
  color: #9ca3af;
  font-size: 12px;
}

.choice-list,
.options {
  display: grid;
  gap: 10px;
  margin-top: 12px;
}

.choice,
.option-button {
  padding: 12px 14px;
  background: #ffffff;
  border: 1px solid #cbd5e1;
  border-radius: 10px;
  cursor: pointer;
  font: inherit;
  text-align: left;
}

.choice:hover,
.option-button:hover {
  background: #f8fafc;
  border-color: #bfdbfe;
}

.choice.correct {
  background: #f0fdf4;
  border-color: #86efac;
}

.choice.incorrect {
  background: #fef2f2;
  border-color: #fecaca;
}

.options .option-button {
  display: block;
  width: 100%;
  margin: 0 0 12px;
}

.feedback {
  margin-top: 14px;
  font-size: 0.97rem;
  line-height: 1.5;
}

.correct {
  color: var(--success);
  font-weight: 700;
}

.incorrect {
  color: var(--danger);
  font-weight: 700;
}

/* ==========================================
   Fill-in-the-Blank
   ========================================== */

.fill-line {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.45rem;
  line-height: 1.75;
}

.inline-answer {
  min-width: 5.5rem;
  max-width: 11rem;
  padding: 0.32rem 0.5rem;
  background: #fff;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  color: var(--text);
  font: inherit;
}

.inline-answer:focus,
.option-button:focus,
.window-controls-left button:focus,
.window-controls-right button:focus,
.button:focus {
  outline: 2px solid rgba(37, 99, 235, 0.18);
  outline-offset: 2px;
}

.text-answer {
  font: inherit;
}

/* ==========================================
   Lesson Popup Window
   ========================================== */

.lesson-overlay {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding-top: 90px;
  overflow: auto;
  background: rgba(0, 0, 0, 0.35);
}

.lesson-window {
  width: 900px;
  max-width: 92%;
  margin: 24px 0 40px;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  background: #ffffff;
  border: 1px solid rgba(15, 23, 42, 0.08);
  border-radius: 14px;
  box-shadow: 0 24px 60px rgba(15, 23, 42, 0.18);
}

.lesson-titlebar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 14px;
  background: #f8fafc;
  border-bottom: 1px solid var(--border);
  font-weight: 600;
}

.lesson-title {
  flex: 1;
  text-align: center;
  font-size: 0.98rem;
  line-height: 1.3;
}

.lesson-body {
  position: relative;
  min-height: 280px;
  padding: 34px 34px 30px;
  overflow: auto;
  color: var(--text);
}

.lesson-summary {
  margin-bottom: 18px;
  color: #555;
  font-style: italic;
}

.lesson-next {
  display: flex;
  justify-content: flex-end;
  gap: 12px;
  margin-top: 32px;
}

.lesson-next button {
  padding: 10px 18px;
  background: var(--accent);
  border: none;
  border-radius: 9px;
  color: #ffffff;
  cursor: pointer;
  font-weight: 600;
  font-size: 0.95rem;
}

.lesson-next button:hover {
  background: var(--accent-2);
}

.lesson-next .secondary {
  background: #ffffff;
  border: 1px solid rgba(0, 0, 0, 0.15);
  color: var(--text);
}

.lesson-next .secondary:hover {
  background: #f3f4f6;
}

.window-controls-left button,
.window-controls-right button {
  padding: 4px 8px;
  background: none;
  border: none;
  border-radius: 4px;
  color: var(--text);
  cursor: pointer;
  font-size: 16px;
}

.window-controls-left button:hover,
.window-controls-right button:hover {
  background: #d9d9d9;
}

/* ==========================================
   Lesson Panels / Animation
   ========================================== */

#practice-panels-root {
  position: relative;
  min-height: 180px;
}

.lesson-panel {
  display: none;
  opacity: 0;
  transform: translateX(24px);
}

.lesson-panel.active {
  display: block;
  opacity: 1;
  transform: translateX(0);
  animation: panelSlideIn 0.28s ease;
}

.lesson-panel.slide-back.active {
  animation: panelSlideBack 0.28s ease;
}

#panel-next h2 {
  margin-top: 0;
}

@keyframes panelSlideIn {
  from {
    opacity: 0;
    transform: translateX(24px);
  }

  to {
    opacity: 1;
    transform: translateX(0);
  }
}

@keyframes panelSlideBack {
  from {
    opacity: 0;
    transform: translateX(-24px);
  }

  to {
    opacity: 1;
    transform: translateX(0);
  }
}

/* ==========================================
   Lesson Visibility Safety
   ========================================== */

#practice-panels-root,
#practice-panels-root .lesson-panel,
#practice-panels-root .question-card,
#practice-panels-root .question-card p,
#practice-panels-root .question-card h2,
#practice-panels-root .question-card h3,
#practice-panels-root .lesson-text,
#practice-panels-root .feedback {
  color: var(--text) !important;
}

#practice-panels-root .question-card {
  background: transparent;
}

#practice-panels-root .option-button {
  color: var(--text) !important;
}

/* ==========================================
   Responsive
   ========================================== */

@media (max-width: 900px) {
  .site-topbar .site-wrap {
    flex-direction: column;
    align-items: flex-start;
  }

  .site-nav {
    gap: 0.85rem;
  }
}

@media (max-width: 640px) {
  .container {
    padding: 20px 14px 50px;
  }

  .card {
    padding: 20px;
  }

  .hero h1 {
    font-size: 2rem;
    line-height: 1.1;
  }

  .hero-intro {
    max-width: 100%;
  }

  .lesson-body {
    padding: 24px 20px 22px;
  }

  .question-card {
    max-width: 100%;
  }
}