/* ===========================
   VectorScaleDB — Design System
   =========================== */

:root {
  --bg: #09090b;
  --bg-card: #111113;
  --bg-code: #0d0d0f;
  --border: rgba(255, 255, 255, 0.06);
  --border-hover: rgba(255, 255, 255, 0.12);
  --text: #e4e4e7;
  --text-muted: #71717a;
  --accent: #2563eb;
  --accent-hover: #1d4ed8;
  --accent-purple: #7c3aed;
  --success: #22c55e;
  --warning: #f59e0b;
  --danger: #ef4444;
  --font-sans: "Inter", system-ui, -apple-system, sans-serif;
  --font-mono: "JetBrains Mono", "Fira Code", ui-monospace, monospace;
}

/* Reset */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
  font-size: 16px;
}

body {
  font-family: var(--font-sans);
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  background-image: radial-gradient(circle, rgba(255, 255, 255, 0.03) 1px, transparent 1px);
  background-size: 24px 24px;
}

a {
  color: var(--accent);
  text-decoration: none;
  transition: color 0.2s;
}

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

img {
  max-width: 100%;
  height: auto;
}

/* ===========================
   Layout
   =========================== */

.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 2rem;
  overflow: clip;
}

/* Prevent scrollbar flash on sections during fade-in animation */
.section {
  overflow: clip;
}

.section {
  padding: 6rem 0;
}

.section-title {
  font-size: clamp(1.6rem, 4vw, 2.5rem);
  font-weight: 700;
  color: var(--text);
  margin-bottom: 1rem;
  text-align: left;
}

.section-subtitle {
  font-size: 1.1rem;
  color: var(--text-muted);
  max-width: 600px;
  margin-bottom: 3rem;
  line-height: 1.6;
}

/* ===========================
   Launch Banner
   =========================== */

@keyframes banner-glow {
  0%, 100% {
    box-shadow: 0 2px 20px rgba(37, 99, 235, 0.3);
  }
  50% {
    box-shadow: 0 2px 30px rgba(124, 58, 237, 0.45);
  }
}

.launch-banner {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 40px;
  z-index: 1100;
  background: linear-gradient(135deg, var(--accent), var(--accent-purple));
  display: flex;
  align-items: center;
  justify-content: center;
  animation: banner-glow 3s ease-in-out infinite;
}

.launch-banner-content {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.launch-banner-badge {
  background: rgba(255, 255, 255, 0.2);
  color: #fff;
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  padding: 0.15rem 0.5rem;
  border-radius: 4px;
  text-transform: uppercase;
}

.launch-banner-text {
  color: #fff;
  font-size: 0.85rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.launch-banner-cta {
  color: #fff;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.03em;
  text-decoration: underline;
  text-underline-offset: 2px;
  transition: opacity 0.2s;
}

.launch-banner-cta:hover {
  color: #fff;
  opacity: 0.85;
}

.launch-banner-close {
  position: absolute;
  right: 1rem;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  color: rgba(255, 255, 255, 0.7);
  font-size: 1.25rem;
  cursor: pointer;
  padding: 0.25rem 0.5rem;
  line-height: 1;
  transition: color 0.2s;
}

.launch-banner-close:hover {
  color: #fff;
}

/* Push nav down when banner is visible */
body:has(.launch-banner) .nav {
  top: 40px;
}

/* Push hero down to account for banner + nav */
body:has(.launch-banner) .hero {
  padding-top: calc(5rem + 40px);
}

/* Push breadcrumb down on sub-pages when banner is present */
body:has(.launch-banner) .page-breadcrumb {
  padding-top: calc(6rem + 40px);
}

@media (max-width: 768px) {
  .launch-banner {
    height: auto;
    min-height: 36px;
    padding: 0.4rem 2.5rem 0.4rem 0.75rem;
  }

  .launch-banner-content {
    flex-wrap: wrap;
    justify-content: center;
    gap: 0.4rem;
  }

  .launch-banner-text {
    font-size: 0.7rem;
    letter-spacing: 0.02em;
  }

  .launch-banner-badge {
    font-size: 0.6rem;
  }

  .launch-banner-cta {
    font-size: 0.65rem;
  }

  .launch-banner-close {
    right: 0.5rem;
  }
}

@media (max-width: 480px) {
  .launch-banner-text {
    font-size: 0.6rem;
  }

  .launch-banner-cta {
    display: none;
  }
}

/* Reduced motion: disable glow animation on banner */
@media (prefers-reduced-motion: reduce) {
  .launch-banner {
    animation: none !important;
    box-shadow: 0 2px 20px rgba(37, 99, 235, 0.3);
  }
}

/* ===========================
   Navigation
   =========================== */

.nav {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  z-index: 1000;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  background: rgba(9, 9, 11, 0.8);
  border-bottom: 1px solid var(--border);
  transition: background 0.3s;
}

.nav.scrolled {
  background: rgba(9, 9, 11, 0.95);
}

.nav-container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0.75rem 2rem;
}

.nav-logo {
  height: 36px;
  width: auto;
  flex-shrink: 0;
}

.nav-cta-short {
  display: none;
}

.nav-links {
  display: flex;
  gap: 1.5rem;
  list-style: none;
  align-items: center;
}

@media (min-width: 1200px) {
  .nav-links {
    gap: 2rem;
  }
}

.nav-links a {
  color: var(--text-muted);
  text-decoration: none;
  font-size: 0.9rem;
  font-weight: 500;
  transition: color 0.2s;
}

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

.nav-cta {
  display: inline-flex;
  align-items: center;
  background: linear-gradient(135deg, var(--accent), var(--accent-purple));
  color: #fff;
  padding: 0.5rem 1.25rem;
  border-radius: 9999px;
  font-size: 0.875rem;
  font-weight: 600;
  text-decoration: none;
  transition: opacity 0.2s, transform 0.2s;
  border: none;
  cursor: pointer;
}

.nav-cta:hover {
  opacity: 0.9;
  transform: translateY(-1px);
  color: #fff;
}

.nav-hamburger {
  display: none;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 5px;
  background: none;
  border: none;
  cursor: pointer;
  /* >=44x44 tap target */
  width: 44px;
  height: 44px;
  padding: 10px;
  margin-right: -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);
  border-radius: 2px;
  transition: transform 0.2s, opacity 0.2s;
}

