/* ========================================
   Personal Knowledge Wiki - Landing Page
   Premium Dark Theme Design
   ======================================== */

/* --- CSS Custom Properties --- */
:root {
  --bg-primary: #0c0e1a;
  --bg-secondary: #111328;
  --bg-card: rgba(255, 255, 255, 0.05);
  --bg-card-hover: rgba(255, 255, 255, 0.09);
  --text-primary: #f0f0f8;
  --text-secondary: #a0a0c0;
  --text-dim: #707090;
  --accent: #8b6cf6;
  --accent-light: #b49cff;
  --accent-glow: rgba(139, 108, 246, 0.35);
  --accent-2: #22d3ee;
  --green: #34d399;
  --yellow: #fbbf24;
  --red: #f87171;
  --border: rgba(255, 255, 255, 0.08);
  --border-hover: rgba(255, 255, 255, 0.18);
  --glass: rgba(255, 255, 255, 0.04);
  --glass-border: rgba(255, 255, 255, 0.08);
  --code-bg: #0d1025;
  --code-text: #d4dce8;
  --shadow: 0 4px 32px rgba(0, 0, 0, 0.4);
  --shadow-glow: 0 0 80px rgba(139, 108, 246, 0.15);
  --radius: 16px;
  --radius-sm: 10px;
  --radius-xs: 6px;
  --nav-height: 64px;
  --transition: 0.3s cubic-bezier(0.4, 0, 0.2, 1);

  /* Architecture layer colors */
  --layer-raw: rgba(52, 211, 153, 0.1);
  --layer-raw-border: rgba(52, 211, 153, 0.25);
  --layer-wiki: rgba(139, 108, 246, 0.1);
  --layer-wiki-border: rgba(139, 108, 246, 0.25);
  --layer-meta: rgba(255, 255, 255, 0.04);
  --layer-meta-border: rgba(255, 255, 255, 0.1);
}

[data-theme="light"] {
  --bg-primary: #f8f9fc;
  --bg-secondary: #ffffff;
  --bg-card: rgba(0, 0, 0, 0.02);
  --bg-card-hover: rgba(0, 0, 0, 0.04);
  --text-primary: #1a1a2e;
  --text-secondary: #6b7280;
  --text-dim: #9ca3af;
  --accent: #6d28d9;
  --accent-light: #7c3aed;
  --accent-glow: rgba(109, 40, 217, 0.15);
  --border: rgba(0, 0, 0, 0.06);
  --border-hover: rgba(0, 0, 0, 0.12);
  --glass: rgba(255, 255, 255, 0.6);
  --glass-border: rgba(0, 0, 0, 0.06);
  --code-bg: #1e1e2e;
  --code-text: #c9d1d9;
  --shadow: 0 4px 32px rgba(0, 0, 0, 0.08);
  --shadow-glow: 0 0 60px rgba(109, 40, 217, 0.05);
  --layer-raw: rgba(16, 185, 129, 0.06);
  --layer-raw-border: rgba(16, 185, 129, 0.15);
  --layer-wiki: rgba(109, 40, 217, 0.06);
  --layer-wiki-border: rgba(109, 40, 217, 0.15);
  --layer-meta: rgba(0, 0, 0, 0.02);
  --layer-meta-border: rgba(0, 0, 0, 0.06);
}

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

html {
  scroll-behavior: smooth;
  scroll-padding-top: var(--nav-height);
  font-size: 16px;
}

body {
  font-family: "Inter", "Noto Sans SC", -apple-system, BlinkMacSystemFont, sans-serif;
  background: var(--bg-primary);
  color: var(--text-primary);
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

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

code {
  font-family: "JetBrains Mono", "Fira Code", monospace;
  font-size: 0.875em;
  background: rgba(124, 92, 252, 0.1);
  padding: 0.15em 0.4em;
  border-radius: 4px;
  color: var(--accent-light);
}

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

/* --- Navigation --- */
#navbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: var(--nav-height);
  z-index: 1000;
  background: rgba(10, 10, 26, 0.6);
  backdrop-filter: blur(20px) saturate(1.5);
  -webkit-backdrop-filter: blur(20px) saturate(1.5);
  border-bottom: 1px solid var(--border);
  transition: background var(--transition), box-shadow var(--transition);
}

