/* ============================================
   Apache EventMesh — Redesigned Official Site
   Modern, dark, event-driven aesthetic
   ============================================ */

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

:root {
  /* Brand */
  --em-green: #00D97E;
  --em-green-dim: #00B86A;
  --em-green-glow: rgba(0, 217, 126, 0.35);
  --em-purple: #7C5CFC;
  --em-purple-dim: #6344E0;
  --em-cyan: #22D3EE;
  --em-amber: #FBBF24;

  /* Surfaces */
  --bg-deep: #060912;
  --bg-base: #0A0E1A;
  --bg-card: rgba(255, 255, 255, 0.04);
  --bg-card-hover: rgba(255, 255, 255, 0.07);
  --bg-glass: rgba(10, 14, 26, 0.72);
  --border-subtle: rgba(255, 255, 255, 0.08);
  --border-glow: rgba(0, 217, 126, 0.3);

  /* Text */
  --text-primary: #F5F7FA;
  --text-secondary: #A0AAB8;
  --text-tertiary: #6B7280;

  /* Layout */
  --max-w: 1200px;
  --nav-h: 68px;

  /* Transitions */
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  --dur: 0.4s;
}

html { scroll-behavior: smooth; font-size: 16px; }

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

a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }

::selection { background: var(--em-green); color: var(--bg-deep); }

/* ---- Scrollbar ---- */
::-webkit-scrollbar { width: 8px; }
::-webkit-scrollbar-track { background: var(--bg-base); }
::-webkit-scrollbar-thumb { background: rgba(0, 217, 126, 0.3); border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: var(--em-green); }

/* ---- Layout Helpers ---- */
.container { max-width: var(--max-w); margin: 0 auto; padding: 0 24px; }

.section { padding: 100px 0; position: relative; }

.section-label {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--em-green);
  margin-bottom: 16px;
}

.section-label::before {
  content: '';
  width: 24px;
  height: 2px;
  background: var(--em-green);
  border-radius: 1px;
}

.section-title {
  font-size: 2.5rem;
  font-weight: 800;
  letter-spacing: -0.03em;
  margin-bottom: 16px;
  line-height: 1.15;
}

.section-subtitle {
  font-size: 1.15rem;
  color: var(--text-secondary);
  max-width: 640px;
  margin-bottom: 56px;
}

.gradient-text {
  background: linear-gradient(135deg, var(--em-green), var(--em-cyan));
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

/* ---- Navigation ---- */
.nav {
  position: fixed;
  top: 0; left: 0; right: 0;
  height: var(--nav-h);
  z-index: 1000;
  display: flex;
  align-items: center;
  transition: background var(--dur) var(--ease), border-color var(--dur) var(--ease);
  border-bottom: 1px solid transparent;
}

.nav.scrolled {
  background: var(--bg-glass);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom-color: var(--border-subtle);
}

.nav-inner {
  width: 100%;
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 0 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.nav-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  font-weight: 700;
  font-size: 1.1rem;
  flex-shrink: 0;
}

.nav-brand-logo {
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.nav-brand-logo svg { width: 100%; height: 100%; }

.nav-brand-text { letter-spacing: -0.02em; white-space: nowrap; }
.nav-brand-text span { color: var(--em-green); }

.nav-links {
  display: flex;
  align-items: center;
  gap: 4px;
  flex-shrink: 0;
}

.nav-link {
  padding: 8px 16px;
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--text-secondary);
  border-radius: 8px;
  white-space: nowrap;
  flex-shrink: 0;
  transition: color var(--dur) var(--ease), background var(--dur) var(--ease);
}

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

/* ---- Nav dropdown (Community → Subscribe / Team) ---- */
.nav-dropdown {
  position: relative;
}
.nav-dropdown-toggle {
  cursor: pointer;
  user-select: none;
}
.nav-dropdown-toggle::after {
  content: ' ▾';
  font-size: 0.7rem;
  vertical-align: middle;
}
.nav-dropdown-menu {
  position: absolute;
  top: 100%;
  left: 0;
  min-width: 160px;
  padding: 6px 0;
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: 10px;
  box-shadow: 0 8px 32px rgba(0,0,0,0.2);
  opacity: 0;
  visibility: hidden;
  transform: translateY(0);
  transition: opacity 0.15s ease, visibility 0.15s ease;
  z-index: 1000;
}
/* Bridge hover gap between toggle and menu */
.nav-dropdown::after {
  content: '';
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  height: 8px;
  z-index: 999;
}
.nav-dropdown:hover .nav-dropdown-menu,
.nav-dropdown.open .nav-dropdown-menu {
  opacity: 1;
  visibility: visible;
}
.nav-dropdown-item {
  display: block;
  padding: 8px 18px;
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--text-secondary);
  transition: color 0.15s ease, background 0.15s ease;
}
.nav-dropdown-item:hover {
  color: var(--text-primary);
  background: var(--bg-card-hover);
}

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

