:root {
  --black: #06060a;
  --deep: #09090f;
  --surface: #0d0d16;
  --purple-dim: #1a1028;
  --purple-mid: #6b21a8;
  --purple-core: #a855f7;
  --purple-bright: #c084fc;
  --purple-glow: #e9d5ff;
  --purple-ultra: #7c3aed;
  --text-primary: #ede9fe;
  --text-secondary: #a78bfa;
  --text-muted: #4c3a6e;
  --text-dim: #2d1f4a;
  --accent-green: #34d399;
  --accent-amber: #fbbf24;
}

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

html { scroll-behavior: smooth; }

body {
  background: var(--black);
  color: var(--text-primary);
  font-family: 'DM Mono', monospace;
  overflow-x: hidden;
  cursor: none;
}

/* Custom cursor */
.cursor {
  position: fixed;
  width: 8px;
  height: 8px;
  background: var(--purple-core);
  border-radius: 50%;
  pointer-events: none;
  z-index: 9999;
  transition: transform 0.1s ease;
  box-shadow: 0 0 12px var(--purple-core), 0 0 24px var(--purple-mid);
}

.cursor-ring {
  position: fixed;
  width: 32px;
  height: 32px;
  border: 1px solid var(--purple-bright);
  border-radius: 50%;
  pointer-events: none;
  z-index: 9998;
  transition: transform 0.15s ease, width 0.2s, height 0.2s, opacity 0.2s;
  opacity: 0.4;
  transform: translate(-12px, -12px);
}

/* Wave canvas */
#wave-canvas {
  position: fixed;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 280px;
  pointer-events: none;
  z-index: 0;
  opacity: 0.5;
}

/* Grain overlay */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noise)' opacity='0.04'/%3E%3C/svg%3E");
  pointer-events: none;
  z-index: 1;
  opacity: 0.6;
}

/* Grid background */
body::after {
  content: '';
  position: fixed;
  inset: 0;
  background-image:
    linear-gradient(rgba(168, 85, 247, 0.03) 1px, transparent 1px),
    linear-gradient(90deg, rgba(168, 85, 247, 0.03) 1px, transparent 1px);
  background-size: 48px 48px;
  pointer-events: none;
  z-index: 0;
}

/* Nav */
nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  padding: 20px 48px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid rgba(168, 85, 247, 0.08);
  background: rgba(6, 6, 10, 0.8);
  backdrop-filter: blur(20px);
}

