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

/* Dark theme (default) — matches logo: red claw, green/blue/purple nodes */
:root,
[data-theme="dark"] {
  --bg: #0d0d12;
  --bg-alt: #111118;
  --surface: #181820;
  --surface-hover: #22222e;
  --border: #2a2a3a;
  --text: #eaeaf0;
  --text-muted: #8888a0;
  --accent: #d94040;
  --accent-light: #ef5350;
  --accent-glow: rgba(217, 64, 64, 0.2);
  --green: #2ecc71;
  --green-glow: rgba(46, 204, 113, 0.15);
  --blue: #5dade2;
  --purple: #b388ff;
  --peach: #f0a87e;
  --nav-bg: rgba(13, 13, 18, 0.85);
  --radius: 12px;
  --radius-sm: 8px;
  --font: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
  --mono: 'JetBrains Mono', 'Fira Code', 'Cascadia Code', 'Consolas', monospace;
}

/* Light theme */
[data-theme="light"] {
  --bg: #f8f8fa;
  --bg-alt: #f0f0f4;
  --surface: #ffffff;
  --surface-hover: #f0f0f5;
  --border: #dcdce4;
  --text: #1a1a2e;
  --text-muted: #5c5c72;
  --accent: #c0392b;
  --accent-light: #d94040;
  --accent-glow: rgba(192, 57, 43, 0.12);
  --green: #219653;
  --green-glow: rgba(33, 150, 83, 0.1);
  --blue: #2980b9;
  --purple: #7c4dff;
  --peach: #d47a4e;
  --nav-bg: rgba(248, 248, 250, 0.9);
}

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800&family=JetBrains+Mono:wght@400;500&display=swap');

html {
  scroll-behavior: smooth;
  -webkit-font-smoothing: antialiased;
}

body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  overflow-x: hidden;
}

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

a:hover {
  color: var(--green);
}

code {
  font-family: var(--mono);
  font-size: 0.9em;
  background: var(--surface);
  padding: 2px 6px;
  border-radius: 4px;
}

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

/* === Nav === */
/* === Alpha Banner === */
.alpha-banner {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 8px 16px;
  background: linear-gradient(135deg, var(--accent-light), var(--blue));
  color: #fff;
  font-size: 0.85rem;
  font-weight: 500;
  text-align: center;
}

.alpha-banner[hidden] { display: none; }

.alpha-banner a {
  color: #fff;
  font-weight: 700;
  text-decoration: underline;
  text-underline-offset: 2px;
}

.alpha-banner-close {
  background: none;
  border: none;
  color: #fff;
  font-size: 1.2rem;
  cursor: pointer;
  margin-left: 8px;
  line-height: 1;
  opacity: 0.8;
}

.alpha-banner-close:hover { opacity: 1; }

.nav {
  position: fixed;
  top: 36px;
  left: 0;
  right: 0;
  z-index: 100;
  background: var(--nav-bg);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border);
  transition: top 0.2s ease;
}

.alpha-banner[hidden] ~ .nav { top: 0; }

/* === Theme Toggle === */
.theme-toggle {
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--text-muted);
  width: 36px;
  height: 36px;
  border-radius: 8px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: color 0.2s, border-color 0.2s, background 0.2s;
  padding: 0;
  flex-shrink: 0;
}

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

.theme-toggle .icon-sun,
.theme-toggle .icon-moon { display: none; }

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

.nav-inner {
  max-width: 1100px;
  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: 10px;
  font-weight: 700;
  font-size: 1.1rem;
  color: var(--text);
}

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

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

.nav-links a {
  color: var(--text-muted);
  font-size: 0.9rem;
  font-weight: 500;
  transition: color 0.2s;
}

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

.nav-mobile-toggle {
  display: none;
  background: none;
  border: none;
  color: var(--text);
  cursor: pointer;
  padding: 4px;
}

/* === Hero === */
.hero {
  position: relative;
  padding: 156px 0 60px;
  text-align: center;
  overflow: hidden;
}