[data-theme="light"] #navbar {
  background: rgba(248, 249, 252, 0.8);
}

#navbar.scrolled {
  box-shadow: 0 2px 20px rgba(0,0,0,0.15);
}

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

.nav-brand {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--text-primary);
  font-weight: 700;
  font-size: 1.1rem;
  letter-spacing: -0.02em;
}

.brand-icon { display: flex; color: var(--accent); }

.nav-links {
  display: flex;
  gap: 32px;
}

.nav-links a {
  color: var(--text-secondary);
  font-size: 0.875rem;
  font-weight: 500;
  transition: color var(--transition);
  position: relative;
}

.nav-links a::after {
  content: '';
  position: absolute;
  bottom: -4px;
  left: 0;
  width: 0;
  height: 2px;
  background: var(--accent);
  border-radius: 1px;
  transition: width var(--transition);
}

.nav-links a:hover,
.nav-links a.active {
  color: var(--text-primary);
}

.nav-links a.active::after {
  width: 100%;
}

.nav-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

#theme-toggle {
  width: 36px;
  height: 36px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: transparent;
  color: var(--text-secondary);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all var(--transition);
}

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

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

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

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

/* --- HERO --- */
#hero {
  position: relative;
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 120px 24px 80px;
  overflow: hidden;
}

.hero-bg {
  position: absolute;
  inset: 0;
  z-index: 0;
}

.hero-grid {
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(139, 108, 246, 0.06) 1px, transparent 1px),
    linear-gradient(90deg, rgba(139, 108, 246, 0.06) 1px, transparent 1px);
  background-size: 60px 60px;
  mask-image: radial-gradient(ellipse 80% 60% at 50% 40%, black 30%, transparent 100%);
  -webkit-mask-image: radial-gradient(ellipse 80% 60% at 50% 40%, black 30%, transparent 100%);
}

[data-theme="light"] .hero-grid {
  background-image:
    linear-gradient(rgba(109, 40, 217, 0.05) 1px, transparent 1px),
    linear-gradient(90deg, rgba(109, 40, 217, 0.05) 1px, transparent 1px);
}

.hero-glow {
  position: absolute;
  top: 20%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 700px;
  height: 700px;
  background: radial-gradient(circle, rgba(139, 108, 246, 0.25) 0%, rgba(34, 211, 238, 0.08) 40%, transparent 70%);
  filter: blur(60px);
  pointer-events: none;
  animation: glowPulse 6s ease-in-out infinite alternate;
}

@keyframes glowPulse {
  0% { opacity: 0.8; transform: translate(-50%, -50%) scale(1); }
  100% { opacity: 1; transform: translate(-50%, -50%) scale(1.1); }
}

[data-theme="light"] .hero-glow {
  background: radial-gradient(circle, rgba(109, 40, 217, 0.08) 0%, transparent 70%);
}

.hero-content {
  position: relative;
  z-index: 1;
  text-align: center;
  max-width: 800px;
}

.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 16px;
  border: 1px solid var(--border);
  border-radius: 999px;
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--accent-light);
  background: var(--glass);
  margin-bottom: 32px;
  letter-spacing: 0.05em;
}

.hero-title {
  font-size: clamp(2.5rem, 6vw, 4.5rem);
  font-weight: 800;
  line-height: 1.1;
  letter-spacing: -0.04em;
  margin-bottom: 24px;
}