.nav-lang {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 0.85rem;
  color: var(--text-secondary);
  cursor: pointer;
  padding: 6px 10px;
  border-radius: 8px;
  transition: background var(--dur) var(--ease);
  white-space: nowrap;
  flex-shrink: 0;
}

.nav-lang:hover { background: var(--bg-card); }
.nav-lang.active { color: var(--em-green); }

.nav-theme-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  padding: 0;
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: 8px;
  color: var(--text-secondary);
  cursor: pointer;
  transition: all var(--dur) var(--ease);
}

.nav-theme-toggle:hover {
  background: var(--bg-card-hover);
  border-color: var(--em-green);
  color: var(--em-green);
}

.nav-theme-toggle:focus {
  outline: 2px solid var(--em-green);
  outline-offset: 2px;
}

.nav-theme-toggle .icon-sun,
.nav-theme-toggle .icon-moon {
  display: inline-block;
  vertical-align: middle;
}

.btn-gh-stars {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 7px 14px;
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: 8px;
  font-size: 0.85rem;
  font-weight: 600;
  transition: border-color var(--dur) var(--ease), background var(--dur) var(--ease);
}

.btn-gh-stars:hover { border-color: var(--em-green); background: var(--bg-card-hover); }
.btn-gh-stars svg { width: 16px; height: 16px; }
.btn-gh-stars .count { color: var(--em-green); }

.nav-mobile-toggle { display: none; }

/* ---- Buttons ---- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 28px;
  font-size: 0.95rem;
  font-weight: 600;
  border-radius: 10px;
  cursor: pointer;
  transition: all var(--dur) var(--ease);
  border: none;
  font-family: inherit;
}

.btn-primary {
  background: linear-gradient(135deg, var(--em-green), var(--em-green-dim));
  color: var(--bg-deep);
  box-shadow: 0 4px 24px var(--em-green-glow);
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 32px var(--em-green-glow);
}

.btn-ghost {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  color: var(--text-primary);
}

.btn-ghost:hover {
  border-color: var(--em-green);
  background: var(--bg-card-hover);
}

.btn-lg { padding: 14px 32px; font-size: 1rem; }

/* ---- Hero ---- */
.hero {
  position: relative;
  min-height: 100vh;
  display: flex;
  align-items: center;
  overflow: hidden;
  padding-top: var(--nav-h);
}

#hero-canvas {
  position: absolute;
  top: 0; left: 0;
  width: 100%; height: 100%;
  z-index: 0;
}

.hero-glow {
  position: absolute;
  top: -10%; left: 50%;
  transform: translateX(-50%);
  width: 800px; height: 600px;
  background: radial-gradient(ellipse at center, var(--em-green-glow) 0%, transparent 60%);
  z-index: 1;
  pointer-events: none;
}

.hero-glow-2 {
  position: absolute;
  bottom: -20%; right: -10%;
  width: 600px; height: 500px;
  background: radial-gradient(ellipse at center, rgba(124, 92, 252, 0.15) 0%, transparent 60%);
  z-index: 1;
  pointer-events: none;
}

.hero-content {
  position: relative;
  z-index: 2;
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}

.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 14px;
  background: rgba(0, 217, 126, 0.1);
  border: 1px solid rgba(0, 217, 126, 0.25);
  border-radius: 100px;
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--em-green);
  margin-bottom: 28px;
  backdrop-filter: blur(10px);
}

.hero-badge .dot {
  width: 6px; height: 6px;
  background: var(--em-green);
  border-radius: 50%;
  animation: pulse-dot 2s ease-in-out infinite;
}

@keyframes pulse-dot {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.5; transform: scale(1.3); }
}

.hero h1 {
  font-size: clamp(2.5rem, 6vw, 4.5rem);
  font-weight: 900;
  letter-spacing: -0.04em;
  line-height: 1.05;
  margin-bottom: 24px;
  text-shadow: 0 2px 24px rgba(0, 0, 0, 0.4);
}

