/* ============================================================
   Cenefit — Crispy design system
   ============================================================ */

:root {
  /* Surfaces */
  --bg:        #0a0c14;
  --bg-grad:   radial-gradient(ellipse 80% 50% at 50% -20%, rgba(120, 119, 198, 0.18), transparent),
               radial-gradient(ellipse 60% 50% at 80% 0%, rgba(99, 102, 241, 0.12), transparent),
               #0a0c14;
  --bg-elev:   #11131c;
  --bg-card:   #141824;
  --bg-card-hover: #181d2b;
  --bg-code:   #0c0f17;

  /* Borders */
  --border:        rgba(255, 255, 255, 0.06);
  --border-strong: rgba(255, 255, 255, 0.10);
  --border-glow:   rgba(129, 140, 248, 0.35);

  /* Text */
  --text:        #f0f2f8;
  --text-soft:   #c9cdd9;
  --text-muted:  #8a91a3;
  --text-dim:    #5a6175;

  /* Accents */
  --accent:        #818cf8;
  --accent-bright: #a5b4fc;
  --accent-deep:   #6366f1;
  --accent-soft:   rgba(129, 140, 248, 0.12);
  --accent-glow:   rgba(129, 140, 248, 0.25);
  --violet:        #a78bfa;
  --pink:          #f472b6;

  /* Semantic */
  --success: #34d399;
  --warning: #fbbf24;
  --danger:  #f87171;
  --info:    #60a5fa;

  /* Radii & shadows */
  --radius-xs: 6px;
  --radius:    10px;
  --radius-lg: 14px;
  --radius-xl: 20px;
  --shadow-sm:  0 1px 2px rgba(0, 0, 0, 0.3);
  --shadow:     0 4px 16px rgba(0, 0, 0, 0.25);
  --shadow-lg:  0 20px 50px -10px rgba(0, 0, 0, 0.5), 0 10px 20px -5px rgba(0, 0, 0, 0.3);
  --shadow-glow: 0 0 40px rgba(129, 140, 248, 0.15);

  /* Typography */
  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
  --font-mono: 'JetBrains Mono', 'Fira Code', 'Cascadia Code', Consolas, monospace;

  --max-width: 1180px;
  --transition: 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

[data-theme="light"] {
  --bg:        #fafbfd;
  --bg-grad:   radial-gradient(ellipse 80% 50% at 50% -20%, rgba(99, 102, 241, 0.10), transparent),
               radial-gradient(ellipse 60% 50% at 80% 0%, rgba(129, 140, 248, 0.06), transparent),
               #fafbfd;
  --bg-elev:   #ffffff;
  --bg-card:   #ffffff;
  --bg-card-hover: #f6f8fc;
  --bg-code:   #f3f5fa;

  --border:        rgba(15, 18, 28, 0.07);
  --border-strong: rgba(15, 18, 28, 0.12);
  --border-glow:   rgba(99, 102, 241, 0.35);

  --text:        #0f1722;
  --text-soft:   #2d3548;
  --text-muted:  #5b6478;
  --text-dim:    #8b91a3;

  --accent:        #4f46e5;
  --accent-bright: #6366f1;
  --accent-deep:   #4338ca;
  --accent-soft:   rgba(79, 70, 229, 0.08);
  --accent-glow:   rgba(79, 70, 229, 0.18);

  --shadow-sm:  0 1px 2px rgba(15, 18, 28, 0.04);
  --shadow:     0 4px 16px rgba(15, 18, 28, 0.06);
  --shadow-lg:  0 20px 50px -10px rgba(15, 18, 28, 0.12), 0 10px 20px -5px rgba(15, 18, 28, 0.04);
  --shadow-glow: 0 0 40px rgba(79, 70, 229, 0.10);
}

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

* { box-sizing: border-box; margin: 0; padding: 0; }
*::selection { background: var(--accent-soft); color: var(--text); }

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: var(--font-sans);
  font-feature-settings: 'cv02', 'cv03', 'cv04', 'cv11';
  background: var(--bg);
  background-image: var(--bg-grad);
  background-attachment: fixed;
  color: var(--text);
  line-height: 1.65;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  transition: background-color var(--transition), color var(--transition);
}

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