.gradient-text {
  background: linear-gradient(135deg, #a78bfa 0%, #22d3ee 45%, #67e8f9 70%, #c4b5fd 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

.hero-subtitle {
  font-size: 1.2rem;
  color: var(--text-secondary);
  line-height: 1.8;
  margin-bottom: 40px;
}

.hero-cta {
  display: flex;
  gap: 16px;
  justify-content: center;
  margin-bottom: 64px;
}

.btn {
  display: inline-flex;
  align-items: center;
  padding: 12px 28px;
  border-radius: 12px;
  font-size: 0.95rem;
  font-weight: 600;
  transition: all var(--transition);
  cursor: pointer;
  border: none;
}

.btn-primary {
  background: linear-gradient(135deg, #8b6cf6 0%, #6d28d9 100%);
  color: #fff;
  box-shadow: 0 4px 24px rgba(139, 108, 246, 0.4);
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 40px rgba(139, 108, 246, 0.55);
  color: #fff;
}

.btn-ghost {
  background: transparent;
  color: var(--text-secondary);
  border: 1px solid var(--border);
}

.btn-ghost:hover {
  border-color: var(--accent);
  color: var(--accent-light);
  background: rgba(124, 92, 252, 0.05);
}

.hero-highlights {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  flex-wrap: wrap;
}

.highlight-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 18px;
  border: 1px solid var(--border);
  border-radius: 999px;
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--text-secondary);
  background: var(--glass);
  transition: all var(--transition);
  backdrop-filter: blur(8px);
}

.highlight-pill:hover {
  border-color: var(--accent);
  color: var(--accent-light);
  background: rgba(139, 108, 246, 0.08);
  box-shadow: 0 0 20px rgba(139, 108, 246, 0.15);
}

.highlight-pill svg {
  color: var(--accent-light);
  flex-shrink: 0;
}

/* --- Sections --- */
.section {
  padding: 120px 0;
  position: relative;
}

.section-alt {
  background: var(--bg-secondary);
}

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

.section-tag {
  display: inline-block;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.15em;
  color: var(--accent);
  margin-bottom: 16px;
}

.section-header h2 {
  font-size: clamp(1.8rem, 4vw, 2.5rem);
  font-weight: 800;
  letter-spacing: -0.03em;
  margin-bottom: 16px;
}

.section-desc {
  font-size: 1.05rem;
  color: var(--text-secondary);
  max-width: 600px;
  margin: 0 auto;
}

/* --- Features Grid --- */
.features-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
}

.features-grid .feature-card:nth-child(4),
.features-grid .feature-card:nth-child(5) {
  /* Center last two cards */
}

.feature-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 32px 28px;
  transition: all var(--transition);
  position: relative;
  overflow: hidden;
}

.feature-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: linear-gradient(90deg, transparent, var(--icon-color, var(--accent)), transparent);
  opacity: 0;
  transition: opacity var(--transition);
}

.feature-card:hover {
  background: var(--bg-card-hover);
  border-color: var(--border-hover);
  transform: translateY(-6px);
  box-shadow: 0 8px 40px rgba(139, 108, 246, 0.12), 0 0 0 1px rgba(139, 108, 246, 0.1);
}

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

.feature-icon {
  width: 52px;
  height: 52px;
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(124, 92, 252, 0.08);
  color: var(--icon-color, var(--accent));
  margin-bottom: 20px;
}

.feature-card h3 {
  font-size: 1.3rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  margin-bottom: 4px;
  font-family: "JetBrains Mono", monospace;
}

.feature-label {
  font-size: 0.85rem;
  color: var(--text-dim);
  margin-bottom: 12px;
}

.feature-desc {
  font-size: 0.9rem;
  color: var(--text-secondary);
  line-height: 1.7;
  margin-bottom: 16px;
}

.feature-tag {
  font-size: 0.75rem;
  color: var(--accent-light);
  padding: 4px 10px;
  background: rgba(124, 92, 252, 0.08);
  border-radius: 6px;
  display: inline-block;
  font-family: "JetBrains Mono", monospace;
}

/* --- Architecture --- */
.arch-diagram {
  max-width: 800px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 0;
}

.arch-layer {
  border-radius: var(--radius);
  padding: 28px 32px;
  border: 1px solid;
  position: relative;
}

.arch-raw {
  background: var(--layer-raw);
  border-color: var(--layer-raw-border);
}

.arch-wiki {
  background: var(--layer-wiki);
  border-color: var(--layer-wiki-border);
}

.arch-meta {
  background: var(--layer-meta);
  border-color: var(--layer-meta-border);
}

.arch-layer-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 20px;
}

.arch-layer-badge {
  font-size: 0.7rem;
  font-weight: 600;
  padding: 3px 10px;
  border-radius: 6px;
  background: rgba(16, 185, 129, 0.15);
  color: var(--green);
  text-transform: uppercase;
  letter-spacing: 0.1em;
}

.badge-wiki {
  background: rgba(124, 92, 252, 0.15);
  color: var(--accent-light);
}