.nav-logo {
  font-family: 'Martian Mono', monospace;
  font-weight: 800;
  font-size: 14px;
  color: var(--purple-bright);
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

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

.nav-links {
  display: flex;
  gap: 36px;
  list-style: none;
}

.nav-links a {
  font-family: 'DM Mono', monospace;
  font-size: 11px;
  color: var(--text-muted);
  text-decoration: none;
  letter-spacing: 0.08em;
  transition: color 0.2s;
  text-transform: uppercase;
}

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

.nav-cta {
  font-family: 'Martian Mono', monospace;
  font-size: 11px;
  font-weight: 500;
  color: var(--black);
  background: var(--purple-core);
  border: none;
  padding: 8px 20px;
  cursor: none;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  transition: background 0.2s, box-shadow 0.2s;
}

.nav-cta:hover {
  background: var(--purple-bright);
  box-shadow: 0 0 20px rgba(168, 85, 247, 0.4);
}

/* Hero */
.hero {
  position: relative;
  z-index: 2;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 0 48px;
  padding-top: 100px;
}

.hero-eyebrow {
  font-family: 'DM Mono', monospace;
  font-size: 11px;
  color: var(--purple-core);
  letter-spacing: 0.2em;
  text-transform: uppercase;
  margin-bottom: 28px;
  display: flex;
  align-items: center;
  gap: 12px;
  opacity: 0;
  animation: fadeUp 0.8s ease forwards 0.2s;
}

.hero-eyebrow::before {
  content: '';
  display: block;
  width: 32px;
  height: 1px;
  background: var(--purple-core);
}

.hero-title {
  font-family: 'Martian Mono', monospace;
  font-weight: 800;
  font-size: clamp(42px, 7vw, 96px);
  line-height: 0.95;
  letter-spacing: -0.03em;
  margin-bottom: 32px;
  opacity: 0;
  animation: fadeUp 0.8s ease forwards 0.4s;
}

.hero-title .line-1 { color: var(--text-primary); }
.hero-title .line-2 {
  color: transparent;
  -webkit-text-stroke: 1px var(--purple-mid);
  display: block;
}
.hero-title .line-3 {
  color: var(--purple-core);
  display: block;
}

.hero-sub {
  font-family: 'DM Mono', monospace;
  font-size: 14px;
  color: var(--text-muted);
  line-height: 1.8;
  max-width: 520px;
  margin-bottom: 48px;
  opacity: 0;
  animation: fadeUp 0.8s ease forwards 0.6s;
}

.hero-sub em {
  color: var(--purple-bright);
  font-style: normal;
}

.hero-actions {
  display: flex;
  gap: 16px;
  align-items: center;
  opacity: 0;
  animation: fadeUp 0.8s ease forwards 0.8s;
}

.btn-primary {
  font-family: 'Martian Mono', monospace;
  font-size: 12px;
  font-weight: 700;
  color: var(--black);
  background: var(--purple-core);
  border: none;
  padding: 14px 32px;
  cursor: none;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  text-decoration: none;
  transition: all 0.2s;
  display: inline-block;
}

.btn-primary:hover {
  background: var(--purple-bright);
  box-shadow: 0 0 40px rgba(168, 85, 247, 0.5);
  transform: translateY(-2px);
}

.btn-ghost {
  font-family: 'Martian Mono', monospace;
  font-size: 12px;
  color: var(--text-muted);
  background: transparent;
  border: 1px solid var(--text-dim);
  padding: 14px 32px;
  cursor: none;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  text-decoration: none;
  transition: all 0.2s;
  display: inline-block;
}

.btn-ghost:hover {
  border-color: var(--purple-mid);
  color: var(--purple-bright);
}

/* Terminal blink */
.blink {
  animation: blink 1.2s step-end infinite;
  color: var(--purple-core);
}

/* Hero metrics */
.hero-metrics {
  position: absolute;
  right: 48px;
  top: 50%;
  transform: translateY(-50%);
  display: flex;
  flex-direction: column;
  gap: 24px;
  opacity: 0;
  animation: fadeLeft 0.8s ease forwards 1s;
}

.metric {
  border-left: 2px solid var(--purple-dim);
  padding-left: 20px;
}

.metric-value {
  font-family: 'Martian Mono', monospace;
  font-size: 28px;
  font-weight: 800;
  color: var(--purple-bright);
  display: block;
}

.metric-label {
  font-size: 10px;
  color: var(--text-muted);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  display: block;
  margin-top: 4px;
}

/* Section base */
section {
  position: relative;
  z-index: 2;
  padding: 120px 48px;
}

.section-header {
  margin-bottom: 72px;
}

.section-tag {
  font-family: 'DM Mono', monospace;
  font-size: 10px;
  color: var(--purple-core);
  letter-spacing: 0.25em;
  text-transform: uppercase;
  margin-bottom: 16px;
  display: flex;
  align-items: center;
  gap: 10px;
}

.section-tag::after {
  content: '';
  display: block;
  flex: 1;
  max-width: 60px;
  height: 1px;
  background: var(--purple-dim);
}

.section-title {
  font-family: 'Martian Mono', monospace;
  font-weight: 800;
  font-size: clamp(28px, 4vw, 52px);
  line-height: 1.05;
  letter-spacing: -0.02em;
  color: var(--text-primary);
}

.section-title span { color: var(--purple-core); }

/* Products */
.products-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2px;
}

.product-card {
  background: var(--surface);
  border: 1px solid rgba(168, 85, 247, 0.08);
  padding: 48px;
  position: relative;
  overflow: hidden;
  transition: border-color 0.3s, background 0.3s;
  cursor: none;
}

.product-card::before {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at 0% 0%, rgba(168, 85, 247, 0.06) 0%, transparent 60%);
  opacity: 0;
  transition: opacity 0.4s;
}

.product-card:hover {
  border-color: rgba(168, 85, 247, 0.25);
  background: var(--purple-dim);
}

.product-card:hover::before { opacity: 1; }

.product-card.featured {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 48px;
  align-items: center;
  border-color: rgba(168, 85, 247, 0.15);
  background: linear-gradient(135deg, var(--surface) 0%, var(--purple-dim) 100%);
}