/* Mobile Menu */
.mobile-menu {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(9, 9, 11, 0.98);
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
  z-index: 1001;
  flex-direction: column;
  align-items: stretch;
  justify-content: flex-start;
  gap: 0;
  padding: 1.5rem 1.5rem 2.5rem;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

.mobile-menu.active,
.mobile-menu.open {
  display: flex;
}

.mobile-menu-close {
  position: absolute;
  top: 0.6rem;
  right: 1rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  background: none;
  border: none;
  color: var(--text);
  font-size: 2rem;
  cursor: pointer;
  padding: 0;
  line-height: 1;
  border-radius: 8px;
  -webkit-tap-highlight-color: transparent;
}

.mobile-menu-close:hover,
.mobile-menu-close:focus-visible {
  background: rgba(255, 255, 255, 0.06);
  outline: none;
}

.mobile-menu-links {
  list-style: none;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 0;
  margin: 3.5rem 0 0;
  padding: 0;
}

.mobile-menu-links li {
  border-bottom: 1px solid var(--border);
}

.mobile-menu a {
  display: flex;
  align-items: center;
  min-height: 52px;
  padding: 0.5rem 0.25rem;
  color: var(--text);
  font-size: 1.2rem;
  font-weight: 500;
  text-decoration: none;
  -webkit-tap-highlight-color: transparent;
}

.mobile-menu-links a:hover,
.mobile-menu-links a:active {
  color: var(--accent);
}

/* Bottom CTA inside the mobile menu — full-width, tall, tappable */
.mobile-menu .nav-cta {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  min-height: 52px;
  margin-top: 2rem !important;
  padding: 0.85rem 1.25rem;
  border-radius: 12px;
  font-size: 1rem;
}

/* ===========================
   Hero
   =========================== */

.hero {
  min-height: 90vh;
  display: flex;
  align-items: center;
  padding-top: 5rem;
}

.hero-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4rem;
  align-items: center;
}

.hero-visual {
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 0;
}

.hero-visual canvas {
  max-width: 100%;
  height: auto;
}

.hero-title {
  font-size: clamp(2.25rem, 7vw, 4rem);
  font-weight: 800;
  line-height: 1.1;
  background: linear-gradient(135deg, #e4e4e7 0%, #2563eb 50%, #7c3aed 100%);
  background-size: 200% 200%;
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  animation: gradient-shift 6s ease infinite;
}

.hero-subtitle {
  font-size: 1.25rem;
  color: var(--text-muted);
  margin: 1.5rem 0 2rem;
  max-width: 500px;
  line-height: 1.6;
}

.hero-buttons {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
}

.hero-canvas {
  width: 100%;
  aspect-ratio: 4 / 3;
  border-radius: 16px;
}

/* Stats Row */
.stats-row {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1.5rem;
  margin-top: 4rem;
  padding-top: 2rem;
  border-top: 1px solid var(--border);
}

.stat-item {
  text-align: center;
}

.stat-value {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--accent);
}

.stat-label {
  font-size: 0.8rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-top: 0.25rem;
}

/* ===========================
   Buttons
   =========================== */

.btn-primary {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  background: var(--accent);
  color: #fff;
  padding: 0.75rem 1.5rem;
  border-radius: 12px;
  font-weight: 600;
  font-size: 0.95rem;
  border: none;
  cursor: pointer;
  transition: background 0.2s, transform 0.2s, box-shadow 0.2s;
  text-decoration: none;
}

