/* ==========================================================================
   Tokens
   ========================================================================== */
:root {
  --bg: #090c11;
  --bg-soft: #0c1017;
  --surface: #10151d;
  --surface-2: #161d27;
  --border: #212b38;
  --border-soft: #1a222d;
  --text: #e9eef4;
  --text-dim: #9aa7b8;
  --text-faint: #5e6a7a;

  --accent: #4ee6a8;
  --accent-dim: #2f9d72;
  --accent-soft: rgba(78, 230, 168, 0.12);
  --accent-glow: rgba(78, 230, 168, 0.35);

  --danger: #ff6b6b;
  --danger-soft: rgba(255, 107, 107, 0.12);
  --warning: #ffc069;
  --blue: #6ea8fe;

  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --font-display: 'Space Grotesk', var(--font-sans);
  --font-mono: 'JetBrains Mono', ui-monospace, 'SFMono-Regular', Menlo, Consolas, monospace;

  --radius-sm: 8px;
  --radius: 12px;
  --radius-lg: 20px;

  --maxw: 1180px;
  --header-h: 68px;

  --shadow-lg: 0 30px 80px -30px rgba(0, 0, 0, 0.65);
  --shadow-md: 0 12px 30px -14px rgba(0, 0, 0, 0.55);
}

/* ==========================================================================
   Reset + base
   ========================================================================== */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: calc(var(--header-h) + 16px); }

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

h1, h2, h3, h4 {
  font-family: var(--font-display);
  font-weight: 600;
  line-height: 1.2;
  margin: 0 0 0.5em;
  letter-spacing: -0.01em;
}

p { margin: 0 0 1em; color: var(--text-dim); }
a { color: inherit; text-decoration: none; }
ul, ol { margin: 0; padding: 0; list-style: none; }
code { font-family: var(--font-mono); font-size: 0.9em; }
img, svg { display: block; max-width: 100%; }

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

/* subtle circuit-board dotted grid behind everything */
.bg-grid {
  position: fixed;
  inset: 0;
  z-index: -1;
  background-image:
    radial-gradient(circle at 1px 1px, rgba(255,255,255,0.045) 1px, transparent 0);
  background-size: 28px 28px;
  mask-image: radial-gradient(ellipse 80% 60% at 50% 0%, black 40%, transparent 100%);
}

/* ==========================================================================
   Buttons / badges
   ========================================================================== */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-sans);
  font-weight: 600;
  font-size: 0.92rem;
  padding: 12px 22px;
  border-radius: var(--radius-sm);
  border: 1px solid transparent;
  cursor: pointer;
  transition: transform 0.15s ease, background 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease;
  white-space: nowrap;
}
.btn:hover { transform: translateY(-1px); }
.btn-sm { padding: 8px 14px; font-size: 0.85rem; }

.btn-primary {
  background: var(--accent);
  color: #06120c;
  box-shadow: 0 8px 24px -8px var(--accent-glow);
}
.btn-primary:hover { background: #63edb6; }

.btn-ghost {
  background: var(--surface);
  color: var(--text);
  border-color: var(--border);
}
.btn-ghost:hover { border-color: var(--accent-dim); background: var(--surface-2); }

.badge-link {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text-dim);
  padding: 7px 12px;
  border-radius: 999px;
  border: 1px solid var(--border);
  transition: border-color 0.15s ease, color 0.15s ease;
}
.badge-link:hover { color: var(--text); border-color: var(--accent-dim); }

.dot { width: 7px; height: 7px; border-radius: 50%; display: inline-block; }
.dot-accent { background: var(--accent); box-shadow: 0 0 8px var(--accent-glow); }

/* ==========================================================================
   Header
   ========================================================================== */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  height: var(--header-h);
  display: flex;
  align-items: center;
  background: rgba(9, 12, 17, 0.72);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--border-soft);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.05rem;
  letter-spacing: 0.04em;
  color: var(--text);
}
.brand svg { color: var(--accent); }

.main-nav {
  display: flex;
  align-items: center;
  gap: 28px;
  font-size: 0.9rem;
  font-weight: 500;
}
.main-nav a { color: var(--text-dim); transition: color 0.15s ease; position: relative; }
.main-nav a:hover, .main-nav a.is-active { color: var(--text); }
.main-nav a.is-active::after {
  content: "";
  position: absolute;
  left: 0; right: 0; bottom: -20px;
  height: 2px;
  background: var(--accent);
}

.header-actions { display: flex; align-items: center; gap: 10px; }

