:root {
  --bg-primary: #1a1410;
  --bg-secondary: #231c16;
  --bg-card: #2d231c;
  --bg-hover: #3d3026;
  --bg-elevated: #4a392b;
  --text-primary: #f0e6d3;
  --text-secondary: #c4b49a;
  --text-muted: #8a7a66;
  --accent: #aed581;
  --accent-dim: #8bc34a;
  --accent-glow: rgba(174, 213, 129, 0.12);
  --accent-orange: #d4a373;
  --accent-blue: #7ec8e3;
  --accent-purple: #c3aed6;
  --accent-pink: #e8a0bf;
  --border: #3d3026;
  --border-light: #4a392b;
  --danger: #e57373;
  --success: #aed581;
  --warning: #d4a373;
  --info: #7ec8e3;
  --font-mono: 'JetBrains Mono', 'Fira Code', 'Cascadia Code', 'IBM Plex Mono', monospace;
  --font-sans: 'Inter', 'SF Pro Display', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 16px;
  --radius-xl: 24px;
  --shadow-sm: 0 2px 8px rgba(0,0,0,0.4);
  --shadow-md: 0 4px 20px rgba(0,0,0,0.5);
  --shadow-lg: 0 8px 40px rgba(0,0,0,0.6);
  --transition: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

[data-theme="light"] {
  --bg-primary: #faf6f0;
  --bg-secondary: #ffffff;
  --bg-card: #ffffff;
  --bg-hover: #f0ebe4;
  --bg-elevated: #e8e0d6;
  --text-primary: #2d231c;
  --text-secondary: #6b5d4f;
  --text-muted: #9a8a78;
  --accent: #689f38;
  --accent-dim: #558b2f;
  --accent-glow: rgba(104, 159, 56, 0.1);
  --border: #d4c9bc;
  --border-light: #e0d6c8;
  --shadow-sm: 0 2px 8px rgba(0,0,0,0.06);
  --shadow-md: 0 4px 20px rgba(0,0,0,0.08);
  --shadow-lg: 0 8px 40px rgba(0,0,0,0.1);
}

*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; }

body {
  font-family: var(--font-sans);
  background: var(--bg-primary);
  color: var(--text-primary);
  line-height: 1.7;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  font-weight: 400;
  font-size: 16px;
}

::selection { background: var(--accent); color: var(--bg-primary); }

::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-track { background: var(--bg-secondary); }
::-webkit-scrollbar-thumb { background: var(--border-light); border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: var(--text-muted); }

a { color: var(--accent); text-decoration: none; transition: color var(--transition); }
a:hover { color: var(--accent-dim); }
img { max-width: 100%; height: auto; }

code, pre, kbd, samp {
  font-family: var(--font-mono);
  font-size: 0.88em;
  font-weight: 400;
}

.navbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1000;
  background: rgba(26, 20, 16, 0.88);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  border-bottom: 1px solid var(--border);
  transition: background var(--transition);
}

[data-theme="light"] .navbar {
  background: rgba(250, 246, 240, 0.88);
}

.nav-inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 24px;
  height: 64px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.nav-logo {
  display: flex;
  align-items: center;
  gap: 2px;
  font-family: var(--font-mono);
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--text-primary);
}

.logo-bracket { color: var(--text-muted); }
.logo-text { color: var(--accent); }

.nav-links {
  display: flex;
  align-items: center;
  gap: 6px;
}

.nav-link {
  padding: 7px 16px;
  border-radius: var(--radius-sm);
  font-size: 0.88rem;
  font-weight: 500;
  color: var(--text-secondary);
  transition: all var(--transition);
  letter-spacing: 0.01em;
}

.nav-link:hover, .nav-link.active {
  color: var(--text-primary);
  background: var(--bg-hover);
}

.nav-toggle {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  padding: 8px;
  flex-direction: column;
  gap: 5px;
}

.nav-toggle span {
  display: block;
  width: 22px;
  height: 2px;
  background: var(--text-primary);
  border-radius: 2px;
  transition: all var(--transition);
}

.theme-toggle {
  background: none;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 6px 8px;
  cursor: pointer;
  color: var(--text-secondary);
  transition: all var(--transition);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-left: 10px;
}

