:root {
  color-scheme: light;
  --bg: #ffffff;
  --bg-alt: #f6f8fc;
  --bg-card: #ffffff;
  --bg-hover: #f1f3f4;
  --text: #202124;
  --text-secondary: #5f6368;
  --text-muted: #9aa0a6;
  --border: #e0e0e0;
  --accent: #2563EB;
  --accent-hover: #1d4ed8;
  --accent-light: #e8f0fe;
  --success: #22c55e;
  --shadow: 0 1px 3px rgba(0,0,0,0.1);
  --shadow-lg: 0 4px 12px rgba(0,0,0,0.12);
  --radius: 8px;
  --radius-lg: 12px;
}

[data-theme="dark"] {
  color-scheme: dark;
  --bg: #111111;
  --bg-alt: #1a1a1a;
  --bg-card: #222222;
  --bg-hover: #2a2a2a;
  --text: #e8eaed;
  --text-secondary: #9aa0a6;
  --text-muted: #5f6368;
  --border: #333333;
  --accent: #60a5fa;
  --accent-hover: #93c5fd;
  --accent-light: #1e3a5f;
  --success: #4ade80;
  --shadow: 0 1px 3px rgba(0,0,0,0.4);
  --shadow-lg: 0 4px 12px rgba(0,0,0,0.5);
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

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

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

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 20px;
  border: none;
  border-radius: var(--radius);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s;
  text-decoration: none;
}

.btn-primary { background: var(--accent); color: #fff; }
.btn-primary:hover { background: var(--accent-hover); }

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

.btn-lg {
  padding: 14px 32px !important;
  font-size: 16px !important;
  border-radius: 10px !important;
}

.icon-btn {
  background: none;
  border: none;
  border-radius: 50%;
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: var(--text-secondary);
  transition: background 0.15s;
}
.icon-btn:hover { background: var(--bg-hover); }

/* Nav */
.nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  background: rgba(255,255,255,0.85);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
}
[data-theme="dark"] .nav { background: rgba(17,17,17,0.85); }

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

.logo {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 20px;
  font-weight: 700;
  color: var(--accent);
  text-decoration: none;
}

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

/* Hero */
.hero {
  padding: 160px 24px 80px;
  background:
    radial-gradient(ellipse 80% 50% at 50% -20%, rgba(37,99,235,0.08), transparent),
    var(--bg);
}
[data-theme="dark"] .hero {
  background:
    radial-gradient(ellipse 80% 50% at 50% -20%, rgba(96,165,250,0.1), transparent),
    var(--bg);
}

.hero-inner {
  max-width: 1200px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1fr 1.1fr;
  gap: 64px;
  align-items: center;
}

.hero h1 {
  font-size: 56px;
  font-weight: 800;
  line-height: 1.1;
  letter-spacing: -0.02em;
}

.accent { color: var(--accent); }

.hero-sub {
  margin-top: 24px;
  font-size: 18px;
  line-height: 1.7;
  color: var(--text-secondary);
  max-width: 520px;
}

.hero-actions {
  margin-top: 36px;
  display: flex;
  gap: 12px;
}

/* Terminal mockup */
.terminal {
  width: 100%;
  max-width: 560px;
  border-radius: var(--radius-lg);
  overflow: hidden;
  border: 1px solid var(--border);
  box-shadow: 0 20px 60px rgba(0,0,0,0.12);
  background: #1a1a2e;
}
[data-theme="dark"] .terminal {
  box-shadow: 0 20px 60px rgba(0,0,0,0.5);
  background: #0d0d1a;
}

.terminal-bar {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 12px 16px;
  background: #16162a;
  border-bottom: 1px solid #2a2a4a;
}