.nav-toggle {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 34px;
  height: 34px;
  background: transparent;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  cursor: pointer;
}
.nav-toggle span { height: 2px; background: var(--text); margin: 0 7px; border-radius: 2px; transition: transform 0.2s ease, opacity 0.2s ease; }
.nav-toggle.is-open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.nav-toggle.is-open span:nth-child(2) { opacity: 0; }
.nav-toggle.is-open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

.site-header.is-scrolled { border-bottom-color: var(--border); box-shadow: var(--shadow-md); }

/* ==========================================================================
   Hero
   ========================================================================== */
.hero {
  display: grid;
  grid-template-columns: 1.05fr 0.95fr;
  gap: 56px;
  align-items: center;
  padding: 88px 24px 96px;
}

.eyebrow {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  font-weight: 500;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 14px;
}

.hero-logo {
  font-family: var(--font-mono);
  font-size: 6.5px;
  line-height: 1.15;
  color: var(--accent);
  opacity: 0.85;
  margin: 0 0 20px;
  white-space: pre;
}

.hero h1 {
  font-size: clamp(2.1rem, 3.6vw, 3rem);
  color: var(--text);
  max-width: 15ch;
}
.hero h1 em { color: var(--accent); font-style: normal; }

.hero-sub {
  font-size: 1.05rem;
  max-width: 46ch;
  margin-bottom: 28px;
}

.hero-ctas { display: flex; gap: 12px; flex-wrap: wrap; margin-bottom: 40px; }

.hero-stats {
  display: flex;
  gap: 36px;
}
.hero-stats li { display: flex; flex-direction: column; gap: 2px; }
.hero-stats strong { font-family: var(--font-display); font-size: 1.3rem; color: var(--text); }
.hero-stats span { font-size: 0.8rem; color: var(--text-faint); }

.hero-visual { position: relative; }

/* terminal window */
.term {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow-lg);
}
.term-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 16px;
  background: var(--surface-2);
  border-bottom: 1px solid var(--border);
}
.term-dot { width: 10px; height: 10px; border-radius: 50%; }
.term-dot-red { background: #ff5f56; }
.term-dot-amber { background: #ffbd2e; }
.term-dot-green { background: #27c93f; }
.term-title {
  margin-left: 8px;
  font-family: var(--font-mono);
  font-size: 0.78rem;
  color: var(--text-faint);
}
.term-body {
  margin: 0;
  padding: 22px 20px 26px;
  font-family: var(--font-mono);
  font-size: 0.86rem;
  line-height: 1.7;
  overflow-x: auto;
}

/* ==========================================================================
   Sections
   ========================================================================== */
.section { padding: 96px 0; }
.section-alt { background: linear-gradient(180deg, transparent, var(--bg-soft) 8%, var(--bg-soft) 92%, transparent); border-top: 1px solid var(--border-soft); border-bottom: 1px solid var(--border-soft); }

.section-head { max-width: 720px; margin: 0 auto 52px; text-align: center; }
.section-head h2 { font-size: clamp(1.6rem, 2.6vw, 2.15rem); color: var(--text); }
.section-sub { font-size: 1rem; margin-top: 6px; }
.section-head .eyebrow { display: block; text-align: center; }

/* ==========================================================================
   Problem / solution cards
   ========================================================================== */
.split-cards {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
}

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 32px;
  border-left: 3px solid var(--border);
}
.card-problem { border-left-color: var(--danger); }
.card-solution { border-left-color: var(--accent); }

.card-tag {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 5px 10px;
  border-radius: 999px;
  margin-bottom: 16px;
}
.card-tag-danger { background: var(--danger-soft); color: var(--danger); }
.card-tag-accent { background: var(--accent-soft); color: var(--accent); }

.card p { font-size: 0.98rem; }
.card-foot { color: var(--text-faint); font-size: 0.92rem; margin-bottom: 0; }
.card em { color: var(--text); font-style: normal; }

/* ==========================================================================
   Feature grid
   ========================================================================== */
.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: 26px;
  transition: border-color 0.2s ease, transform 0.2s ease;
}
.feature-card:hover { border-color: var(--accent-dim); transform: translateY(-3px); }

.feature-icon {
  width: 38px;
  height: 38px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-sm);
  background: var(--accent-soft);
  color: var(--accent);
  margin-bottom: 16px;
}
.feature-icon svg { width: 20px; height: 20px; }

.feature-card h3 { font-size: 1.05rem; color: var(--text); }
.feature-card p { font-size: 0.9rem; margin-bottom: 14px; }
.feature-card a { font-size: 0.85rem; font-weight: 600; color: var(--accent); }
.feature-card a:hover { text-decoration: underline; }