button { font-family: inherit; }

img { max-width: 100%; display: block; }

::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border-strong); border-radius: 5px; }
::-webkit-scrollbar-thumb:hover { background: var(--text-dim); }

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

.container {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 28px;
}

/* ============================================================
   Navbar
   ============================================================ */

.navbar {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(10, 12, 20, 0.7);
  backdrop-filter: saturate(180%) blur(16px);
  -webkit-backdrop-filter: saturate(180%) blur(16px);
  border-bottom: 1px solid var(--border);
}

[data-theme="light"] .navbar { background: rgba(250, 251, 253, 0.75); }

.navbar-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 28px;
  max-width: var(--max-width);
  margin: 0 auto;
  gap: 24px;
}

.logo {
  display: flex;
  align-items: center;
  gap: 11px;
  font-weight: 700;
  font-size: 0.98rem;
  color: var(--text);
  letter-spacing: -0.01em;
}

.logo:hover { color: var(--text); }

.logo-mark {
  width: 30px;
  height: 30px;
  border-radius: 8px;
  background: linear-gradient(135deg, var(--accent) 0%, var(--violet) 100%);
  display: grid;
  place-items: center;
  color: white;
  font-weight: 800;
  font-size: 0.78rem;
  letter-spacing: -0.04em;
  box-shadow: 0 4px 14px var(--accent-glow);
}

.nav-links {
  display: flex;
  gap: 4px;
  align-items: center;
  list-style: none;
}

.nav-links a {
  padding: 7px 13px;
  border-radius: 7px;
  color: var(--text-muted);
  font-size: 0.88rem;
  font-weight: 500;
  transition: all var(--transition);
  letter-spacing: -0.005em;
}

.nav-links a:hover {
  background: var(--accent-soft);
  color: var(--text);
}

.nav-links a.active {
  background: var(--accent-soft);
  color: var(--accent-bright);
}

.theme-toggle {
  width: 34px;
  height: 34px;
  border-radius: 9px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  color: var(--text-soft);
  cursor: pointer;
  display: grid;
  place-items: center;
  transition: all var(--transition);
  font-size: 0.95rem;
}

.theme-toggle:hover {
  background: var(--accent-soft);
  border-color: var(--border-glow);
  color: var(--accent-bright);
}

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

.hero {
  padding: 96px 0 60px;
  text-align: center;
  position: relative;
}

.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 14px;
  border-radius: 999px;
  background: var(--accent-soft);
  border: 1px solid var(--border-glow);
  color: var(--accent-bright);
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.01em;
  margin-bottom: 24px;
}

.hero-badge::before {
  content: '';
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent-bright);
  box-shadow: 0 0 12px var(--accent-bright);
  animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.4; }
}