.btn-primary:hover {
  background: var(--accent-hover);
  color: #fff;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(37, 99, 235, 0.3);
}

.btn-ghost {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  background: transparent;
  color: var(--text);
  padding: 0.75rem 1.5rem;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  font-weight: 600;
  font-size: 0.95rem;
  cursor: pointer;
  transition: border-color 0.2s, background 0.2s;
  text-decoration: none;
}

.btn-ghost:hover {
  border-color: rgba(255, 255, 255, 0.2);
  background: rgba(255, 255, 255, 0.03);
  color: var(--text);
}

/* ===========================
   Cards
   =========================== */

.card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 2rem;
  transition: border-color 0.2s, transform 0.2s;
  overflow: clip;
  min-width: 0;
  word-wrap: break-word;
  overflow-wrap: break-word;
}

.card:hover {
  border-color: var(--border-hover);
  transform: translateY(-2px);
}

.card-label {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--accent);
  font-weight: 600;
  margin-bottom: 0.5rem;
}

.card-title {
  font-size: 1.25rem;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 0.75rem;
}

.card-description {
  font-size: 0.95rem;
  color: var(--text-muted);
  line-height: 1.6;
}

/* ===========================
   Grids
   =========================== */

.grid-2 {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1.5rem;
}

.grid-3 {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.5rem;
}

.grid-4 {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1.5rem;
}

/* Bento Grid */
.bento-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1.5rem;
}

.bento-large {
  grid-column: span 2;
}

.bento-medium {
  grid-column: span 1;
}

/* ===========================
   Problem / Solution Section
   =========================== */

.problem-cards {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.5rem;
}

.solution-card {
  background: rgba(37, 99, 235, 0.05);
  border: 1px solid var(--border);
  border-left: 3px solid var(--accent);
  border-radius: 16px;
  padding: 2rem;
}

/* ===========================
   Comparison Table
   =========================== */

.compare-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  background: var(--bg-card);
  border-radius: 16px;
  overflow: hidden;
}

.compare-table th {
  padding: 1rem;
  text-align: left;
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
  border-bottom: 1px solid var(--border);
  font-weight: 600;
}

.compare-table td {
  padding: 0.75rem 1rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.03);
  font-size: 0.9rem;
  color: var(--text-muted);
}

.compare-table tr:last-child td {
  border-bottom: none;
}

.compare-highlight {
  background: rgba(37, 99, 235, 0.05);
  color: var(--text);
  font-weight: 500;
}

/* Badges */
.badge-native {
  display: inline-block;
  padding: 0.2rem 0.5rem;
  border-radius: 4px;
  font-size: 0.75rem;
  font-weight: 600;
  background: rgba(34, 197, 94, 0.1);
  color: var(--success);
}

.badge-partial {
  display: inline-block;
  padding: 0.2rem 0.5rem;
  border-radius: 4px;
  font-size: 0.75rem;
  font-weight: 600;
  background: rgba(245, 158, 11, 0.1);
  color: var(--warning);
}

.badge-none {
  display: inline-block;
  padding: 0.2rem 0.5rem;
  border-radius: 4px;
  font-size: 0.75rem;
  font-weight: 600;
  background: rgba(239, 68, 68, 0.1);
  color: var(--danger);
}

/* ===========================
   Architecture Stack
   =========================== */

.arch-stack {
  display: flex;
  flex-direction: column;
  gap: 2px;
  max-width: 900px;
}

.arch-layer {
  padding: 1.25rem 1.5rem;
  border-radius: 12px;
  border: 1px solid var(--border);
}

.arch-layer-label {
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  font-weight: 600;
  margin-bottom: 0.75rem;
}

.arch-layer--api {
  background: rgba(37, 99, 235, 0.06);
  border-color: rgba(37, 99, 235, 0.15);
}

