/* ============================================
   GhostRun landing page
   Dark, terminal-inspired, spectral accent
   ============================================ */

:root {
  --bg: #08090c;
  --bg-raised: #0e1015;
  --bg-card: #12141a;
  --border: #23262f;
  --border-soft: #1a1d24;
  --text: #e9e9ee;
  --text-dim: #9a9ba6;
  --text-faint: #5f6170;
  --accent: #5ce1b0;
  --accent-soft: rgba(92, 225, 176, 0.14);
  --accent-glow: rgba(92, 225, 176, 0.35);
  --violet: #a78bfa;
  --font-display: "Space Grotesk", system-ui, sans-serif;
  --font-mono: "JetBrains Mono", "SFMono-Regular", Menlo, monospace;
  --radius: 14px;
  --radius-sm: 8px;
  --max-width: 1080px;
}

* { box-sizing: border-box; }

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-display);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

a {
  color: inherit;
  text-decoration: none;
}

code {
  font-family: var(--font-mono);
}

.section-inner {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 28px;
}

.section-inner.narrow {
  max-width: 720px;
}

/* ---------- Atmosphere ---------- */

.fog {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background:
    radial-gradient(600px 400px at 15% 8%, rgba(92, 225, 176, 0.10), transparent 60%),
    radial-gradient(500px 380px at 88% 18%, rgba(167, 139, 250, 0.08), transparent 60%);
}

.grain {
  position: fixed;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  opacity: 0.035;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='120' height='120'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

/* ---------- Nav ---------- */

.nav {
  position: sticky;
  top: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 18px 28px;
  background: rgba(8, 9, 12, 0.72);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--border-soft);
}

.nav-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 600;
  font-size: 1.05rem;
  letter-spacing: -0.01em;
}

.nav-brand .mark {
  font-size: 1.2rem;
  filter: drop-shadow(0 0 8px var(--accent-glow));
}

.nav-links {
  display: flex;
  gap: 28px;
  font-size: 0.92rem;
  color: var(--text-dim);
}

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

.nav-cta {
  font-size: 0.88rem;
  font-weight: 600;
  padding: 8px 16px;
  border: 1px solid var(--border);
  border-radius: 999px;
  white-space: nowrap;
  transition: border-color 0.15s ease, color 0.15s ease;
}

.nav-cta:hover {
  border-color: var(--accent);
  color: var(--accent);
}

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

.nav-toggle span {
  width: 20px;
  height: 2px;
  background: var(--text);
  border-radius: 2px;
}

/* ---------- Hero ---------- */

.hero {
  position: relative;
  z-index: 2;
  padding: 110px 28px 90px;
  text-align: center;
  overflow: hidden;
}

.hero-atmosphere {
  position: absolute;
  inset: 0;
  z-index: -1;
  pointer-events: none;
}

.orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(60px);
  opacity: 0.5;
}

.orb-a {
  width: 380px;
  height: 380px;
  top: -140px;
  left: 8%;
  background: radial-gradient(circle, var(--accent-glow), transparent 70%);
  animation: drift 14s ease-in-out infinite;
}

.orb-b {
  width: 320px;
  height: 320px;
  top: -100px;
  right: 10%;
  background: radial-gradient(circle, rgba(167, 139, 250, 0.3), transparent 70%);
  animation: drift 18s ease-in-out infinite reverse;
}

@keyframes drift {
  0%, 100% { transform: translate(0, 0); }
  50% { transform: translate(24px, 30px); }
}

.wisps {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

.hero-copy {
  max-width: 720px;
  margin: 0 auto;
}

.hero-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: var(--text-dim);
  border: 1px solid var(--border);
  padding: 6px 14px;
  border-radius: 999px;
  margin: 0 0 28px;
}

.hero-eyebrow .dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 8px var(--accent-glow);
}

.hero-title {
  font-size: clamp(2.4rem, 6vw, 4rem);
  line-height: 1.08;
  letter-spacing: -0.02em;
  margin: 0 0 22px;
  font-weight: 700;
}