.hero-glow {
  position: absolute;
  top: -200px;
  left: 50%;
  transform: translateX(-50%);
  width: 800px;
  height: 600px;
  background: radial-gradient(ellipse, rgba(93, 173, 226, 0.12) 0%, rgba(46, 204, 113, 0.06) 40%, transparent 70%);
  pointer-events: none;
  z-index: 0;
}

.hero .container {
  position: relative;
  z-index: 1;
}

.badge {
  display: inline-block;
  padding: 6px 16px;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--accent-light);
  background: var(--accent-glow);
  border: 1px solid rgba(217, 64, 64, 0.25);
  border-radius: 100px;
  margin-bottom: 28px;
  letter-spacing: 0.03em;
}

[data-theme="light"] .badge {
  border-color: rgba(192, 57, 43, 0.3);
}

.hero h1 {
  font-size: clamp(2.5rem, 6vw, 4rem);
  font-weight: 800;
  line-height: 1.15;
  letter-spacing: -0.03em;
  margin-bottom: 24px;
}

.gradient-text {
  background: linear-gradient(135deg, var(--accent-light) 0%, var(--blue) 50%, var(--green) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.hero-tagline {
  font-size: 3.4rem;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 24px;
  letter-spacing: -0.02em;
  line-height: 1.3;
}

.hero-sub {
  font-size: 1.15rem;
  color: var(--text-muted);
  max-width: 560px;
  margin: 0 auto 24px;
  line-height: 1.7;
}

.hero-sub code {
  color: var(--green);
  background: var(--green-glow);
  border: 1px solid rgba(46, 204, 113, 0.25);
}

.hero-actions {
  display: flex;
  gap: 12px;
  justify-content: center;
  align-items: center;
  flex-wrap: wrap;
  margin-bottom: 0;
}

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

.btn-primary {
  background: var(--accent);
  color: #fff;
  box-shadow: 0 0 20px var(--accent-glow);
}

.btn-primary:hover {
  background: var(--accent-light);
  color: #fff;
  box-shadow: 0 0 30px var(--accent-glow);
  transform: translateY(-1px);
}

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

.btn-secondary:hover {
  background: var(--surface-hover);
  color: var(--text);
  border-color: var(--text-muted);
  transform: translateY(-1px);
}

.hero-install {
  display: flex;
  justify-content: center;
}

.hero-image {
  margin-top: 20px;
  margin-bottom: 16px;
  display: flex;
  justify-content: center;
}

.hero-image img {
  max-width: 260px;
  width: 100%;
  height: auto;
  border-radius: var(--radius);
  box-shadow: 0 8px 40px rgba(0, 0, 0, 0.3);
}

[data-theme="light"] .hero-image img {
  box-shadow: 0 8px 40px rgba(0, 0, 0, 0.1);
}

.install-box {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 20px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-family: var(--mono);
  font-size: 0.95rem;
}

.install-box .prompt {
  color: var(--green);
}

.copy-btn {
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  padding: 4px;
  transition: color 0.2s;
  display: flex;
  align-items: center;
}

.copy-btn:hover {
  color: var(--text);
}

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

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

.section-title {
  font-size: 2rem;
  font-weight: 700;
  text-align: center;
  margin-bottom: 12px;
  letter-spacing: -0.02em;
}

.section-sub {
  text-align: center;
  color: var(--text-muted);
  font-size: 1.05rem;
  max-width: 520px;
  margin: 0 auto 36px;
}

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

.openclaw-options {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 24px;
  max-width: 800px;
  margin: 0 auto;
}
.openclaw-options .feature-card {
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
}
.openclaw-options .btn {
  margin-top: auto;
}

.feature-card {
  padding: 28px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  transition: border-color 0.2s, transform 0.2s;
}

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

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

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

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

/* === Tabs === */
.tabs {
  display: flex;
  gap: 4px;
  justify-content: center;
  margin-bottom: 24px;
  background: var(--surface);
  border-radius: var(--radius-sm);
  padding: 4px;
  display: inline-flex;
  margin-left: 50%;
  transform: translateX(-50%);
}

.tab {
  padding: 10px 24px;
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 0.9rem;
  font-weight: 500;
  cursor: pointer;
  border-radius: 6px;
  transition: all 0.2s;
  font-family: var(--font);
}

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

.tab.active {
  background: var(--accent);
  color: #fff;
}

.tab-content {
  display: none;
  max-width: 720px;
  margin: 0 auto;
}

.tab-content.active {
  display: block;
}

.tab-content pre {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 28px;
  overflow-x: auto;
  font-family: var(--mono);
  font-size: 0.88rem;
  line-height: 1.8;
}

.tab-content pre code {
  background: none;
  padding: 0;
  font-size: inherit;
}

.comment { color: #636380; }
.keyword { color: var(--accent-light); }
.string { color: var(--green); }
.prompt { color: var(--green); user-select: none; }
.output { color: #636380; }

/* === Architecture === */
.arch-pipeline {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  margin-bottom: 60px;
  flex-wrap: wrap;
}

.arch-step {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 24px 28px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  min-width: 120px;
}

.arch-icon {
  color: var(--accent-light);
}

.arch-label {
  font-weight: 600;
  font-size: 0.95rem;
}

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

.arch-arrow {
  font-size: 1.5rem;
  color: var(--text-muted);
  font-weight: 300;
}

.stack-table {
  max-width: 700px;
  margin: 0 auto;
}

.stack-table h3 {
  font-size: 1.2rem;
  font-weight: 600;
  margin-bottom: 16px;
  text-align: center;
}

.stack-table table {
  width: 100%;
  border-collapse: collapse;
}

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

.stack-table th {
  color: var(--text-muted);
  font-weight: 500;
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.stack-table td:first-child {
  font-weight: 600;
  color: var(--accent-light);
}

/* === Models Carousel === */
.carousel-wrapper {
  display: flex;
  align-items: center;
  gap: 12px;
  position: relative;
}

.carousel-track {
  display: flex;
  gap: 20px;
  overflow-x: auto;
  scroll-behavior: smooth;
  scroll-snap-type: x mandatory;
  -ms-overflow-style: none;
  scrollbar-width: none;
  padding: 16px 4px;
}

.carousel-track::-webkit-scrollbar {
  display: none;
}

.carousel-btn {
  flex-shrink: 0;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text-muted);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
  z-index: 2;
}

.carousel-btn:hover {
  border-color: var(--accent);
  color: var(--text);
  background: var(--surface-hover);
}

.carousel-dots {
  display: flex;
  justify-content: center;
  gap: 8px;
  margin-top: 8px;
}

.carousel-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--border);
  border: none;
  padding: 0;
  cursor: pointer;
  transition: background 0.2s, transform 0.2s;
}

.carousel-dot.active {
  background: var(--accent);
  transform: scale(1.3);
}

.model-card {
  min-width: 280px;
  max-width: 300px;
  flex-shrink: 0;
  padding: 28px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  position: relative;
  transition: border-color 0.2s, transform 0.2s;
  scroll-snap-align: start;
}

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

.model-card.recommended {
  border-color: var(--green);
  background: linear-gradient(to bottom, var(--green-glow), transparent);
}

.model-card.model-local {
  border-style: dashed;
}

.model-card.model-local:hover {
  border-color: var(--blue);
}

.model-badge {
  position: absolute;
  top: -10px;
  left: 16px;
  padding: 2px 10px;
  background: var(--green);
  color: #0a0a0f;
  font-size: 0.7rem;
  font-weight: 700;
  border-radius: 4px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.model-lab {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: 6px;
}

.model-card h3 {
  font-family: var(--mono);
  font-size: 1rem;
  font-weight: 600;
  margin-bottom: 8px;
  color: var(--text);
}

.model-type {
  font-size: 0.75rem;
  color: var(--accent-light);
  margin-bottom: 12px;
  font-weight: 500;
}

.model-local .model-type {
  color: var(--blue);
}

.model-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 14px;
}

.model-stats span {
  font-size: 0.75rem;
  color: var(--text-muted);
  background: rgba(255, 255, 255, 0.04);
  padding: 3px 10px;
  border-radius: 100px;
  border: 1px solid var(--border);
}

[data-theme="light"] .model-stats span {
  background: var(--bg-alt);
}

.model-card p {
  font-size: 0.85rem;
  color: var(--text-muted);
  line-height: 1.55;
}

/* === CTA === */
.cta-section {
  text-align: center;
  padding: 48px 0;
  background: linear-gradient(to bottom, var(--bg), var(--bg-alt));
}

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

.cta-section p {
  color: var(--text-muted);
  font-size: 1.05rem;
  margin-bottom: 32px;
}

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

.footer-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 16px;
}

.footer-brand {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 600;
  font-size: 0.95rem;
}

.footer-links {
  display: flex;
  gap: 24px;
}

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

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

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

.footer-disclaimer {
  width: 100%;
  text-align: center;
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid var(--border);
  opacity: 0.7;
}

/* === Pipeline Labels === */
.pipeline-label {
  text-align: center;
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--accent-light);
  margin-bottom: 20px;
  letter-spacing: 0.02em;
}

