/* ===========================
   VectorScaleDB — Overhaul Theme (purple/teal dark)
   Used alongside Tailwind CDN on new pages.
   =========================== */

:root {
  --bg-primary: #09090b;
  --bg-secondary: #111114;
  --bg-tertiary: #18181b;
  --bg-code: #0c0c0e;
  --bg-surface: #1a1a1f;

  --border-default: #27272a;
  --border-hover: #3f3f46;
  --border-focus: #7c3aed;

  --purple-300: #c4b5fd;
  --purple-400: #a78bfa;
  --purple-500: #8b5cf6;
  --purple-600: #7c3aed;
  --purple-700: #6d28d9;
  --purple-glow: rgba(139, 92, 246, 0.15);

  --teal-300: #5eead4;
  --teal-400: #2dd4bf;
  --teal-500: #14b8a6;
  --teal-glow: rgba(45, 212, 191, 0.15);

  --text-primary: #f4f4f5;
  --text-secondary: #d4d4d8;
  --text-tertiary: #a1a1aa;
  --text-muted: #71717a;
  --text-disabled: #52525b;

  --success: #22c55e;
  --warning: #f59e0b;
  --error: #ef4444;
  --info: #3b82f6;

  --gradient-purple-teal: linear-gradient(135deg, #8b5cf6, #2dd4bf);
  --gradient-hero: linear-gradient(180deg, #09090b 0%, #0f0a1a 50%, #09090b 100%);
  --gradient-cta: linear-gradient(135deg, #7c3aed, #6d28d9);

  --font-sans: "Inter", "Inter Display", system-ui, -apple-system, sans-serif;
  --font-mono: "JetBrains Mono", "Fira Code", ui-monospace, monospace;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  font-family: var(--font-sans);
  background: var(--bg-primary);
  color: var(--text-secondary);
  line-height: 1.7;
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
a { color: inherit; text-decoration: none; }
img, svg { display: block; max-width: 100%; }
button { font: inherit; color: inherit; background: transparent; border: 0; cursor: pointer; }

.container { width: 100%; max-width: 1200px; margin: 0 auto; padding: 0 1.25rem; }
@media (min-width: 768px) { .container { padding: 0 2rem; } }

/* Typography */
h1, h2, h3, h4 { color: var(--text-primary); font-weight: 700; letter-spacing: -0.02em; line-height: 1.15; }
.display { font-size: clamp(2.5rem, 6vw, 4.5rem); font-weight: 800; letter-spacing: -0.03em; }
.page-title { font-size: clamp(2rem, 4vw, 3rem); }
.section-title { font-size: clamp(1.5rem, 3vw, 2.25rem); }

.gradient-text {
  background: var(--gradient-purple-teal);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

/* Navigation */
.nav {
  position: sticky; top: 0; z-index: 50;
  background: rgba(9, 9, 11, 0.72);
  backdrop-filter: saturate(140%) blur(14px);
  -webkit-backdrop-filter: saturate(140%) blur(14px);
  border-bottom: 1px solid var(--border-default);
}
.nav-inner {
  display: flex; align-items: center; justify-content: space-between;
  height: 64px;
  max-width: 1200px; margin: 0 auto; padding: 0 1.25rem;
}
.nav-logo { height: 28px; width: auto; }
.nav-links { display: none; align-items: center; gap: 2rem; list-style: none; }
.nav-links a { color: var(--text-tertiary); font-size: 0.9375rem; font-weight: 500; transition: color .15s ease; }
.nav-links a:hover { color: var(--text-primary); }
@media (min-width: 960px) { .nav-links { display: flex; } }

.nav-actions { display: flex; align-items: center; gap: .5rem; }
.nav-hamburger {
  display: inline-flex; flex-direction: column;
  align-items: center; justify-content: center;
  gap: 5px;
  width: 44px; height: 44px; padding: 10px;
  border-radius: 8px;
  -webkit-tap-highlight-color: transparent;
}
.nav-hamburger:hover, .nav-hamburger:focus-visible { background: rgba(255,255,255,0.06); outline: none; }
.nav-hamburger span { display: block; width: 24px; height: 2.5px; background: var(--text-primary); border-radius: 2px; }
@media (min-width: 960px) { .nav-hamburger { display: none; } }

/* Buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .5rem;
  font-weight: 600; font-size: 0.9375rem;
  padding: .75rem 1.25rem; border-radius: 9999px;
  transition: all .18s ease;
  border: 1px solid transparent;
  white-space: nowrap;
}
.btn-primary {
  background: var(--gradient-cta);
  color: #fff;
  box-shadow: 0 0 0 1px rgba(139,92,246,0.2), 0 8px 24px -10px rgba(124,58,237,0.6);
}
.btn-primary:hover { transform: translateY(-1px); box-shadow: 0 0 0 1px rgba(139,92,246,0.3), 0 12px 28px -10px rgba(124,58,237,0.8); }
.btn-secondary { border-color: var(--border-default); color: var(--text-secondary); }
.btn-secondary:hover { border-color: var(--border-hover); color: var(--text-primary); }
.btn-ghost { color: var(--text-tertiary); }
.btn-ghost:hover { color: var(--text-primary); }
.btn-lg { padding: 1rem 1.75rem; font-size: 1rem; }

/* Cards */
.card {
  background: var(--bg-secondary);
  border: 1px solid var(--border-default);
  border-radius: 16px;
  padding: 1.75rem;
  transition: border-color .2s ease, transform .2s ease, background .2s ease;
}
.card:hover { border-color: var(--border-hover); }
.card-feature .icon {
  width: 40px; height: 40px; border-radius: 10px;
  display: inline-flex; align-items: center; justify-content: center;
  background: var(--purple-glow); color: var(--purple-400);
  margin-bottom: 1rem;
}
.card-feature .icon.teal { background: var(--teal-glow); color: var(--teal-400); }

/* Terminal */
.terminal {
  background: var(--bg-code);
  border: 1px solid var(--border-default);
  border-radius: 12px;
  overflow: hidden;
  font-family: var(--font-mono);
  font-size: 0.875rem;
  box-shadow: 0 30px 80px -30px rgba(139,92,246,0.25);
}
.terminal-header {
  display: flex; align-items: center;
  padding: .75rem 1rem;
  background: var(--bg-tertiary);
  border-bottom: 1px solid var(--border-default);
}
.terminal-dots { display: flex; gap: 6px; }
.terminal-dots span { width: 12px; height: 12px; border-radius: 50%; }
.terminal-dots span:nth-child(1) { background: #ff5f57; }
.terminal-dots span:nth-child(2) { background: #febc2e; }
.terminal-dots span:nth-child(3) { background: #28c840; }
.terminal-title {
  flex: 1; text-align: center; color: var(--text-muted); font-size: 0.75rem;
}
.terminal-body {
  padding: 1.25rem 1.25rem;
  min-height: 280px;
  white-space: pre-wrap;
  color: var(--text-secondary);
  line-height: 1.65;
}
.terminal-body .prompt { color: var(--teal-400); }
.terminal-body .command { color: var(--text-primary); }
.terminal-body .output { color: var(--text-tertiary); }
.terminal-body .ok { color: var(--success); }
.terminal-cursor {
  display: inline-block;
  width: 8px; height: 1.1em;
  background: var(--teal-400);
  vertical-align: text-bottom;
  animation: blink 1s steps(2) infinite;
}
@keyframes blink { 50% { opacity: 0; } }

/* Code block */
.code-block {
  background: var(--bg-code);
  border: 1px solid var(--border-default);
  border-radius: 12px;
  overflow: hidden;
  font-family: var(--font-mono);
  font-size: 0.875rem;
}
.code-block pre { margin: 0; padding: 1rem 1.25rem; overflow-x: auto; color: var(--text-secondary); }
.code-header {
  display: flex; justify-content: space-between; align-items: center;
  padding: .5rem 1rem; background: var(--bg-tertiary); border-bottom: 1px solid var(--border-default);
  font-size: .75rem; color: var(--text-muted);
}
.code-copy { color: var(--text-muted); transition: color .15s ease; }
.code-copy:hover { color: var(--text-primary); }

/* Tabs */
.tabs { display: flex; gap: .25rem; flex-wrap: wrap; margin-bottom: 1rem; }
.tab-btn {
  padding: .5rem 1rem;
  border-radius: 9999px;
  border: 1px solid var(--border-default);
  color: var(--text-tertiary);
  font-size: .875rem;
  transition: all .15s ease;
}
.tab-btn:hover { border-color: var(--border-hover); color: var(--text-primary); }
.tab-btn.active { background: var(--purple-glow); border-color: var(--purple-500); color: var(--text-primary); }

/* Pricing */
.pricing-grid {
  display: grid;
  gap: 1.25rem;
  grid-template-columns: 1fr;
}
@media (min-width: 768px) { .pricing-grid { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 1024px) { .pricing-grid { grid-template-columns: repeat(4, 1fr); } }
.pricing-card {
  background: var(--bg-secondary);
  border: 1px solid var(--border-default);
  border-radius: 20px;
  padding: 2rem 1.5rem;
  display: flex; flex-direction: column;
  transition: all .2s ease;
}
.pricing-card:hover { border-color: var(--border-hover); transform: translateY(-2px); }
.pricing-card.popular {
  border-color: var(--purple-500);
  box-shadow: 0 0 0 1px var(--purple-500), 0 20px 60px -20px rgba(139,92,246,0.35);
}
.pricing-badge {
  display: inline-block;
  background: var(--gradient-cta);
  color: #fff;
  font-size: .6875rem;
  font-weight: 700; letter-spacing: .08em;
  padding: .25rem .625rem;
  border-radius: 9999px;
  margin-bottom: .75rem;
}
.pricing-price { font-size: 2.25rem; font-weight: 800; color: var(--text-primary); letter-spacing: -0.02em; }
.pricing-price .period { font-size: .875rem; color: var(--text-muted); font-weight: 500; }
.pricing-feature-list { list-style: none; padding: 0; margin: 1.25rem 0; display: flex; flex-direction: column; gap: .5rem; font-size: .875rem; color: var(--text-tertiary); }
.pricing-feature-list li::before { content: "✓"; color: var(--teal-400); margin-right: .5rem; }

/* Stats */
.stats {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1rem;
  text-align: center;
}
@media (min-width: 768px) { .stats { grid-template-columns: repeat(4, 1fr); gap: 2rem; } }
.stat-value {
  font-size: clamp(1.75rem, 3vw, 2.5rem);
  font-weight: 800;
  background: var(--gradient-purple-teal);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  letter-spacing: -0.02em;
}
.stat-label { font-size: .75rem; color: var(--text-muted); text-transform: uppercase; letter-spacing: .1em; margin-top: .25rem; }

/* FAQ */
.faq-item { border-top: 1px solid var(--border-default); }
.faq-item:last-child { border-bottom: 1px solid var(--border-default); }
.faq-q {
  width: 100%; text-align: left;
  padding: 1.25rem 0; display: flex; justify-content: space-between; align-items: center;
  color: var(--text-primary); font-weight: 600; font-size: 1rem;
}
.faq-q .chev { color: var(--text-muted); transition: transform .2s ease; }
.faq-q[aria-expanded="true"] .chev { transform: rotate(180deg); }
.faq-a { padding-bottom: 1.25rem; color: var(--text-tertiary); display: none; }
.faq-a.open { display: block; }

/* Footer */
.footer {
  border-top: 1px solid var(--border-default);
  margin-top: 6rem;
  padding: 3rem 0 2rem;
  color: var(--text-muted);
  font-size: .875rem;
}
.footer-grid { display: grid; gap: 2rem; grid-template-columns: 1fr; }
@media (min-width: 640px) { .footer-grid { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 960px) { .footer-grid { grid-template-columns: 1.5fr repeat(4, 1fr); } }
.footer h4 { color: var(--text-primary); font-size: .875rem; margin-bottom: .75rem; letter-spacing: .02em; }
.footer ul { list-style: none; display: flex; flex-direction: column; gap: .5rem; }
.footer a:hover { color: var(--text-primary); }
.footer-copy { margin-top: 2.5rem; padding-top: 1.5rem; border-top: 1px solid var(--border-default); color: var(--text-disabled); font-size: .8125rem; }

/* Hero section */
.hero {
  padding: 5rem 0 4rem;
  background: var(--gradient-hero);
  position: relative;
  overflow: hidden;
}
.hero::before {
  content: "";
  position: absolute; inset: -20% -20% auto auto;
  width: 60vw; height: 60vw;
  background: radial-gradient(circle at center, var(--purple-glow), transparent 60%);
  filter: blur(40px);
  pointer-events: none;
  z-index: 0;
}
.hero-inner { position: relative; z-index: 1; text-align: center; }
.hero-eyebrow {
  display: inline-flex; align-items: center; gap: .5rem;
  padding: .375rem .875rem; border-radius: 9999px;
  border: 1px solid var(--border-default);
  color: var(--text-tertiary);
  font-size: .75rem; letter-spacing: .08em; text-transform: uppercase;
  margin-bottom: 1.5rem;
}
.hero-eyebrow .dot { width: 6px; height: 6px; border-radius: 50%; background: var(--teal-400); box-shadow: 0 0 12px var(--teal-400); }
.hero-sub {
  color: var(--text-tertiary);
  font-size: clamp(1rem, 1.5vw, 1.25rem);
  max-width: 38rem;
  margin: 1rem auto 2rem;
}
.hero-cta { display: flex; gap: .75rem; justify-content: center; flex-wrap: wrap; }

/* Section */
.section { padding: 4rem 0; }
.section-intro { text-align: center; max-width: 48rem; margin: 0 auto 3rem; }
.section-intro p { color: var(--text-tertiary); margin-top: .75rem; }

.feature-grid {
  display: grid; gap: 1rem;
  grid-template-columns: 1fr;
}
@media (min-width: 640px) { .feature-grid { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 960px) { .feature-grid { grid-template-columns: repeat(3, 1fr); } }

.value-grid {
  display: grid; gap: 1rem;
  grid-template-columns: 1fr;
}
@media (min-width: 768px) { .value-grid { grid-template-columns: repeat(3, 1fr); } }
.value-card {
  padding: 2rem 1.5rem;
  border: 1px solid var(--border-default);
  border-radius: 16px;
  background: var(--bg-secondary);
  position: relative;
  transition: all .2s ease;
}
.value-card:hover {
  border-color: transparent;
  background:
    linear-gradient(var(--bg-secondary), var(--bg-secondary)) padding-box,
    var(--gradient-purple-teal) border-box;
  border: 1px solid transparent;
}
.value-card .kicker { color: var(--purple-400); font-size: .75rem; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; }
.value-card h3 { margin-top: .5rem; font-size: 1.5rem; }
.value-card p { margin-top: .75rem; color: var(--text-tertiary); }

/* Mobile menu */
.mobile-menu {
  position: fixed; inset: 0; z-index: 60;
  background: var(--bg-primary);
  display: none; flex-direction: column;
  padding: 1rem 1.25rem;
}
.mobile-menu.open { display: flex; }
.mobile-menu-head { display: flex; justify-content: space-between; align-items: center; height: 64px; }
.mobile-menu ul { list-style: none; display: flex; flex-direction: column; gap: 0; padding: 1rem 0; font-size: 1.2rem; }
.mobile-menu ul li { border-bottom: 1px solid var(--border-default); }
.mobile-menu a { display: flex; align-items: center; min-height: 52px; padding: 0.5rem 0.25rem; color: var(--text-primary); font-weight: 600; -webkit-tap-highlight-color: transparent; }

.subtle { color: var(--text-tertiary); }
.muted { color: var(--text-muted); }
.kbd { font-family: var(--font-mono); background: var(--bg-tertiary); border: 1px solid var(--border-default); border-radius: 6px; padding: 2px 6px; font-size: .8125rem; }

/* Utility */
.text-center { text-align: center; }
.flex { display: flex; } .items-center { align-items: center; } .justify-between { justify-content: space-between; } .justify-center { justify-content: center; }
.gap-2 { gap: .5rem; } .gap-3 { gap: .75rem; } .gap-4 { gap: 1rem; } .gap-6 { gap: 1.5rem; } .gap-8 { gap: 2rem; }
.mt-2 { margin-top: .5rem; } .mt-4 { margin-top: 1rem; } .mt-6 { margin-top: 1.5rem; } .mt-8 { margin-top: 2rem; } .mt-12 { margin-top: 3rem; }
.mb-2 { margin-bottom: .5rem; } .mb-4 { margin-bottom: 1rem; } .mb-6 { margin-bottom: 1.5rem; } .mb-8 { margin-bottom: 2rem; }
.w-full { width: 100%; }
.hidden { display: none; }
@media (min-width: 768px) { .md\:block { display: block; } .md\:flex { display: flex; } .md\:hidden { display: none; } }

/* Mobile: no element may exceed the viewport; long code wraps. */
@media (max-width: 768px) {
  html, body { overflow-x: hidden; max-width: 100%; }
  .section { padding: 3rem 0; }
  .hero { padding: 3.5rem 0 3rem; }
  pre, code { white-space: pre-wrap; word-break: break-word; overflow-wrap: anywhere; }
  .btn-lg { padding: 0.85rem 1.5rem; }
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
