:root {
  --bg: #06070a;
  --bg-2: #0b0d12;
  --line: rgba(255, 255, 255, 0.08);
  --fg: #e8ebf0;
  --muted: #8a919e;
  --cyan: #5cf2ff;
  --violet: #8b7bff;
  --sans: "Space Grotesk", system-ui, sans-serif;
  --mono: "JetBrains Mono", ui-monospace, monospace;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  background: var(--bg);
  color: var(--fg);
  font-family: var(--sans);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
a { color: inherit; text-decoration: none; }
.mono { font-family: var(--mono); }
.grad {
  background: linear-gradient(90deg, var(--cyan), var(--violet));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.dot {
  display: inline-block; width: 6px; height: 6px; border-radius: 50%;
  background: var(--cyan); box-shadow: 0 0 10px var(--cyan);
  animation: pulse 2s infinite; vertical-align: middle;
}
@keyframes pulse { 50% { opacity: 0.3; } }

/* NAV */
.nav {
  position: fixed; inset: 0 0 auto 0; z-index: 10;
  display: flex; align-items: center; justify-content: space-between;
  padding: 18px clamp(16px, 4vw, 48px);
  backdrop-filter: blur(12px);
  background: linear-gradient(var(--bg), rgba(6, 7, 10, 0.4));
  border-bottom: 1px solid var(--line);
}
.logo { display: flex; align-items: center; gap: 10px; font-weight: 600; letter-spacing: 0.2em; font-size: 14px; }
.logo svg { color: var(--cyan); }
.nav nav { display: flex; gap: 28px; align-items: center; font-size: 14px; color: var(--muted); }
.nav nav a:hover { color: var(--fg); }
.nav-cta { color: var(--fg) !important; border: 1px solid var(--line); padding: 7px 14px; border-radius: 999px; }
.nav-cta:hover { border-color: var(--cyan); }

/* BUTTONS */
.btn {
  display: inline-block; padding: 13px 22px; border-radius: 999px;
  font-size: 15px; font-weight: 500; transition: all 0.2s;
}
.btn.primary { background: var(--fg); color: var(--bg); }
.btn.primary:hover { background: var(--cyan); box-shadow: 0 0 30px rgba(92, 242, 255, 0.35); }
.btn.ghost { border: 1px solid var(--line); color: var(--muted); font-size: 13px; }
.btn.ghost:hover { color: var(--fg); border-color: var(--fg); }

/* HERO */
.hero { position: relative; min-height: 100vh; display: flex; align-items: center; overflow: hidden; }
#hero-canvas { position: absolute; inset: 0; width: 100%; height: 100%; }
.hero::after {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background:
    linear-gradient(90deg, var(--bg) 18%, rgba(6, 7, 10, 0.6) 40%, transparent 65%),
    linear-gradient(0deg, var(--bg), transparent 25%);
}
.hero-inner { position: relative; z-index: 2; padding: 120px clamp(16px, 6vw, 96px) 80px; max-width: 820px; }
.eyebrow { font-size: 12px; letter-spacing: 0.15em; color: var(--muted); margin-bottom: 28px; display: flex; gap: 10px; align-items: center; }
h1 { font-size: clamp(42px, 7.5vw, 96px); font-weight: 500; line-height: 1; letter-spacing: -0.035em; }
.lede { margin-top: 28px; font-size: clamp(16px, 1.6vw, 19px); line-height: 1.6; color: var(--muted); max-width: 560px; font-weight: 300; }
.hero-actions { margin-top: 40px; display: flex; gap: 14px; flex-wrap: wrap; }
.hero-hud {
  position: absolute; z-index: 2; right: clamp(16px, 4vw, 48px); bottom: 40px;
  font-size: 11px; color: var(--muted); display: grid; gap: 6px;
  border-left: 1px solid var(--line); padding-left: 16px;
}
.hero-hud div { display: flex; gap: 18px; justify-content: space-between; }
.hero-hud .v { color: var(--fg); font-variant-numeric: tabular-nums; }

/* SECTIONS */
.section { padding: clamp(80px, 12vw, 160px) clamp(16px, 6vw, 96px); border-top: 1px solid var(--line); position: relative; }
.section-head { max-width: 720px; margin-bottom: 56px; }
.label { font-size: 12px; letter-spacing: 0.15em; color: var(--cyan); margin-bottom: 20px; }
h2 { font-size: clamp(32px, 4.5vw, 56px); font-weight: 500; letter-spacing: -0.03em; line-height: 1.05; }
.sub { margin-top: 20px; color: var(--muted); font-size: 17px; line-height: 1.6; font-weight: 300; max-width: 600px; }

/* WORLDS */
.worlds-wrap { border: 1px solid var(--line); border-radius: 14px; overflow: hidden; background: var(--bg-2); }
#worlds-canvas { display: block; width: 100%; aspect-ratio: 2 / 1; }
.worlds-bar {
  display: flex; gap: 24px; align-items: center; flex-wrap: wrap;
  padding: 14px 18px; border-top: 1px solid var(--line); font-size: 12px; color: var(--muted);
}
.chip {
  margin-left: auto; font: inherit; color: var(--fg); background: none; cursor: pointer;
  border: 1px solid var(--line); border-radius: 999px; padding: 6px 12px; transition: 0.2s;
}
.chip:hover { border-color: var(--cyan); color: var(--cyan); }

/* STEPS */
.steps { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1px; background: var(--line); border: 1px solid var(--line); border-radius: 14px; overflow: hidden; }
.step { background: var(--bg); padding: 32px 28px 36px; transition: background 0.3s; }
.step:hover { background: var(--bg-2); }
.step .num { font-size: 12px; color: var(--muted); }
.glyph { width: 100%; height: 64px; margin: 28px 0; fill: none; stroke: var(--muted); stroke-width: 1.4; }
.glyph circle { fill: var(--cyan); stroke: none; }
.glyph .anim { stroke: var(--cyan); stroke-dasharray: 160; stroke-dashoffset: 160; animation: draw 3s ease-in-out infinite; }
.step:nth-child(2) .anim { animation-delay: 0.4s; }
.step:nth-child(3) .anim { animation-delay: 0.8s; }
.step:nth-child(4) .anim { animation-delay: 1.2s; }
@keyframes draw { 50%, 80% { stroke-dashoffset: 0; } 100% { stroke-dashoffset: -160; } }
.step h3 { font-size: 22px; font-weight: 500; margin-bottom: 10px; }
.step p { color: var(--muted); font-size: 15px; line-height: 1.55; font-weight: 300; }

/* ENGINE */
.engine { display: grid; grid-template-columns: 1fr 1fr; gap: clamp(32px, 6vw, 80px); align-items: center; }
.stats { margin-top: 48px; display: grid; gap: 28px; }
.stat { display: flex; flex-direction: column; gap: 4px; border-left: 1px solid var(--line); padding-left: 18px; }
.stat-v { font-size: clamp(28px, 3.5vw, 40px); color: var(--fg); font-variant-numeric: tabular-nums; }
.stat-k { font-size: 14px; color: var(--muted); }
.terminal { border: 1px solid var(--line); border-radius: 14px; background: var(--bg-2); overflow: hidden; min-width: 0; }
.term-bar { display: flex; align-items: center; gap: 7px; padding: 12px 16px; border-bottom: 1px solid var(--line); font-size: 11px; color: var(--muted); }
.term-bar i { width: 9px; height: 9px; border-radius: 50%; background: var(--line); }
.term-bar span { margin-left: 10px; }
#term { padding: 18px; height: 360px; overflow: hidden; font-size: 12px; line-height: 1.75; color: var(--muted); white-space: pre-wrap; word-break: break-all; }
#term .ok { color: var(--cyan); }
#term .hl { color: var(--violet); }
#term .w { color: var(--fg); }

/* CTA */
.cta { text-align: center; overflow: hidden; min-height: 70vh; display: flex; align-items: center; justify-content: center; }
#cta-canvas { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0.7; }
.cta-inner { position: relative; z-index: 2; display: flex; flex-direction: column; align-items: center; }
.cta .sub { margin: 20px auto 40px; }

.foot { display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; padding: 24px clamp(16px, 6vw, 96px); border-top: 1px solid var(--line); font-size: 12px; color: var(--muted); }

/* REVEAL */
.reveal { opacity: 0; transform: translateY(24px); transition: opacity 0.9s, transform 0.9s; }
.reveal.in { opacity: 1; transform: none; }

@media (max-width: 900px) {
  .steps { grid-template-columns: 1fr 1fr; }
  .engine { grid-template-columns: 1fr; }
  .nav nav a:not(.nav-cta) { display: none; }
  .hero-hud { display: none; }
  #worlds-canvas { aspect-ratio: 1 / 1; }
}
@media (max-width: 540px) {
  .steps { grid-template-columns: 1fr; }
  .chip { margin-left: 0; }
}
@media (prefers-reduced-motion: reduce) {
  .glyph .anim, .dot { animation: none; stroke-dashoffset: 0; }
  .reveal { opacity: 1; transform: none; }
}
