@import url('https://fonts.googleapis.com/css2?family=Space+Grotesk:wght@400;500;600;700&family=DM+Sans:wght@400;500;600;700&family=JetBrains+Mono:wght@400;500&display=swap');

/* ── Reset ── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; border-color: var(--border); }
html { font-family: 'DM Sans', system-ui, sans-serif; -webkit-font-smoothing: antialiased; }
body {
  background: radial-gradient(ellipse at top, oklch(0.18 0.06 275) 0%, var(--background) 60%);
  color: var(--foreground);
  min-height: 100vh;
  font-feature-settings: "ss01", "cv11";
  line-height: 1.6;
}
h1,h2,h3,h4,h5,h6 { font-family: 'Space Grotesk', system-ui, sans-serif; letter-spacing: -0.02em; line-height: 1.1; }
a { color: inherit; text-decoration: none; }
button { cursor: pointer; font: inherit; }
ol, ul { list-style: none; }
img { max-width: 100%; display: block; }

/* ── Theme variables (dark by default) ── */
:root {
  --radius: 0.75rem;
  --background: oklch(0.13 0.04 270);
  --foreground: oklch(0.97 0.01 260);
  --surface: oklch(0.17 0.045 270);
  --surface-elevated: oklch(0.22 0.055 270);
  --card: oklch(0.17 0.045 270);
  --card-foreground: oklch(0.97 0.01 260);
  --popover: oklch(0.19 0.05 270);
  --popover-foreground: oklch(0.97 0.01 260);
  --primary: oklch(0.62 0.22 275);
  --primary-foreground: oklch(0.99 0.005 260);
  --primary-glow: oklch(0.72 0.2 285);
  --secondary: oklch(0.25 0.06 270);
  --secondary-foreground: oklch(0.95 0.01 260);
  --muted: oklch(0.23 0.05 270);
  --muted-foreground: oklch(0.7 0.03 260);
  --accent: oklch(0.55 0.18 200);
  --accent-foreground: oklch(0.99 0.005 260);
  --destructive: oklch(0.62 0.23 25);
  --destructive-foreground: oklch(0.99 0.005 260);
  --success: oklch(0.7 0.18 155);
  --success-foreground: oklch(0.13 0.04 270);
  --warning: oklch(0.78 0.16 75);
  --warning-foreground: oklch(0.13 0.04 270);
  --border: oklch(1 0 0 / 8%);
  --input: oklch(1 0 0 / 12%);
  --ring: oklch(0.62 0.22 275);
  --level-1: oklch(0.7 0.18 155);
  --level-2: oklch(0.72 0.18 245);
  --level-3: oklch(0.7 0.2 320);
}

/* ── Typography ── */
.font-display { font-family: 'Space Grotesk', system-ui, sans-serif; }
.font-mono { font-family: 'JetBrains Mono', monospace; }

