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

:root {
  --bg: #050505;
  --surface: #0a0a0a;
  --surface-hover: #0f0f0f;
  --border: rgba(255, 255, 255, 0.06);
  --border-accent: rgba(0, 255, 136, 0.15);
  --accent: #00ff88;
  --accent-dim: rgba(0, 255, 136, 0.08);
  --accent-glow: rgba(0, 255, 136, 0.25);
  --red: #ff3333;
  --text: #d4d4d4;
  --text-muted: #666;
  --text-dim: #3a3a3a;
  --font-display: 'Syne', sans-serif;
  --font-body: 'Outfit', sans-serif;
  --font-mono: 'JetBrains Mono', monospace;
}

html { scroll-behavior: smooth; }

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

/* Grid overlay */
body::after {
  content: '';
  position: fixed;
  inset: 0;
  background-image:
    linear-gradient(rgba(0, 255, 136, 0.02) 1px, transparent 1px),
    linear-gradient(90deg, rgba(0, 255, 136, 0.02) 1px, transparent 1px);
  background-size: 80px 80px;
  pointer-events: none;
  z-index: 0;
}

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

/* === WebGL Canvas === */
#webgl-canvas {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
  pointer-events: none;
  opacity: 0.45;
}

/* === Navigation === */
nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  border-bottom: 1px solid transparent;
  transition: background 0.3s, border-color 0.3s;
}

nav.scrolled {
  background: rgba(5, 5, 5, 0.92);
  backdrop-filter: blur(12px);
  border-bottom-color: var(--border);
}

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

.logo {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  text-decoration: none;
}

.logo:hover { text-decoration: none; }

.logo svg { flex-shrink: 0; }

.logo-text {
  font-family: var(--font-mono);
  font-weight: 500;
  font-size: 0.95rem;
  color: var(--text);
}

.logo-ver {
  font-family: var(--font-mono);
  font-size: 0.6rem;
  color: var(--text-dim);
  border: 1px solid var(--border);
  padding: 0.1rem 0.4rem;
  border-radius: 2px;
}

.nav-links {
  display: flex;
  gap: 1.75rem;
  list-style: none;
  align-items: center;
}

.nav-links a {
  color: var(--text-muted);
  font-family: var(--font-mono);
  font-size: 0.78rem;
  letter-spacing: 0.02em;
  transition: color 0.2s;
}

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

.nav-gh { color: var(--accent) !important; }

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

.nav-toggle span {
  display: block;
  width: 22px;
  height: 1.5px;
  background: var(--text);
  transition: transform 0.3s, opacity 0.3s;
}

.nav-toggle.open span:nth-child(1) { transform: translateY(6.5px) rotate(45deg); }
.nav-toggle.open span:nth-child(2) { opacity: 0; }
.nav-toggle.open span:nth-child(3) { transform: translateY(-6.5px) rotate(-45deg); }

/* === Sections === */
section {
  position: relative;
  z-index: 1;
  padding: 6rem 2rem;
  max-width: 1200px;
  margin: 0 auto;
}

.section-head {
  font-family: var(--font-display);
  font-size: 2.2rem;
  font-weight: 800;
  line-height: 1.2;
  color: var(--text);
  margin-bottom: 1rem;
  text-align: center;
}

.section-lead {
  color: var(--text-muted);
  font-size: 1.05rem;
  line-height: 1.7;
  margin-bottom: 3rem;
  max-width: 600px;
  text-align: center;
  margin-left: auto;
  margin-right: auto;
}

.divider {
  position: relative;
  z-index: 1;
  max-width: 1200px;
  margin: 0 auto;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--border-accent) 50%, transparent);
}

/* === Hero === */
.hero {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 8rem 2rem 3rem;
}

.hero-grid {
  display: grid;
  grid-template-columns: 1.2fr 0.8fr;
  gap: 3rem;
  align-items: center;
}

.hero-badge {
  font-family: var(--font-mono);
  font-size: 0.68rem;
  font-weight: 500;
  letter-spacing: 0.15em;
  color: var(--accent);
  margin-bottom: 1.5rem;
  padding: 0.35rem 0.8rem;
  border: 1px solid var(--border-accent);
  display: inline-block;
  border-radius: 2px;
  background: var(--accent-dim);
}

