/* ==========================================================================
   Design tokens
   ========================================================================== */
:root {
  --black: #050505;
  --bg: #0a0a0a;
  --bg-elevated: #121212;
  --bg-card: #0f0f0f;
  --border: #232323;
  --border-strong: #3a3a3a;
  --white: #ffffff;
  --text: #ededed;
  --text-dim: #8f8f8f;
  --text-faint: #5a5a5a;

  --font-display: "Space Grotesk", "Helvetica Neue", Arial, sans-serif;
  --font-body: "Inter", "Helvetica Neue", Arial, sans-serif;
  --font-mono: "JetBrains Mono", "SFMono-Regular", Consolas, monospace;

  --radius: 10px;
  --radius-sm: 6px;
  --ease: cubic-bezier(0.16, 1, 0.3, 1);
  --max-w: 1120px;
}

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

html { scroll-behavior: smooth; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

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

/* Faint grain texture over everything, sits above bg */
body::before {
  content: "";
  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");
}

a { color: inherit; text-decoration: none; }
ul { list-style: none; }
img, svg { display: block; max-width: 100%; }

.container {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 0 32px;
  position: relative;
  z-index: 2;
}

::selection { background: var(--white); color: var(--black); }

:focus-visible {
  outline: 2px solid var(--white);
  outline-offset: 3px;
  border-radius: 3px;
}

/* ==========================================================================
   Typography helpers
   ========================================================================== */
.eyebrow {
  font-family: var(--font-mono);
  font-size: 13px;
  letter-spacing: 0.02em;
  color: var(--text-dim);
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 18px;
}
.eyebrow::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--white);
  box-shadow: 0 0 0 3px rgba(255,255,255,0.08);
}

h1, h2, h3, h4 {
  font-family: var(--font-display);
  font-weight: 600;
  letter-spacing: -0.02em;
  color: var(--white);
}

.section-heading {
  font-size: clamp(28px, 4vw, 42px);
  line-height: 1.15;
  max-width: 640px;
}

.section-sub {
  color: var(--text-dim);
  font-size: 17px;
  max-width: 560px;
  margin-top: 14px;
}

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

/* ==========================================================================
   Buttons
   ========================================================================== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 13px 24px;
  border-radius: var(--radius-sm);
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 15px;
  cursor: pointer;
  border: 1px solid transparent;
  transition: transform 0.35s var(--ease), background 0.25s ease, border-color 0.25s ease, color 0.25s ease;
  white-space: nowrap;
}
.btn:active { transform: scale(0.97); }

.btn-primary {
  background: var(--white);
  color: var(--black);
}
.btn-primary:hover { background: #d9d9d9; transform: translateY(-2px); }

.btn-ghost {
  background: transparent;
  border-color: var(--border-strong);
  color: var(--text);
}
.btn-ghost:hover {
  border-color: var(--white);
  transform: translateY(-2px);
}

.btn-sm { padding: 9px 16px; font-size: 13px; }

/* ==========================================================================
   Nav
   ========================================================================== */
.nav {
  position: sticky;
  top: 0;
  z-index: 50;
  border-bottom: 1px solid transparent;
  transition: border-color 0.3s ease, background 0.3s ease;
}
.nav.scrolled {
  background: rgba(10,10,10,0.85);
  backdrop-filter: blur(10px);
  border-bottom-color: var(--border);
}
.nav-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 0;
}
.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 17px;
  color: var(--white);
}
.brand-avatar {
  width: 32px;
  height: 32px;
  flex: 0 0 32px;
  display: block;
  object-fit: cover;
  object-position: center;
  border-radius: 8px;
  border: 1px solid var(--border-strong);
}
.brand-mark {
  width: 30px;
  height: 30px;
  border-radius: 8px;
  background: var(--white);
  color: var(--black);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-mono);
  font-size: 14px;
  font-weight: 700;
}
.nav-links {
  display: flex;
  align-items: center;
  gap: 34px;
}
.nav-links a:not(.btn) {
  font-size: 14px;
  color: var(--text-dim);
  transition: color 0.2s ease;
}
.nav-links a:not(.btn):hover { color: var(--white); }
.nav-cta { display: flex; align-items: center; gap: 14px; }
.nav-toggle { display: none; }

@media (max-width: 780px) {
  .nav-links-desktop { display: none; }
  .nav-toggle {
    display: flex;
    width: 38px; height: 38px;
    align-items: center; justify-content: center;
    border: 1px solid var(--border-strong);
    border-radius: var(--radius-sm);
    background: none;
    color: var(--white);
  }
}

/* ==========================================================================
   Hero
   ========================================================================== */