.hero h1 {
  font-size: clamp(2.2rem, 6vw, 4.2rem);
  font-weight: 800;
  letter-spacing: -0.035em;
  line-height: 1.05;
  margin-bottom: 22px;
  background: linear-gradient(180deg, var(--text) 30%, var(--text-muted));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.hero h1 .accent {
  background: linear-gradient(135deg, var(--accent-bright) 0%, var(--violet) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.hero p {
  font-size: 1.12rem;
  color: var(--text-muted);
  max-width: 620px;
  margin: 0 auto 36px;
  line-height: 1.6;
}

.hero-actions {
  display: flex;
  gap: 12px;
  justify-content: center;
  flex-wrap: wrap;
  margin-bottom: 56px;
}

.hero-stats {
  display: flex;
  gap: 48px;
  justify-content: center;
  flex-wrap: wrap;
  padding: 24px 32px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  max-width: 720px;
  margin: 0 auto;
  box-shadow: var(--shadow);
}

.stat-num {
  font-size: 1.8rem;
  font-weight: 800;
  background: linear-gradient(135deg, var(--accent-bright), var(--violet));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  display: block;
  letter-spacing: -0.02em;
  line-height: 1;
  margin-bottom: 4px;
}

.stat-label {
  font-size: 0.78rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-weight: 500;
}

/* ============================================================
   Sections
   ============================================================ */

section { padding: 56px 0; }

.section-header {
  margin-bottom: 36px;
  text-align: center;
}

.section-eyebrow {
  display: inline-block;
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--accent-bright);
  text-transform: uppercase;
  letter-spacing: 0.12em;
  margin-bottom: 10px;
}

.section-title {
  font-size: clamp(1.6rem, 3.5vw, 2.4rem);
  font-weight: 700;
  margin-bottom: 12px;
  letter-spacing: -0.025em;
  line-height: 1.15;
}

.section-subtitle {
  color: var(--text-muted);
  font-size: 1.02rem;
  max-width: 600px;
  margin: 0 auto;
}

/* ============================================================
   Unit cards
   ============================================================ */

.unit-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 18px;
}

.unit-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 28px;
  transition: all var(--transition);
  cursor: pointer;
  display: block;
  color: var(--text);
  position: relative;
  overflow: hidden;
}

.unit-card::before {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: var(--radius-lg);
  padding: 1px;
  background: linear-gradient(135deg, var(--accent), transparent 50%, var(--violet));
  -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  opacity: 0;
  transition: opacity var(--transition);
  pointer-events: none;
}

.unit-card:hover {
  transform: translateY(-3px);
  background: var(--bg-card-hover);
  box-shadow: var(--shadow-lg);
  color: var(--text);
}

.unit-card:hover::before { opacity: 1; }

.unit-num {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--accent-bright);
  text-transform: uppercase;
  letter-spacing: 0.12em;
  margin-bottom: 10px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.unit-title {
  font-size: 1.22rem;
  font-weight: 700;
  margin-bottom: 10px;
  letter-spacing: -0.015em;
  line-height: 1.3;
}

.unit-desc {
  color: var(--text-muted);
  font-size: 0.92rem;
  margin-bottom: 18px;
  line-height: 1.55;
}

.unit-meta {
  display: flex;
  gap: 10px;
  font-size: 0.78rem;
  color: var(--text-dim);
  align-items: center;
}

.unit-weight {
  display: inline-flex;
  align-items: center;
  padding: 3px 9px;
  background: var(--accent-soft);
  color: var(--accent-bright);
  border-radius: 5px;
  font-weight: 600;
  font-size: 0.72rem;
  letter-spacing: 0.02em;
}

/* ============================================================
   Lesson page
   ============================================================ */

.lesson-layout {
  display: grid;
  grid-template-columns: 260px 1fr;
  gap: 48px;
  padding: 40px 0 80px;
}

@media (max-width: 900px) {
  .lesson-layout { grid-template-columns: 1fr; gap: 24px; }
  .sidebar { position: static !important; }
}

.sidebar {
  position: sticky;
  top: 76px;
  height: fit-content;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 22px;
}

.sidebar h3 {
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--text-muted);
  margin-bottom: 14px;
  font-weight: 600;
}

.sidebar ol {
  list-style: none;
  counter-reset: lesson;
}

.sidebar li {
  counter-increment: lesson;
  margin-bottom: 2px;
}

.sidebar li a {
  display: block;
  padding: 8px 12px;
  border-radius: 7px;
  color: var(--text-muted);
  font-size: 0.88rem;
  transition: all var(--transition);
  line-height: 1.4;
}

.sidebar li a::before {
  content: counter(lesson, decimal-leading-zero);
  color: var(--text-dim);
  font-weight: 600;
  font-family: var(--font-mono);
  font-size: 0.78em;
  margin-right: 10px;
}

.sidebar li a:hover {
  background: var(--accent-soft);
  color: var(--text);
}

