/* === Nav === */
nav {
  position: sticky; top: 0; z-index: 100;
  background: rgba(10,10,15,0.92);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
  padding: 0 24px;
}
.nav-inner {
  max-width: 1100px; margin: 0 auto;
  display: flex; align-items: center; gap: 8px;
  height: 52px;
}
.nav-brand {
  font-weight: 800; font-size: 1.1rem; color: var(--text);
  text-decoration: none; margin-right: 24px;
}
.nav-brand span { color: var(--accent2); }
.nav-link {
  color: var(--text2); text-decoration: none;
  font-size: 0.88rem; padding: 6px 14px; border-radius: 6px;
  transition: all 0.2s;
}
.nav-link:hover, .nav-link.active { color: var(--text); background: var(--bg3); }

/* Page header */
.page-header {
  padding: 64px 0 40px;
  text-align: center;
  border-bottom: 1px solid var(--border);
}
.page-header h1 { font-size: 2.4rem; font-weight: 800; }
.page-header h1 span { color: var(--accent2); }
.page-header p { color: var(--text2); margin-top: 8px; font-size: 1.05rem; }

/* Content sections */
.content-section {
  padding: 64px 0;
  border-bottom: 1px solid var(--border);
}
.content-section.alt { background: var(--bg2); }
.content-section h2 { text-align: left; margin-bottom: 24px; }

/* Cards */
.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 20px;
}
.card {
  background: var(--bg3);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  transition: border-color 0.2s;
}
.card:hover { border-color: var(--accent); }
.card h3 { font-size: 1.1rem; margin-bottom: 4px; }
.card .card-badge {
  display: inline-block;
  font-size: 0.7rem; padding: 2px 10px; border-radius: 10px;
  font-weight: 700; margin-left: 8px; vertical-align: middle;
}
.badge-green { background: rgba(0,210,160,0.15); color: var(--green); }
.badge-yellow { background: rgba(254,202,87,0.15); color: var(--orange); }
.badge-orange { background: rgba(255,159,67,0.15); color: #ff9f43; }
.badge-red { background: rgba(255,107,107,0.15); color: var(--red); }
.card p { color: var(--text2); font-size: 0.88rem; margin-top: 8px; line-height: 1.6; }
.card .card-meta { font-size: 0.78rem; color: var(--text2); margin-top: 10px; }
.card .card-meta span { margin-right: 12px; }

/* Feature list */
.feature-list {
  list-style: none;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 10px;
}
.feature-list li {
  font-size: 0.9rem; color: var(--text2);
  padding: 6px 0;
}
.feature-list li::before { content: "▸ "; color: var(--accent2); }

/* Spec table */
.spec-table {
  width: 100%; border-collapse: collapse;
  font-size: 0.9rem;
}
.spec-table th, .spec-table td {
  text-align: left; padding: 10px 16px;
  border-bottom: 1px solid var(--border);
}
.spec-table th { color: var(--text2); font-weight: 600; font-size: 0.8rem; text-transform: uppercase; }
.spec-table td { color: var(--text); }
.spec-table tr:hover td { background: rgba(108,92,231,0.04); }

/* Info box */
.info-box {
  background: var(--bg3);
  border: 1px solid var(--border);
  border-left: 3px solid var(--accent);
  border-radius: 0 var(--radius) var(--radius) 0;
  padding: 20px 24px;
  margin: 20px 0;
}
.info-box h4 { font-size: 0.9rem; color: var(--accent2); margin-bottom: 6px; }
.info-box p, .info-box li { font-size: 0.88rem; color: var(--text2); line-height: 1.7; }

/* Two column */
.two-col {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 32px;
  align-items: start;
}

/* Page content max-width paragraphs */
.content-section p, .content-section .spec-table, .content-section .info-box {
  max-width: 900px;
}

/* Home hero cards */
.home-cards {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
  margin-top: 40px;
}
.home-card {
  background: var(--bg3);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 28px;
  text-decoration: none;
  transition: all 0.25s;
  display: block;
}
.home-card:hover { border-color: var(--accent); transform: translateY(-2px); }
.home-card .icon { font-size: 2rem; margin-bottom: 12px; }
.home-card h3 { color: var(--text); margin-bottom: 6px; }
.home-card p { color: var(--text2); font-size: 0.9rem; line-height: 1.6; }

/* === Reset & Base === */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --bg: #0a0a0f;
  --bg2: #111118;
  --bg3: #1a1a24;
  --border: #2a2a3a;
  --text: #c8c8d4;
  --text2: #8888a0;
  --accent: #6c5ce7;
  --accent2: #a29bfe;
  --green: #00d2a0;
  --blue: #54a0ff;
  --orange: #feca57;
  --red: #ff6b6b;
  --cyan: #00d2d3;
  --pink: #e84393;
  --radius: 8px;
  --font-mono: 'SF Mono', 'Fira Code', 'Cascadia Code', monospace;
}