.theme-toggle:hover {
  color: var(--accent);
  border-color: var(--accent);
}

[data-theme="dark"] .sun-icon { display: block; }
[data-theme="dark"] .moon-icon { display: none; }
[data-theme="light"] .sun-icon { display: none; }
[data-theme="light"] .moon-icon { display: block; }

#app { padding-top: 64px; min-height: 100vh; }

.page { display: none; }
.page.active { display: block; animation: fadeIn 0.45s ease; }

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes slideUp {
  from { opacity: 0; transform: translateY(30px); }
  to { opacity: 1; transform: translateY(0); }
}

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

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

@keyframes gradientShift {
  0% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
  100% { background-position: 0% 50%; }
}

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

.section {
  max-width: 1200px;
  margin: 0 auto;
  padding: 64px 24px;
}

.section-title {
  font-size: 2.4rem;
  font-weight: 700;
  text-align: center;
  margin-bottom: 8px;
  letter-spacing: -0.02em;
  color: var(--text-primary);
}

.section-desc {
  text-align: center;
  color: var(--text-secondary);
  max-width: 620px;
  margin: 0 auto 44px;
  font-size: 1.08rem;
  line-height: 1.6;
}

.hero {
  max-width: 1200px;
  margin: 0 auto;
  padding: 80px 24px 48px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 64px;
  align-items: center;
  min-height: calc(100vh - 64px);
}

.hero-content { animation: slideUp 0.6s ease; }

.terminal-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 6px 18px;
  margin-bottom: 28px;
  font-family: var(--font-mono);
  font-size: 0.78rem;
  color: var(--text-muted);
}

.badge-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--success);
  animation: pulse 2s infinite;
}

.hero-title {
  font-size: 3.8rem;
  font-weight: 800;
  line-height: 1.08;
  margin-bottom: 20px;
  letter-spacing: -0.03em;
}

.gradient-text {
  background: linear-gradient(135deg, var(--accent), #d4a373, var(--accent-blue));
  background-size: 200% 200%;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  animation: gradientShift 5s ease infinite;
}

.hero-subtitle {
  font-size: 1.15rem;
  color: var(--text-secondary);
  line-height: 1.7;
  margin-bottom: 36px;
  max-width: 540px;
}

.hero-stats {
  display: flex;
  gap: 36px;
  margin-bottom: 40px;
}

.stat { text-align: center; }
.stat-number {
  display: block;
  font-size: 1.9rem;
  font-weight: 700;
  font-family: var(--font-mono);
  color: var(--accent);
}
.stat-label {
  font-size: 0.78rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.hero-actions { display: flex; gap: 14px; flex-wrap: wrap; }

.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 26px;
  border-radius: var(--radius-md);
  font-family: var(--font-sans);
  font-size: 0.9rem;
  font-weight: 600;
  border: none;
  cursor: pointer;
  transition: all var(--transition);
  text-decoration: none;
}

.btn-primary {
  background: var(--accent);
  color: var(--bg-primary);
}
.btn-primary:hover {
  background: var(--accent-dim);
  box-shadow: 0 0 32px var(--accent-glow);
  transform: translateY(-2px);
  color: var(--bg-primary);
}

.btn-secondary {
  background: var(--bg-card);
  color: var(--text-primary);
  border: 1px solid var(--border);
}
.btn-secondary:hover {
  background: var(--bg-hover);
  border-color: var(--accent);
  color: var(--text-primary);
  transform: translateY(-2px);
}

.btn-small {
  padding: 6px 14px;
  font-size: 0.8rem;
  border-radius: var(--radius-sm);
}

.btn-back {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  cursor: pointer;
  font-size: 0.85rem;
  font-weight: 500;
  transition: all var(--transition);
  margin-bottom: 28px;
}

.btn-back:hover {
  color: var(--text-primary);
  border-color: var(--accent);
}

.hero-visual { animation: slideUp 0.6s ease 0.2s both; }

.code-window {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-lg);
  transform: perspective(1000px) rotateY(-3deg) rotateX(2deg);
  transition: transform 0.4s ease;
}

.code-window:hover {
  transform: perspective(1000px) rotateY(0deg) rotateX(0deg);
}