.ghost-text {
  background: linear-gradient(120deg, var(--accent), var(--violet));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.hero-lede {
  font-size: 1.1rem;
  color: var(--text-dim);
  max-width: 560px;
  margin: 0 auto 36px;
}

.hero-actions {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
  flex-wrap: wrap;
  margin-bottom: 30px;
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 24px;
  border-radius: 999px;
  font-size: 0.95rem;
  font-weight: 600;
  transition: transform 0.15s ease, box-shadow 0.15s ease, border-color 0.15s ease;
}

.btn-primary {
  background: var(--accent);
  color: #052018;
  box-shadow: 0 0 0 rgba(92, 225, 176, 0);
}

.btn-primary:hover {
  box-shadow: 0 0 28px var(--accent-glow);
  transform: translateY(-1px);
}

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

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

.hero-install {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  background: var(--bg-raised);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 10px 10px 10px 20px;
  font-family: var(--font-mono);
  font-size: 0.88rem;
  color: var(--text-dim);
}

.copy-btn {
  background: var(--bg-card);
  border: 1px solid var(--border);
  color: var(--text-dim);
  font-family: var(--font-mono);
  font-size: 0.78rem;
  padding: 7px 14px;
  border-radius: 999px;
  cursor: pointer;
  transition: color 0.15s ease, border-color 0.15s ease;
}

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

.copy-btn.copied {
  color: var(--accent);
  border-color: var(--accent);
}

/* ---------- Sections ---------- */

.section {
  position: relative;
  z-index: 2;
  padding: 90px 0;
  border-top: 1px solid var(--border-soft);
}

.eyebrow {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--accent);
  margin: 0 0 14px;
}

.section h2 {
  font-size: clamp(1.7rem, 3.4vw, 2.4rem);
  letter-spacing: -0.015em;
  line-height: 1.2;
  margin: 0 0 18px;
  max-width: 680px;
}

.section-sub {
  color: var(--text-dim);
  font-size: 1.02rem;
  max-width: 620px;
  margin: 0 0 44px;
}

.lead {
  color: var(--text-dim);
  font-size: 1.08rem;
  line-height: 1.7;
}

.lead a {
  color: var(--accent);
  text-decoration: underline;
  text-decoration-color: rgba(92, 225, 176, 0.35);
  text-underline-offset: 3px;
}

/* ---------- Why grid ---------- */

.why-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1px;
  background: var(--border-soft);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius);
  overflow: hidden;
}

.why-card {
  background: var(--bg-card);
  padding: 32px;
}

.why-index {
  display: block;
  font-family: var(--font-mono);
  color: var(--text-faint);
  font-size: 0.85rem;
  margin-bottom: 14px;
}

.why-card h3 {
  margin: 0 0 10px;
  font-size: 1.1rem;
}

.why-card p {
  margin: 0;
  color: var(--text-dim);
  font-size: 0.95rem;
  line-height: 1.65;
}

.why-card code {
  background: var(--accent-soft);
  color: var(--accent);
  padding: 1px 6px;
  border-radius: 4px;
  font-size: 0.85em;
}

/* ---------- Steps ---------- */

.steps {
  list-style: none;
  counter-reset: step;
  margin: 0 0 48px;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 20px;
}

.steps li {
  counter-increment: step;
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-sm);
  padding: 22px 18px;
  background: var(--bg-raised);
}

.steps li::before {
  content: counter(step);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: var(--accent-soft);
  color: var(--accent);
  font-family: var(--font-mono);
  font-size: 0.8rem;
  margin-bottom: 14px;
}

.steps strong {
  display: block;
  margin-bottom: 6px;
  font-size: 1rem;
}

.steps span {
  color: var(--text-dim);
  font-size: 0.9rem;
  line-height: 1.55;
}

/* ---------- Terminal ---------- */

.terminal {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: #0a0b0f;
  overflow: hidden;
  box-shadow: 0 20px 60px -30px rgba(92, 225, 176, 0.12);
}