.arch-layer--api .arch-layer-label { color: #60a5fa; }

.arch-layer--middleware {
  background: rgba(124, 58, 237, 0.06);
  border-color: rgba(124, 58, 237, 0.15);
}

.arch-layer--middleware .arch-layer-label { color: #a78bfa; }

.arch-layer--engine {
  background: rgba(34, 197, 94, 0.04);
  border-color: rgba(34, 197, 94, 0.12);
  padding: 1.5rem;
}

.arch-layer--engine .arch-layer-label { color: #4ade80; }

.arch-layer--storage {
  background: rgba(245, 158, 11, 0.05);
  border-color: rgba(245, 158, 11, 0.12);
}

.arch-layer--storage .arch-layer-label { color: #fbbf24; }

.arch-layer-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.arch-chip {
  font-size: 0.8rem;
  padding: 0.3rem 0.75rem;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.06);
  color: var(--text-muted);
  font-weight: 500;
}

.arch-layer-inner {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.75rem;
}

.arch-block {
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid rgba(255, 255, 255, 0.05);
  border-radius: 8px;
  padding: 1rem;
}

.arch-block-title {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 0.35rem;
}

.arch-block-detail {
  font-size: 0.8rem;
  color: var(--text-muted);
  line-height: 1.5;
}

/* API Method Badges */
.method-post {
  display: inline-block;
  padding: 0.15rem 0.5rem;
  border-radius: 4px;
  font-size: 0.7rem;
  font-weight: 700;
  font-family: var(--font-mono);
  letter-spacing: 0.05em;
  background: rgba(34, 197, 94, 0.1);
  color: var(--success);
}

.method-get {
  display: inline-block;
  padding: 0.15rem 0.5rem;
  border-radius: 4px;
  font-size: 0.7rem;
  font-weight: 700;
  font-family: var(--font-mono);
  letter-spacing: 0.05em;
  background: rgba(37, 99, 235, 0.1);
  color: var(--accent);
}

/* ===========================
   Overflow Containment
   =========================== */

.table-wrapper {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.demo-canvas,
.hero-canvas,
.viz-panel canvas {
  max-width: 100%;
}

.viz-container,
.demo-section {
  overflow: clip;
}

.api-preview-table {
  overflow: hidden;
}

/* ===========================
   Compression Visualizer
   =========================== */

.viz-container {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  gap: 2rem;
  align-items: center;
}

.viz-panel {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 1.5rem;
}

.viz-panel canvas {
  width: 100%;
  height: 200px;
  display: block;
}

.viz-panel-title {
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-muted);
  margin-bottom: 1rem;
  font-weight: 500;
}

.viz-counter {
  text-align: center;
}

.viz-counter-value {
  font-size: 3.5rem;
  font-weight: 800;
  background: linear-gradient(135deg, var(--accent), var(--accent-purple));
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  transition: transform 0.3s;
  line-height: 1.2;
}

.viz-counter-label {
  font-size: 0.8rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  margin-top: 0.25rem;
}

/* ===========================
   Interactive Demos
   =========================== */

.demo-section {
  padding: 2rem;
}

.demo-canvas {
  width: 100%;
  height: 300px;
  background: var(--bg-code);
  border-radius: 12px;
  border: 1px solid var(--border);
  display: block;
}

.demo-label {
  text-align: center;
  font-size: 0.95rem;
  color: var(--text-muted);
  margin-top: 1rem;
}

/* ===========================
   Pattern A: Hero Backdrop (canvas below hero text, atmospheric)
   =========================== */

.hero-backdrop-section {
  position: relative;
  width: 100%;
  margin-top: -1.5rem;
  margin-bottom: 0;
  overflow: clip;
}

.hero-backdrop-section canvas {
  width: 100%;
  height: 400px;
  display: block;
  opacity: 0.6;
  position: relative;
  z-index: 0;
}

/* Gradient fade on top and bottom edges for seamless flow */
.hero-backdrop-section::before,
.hero-backdrop-section::after {
  content: '';
  position: absolute;
  left: 0;
  right: 0;
  height: 40px;
  z-index: 1;
  pointer-events: none;
}

.hero-backdrop-section::before {
  top: 0;
  background: linear-gradient(to bottom, var(--bg), transparent);
}

.hero-backdrop-section::after {
  bottom: 0;
  background: linear-gradient(to top, var(--bg), transparent);
}

/* Taller variant */
.hero-backdrop-section.tall canvas {
  height: 480px;
}

/* Tighten spacing between sections for smooth page flow */
.flow-tight .section {
  padding-top: 3rem;
}

.flow-tight .section + .section {
  padding-top: 2rem;
}

/* ===========================
   Pattern C: Viz Feature Card
   =========================== */

.viz-feature-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 1.5rem;
  margin: 0 auto 1rem;
  max-width: 64rem;
}

.viz-feature-card .viz-label {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-muted);
  margin-bottom: 0.75rem;
  font-weight: 500;
}

.viz-feature-card canvas {
  width: 100%;
  height: 320px;
  min-height: 280px;
  display: block;
  border-radius: 8px;
}

/* ===========================
   Code Examples
   =========================== */

.code-tabs {
  display: flex;
  gap: 0;
  border-bottom: 1px solid var(--border);
}

.code-tab {
  padding: 0.5rem 1rem;
  cursor: pointer;
  color: var(--text-muted);
  font-size: 0.875rem;
  font-family: var(--font-sans);
  border: none;
  background: none;
  border-bottom: 2px solid transparent;
  transition: color 0.2s, border-color 0.2s;
}

.code-tab:hover {
  color: var(--text);
}

.code-tab.active {
  color: var(--accent);
  border-bottom-color: var(--accent);
}

.code-panel {
  display: none;
  background: var(--bg-code);
  padding: 1.5rem;
  border-radius: 0 0 12px 12px;
  overflow-x: auto;
}

.code-panel.active {
  display: block;
}

.code-panel pre {
  margin: 0;
  font-family: var(--font-mono);
  font-size: 0.875rem;
  line-height: 1.6;
  color: var(--text);
}

/* ===========================
   Roadmap
   =========================== */

.roadmap-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.5rem;
}