.hero-desc {
  font-size: 1.25rem;
  color: var(--text-secondary);
  max-width: 680px;
  margin-bottom: 40px;
  line-height: 1.7;
  text-shadow: 0 1px 12px rgba(0, 0, 0, 0.4);
}

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

.hero-terminal {
  margin-top: 56px;
  max-width: 640px;
  width: 100%;
  text-align: left;
  background: rgba(6, 9, 18, 0.85);
  border: 1px solid var(--border-subtle);
  border-radius: 12px;
  overflow: hidden;
  backdrop-filter: blur(20px);
}

.terminal-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 16px;
  border-bottom: 1px solid var(--border-subtle);
}

.terminal-dot { width: 12px; height: 12px; border-radius: 50%; }
.terminal-dot.r { background: #FF5F57; }
.terminal-dot.y { background: #FEBC2E; }
.terminal-dot.g { background: #28C840; }
.terminal-title { margin-left: 8px; font-size: 0.8rem; color: var(--text-tertiary); }

.terminal-body {
  padding: 20px;
  font-family: 'JetBrains Mono', 'Fira Code', monospace;
  font-size: 0.85rem;
  line-height: 1.8;
}

.terminal-body .prompt { color: var(--em-green); }
.terminal-body .cmd { color: var(--text-primary); }
.terminal-body .out { color: var(--text-secondary); }
.terminal-body .cursor {
  display: inline-block;
  width: 8px; height: 16px;
  background: var(--em-green);
  vertical-align: text-bottom;
  animation: blink 1s step-end infinite;
}

@keyframes blink { 50% { opacity: 0; } }

/* ---- Stats Bar ---- */
.stats {
  border-top: 1px solid var(--border-subtle);
  border-bottom: 1px solid var(--border-subtle);
  background: rgba(10, 14, 26, 0.5);
  padding: 40px 0;
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 32px;
  text-align: center;
}

.stat-value {
  font-size: 2.5rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: var(--text-primary);
}

.stat-value .unit { color: var(--em-green); }

.stat-label {
  font-size: 0.85rem;
  color: var(--text-secondary);
  margin-top: 4px;
}

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

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

.feature-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--em-green), transparent);
  opacity: 0;
  transition: opacity var(--dur) var(--ease);
}

.feature-card:hover {
  border-color: var(--border-glow);
  background: var(--bg-card-hover);
  transform: translateY(-4px);
}

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

.feature-icon {
  width: 48px; height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 217, 126, 0.1);
  border: 1px solid rgba(0, 217, 126, 0.2);
  border-radius: 12px;
  margin-bottom: 20px;
  color: var(--em-green);
}

.feature-icon svg { width: 24px; height: 24px; }

.feature-card h3 {
  font-size: 1.2rem;
  font-weight: 700;
  margin-bottom: 10px;
}

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

/* ---- Architecture ---- */
.arch-section { background: var(--bg-base); }

.arch-diagram {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: 20px;
  padding: 48px;
  position: relative;
  overflow: hidden;
}

.arch-layers {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.arch-layer {
  display: flex;
  align-items: stretch;
  gap: 12px;
}

.arch-layer-label {
  flex-shrink: 0;
  width: 140px;
  display: flex;
  align-items: center;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

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

.arch-node {
  flex: 1;
  min-width: 120px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border-subtle);
  border-radius: 10px;
  padding: 14px 16px;
  text-align: center;
  font-size: 0.85rem;
  font-weight: 500;
  transition: all var(--dur) var(--ease);
}

.arch-node:hover {
  border-color: var(--em-green);
  background: rgba(0, 217, 126, 0.08);
  color: var(--em-green);
}

.arch-node.core {
  background: rgba(0, 217, 126, 0.08);
  border-color: rgba(0, 217, 126, 0.3);
  color: var(--em-green);
  font-weight: 600;
}

.arch-flow {
  text-align: center;
  padding: 8px 0;
  color: var(--text-tertiary);
  font-size: 0.75rem;
  letter-spacing: 0.1em;
}

/* ---- A2A Section ---- */
.a2a-section {
  position: relative;
  overflow: hidden;
}

.a2a-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 64px;
  align-items: center;
}