/* ── Layout ── */
.container { max-width: 80rem; margin: 0 auto; padding: 0 1rem; }
@media (min-width: 640px) { .container { padding: 0 1.5rem; } }
@media (min-width: 1024px) { .container { padding: 0 2rem; } }
.container-sm { max-width: 48rem; margin: 0 auto; padding: 0 1rem; }
@media (min-width: 640px) { .container-sm { padding: 0 1.5rem; } }
.container-md { max-width: 64rem; margin: 0 auto; padding: 0 1rem; }
@media (min-width: 640px) { .container-md { padding: 0 1.5rem; } }
.flex { display: flex; }
.flex-col { flex-direction: column; }
.flex-1 { flex: 1; }
.items-center { align-items: center; }
.items-baseline { align-items: baseline; }
.items-end { align-items: flex-end; }
.justify-between { justify-content: space-between; }
.justify-center { justify-content: center; }
.justify-end { justify-content: flex-end; }
.gap-1 { gap: 0.25rem; }
.gap-1\.5 { gap: 0.375rem; }
.gap-2 { gap: 0.5rem; }
.gap-2\.5 { gap: 0.625rem; }
.gap-3 { gap: 0.75rem; }
.gap-4 { gap: 1rem; }
.gap-5 { gap: 1.25rem; }
.gap-6 { gap: 1.5rem; }
.flex-wrap { flex-wrap: wrap; }
.shrink-0 { flex-shrink: 0; }
.min-w-0 { min-width: 0; }
.truncate { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.min-h-screen { min-height: 100vh; }

/* ── Grid ── */
.grid { display: grid; }
.grid-cols-2 { grid-template-columns: repeat(2, 1fr); }
.grid-cols-3 { grid-template-columns: repeat(3, 1fr); }
@media (min-width: 640px) {
  .sm-grid-cols-2 { grid-template-columns: repeat(2, 1fr); }
  .sm-grid-cols-3 { grid-template-columns: repeat(3, 1fr); }
}
@media (min-width: 768px) {
  .md-grid-cols-3 { grid-template-columns: repeat(3, 1fr); }
}
@media (min-width: 1024px) {
  .lg-grid-cols-3 { grid-template-columns: repeat(3, 1fr); }
}

/* ── Spacing ── */
.space-y-1 > * + * { margin-top: 0.25rem; }
.space-y-2 > * + * { margin-top: 0.5rem; }
.space-y-4 > * + * { margin-top: 1rem; }
.space-y-12 > * + * { margin-top: 3rem; }
.mb-1 { margin-bottom: 0.25rem; }
.mb-1\.5 { margin-bottom: 0.375rem; }
.mb-2 { margin-bottom: 0.5rem; }
.mb-3 { margin-bottom: 0.75rem; }
.mb-4 { margin-bottom: 1rem; }
.mb-5 { margin-bottom: 1.25rem; }
.mb-6 { margin-bottom: 1.5rem; }
.mb-8 { margin-bottom: 2rem; }
.mb-10 { margin-bottom: 2.5rem; }
.mt-1 { margin-top: 0.25rem; }
.mt-2 { margin-top: 0.5rem; }
.mt-3 { margin-top: 0.75rem; }
.mt-4 { margin-top: 1rem; }
.mt-5 { margin-top: 1.25rem; }
.mt-6 { margin-top: 1.5rem; }
.mt-8 { margin-top: 2rem; }
.mt-10 { margin-top: 2.5rem; }
.p-3 { padding: 0.75rem; }
.p-4 { padding: 1rem; }
.p-5 { padding: 1.25rem; }
.p-6 { padding: 1.5rem; }
.p-8 { padding: 2rem; }
.px-3 { padding-left: 0.75rem; padding-right: 0.75rem; }
.px-4 { padding-left: 1rem; padding-right: 1rem; }
.px-5 { padding-left: 1.25rem; padding-right: 1.25rem; }
.py-1 { padding-top: 0.25rem; padding-bottom: 0.25rem; }
.py-1\.5 { padding-top: 0.375rem; padding-bottom: 0.375rem; }
.py-2 { padding-top: 0.5rem; padding-bottom: 0.5rem; }
.py-3 { padding-top: 0.75rem; padding-bottom: 0.75rem; }
.py-10 { padding-top: 2.5rem; padding-bottom: 2.5rem; }
.py-12 { padding-top: 3rem; padding-bottom: 3rem; }

/* ── Surfaces ── */
.gradient-primary {
  background-image: linear-gradient(135deg, var(--primary) 0%, var(--primary-glow) 100%);
}
.gradient-text {
  background: linear-gradient(135deg, var(--primary-glow) 0%, var(--accent) 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.surface-card {
  background: linear-gradient(180deg, var(--surface-elevated) 0%, var(--surface) 100%);
  border: 1px solid var(--border);
  border-radius: calc(var(--radius) + 8px);
}
.bg-surface { background: var(--surface); }
.bg-surface-elevated { background: var(--surface-elevated); }
.bg-background { background: var(--background); }
.border-border { border: 1px solid var(--border); }
.rounded-full { border-radius: 9999px; }
.rounded-lg { border-radius: var(--radius); }
.rounded-xl { border-radius: calc(var(--radius) + 4px); }
.rounded-2xl { border-radius: calc(var(--radius) + 8px); }

/* ── Shadow ── */
.shadow-glow { box-shadow: 0 0 60px -10px color-mix(in oklab, var(--primary-glow) 50%, transparent); }
.shadow-elegant { box-shadow: 0 1px 0 0 color-mix(in oklab, white 6%, transparent) inset, 0 20px 40px -20px oklch(0 0 0 / 0.5); }

/* ── Typography ── */
.text-xs { font-size: 0.75rem; line-height: 1rem; }
.text-sm { font-size: 0.875rem; line-height: 1.25rem; }
.text-base { font-size: 1rem; line-height: 1.5rem; }
.text-lg { font-size: 1.125rem; line-height: 1.75rem; }
.text-xl { font-size: 1.25rem; line-height: 1.75rem; }
.text-2xl { font-size: 1.5rem; line-height: 2rem; }
.text-3xl { font-size: 1.875rem; line-height: 2.25rem; }
.text-4xl { font-size: 2.25rem; line-height: 2.5rem; }
.text-5xl { font-size: 3rem; line-height: 1; }
.text-7xl { font-size: 4.5rem; line-height: 1; }
.font-medium { font-weight: 500; }
.font-semibold { font-weight: 600; }
.font-bold { font-weight: 700; }
.uppercase { text-transform: uppercase; }
.tracking-tight { letter-spacing: -0.025em; }
.tracking-wider { letter-spacing: 0.05em; }
.tracking-widest { letter-spacing: 0.1em; }
.leading-relaxed { line-height: 1.625; }
.leading-tight { line-height: 1.25; }
.leading-none { line-height: 1; }
.text-center { text-align: center; }
.text-right { text-align: right; }
.text-foreground { color: var(--foreground); }
.text-muted-foreground { color: var(--muted-foreground); }
.text-primary-foreground { color: var(--primary-foreground); }
.text-primary-glow { color: var(--primary-glow); }
.text-success { color: var(--success); }
.text-destructive { color: var(--destructive); }
.text-warning { color: var(--warning); }

/* ── Header ── */
.site-header {
  position: sticky;
  top: 0;
  z-index: 40;
  border-bottom: 1px solid color-mix(in oklab, var(--border) 60%, transparent);
  backdrop-filter: blur(20px);
  background: color-mix(in oklab, var(--background) 70%, transparent);
}
.site-header .inner {
  max-width: 80rem;
  margin: 0 auto;
  padding: 0 1rem;
  height: 4rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
}
@media (min-width: 640px) { .site-header .inner { padding: 0 1.5rem; } }
@media (min-width: 1024px) { .site-header .inner { padding: 0 2rem; } }
.site-header .logo {
  display: flex;
  align-items: center;
  gap: 0.625rem;
}
.site-header .logo-icon {
  display: grid;
  place-items: center;
  width: 2.25rem;
  height: 2.25rem;
  border-radius: calc(var(--radius) + 4px);
  background-image: linear-gradient(135deg, var(--primary) 0%, var(--primary-glow) 100%);
  box-shadow: 0 0 60px -10px color-mix(in oklab, var(--primary-glow) 50%, transparent);
}
.site-header .logo-text {
  font-family: 'Space Grotesk', system-ui, sans-serif;
  font-weight: 600;
  font-size: 1.125rem;
  letter-spacing: -0.025em;
}
.site-header .logo-text .dot { color: var(--primary-glow); }
.site-header nav { display: none; align-items: center; gap: 0.25rem; }
@media (min-width: 768px) { .site-header nav { display: flex; } }
.site-header nav a {
  padding: 0.375rem 0.875rem;
  border-radius: var(--radius);
  font-size: 0.875rem;
  font-weight: 500;
  transition: all 0.15s;
  color: var(--muted-foreground);
}
.site-header nav a:hover { color: var(--foreground); background: var(--surface); }
.site-header nav a.active { color: var(--foreground); background: var(--surface-elevated); }
.site-header .stats {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}
.stat-pill {
  display: flex;
  align-items: center;
  gap: 0.375rem;
  padding: 0.375rem 0.75rem;
  border-radius: 9999px;
  background: var(--surface);
  border: 1px solid var(--border);
  font-size: 0.75rem;
  font-weight: 500;
}
.stat-pill .value { font-family: 'JetBrains Mono', monospace; }
.stat-pill .label { color: var(--muted-foreground); }
.stat-pill.hide-mobile { display: none; }
@media (min-width: 640px) { .stat-pill.hide-mobile { display: flex; } }

/* ── Buttons ── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.75rem 1.25rem;
  border-radius: calc(var(--radius) + 4px);
  font-weight: 500;
  font-size: 0.875rem;
  transition: all 0.15s;
  border: none;
  cursor: pointer;
}
.floating-ia-button {
  position: fixed;
  left: 1.25rem;
  bottom: 1.25rem;
  width: 3rem;
  height: 3rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 9999px;
  background: var(--surface-elevated);
  border: 1px solid var(--border);
  box-shadow: 0 12px 40px -20px rgba(0, 0, 0, 0.35);
  color: var(--primary-glow);
  cursor: pointer;
  z-index: 20;
}
.floating-ia-button:hover {
  background: var(--surface);
}
.btn-primary {
  background-image: linear-gradient(135deg, var(--primary) 0%, var(--primary-glow) 100%);
  color: var(--primary-foreground);
  box-shadow: 0 0 60px -10px color-mix(in oklab, var(--primary-glow) 50%, transparent);
}
.btn-primary:hover { opacity: 0.95; }
.btn-outline {
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--foreground);
}
.btn-outline:hover { background: var(--surface-elevated); border-color: color-mix(in oklab, var(--primary) 50%, transparent); }
.btn-sm { padding: 0.375rem 0.75rem; font-size: 0.8125rem; border-radius: var(--radius); }
.btn-lg { padding: 0.875rem 1.5rem; font-size: 1rem; }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }
.btn-icon {
  width: 2.25rem;
  height: 2.25rem;
  padding: 0;
  display: grid;
  place-items: center;
  border-radius: var(--radius);
}

/* ── Hero ── */
.hero { padding: 4rem 0 5rem; }
@media (min-width: 640px) { .hero { padding: 6rem 0 7rem; } }
.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.25rem 0.75rem;
  border-radius: 9999px;
  background: var(--surface);
  border: 1px solid var(--border);
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--muted-foreground);
  margin-bottom: 1.5rem;
}
.hero-badge .pulse {
  width: 0.375rem;
  height: 0.375rem;
  border-radius: 9999px;
  background: var(--success);
  animation: pulse 2s infinite;
}
@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.5; }
}