.roadmap-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 2rem;
}

.roadmap-card.shipped {
  border-left: 3px solid var(--success);
}

.roadmap-card.next {
  border-left: 3px solid var(--accent);
}

.roadmap-status {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  font-weight: 600;
  margin-bottom: 0.5rem;
}

.roadmap-status.shipped {
  color: var(--success);
}

.roadmap-status.next {
  color: var(--accent);
}

/* ===========================
   CTA Section
   =========================== */

.cta-section {
  text-align: center;
  padding: 6rem 0;
  background: linear-gradient(180deg, transparent, rgba(37, 99, 235, 0.05));
}

.cta-title {
  font-size: clamp(1.6rem, 4vw, 2.5rem);
  font-weight: 700;
  color: var(--text);
  margin-bottom: 1rem;
}

.cta-subtitle {
  color: var(--text-muted);
  margin-bottom: 2rem;
  font-size: 1.1rem;
}

/* ===========================
   Footer
   =========================== */

.footer {
  border-top: 1px solid var(--border);
  padding: 3rem 0 2rem;
}

.footer-grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr;
  gap: 2rem;
}

.footer-brand p {
  color: var(--text-muted);
  font-size: 0.9rem;
  margin-top: 1rem;
  line-height: 1.6;
}

.footer-heading {
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-muted);
  margin-bottom: 1rem;
  font-weight: 600;
}

.footer-links {
  list-style: none;
  padding: 0;
}

.footer-links li {
  margin-bottom: 0.5rem;
}

.footer-links a {
  color: var(--text-muted);
  font-size: 0.9rem;
  text-decoration: none;
  transition: color 0.2s;
}

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

.footer-bottom {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-top: 2rem;
  margin-top: 2rem;
  border-top: 1px solid var(--border);
  font-size: 0.8rem;
  color: var(--text-muted);
}


/* ===========================
   Animations
   =========================== */

@keyframes gradient-shift {
  0% {
    background-position: 0% 50%;
  }
  50% {
    background-position: 100% 50%;
  }
  100% {
    background-position: 0% 50%;
  }
}