.a2a-visual {
  position: relative;
  height: 420px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.a2a-card {
  width: 150px;
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: 16px;
  padding: 18px 16px;
  position: absolute;
  transform: translate(-50%, -50%);
  text-align: center;
  backdrop-filter: blur(10px);
  transition: all var(--dur) var(--ease);
}

.a2a-card:hover {
  border-color: var(--em-green);
  transform: translate(-50%, -50%) scale(1.05);
}

.a2a-card .icon { font-size: 1.5rem; margin-bottom: 8px; }
.a2a-card .name { font-size: 0.85rem; font-weight: 600; }
.a2a-card .desc { font-size: 0.75rem; color: var(--text-tertiary); margin-top: 4px; }

.a2a-card.center {
  background: rgba(0, 217, 126, 0.1);
  border-color: var(--em-green);
  box-shadow: 0 0 40px var(--em-green-glow);
  z-index: 2;
}

.a2a-card.center .name { color: var(--em-green); }

/* Circular layout: 6 agents around center bus */
.a2a-visual > .a2a-card:nth-child(1) { top: 12%; left: 50%; }    /* Research Agent */
.a2a-visual > .a2a-card:nth-child(2) { top: 50%; left: 50%; }    /* EventMesh Bus (center) */
.a2a-visual > .a2a-card:nth-child(3) { top: 28%; left: 86%; }    /* Analysis Agent */
.a2a-visual > .a2a-card:nth-child(4) { top: 72%; left: 86%; }   /* Execution Agent */
.a2a-visual > .a2a-card:nth-child(5) { top: 88%; left: 50%; }    /* Risk Agent */
.a2a-visual > .a2a-card:nth-child(6) { top: 72%; left: 14%; }    /* Report Agent */
.a2a-visual > .a2a-card:nth-child(7) { top: 28%; left: 14%; }    /* LLM Agent */

.a2a-features { list-style: none; }
.a2a-features li {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 12px 0;
  font-size: 1rem;
  color: var(--text-secondary);
}

.a2a-features li .check {
  flex-shrink: 0;
  width: 20px; height: 20px;
  background: rgba(0, 217, 126, 0.15);
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--em-green);
  margin-top: 2px;
}

.a2a-features li strong { color: var(--text-primary); }

/* ---- Ecosystem ---- */
.eco-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
}

.eco-item {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: 12px;
  padding: 24px 16px;
  text-align: center;
  transition: all var(--dur) var(--ease);
}

.eco-item:hover {
  border-color: var(--em-green);
  background: var(--bg-card-hover);
  transform: translateY(-2px);
}

.eco-item .eco-icon {
  font-size: 2rem;
  margin-bottom: 10px;
}

.eco-item .eco-name {
  font-size: 0.9rem;
  font-weight: 600;
  margin-bottom: 4px;
}

.eco-item .eco-type {
  font-size: 0.75rem;
  color: var(--text-tertiary);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

/* ---- Event Bus Diagram ---- */
.eco-bus {
  display: flex;
  align-items: center;
  gap: 12px;
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: 20px;
  padding: 28px 20px;
  position: relative;
  overflow: hidden;
}

/* ---- Connector Boxes (Source / Sink) ---- */
.eco-box {
  flex: 0 0 300px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--border-subtle);
  border-radius: 14px;
  padding: 16px;
  transition: border-color var(--dur) var(--ease);
}

.eco-source-box {
  border-color: rgba(139, 92, 246, 0.3);
}
.eco-source-box:hover {
  border-color: rgba(139, 92, 246, 0.6);
}
.eco-sink-box {
  border-color: rgba(6, 182, 212, 0.3);
}
.eco-sink-box:hover {
  border-color: rgba(6, 182, 212, 0.6);
}

.eco-box-title {
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  text-align: center;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--border-subtle);
}

.eco-source-box .eco-box-title { color: var(--em-purple); }
.eco-sink-box .eco-box-title { color: var(--em-cyan); }

.eco-box-grid {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 6px;
}