/* === Memory Types === */
.memory-types-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 20px;
}

.memory-type-card {
  padding: 24px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  transition: border-color 0.2s, transform 0.2s;
}

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

.memory-type-icon {
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--accent-glow);
  border-radius: 10px;
  margin-bottom: 14px;
  color: var(--accent-light);
}

.memory-type-card h4 {
  font-size: 1rem;
  font-weight: 600;
  margin-bottom: 8px;
}

.memory-type-card p {
  font-size: 0.85rem;
  color: var(--text-muted);
  line-height: 1.55;
  margin-bottom: 12px;
}

.memory-example {
  display: block;
  font-size: 0.78rem;
  color: var(--green);
  background: var(--green-glow);
  border: 1px solid rgba(46, 204, 113, 0.2);
  padding: 6px 10px;
  border-radius: 6px;
  line-height: 1.4;
}

/* === Coming Soon / BYODB === */
.coming-soon-section {
  background: var(--bg);
}

.coming-soon-badge {
  display: inline-block;
  padding: 6px 16px;
  font-size: 0.8rem;
  font-weight: 700;
  color: #f0a500;
  background: rgba(240, 165, 0, 0.1);
  border: 1px solid rgba(240, 165, 0, 0.25);
  border-radius: 100px;
  margin-bottom: 20px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  text-align: center;
  display: block;
  width: fit-content;
  margin-left: auto;
  margin-right: auto;
}