@keyframes fade-in-up {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* FAILSAFE: .fade-in is VISIBLE by default. Content is NEVER hidden unless
   JS is confirmed active (config.js adds html.js-fade synchronously). So if
   config.js fails to load/run, every page still shows all its content. */
.fade-in {
  opacity: 1;
  transform: none;
  transition: opacity 0.6s ease, transform 0.6s ease;
}

/* Animated entrance — only when JS is active (config.js set html.js-fade). */
html.js-fade .fade-in {
  opacity: 0;
  transform: translateY(20px);
}

html.js-fade .fade-in.visible {
  opacity: 1;
  transform: translateY(0);
}

@media (prefers-reduced-motion: reduce) {
  html.js-fade .fade-in { opacity: 1; transform: none; transition: none; }
}

/* ===========================
   Responsive — Mobile
   =========================== */

/* Nav collapses to hamburger at 1024px */
@media (max-width: 1024px) {
  .nav-links {
    display: none;
  }

  .nav-hamburger {
    display: flex;
  }

  .nav-container {
    min-height: 56px;
    padding: 0.5rem 1.25rem;
    gap: 0.75rem;
  }

  .nav-logo {
    height: 30px;
  }
}

/* "Request Demo" → "Demo" under 900px */
@media (max-width: 900px) {
  .nav-cta-full {
    display: none;
  }

  .nav-cta-short {
    display: inline;
  }

  .nav-container .nav-cta {
    min-height: 40px;
    padding: 0.5rem 1rem;
    font-size: 0.85rem;
  }
}

/* Phone layout */
@media (max-width: 768px) {
  .nav-logo {
    height: 26px;
  }

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

  /* .hero-title / .section-title use clamp() in their base rules — they
     scale fluidly, so no fixed-px override is needed here. */

  .hero-canvas {
    display: none;
  }

  .hero-backdrop-section canvas {
    height: 220px;
  }

  .hero-backdrop-section.tall canvas {
    height: 300px;
  }

  .viz-feature-card {
    margin: 1.5rem 1rem;
    padding: 1rem;
  }

  .viz-feature-card canvas {
    height: 200px;
  }

  .stats-row {
    grid-template-columns: repeat(2, 1fr);
  }

  .grid-2,
  .grid-3,
  .grid-4 {
    grid-template-columns: 1fr;
  }

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

  /* No element may exceed the viewport width on phones. */
  html,
  body {
    overflow-x: hidden;
    max-width: 100%;
  }

  pre,
  code,
  .code-panel pre {
    white-space: pre-wrap;
    word-break: break-word;
    overflow-wrap: anywhere;
  }

  .bento-large {
    grid-column: span 1;
  }

  .problem-cards {
    grid-template-columns: 1fr;
  }

  .viz-container {
    grid-template-columns: 1fr;
  }

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

  .compare-table {
    display: block;
    overflow-x: auto;
  }

  .arch-layer-inner {
    grid-template-columns: 1fr;
  }

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

  .footer-bottom {
    flex-direction: column;
    gap: 1rem;
    text-align: center;
  }

  .section {
    padding: 4rem 0;
  }

  .hero-buttons {
    flex-direction: column;
    align-items: stretch;
  }

  .hero-buttons .btn-primary,
  .hero-buttons .btn-ghost {
    justify-content: center;
    width: 100%;
    min-height: 48px;
  }

  /* Ensure cards don't bleed past viewport */
  .container {
    padding: 0 1rem;
  }

  .card {
    padding: 1.25rem;
  }

  /* Viz feature cards need tighter padding on mobile */
  .viz-feature-card {
    margin-left: 0;
    margin-right: 0;
    padding: 1rem;
  }

  /* Prevent any element from exceeding viewport */
  body {
    overflow-x: hidden;
  }
}

/* Small phones */
@media (max-width: 480px) {
  .nav-container {
    padding: 0.5rem 1rem;
    gap: 0.5rem;
  }

  .nav-logo {
    height: 24px;
  }

  .nav-container .nav-cta {
    min-height: 38px;
    padding: 0.45rem 0.85rem;
    font-size: 0.8rem;
  }

  .mobile-menu {
    padding: 1.25rem 1.25rem 2.5rem;
  }

  /* hero-title / section-title / cta-title scale via clamp() floors —
     no fixed-px override needed at 480. */

  .stats-row {
    grid-template-columns: 1fr;
  }

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

  .card {
    padding: 1rem;
  }

  .bento-grid,
  .grid-2,
  .grid-3,
  .grid-4 {
    gap: 1rem;
  }

  .container {
    padding: 0 0.75rem;
  }

  .section {
    padding: 3rem 0;
  }
}

/* Two-up grid-2 on small tablets / large phones (looks better than 1-up). */
@media (min-width: 600px) and (max-width: 768px) {
  .grid-2 {
    grid-template-columns: repeat(2, 1fr);
  }
}

/* ===========================
   Responsive — Tablet
   =========================== */

@media (min-width: 769px) and (max-width: 1024px) {
  .hero-grid {
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
  }

  .hero-title {
    font-size: 3rem;
  }

  .grid-3 {
    grid-template-columns: repeat(2, 1fr);
  }

  .grid-4 {
    grid-template-columns: repeat(2, 1fr);
  }

  .bento-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .problem-cards {
    grid-template-columns: repeat(2, 1fr);
  }
}

/* ===========================
   Responsive — Large screens
   =========================== */

@media (min-width: 1920px) {
  .container {
    max-width: 1600px;
  }

  body {
    font-size: 1.15rem;
  }

  .hero-title {
    font-size: 5rem;
  }

  .section-title {
    font-size: 3rem;
  }
}

/* ===========================
   Accessibility: Reduced Motion
   =========================== */

@media (prefers-reduced-motion: reduce) {
  /* Disable all CSS transitions and animations */
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }

  /* Hide animated canvases — show static fallback or nothing */
  .hero-canvas,
  .hero-backdrop-section canvas,
  .viz-feature-card canvas,
  .demo-canvas,
  .viz-panel canvas {
    display: none !important;
  }

  /* Disable hover transforms */
  .card:hover {
    transform: none;
  }

  /* Disable fade-in animations */
  .fade-in {
    opacity: 1 !important;
    transform: none !important;
  }
}

/* ===========================
   Epilepsy Safety: Cap Animation Speed
   =========================== */

/* Ensure no CSS animation flashes faster than 3Hz (WCAG 2.3.1) */
@keyframes safe-pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.85; }
}

/* Override any existing rapid animations with safe alternatives */
.animate-pulse {
  animation: safe-pulse 2s ease-in-out infinite !important;
}

/* ===========================
   Breadcrumb Navigation
   =========================== */

.page-breadcrumb {
  padding: 6rem 0 0;
  font-size: 0.85rem;
}

.page-breadcrumb .container {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.page-breadcrumb a {
  color: var(--text-muted);
  text-decoration: none;
  transition: color 0.2s;
}

.page-breadcrumb a:hover {
  color: var(--accent);
}

.page-breadcrumb span {
  color: var(--text-secondary);
}

.breadcrumb-sep {
  color: var(--text-muted);
  opacity: 0.5;
}

/* ===========================
   Live Data Widgets
   =========================== */

.live-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-bottom: 0.5rem;
}