.dot { width: 10px; height: 10px; border-radius: 50%; }
.dot.red { background: #ff5f57; }
.dot.yellow { background: #ffbd2e; }
.dot.green { background: #28c840; }

.terminal-title {
  margin-left: 12px;
  font-size: 12px;
  font-weight: 600;
  color: #6b6b8d;
}

.terminal-body {
  padding: 20px;
  font-family: 'SF Mono', 'Fira Code', 'Cascadia Code', monospace;
  font-size: 13px;
  line-height: 1.8;
}

.line { min-height: 1.8em; }
.prompt { color: #22c55e; }
.cmd { color: #e8eaed; }
.output { color: #9aa0a6; }
.output.success { color: #4ade80; }
.output.dim { color: #5f6368; }

/* Protocols bar */
.protocols {
  padding: 48px 24px;
  background: var(--bg-alt);
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}

.protocols-inner {
  max-width: 900px;
  margin: 0 auto;
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 40px;
}

.protocol { text-align: center; }

.protocol-port {
  font-family: 'SF Mono', monospace;
  font-size: 14px;
  font-weight: 700;
  color: var(--accent);
  margin-bottom: 4px;
}

.protocol-name {
  font-size: 20px;
  font-weight: 800;
  color: var(--text);
}

.protocol-desc {
  font-size: 13px;
  color: var(--text-muted);
  margin-top: 2px;
}

.protocol-divider {
  width: 1px;
  height: 56px;
  background: var(--border);
}

/* Features */
.features {
  padding: 100px 24px;
  background: var(--bg);
}

.features-inner {
  max-width: 1200px;
  margin: 0 auto;
}

.section-title {
  font-size: 36px;
  font-weight: 800;
  text-align: center;
  letter-spacing: -0.01em;
}

.section-sub {
  font-size: 18px;
  text-align: center;
  color: var(--text-secondary);
  margin-top: 12px;
  max-width: 640px;
  margin-left: auto;
  margin-right: auto;
}

.grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
  margin-top: 64px;
}

.card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 32px;
  transition: box-shadow 0.2s, transform 0.2s;
}

.card:hover {
  box-shadow: var(--shadow-lg);
  transform: translateY(-2px);
}

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

.card-icon svg {
  width: 24px;
  height: 24px;
  color: var(--accent);
}

.card h3 {
  font-size: 18px;
  font-weight: 700;
  margin-bottom: 8px;
}

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

/* Architecture */
.arch {
  padding: 100px 24px;
  background: var(--bg-alt);
}

.arch-inner {
  max-width: 1000px;
  margin: 0 auto;
}

.arch-diagram {
  display: flex;
  align-items: stretch;
  justify-content: center;
  gap: 24px;
  margin-top: 64px;
}

.arch-col {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.arch-col.center .arch-item { border-color: var(--accent); }

.arch-label {
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
  margin-bottom: 8px;
  text-align: center;
}

.arch-item {
  padding: 12px 16px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  text-align: center;
  font-size: 14px;
  font-weight: 500;
}

.arch-item.highlight {
  background: var(--accent-light);
  border-color: var(--accent);
  color: var(--accent);
  font-weight: 700;
}

.arch-arrow {
  display: flex;
  align-items: center;
  flex-shrink: 0;
  color: var(--text-muted);
}

.arch-arrow svg { width: 32px; height: 32px; }

/* CTA */
.cta {
  padding: 100px 24px;
  background: var(--bg);
}

.cta-inner {
  max-width: 640px;
  margin: 0 auto;
  text-align: center;
}

.cta-inner h2 {
  font-size: 36px;
  font-weight: 800;
  letter-spacing: -0.01em;
}

.cta-inner p {
  font-size: 18px;
  color: var(--text-secondary);
  margin: 16px 0 36px;
}

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

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

.footer-inner {
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.footer-brand {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 16px;
  font-weight: 700;
  color: var(--accent);
}

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

/* Responsive */
@media (max-width: 1024px) {
  .hero-inner { grid-template-columns: 1fr; gap: 48px; }
  .hero-content { text-align: center; }
  .hero-sub { margin-left: auto; margin-right: auto; }
  .hero-actions { justify-content: center; }
  .hero-visual { display: flex; justify-content: center; }
  .terminal { max-width: 500px; }
  .grid { grid-template-columns: repeat(2, 1fr); }
  .arch-diagram { flex-direction: column; align-items: center; }
  .arch-arrow { transform: rotate(90deg); }
  .arch-col { width: 100%; max-width: 300px; }
}

@media (max-width: 768px) {
  .hero { padding: 120px 16px 60px; }
  .hero h1 { font-size: 36px; }
  .hero-sub { font-size: 16px; }
  .protocols-inner { flex-wrap: wrap; gap: 24px; }
  .protocol-divider { display: none; }
  .features, .arch, .cta { padding: 60px 16px; }
  .grid { grid-template-columns: 1fr; }
  .section-title { font-size: 28px; }
  .cta-inner h2 { font-size: 28px; }
  .terminal-body { font-size: 11px; padding: 14px; }
  .footer-inner { flex-direction: column; gap: 12px; text-align: center; }
}