.byodb-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
  max-width: 900px;
  margin: 0 auto;
}

.byodb-card {
  padding: 28px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  text-align: center;
  transition: border-color 0.2s, transform 0.2s;
}

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

.byodb-logo {
  width: auto;
  height: 56px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 16px;
}

/* Theme-aware logos */
.logo-light-only { display: none; }
.logo-dark-only { display: block; }
[data-theme="light"] .logo-light-only { display: block; }
[data-theme="light"] .logo-dark-only { display: none; }

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

.byodb-status {
  display: inline-block;
  font-size: 0.75rem;
  font-weight: 600;
  padding: 3px 10px;
  border-radius: 100px;
  margin-bottom: 12px;
  color: #f0a500;
  background: rgba(240, 165, 0, 0.1);
  border: 1px solid rgba(240, 165, 0, 0.2);
}

.byodb-status.byodb-available {
  color: var(--green);
  background: var(--green-glow);
  border-color: rgba(46, 204, 113, 0.25);
}

.byodb-card p {
  font-size: 0.85rem;
  color: var(--text-muted);
  line-height: 1.5;
}

/* === Comparison Table (.md vs Graph) === */
.comparison-table {
  max-width: 860px;
  margin: 0 auto;
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid var(--border);
}

.comparison-table table {
  width: 100%;
  border-collapse: collapse;
}