/* ── Level cards ── */
.level-card {
  position: relative;
  overflow: hidden;
  transition: all 0.2s;
}
.level-card:hover { border-color: color-mix(in oklab, var(--primary) 50%, transparent); }
.level-card .glow {
  position: absolute;
  top: -5rem;
  right: -5rem;
  width: 12rem;
  height: 12rem;
  border-radius: 9999px;
  opacity: 0.2;
  filter: blur(48px);
  transition: opacity 0.3s;
}
.level-card:hover .glow { opacity: 0.4; }
.level-card .inner { position: relative; }
.icon-box {
  display: grid;
  place-items: center;
  width: 2.75rem;
  height: 2.75rem;
  border-radius: calc(var(--radius) + 4px);
}

/* ── Progress bar ── */
.progress-track {
  height: 0.375rem;
  border-radius: 9999px;
  background: var(--surface);
  overflow: hidden;
}
.progress-track.lg { height: 0.5rem; }
.progress-fill {
  height: 100%;
  border-radius: 9999px;
  transition: width 0.3s;
}

/* ── Pillar cards ── */
.pillar-icon {
  display: grid;
  place-items: center;
  width: 2.5rem;
  height: 2.5rem;
  border-radius: var(--radius);
  background: color-mix(in oklab, var(--primary) 15%, transparent);
  color: var(--primary-glow);
  margin-bottom: 1rem;
}