.live-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--success);
  display: inline-block;
  animation: pulse-dot 2s ease-in-out infinite;
}

@keyframes pulse-dot {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.4; }
}

.live-stats-widget {
  margin: 1.5rem 0;
  padding: 1rem 1.5rem;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 12px;
}

.live-stats-grid {
  display: flex;
  gap: 2rem;
  margin-top: 0.5rem;
}

.live-stat {
  text-align: center;
}

.live-stat span {
  display: block;
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--text);
}

.live-stat small {
  font-size: 0.75rem;
  color: var(--text-muted);
}

.live-benchmarks-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 1rem;
  margin-top: 0.75rem;
}

.live-benchmark-item {
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 8px;
  padding: 0.75rem 1rem;
  text-align: center;
}

.live-benchmark-item .benchmark-ratio {
  display: block;
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--accent);
}

.live-benchmark-item .benchmark-format {
  display: block;
  font-size: 0.7rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-top: 0.25rem;
}

.live-network-grid {
  display: flex;
  gap: 2rem;
  margin-top: 0.5rem;
  flex-wrap: wrap;
}

.live-network-stat {
  text-align: center;
}

.live-network-stat span {
  display: block;
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--text);
}

.live-network-stat small {
  font-size: 0.7rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.live-network-stat .status-healthy {
  color: var(--success);
}

.live-network-stat .status-degraded {
  color: var(--warning);
}

@media (prefers-reduced-motion: reduce) {
  .live-dot {
    animation: none;
  }
}

/* ===========================
   Pricing Page
   =========================== */

/* Billing Toggle */
.pricing-toggle {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
}

.pricing-toggle-label {
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 0.5rem;
  user-select: none;
}

.pricing-save-badge {
  font-size: 0.7rem;
  font-weight: 700;
  color: var(--success);
  background: rgba(34, 197, 94, 0.1);
  padding: 0.15rem 0.5rem;
  border-radius: 9999px;
  letter-spacing: 0.02em;
}

.pricing-toggle-switch {
  position: relative;
  width: 48px;
  height: 26px;
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid var(--border);
  border-radius: 9999px;
  cursor: pointer;
  transition: background 0.2s;
  padding: 0;
}

.pricing-toggle-switch.active {
  background: var(--accent);
  border-color: var(--accent);
}

.pricing-toggle-knob {
  position: absolute;
  top: 3px;
  left: 3px;
  width: 18px;
  height: 18px;
  background: #fff;
  border-radius: 50%;
  transition: transform 0.2s;
}

.pricing-toggle-switch.active .pricing-toggle-knob {
  transform: translateX(22px);
}

/* Deployment Mode Tabs */
.pricing-mode-tabs {
  display: flex;
  justify-content: center;
  gap: 0;
  border: 1px solid var(--border);
  border-radius: 12px;
  overflow: hidden;
  max-width: 300px;
  margin: 0 auto;
}

.pricing-mode-tab {
  flex: 1;
  padding: 0.6rem 1.5rem;
  font-size: 0.85rem;
  font-weight: 600;
  font-family: var(--font-sans);
  color: var(--text-muted);
  background: transparent;
  border: none;
  cursor: pointer;
  transition: background 0.2s, color 0.2s;
}

.pricing-mode-tab.active {
  background: var(--accent);
  color: #fff;
}

.pricing-mode-tab:not(.active):hover {
  background: rgba(255, 255, 255, 0.04);
  color: var(--text);
}

/* Pricing Grid */
.pricing-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 1.25rem;
  align-items: start;
}

/* Pricing Card */
.pricing-card {
  position: relative;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 2rem 1.5rem;
  display: flex;
  flex-direction: column;
  transition: border-color 0.2s, transform 0.2s;
}

.pricing-card:hover {
  border-color: var(--border-hover);
  transform: translateY(-2px);
}

.pricing-card--popular {
  border-color: var(--accent);
  box-shadow: 0 0 40px rgba(37, 99, 235, 0.15);
}

.pricing-popular-badge {
  position: absolute;
  top: -12px;
  left: 50%;
  transform: translateX(-50%);
  background: linear-gradient(135deg, var(--accent), var(--accent-purple));
  color: #fff;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  padding: 0.25rem 1rem;
  border-radius: 9999px;
  white-space: nowrap;
}

.pricing-card-header {
  margin-bottom: 1.25rem;
}

.pricing-card-tier {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--text);
}

.pricing-card-desc {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-top: 0.25rem;
  line-height: 1.4;
}

.pricing-card-price {
  margin-bottom: 1.5rem;
  display: flex;
  align-items: baseline;
  gap: 0.25rem;
}

.pricing-amount {
  font-size: 2.25rem;
  font-weight: 800;
  color: var(--text);
  line-height: 1.1;
}