.eco-box-item {
  font-size: 0.68rem;
  font-weight: 450;
  color: var(--text-secondary);
  padding: 5px 6px;
  border-radius: 6px;
  text-align: center;
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid transparent;
  transition: all var(--dur) var(--ease);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.eco-box-item:hover {
  background: rgba(0, 217, 126, 0.05);
  border-color: rgba(0, 217, 126, 0.2);
  color: var(--text-primary);
}

/* ---- Arrow Block ---- */
.eco-arrow-block {
  flex: 0 0 56px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.eco-arrow-svg {
  width: 100%;
  height: 40px;
  display: block;
}

/* ---- EventMesh Hub (prominent center) ---- */
.eco-hub {
  flex: 0 0 auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  padding: 28px 32px;
  background: rgba(0, 217, 126, 0.04);
  border: 2px solid rgba(0, 217, 126, 0.35);
  border-radius: 20px;
  box-shadow: 0 0 40px rgba(0, 217, 126, 0.15), 0 8px 32px rgba(0, 0, 0, 0.3);
  position: relative;
}

.eco-hub::before {
  content: '';
  position: absolute;
  inset: -3px;
  border-radius: 23px;
  padding: 3px;
  background: linear-gradient(135deg, var(--em-green) 0%, transparent 50%, var(--em-green) 100%);
  -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  opacity: 0.3;
}

.eco-hub-logo {
  width: 64px;
  height: 64px;
  filter: drop-shadow(0 0 16px rgba(0, 217, 126, 0.5));
}

.eco-hub-name {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--em-green);
  letter-spacing: -0.02em;
  white-space: nowrap;
}

.eco-hub-tag {
  font-size: 0.7rem;
  color: var(--text-tertiary);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  background: rgba(0, 217, 126, 0.1);
  padding: 2px 10px;
  border-radius: 12px;
}

/* ---- Code Section ---- */
.code-section { background: var(--bg-base); }

.code-grid {
  display: grid;
  grid-template-columns: 1fr 1.2fr;
  gap: 48px;
  align-items: center;
}

.code-block {
  background: rgba(6, 9, 18, 0.8);
  border: 1px solid var(--border-subtle);
  border-radius: 12px;
  overflow: hidden;
}

.code-tabs {
  display: flex;
  border-bottom: 1px solid var(--border-subtle);
}

.code-tab {
  padding: 12px 20px;
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--text-secondary);
  cursor: pointer;
  border-bottom: 2px solid transparent;
  transition: all var(--dur) var(--ease);
}

.code-tab.active { color: var(--em-green); border-bottom-color: var(--em-green); }

.code-body {
  padding: 24px;
  font-family: 'JetBrains Mono', 'Fira Code', monospace;
  font-size: 0.85rem;
  line-height: 1.8;
  overflow-x: auto;
}

.code-body pre { margin: 0; white-space: pre-wrap; word-break: break-all; }