.product-tag {
  font-size: 10px;
  color: var(--purple-core);
  background: rgba(168, 85, 247, 0.1);
  border: 1px solid rgba(168, 85, 247, 0.2);
  padding: 3px 10px;
  display: inline-block;
  margin-bottom: 20px;
  letter-spacing: 0.15em;
  text-transform: uppercase;
}

.product-name {
  font-family: 'Martian Mono', monospace;
  font-weight: 800;
  font-size: 36px;
  color: var(--text-primary);
  margin-bottom: 8px;
  letter-spacing: -0.02em;
}

.product-name span { color: var(--purple-core); }

.product-tagline {
  font-size: 12px;
  color: var(--text-muted);
  margin-bottom: 24px;
  line-height: 1.7;
}

.product-tagline em {
  color: var(--purple-bright);
  font-style: normal;
}

.product-features {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 32px;
}

.product-features li {
  font-size: 11px;
  color: var(--text-muted);
  display: flex;
  align-items: flex-start;
  gap: 10px;
  line-height: 1.6;
}

.product-features li::before {
  content: '→';
  color: var(--purple-core);
  flex-shrink: 0;
}

.product-status {
  font-size: 10px;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  display: flex;
  align-items: center;
  gap: 8px;
}

.status-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent-green);
  box-shadow: 0 0 8px var(--accent-green);
  animation: pulse 2s infinite;
}

.status-dot.building {
  background: var(--accent-amber);
  box-shadow: 0 0 8px var(--accent-amber);
}

/* Demo terminal */
.demo-terminal {
  background: rgba(6, 6, 10, 0.9);
  border: 1px solid rgba(168, 85, 247, 0.15);
  padding: 24px;
  font-size: 12px;
  line-height: 1.8;
}

.terminal-bar {
  display: flex;
  gap: 6px;
  margin-bottom: 20px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--purple-dim);
}

.t-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
}

.terminal-line { margin-bottom: 4px; }
.t-prompt { color: var(--purple-core); }
.t-cmd { color: var(--text-primary); }
.t-out { color: var(--text-muted); }
.t-success { color: var(--accent-green); }
.t-agent { color: var(--purple-bright); }

/* Philosophy section */
.philosophy {
  background: var(--surface);
  border-top: 1px solid rgba(168, 85, 247, 0.08);
  border-bottom: 1px solid rgba(168, 85, 247, 0.08);
}

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

.philosophy-item {
  padding: 40px;
  border: 1px solid rgba(168, 85, 247, 0.06);
  position: relative;
}

.philosophy-num {
  font-family: 'Martian Mono', monospace;
  font-size: 48px;
  font-weight: 800;
  color: var(--text-dim);
  display: block;
  margin-bottom: 20px;
  letter-spacing: -0.04em;
}

.philosophy-title {
  font-family: 'Martian Mono', monospace;
  font-size: 16px;
  font-weight: 700;
  color: var(--purple-bright);
  margin-bottom: 12px;
  letter-spacing: -0.01em;
}

.philosophy-body {
  font-size: 12px;
  color: var(--text-muted);
  line-height: 1.8;
}

/* Manifesto */
.manifesto-text {
  font-family: 'Martian Mono', monospace;
  font-size: clamp(18px, 3vw, 32px);
  font-weight: 300;
  line-height: 1.5;
  color: var(--text-dim);
  max-width: 900px;
  letter-spacing: -0.01em;
}

.manifesto-text .highlight {
  color: var(--text-primary);
  font-weight: 800;
}

.manifesto-text .purple {
  color: var(--purple-core);
  font-weight: 800;
}

/* CTA section */
.cta-section {
  text-align: center;
  padding: 160px 48px;
}

.cta-title {
  font-family: 'Martian Mono', monospace;
  font-weight: 800;
  font-size: clamp(32px, 5vw, 72px);
  line-height: 1.0;
  margin-bottom: 24px;
  letter-spacing: -0.03em;
}

.cta-sub {
  font-size: 13px;
  color: var(--text-muted);
  margin-bottom: 48px;
  line-height: 1.8;
}

/* Download buttons */
.download-primary {
  font-family: 'Martian Mono', monospace;
  font-size: 12px;
  font-weight: 700;
  color: var(--black);
  background: var(--accent-green);
  border: none;
  padding: 12px 28px;
  cursor: none;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  text-decoration: none;
  transition: all 0.2s;
  display: inline-block;
  margin-bottom: 12px;
}

