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

:root {
  --text: #1a1a1a;
  --text-secondary: #555;
  --text-muted: #888;
  --bg: #ffffff;
  --bg-alt: #fafafa;
  --border: #e8e8e8;
  --accent: #e85d26;
  --accent-light: #fff4f0;
  --code-bg: #f5f5f5;
  --radius: 8px;
  --font: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  --mono: 'JetBrains Mono', 'SF Mono', 'Fira Code', monospace;
}

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: var(--font);
  color: var(--text);
  background: var(--bg);
  line-height: 1.7;
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
}

/* Nav */
.nav {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

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

.nav-logo {
  font-weight: 700;
  font-size: 18px;
  color: var(--text);
  text-decoration: none;
  letter-spacing: -0.02em;
}

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

.nav-links a {
  color: var(--text-secondary);
  text-decoration: none;
  font-size: 14px;
  font-weight: 500;
  transition: color 0.15s;
}

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

/* Container */
.container {
  max-width: 1080px;
  margin: 0 auto;
  padding: 0 24px;
}

/* Hero */
.hero {
  padding: 100px 0 80px;
  text-align: center;
}

.hero-tag {
  font-size: 13px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--accent);
  margin-bottom: 16px;
}

.hero h1 {
  font-size: clamp(42px, 6vw, 64px);
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1.1;
  margin-bottom: 20px;
}

.hero-subtitle {
  font-size: 18px;
  color: var(--text-secondary);
  max-width: 560px;
  margin: 0 auto 48px;
  line-height: 1.6;
}

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

.stat {
  display: flex;
  flex-direction: column;
}

.stat-value {
  font-size: 32px;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--text);
}

.stat-label {
  font-size: 13px;
  color: var(--text-muted);
  font-weight: 500;
}

/* Sections */
.section {
  padding: 80px 0;
}

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

.section h2 {
  font-size: 32px;
  font-weight: 700;
  letter-spacing: -0.02em;
  margin-bottom: 12px;
}

.section-intro {
  font-size: 17px;
  color: var(--text-secondary);
  max-width: 680px;
  margin-bottom: 48px;
  line-height: 1.7;
}

/* Cards */
.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 24px;
}

.card {
  padding: 28px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg);
}

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

.card p {
  font-size: 15px;
  color: var(--text-secondary);
  line-height: 1.6;
}

/* Timeline */
.timeline {
  position: relative;
  padding-left: 32px;
}

.timeline::before {
  content: '';
  position: absolute;
  left: 0;
  top: 8px;
  bottom: 8px;
  width: 2px;
  background: var(--border);
}

.timeline-item {
  position: relative;
  padding-bottom: 36px;
}

.timeline-item:last-child {
  padding-bottom: 0;
}

.timeline-item::before {
  content: '';
  position: absolute;
  left: -36px;
  top: 6px;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--accent);
}

.timeline-date {
  font-size: 13px;
  font-weight: 600;
  color: var(--accent);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 4px;
}

.timeline-content h4 {
  font-size: 17px;
  font-weight: 600;
  margin-bottom: 4px;
}

.timeline-content p {
  font-size: 15px;
  color: var(--text-secondary);
  line-height: 1.6;
}

/* Architecture Diagram */
.arch-diagram {
  max-width: 640px;
  margin: 0 auto 48px;
  text-align: center;
}

.arch-row {
  display: flex;
  justify-content: center;
  gap: 24px;
}

.arch-row-split {
  display: flex;
  justify-content: center;
  gap: 24px;
}

.arch-box {
  padding: 20px 28px;
  border-radius: var(--radius);
  font-weight: 600;
  font-size: 16px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 240px;
  border: 1px solid var(--border);
  background: var(--bg);
}

.arch-box span {
  font-size: 12px;
  font-weight: 400;
  color: var(--text-muted);
}