.comparison-table th,
.comparison-table td {
  padding: 14px 20px;
  text-align: left;
  font-size: 0.9rem;
  border-bottom: 1px solid var(--border);
}

.comparison-table thead th {
  background: var(--surface);
  font-weight: 600;
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-muted);
}

.comparison-table thead th:first-child {
  width: 22%;
}

.comparison-table thead th.compare-header-md {
  color: var(--text-muted);
}

.comparison-table thead th.compare-header-graph {
  color: var(--green);
}

.comparison-table tbody tr {
  transition: background 0.15s;
}

.comparison-table tbody tr:hover {
  background: var(--surface-hover);
}

.comparison-table tbody tr:last-child td {
  border-bottom: none;
}

.compare-label {
  font-weight: 600;
  color: var(--text);
}

.compare-bad {
  color: var(--text-muted);
  opacity: 0.85;
}

.compare-good {
  color: var(--green);
  font-weight: 500;
}

.comparison-table td svg {
  vertical-align: middle;
  margin-right: 4px;
}

/* === Works With Grid === */
.grid-4 {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 20px;
}

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  transition: border-color 0.2s, transform 0.2s;
}

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

.card h4 {
  font-size: 1.05rem;
  font-weight: 600;
  margin-bottom: 8px;
}

/* === Subscribe === */
.subscribe-section {
  background: var(--bg-alt);
  text-align: center;
}

.subscribe-form {
  max-width: 480px;
  margin: 0 auto;
}

.subscribe-input-group {
  display: flex;
  gap: 8px;
  justify-content: center;
  flex-wrap: wrap;
}

.subscribe-input {
  flex: 1;
  min-width: 220px;
  padding: 12px 18px;
  font-size: 0.95rem;
  font-family: var(--font);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text);
  transition: border-color 0.2s, box-shadow 0.2s;
  outline: none;
}

.subscribe-input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-glow);
}

.subscribe-input::placeholder {
  color: var(--text-muted);
}

.subscribe-btn {
  flex-shrink: 0;
}

.subscribe-note {
  margin-top: 12px;
  font-size: 0.8rem;
  color: var(--text-muted);
}

.subscribe-success {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin-top: 16px;
  color: var(--green);
  font-size: 0.95rem;
  font-weight: 500;
}

.subscribe-success[hidden],
.subscribe-error[hidden] {
  display: none;
}

.subscribe-error {
  margin-top: 12px;
  color: var(--accent-light);
  font-size: 0.9rem;
}

/* === Responsive === */
@media (max-width: 1100px) {
  .carousel-btn {
    display: none;
  }
}

@media (max-width: 900px) {
  .features-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .grid-4 {
    grid-template-columns: repeat(2, 1fr);
  }

  .memory-types-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .byodb-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 640px) {
  .nav-links {
    display: none;
    position: absolute;
    top: 64px;
    left: 0;
    right: 0;
    background: var(--nav-bg);
    backdrop-filter: blur(20px);
    flex-direction: column;
    padding: 24px;
    gap: 20px;
    border-bottom: 1px solid var(--border);
  }

  .nav-links.open {
    display: flex;
  }

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

  .hero {
    padding: 136px 0 40px;
  }

  .alpha-banner {
    font-size: 0.75rem;
    gap: 8px;
    flex-wrap: wrap;
  }

  .hero h1 {
    font-size: 2rem;
  }

  .hero-sub {
    font-size: 1rem;
  }

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

  .openclaw-options {
    grid-template-columns: 1fr;
  }

  .memory-types-grid {
    grid-template-columns: 1fr;
  }

  .byodb-grid {
    grid-template-columns: 1fr;
  }

  .arch-pipeline {
    flex-direction: column;
  }

  .arch-arrow {
    transform: rotate(90deg);
  }

  .section {
    padding: 40px 0;
  }

  .section-title {
    font-size: 1.5rem;
  }

  .footer-inner {
    flex-direction: column;
    text-align: center;
  }

  .tabs {
    flex-wrap: wrap;
  }

  .install-box {
    font-size: 0.8rem;
  }

  .hero-tagline {
    font-size: 1.8rem;
  }

  .grid-4 {
    grid-template-columns: 1fr;
  }

  .comparison-table {
    overflow-x: auto;
  }

  .comparison-table th,
  .comparison-table td {
    padding: 10px 12px;
    font-size: 0.82rem;
    white-space: nowrap;
  }
}