/* ── Topic list items ── */
.topic-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem;
  border-radius: calc(var(--radius) + 4px);
  background: var(--surface);
  border: 1px solid var(--border);
  transition: all 0.15s;
}
.topic-item:hover {
  border-color: color-mix(in oklab, var(--primary) 50%, transparent);
  background: var(--surface-elevated);
}
.topic-item .num {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.75rem;
  color: var(--muted-foreground);
  width: 1.5rem;
  text-align: right;
  flex-shrink: 0;
}
.topic-item .check-icon { flex-shrink: 0; }
.topic-item .chevron {
  flex-shrink: 0;
  color: var(--muted-foreground);
  opacity: 0;
  transition: opacity 0.15s;
}
.topic-item:hover .chevron { opacity: 1; }
.topic-item .info { flex: 1; min-width: 0; }
.topic-item .title { font-size: 0.875rem; font-weight: 500; display: flex; align-items: center; gap: 0.5rem; }
.topic-item .summary { font-size: 0.75rem; color: var(--muted-foreground); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.topic-item-lg { padding: 1rem; gap: 1rem; }
.topic-item-lg .num { font-size: 0.875rem; width: 2rem; }
.topic-item-lg .title { font-size: 1rem; }
.topic-item-lg .summary { font-size: 0.875rem; }
.demo-badge {
  font-size: 9px;
  font-family: 'JetBrains Mono', monospace;
  padding: 0.125rem 0.375rem;
  border-radius: 4px;
  background: color-mix(in oklab, var(--primary) 20%, transparent);
  color: var(--primary-glow);
  text-transform: uppercase;
}
.xp-badge {
  font-size: 0.75rem;
  font-family: 'JetBrains Mono', monospace;
  color: var(--muted-foreground);
  flex-shrink: 0;
}

/* ── Section headers (topic page) ── */
.section-header {
  display: flex;
  align-items: baseline;
  gap: 0.75rem;
  margin-bottom: 1.25rem;
}
.section-icon {
  display: grid;
  place-items: center;
  width: 2rem;
  height: 2rem;
  border-radius: var(--radius);
  background: color-mix(in oklab, var(--primary) 15%, transparent);
  color: var(--primary-glow);
}
.section-title { font-family: 'Space Grotesk', system-ui, sans-serif; font-size: 1.5rem; font-weight: 600; line-height: 1; }
.section-sub { font-size: 0.75rem; color: var(--muted-foreground); margin-top: 0.25rem; }

/* ── Breadcrumb ── */
.breadcrumb {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.75rem;
  color: var(--muted-foreground);
  margin-bottom: 1.5rem;
}
.breadcrumb a:hover { color: var(--foreground); }
.breadcrumb .current { color: var(--foreground); }

/* ── Analogy box ── */
.analogy-box {
  margin-top: 1.25rem;
  padding: 1rem;
  border-radius: calc(var(--radius) + 4px);
  background: color-mix(in oklab, var(--primary) 10%, transparent);
  border: 1px solid color-mix(in oklab, var(--primary) 30%, transparent);
}
.analogy-label {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.75rem;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--primary-glow);
  margin-bottom: 0.5rem;
}