.download-primary:hover {
  background: #10b981;
  box-shadow: 0 0 30px rgba(52, 211, 153, 0.4);
  transform: translateY(-2px);
}

.download-secondary {
  font-family: 'DM Mono', monospace;
  font-size: 10px;
  color: var(--text-muted);
  text-decoration: none;
  letter-spacing: 0.08em;
  transition: color 0.2s;
  cursor: none;
}

.download-secondary:hover {
  color: var(--purple-bright);
}

.download-options {
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid var(--purple-dim);
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.download-option {
  font-family: 'DM Mono', monospace;
  font-size: 10px;
  color: var(--text-muted);
  text-decoration: none;
  letter-spacing: 0.05em;
  transition: color 0.2s;
  cursor: none;
}

.download-option:hover {
  color: var(--purple-core);
}

/* Footer */
footer {
  position: relative;
  z-index: 2;
  padding: 40px 48px;
  border-top: 1px solid rgba(168, 85, 247, 0.08);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.footer-logo {
  font-family: 'Martian Mono', monospace;
  font-weight: 800;
  font-size: 12px;
  color: var(--purple-core);
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

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

.footer-links a {
  font-size: 11px;
  color: var(--text-muted);
  text-decoration: none;
  letter-spacing: 0.08em;
  transition: color 0.2s;
  text-transform: uppercase;
}

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

.footer-copy {
  font-size: 10px;
  color: var(--text-dim);
  letter-spacing: 0.1em;
}

/* Divider line */
.divider {
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--purple-dim), transparent);
  margin: 0 48px;
  position: relative;
  z-index: 2;
}

/* Animations */
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(24px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes fadeLeft {
  from { opacity: 0; transform: translateX(24px); }
  to { opacity: 1; transform: translateX(0); }
}

@keyframes blink {
  0%, 100% { opacity: 1; }
  50% { opacity: 0; }
}

@keyframes pulse {
  0%, 100% { opacity: 1; box-shadow: 0 0 8px currentColor; }
  50% { opacity: 0.6; box-shadow: 0 0 4px currentColor; }
}

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

.scroll-reveal {
  opacity: 0;
  transform: translateY(32px);
  transition: opacity 0.7s ease, transform 0.7s ease;
}

.scroll-reveal.visible {
  opacity: 1;
  transform: translateY(0);
}

/* Responsive - Tablet */
@media (max-width: 768px) {
  nav {
    padding: 16px 24px;
  }

  .nav-links {
    gap: 20px;
  }

  .hero {
    padding: 0 24px;
    padding-top: 80px;
  }

  .hero-metrics {
    position: static;
    transform: none;
    flex-direction: row;
    margin-top: 48px;
    gap: 32px;
  }

  section {
    padding: 80px 24px;
  }

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

  .product-card.featured {
    grid-template-columns: 1fr;
  }

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

  .divider {
    margin: 0 24px;
  }

  footer {
    padding: 32px 24px;
    flex-direction: column;
    gap: 20px;
    text-align: center;
  }
}

/* Responsive - Mobile */
@media (max-width: 480px) {
  nav {
    padding: 12px 16px;
  }

  .nav-logo {
    font-size: 12px;
  }

  .nav-links {
    display: none;
  }

  .nav-cta {
    font-size: 10px;
    padding: 6px 16px;
  }

  .hero {
    padding: 0 16px;
    padding-top: 60px;
  }

  .hero-eyebrow {
    font-size: 9px;
  }

  .hero-metrics {
    flex-direction: column;
    gap: 16px;
  }

  section {
    padding: 60px 16px;
  }

  .product-card {
    padding: 32px;
  }

  .philosophy-item {
    padding: 32px;
  }

  .divider {
    margin: 0 16px;
  }

  footer {
    padding: 24px 16px;
  }

  .footer-links {
    flex-wrap: wrap;
    justify-content: center;
    gap: 12px;
  }
}

/* Hide cursor on touch devices */
@media (hover: none) and (pointer: coarse) {
  body {
    cursor: auto !important;
  }

  .cursor,
  .cursor-ring {
    display: none !important;
  }

  .btn-primary,
  .btn-ghost,
  .nav-cta,
  .download-primary {
    cursor: pointer !important;
  }
}

/* Respect reduced motion preference */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }

  #wave-canvas {
    display: none;
  }
}