html { scroll-behavior: smooth; }

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  overflow-x: hidden;
}

.container { max-width: 1100px; margin: 0 auto; padding: 0 24px; }

h2 { font-size: 2rem; font-weight: 700; text-align: center; margin-bottom: 8px; }
h3 { font-size: 1.15rem; font-weight: 600; }
.section-desc { text-align: center; color: var(--text2); margin-bottom: 40px; font-size: 1.05rem; }
.section-hint { text-align: center; color: var(--text2); margin-top: 16px; font-size: 0.9rem; }

/* === Hero === */
.hero {
  position: relative;
  padding: 100px 0 80px;
  text-align: center;
  background: radial-gradient(ellipse 80% 60% at 50% 0%, rgba(108,92,231,0.12), transparent 70%),
              radial-gradient(ellipse 40% 50% at 80% 80%, rgba(0,210,160,0.08), transparent 70%);
  border-bottom: 1px solid var(--border);
  overflow: hidden;
}

.hero-badge {
  display: inline-block;
  background: var(--bg3);
  border: 1px solid var(--border);
  padding: 4px 14px;
  border-radius: 20px;
  font-size: 0.85rem;
  color: var(--accent2);
  margin-bottom: 24px;
  font-family: var(--font-mono);
}

.hero h1 { font-size: 3.8rem; font-weight: 800; letter-spacing: -1px; }
.hero h1 span { color: var(--accent2); }

.hero-tagline {
  font-size: 1.2rem;
  color: var(--text);
  margin: 16px 0 12px;
  font-weight: 500;
}

.hero-desc {
  color: var(--text2);
  font-size: 1rem;
  max-width: 640px;
  margin: 0 auto 32px;
  line-height: 1.8;
}

.hero-actions { display: flex; gap: 16px; justify-content: center; flex-wrap: wrap; }

.btn {
  display: inline-block;
  padding: 12px 28px;
  border-radius: var(--radius);
  font-size: 0.95rem;
  font-weight: 600;
  text-decoration: none;
  transition: all 0.2s;
  cursor: pointer;
}