/* ── Step list ── */
.step-list { list-style: none; }
.step-list > li + li { margin-top: 1rem; }
.step-item { display: flex; gap: 1rem; }
.step-num {
  display: grid;
  place-items: center;
  width: 1.75rem;
  height: 1.75rem;
  border-radius: 9999px;
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.75rem;
  font-weight: 600;
  flex-shrink: 0;
  margin-top: 0.125rem;
}
.step-text { font-size: 0.9375rem; color: color-mix(in oklab, var(--foreground) 90%, transparent); line-height: 1.625; }

/* ── Key formulas ── */
.key-formulas {
  margin-top: 1.5rem;
  padding: 1.25rem;
}
.key-formulas-label {
  font-size: 0.75rem;
  font-family: 'JetBrains Mono', monospace;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--muted-foreground);
  margin-bottom: 0.75rem;
}
.key-formulas ul { list-style: none; }
.key-formulas li + li { margin-top: 0.5rem; }

/* ── Quiz cards ── */
.quiz-card {
  padding: 1.25rem;
  border-radius: calc(var(--radius) + 8px);
}
.quiz-card + .quiz-card { margin-top: 1rem; }
.mathbuddy-card {
  padding: 1.25rem;
  border-left: 4px solid var(--primary);
  margin-bottom: 1rem;
}
.mathbuddy-inner {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
}
.mathbuddy-title {
  font-size: 1rem;
  font-weight: 700;
  color: var(--primary-glow);
  margin-bottom: 0.25rem;
}
.mathbuddy-copy {
  margin: 0;
  color: var(--foreground);
  line-height: 1.6;
  font-size: 0.95rem;
}
.mathbuddy-hero-card {
  padding: 1.5rem;
  border-radius: calc(var(--radius) + 8px);
  margin-bottom: 1.5rem;
}
.mathbuddy-hero-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}
.mathbuddy-input-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-top: 1rem;
}
.mathbuddy-panel {
  position: fixed;
  left: 1.25rem;
  bottom: 5.5rem;
  width: min(24rem, calc(100% - 2.5rem));
  max-width: 28rem;
  background: var(--surface-elevated);
  border: 1px solid var(--border);
  border-radius: calc(var(--radius) + 4px);
  padding: 1rem 1rem 1.25rem;
  box-shadow: 0 24px 60px -30px rgba(0, 0, 0, 0.35);
  z-index: 21;
  opacity: 0;
  transform: translateY(1rem);
  pointer-events: none;
  transition: all 0.2s ease;
}
.mathbuddy-panel.open {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}
.mathbuddy-panel-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
}
.mathbuddy-error {
  color: var(--danger);
}
.mathbuddy-answer {
  color: var(--foreground);
}
.mathbuddy-input {
  flex: 1 1 0;
  min-width: 0;
  padding: 0.75rem 1rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--foreground);
}
.mathbuddy-response {
  margin-top: 1rem;
  color: var(--foreground);
  line-height: 1.6;
  font-size: 0.95rem;
}
.mathbuddy-status {
  color: var(--primary-glow);
}
.mathbuddy-error {
  color: var(--warning);
}
.mathbuddy-answer {
  white-space: pre-wrap;
}
.quiz-tag {
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
  padding: 0.125rem 0.625rem;
  border-radius: 9999px;
  font-size: 11px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.quiz-question { font-size: 1rem; font-weight: 500; margin-top: 1rem; color: var(--foreground); }
.quiz-options { display: grid; gap: 0.5rem; margin-top: 1rem; }
@media (min-width: 640px) { .quiz-options.mc-options { grid-template-columns: repeat(2, 1fr); } }
.quiz-option {
  text-align: left;
  padding: 0.75rem 1rem;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--foreground);
  font-size: 0.875rem;
  font-weight: 500;
  transition: all 0.15s;
  cursor: pointer;
  width: 100%;
}
.quiz-option:not(:disabled):hover {
  border-color: color-mix(in oklab, var(--primary) 60%, transparent);
  background: var(--surface-elevated);
}
.quiz-option:disabled { cursor: default; }
.quiz-option.correct { border-color: var(--success); background: color-mix(in oklab, var(--success) 10%, transparent); color: var(--success); }
.quiz-option.wrong { border-color: var(--destructive); background: color-mix(in oklab, var(--destructive) 10%, transparent); color: var(--destructive); }
.quiz-option .letter { font-family: 'JetBrains Mono', monospace; margin-right: 0.5rem; color: var(--muted-foreground); }
.quiz-feedback {
  display: flex;
  gap: 0.5rem;
  padding: 0.75rem;
  border-radius: var(--radius);
  font-size: 0.875rem;
  margin-top: 1rem;
}
.quiz-feedback.correct-fb { background: color-mix(in oklab, var(--success) 10%, transparent); color: var(--success); }
.quiz-feedback.wrong-fb { background: color-mix(in oklab, var(--destructive) 10%, transparent); color: var(--destructive); }
.quiz-feedback .fb-text { color: color-mix(in oklab, var(--foreground) 90%, transparent); }
.quiz-tf-buttons { display: flex; gap: 0.5rem; margin-top: 1rem; }
.quiz-tf-btn { flex: 1; }
.challenge-card { border-left: 4px solid var(--warning); }
.challenge-hint {
  padding: 0.75rem;
  border-radius: var(--radius);
  background: color-mix(in oklab, var(--warning) 10%, transparent);
  border: 1px solid color-mix(in oklab, var(--warning) 30%, transparent);
  font-size: 0.875rem;
  margin-top: 1rem;
}
.challenge-solution {
  padding: 0.75rem;
  border-radius: var(--radius);
  background: color-mix(in oklab, var(--success) 10%, transparent);
  border: 1px solid color-mix(in oklab, var(--success) 30%, transparent);
  font-size: 0.875rem;
  margin-top: 0.5rem;
}