.window-header {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 16px;
  background: var(--bg-elevated);
  border-bottom: 1px solid var(--border);
}

.dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
}
.dot.close { background: #e57373; }
.dot.minimize { background: #d4a373; }
.dot.maximize { background: var(--accent); }

.window-title {
  margin-left: auto;
  font-size: 0.78rem;
  color: var(--text-muted);
  font-family: var(--font-mono);
}

.window-body {
  padding: 20px;
  overflow-x: auto;
  font-size: 0.88rem;
  line-height: 1.6;
}

.window-body .kw { color: var(--accent-orange); }
.window-body .str { color: var(--accent); }
.window-body .fn { color: var(--accent-blue); }
.window-body .k { color: var(--accent-purple); }
.window-body .num { color: var(--accent-pink); }

.window-footer {
  padding: 10px 16px;
  background: var(--bg-elevated);
  border-top: 1px solid var(--border);
  font-family: var(--font-mono);
  font-size: 0.78rem;
  display: flex;
  gap: 8px;
}

.output-label { color: var(--text-muted); }

.typing-line {
  display: inline-flex;
  align-items: center;
  color: var(--accent);
}

.typing-text {
  overflow: hidden;
  white-space: nowrap;
  border-right: 2px solid var(--accent);
  animation: typing 2s steps(20) 1s forwards;
  width: 0;
}

.typing-cursor {
  display: inline-block;
  width: 2px;
  height: 1.1em;
  background: var(--accent);
  margin-left: 2px;
  animation: cursorBlink 0.8s step-end infinite;
}

@keyframes typing {
  from { width: 0; }
  to { width: 100%; }
}

.level-grid { display: grid; gap: 10px; }

.level-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 26px;
  cursor: pointer;
  transition: all var(--transition);
  animation: slideUp 0.4s ease both;
}

.level-card:hover {
  border-color: var(--accent);
  background: var(--bg-hover);
  transform: translateX(6px);
  box-shadow: var(--shadow-sm);
}

.level-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
}

.level-name {
  font-size: 1.12rem;
  font-weight: 600;
  color: var(--text-primary);
}

.level-range {
  font-size: 0.8rem;
  color: var(--text-muted);
  font-family: var(--font-mono);
}

.level-desc {
  font-size: 0.9rem;
  color: var(--text-secondary);
  margin-bottom: 14px;
  line-height: 1.6;
}

.level-modules {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.module-chip {
  padding: 3px 12px;
  background: var(--bg-hover);
  border-radius: 12px;
  font-size: 0.75rem;
  color: var(--text-muted);
  font-family: var(--font-mono);
  transition: all var(--transition);
}

.level-card:hover .module-chip {
  background: var(--accent-glow);
  color: var(--accent);
}

.features-section {
  padding: 80px 24px;
  background: var(--bg-secondary);
}

.features-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 24px;
  max-width: 1200px;
  margin: 0 auto;
}

.feature-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 34px;
  transition: all var(--transition);
}

.feature-card:hover {
  border-color: var(--accent);
  transform: translateY(-4px);
  box-shadow: var(--shadow-md);
}

.feature-icon {
  font-size: 2rem;
  margin-bottom: 16px;
}

.feature-card h3 {
  font-size: 1.12rem;
  font-weight: 600;
  margin-bottom: 8px;
  color: var(--text-primary);
}

.feature-card p {
  font-size: 0.9rem;
  color: var(--text-secondary);
  line-height: 1.6;
}

.module-filters {
  display: flex;
  gap: 8px;
  justify-content: center;
  margin-bottom: 36px;
  flex-wrap: wrap;
}

.filter-btn {
  padding: 8px 22px;
  border: 1px solid var(--border);
  border-radius: 20px;
  background: var(--bg-card);
  color: var(--text-secondary);
  cursor: pointer;
  font-size: 0.85rem;
  font-weight: 500;
  transition: all var(--transition);
}

.filter-btn:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.filter-btn.active {
  background: var(--accent);
  color: var(--bg-primary);
  border-color: var(--accent);
}

.module-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 24px;
  margin-bottom: 12px;
  cursor: pointer;
  transition: all var(--transition);
  animation: slideUp 0.4s ease both;
}