.pricing-period {
  font-size: 0.85rem;
  color: var(--text-muted);
  font-weight: 500;
}

.pricing-features {
  list-style: none;
  padding: 0;
  margin: 0 0 1.5rem;
  flex: 1;
}

.pricing-features li {
  position: relative;
  padding-left: 1.25rem;
  font-size: 0.85rem;
  color: var(--text-muted);
  line-height: 1.5;
  margin-bottom: 0.5rem;
}

.pricing-features li::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0.45em;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent);
}

.pricing-cta {
  width: 100%;
  text-align: center;
  justify-content: center;
  margin-top: auto;
}

/* Feature Comparison Matrix */
.pricing-matrix {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  background: var(--bg-card);
  border-radius: 16px;
  overflow: hidden;
}

.pricing-matrix th {
  padding: 1rem;
  text-align: center;
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
  border-bottom: 1px solid var(--border);
  font-weight: 600;
}

.pricing-matrix th:first-child {
  text-align: left;
  width: 220px;
}

.pricing-matrix td {
  padding: 0.6rem 1rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.03);
  font-size: 0.85rem;
  color: var(--text-muted);
  text-align: center;
}

.pricing-matrix td:first-child {
  text-align: left;
  color: var(--text);
  font-weight: 500;
}

.pricing-matrix tr:last-child td {
  border-bottom: none;
}

.pricing-matrix-highlight {
  background: rgba(37, 99, 235, 0.05);
}

.pricing-matrix-group td {
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--accent);
  padding-top: 1.25rem;
  border-bottom: 1px solid rgba(37, 99, 235, 0.12);
}

/* Check / Cross icons */
.pm-yes::before {
  content: '\2713';
  display: inline-block;
  width: 20px;
  height: 20px;
  line-height: 20px;
  font-size: 0.75rem;
  font-weight: 700;
  text-align: center;
  border-radius: 50%;
  background: rgba(34, 197, 94, 0.12);
  color: var(--success);
}

.pm-no::before {
  content: '\2014';
  display: inline-block;
  width: 20px;
  height: 20px;
  line-height: 20px;
  font-size: 0.8rem;
  text-align: center;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.04);
  color: var(--text-muted);
}

/* Compute Credit Calculator */
.calc-container {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 3rem;
  align-items: start;
}

.calc-inputs {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.calc-slider-group {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.calc-label {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--text);
}

.calc-value {
  font-family: var(--font-mono);
  font-weight: 600;
  color: var(--accent);
  font-size: 0.85rem;
}

.calc-range {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 6px;
  border-radius: 3px;
  background: rgba(255, 255, 255, 0.08);
  outline: none;
  cursor: pointer;
}

.calc-range::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--accent);
  border: 2px solid #fff;
  cursor: pointer;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.3);
}

.calc-range::-moz-range-thumb {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--accent);
  border: 2px solid #fff;
  cursor: pointer;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.3);
}

.calc-range-labels {
  display: flex;
  justify-content: space-between;
  font-size: 0.7rem;
  color: var(--text-muted);
}

.calc-result {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 2rem;
  position: sticky;
  top: 6rem;
}

.calc-result-header {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-muted);
  font-weight: 600;
  margin-bottom: 0.5rem;
}

.calc-result-plan {
  font-size: 2rem;
  font-weight: 800;
  color: var(--text);
  margin-bottom: 0.25rem;
}

.calc-result-price {
  font-size: 1.1rem;
  color: var(--accent);
  font-weight: 600;
  margin-bottom: 1.5rem;
  padding-bottom: 1.5rem;
  border-bottom: 1px solid var(--border);
}

.calc-result-credits {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1rem;
}

.calc-result-credits-label {
  font-size: 0.85rem;
  color: var(--text-muted);
}

.calc-result-credits-val {
  font-size: 1.5rem;
  font-weight: 700;
  font-family: var(--font-mono);
  color: var(--text);
}

.calc-result-breakdown {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.calc-breakdown-row {
  display: flex;
  justify-content: space-between;
  font-size: 0.8rem;
  color: var(--text-muted);
}

.calc-breakdown-row span:last-child {
  font-family: var(--font-mono);
  color: var(--text);
}

/* Pricing Responsive */
@media (max-width: 1200px) {
  .pricing-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

@media (max-width: 768px) {
  .pricing-grid {
    grid-template-columns: 1fr;
    max-width: 400px;
    margin: 0 auto;
  }

  .calc-container {
    grid-template-columns: 1fr;
  }

  .calc-result {
    position: static;
  }

  .pricing-matrix {
    display: block;
    overflow-x: auto;
  }
}

@media (max-width: 480px) {
  .pricing-card {
    padding: 1.5rem 1rem;
  }

  .pricing-amount {
    font-size: 1.75rem;
  }
}