.sidebar li a.active {
  background: var(--accent-soft);
  color: var(--accent-bright);
}

.lesson-content { min-width: 0; }

.breadcrumb {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-bottom: 14px;
  font-family: var(--font-mono);
}

.breadcrumb a { color: var(--text-muted); }
.breadcrumb a:hover { color: var(--accent-bright); }

.lesson-title {
  font-size: clamp(2rem, 5vw, 2.8rem);
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1.1;
  margin-bottom: 12px;
  background: linear-gradient(180deg, var(--text), var(--text-soft));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.lesson-subtitle {
  color: var(--text-muted);
  font-size: 1.08rem;
  margin-bottom: 40px;
  line-height: 1.55;
  max-width: 700px;
}

.lesson {
  margin-bottom: 56px;
  padding-bottom: 48px;
  border-bottom: 1px solid var(--border);
}

.lesson:last-child { border-bottom: none; }

.lesson h2 {
  font-size: 1.55rem;
  font-weight: 700;
  margin-bottom: 18px;
  scroll-margin-top: 90px;
  letter-spacing: -0.02em;
  display: flex;
  align-items: center;
  gap: 14px;
  line-height: 1.25;
}

.lesson h2 .topic-num {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  font-weight: 600;
  color: white;
  background: linear-gradient(135deg, var(--accent), var(--violet));
  padding: 5px 10px;
  border-radius: 7px;
  display: inline-block;
  letter-spacing: 0.02em;
  box-shadow: 0 2px 10px var(--accent-glow);
}

.lesson h3 {
  font-size: 1.18rem;
  font-weight: 700;
  margin: 28px 0 12px;
  letter-spacing: -0.015em;
}

.lesson h4 {
  font-size: 1rem;
  font-weight: 700;
  margin: 22px 0 8px;
  color: var(--text);
}

.lesson p { margin-bottom: 14px; color: var(--text-soft); line-height: 1.7; }
.lesson p strong { color: var(--text); font-weight: 600; }
.lesson ul, .lesson ol { margin: 12px 0 14px 26px; }
.lesson li { margin-bottom: 7px; color: var(--text-soft); line-height: 1.65; }
.lesson li strong { color: var(--text); font-weight: 600; }

.lesson code {
  font-family: var(--font-mono);
  background: var(--bg-code);
  padding: 2px 7px;
  border-radius: 5px;
  font-size: 0.85em;
  color: var(--pink);
  border: 1px solid var(--border);
  font-weight: 500;
}

[data-theme="light"] .lesson code { color: #be185d; }

/* ============================================================
   Callouts
   ============================================================ */

.callout {
  padding: 16px 20px;
  border-radius: var(--radius);
  margin: 18px 0;
  border-left: 3px solid;
  background: var(--bg-card);
  border-top: 1px solid var(--border);
  border-right: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  position: relative;
}

.callout-title {
  font-weight: 600;
  margin-bottom: 6px;
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.92rem;
  letter-spacing: -0.005em;
}

.callout p { color: var(--text-soft); margin-bottom: 0; font-size: 0.95rem; }
.callout p + p { margin-top: 8px; }

.callout.info    { border-left-color: var(--info); }
.callout.info    .callout-title { color: var(--info); }
.callout.warning { border-left-color: var(--warning); }
.callout.warning .callout-title { color: var(--warning); }
.callout.danger  { border-left-color: var(--danger); }
.callout.danger  .callout-title { color: var(--danger); }
.callout.success { border-left-color: var(--success); }
.callout.success .callout-title { color: var(--success); }
.callout.tip     { border-left-color: var(--violet); }
.callout.tip     .callout-title { color: var(--violet); }
.callout.task    { border-left-color: var(--success); background: linear-gradient(90deg, color-mix(in srgb, var(--success) 8%, var(--bg-card)) 0%, var(--bg-card) 40%); }
.callout.task    .callout-title { color: var(--success); }
.callout.task ul, .callout.task ol { margin: 6px 0 0 20px; color: var(--text-soft); font-size: 0.95rem; }
.callout.task code { font-size: 0.88em; }

.solution {
  margin: -6px 0 18px 0;
  border: 1px dashed var(--border);
  border-radius: var(--radius);
  background: var(--bg-card);
  padding: 0 14px;
  font-size: 0.9rem;
}
.solution > summary {
  cursor: pointer;
  padding: 10px 0;
  font-weight: 600;
  color: var(--text-dim);
  list-style: none;
  user-select: none;
}
.solution > summary::before { content: "▸ "; color: var(--violet); }
.solution[open] > summary::before { content: "▾ "; }
.solution > summary:hover { color: var(--text); }
.solution pre { margin: 0 0 12px 0; }

/* ============================================================
   Buttons
   ============================================================ */

.btn {
  font-family: var(--font-sans);
  font-size: 0.92rem;
  font-weight: 600;
  padding: 9px 16px;
  border-radius: 9px;
  border: 1px solid var(--border-strong);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  transition: all var(--transition);
  background: var(--bg-card);
  color: var(--text);
  text-decoration: none;
  letter-spacing: -0.005em;
  white-space: nowrap;
}

.btn:hover {
  background: var(--bg-card-hover);
  border-color: var(--border-glow);
  color: var(--text);
  transform: translateY(-1px);
}

.btn-primary {
  background: linear-gradient(135deg, var(--accent-deep), var(--violet));
  color: white;
  border-color: transparent;
  box-shadow: 0 4px 14px var(--accent-glow);
}

.btn-primary:hover {
  background: linear-gradient(135deg, var(--accent-bright), var(--violet));
  color: white;
  box-shadow: 0 6px 20px var(--accent-glow);
}

.btn:disabled { opacity: 0.5; cursor: not-allowed; transform: none; }

.btn-lg {
  padding: 12px 22px;
  font-size: 0.98rem;
  border-radius: 10px;
}

/* ============================================================
   IDE component
   ============================================================ */

.ide {
  background: var(--bg-card);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-lg);
  overflow: hidden;
  margin: 22px 0;
  box-shadow: var(--shadow);
}

.ide-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 14px;
  background: var(--bg-elev);
  border-bottom: 1px solid var(--border);
}