.terminal-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 16px;
  background: var(--bg-raised);
  border-bottom: 1px solid var(--border-soft);
}

.terminal-bar span {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--border);
}

.terminal-bar code {
  margin-left: 10px;
  font-size: 0.78rem;
  color: var(--text-faint);
}

.terminal-body {
  margin: 0;
  padding: 24px 26px;
  font-family: var(--font-mono);
  font-size: 0.86rem;
  line-height: 1.75;
  color: var(--text-dim);
  overflow-x: auto;
}

.terminal-body .cmt { color: var(--text-faint); }
.terminal-body .prompt { color: var(--violet); }
.terminal-body .ok { color: var(--accent); }
.terminal-body .dim { color: var(--text-faint); }
.terminal-body .key { color: var(--violet); }

/* ---------- Commands table ---------- */

.cmd-table {
  border: 1px solid var(--border-soft);
  border-radius: var(--radius);
  overflow: hidden;
}

.cmd-row {
  display: grid;
  grid-template-columns: minmax(180px, 280px) 1fr;
  gap: 18px;
  padding: 16px 22px;
  border-bottom: 1px solid var(--border-soft);
  align-items: center;
}

.cmd-row:last-child {
  border-bottom: none;
}

.cmd-row code {
  color: var(--accent);
  font-size: 0.85rem;
}

.cmd-row span {
  color: var(--text-dim);
  font-size: 0.92rem;
}

.cmd-head {
  background: var(--bg-raised);
  font-family: var(--font-mono);
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-faint);
}

/* ---------- MCP config block ---------- */

.mcp-config {
  margin: 28px 0 0;
  padding: 22px 26px;
  border: 1px solid var(--border-soft);
  border-radius: var(--radius);
  background: var(--bg-raised);
  font-family: var(--font-mono);
  font-size: 0.86rem;
  color: var(--text-dim);
  overflow-x: auto;
}

/* ---------- Atlas cross-link ---------- */

.atlas-cross {
  text-align: center;
}

.atlas-cross .section-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
}

.atlas-cross h2 {
  max-width: 640px;
}

.atlas-cross .lead {
  max-width: 560px;
}

.atlas-cross .btn {
  margin-top: 28px;
}

/* ---------- Footnote ---------- */

.footnote {
  margin-top: 26px;
  color: var(--text-faint);
  font-size: 0.86rem;
}

/* ---------- Footer ---------- */

.footer {
  border-top: 1px solid var(--border-soft);
  padding: 56px 28px 40px;
  position: relative;
  z-index: 2;
}

.footer-inner {
  max-width: var(--max-width);
  margin: 0 auto;
  text-align: center;
}

.footer-brand {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  font-weight: 600;
  margin: 0 0 8px;
}

.footer-tag {
  color: var(--text-dim);
  margin: 0 0 24px;
}

.footer-links {
  display: flex;
  justify-content: center;
  gap: 24px;
  font-size: 0.9rem;
  color: var(--text-dim);
  margin-bottom: 20px;
}

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

.footer-meta {
  color: var(--text-faint);
  font-size: 0.82rem;
  margin: 0;
}

/* ---------- Responsive ---------- */

@media (max-width: 860px) {
  .why-grid {
    grid-template-columns: 1fr;
  }

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

  .cmd-row {
    grid-template-columns: 1fr;
    gap: 6px;
  }
}

@media (max-width: 640px) {
  .nav-links {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    flex-direction: column;
    background: var(--bg-raised);
    border-bottom: 1px solid var(--border-soft);
    padding: 20px 28px;
    display: none;
    gap: 16px;
  }

  .nav-links.open {
    display: flex;
  }

  .nav-toggle {
    display: flex;
  }

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

  .hero {
    padding-top: 90px;
  }

  .hero-install {
    flex-direction: column;
    align-items: stretch;
    text-align: center;
    padding: 16px;
    border-radius: var(--radius-sm);
  }
}