.module-card:hover {
  border-color: var(--accent);
  background: var(--bg-hover);
  transform: translateX(6px);
  box-shadow: var(--shadow-sm);
}

.module-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
}

.module-num {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: var(--accent);
}

.module-name {
  font-size: 1.08rem;
  font-weight: 600;
  color: var(--text-primary);
}

.module-desc {
  font-size: 0.9rem;
  color: var(--text-secondary);
  line-height: 1.6;
}

.module-content {
  max-width: 900px;
  margin: 0 auto;
}

.module-content h1 {
  font-size: 2rem;
  margin: 28px 0 14px;
  color: var(--text-primary);
}

.module-content h2 {
  font-size: 1.5rem;
  margin: 28px 0 12px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--border);
  color: var(--text-primary);
}

.module-content h3 {
  font-size: 1.2rem;
  margin: 24px 0 10px;
  color: var(--text-primary);
}

.module-content p {
  margin-bottom: 18px;
  color: var(--text-secondary);
  line-height: 1.7;
}

.module-content ul, .module-content ol {
  margin: 12px 0 18px 24px;
  color: var(--text-secondary);
}

.module-content li { margin-bottom: 8px; }
.module-content strong { color: var(--text-primary); }

.module-content pre {
  background: #0d0a08 !important;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 18px;
  overflow-x: auto;
  margin: 18px 0;
  font-size: 0.85rem;
  line-height: 1.5;
}

.module-content code {
  background: var(--bg-hover);
  padding: 2px 7px;
  border-radius: 4px;
  font-size: 0.85em;
}

.module-content pre code {
  background: none;
  padding: 0;
}

.module-content blockquote {
  border-left: 3px solid var(--accent);
  padding: 14px 24px;
  margin: 18px 0;
  background: var(--bg-card);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  color: var(--text-secondary);
}

.c-source-list {
  display: grid;
  gap: 10px;
  margin-top: 20px;
}

.c-source-item {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  overflow: hidden;
  transition: all var(--transition);
}

.c-source-item:hover {
  border-color: var(--accent);
}

.c-source-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 18px;
  cursor: pointer;
  background: var(--bg-hover);
  border-bottom: 1px solid var(--border);
  transition: background var(--transition);
}

.c-source-header:hover {
  background: var(--bg-elevated);
}

.c-source-name {
  font-family: var(--font-mono);
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--accent);
}

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

.c-source-desc {
  padding: 16px 18px;
  font-size: 0.88rem;
  color: var(--text-secondary);
  line-height: 1.6;
  border-bottom: 1px solid var(--border);
}

.c-source-code {
  display: none;
  background: #0d0a08;
  border-top: 1px solid var(--border);
}

.c-source-code.open {
  display: block;
}

.c-source-code pre {
  padding: 16px 18px;
  overflow-x: auto;
  font-size: 0.82rem;
  line-height: 1.5;
  margin: 0;
  color: var(--text-secondary);
}

.c-source-code .code-lang-label {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 18px;
  background: var(--bg-elevated);
  font-size: 0.72rem;
  color: var(--text-muted);
  font-family: var(--font-mono);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.load-in-editor-btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 12px;
  background: var(--accent-glow);
  border: 1px solid var(--accent);
  border-radius: var(--radius-sm);
  color: var(--accent);
  font-family: var(--font-mono);
  font-size: 0.75rem;
  cursor: pointer;
  transition: all var(--transition);
}

.load-in-editor-btn:hover {
  background: var(--accent);
  color: var(--bg-primary);
}

.editor-tabs {
  display: flex;
  align-items: center;
  gap: 2px;
  padding: 0 4px;
  overflow-x: auto;
  background: var(--bg-card);
  border-bottom: 1px solid var(--border);
  min-height: 36px;
}

.file-tab {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 14px;
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: var(--text-muted);
  cursor: pointer;
  border-bottom: 2px solid transparent;
  transition: all var(--transition);
  white-space: nowrap;
}

.file-tab:hover {
  color: var(--text-primary);
  background: var(--bg-hover);
}

.file-tab.active {
  color: var(--accent);
  border-bottom-color: var(--accent);
  background: var(--accent-glow);
}

.tab-placeholder {
  padding: 7px 14px;
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: var(--text-muted);
}