.hero {
  padding: 120px 0 90px;
  position: relative;
}
.hero-grid {
  display: grid;
  grid-template-columns: 1.05fr 0.95fr;
  gap: 56px;
  align-items: center;
}
@media (max-width: 900px) {
  .hero-grid { grid-template-columns: 1fr; }
  .hero { padding: 80px 0 60px; }
}

.hero h1 {
  font-size: clamp(38px, 5.4vw, 62px);
  line-height: 1.06;
}
.hero h1 .dim { color: var(--text-faint); }

.hero-sub {
  margin-top: 22px;
  font-size: 18px;
  color: var(--text-dim);
  max-width: 480px;
  line-height: 1.65;
}

.hero-cta {
  margin-top: 34px;
  display: flex;
  gap: 14px;
  flex-wrap: wrap;
}

.hero-meta {
  margin-top: 30px;
  display: flex;
  gap: 26px;
  flex-wrap: wrap;
}
.hero-meta div {
  font-family: var(--font-mono);
  font-size: 12.5px;
  color: var(--text-faint);
  display: flex;
  align-items: center;
  gap: 8px;
}
.hero-meta strong { color: var(--white); font-weight: 600; }
.dot {
  width: 6px; height: 6px; border-radius: 50%;
  background: #3ddc84;
  display: inline-block;
  box-shadow: 0 0 0 3px rgba(61,220,132,0.12);
}

/* Terminal */
.terminal {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: 0 30px 80px -30px rgba(0,0,0,0.7);
  opacity: 0;
  transform: translateY(24px);
  animation: rise 0.9s var(--ease) 0.15s forwards;
}
@keyframes rise { to { opacity: 1; transform: translateY(0); } }

.terminal-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 13px 16px;
  border-bottom: 1px solid var(--border);
}
.terminal-bar span {
  width: 10px; height: 10px;
  border-radius: 50%;
  background: var(--border-strong);
}
.terminal-bar .title {
  margin-left: 8px;
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--text-faint);
  width: auto;
  height: auto;
  border-radius: 0;
  background: none;
}
.terminal-body {
  padding: 22px;
  font-family: var(--font-mono);
  font-size: 14px;
  line-height: 1.9;
  min-height: 230px;
}
.terminal-line { color: var(--text-dim); }
.terminal-line .prompt { color: var(--white); }
.terminal-cursor {
  display: inline-block;
  width: 7px; height: 15px;
  background: var(--white);
  vertical-align: middle;
  animation: blink 1s step-end infinite;
}
@keyframes blink { 50% { opacity: 0; } }

/* ==========================================================================
   Stats bar
   ========================================================================== */
.stats {
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  padding: 44px 0;
}
.stats-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 24px;
  text-align: center;
}
@media (max-width: 700px) {
  .stats-grid { grid-template-columns: repeat(2, 1fr); }
}
.stat-num {
  font-family: var(--font-display);
  font-size: clamp(26px, 3.4vw, 38px);
  font-weight: 700;
  color: var(--white);
}
.stat-label {
  margin-top: 6px;
  font-size: 13px;
  color: var(--text-faint);
  font-family: var(--font-mono);
}

/* ==========================================================================
   Sections
   ========================================================================== */
.section { padding: 110px 0; }
@media (max-width: 700px) { .section { padding: 70px 0; } }

.section-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 30px;
  margin-bottom: 56px;
}
@media (max-width: 700px) {
  .section-head { flex-direction: column; align-items: flex-start; }
}

/* Reveal on scroll */
.reveal {
  opacity: 0;
  transform: translateY(28px);
  transition: opacity 0.8s var(--ease), transform 0.8s var(--ease);
}
.reveal.in-view { opacity: 1; transform: translateY(0); }

/* Feature grid */
.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;
}
@media (max-width: 860px) { .features-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 560px) { .features-grid { grid-template-columns: 1fr; } }

.feature-card {
  transition: transform 0.35s var(--ease), border-color 0.25s ease, background 0.25s ease;
  background: var(--bg-card);
  padding: 34px 30px;
  transition: background 0.3s ease;
  position: relative;
}
.feature-card:hover { background: var(--bg-elevated); }
.feature-icon {
  width: 40px; height: 40px;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  display: flex; align-items: center; justify-content: center;
  margin-bottom: 20px;
  color: var(--white);
  transition: border-color 0.3s ease, transform 0.3s ease;
}
.feature-card:hover .feature-icon { border-color: var(--white); transform: translateY(-3px); }
.feature-card h3 {
  font-size: 17px;
  margin-bottom: 8px;
}
.feature-card p {
  font-size: 14.5px;
  color: var(--text-dim);
  line-height: 1.6;
}