.arch-channels { border-left: 3px solid #6366f1; }
.arch-gateway { border-left: 3px solid var(--accent); }
.arch-brain { border-left: 3px solid #10b981; }
.arch-memory { border-left: 3px solid #f59e0b; }
.arch-skills { border-left: 3px solid #8b5cf6; }

.arch-arrow, .arch-arrow-split {
  padding: 8px 0;
  font-size: 20px;
  color: var(--text-muted);
}

.arch-arrow-split {
  display: flex;
  justify-content: center;
  gap: 180px;
}

/* Component Details */
.component-details {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 24px;
}

.component h3 {
  font-size: 16px;
  font-weight: 600;
  margin-bottom: 6px;
}

.component p {
  font-size: 14px;
  color: var(--text-secondary);
  line-height: 1.6;
}

/* Feature Grid */
.feature-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 32px;
}

.feature-icon {
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  background: var(--accent-light);
  color: var(--accent);
  margin-bottom: 12px;
}

.feature h3 {
  font-size: 16px;
  font-weight: 600;
  margin-bottom: 6px;
}

.feature p {
  font-size: 14px;
  color: var(--text-secondary);
  line-height: 1.6;
}

/* Ecosystem */
.eco-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 24px;
}

.eco-item {
  padding: 28px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg);
}

.eco-item h3 {
  font-size: 17px;
  font-weight: 600;
  margin-bottom: 8px;
}

.eco-item p {
  font-size: 15px;
  color: var(--text-secondary);
  line-height: 1.6;
}

.link {
  display: inline-block;
  margin-top: 8px;
  color: var(--accent);
  text-decoration: none;
  font-size: 14px;
  font-weight: 500;
}

.link:hover {
  text-decoration: underline;
}

/* Comparison Table */
.table-wrapper {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.comparison-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}

.comparison-table th,
.comparison-table td {
  padding: 12px 16px;
  text-align: left;
  border-bottom: 1px solid var(--border);
}

.comparison-table th {
  font-weight: 600;
  font-size: 13px;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.comparison-table th:first-child {
  color: var(--text);
}

.comparison-table td:first-child {
  font-weight: 500;
  color: var(--text);
}

.comparison-table td {
  color: var(--text-secondary);
}

.comparison-table td:nth-child(2) {
  color: var(--text);
  font-weight: 500;
}

/* Steps */
.steps {
  display: flex;
  flex-direction: column;
  gap: 36px;
}

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

.step-num {
  flex-shrink: 0;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--text);
  color: var(--bg);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 15px;
  margin-top: 2px;
}

.step-content {
  flex: 1;
}

.step-content h3 {
  font-size: 18px;
  font-weight: 600;
  margin-bottom: 8px;
}

.step-content p {
  font-size: 15px;
  color: var(--text-secondary);
  margin-top: 8px;
}

pre, code {
  font-family: var(--mono);
}

pre {
  background: var(--code-bg);
  padding: 16px 20px;
  border-radius: var(--radius);
  overflow-x: auto;
  font-size: 14px;
  line-height: 1.6;
}

code {
  font-size: 0.9em;
}

p code {
  background: var(--code-bg);
  padding: 2px 6px;
  border-radius: 4px;
  font-size: 13px;
}

.config-block {
  max-width: 560px;
}

/* Resources */
.resource-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 16px;
}

.resource {
  display: block;
  padding: 24px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  text-decoration: none;
  transition: border-color 0.15s;
}

.resource:hover {
  border-color: var(--text-muted);
}

.resource h3 {
  font-size: 16px;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 4px;
}

.resource p {
  font-size: 14px;
  color: var(--text-secondary);
}

/* Footer */
.footer {
  padding: 48px 0;
  text-align: center;
}

.footer p {
  font-size: 14px;
  color: var(--text-secondary);
}

.footer a {
  color: var(--text);
  text-decoration: none;
  font-weight: 500;
}

.footer a:hover {
  text-decoration: underline;
}

.footer-note {
  margin-top: 8px;
  font-size: 12px;
  color: var(--text-muted);
}

/* Mobile */
@media (max-width: 768px) {
  .nav-links {
    display: none;
  }

  .hero {
    padding: 60px 0 48px;
  }

  .hero-stats {
    gap: 24px;
  }

  .stat-value {
    font-size: 24px;
  }

  .section {
    padding: 56px 0;
  }

  .section h2 {
    font-size: 26px;
  }

  .arch-arrow-split {
    gap: 60px;
  }

  .arch-box {
    min-width: auto;
    padding: 14px 18px;
    font-size: 14px;
  }

  .step {
    flex-direction: column;
    gap: 12px;
  }

  .feature-grid {
    grid-template-columns: 1fr;
    gap: 24px;
  }
}

@media (max-width: 480px) {
  .hero h1 {
    font-size: 36px;
  }

  .hero-stats {
    flex-direction: column;
    align-items: center;
    gap: 16px;
  }

  .arch-row-split {
    flex-direction: column;
    align-items: center;
  }

  .arch-arrow-split {
    gap: 0;
  }
}