.tab-close {
  font-size: 1.1rem;
  line-height: 1;
  opacity: 0.5;
  transition: opacity var(--transition);
}

.tab-close:hover { opacity: 1; }

.playground-container {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  height: calc(100vh - 280px);
  min-height: 520px;
}

.editor-panel {
  display: flex;
  flex-direction: column;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  overflow: hidden;
}

.editor-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 14px;
  background: var(--bg-elevated);
  border-bottom: 1px solid var(--border);
}

.editor-title {
  font-family: var(--font-mono);
  font-size: 0.82rem;
  color: var(--text-muted);
}

.editor-actions { display: flex; gap: 6px; }

.CodeMirror {
  height: 100% !important;
  font-family: var(--font-mono) !important;
  font-size: 14px !important;
  line-height: 1.6 !important;
}

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

.cm-s-dracula.CodeMirror { background: var(--bg-card) !important; }
.cm-s-dracula .CodeMirror-gutters { background: var(--bg-card) !important; }
.cm-s-dracula .CodeMirror-cursor { border-left: 2px solid var(--accent) !important; }

.editor-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 14px;
  background: var(--bg-elevated);
  border-top: 1px solid var(--border);
  gap: 12px;
  flex-wrap: wrap;
}

.compiler-options {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.8rem;
  color: var(--text-muted);
  flex-wrap: wrap;
}

.compiler-options select {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 4px 8px;
  color: var(--text-primary);
  font-family: var(--font-mono);
  font-size: 0.8rem;
  cursor: pointer;
}

.btn-compile {
  padding: 8px 22px;
  font-size: 0.85rem;
}

.output-panel {
  display: flex;
  flex-direction: column;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  overflow: hidden;
}

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

.output-title {
  font-weight: 600;
  font-size: 0.85rem;
  color: var(--text-primary);
}

.output-header-actions {
  display: flex;
  gap: 6px;
}

.output-content {
  flex: 1;
  padding: 16px;
  overflow-y: auto;
  font-family: var(--font-mono);
  font-size: 0.85rem;
  line-height: 1.6;
  white-space: pre-wrap;
  word-break: break-all;
  background: #0d0a08;
}

[data-theme="light"] .output-content { background: #f5f0ea; }

.output-placeholder {
  color: var(--text-muted);
  display: flex;
  gap: 8px;
  align-items: center;
}

.prompt-symbol { color: var(--accent); }
.prompt-text { font-style: italic; }

.output-status {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 14px;
  background: var(--bg-elevated);
  border-top: 1px solid var(--border);
  font-size: 0.8rem;
}

.status-indicator {
  width: 8px;
  height: 8px;
  border-radius: 50%;
}
.status-indicator.idle { background: var(--text-muted); }
.status-indicator.running { background: var(--warning); animation: pulse 1s infinite; }
.status-indicator.success { background: var(--success); }
.status-indicator.error { background: var(--danger); }

.status-text { color: var(--text-muted); }

.output-line { margin-bottom: 2px; }
.output-line.stdout { color: var(--text-primary); }
.output-line.stderr { color: var(--danger); }
.output-line.system { color: var(--text-muted); font-style: italic; }
.output-line.error-line { color: var(--danger); font-weight: 500; }
.output-line.warning-line { color: var(--warning); }

.about-grid {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 44px;
  max-width: 1000px;
  margin: 0 auto;
}

.about-content p {
  color: var(--text-secondary);
  margin-bottom: 20px;
  line-height: 1.7;
}

.about-content h3 {
  margin: 28px 0 14px;
  color: var(--text-primary);
}

.about-content ul {
  margin: 12px 0 24px 24px;
  color: var(--text-secondary);
}

.about-content li { margin-bottom: 8px; }

.about-stats-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 26px;
  height: fit-content;
  position: sticky;
  top: 88px;
}

.about-stats-card h3 {
  margin-bottom: 16px;
  font-size: 1.12rem;
  color: var(--text-primary);
}

.repo-stats { display: flex; flex-direction: column; gap: 12px; }

.repo-stat {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 0;
  border-bottom: 1px solid var(--border);
}

.repo-stat:last-child { border-bottom: none; }

.repo-stat-label {
  font-size: 0.85rem;
  color: var(--text-muted);
}