.btn-primary {
  background: var(--accent);
  color: #fff;
  border: none;
}
.btn-primary:hover { background: #7d6ff0; transform: translateY(-1px); }

.btn-outline {
  background: transparent;
  color: var(--text);
  border: 1px solid var(--border);
}
.btn-outline:hover { border-color: var(--accent2); color: var(--accent2); }

/* Grid animation */
.hero-grid {
  position: absolute;
  top: 0; left: 0; right: 0; bottom: 0;
  background-image:
    linear-gradient(rgba(108,92,231,0.04) 1px, transparent 1px),
    linear-gradient(90deg, rgba(108,92,231,0.04) 1px, transparent 1px);
  background-size: 60px 60px;
  pointer-events: none;
  mask-image: radial-gradient(ellipse 60% 50% at 50% 30%, black 30%, transparent 70%);
}

/* === Stats === */
.stats {
  border-bottom: 1px solid var(--border);
  padding: 32px 0;
}

.stats .container {
  display: flex;
  justify-content: center;
  gap: 48px;
  flex-wrap: wrap;
}

.stat-item {
  display: flex;
  flex-direction: column;
  align-items: center;
}

.stat-num {
  font-size: 2.4rem;
  font-weight: 800;
  color: var(--accent2);
  font-family: var(--font-mono);
}

.stat-label {
  font-size: 0.85rem;
  color: var(--text2);
  margin-top: 2px;
}

/* === Architecture === */
.arch {
  padding: 80px 0;
  background: var(--bg2);
  border-bottom: 1px solid var(--border);
}

.arch-flow { max-width: 900px; margin: 0 auto; }
.arch-row { display: flex; align-items: flex-start; gap: 20px; margin: 12px 0; flex-wrap: wrap; }
.arch-row.highlight {
  background: rgba(108,92,231,0.08);
  border: 1px solid rgba(108,92,231,0.2);
  border-radius: var(--radius);
  padding: 16px 20px;
  margin: 16px 0;
}

.arch-label {
  font-weight: 700;
  font-size: 0.9rem;
  color: var(--text2);
  min-width: 80px;
  padding-top: 6px;
  text-transform: uppercase;
  letter-spacing: 1px;
}

.arch-items { display: flex; flex-wrap: wrap; gap: 6px; }

.arch-chip {
  display: inline-block;
  padding: 4px 10px;
  border-radius: 4px;
  font-size: 0.78rem;
  font-family: var(--font-mono);
  font-weight: 600;
}

.arch-chip.c    { background: #2d35611a; color: #54a0ff; border: 1px solid #54a0ff33; }
.arch-chip.basic{ background: #2d35611a; color: #feca57; border: 1px solid #feca5733; }
.arch-chip.pas  { background: #2d35611a; color: #5f27cd; border: 1px solid #5f27cd33; }
.arch-chip.py   { background: #2d35611a; color: #00d2a0; border: 1px solid #00d2a033; }
.arch-chip.lua  { background: #2d35611a; color: #54a0ff; border: 1px solid #54a0ff33; }
.arch-chip.forth{ background: #2d35611a; color: #c8d6e5; border: 1px solid #c8d6e533; }
.arch-chip.rs   { background: #2d35611a; color: #ff6b6b; border: 1px solid #ff6b6b33; }
.arch-chip.go   { background: #2d35611a; color: #00d2d3; border: 1px solid #00d2d333; }
.arch-chip.ld   { background: #2d35611a; color: #feca57; border: 1px solid #feca5733; }
.arch-chip.java { background: #2d35611a; color: #ff9f43; border: 1px solid #ff9f4333; }
.arch-chip.js   { background: #2d35611a; color: #feca57; border: 1px solid #feca5733; }
.arch-chip.cs   { background: #2d35611a; color: #a29bfe; border: 1px solid #a29bfe33; }
.arch-chip.swift{ background: #2d35611a; color: #ff6b6b; border: 1px solid #ff6b6b33; }
.arch-chip.cpp  { background: #2d35611a; color: #54a0ff; border: 1px solid #54a0ff33; }
.arch-chip.kt   { background: #2d35611a; color: #e84393; border: 1px solid #e8439333; }
.arch-chip.scm  { background: #2d35611a; color: #c8d6e5; border: 1px solid #c8d6e533; }
.arch-chip.ir   { background: rgba(108,92,231,0.15); color: var(--accent2); border: 1px solid var(--accent); font-size: 0.85rem; }
.arch-chip.arch { background: #1a2a1a; color: var(--green); border: 1px solid var(--green); }

.arch-arrow {
  text-align: center;
  color: var(--accent2);
  font-size: 0.9rem;
  padding: 4px 0 4px 100px;
}

/* === Quick Start === */
.quickstart {
  padding: 80px 0;
  border-bottom: 1px solid var(--border);
}

.code-tabs { display: flex; gap: 4px; justify-content: center; margin-bottom: 20px; flex-wrap: wrap; }

.code-tab {
  padding: 8px 20px;
  border-radius: var(--radius);
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  border: 1px solid transparent;
  color: var(--text2);
  background: transparent;
  transition: all 0.2s;
}
.code-tab:hover { color: var(--text); border-color: var(--border); }
.code-tab.active { background: var(--bg3); color: var(--accent2); border-color: var(--accent); }

.code-blocks { max-width: 750px; margin: 0 auto; }

.code-block { display: none; }
.code-block.active { display: block; }
.code-block h4 { font-size: 0.85rem; color: var(--text2); margin-bottom: 8px; }

pre {
  background: var(--bg3);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px 24px;
  overflow-x: auto;
  font-family: var(--font-mono);
  font-size: 0.88rem;
  line-height: 1.7;
}

pre code { color: var(--text); }

.cli {
  background: var(--bg3);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px 24px;
  margin-top: 8px;
  font-family: var(--font-mono);
  font-size: 0.85rem;
  line-height: 1.8;
  color: #a0a0b0;
}

.prompt { color: var(--green); }
.out { color: #feca57; }

/* Syntax highlighting */
.cmt { color: #5c6370; font-style: italic; }
.kwd { color: #c678dd; }
.str { color: #98c379; }
.fn  { color: #61afef; }
.num { color: #d19a66; }

/* === MCU === */
.mcu {
  padding: 80px 0;
  background: var(--bg2);
  border-bottom: 1px solid var(--border);
}

.mcu-cols { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; max-width: 800px; margin: 0 auto; }

.mcu-col {
  background: var(--bg3);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 28px;
}

.mcu-col h3 { margin-bottom: 12px; }

.mcu-col ul {
  list-style: none;
  margin-bottom: 16px;
}

.mcu-col li {
  font-size: 0.9rem;
  color: var(--text2);
  padding: 4px 0;
}

.mcu-col li::before { content: "✓ "; color: var(--green); font-weight: 700; }

.mcu-col pre {
  background: var(--bg);
  padding: 12px 16px;
  font-size: 0.8rem;
}

.mcu-col pre strong { color: var(--accent2); }

/* === FFI === */
.ffi {
  padding: 80px 0;
  border-bottom: 1px solid var(--border);
}

.ffi pre { max-width: 650px; margin: 0 auto 20px; }

.ffi-chain {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  flex-wrap: wrap;
  font-family: var(--font-mono);
  font-size: 0.82rem;
  color: var(--text2);
}

.ffi-chain span {
  background: var(--bg3);
  padding: 6px 14px;
  border-radius: 4px;
  border: 1px solid var(--border);
}

/* === Translators Grid === */
.translators {
  padding: 80px 0;
  background: var(--bg2);
  border-bottom: 1px solid var(--border);
}

.arch-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 12px;
  max-width: 900px;
  margin: 0 auto;
}

.arch-card {
  background: var(--bg3);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
  text-align: center;
  transition: border-color 0.2s;
}
.arch-card:hover { border-color: var(--accent); }

.arch-name {
  font-size: 1.05rem;
  font-weight: 700;
  font-family: var(--font-mono);
  color: var(--text);
}

.arch-bits {
  display: inline-block;
  font-size: 0.7rem;
  padding: 2px 8px;
  border-radius: 10px;
  background: rgba(108,92,231,0.15);
  color: var(--accent2);
  margin-top: 4px;
  font-family: var(--font-mono);
}

.arch-desc {
  font-size: 0.75rem;
  color: var(--text2);
  margin-top: 6px;
}

/* === OpenGL Demo === */
.opengl {
  padding: 80px 0;
  border-bottom: 1px solid var(--border);
}

.lang-grid {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
  margin-bottom: 24px;
  max-width: 700px;
  margin-left: auto; margin-right: auto;
}

.lang-grid span {
  background: var(--bg3);
  border: 1px solid var(--border);
  padding: 8px 18px;
  border-radius: var(--radius);
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text);
}

.demo-flow { max-width: 650px; margin: 0 auto; }

/* === WASM Demo === */
.wasm-section {
  padding: 80px 0;
  border-bottom: 1px solid var(--border);
  background: var(--bg);
}

.wasm-flow {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  flex-wrap: wrap;
  max-width: 850px;
  margin: 24px auto;
}

.wasm-step {
  background: var(--bg3);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px 20px;
  text-align: center;
  min-width: 130px;
}

.wasm-step-label {
  display: block;
  font-size: 0.8rem;
  color: var(--text2);
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-bottom: 6px;
}

.wasm-step-chip {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: 0.82rem;
  color: var(--accent2);
  font-weight: 600;
}

.wasm-arrow {
  font-size: 1.4rem;
  color: var(--accent);
  font-weight: 700;
}

.wasm-actions {
  text-align: center;
  margin-top: 20px;
}

/* === CTA === */
.cta {
  padding: 80px 0;
  background: var(--bg2);
  border-bottom: 1px solid var(--border);
}

.cta-steps { max-width: 650px; margin: 32px auto 0; display: flex; flex-direction: column; gap: 16px; }

.cta-step {
  display: flex;
  align-items: flex-start;
  gap: 16px;
}

.step-num {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  background: var(--accent);
  color: #fff;
  border-radius: 50%;
  font-weight: 700;
  font-size: 0.9rem;
  flex-shrink: 0;
  margin-top: 12px;
}

.cta-step pre { flex: 1; margin: 0; }

/* === Footer === */
footer {
  padding: 32px 0;
  text-align: center;
  color: var(--text2);
  font-size: 0.85rem;
}

.footer-links { margin-top: 8px; display: flex; gap: 20px; justify-content: center; }
.footer-links a { color: var(--text2); text-decoration: none; }
.footer-links a:hover { color: var(--accent2); }

/* === Responsive === */
@media (max-width: 768px) {
  .hero h1 { font-size: 2.4rem; }
  .hero { padding: 60px 0 48px; }
  .hero-desc br { display: none; }

  .stats .container { gap: 24px; }

  .arch-row { flex-direction: column; }
  .arch-label { min-width: auto; }
  .arch-arrow { padding-left: 0; }

  .mcu-cols { grid-template-columns: 1fr; }

  .arch-grid { grid-template-columns: repeat(3, 1fr); }

	  .home-cards { grid-template-columns: 1fr; }
	  .two-col { grid-template-columns: 1fr; }
	  .card-grid { grid-template-columns: 1fr; }
	  .nav-inner { flex-wrap: wrap; height: auto; padding: 8px 0; }
	  .page-header h1 { font-size: 1.8rem; }

  h2 { font-size: 1.5rem; }
}
