/* ===========================================================
   Runveil — landing page styles
   Dark / cyan aesthetic. No build step; plain CSS.
   =========================================================== */

:root {
  --bg:        #070b14;
  --bg-2:      #0a1120;
  --surface:   #0e1626;
  --surface-2: #121d31;
  --border:    rgba(120, 160, 220, 0.12);
  --border-2:  rgba(120, 160, 220, 0.22);

  --text:      #e8eefc;
  --text-dim:  #9fb0cc;
  --text-mute: #64748b;

  --cyan:      #38bdf8;
  --cyan-2:    #22d3ee;
  --blue:      #3b82f6;
  --accent-glow: rgba(56, 189, 248, 0.45);

  --good:      #34d399;
  --bad:       #f87171;
  --warn:      #fbbf24;

  --maxw: 1120px;
  --radius: 14px;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);

  --font: 'Inter', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --mono: 'JetBrains Mono', ui-monospace, 'SF Mono', Menlo, monospace;
}

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

html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }

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

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

.container { width: 100%; max-width: var(--maxw); margin: 0 auto; padding: 0 24px; }

/* ---------- Background layers ---------- */
#graph-canvas {
  position: fixed; inset: 0;
  width: 100%; height: 100%;
  z-index: 0;
  opacity: 0.55;
  pointer-events: none;
}
.bg-grid {
  position: fixed; inset: 0; z-index: 0;
  background-image:
    linear-gradient(rgba(120,160,220,0.05) 1px, transparent 1px),
    linear-gradient(90deg, rgba(120,160,220,0.05) 1px, transparent 1px);
  background-size: 56px 56px;
  mask-image: radial-gradient(ellipse 80% 60% at 50% 0%, #000 30%, transparent 75%);
  -webkit-mask-image: radial-gradient(ellipse 80% 60% at 50% 0%, #000 30%, transparent 75%);
  pointer-events: none;
}
.bg-glow {
  position: fixed; top: -20%; left: 50%; transform: translateX(-50%);
  width: 900px; height: 700px; z-index: 0;
  background: radial-gradient(circle, rgba(56,189,248,0.18), transparent 60%);
  filter: blur(40px); pointer-events: none;
}

main, .nav, .footer { position: relative; z-index: 1; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; gap: 8px;
  font-weight: 600; font-size: 0.95rem;
  padding: 12px 22px; border-radius: 10px;
  border: 1px solid transparent;
  cursor: pointer; transition: all 0.25s var(--ease);
  white-space: nowrap;
}
.btn .icon { flex-shrink: 0; }
.btn-primary {
  background: linear-gradient(135deg, var(--cyan), var(--blue));
  color: #051018; box-shadow: 0 8px 30px -8px var(--accent-glow);
}
.btn-primary:hover { transform: translateY(-2px); box-shadow: 0 14px 40px -8px var(--accent-glow); }
.btn-secondary {
  background: rgba(255,255,255,0.04); color: var(--text);
  border-color: var(--border-2);
}
.btn-secondary:hover { background: rgba(255,255,255,0.08); border-color: var(--cyan); }
.btn-ghost {
  background: transparent; color: var(--text-dim);
  border-color: var(--border-2); padding: 9px 16px; font-size: 0.88rem;
}
.btn-ghost:hover { color: var(--text); border-color: var(--cyan); }

/* ---------- Nav ---------- */
.nav {
  position: fixed; top: 0; left: 0; right: 0; z-index: 50;
  transition: background 0.3s, border-color 0.3s, backdrop-filter 0.3s;
  border-bottom: 1px solid transparent;
}
.nav.scrolled {
  background: rgba(7, 11, 20, 0.8);
  backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
  border-bottom-color: var(--border);
}
.nav-inner { display: flex; align-items: center; justify-content: space-between; height: 68px; gap: 24px; }
.brand { display: flex; align-items: center; gap: 10px; }
.brand-mark {
  width: 18px; height: 18px; border-radius: 5px;
  background: linear-gradient(135deg, var(--cyan), var(--blue));
  box-shadow: 0 0 16px var(--accent-glow);
  position: relative;
}
.brand-mark::after {
  content: ''; position: absolute; inset: 5px;
  border-radius: 2px; background: var(--bg);
}
.brand-name { font-weight: 700; letter-spacing: 0.16em; font-size: 0.95rem; }
.nav-links { display: flex; gap: 28px; }
.nav-links a { color: var(--text-dim); font-size: 0.9rem; font-weight: 500; transition: color 0.2s; }
.nav-links a:hover { color: var(--text); }
.nav-cta { display: flex; align-items: center; gap: 12px; }
.nav-toggle { display: none; background: none; border: none; color: var(--text); font-size: 1.4rem; cursor: pointer; }

/* ---------- Hero ---------- */
.hero {
  min-height: 100vh; display: flex; flex-direction: column;
  align-items: center; justify-content: center; text-align: center;
  padding: 120px 0 80px; position: relative;
}
.hero-inner { display: flex; flex-direction: column; align-items: center; }
.pill {
  display: inline-flex; align-items: center; gap: 8px;
  font-family: var(--mono); font-size: 0.72rem; letter-spacing: 0.18em;
  color: var(--cyan); padding: 7px 16px; border-radius: 999px;
  border: 1px solid var(--border-2); background: rgba(56,189,248,0.06);
  margin-bottom: 28px;
}
.pill-dot {
  width: 7px; height: 7px; border-radius: 50%; background: var(--cyan);
  box-shadow: 0 0 10px var(--cyan); animation: pulse 2s infinite;
}
@keyframes pulse { 0%,100% { opacity: 1; } 50% { opacity: 0.3; } }

.hero-title {
  font-size: clamp(2.4rem, 6vw, 4.6rem); font-weight: 800;
  line-height: 1.05; letter-spacing: -0.02em; margin-bottom: 24px;
}
.grad-text {
  background: linear-gradient(120deg, var(--cyan), var(--cyan-2) 50%, var(--blue));
  -webkit-background-clip: text; background-clip: text;
  -webkit-text-fill-color: transparent; color: transparent;
}
.hero-sub {
  max-width: 640px; font-size: clamp(1.02rem, 2vw, 1.22rem);
  color: var(--text-dim); margin-bottom: 36px;
}
.hero-sub strong { color: var(--text); font-weight: 600; }
.hero-actions { display: flex; gap: 14px; flex-wrap: wrap; justify-content: center; margin-bottom: 28px; }
.hero-foot { font-size: 0.9rem; color: var(--text-mute); }
.hero-foot a { color: var(--cyan); }
.hero-foot a:hover { text-decoration: underline; }

.scroll-hint {
  position: absolute; bottom: 28px; left: 50%; transform: translateX(-50%);
  display: flex; flex-direction: column; align-items: center; gap: 6px;
  font-size: 0.72rem; letter-spacing: 0.1em; color: var(--text-mute);
  text-transform: uppercase;
}
.scroll-arrow { animation: bounce 1.8s infinite; font-size: 1rem; }
@keyframes bounce { 0%,100% { transform: translateY(0); } 50% { transform: translateY(7px); } }

/* ---------- Section primitives ---------- */
section { padding: 100px 0; }
.eyebrow {
  font-family: var(--mono); font-size: 0.78rem; letter-spacing: 0.2em;
  text-transform: uppercase; color: var(--cyan); margin-bottom: 14px;
}
.section-title {
  font-size: clamp(1.8rem, 4vw, 2.8rem); font-weight: 800;
  letter-spacing: -0.02em; line-height: 1.1; margin-bottom: 18px;
}
.section-lead { max-width: 620px; color: var(--text-dim); font-size: 1.08rem; margin-bottom: 40px; }
.section-lead em { color: var(--cyan); font-style: normal; }

/* ---------- Wedge / compare ---------- */
.compare {
  display: grid; grid-template-columns: 1fr auto 1fr; gap: 20px;
  align-items: center; margin: 20px 0 24px;
}
.compare-card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 32px; text-align: center;
  position: relative; overflow: hidden;
}
.compare-after { border-color: rgba(52,211,153,0.3); box-shadow: 0 0 50px -20px rgba(52,211,153,0.5); }
.compare-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 20px; }
.compare-tool { font-family: var(--mono); font-size: 0.95rem; color: var(--text); }
.compare-tag { font-size: 0.68rem; padding: 4px 10px; border-radius: 999px; font-weight: 600; }
.tag-bad { background: rgba(248,113,113,0.12); color: var(--bad); }
.tag-good { background: rgba(52,211,153,0.14); color: var(--good); }
.compare-num { font-size: clamp(3rem, 9vw, 5rem); font-weight: 800; line-height: 1; font-family: var(--mono); }
.compare-before .compare-num { color: var(--bad); }
.compare-label { color: var(--text-mute); font-size: 0.92rem; margin-top: 8px; }
.compare-bar { height: 6px; border-radius: 999px; background: rgba(255,255,255,0.06); margin-top: 22px; overflow: hidden; }
.bar-fill { display: block; height: 100%; width: 0; border-radius: 999px; transition: width 1.4s var(--ease); }
.bar-fill.grow { width: var(--w); }
.bar-bad { background: linear-gradient(90deg, #f87171, #ef4444); }
.bar-good { background: linear-gradient(90deg, var(--good), var(--cyan)); }
.compare-arrow { display: flex; align-items: center; color: var(--cyan); font-size: 1.6rem; }
.arrow-line { width: 28px; height: 2px; background: linear-gradient(90deg, transparent, var(--cyan)); }
.compare-caption { text-align: center; color: var(--text-dim); font-size: 1.05rem; }
.compare-caption strong { color: var(--good); }

/* ---------- Terminal ---------- */
.terminal {
  background: #060a12; border: 1px solid var(--border-2);
  border-radius: var(--radius); overflow: hidden; max-width: 820px;
  box-shadow: 0 30px 80px -30px rgba(0,0,0,0.8), 0 0 60px -30px var(--accent-glow);
}
.terminal-bar {
  display: flex; align-items: center; gap: 8px;
  padding: 12px 16px; background: var(--surface);
  border-bottom: 1px solid var(--border);
}
.dot { width: 11px; height: 11px; border-radius: 50%; }
.dot-r { background: #ff5f56; } .dot-y { background: #ffbd2e; } .dot-g { background: #27c93f; }
.terminal-title { margin-left: 12px; font-family: var(--mono); font-size: 0.78rem; color: var(--text-mute); }
.terminal-body {
  font-family: var(--mono); font-size: 0.86rem; line-height: 1.7;
  padding: 22px; color: var(--text-dim); white-space: pre-wrap;
  min-height: 320px;
}
.terminal-body .t-prompt { color: var(--cyan); }
.terminal-body .t-cmd { color: var(--text); }
.terminal-body .t-dim { color: var(--text-mute); }
.terminal-body .t-bad { color: var(--bad); }
.terminal-body .t-good { color: var(--good); }
.terminal-body .t-warn { color: var(--warn); }
.terminal-body .t-cyan { color: var(--cyan); }
.cursor { display: inline-block; width: 8px; height: 1.05em; background: var(--cyan); vertical-align: text-bottom; animation: blink 1s steps(2) infinite; }
@keyframes blink { 50% { opacity: 0; } }

/* ---------- How it works ---------- */
.steps { display: grid; grid-template-columns: repeat(4, 1fr); gap: 20px; }
.step {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 28px; transition: all 0.3s var(--ease);
}
.step:hover { transform: translateY(-4px); border-color: var(--border-2); background: var(--surface-2); }
.step-num { font-family: var(--mono); font-size: 1.6rem; font-weight: 700; color: var(--cyan); margin-bottom: 14px; opacity: 0.8; }
.step h3 { font-size: 1.12rem; margin-bottom: 10px; }
.step p { color: var(--text-dim); font-size: 0.92rem; }
.step code, .feature-card code { font-family: var(--mono); font-size: 0.85em; color: var(--cyan); background: rgba(56,189,248,0.08); padding: 1px 6px; border-radius: 5px; }

/* ---------- Features ---------- */
.feature-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.feature-card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 30px; transition: all 0.3s var(--ease);
  position: relative; overflow: hidden;
}
.feature-card::before {
  content: ''; position: absolute; inset: 0;
  background: radial-gradient(circle at 50% 0%, rgba(56,189,248,0.08), transparent 60%);
  opacity: 0; transition: opacity 0.3s;
}
.feature-card:hover { transform: translateY(-4px); border-color: var(--border-2); }
.feature-card:hover::before { opacity: 1; }
.feature-icon {
  width: 48px; height: 48px; border-radius: 12px;
  display: grid; place-items: center; font-size: 1.5rem;
  background: rgba(56,189,248,0.1); color: var(--cyan);
  margin-bottom: 18px; border: 1px solid var(--border-2);
}
.feature-card h3 { font-size: 1.18rem; margin-bottom: 10px; }
.feature-card p { color: var(--text-dim); font-size: 0.94rem; }

/* ---------- Install / CTA ---------- */
.install { text-align: center; }
.install-inner { display: flex; flex-direction: column; align-items: center; }
.install-cmd {
  display: inline-flex; align-items: center; gap: 14px;
  background: #060a12; border: 1px solid var(--border-2);
  border-radius: 12px; padding: 14px 14px 14px 22px; margin: 12px 0 32px;
  font-family: var(--mono); font-size: 0.95rem; max-width: 100%; overflow: hidden;
}
.install-cmd code { color: var(--text); white-space: nowrap; overflow-x: auto; }
.cmd-prompt { color: var(--cyan); margin-right: 10px; user-select: none; }
.copy-btn {
  background: rgba(56,189,248,0.12); color: var(--cyan);
  border: 1px solid var(--border-2); border-radius: 8px;
  padding: 8px 16px; cursor: pointer; font-weight: 600; font-size: 0.85rem;
  transition: all 0.2s; flex-shrink: 0;
}
.copy-btn:hover { background: rgba(56,189,248,0.22); }
.copy-btn.copied { color: var(--good); border-color: rgba(52,211,153,0.4); }
.install-actions { display: flex; gap: 14px; flex-wrap: wrap; justify-content: center; }

/* ---------- Footer ---------- */
.footer { border-top: 1px solid var(--border); padding: 56px 0 32px; background: var(--bg-2); }
.footer-inner { display: flex; justify-content: space-between; align-items: flex-start; gap: 40px; flex-wrap: wrap; }
.footer-brand { display: flex; gap: 14px; align-items: center; }
.footer-tagline { color: var(--text-mute); font-size: 0.88rem; margin-top: 2px; }
.footer-links { display: flex; gap: 28px; flex-wrap: wrap; }
.footer-links a { color: var(--text-dim); font-size: 0.92rem; transition: color 0.2s; }
.footer-links a:hover { color: var(--cyan); }
.footer-bottom { margin-top: 36px; padding-top: 24px; border-top: 1px solid var(--border); color: var(--text-mute); font-size: 0.84rem; }

/* ---------- Reveal animation ----------
   Hidden state only applies when JS is present (html.js); without JS,
   all content stays visible so the page never renders blank. */
.js [data-reveal] { opacity: 0; transform: translateY(28px); transition: opacity 0.7s var(--ease), transform 0.7s var(--ease); }
.js [data-reveal].in { opacity: 1; transform: none; }

/* ---------- Responsive ---------- */
@media (max-width: 860px) {
  .nav-links { display: none; }
  .nav-links.open {
    display: flex; flex-direction: column; position: absolute; top: 68px; left: 0; right: 0;
    background: rgba(7,11,20,0.97); backdrop-filter: blur(14px);
    padding: 20px 24px; gap: 18px; border-bottom: 1px solid var(--border);
  }
  .nav-toggle { display: block; }
  .steps { grid-template-columns: repeat(2, 1fr); }
  .feature-grid { grid-template-columns: 1fr; }
  .compare { grid-template-columns: 1fr; }
  .compare-arrow { transform: rotate(90deg); justify-content: center; }
}
@media (max-width: 520px) {
  .steps { grid-template-columns: 1fr; }
  section { padding: 72px 0; }
  .nav-cta .btn-ghost { padding: 8px 12px; }
  .install-cmd { font-size: 0.8rem; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; }
  [data-reveal] { opacity: 1; transform: none; }
  #graph-canvas { display: none; }
}