.repo-stat-value {
  font-weight: 600;
  font-family: var(--font-mono);
  font-size: 0.9rem;
  color: var(--text-primary);
}

.footer {
  border-top: 1px solid var(--border);
  padding: 36px 24px;
  text-align: center;
}

.footer-inner {
  max-width: 1200px;
  margin: 0 auto;
}

.footer-links {
  display: flex;
  justify-content: center;
  gap: 28px;
  margin-bottom: 12px;
}

.footer-links a {
  color: var(--text-muted);
  font-size: 0.85rem;
}

.footer-links a:hover { color: var(--accent); }

.footer-text {
  font-size: 0.8rem;
  color: var(--text-muted);
}

.loading-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 80px 20px;
  gap: 16px;
}

.loader {
  width: 40px;
  height: 40px;
  border: 3px solid var(--border);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

.loading-container p {
  color: var(--text-muted);
  font-size: 0.9rem;
}

.error-container {
  text-align: center;
  padding: 60px 20px;
}

.error-container h3 {
  font-size: 1.3rem;
  margin-bottom: 8px;
  color: var(--danger);
}

.error-container p {
  color: var(--text-secondary);
  font-size: 0.9rem;
}

.toast-container {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.toast {
  padding: 12px 20px;
  border-radius: var(--radius-sm);
  font-size: 0.85rem;
  animation: slideUp 0.3s ease;
  box-shadow: var(--shadow-md);
  max-width: 400px;
}

.toast.success { background: var(--success); color: #1a1410; }
.toast.error { background: var(--danger); color: #1a1410; }
.toast.info { background: var(--info); color: #1a1410; }
.toast.warning { background: var(--warning); color: #1a1410; }

.back-to-top {
  position: fixed;
  bottom: 80px;
  right: 24px;
  z-index: 999;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: var(--bg-card);
  border: 1px solid var(--border);
  color: var(--text-secondary);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  visibility: hidden;
  transition: all var(--transition);
  box-shadow: var(--shadow-sm);
}

.back-to-top.visible {
  opacity: 1;
  visibility: visible;
}

.back-to-top:hover {
  background: var(--accent);
  color: var(--bg-primary);
  border-color: var(--accent);
}

@media (max-width: 900px) {
  .hero {
    grid-template-columns: 1fr;
    gap: 44px;
    padding-top: 48px;
    min-height: auto;
  }

  .hero-title { font-size: 2.6rem; }
  .hero-stats { gap: 24px; }
  .hero-visual { max-width: 500px; margin: 0 auto; }
  .code-window { transform: none; }
  .code-window:hover { transform: none; }

  .playground-container {
    grid-template-columns: 1fr;
    height: auto;
    min-height: auto;
  }

  .editor-panel, .output-panel { min-height: 400px; }

  .about-grid { grid-template-columns: 1fr; }
  .about-stats-card { position: static; }
  .section-title { font-size: 1.9rem; }
}

@media (max-width: 640px) {
  .nav-links {
    position: fixed;
    top: 64px;
    left: 0;
    right: 0;
    background: var(--bg-primary);
    border-bottom: 1px solid var(--border);
    flex-direction: column;
    padding: 16px;
    gap: 4px;
    display: none;
  }

  .nav-links.open { display: flex; }
  .nav-toggle { display: flex; }
  .nav-link { width: 100%; padding: 10px 14px; }
  .theme-toggle { margin-left: auto; }

  .hero-title { font-size: 2.2rem; }
  .hero-subtitle { font-size: 1rem; }
  .hero-stats { flex-wrap: wrap; gap: 16px; }
  .stat { flex: 1; min-width: 80px; }

  .features-grid { grid-template-columns: 1fr; }
  .hero-actions { flex-direction: column; }
  .hero-actions .btn { width: 100%; justify-content: center; }

  .section-title { font-size: 1.6rem; }
  .section { padding: 40px 16px; }
  .hero { padding: 36px 16px 28px; }
  .features-section { padding: 40px 16px; }

  .editor-footer { flex-direction: column; align-items: stretch; }
  .compiler-options { justify-content: center; }
  .btn-compile { width: 100%; justify-content: center; }
  .footer-links { flex-wrap: wrap; gap: 16px; }
}