/* === Claw Machine Game === */
.game-wrapper {
  position: relative;
  max-width: 800px;
  margin: 32px auto 0;
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid var(--border);
  background: #0d0d12;
}

.game-canvas {
  display: block;
  width: 100%;
  height: 500px;
  outline: none;
}

.game-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(10, 10, 15, 0.75);
  backdrop-filter: blur(4px);
  z-index: 2;
}

.game-overlay[hidden] {
  display: none;
}

.game-start-btn {
  font-size: 1.2rem;
  padding: 14px 36px;
}

.game-hud {
  position: absolute;
  top: 12px;
  right: 16px;
  z-index: 1;
  display: flex;
  gap: 8px;
  align-items: center;
}

.game-score-box {
  background: rgba(0, 0, 0, 0.55);
  color: #eee;
  font-family: var(--mono);
  font-size: 0.95rem;
  padding: 6px 14px;
  border-radius: var(--radius-sm);
}

.game-restart-btn {
  font-size: 0.78rem;
  padding: 5px 12px;
  border-radius: var(--radius-sm);
}

.game-controls-hint {
  display: flex;
  gap: 24px;
  justify-content: center;
  padding: 12px 16px;
  font-size: 0.82rem;
  color: var(--text-muted);
  background: var(--surface);
  border-top: 1px solid var(--border);
  flex-wrap: wrap;
}

.game-controls-hint kbd {
  display: inline-block;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 1px 6px;
  font-family: var(--mono);
  font-size: 0.78rem;
  margin: 0 2px;
}

/* Game Over overlay */
.game-over-screen {
  position: absolute;
  inset: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.75);
  border-radius: var(--radius);
  animation: goFadeIn 0.5s ease-out;
}

.game-over-screen[hidden] {
  display: none;
}

.fw-canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
}

.game-over-content {
  position: relative;
  z-index: 1;
  text-align: center;
  color: #fff;
  padding: 32px 40px;
  animation: goSlideUp 0.6s cubic-bezier(0.22, 1, 0.36, 1) both;
}

.game-over-title {
  font-size: 1.6rem;
  margin: 0 0 24px;
  font-weight: 700;
}

.game-over-stats {
  display: flex;
  gap: 28px;
  justify-content: center;
}

.go-stat {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
}

.go-stat-val {
  font-size: 1.8rem;
  font-weight: 800;
  font-family: var(--mono);
  color: #5dade2;
}

.go-stat-lbl {
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: rgba(255,255,255,0.6);
}

@keyframes goFadeIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}

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

.go-play-again {
  margin-top: 24px;
  font-size: 1rem;
  padding: 10px 28px;
}

@media (max-width: 600px) {
  .game-canvas {
    height: 350px;
  }
}

/* On-screen game controls (D-pad + Drop) */
.game-controls {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 40px;
  padding: 16px 16px 8px;
  background: var(--surface);
  border-top: 1px solid var(--border);
}

.game-dpad {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
}

.dpad-row {
  display: flex;
  gap: 3px;
}

.dpad-btn {
  width: 46px;
  height: 46px;
  border: 1px solid var(--border);
  background: var(--bg);
  color: var(--text);
  border-radius: 8px;
  font-size: 1.1rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.1s, transform 0.08s;
  user-select: none;
  -webkit-user-select: none;
  touch-action: none;
}