.simplifications {
  max-width: 760px;
  margin: 44px auto 0;
  text-align: center;
  font-size: 0.88rem;
  color: var(--text-faint);
}
.simplifications code { color: var(--text-dim); }

/* ==========================================================================
   Tabs
   ========================================================================== */
.tab-list {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  border-bottom: 1px solid var(--border);
  margin-bottom: 28px;
}
.tab-btn {
  font-family: var(--font-sans);
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--text-faint);
  background: transparent;
  border: none;
  padding: 12px 6px;
  margin-right: 18px;
  cursor: pointer;
  position: relative;
  transition: color 0.15s ease;
}
.tab-btn::after {
  content: "";
  position: absolute;
  left: 0; right: 0; bottom: -1px;
  height: 2px;
  background: transparent;
  transition: background 0.15s ease;
}
.tab-btn:hover { color: var(--text-dim); }
.tab-btn.is-active { color: var(--accent); }
.tab-btn.is-active::after { background: var(--accent); }

.tab-panel { display: none; }
.tab-panel.is-active { display: block; animation: fadeIn 0.25s ease; }

@keyframes fadeIn { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }

.callout {
  font-size: 0.88rem;
  color: var(--text-faint);
  background: var(--surface);
  border: 1px solid var(--border-soft);
  border-left: 3px solid var(--blue);
  border-radius: var(--radius-sm);
  padding: 12px 16px;
  margin-top: 16px;
}
.callout code { color: var(--text-dim); }
.callout strong { color: var(--text-dim); }

/* ==========================================================================
   Code blocks
   ========================================================================== */
.code-block {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}
.code-block-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 9px 14px;
  background: var(--surface-2);
  border-bottom: 1px solid var(--border);
  font-family: var(--font-mono);
  font-size: 0.74rem;
  color: var(--text-faint);
  letter-spacing: 0.02em;
}
.copy-btn {
  font-family: var(--font-sans);
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--text-dim);
  background: transparent;
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 4px 9px;
  cursor: pointer;
  transition: color 0.15s ease, border-color 0.15s ease;
}
.copy-btn:hover { color: var(--text); border-color: var(--accent-dim); }
.copy-btn.is-copied { color: var(--accent); border-color: var(--accent-dim); }

.code-block pre {
  margin: 0;
  padding: 18px 20px;
  overflow-x: auto;
  font-family: var(--font-mono);
  font-size: 0.85rem;
  line-height: 1.65;
}

/* token colors, shared by hero terminal + code blocks */
.tok-kw   { color: #ff9d6c; }
.tok-str  { color: var(--accent); }
.tok-cmt  { color: var(--text-faint); font-style: italic; }
.tok-flag { color: var(--blue); }
.tok-key  { color: #c9a3ff; }
.tok-num  { color: var(--warning); }
.tok-pass { color: var(--accent); font-weight: 600; }
.tok-fail { color: var(--danger); font-weight: 600; }
.tok-metric { color: var(--blue); }
.tok-prompt { color: var(--text-faint); }

/* ==========================================================================
   Quickstart
   ========================================================================== */
.quickstart-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
  align-items: start;
}
.quickstart-note { font-size: 0.88rem; color: var(--text-faint); margin-top: 16px; }
.quickstart-note code { color: var(--text-dim); }

/* ==========================================================================
   Timeline / walkthrough
   ========================================================================== */
.timeline {
  position: relative;
  max-width: 820px;
  margin: 0 auto;
  padding-left: 52px;
}
.timeline::before {
  content: "";
  position: absolute;
  left: 19px;
  top: 6px;
  bottom: 6px;
  width: 2px;
  background: linear-gradient(180deg, var(--accent-dim), var(--border) 90%);
}
.timeline-step {
  position: relative;
  margin-bottom: 48px;
}
.timeline-step:last-child { margin-bottom: 0; }

.timeline-marker {
  position: absolute;
  left: -52px;
  top: 0;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--surface);
  border: 2px solid var(--accent-dim);
  color: var(--accent);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1rem;
}

.timeline-content h3 { font-size: 1.15rem; color: var(--text); margin-bottom: 8px; }
.timeline-content p { font-size: 0.94rem; margin-bottom: 16px; }
.timeline-content code { color: var(--text-dim); }
.timeline-content .code-block { margin-bottom: 12px; }
.timeline-content .code-block:last-child { margin-bottom: 0; }

/* ==========================================================================
   Docs panels
   ========================================================================== */
.docs-panel {
  display: grid;
  grid-template-columns: 0.85fr 1.15fr;
  gap: 32px;
  align-items: center;
}
.docs-panel-copy h3 { font-size: 1.2rem; color: var(--text); }
.docs-panel-copy p { font-size: 0.94rem; }
.docs-panel-copy .btn { margin-top: 4px; }