.code-body .kw { color: #C792EA; }
.code-body .str { color: #C3E88D; }
.code-body .fn { color: #82AAFF; }
.code-body .com { color: #546E7A; font-style: italic; }
.code-body .num { color: #F78C6C; }
.code-body .cls { color: #FFCB6B; }

/* ---- Community CTA ---- */
.cta-section {
  text-align: center;
  padding: 120px 0;
  position: relative;
  overflow: hidden;
}

.cta-bg {
  position: absolute;
  top: 50%; left: 50%;
  transform: translate(-50%, -50%);
  width: 100%; height: 100%;
  background: radial-gradient(ellipse at center, var(--em-green-glow) 0%, transparent 50%);
  z-index: 0;
}

.cta-content { position: relative; z-index: 1; }

.cta-content h2 {
  font-size: 3rem;
  font-weight: 800;
  letter-spacing: -0.03em;
  margin-bottom: 20px;
}

.cta-content p {
  font-size: 1.2rem;
  color: var(--text-secondary);
  max-width: 560px;
  margin: 0 auto 40px;
}

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

/* ---- Footer ---- */
.footer {
  border-top: 1px solid var(--border-subtle);
  background: var(--bg-base);
  padding: 64px 0 32px;
}

.footer-grid {
  display: grid;
  grid-template-columns: 1.5fr 1fr 1fr 1fr 1fr;
  gap: 32px;
  margin-bottom: 48px;
}

.footer-brand .logo { margin-bottom: 16px; }
.footer-brand p { font-size: 0.9rem; color: var(--text-secondary); line-height: 1.7; }

.footer-col h4 {
  font-size: 0.85rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-primary);
  margin-bottom: 16px;
}

.footer-col ul { list-style: none; }
.footer-col li { margin-bottom: 10px; }

.footer-col a {
  font-size: 0.9rem;
  color: var(--text-secondary);
  transition: color var(--dur) var(--ease);
}

.footer-col a:hover { color: var(--em-green); }

.footer-bottom {
  border-top: 1px solid var(--border-subtle);
  padding-top: 24px;
  text-align: center;
  font-size: 0.8rem;
  color: var(--text-tertiary);
}

/* ---- Scroll Reveal (progressive enhancement) ---- */
.reveal {
  opacity: 1;
  transform: none;
  transition: opacity 0.8s var(--ease), transform 0.8s var(--ease);
}

.reveal.visible { opacity: 1; transform: translateY(0); }

/* ---- Responsive ---- */
@media (max-width: 968px) {
  .features-grid { grid-template-columns: repeat(2, 1fr); }
  .eco-grid { grid-template-columns: repeat(3, 1fr); }
  .eco-bus { gap: 8px; padding: 20px 12px; }
  .eco-box { flex: 0 0 240px; padding: 12px; }
  .eco-box-grid { grid-template-columns: 1fr 1fr; }
  .eco-box-item { font-size: 0.62rem; padding: 4px 5px; }
  .eco-arrow-block { flex: 0 0 36px; }
  .eco-hub { padding: 20px 24px; }
  .eco-hub-logo { width: 48px; height: 48px; }
  .eco-hub-name { font-size: 0.95rem; }
  .a2a-grid, .code-grid { grid-template-columns: 1fr; }
  .a2a-visual { height: 320px; }
  .footer-grid { grid-template-columns: repeat(2, 1fr); }
  .stats-grid { grid-template-columns: repeat(2, 1fr); }

  .nav-links { display: none; }
  .nav-mobile-toggle {
    display: flex;
    flex-direction: column;
    gap: 5px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 8px;
  }
  .nav-mobile-toggle span {
    width: 24px; height: 2px;
    background: var(--text-primary);
    border-radius: 1px;
    transition: all var(--dur) var(--ease);
  }
}

@media (max-width: 640px) {
  .section { padding: 64px 0; }
  .section-title { font-size: 1.8rem; }
  .features-grid { grid-template-columns: 1fr; }
  .eco-grid { grid-template-columns: repeat(2, 1fr); }
  .eco-bus { flex-direction: column; gap: 14px; padding: 16px 10px; }
  .eco-box { flex: 0 0 auto; width: 100%; padding: 12px; }
  .eco-box-grid { grid-template-columns: 1fr 1fr 1fr; gap: 4px; }
  .eco-box-item { font-size: 0.6rem; padding: 4px 4px; }
  .eco-arrow-block { flex: 0 0 100%; height: 36px; }
  .eco-arrow-svg { height: 36px; }
  .eco-hub { flex-direction: row; gap: 12px; padding: 14px 18px; }
  .eco-hub-logo { width: 36px; height: 36px; }
  .eco-hub-name { font-size: 0.85rem; }
  .eco-hub-tag { font-size: 0.62rem; }
  .footer-grid { grid-template-columns: 1fr; }
  .stats-grid { grid-template-columns: repeat(2, 1fr); gap: 20px; }
  .stat-value { font-size: 1.8rem; }
  .arch-layer-label { width: 100px; font-size: 0.75rem; }
  .arch-node { min-width: 90px; font-size: 0.75rem; padding: 10px 8px; }
  .cta-content h2 { font-size: 2rem; }
  .hero-terminal { display: none; }
  .hero-content { align-items: flex-start; text-align: left; }
  .hero-actions { justify-content: flex-start; }

  .nav-brand-text { font-size: 0.9rem; }
  .nav-brand-logo img { width: 28px; height: 28px; }

  .a2a-visual {
    height: auto;
    flex-direction: column;
    gap: 12px;
    padding: 24px 0;
  }
  .a2a-card {
    position: relative;
    width: 100%;
    transform: none;
    top: auto !important;
    left: auto !important;
    right: auto !important;
  }
  .a2a-card:hover {
    transform: scale(1.02);
  }
  .a2a-card.center {
    order: -1;
  }
}

/* ---- Mobile Menu ---- */
.mobile-menu {
  position: fixed;
  top: var(--nav-h); left: 0; right: 0; bottom: 0;
  background: var(--bg-deep);
  z-index: 999;
  padding: 32px 24px;
  transform: translateX(100%);
  transition: transform var(--dur) var(--ease);
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.mobile-menu.open { transform: translateX(0); }

.mobile-menu a {
  padding: 16px;
  font-size: 1.1rem;
  font-weight: 500;
  border-bottom: 1px solid var(--border-subtle);
}

.mobile-menu a:hover { color: var(--em-green); }

/* ============================================================
   Light Theme Overrides
   ============================================================ */
html[data-theme="light"] {
  --em-green: #00b86a;
  --em-green-dim: #009b5a;
  --em-green-glow: rgba(0, 184, 106, 0.2);
  --em-purple: #7c5cfc;
  --em-cyan: #0ea5e9;
  --em-amber: #f59e0b;
  --bg-deep: #f8fafc;
  --bg-base: #f1f5f9;
  --bg-card: rgba(15, 23, 42, 0.04);
  --bg-card-hover: rgba(15, 23, 42, 0.08);
  --bg-glass: rgba(255, 255, 255, 0.85);
  --border-subtle: rgba(15, 23, 42, 0.08);
  --border-glow: rgba(0, 184, 106, 0.25);
  --text-primary: #0f172a;
  --text-secondary: #334155;
  --text-tertiary: #64748b;
}

html[data-theme="light"] body {
  background: var(--bg-deep);
  color: var(--text-primary);
}

html[data-theme="light"] .nav.scrolled {
  background: var(--bg-glass);
  border-bottom-color: var(--border-subtle);
}

html[data-theme="light"] .nav-link { color: var(--text-secondary); }
html[data-theme="light"] .nav-link:hover { color: var(--text-primary); background: var(--bg-card); }
html[data-theme="light"] .nav-lang { color: var(--text-secondary); }
html[data-theme="light"] .nav-lang:hover { background: var(--bg-card); }
html[data-theme="light"] .nav-theme-toggle { color: var(--text-secondary); background: var(--bg-card); border-color: var(--border-subtle); }
html[data-theme="light"] .nav-theme-toggle:hover { color: var(--em-green); border-color: var(--em-green); background: var(--bg-card-hover); }
html[data-theme="light"] .btn-gh-stars { background: var(--bg-card); border-color: var(--border-subtle); color: var(--text-secondary); }
html[data-theme="light"] .btn-gh-stars:hover { border-color: var(--em-green); background: var(--bg-card-hover); }

html[data-theme="light"] .hero { background: radial-gradient(ellipse at 80% 20%, rgba(0, 184, 106, 0.12) 0%, transparent 40%), radial-gradient(ellipse at 20% 80%, rgba(124, 92, 252, 0.1) 0%, transparent 40%), linear-gradient(135deg, #f8fafc 0%, #f1f5f9 50%, #e2e8f0 100%); }
html[data-theme="light"] .hero h1 { color: var(--text-primary); text-shadow: 0 2px 20px rgba(15, 23, 42, 0.08); }
html[data-theme="light"] .hero-desc { color: var(--text-secondary); }
html[data-theme="light"] .hero-terminal { background: rgba(255, 255, 255, 0.92); border-color: var(--border-subtle); box-shadow: 0 20px 50px rgba(0, 0, 0, 0.08); }
html[data-theme="light"] .terminal-header { border-bottom-color: var(--border-subtle); }
html[data-theme="light"] .terminal-title { color: var(--text-tertiary); }
html[data-theme="light"] .terminal-body { color: var(--text-primary); }
html[data-theme="light"] .terminal-body .prompt { color: var(--em-green); }
html[data-theme="light"] .terminal-body .cmd { color: var(--text-primary); }
html[data-theme="light"] .terminal-body .out { color: var(--text-secondary); }
html[data-theme="light"] .hero-pill { background: rgba(0, 184, 106, 0.1); border-color: rgba(0, 184, 106, 0.25); color: var(--em-green); }
html[data-theme="light"] .hero-pill:hover { background: rgba(0, 184, 106, 0.18); }
html[data-theme="light"] .hero-pill .arrow { color: var(--em-green); }

html[data-theme="light"] .trusted-by,
html[data-theme="light"] .stats-section { background: var(--bg-base); }
html[data-theme="light"] .trusted-by-title,
html[data-theme="light"] .stat-label { color: var(--text-tertiary); }
html[data-theme="light"] .stat-value { color: var(--text-primary); }
html[data-theme="light"] .stat-value .unit { color: var(--em-green); }
html[data-theme="light"] .trusted-logo { color: var(--text-tertiary); opacity: 0.5; }
html[data-theme="light"] .trusted-logo:hover { color: var(--em-green); opacity: 1; }

html[data-theme="light"] .feature-card { background: var(--bg-card); border-color: var(--border-subtle); }
html[data-theme="light"] .feature-card:hover { background: var(--bg-card-hover); border-color: var(--border-glow); }
html[data-theme="light"] .feature-card p { color: var(--text-secondary); }
html[data-theme="light"] .feature-icon { background: rgba(0, 184, 106, 0.08); }

html[data-theme="light"] .arch-diagram { background: var(--bg-card); border-color: var(--border-subtle); }
html[data-theme="light"] .arch-flow { color: var(--text-tertiary); }
html[data-theme="light"] .arch-layer-label { color: var(--text-tertiary); }
html[data-theme="light"] .arch-node { background: var(--bg-base); border-color: var(--border-subtle); color: var(--text-secondary); }
html[data-theme="light"] .arch-node:hover { border-color: var(--em-green); color: var(--text-primary); background: rgba(255, 255, 255, 0.95); }
html[data-theme="light"] .arch-node.core { background: rgba(0, 184, 106, 0.08); border-color: rgba(0, 184, 106, 0.25); color: var(--em-green); }

html[data-theme="light"] .a2a-section { background: var(--bg-base); }
html[data-theme="light"] .a2a-visual { background: var(--bg-card); border-color: var(--border-subtle); }
html[data-theme="light"] .a2a-card { background: var(--bg-base); border-color: var(--border-subtle); }
html[data-theme="light"] .a2a-card:hover { border-color: var(--em-green); }
html[data-theme="light"] .a2a-card .desc { color: var(--text-tertiary); }
html[data-theme="light"] .a2a-card.center { background: rgba(0, 184, 106, 0.08); border-color: var(--em-green); }
html[data-theme="light"] .a2a-connect { background: linear-gradient(90deg, var(--em-green), var(--em-purple)); }
html[data-theme="light"] .a2a-pulse { background: rgba(0, 184, 106, 0.2); }

html[data-theme="light"] .eco-card { background: var(--bg-card); border-color: var(--border-subtle); }
html[data-theme="light"] .eco-card:hover { background: var(--bg-card-hover); border-color: var(--border-glow); }
html[data-theme="light"] .eco-card p { color: var(--text-secondary); }
html[data-theme="light"] .eco-bus { background: var(--bg-card); border-color: var(--border-subtle); }
html[data-theme="light"] .eco-box { background: rgba(15, 23, 42, 0.02); border-color: var(--border-subtle); }
html[data-theme="light"] .eco-box-item { background: rgba(15, 23, 42, 0.02); color: var(--text-secondary); }
html[data-theme="light"] .eco-box-item:hover { background: rgba(0, 184, 106, 0.05); color: var(--text-primary); border-color: rgba(0, 184, 106, 0.2); }
html[data-theme="light"] .eco-box-title { border-bottom-color: var(--border-subtle); }
html[data-theme="light"] .eco-hub { background: rgba(0, 184, 106, 0.06); border-color: rgba(0, 184, 106, 0.3); }

html[data-theme="light"] .code-tabs { background: var(--bg-card); border-color: var(--border-subtle); }
html[data-theme="light"] .code-tab { color: var(--text-secondary); }
html[data-theme="light"] .code-tab:hover { background: var(--bg-card-hover); color: var(--text-primary); }
html[data-theme="light"] .code-tab.active { background: var(--bg-base); color: var(--em-green); border-bottom-color: var(--em-green); }
html[data-theme="light"] .code-window { background: var(--bg-base); border-color: var(--border-subtle); }
html[data-theme="light"] .code-window pre { color: var(--text-primary); }
html[data-theme="light"] .code-window .code-line { color: var(--text-secondary); }
html[data-theme="light"] .code-window .token-keyword { color: #c026d3; }
html[data-theme="light"] .code-window .token-string { color: var(--em-green); }
html[data-theme="light"] .code-window .token-comment { color: var(--text-tertiary); }
html[data-theme="light"] .code-window .token-function { color: #2563eb; }

html[data-theme="light"] .cta-section { background: linear-gradient(135deg, #f0fdf4 0%, #f1f5f9 100%); }
html[data-theme="light"] .cta-content { background: rgba(255, 255, 255, 0.92); border-color: var(--border-subtle); }
html[data-theme="light"] .cta-content h2 { color: var(--text-primary); }
html[data-theme="light"] .cta-content p { color: var(--text-secondary); }

html[data-theme="light"] .footer { background: var(--bg-deep); border-top-color: var(--border-subtle); }
html[data-theme="light"] .footer-col h4 { color: var(--text-primary); }
html[data-theme="light"] .footer-col a { color: var(--text-secondary); }
html[data-theme="light"] .footer-col a:hover { color: var(--em-green); }
html[data-theme="light"] .footer-bottom { color: var(--text-tertiary); border-top-color: var(--border-subtle); }
html[data-theme="light"] .mobile-menu { background: var(--bg-deep); }
html[data-theme="light"] .mobile-menu a { border-bottom-color: var(--border-subtle); color: var(--text-primary); }
html[data-theme="light"] .mobile-menu a:hover { color: var(--em-green); }