.dpad-btn:hover {
  background: var(--surface);
}

.dpad-btn:active,
.dpad-btn.active {
  background: var(--accent);
  color: #fff;
  transform: scale(0.93);
}

.dpad-center {
  visibility: hidden;
}

.game-drop-btn {
  padding: 14px 28px;
  border: 2px solid var(--accent);
  background: var(--accent);
  color: #fff;
  border-radius: 12px;
  font-size: 1.1rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.12s, transform 0.08s;
  user-select: none;
  -webkit-user-select: none;
  touch-action: none;
}

.game-drop-btn:hover {
  filter: brightness(1.1);
}

.game-drop-btn:active,
.game-drop-btn.active {
  background: #a52218;
  transform: scale(0.94);
}

/* Dynamic knowledge graph visualization below game */
.game-graph {
  margin-top: 32px;
  text-align: center;
}

.game-graph-title {
  font-size: 0.92rem;
  color: var(--text-muted);
  margin-bottom: 16px;
  font-weight: 500;
}

.game-graph-scroll {
  overflow-x: auto;
  overflow-y: hidden;
  padding: 8px 0 12px;
  scroll-behavior: smooth;
  -webkit-overflow-scrolling: touch;
}

.graph-viz-live {
  display: block;
  min-width: 400px;
  height: 240px;
  margin: 0 auto;
}

/* Arrow marker */
.gg-arrow-fill {
  fill: var(--border);
}

/* Edges */
.gg-edge {
  stroke: var(--border);
  stroke-width: 1.8;
  fill: none;
}

.gg-edge-miss {
  stroke: #e74c3c;
  stroke-dasharray: 6 3;
  opacity: 0.7;
}

.gg-edge-label {
  fill: var(--text-muted);
  font-size: 8px;
  font-family: var(--mono);
  text-anchor: middle;
  pointer-events: none;
}

.gg-edge-label-miss {
  fill: #e74c3c;
}

/* Nodes */
.gg-circle {
  fill: var(--accent);
  opacity: 0.9;
  transition: opacity 0.2s;
}

.gg-circle:hover { opacity: 1; }

.gg-start  { fill: #5dade2; }
.gg-drop   { fill: #e67e22; }
.gg-grab   { fill: #27ae60; }
.gg-miss   { fill: #e74c3c; stroke: #e74c3c; stroke-width: 2; stroke-dasharray: 4 2; fill-opacity: 0.3; }
.gg-chute  { fill: #8e44ad; }
.gg-score  { fill: #2ecc71; }

.gg-label {
  fill: #fff;
  font-size: 8.5px;
  font-family: var(--sans);
  text-anchor: middle;
  dominant-baseline: central;
  pointer-events: none;
  font-weight: 600;
}

.gg-miss .gg-label { fill: #e74c3c; }

/* Node appear animation */
.gg-appear {
  animation: ggPop 0.35s cubic-bezier(0.34, 1.56, 0.64, 1) both;
}

@keyframes ggPop {
  from { opacity: 0; transform: scale(0); }
  to   { opacity: 1; transform: scale(1); }
}

/* Edge draw animation */
.gg-edge-draw {
  animation: ggFadeIn 0.3s ease-out both;
}

@keyframes ggFadeIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}

@media (max-width: 600px) {
  .game-controls {
    gap: 24px;
    padding: 12px 12px 6px;
  }
  .dpad-btn {
    width: 40px;
    height: 40px;
    font-size: 0.95rem;
  }
  .game-drop-btn {
    padding: 12px 20px;
    font-size: 1rem;
  }
  .game-graph-scroll {
    margin: 0 -16px;
    padding: 8px 16px 12px;
  }
}

/* Subscribe section reveal animation */
@keyframes fadeSlideIn {
  from {
    opacity: 0;
    transform: translateY(24px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}