.badge-meta {
  background: rgba(255, 255, 255, 0.06);
  color: var(--text-secondary);
}

.arch-layer-header h3 {
  font-size: 1.1rem;
  font-weight: 700;
  font-family: "JetBrains Mono", monospace;
}

.arch-dim {
  font-weight: 400;
  color: var(--text-dim);
  font-family: "Inter", "Noto Sans SC", sans-serif;
  font-size: 0.85rem;
}

.arch-layer-content {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

.arch-box {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 16px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border);
  border-radius: var(--radius-xs);
  font-size: 0.85rem;
  color: var(--text-secondary);
}

[data-theme="light"] .arch-box {
  background: rgba(0,0,0,0.02);
}

.arch-box-icon {
  color: var(--text-dim);
  display: flex;
}

.arch-note {
  margin-top: 16px;
  font-size: 0.78rem;
  color: var(--text-dim);
  font-style: italic;
}

.arch-type-card {
  flex: 1;
  min-width: 120px;
  text-align: center;
  padding: 16px 12px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
}

[data-theme="light"] .arch-type-card {
  background: rgba(0,0,0,0.02);
}

.type-count {
  font-size: 1.8rem;
  font-weight: 800;
  color: var(--accent-light);
  letter-spacing: -0.02em;
}

.type-icon-sm {
  color: var(--accent-light);
  margin-bottom: 6px;
  display: flex;
  justify-content: center;
}

.type-name {
  font-size: 0.8rem;
  font-family: "JetBrains Mono", monospace;
  color: var(--text-secondary);
  margin-top: 2px;
}

.type-desc {
  font-size: 0.75rem;
  color: var(--text-dim);
}

/* Arrow between layers */
.arch-arrow {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 0;
  justify-content: center;
}

.arch-arrow-line {
  flex: 1;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--border), transparent);
  max-width: 100px;
}

.arch-arrow-label {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--accent-light);
  white-space: nowrap;
}

/* --- Workflow Timeline --- */
.workflow-timeline {
  max-width: 1000px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 48px;
}

.workflow-step {
  display: flex;
  gap: 32px;
}

.step-marker {
  display: flex;
  flex-direction: column;
  align-items: center;
  flex-shrink: 0;
  width: 60px;
}

.step-number {
  width: 48px;
  height: 48px;
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.85rem;
  font-weight: 700;
  font-family: "JetBrains Mono", monospace;
  color: var(--accent-light);
  background: rgba(124, 92, 252, 0.1);
  border: 1px solid rgba(124, 92, 252, 0.2);
}

.step-line {
  flex: 1;
  width: 1px;
  background: linear-gradient(to bottom, rgba(124, 92, 252, 0.3), transparent);
  margin-top: 12px;
}

.step-content {
  flex: 1;
  display: grid;
  grid-template-columns: 1fr 1.2fr;
  gap: 24px;
  align-items: start;
}

.step-info h3 {
  font-size: 1.3rem;
  font-weight: 700;
  margin-bottom: 10px;
}

.step-info p {
  font-size: 0.9rem;
  color: var(--text-secondary);
  line-height: 1.8;
}

.step-visual { position: relative; }

/* --- Code Window --- */
.code-window {
  border-radius: var(--radius-sm);
  overflow: hidden;
  border: 1px solid var(--border);
  background: var(--code-bg);
}

.code-titlebar {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 16px;
  background: rgba(255, 255, 255, 0.03);
  border-bottom: 1px solid var(--border);
}

.code-dots {
  display: flex;
  gap: 6px;
}

.code-dots span {
  width: 10px;
  height: 10px;
  border-radius: 50%;
}