.hero h1 {
  font-family: var(--font-display);
  font-size: 3.5rem;
  font-weight: 800;
  line-height: 1.08;
  letter-spacing: -0.025em;
  margin-bottom: 1.5rem;
  color: #f0f0f0;
}

.hero h1 .gl { color: var(--accent); }

.hero h1 .gl:hover {
  animation: glitch-text 0.3s ease;
}

.hero-sub {
  font-size: 1.05rem;
  color: var(--text-muted);
  max-width: 520px;
  line-height: 1.7;
  margin-bottom: 2.5rem;
  font-weight: 300;
}

.hero-cta {
  display: flex;
  gap: 1rem;
  align-items: center;
}

.hero-visual {
  display: flex;
  justify-content: center;
  align-items: center;
  position: relative;
}

.hero-visual::after {
  content: '';
  position: absolute;
  width: 280px;
  height: 280px;
  background: radial-gradient(circle, rgba(0, 255, 136, 0.07), transparent 70%);
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  pointer-events: none;
}

#tardigrade-canvas {
  width: 340px;
  height: 340px;
  position: relative;
  z-index: 1;
}

.hero-mascot { width: 160px; height: auto; }

.hero-stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 2rem;
  margin-top: 4rem;
  padding-top: 2rem;
  border-top: 1px solid var(--border);
}

.stat { text-align: left; }

.stat-value {
  font-family: var(--font-display);
  font-size: 2.2rem;
  font-weight: 800;
  color: #f0f0f0;
  display: inline;
}

.stat-plus {
  font-family: var(--font-display);
  font-size: 2.2rem;
  font-weight: 800;
  color: var(--accent);
}

.stat-label {
  font-family: var(--font-mono);
  font-size: 0.68rem;
  color: var(--text-muted);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  display: block;
  margin-top: 0.25rem;
}

/* === Buttons === */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.7rem 1.75rem;
  font-family: var(--font-mono);
  font-size: 0.82rem;
  font-weight: 500;
  border-radius: 2px;
  text-decoration: none;
  transition: all 0.2s;
  cursor: pointer;
  border: none;
}

.btn:hover { text-decoration: none; }

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

.btn-primary:hover {
  box-shadow: 0 0 30px rgba(0, 255, 136, 0.25);
}

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

.btn-ghost:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.btn .arrow { transition: transform 0.2s; }
.btn:hover .arrow { transform: translateX(3px); }

/* === Manifesto === */
.manifesto .section-head {
  font-size: 2.5rem;
  max-width: 700px;
  margin-left: auto;
  margin-right: auto;
}

.manifesto-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 2rem;
  margin-top: 3rem;
}

.manifesto-item {
  padding-top: 1.5rem;
  border-top: 1px solid var(--border);
}

.item-num {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: var(--accent);
  display: block;
  margin-bottom: 0.75rem;
  letter-spacing: 0.05em;
}

.manifesto-item h3 {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.1rem;
  margin-bottom: 0.75rem;
  color: #e0e0e0;
}

.manifesto-item p {
  color: var(--text-muted);
  font-size: 0.9rem;
  line-height: 1.75;
}

/* === Features === */
.features .section-head {
  margin-bottom: 2.5rem;
}

.features-blocks {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.25rem;
}

.feature-block {
  background: var(--surface);
  border: 1px solid var(--border);
  border-top: 2px solid var(--accent);
  padding: 2rem;
  border-radius: 2px;
  transition: border-color 0.3s, box-shadow 0.3s;
}

.feature-block:hover {
  border-color: var(--border-accent);
  border-top-color: var(--accent);
  box-shadow: 0 0 40px rgba(0, 255, 136, 0.03);
}

.feature-header {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 1.25rem;
}

.feature-icon {
  font-family: var(--font-mono);
  font-size: 1.1rem;
  color: var(--accent);
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--accent-dim);
  border-radius: 2px;
  flex-shrink: 0;
}

.feature-block h3 {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.1rem;
  color: #e0e0e0;
}

.feature-desc {
  color: var(--text-muted);
  font-size: 0.88rem;
  line-height: 1.7;
  margin-bottom: 1.25rem;
}

.feature-list {
  list-style: none;
  padding: 0;
}

