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

:root {
  --bg: #0A0A0A;
  --surface: #111111;
  --surface-2: #1A1A1A;
  --border: #222222;
  --border-bright: #2E2E2E;
  --text: #EDEDED;
  --text-dim: #666666;
  --text-muted: #444444;
  --accent: #C8FF00;
  --accent-dim: rgba(200, 255, 0, 0.15);
  --accent-text: #9BBF00;
  --red: #FF4D4D;
  --green: #4DFF88;
  --yellow: #FFD84D;

  --font-head: 'Space Grotesk', system-ui, sans-serif;
  --font-body: 'DM Sans', system-ui, sans-serif;
  --font-mono: 'DM Mono', monospace;

  --radius: 8px;
  --radius-sm: 4px;
  --container: 1100px;
}

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

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

/* ─── Nav ─────────────────────────────────────────────────────── */
.nav {
  position: sticky;
  top: 0;
  z-index: 100;
  border-bottom: 1px solid var(--border);
  background: rgba(10, 10, 10, 0.85);
  backdrop-filter: blur(12px);
}
.nav-inner {
  max-width: var(--container);
  margin: 0 auto;
  padding: 0 24px;
  height: 56px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.nav-logo {
  display: flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-head);
  font-weight: 700;
  font-size: 1.1rem;
  letter-spacing: -0.02em;
  color: var(--text);
}
.nav-tag {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: var(--text-dim);
  letter-spacing: 0.03em;
}

/* ─── Hero ────────────────────────────────────────────────────── */
.hero {
  position: relative;
  padding: 96px 24px 80px;
  overflow: hidden;
}
.hero-grid-bg {
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(200, 255, 0, 0.04) 1px, transparent 1px),
    linear-gradient(90deg, rgba(200, 255, 0, 0.04) 1px, transparent 1px);
  background-size: 48px 48px;
  mask-image: radial-gradient(ellipse 80% 60% at 50% 0%, black 40%, transparent 100%);
  -webkit-mask-image: radial-gradient(ellipse 80% 60% at 50% 0%, black 40%, transparent 100%);
}
.hero-content {
  position: relative;
  max-width: var(--container);
  margin: 0 auto;
}
.hero-label {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-mono);
  font-size: 0.78rem;
  color: var(--accent-text);
  letter-spacing: 0.02em;
  margin-bottom: 28px;
}
.live-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--accent);
  animation: pulse 2s ease-in-out infinite;
  flex-shrink: 0;
}
@keyframes pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.5; transform: scale(0.85); }
}
.hero-headline {
  font-family: var(--font-head);
  font-size: clamp(2.4rem, 6vw, 4.2rem);
  font-weight: 700;
  line-height: 1.05;
  letter-spacing: -0.04em;
  color: var(--text);
  margin-bottom: 28px;
}
.hero-accent { color: var(--accent); }
.hero-sub {
  font-size: 1.15rem;
  color: var(--text-dim);
  max-width: 560px;
  line-height: 1.7;
  margin-bottom: 48px;
}
.hero-stats {
  display: flex;
  align-items: center;
  gap: 24px;
}
.stat { display: flex; flex-direction: column; gap: 4px; }
.stat-value {
  font-family: var(--font-head);
  font-size: 2rem;
  font-weight: 700;
  color: var(--accent);
  letter-spacing: -0.04em;
}
.stat-label {
  font-size: 0.78rem;
  color: var(--text-dim);
  max-width: 180px;
  line-height: 1.4;
}
.stat-divider {
  width: 1px;
  height: 48px;
  background: var(--border);
  flex-shrink: 0;
}

/* ─── Environment Visual ──────────────────────────────────────── */
.environment {
  padding: 0 24px 80px;
}
.env-container {
  max-width: var(--container);
  margin: 0 auto;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}
.env-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 20px;
  border-bottom: 1px solid var(--border);
  background: var(--surface-2);
}
.mono { font-family: var(--font-mono); font-size: 0.75rem; }
.text-dim { color: var(--text-dim); }
.text-sm { font-size: 0.7rem; }
.text-muted { color: var(--text-muted); }
.status-badge {
  display: flex;
  align-items: center;
  gap: 6px;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: var(--green);
}
.status-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--green);
  animation: pulse 2s ease-in-out infinite;
}
.env-scene { padding: 0; }
.scene-header {
  padding: 10px 20px;
  border-bottom: 1px solid var(--border);
}
.scene-grid {
  display: grid;
  grid-template-columns: 1fr 1.4fr 1fr;
  min-height: 220px;
}
.world-pane, .agent-pane, .user-pane {
  padding: 16px 20px;
  border-right: 1px solid var(--border);
}
.user-pane { border-right: none; }
.pane-label {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  color: var(--text-dim);
  margin-bottom: 12px;
  letter-spacing: 0.02em;
}
.api-line {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 5px 0;
  border-bottom: 1px solid var(--border);
  font-family: var(--font-mono);
  font-size: 0.72rem;
}
.api-line:last-child { border-bottom: none; }
.api-line.dimmed { opacity: 0.4; }
.method {
  padding: 2px 6px;
  border-radius: 3px;
  font-size: 0.65rem;
  font-weight: 600;
  letter-spacing: 0.05em;
  flex-shrink: 0;
}
.method.get { background: rgba(77, 255, 136, 0.15); color: var(--green); }
.method.post { background: rgba(200, 255, 0, 0.1); color: var(--accent); }
.endpoint { color: var(--text); flex: 1; }
.status-ok { color: var(--green); }
.status-err { color: var(--red); }
.status-warn { color: var(--yellow); }
.latency { color: var(--text-dim); margin-left: auto; }
.agent-stream { display: flex; flex-direction: column; gap: 8px; }
.step {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  line-height: 1.4;
}
.step-num { color: var(--text-muted); flex-shrink: 0; width: 20px; }
.step-action { color: var(--text); }
.step-time { color: var(--text-dim); margin-left: auto; flex-shrink: 0; }
.step.current .step-action { color: var(--accent); }
.step-status {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  color: var(--accent-text);
  animation: blink 1s step-end infinite;
}
@keyframes blink { 0%, 100% { opacity: 1; } 50% { opacity: 0; } }
.persona-card { display: flex; flex-direction: column; gap: 8px; }
.persona-row {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 8px;
  font-family: var(--font-mono);
  font-size: 0.72rem;
}
.persona-key { color: var(--text-dim); flex-shrink: 0; }
.persona-val { color: var(--text); text-align: right; }