/* Commands showcase */
.cmd-list {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}
.cmd-row {
  display: grid;
  grid-template-columns: 220px 1fr;
  gap: 20px;
  padding: 20px 26px;
  border-bottom: 1px solid var(--border);
  align-items: center;
  transition: background 0.25s ease;
}
.cmd-row:last-child { border-bottom: none; }
.cmd-row:hover { background: var(--bg-elevated); }
.cmd-name {
  font-family: var(--font-mono);
  font-size: 14.5px;
  color: var(--white);
}
.cmd-desc { font-size: 14.5px; color: var(--text-dim); }
@media (max-width: 620px) {
  .cmd-row { grid-template-columns: 1fr; gap: 6px; }
}

/* CTA band */
.cta-band {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 70px 50px;
  text-align: center;
  position: relative;
  overflow: hidden;
  background:
    radial-gradient(600px 260px at 50% 0%, rgba(255,255,255,0.06), transparent 70%);
}
.cta-band h2 { font-size: clamp(28px, 4vw, 40px); }
.cta-band p { margin: 16px auto 30px; color: var(--text-dim); max-width: 460px; }
.cta-actions { display: flex; justify-content: center; gap: 14px; flex-wrap: wrap; }

/* ==========================================================================
   Footer
   ========================================================================== */
.footer {
  border-top: 1px solid var(--border);
  padding: 56px 0 34px;
}
.footer-top {
  display: flex;
  justify-content: space-between;
  gap: 40px;
  flex-wrap: wrap;
  padding-bottom: 40px;
}
.footer-cols {
  display: flex;
  gap: 64px;
  flex-wrap: wrap;
}
.footer-col h4 {
  font-size: 12.5px;
  color: var(--text-faint);
  font-family: var(--font-mono);
  font-weight: 500;
  letter-spacing: 0.03em;
  margin-bottom: 14px;
}
.footer-col a {
  display: block;
  font-size: 14px;
  color: var(--text-dim);
  margin-bottom: 10px;
  transition: color 0.2s ease;
}
.footer-col a:hover { color: var(--white); }
.footer-bottom {
  border-top: 1px solid var(--border);
  padding-top: 24px;
  display: flex;
  justify-content: space-between;
  gap: 14px;
  flex-wrap: wrap;
  font-size: 13px;
  color: var(--text-faint);
}

/* ==========================================================================
   Legal pages (Terms / Privacy)
   ========================================================================== */
.legal-hero {
  padding: 90px 0 50px;
  border-bottom: 1px solid var(--border);
}
.legal-hero h1 { font-size: clamp(32px, 5vw, 48px); }
.legal-hero .updated {
  margin-top: 16px;
  font-family: var(--font-mono);
  font-size: 13px;
  color: var(--text-faint);
}
.legal-layout {
  display: grid;
  grid-template-columns: 260px 1fr;
  gap: 60px;
  padding: 64px 0 120px;
  align-items: start;
}
@media (max-width: 860px) {
  .legal-layout { grid-template-columns: 1fr; }
}
.legal-toc {
  position: sticky;
  top: 100px;
  border-left: 1px solid var(--border);
  padding-left: 22px;
}
.legal-toc .toc-label {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--text-faint);
  margin-bottom: 16px;
  display: block;
}
.legal-toc a {
  display: block;
  font-size: 13.5px;
  color: var(--text-dim);
  padding: 6px 0;
  border-left: 2px solid transparent;
  margin-left: -23px;
  padding-left: 21px;
  transition: color 0.2s ease, border-color 0.2s ease;
}
.legal-toc a:hover { color: var(--white); }
.legal-toc a.active { color: var(--white); border-left-color: var(--white); }

.legal-body h2 {
  font-size: 21px;
  margin-top: 46px;
  margin-bottom: 14px;
  padding-top: 10px;
  scroll-margin-top: 90px;
}
.legal-body h2:first-child { margin-top: 0; }
.legal-body h3 {
  font-size: 16px;
  margin-top: 26px;
  margin-bottom: 10px;
  color: var(--white);
}
.legal-body p, .legal-body li {
  font-size: 15px;
  color: var(--text-dim);
  line-height: 1.75;
  margin-bottom: 14px;
}
.legal-body ul, .legal-body ol {
  margin: 0 0 16px 0;
  padding-left: 22px;
}
.legal-body ul { list-style: disc; }
.legal-body ol { list-style: decimal; }
.legal-body strong { color: var(--text); font-weight: 600; }
.legal-body a.inline-link {
  color: var(--white);
  border-bottom: 1px solid var(--border-strong);
}
.legal-body a.inline-link:hover { border-color: var(--white); }
.legal-intro {
  font-size: 16.5px;
  color: var(--text-dim);
  max-width: 640px;
  margin-bottom: 40px;
}
.legal-note {
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 16px 18px;
  font-size: 13.5px;
  color: var(--text-faint);
  font-family: var(--font-mono);
  margin: 30px 0;
  line-height: 1.7;
}