.feature-list li {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--text-muted);
  padding: 0.35rem 0;
  padding-left: 1.1rem;
  position: relative;
  line-height: 1.5;
}

.feature-list li::before {
  content: '\203A';
  position: absolute;
  left: 0;
  color: var(--accent);
  font-weight: 700;
}

/* === Architecture === */
.arch-diagram {
  background: var(--surface);
  border: 1px solid var(--border);
  padding: 2.5rem;
  border-radius: 2px;
  max-width: 900px;
  margin: 0 auto;
}

.arch-section { margin-bottom: 0; }

.arch-section-label {
  font-family: var(--font-mono);
  font-size: 0.65rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-dim);
  margin-bottom: 0.75rem;
  text-align: center;
}

.arch-flow {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0;
  flex-wrap: wrap;
}

.arch-node {
  padding: 0.55rem 1.1rem;
  font-family: var(--font-mono);
  font-size: 0.78rem;
  font-weight: 500;
  border-radius: 2px;
  white-space: nowrap;
}

.node-user { background: #111; border: 1px solid #2a2a2a; color: #888; }
.node-agent { background: rgba(0, 255, 136, 0.06); border: 1px solid rgba(0, 255, 136, 0.18); color: var(--accent); }
.node-router { background: rgba(99, 102, 241, 0.06); border: 1px solid rgba(99, 102, 241, 0.18); color: #a5b4fc; }
.node-llm { background: rgba(99, 102, 241, 0.04); border: 1px solid rgba(99, 102, 241, 0.12); color: #818cf8; }
.node-proxy { background: rgba(255, 51, 51, 0.06); border: 1px solid rgba(255, 51, 51, 0.18); color: #ff6b6b; }
.node-service { background: rgba(255, 215, 0, 0.04); border: 1px solid rgba(255, 215, 0, 0.12); color: #fbbf24; }

.arch-arrow {
  font-family: var(--font-mono);
  color: var(--text-dim);
  padding: 0 0.75rem;
  font-size: 1rem;
}

.arrow-blocked { color: var(--red); }

.arch-boundary {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin: 1.5rem 0;
}

.arch-boundary-line {
  flex: 1;
  height: 1px;
  background: repeating-linear-gradient(90deg, var(--red) 0, var(--red) 6px, transparent 6px, transparent 12px);
  opacity: 0.4;
}

.arch-boundary-label {
  font-family: var(--font-mono);
  font-size: 0.62rem;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--red);
  white-space: nowrap;
  opacity: 0.7;
}

.arch-callout {
  margin-top: 2rem;
  padding: 1rem 1.25rem;
  background: rgba(255, 51, 51, 0.03);
  border-left: 2px solid var(--red);
  font-size: 0.85rem;
  color: var(--text-muted);
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  line-height: 1.6;
}

.callout-marker {
  color: var(--red);
  font-weight: 700;
  font-family: var(--font-mono);
  flex-shrink: 0;
}

/* === Terminal / Get Started === */
.get-started { text-align: center; }

.terminal {
  background: #080808;
  border: 1px solid var(--border);
  border-radius: 6px;
  overflow: hidden;
  max-width: 640px;
  margin: 0 auto 2rem;
  text-align: left;
}

.terminal-bar {
  background: #111;
  padding: 0.65rem 1rem;
  display: flex;
  align-items: center;
  gap: 6px;
  border-bottom: 1px solid var(--border);
}

.terminal-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #222;
}

.terminal-title {
  font-family: var(--font-mono);
  font-size: 0.65rem;
  color: var(--text-dim);
  margin-left: auto;
  letter-spacing: 0.05em;
}

.terminal-body {
  padding: 1.25rem 1.5rem;
  font-family: var(--font-mono);
  font-size: 0.82rem;
  line-height: 1.9;
}

.terminal-line .prompt {
  color: var(--accent);
  margin-right: 0.6rem;
  user-select: none;
}

.terminal-line .str { color: #fbbf24; }
.terminal-line.output { color: #555; }
.terminal-line .ok { color: var(--accent); margin-right: 0.4rem; }
.terminal-line .dim { color: #444; }
.terminal-line .ready { color: var(--accent); font-weight: 500; }

.start-cta {
  display: flex;
  gap: 1rem;
  justify-content: center;
  flex-wrap: wrap;
  margin-top: 2rem;
}

/* === Footer === */
footer {
  position: relative;
  z-index: 1;
  border-top: 1px solid var(--border);
}

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

.footer-left {
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

.footer-brand {
  font-family: var(--font-mono);
  font-weight: 500;
  font-size: 0.85rem;
  color: var(--text);
}

.footer-sep { color: var(--text-dim); }

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

.footer-right {
  display: flex;
  gap: 1.75rem;
}

.footer-right a {
  color: var(--text-muted);
  font-family: var(--font-mono);
  font-size: 0.78rem;
  letter-spacing: 0.02em;
}

.footer-right a:hover { color: var(--accent); text-decoration: none; }

/* === Animations === */
.fade-in {
  opacity: 0;
  transform: translateY(18px);
  transition: opacity 0.7s ease, transform 0.7s ease;
}

.fade-in.visible {
  opacity: 1;
  transform: translateY(0);
}

.fade-in:nth-child(2) { transition-delay: 0.1s; }
.fade-in:nth-child(3) { transition-delay: 0.2s; }

@keyframes glitch-text {
  0%   { text-shadow: -2px 0 #ff3333, 2px 0 #00ff88; }
  25%  { text-shadow: 2px 0 #ff3333, -2px 0 #00ff88; }
  50%  { text-shadow: -1px 0 #ff3333, 1px 0 #00ff88; }
  75%  { text-shadow: 1px -1px #ff3333, -1px 1px #00ff88; }
  100% { text-shadow: none; }
}

@keyframes glow-pulse {
  0%, 100% { box-shadow: 0 0 15px rgba(0, 255, 136, 0.12); }
  50%      { box-shadow: 0 0 30px rgba(0, 255, 136, 0.22); }
}

.btn-primary { animation: glow-pulse 3s ease-in-out infinite; }

/* === Mobile === */
@media (max-width: 768px) {
  .nav-inner { padding: 0.75rem 1.25rem; }
  .nav-toggle { display: flex; }

  .nav-links {
    position: fixed;
    top: 0;
    right: 0;
    bottom: 0;
    width: 260px;
    background: rgba(5, 5, 5, 0.98);
    backdrop-filter: blur(12px);
    flex-direction: column;
    padding: 5rem 2rem 2rem;
    gap: 1.5rem;
    transform: translateX(100%);
    transition: transform 0.3s ease;
    border-left: 1px solid var(--border);
  }

  .nav-links.open { transform: translateX(0); }

  section { padding: 4rem 1.25rem; }

  .hero {
    min-height: auto;
    padding: 6rem 1.25rem 3rem;
  }

  .hero-grid {
    grid-template-columns: 1fr;
    text-align: center;
    gap: 2rem;
  }

  .hero-visual { order: -1; }
  .hero-visual::after { width: 180px; height: 180px; }

  #tardigrade-canvas { width: 200px; height: 200px; }
  .hero-mascot { width: 120px; }

  .hero h1 { font-size: 2.2rem; }
  .hero-badge { font-size: 0.6rem; }
  .hero-sub {
    margin-left: auto;
    margin-right: auto;
    font-size: 0.95rem;
  }
  .hero-cta { justify-content: center; }

  .hero-stats {
    grid-template-columns: repeat(2, 1fr);
    gap: 1.5rem;
    margin-top: 3rem;
  }

  .stat-value, .stat-plus { font-size: 1.6rem; }

  .section-head { font-size: 1.6rem; }
  .manifesto .section-head { font-size: 1.8rem; }
  .manifesto-grid { grid-template-columns: 1fr; }

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

  .arch-flow { flex-direction: column; gap: 0.5rem; }
  .arch-arrow { transform: rotate(90deg); padding: 0.25rem 0; }
  .arch-boundary { flex-direction: column; gap: 0.5rem; }
  .arch-boundary-line { width: 100%; height: 1px; }

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

@media (max-width: 480px) {
  .hero h1 { font-size: 1.8rem; }
  .hero-stats { grid-template-columns: 1fr 1fr; gap: 1rem; }
  .stat-value, .stat-plus { font-size: 1.4rem; }
  .btn { padding: 0.65rem 1.25rem; font-size: 0.78rem; }
}