/* ==========================================================================
   Results
   ========================================================================== */
.stat-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 20px;
  margin-bottom: 40px;
}
.stat-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 26px 22px;
  text-align: center;
}
.stat-value {
  display: block;
  font-family: var(--font-display);
  font-size: 2rem;
  font-weight: 700;
  color: var(--accent);
  margin-bottom: 6px;
}
.stat-label { font-size: 0.82rem; color: var(--text-faint); }

.table-wrap {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 8px;
  overflow-x: auto;
}
table { width: 100%; border-collapse: collapse; font-size: 0.9rem; }
caption { text-align: left; color: var(--text-faint); font-size: 0.82rem; padding: 12px 14px 16px; }
th, td { text-align: left; padding: 12px 14px; border-bottom: 1px solid var(--border-soft); }
th { color: var(--text-faint); font-weight: 600; font-size: 0.78rem; text-transform: uppercase; letter-spacing: 0.04em; }
td { color: var(--text-dim); font-family: var(--font-mono); }
tr:last-child td { border-bottom: none; }
.row-highlight td { color: var(--text); }
.row-highlight { background: var(--accent-soft); }

/* ==========================================================================
   CTA
   ========================================================================== */
.cta-section {
  padding: 100px 0 120px;
  background: radial-gradient(ellipse 60% 100% at 50% 0%, var(--accent-soft), transparent 70%);
}
.cta-inner { max-width: 640px; margin: 0 auto; text-align: center; }
.cta-inner h2 { font-size: clamp(1.5rem, 2.6vw, 2rem); margin-bottom: 28px; }
.cta-inner .code-block-cta { margin-bottom: 24px; text-align: left; }
.cta-inner .hero-ctas { justify-content: center; margin-bottom: 0; }

/* ==========================================================================
   Footer
   ========================================================================== */
.site-footer {
  border-top: 1px solid var(--border-soft);
  padding: 56px 0 28px;
}
.footer-inner {
  display: grid;
  grid-template-columns: 1.4fr 1fr 1fr;
  gap: 32px;
  margin-bottom: 40px;
}
.footer-brand p { font-size: 0.88rem; max-width: 30ch; margin-top: 12px; }
.footer-col h4 { font-size: 0.8rem; text-transform: uppercase; letter-spacing: 0.06em; color: var(--text-faint); margin-bottom: 14px; }
.footer-col a { display: block; font-size: 0.9rem; color: var(--text-dim); margin-bottom: 10px; transition: color 0.15s ease; }
.footer-col a:hover { color: var(--accent); }

.footer-bottom {
  display: flex;
  justify-content: space-between;
  padding-top: 24px;
  border-top: 1px solid var(--border-soft);
  font-size: 0.8rem;
  color: var(--text-faint);
}

/* ==========================================================================
   Reveal-on-scroll
   ========================================================================== */
[data-reveal] {
  opacity: 0;
  transform: translateY(18px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}
[data-reveal].in-view { opacity: 1; transform: none; }

/* ==========================================================================
   Responsive
   ========================================================================== */
@media (max-width: 980px) {
  .hero { grid-template-columns: 1fr; padding-top: 56px; }
  .hero-logo { font-size: 5.5px; }
  .split-cards { grid-template-columns: 1fr; }
  .feature-grid { grid-template-columns: repeat(2, 1fr); }
  .quickstart-grid { grid-template-columns: 1fr; }
  .docs-panel { grid-template-columns: 1fr; }
  .stat-grid { grid-template-columns: repeat(2, 1fr); }
  .footer-inner { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 760px) {
  .main-nav { display: none; }
  .nav-toggle { display: flex; }

  .main-nav.is-open {
    display: flex;
    flex-direction: column;
    position: absolute;
    top: var(--header-h);
    left: 0; right: 0;
    background: var(--bg-soft);
    border-bottom: 1px solid var(--border);
    padding: 20px 24px 28px;
    gap: 18px;
  }

  .header-actions .badge-link { display: none; }
  .feature-grid { grid-template-columns: 1fr; }
  .stat-grid { grid-template-columns: 1fr 1fr; }
  .footer-inner { grid-template-columns: 1fr; gap: 28px; }
  .footer-bottom { flex-direction: column; gap: 6px; }
  .timeline { padding-left: 44px; }
  .timeline-marker { left: -44px; width: 34px; height: 34px; font-size: 0.9rem; }
  .section { padding: 64px 0; }
  .hero { padding-bottom: 64px; }
}