.ide-title {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 500;
}

.ide-title::before {
  content: '';
  display: inline-block;
  width: 9px; height: 9px;
  border-radius: 50%;
  background: linear-gradient(135deg, #fbbf24, #f59e0b);
  box-shadow: 0 0 8px rgba(251, 191, 36, 0.5);
}

.ide-actions { display: flex; gap: 8px; }

.ide-actions .btn {
  padding: 5px 12px;
  font-size: 0.82rem;
  border-radius: 7px;
}

.editor-wrap {
  height: 300px;
  position: relative;
  background: var(--bg-code);
}

.CodeMirror {
  height: 100% !important;
  font-family: var(--font-mono) !important;
  font-size: 13px !important;
  line-height: 1.55 !important;
  background: var(--bg-code) !important;
}

.CodeMirror-gutters {
  background: var(--bg-code) !important;
  border-right: 1px solid var(--border) !important;
}

.CodeMirror-linenumber { color: var(--text-dim) !important; }

.ide-output-wrap { border-top: 1px solid var(--border); }

.ide-output {
  background: var(--bg-elev);
  padding: 14px 18px;
  font-family: var(--font-mono);
  font-size: 12.5px;
  color: var(--text);
  max-height: 240px;
  overflow-y: auto;
  white-space: pre-wrap;
  word-break: break-word;
  line-height: 1.5;
}

.ide-output-label {
  font-size: 0.68rem;
  color: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  margin-bottom: 8px;
  font-family: var(--font-sans);
  font-weight: 600;
}

.ide-output .stderr  { color: var(--danger); }
.ide-output .stdout  { color: var(--text); }
.ide-output .info    { color: var(--info); font-style: italic; }
.ide-output .success { color: var(--success); }

.spinner {
  display: inline-block;
  width: 12px;
  height: 12px;
  border: 2px solid var(--border-strong);
  border-top-color: var(--accent-bright);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}

@keyframes spin { to { transform: rotate(360deg); } }

/* ============================================================
   Quiz
   ============================================================ */

.quiz {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 24px;
  margin: 22px 0;
}

.quiz-q {
  font-weight: 600;
  margin-bottom: 16px;
  font-size: 1.02rem;
  letter-spacing: -0.005em;
  line-height: 1.55;
}

.quiz-options {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.quiz-option {
  padding: 11px 14px;
  background: var(--bg-elev);
  border: 1px solid var(--border);
  border-radius: 9px;
  cursor: pointer;
  transition: all var(--transition);
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 0.93rem;
}

.quiz-option:hover {
  border-color: var(--border-glow);
  background: var(--bg-card-hover);
}

.quiz-option.correct {
  background: rgba(52, 211, 153, 0.08);
  border-color: var(--success);
  color: var(--success);
}

.quiz-option.incorrect {
  background: rgba(248, 113, 113, 0.08);
  border-color: var(--danger);
  color: var(--danger);
}

.quiz-option .letter {
  width: 24px;
  height: 24px;
  border-radius: 6px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  display: grid;
  place-items: center;
  font-weight: 700;
  font-size: 0.78rem;
  flex-shrink: 0;
  font-family: var(--font-mono);
}

.quiz-feedback {
  margin-top: 14px;
  padding: 12px 14px;
  border-radius: 8px;
  display: none;
  font-size: 0.92rem;
}

.quiz-feedback.show { display: block; }
.quiz-feedback.correct { background: rgba(52, 211, 153, 0.08); color: var(--success); }
.quiz-feedback.incorrect { background: rgba(248, 113, 113, 0.08); color: var(--danger); }

/* ============================================================
   FRQ
   ============================================================ */

.frq-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 32px;
  margin-bottom: 24px;
}

.frq-tag {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 5px;
  font-size: 0.72rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  background: var(--accent-soft);
  color: var(--accent-bright);
  margin-right: 8px;
  font-family: var(--font-mono);
}

.frq-tag.method  { background: rgba(96, 165, 250, 0.12); color: var(--info); }
.frq-tag.class   { background: rgba(167, 139, 250, 0.12); color: var(--violet); }
.frq-tag.array   { background: rgba(251, 191, 36, 0.12); color: var(--warning); }
.frq-tag.array2d { background: rgba(52, 211, 153, 0.12); color: var(--success); }

details summary {
  cursor: pointer;
  padding: 11px 16px;
  background: var(--bg-elev);
  border: 1px solid var(--border);
  border-radius: 9px;
  font-weight: 600;
  margin: 12px 0 0;
  list-style: none;
  transition: all var(--transition);
  font-size: 0.93rem;
}

details summary::-webkit-details-marker { display: none; }

details summary::before {
  content: '▸';
  display: inline-block;
  transition: transform var(--transition);
  margin-right: 8px;
  color: var(--text-muted);
}

details[open] summary::before {
  transform: rotate(90deg);
  color: var(--accent-bright);
}

details summary:hover {
  border-color: var(--border-glow);
  color: var(--text);
}

details[open] summary {
  border-bottom-left-radius: 0;
  border-bottom-right-radius: 0;
  background: var(--accent-soft);
  color: var(--accent-bright);
  border-color: var(--border-glow);
}

.rubric {
  background: var(--bg-elev);
  border: 1px solid var(--border);
  border-top: none;
  border-radius: 0 0 9px 9px;
  padding: 16px 20px;
}

.rubric-point {
  padding: 8px 0;
  border-bottom: 1px dashed var(--border);
  display: flex;
  justify-content: space-between;
  gap: 16px;
  font-size: 0.92rem;
}

.rubric-point:last-child { border-bottom: none; }

.rubric-point .pts {
  font-weight: 700;
  color: var(--accent-bright);
  white-space: nowrap;
  font-family: var(--font-mono);
  font-size: 0.85em;
}

/* ============================================================
   Tabs
   ============================================================ */

.tabs {
  display: flex;
  gap: 4px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 22px;
  flex-wrap: wrap;
}

.tab {
  padding: 10px 16px;
  background: none;
  border: none;
  color: var(--text-muted);
  font-weight: 500;
  cursor: pointer;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
  font-size: 0.92rem;
  transition: all var(--transition);
}

.tab:hover { color: var(--text); }
.tab.active { color: var(--accent-bright); border-color: var(--accent-bright); }

.tab-content { display: none; }
.tab-content.active { display: block; }

/* ============================================================
   Footer
   ============================================================ */

footer {
  border-top: 1px solid var(--border);
  padding: 48px 0;
  text-align: center;
  color: var(--text-muted);
  font-size: 0.88rem;
  margin-top: 60px;
  background: var(--bg-elev);
}

footer p { margin-bottom: 6px; }
footer a { color: var(--accent-bright); }

/* ============================================================
   Misc
   ============================================================ */

.tag-row { display: flex; gap: 6px; flex-wrap: wrap; margin: 10px 0; }

.tag {
  display: inline-block;
  padding: 3px 9px;
  border-radius: 5px;
  font-size: 0.74rem;
  font-weight: 600;
  background: var(--bg-elev);
  color: var(--text-muted);
  border: 1px solid var(--border);
  font-family: var(--font-mono);
}

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

table {
  width: 100%;
  border-collapse: collapse;
  margin: 18px 0;
  background: var(--bg-card);
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid var(--border);
  font-size: 0.92rem;
}

th, td { padding: 10px 14px; text-align: left; border-bottom: 1px solid var(--border); }
th { background: var(--bg-elev); font-weight: 600; color: var(--text); font-size: 0.82rem; text-transform: uppercase; letter-spacing: 0.05em; }
tr:last-child td { border-bottom: none; }
td code { font-size: 0.88em; }

pre {
  background: var(--bg-code);
  padding: 16px 18px;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  overflow-x: auto;
  font-family: var(--font-mono);
  font-size: 0.82rem;
  margin: 14px 0;
  line-height: 1.6;
}

pre code { background: none; padding: 0; color: var(--text); border: none; font-size: 1em; }

.progress-bar {
  height: 5px;
  background: var(--bg-elev);
  border-radius: 3px;
  overflow: hidden;
  margin-top: 14px;
  border: 1px solid var(--border);
}

.progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--accent), var(--violet));
  transition: width 0.6s cubic-bezier(0.4, 0, 0.2, 1);
  border-radius: 3px;
}

.nav-prev-next {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 40px;
  padding-top: 28px;
  border-top: 1px solid var(--border);
  gap: 12px;
}

.feature-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 18px;
}

.feature-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 28px;
}

.feature-icon {
  width: 44px;
  height: 44px;
  border-radius: 11px;
  background: linear-gradient(135deg, var(--accent-soft), transparent);
  border: 1px solid var(--border-glow);
  display: grid;
  place-items: center;
  font-size: 1.4rem;
  margin-bottom: 16px;
}

.feature-card h3 { font-size: 1.1rem; margin-bottom: 8px; font-weight: 700; letter-spacing: -0.01em; }
.feature-card p { color: var(--text-muted); font-size: 0.92rem; line-height: 1.55; margin: 0; }

@media (max-width: 600px) {
  .container { padding: 0 18px; }
  .navbar-inner { padding: 12px 18px; }
  .nav-links a { padding: 7px 10px; font-size: 0.85rem; }
  .hero { padding: 60px 0 40px; }
  .hero-stats { gap: 28px; padding: 20px; }
  .lesson-content { padding: 0 4px; }
  .unit-card { padding: 22px; }
}