/* ── Why learn list ── */
.why-learn-grid { display: grid; gap: 0.75rem; }
@media (min-width: 640px) { .why-learn-grid { grid-template-columns: repeat(2, 1fr); } }
.why-learn-item {
  padding: 1rem;
  border-radius: calc(var(--radius) + 4px);
  background: var(--surface);
  border: 1px solid var(--border);
  font-size: 0.875rem;
  line-height: 1.625;
  color: color-mix(in oklab, var(--foreground) 90%, transparent);
}

/* ── Complete banner ── */
.complete-banner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-top: 2.5rem;
}

/* ── Nav row ── */
.nav-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.75rem;
  margin-top: 2rem;
}
.nav-card {
  transition: all 0.15s;
}
.nav-card:hover { border-color: color-mix(in oklab, var(--primary) 50%, transparent); }
.nav-card .dir { display: flex; align-items: center; gap: 0.5rem; font-size: 0.75rem; color: var(--muted-foreground); }
.nav-card .nav-title { font-weight: 500; margin-top: 0.25rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ── Placeholder topic ── */
.placeholder-box {
  text-align: center;
}
.placeholder-icon {
  display: grid;
  place-items: center;
  width: 3rem;
  height: 3rem;
  border-radius: calc(var(--radius) + 4px);
  background: color-mix(in oklab, var(--warning) 15%, transparent);
  color: var(--warning);
  margin: 0 auto 1rem;
}

/* ── Conquistas / Stats ── */
.stat-card {
  padding: 1.25rem;
}
.stat-card .stat-label {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--muted-foreground);
  margin-bottom: 0.75rem;
}
.stat-card .stat-value {
  font-family: 'Space Grotesk', system-ui, sans-serif;
  font-size: 2.25rem;
  font-weight: 600;
}
.badge-circle {
  width: 5rem;
  height: 5rem;
  margin: 0 auto;
  border-radius: 9999px;
  display: grid;
  place-items: center;
  margin-bottom: 1rem;
  transition: all 0.3s;
}