/* ─── Features ────────────────────────────────────────────────── */
.features {
  padding: 80px 24px;
  background: var(--surface);
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}
.features-inner { max-width: var(--container); margin: 0 auto; }
.section-header { margin-bottom: 56px; }
.section-label {
  display: block;
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--accent-text);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  margin-bottom: 12px;
}
.section-header h2 {
  font-family: var(--font-head);
  font-size: clamp(1.5rem, 3vw, 2.2rem);
  font-weight: 600;
  letter-spacing: -0.03em;
  color: var(--text);
  max-width: 520px;
}
.features-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1px;
  background: var(--border);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}
.feature {
  background: var(--surface);
  padding: 32px 28px;
}
.feature-icon {
  width: 40px;
  height: 40px;
  background: var(--accent-dim);
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 20px;
}
.feature h3 {
  font-family: var(--font-head);
  font-size: 1rem;
  font-weight: 600;
  letter-spacing: -0.02em;
  color: var(--text);
  margin-bottom: 10px;
}
.feature p {
  font-size: 0.9rem;
  color: var(--text-dim);
  line-height: 1.6;
}

/* ─── How ────────────────────────────────────────────────────── */
.how {
  padding: 80px 24px;
}
.how-inner { max-width: var(--container); margin: 0 auto; }
.steps {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0;
  margin-top: 0;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}
.step-item {
  padding: 32px 24px;
  border-right: 1px solid var(--border);
  position: relative;
}
.step-item:last-child { border-right: none; }
.step-marker {
  font-family: var(--font-head);
  font-size: 2.2rem;
  font-weight: 700;
  color: var(--accent-dim);
  letter-spacing: -0.05em;
  margin-bottom: 16px;
}
.step-body h4 {
  font-family: var(--font-head);
  font-size: 1rem;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 8px;
  letter-spacing: -0.02em;
}
.step-body p {
  font-size: 0.85rem;
  color: var(--text-dim);
  line-height: 1.6;
}

/* ─── Closing ─────────────────────────────────────────────────── */
.closing {
  padding: 96px 24px;
  text-align: center;
  position: relative;
  overflow: hidden;
}
.closing::before {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse 60% 80% at 50% 50%, rgba(200, 255, 0, 0.06) 0%, transparent 70%);
  pointer-events: none;
}
.closing-inner { position: relative; max-width: 600px; margin: 0 auto; }
.closing-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-mono);
  font-size: 0.78rem;
  color: var(--text-dim);
  margin-bottom: 24px;
}
.closing h2 {
  font-family: var(--font-head);
  font-size: clamp(1.8rem, 4vw, 3rem);
  font-weight: 700;
  letter-spacing: -0.04em;
  color: var(--text);
  margin-bottom: 16px;
  line-height: 1.1;
}
.closing-sub {
  font-size: 1.1rem;
  color: var(--text-dim);
}

/* ─── Footer ──────────────────────────────────────────────────── */
.footer {
  border-top: 1px solid var(--border);
  padding: 28px 24px;
}
.footer-inner {
  max-width: var(--container);
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.footer-logo {
  display: flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-head);
  font-weight: 600;
  font-size: 0.9rem;
  color: var(--text-dim);
}
.footer-note {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: var(--text-muted);
}

/* ─── Responsive ──────────────────────────────────────────────── */
@media (max-width: 768px) {
  .hero { padding: 64px 20px 56px; }
  .hero-stats { flex-direction: column; align-items: flex-start; gap: 16px; }
  .stat-divider { display: none; }
  .stat-label { max-width: 240px; }

  .scene-grid { grid-template-columns: 1fr; }
  .world-pane, .agent-pane, .user-pane { border-right: none; border-bottom: 1px solid var(--border); }
  .user-pane { border-bottom: none; }

  .features-grid { grid-template-columns: 1fr; }
  .steps { grid-template-columns: 1fr; }
  .step-item { border-right: none; border-bottom: 1px solid var(--border); }
  .step-item:last-child { border-bottom: none; }

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

@media (max-width: 480px) {
  .env-container { border-radius: 0; margin: 0 -20px; }
}