.code-dots span:nth-child(1) { background: #ff5f57; }
.code-dots span:nth-child(2) { background: #febc2e; }
.code-dots span:nth-child(3) { background: #28c840; }

.code-title {
  font-size: 0.75rem;
  color: var(--text-dim);
  font-family: "JetBrains Mono", monospace;
}

.code-body {
  padding: 16px 20px;
  overflow-x: auto;
}

.code-body code {
  font-size: 0.82rem;
  line-height: 1.8;
  color: var(--code-text);
  background: none;
  padding: 0;
  border-radius: 0;
}

/* Code syntax colors */
.hl-comment { color: #6a737d; }
.hl-prompt { color: var(--green); }
.hl-cmd { color: #e2e4e8; font-weight: 600; }
.hl-success { color: var(--green); }
.hl-info { color: var(--accent-2); }
.hl-warn { color: var(--yellow); }
.hl-dim { color: #555570; }

/* --- Graph Mockup --- */
.graph-mockup {
  position: relative;
  width: 100%;
  height: 220px;
  background: var(--code-bg);
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  overflow: hidden;
}

.graph-lines {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

.graph-node {
  position: absolute;
  padding: 6px 14px;
  border-radius: 8px;
  font-size: 0.78rem;
  font-weight: 600;
  border: 1px solid var(--accent);
  color: var(--accent-light);
  background: rgba(124, 92, 252, 0.1);
  white-space: nowrap;
  z-index: 1;
}

.graph-node-center {
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background: rgba(124, 92, 252, 0.2);
  font-size: 0.9rem;
  padding: 8px 20px;
}

.graph-node-1 { top: 10%; left: 12%; }
.graph-node-2 { top: 10%; right: 12%; }
.graph-node-3 { bottom: 12%; left: 8%; }
.graph-node-4 { bottom: 12%; right: 8%; }
.graph-node-5 { top: 5%; left: 45%; }

/* --- Examples Tabs --- */
.examples-tabs {
  display: flex;
  gap: 8px;
  justify-content: center;
  margin-bottom: 32px;
}

.tab-btn {
  padding: 10px 24px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: transparent;
  color: var(--text-secondary);
  font-size: 0.9rem;
  font-weight: 500;
  cursor: pointer;
  transition: all var(--transition);
  display: flex;
  align-items: center;
  gap: 8px;
  font-family: inherit;
}

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

.tab-btn.active {
  background: rgba(124, 92, 252, 0.1);
  border-color: rgba(124, 92, 252, 0.3);
  color: var(--accent-light);
}

.tab-icon {
  width: 8px;
  height: 8px;
  border-radius: 2px;
}

.concept-icon { background: var(--accent); }
.entity-icon { background: var(--accent-2); }
.topic-icon { background: var(--green); }

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

/* --- Wiki Page Mockup --- */
.wiki-page-mockup {
  max-width: 800px;
  margin: 0 auto;
  border-radius: var(--radius-sm);
  overflow: hidden;
  border: 1px solid var(--border);
  background: var(--code-bg);
}

.wiki-page-body {
  padding: 0;
}

.wiki-frontmatter {
  padding: 16px 24px;
  background: rgba(255, 255, 255, 0.02);
  border-bottom: 1px solid var(--border);
}

.wiki-frontmatter pre {
  font-family: "JetBrains Mono", monospace;
  font-size: 0.78rem;
  color: var(--text-dim);
  line-height: 1.7;
  margin: 0;
  white-space: pre-wrap;
}

.wiki-content {
  padding: 24px 32px 32px;
  color: var(--code-text);
}

.wiki-content h1 {
  font-size: 1.5rem;
  font-weight: 700;
  margin-bottom: 20px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border);
}

.wiki-content h2 {
  font-size: 1.15rem;
  font-weight: 600;
  margin-top: 24px;
  margin-bottom: 12px;
  color: var(--text-primary);
}

.wiki-content h3 {
  font-size: 1rem;
  font-weight: 600;
  margin-top: 16px;
  margin-bottom: 8px;
  color: var(--text-secondary);
}

.wiki-content p {
  font-size: 0.9rem;
  color: #9ca3af;
  margin-bottom: 12px;
  line-height: 1.8;
}

.wiki-content ul, .wiki-content ol {
  padding-left: 20px;
  margin-bottom: 12px;
}

.wiki-content li {
  font-size: 0.88rem;
  color: #9ca3af;
  margin-bottom: 4px;
  line-height: 1.7;
}

.wiki-content table {
  width: 100%;
  border-collapse: collapse;
  margin: 12px 0;
  font-size: 0.85rem;
}

.wiki-content th {
  padding: 8px 12px;
  text-align: left;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border);
  color: var(--text-secondary);
  font-weight: 600;
}

.wiki-content td {
  padding: 8px 12px;
  border: 1px solid var(--border);
  color: #9ca3af;
}

.wiki-content code {
  background: rgba(124, 92, 252, 0.12);
}

.wikilink {
  color: var(--accent-light);
  padding: 2px 6px;
  background: rgba(124, 92, 252, 0.08);
  border-radius: 4px;
  font-size: 0.85rem;
}

/* --- Demo --- */
.demo-placeholder {
  max-width: 900px;
  margin: 0 auto;
}

.demo-frame {
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid var(--border);
  background: var(--code-bg);
}

.demo-body {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 80px 32px;
  color: var(--text-dim);
  gap: 16px;
}

.demo-body p {
  font-size: 1.1rem;
  font-weight: 500;
}

.demo-hint {
  font-size: 0.85rem;
  color: var(--text-dim);
}

/* --- Tech Stack --- */
.tech-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 20px;
  margin-bottom: 48px;
}

.tech-card {
  text-align: center;
  padding: 32px 20px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg-card);
  transition: all var(--transition);
}

.tech-card:hover {
  border-color: var(--border-hover);
  transform: translateY(-2px);
}

.tech-icon-wrap {
  width: 56px;
  height: 56px;
  margin: 0 auto 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 14px;
  background: rgba(124, 92, 252, 0.08);
  color: var(--accent);
}

.tech-card h3 {
  font-size: 1rem;
  font-weight: 600;
  margin-bottom: 8px;
}

.tech-card p {
  font-size: 0.82rem;
  color: var(--text-dim);
  line-height: 1.6;
}

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

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

/* --- Footer --- */
footer {
  padding: 40px 0;
  border-top: 1px solid var(--border);
}

.footer-content {
  text-align: center;
}

.footer-brand {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 8px;
}

.footer-text {
  font-size: 0.82rem;
  color: var(--text-dim);
}

/* --- Animations --- */
[data-aos] {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}

[data-aos].visible {
  opacity: 1;
  transform: translateY(0);
}

/* Stagger animations in grids */
.features-grid [data-aos]:nth-child(2) { transition-delay: 0.08s; }
.features-grid [data-aos]:nth-child(3) { transition-delay: 0.16s; }
.features-grid [data-aos]:nth-child(4) { transition-delay: 0.24s; }
.features-grid [data-aos]:nth-child(5) { transition-delay: 0.32s; }

.tech-grid [data-aos]:nth-child(2) { transition-delay: 0.08s; }
.tech-grid [data-aos]:nth-child(3) { transition-delay: 0.16s; }
.tech-grid [data-aos]:nth-child(4) { transition-delay: 0.24s; }

/* --- Responsive --- */
@media (max-width: 1024px) {
  .features-grid { grid-template-columns: repeat(2, 1fr); }
  .tech-grid { grid-template-columns: repeat(2, 1fr); }
  .step-content { grid-template-columns: 1fr; }
}

@media (max-width: 768px) {
  .nav-links { display: none; }
  .nav-hamburger { display: flex; }

  .nav-links.open {
    display: flex;
    flex-direction: column;
    position: absolute;
    top: var(--nav-height);
    left: 0;
    right: 0;
    background: var(--bg-primary);
    border-bottom: 1px solid var(--border);
    padding: 16px 24px;
    gap: 16px;
    backdrop-filter: blur(20px);
  }

  [data-theme="light"] .nav-links.open {
    background: var(--bg-secondary);
  }

  .features-grid { grid-template-columns: 1fr; }
  .tech-grid { grid-template-columns: 1fr 1fr; }

  .hero-highlights { gap: 8px; }
  .highlight-pill { font-size: 0.8rem; padding: 6px 14px; }

  .section { padding: 80px 0; }

  .workflow-step { flex-direction: column; gap: 16px; }
  .step-marker { flex-direction: row; width: auto; }
  .step-line { display: none; }

  .examples-tabs { flex-direction: column; align-items: stretch; }

  .arch-layer-content { flex-direction: column; }
  .arch-type-card { min-width: auto; }

  .hero-title { font-size: 2.2rem; }
  .hero-cta { flex-direction: column; align-items: center; }
}

@media (max-width: 480px) {
  .tech-grid { grid-template-columns: 1fr; }
  .hero-highlights { flex-direction: column; align-items: center; }
}