/* ── Responsive ── */
@media (max-width: 639px) {
  .hide-mobile { display: none !important; }
  .text-5xl { font-size: 2.25rem; }
  .text-7xl { font-size: 3rem; }
}
@media (min-width: 640px) and (max-width: 767px) {
  .text-5xl { font-size: 2.5rem; }
}

/* ── KaTeX overrides ── */
.katex { font-size: 1.05em; }
.katex-display {
  margin: 1.25rem 0;
  padding: 1rem;
  background: var(--surface);
  border-radius: var(--radius);
  border: 1px solid var(--border);
  overflow-x: auto;
}

/* ── SVG icons (inline) ── */
.icon {
  display: inline-block;
  width: 1em;
  height: 1em;
  vertical-align: -0.125em;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.icon-sm { width: 0.875rem; height: 0.875rem; }
.icon-md { width: 1rem; height: 1rem; }
.icon-lg { width: 1.25rem; height: 1.25rem; }
.icon-xl { width: 1.5rem; height: 1.5rem; }

/* ── Overflow ── */
.overflow-hidden { overflow: hidden; }

/* ── Animations ── */
.animate-pulse { animation: pulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite; }

/* ── Ad banner (Minecraft) ── */
#ad-banner { margin: 2rem auto; max-width: 64rem; padding: 0 1rem; }
.ad-card {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 1.25rem;
  align-items: center;
  padding: 1.25rem 1.5rem;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: linear-gradient(135deg, color-mix(in oklab, var(--level-1) 18%, var(--card)), var(--card));
  box-shadow: 0 10px 30px -18px color-mix(in oklab, var(--primary) 40%, transparent);
}
.ad-emoji { font-size: 2.5rem; line-height: 1; }
.ad-img { width: 64px; height: 64px; object-fit: cover; border-radius: 0.5rem; }
.ad-tag {
  display: inline-block; font-size: 0.7rem; letter-spacing: 0.12em;
  text-transform: uppercase; color: var(--muted-foreground); margin-bottom: 0.25rem;
}
.ad-title { font-weight: 600; font-size: 1.05rem; }
.ad-sub { color: var(--muted-foreground); font-size: 0.9rem; margin-top: 0.15rem; }
.ad-meta { display: flex; flex-wrap: wrap; gap: 0.5rem; margin-top: 0.6rem; }
.ad-pill {
  font-size: 0.78rem; padding: 0.2rem 0.55rem; border-radius: 9999px;
  background: var(--surface); border: 1px solid var(--border);
}
.ad-pill code { font-family: ui-monospace, monospace; color: var(--foreground); }
.ad-actions { display: flex; flex-direction: column; gap: 0.4rem; }
@media (max-width: 640px) {
  .ad-card { grid-template-columns: 1fr; text-align: left; }
  .ad-actions { flex-direction: row; }
}

/* ── Editor ── */
.editor-tabs { display: flex; gap: 0.5rem; margin: 1.5rem 0; flex-wrap: wrap; }
.editor-tab {
  padding: 0.5rem 1rem; border-radius: 0.5rem; cursor: pointer;
  border: 1px solid var(--border); background: var(--surface); color: var(--foreground);
  font: inherit;
}
.editor-tab.active { background: var(--primary); color: var(--primary-foreground); border-color: var(--primary); }
.editor-panel { display: none; }
.editor-panel.active { display: block; }
.editor-field { display: block; margin-bottom: 1rem; }
.editor-field label { display: block; font-size: 0.8rem; color: var(--muted-foreground); margin-bottom: 0.3rem; text-transform: uppercase; letter-spacing: 0.08em; }
.editor-field input, .editor-field textarea, .editor-field select {
  width: 100%; padding: 0.6rem 0.8rem; border-radius: 0.5rem;
  background: var(--surface); border: 1px solid var(--border); color: var(--foreground);
  font: inherit; font-size: 0.95rem;
}
.editor-field textarea { min-height: 6rem; resize: vertical; font-family: inherit; }
.editor-card {
  padding: 1.25rem; border-radius: var(--radius); border: 1px solid var(--border);
  background: var(--card); margin-bottom: 1rem;
}
.editor-toolbar {
  position: sticky; top: 0; z-index: 10;
  background: color-mix(in oklab, var(--background) 92%, transparent);
  backdrop-filter: blur(10px); padding: 1rem 0; border-bottom: 1px solid var(--border);
  display: flex; gap: 0.5rem; flex-wrap: wrap; align-items: center;
}
.editor-saved { color: var(--success); font-size: 0.85rem; }

.logo-text.font-display {
    font-size: 32px; /* Altere o número para o tamanho desejado */
}

/* ── Ajuste do espaçamento do Logo ── */
.logo {
  display: flex;
  align-items: center;
  gap: 8px; /* Controla o espaço geral entre a imagem e o texto */
}

.logo-text {
  margin-left: -28px; /* Move o texto ainda mais para a esquerda, aproximando da imagem */
}
