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

html {
  scroll-behavior: smooth;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background-color: var(--bg-primary);
  color: var(--text-primary);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

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

a {
  color: var(--accent-start);
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

/* ==================== Variables ==================== */
:root {
  /* Colors */
  --bg-primary: #0f172a;
  --bg-surface: #1e293b;
  --border: #334155;
  --text-primary: #f1f5f9;
  --text-secondary: #cbd5e1;
  --text-muted: #b0bec5;
  --accent-start: #60a5fa;
  --accent-end: #6366f1;
  --code-green: #a3e635;
  --code-blue: #bfdbfe;

  /* Typography */
  --font-mono: ui-monospace, 'Cascadia Code', 'Fira Code', monospace;

  /* Layout */
  --max-width: 1200px;
  --section-padding: 80px 24px;
  --card-gap: 20px;
  --radius: 8px;
  --radius-sm: 4px;
  --radius-lg: 12px;
}

/* ==================== Layout ==================== */
.container {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 24px;
}

section {
  padding: var(--section-padding);
}

.section-title {
  font-size: 2rem;
  font-weight: 700;
  margin-bottom: 16px;
}

.section-subtitle {
  font-size: 1.125rem;
  color: var(--text-secondary);
  max-width: 600px;
  margin-bottom: 48px;
}

/* ==================== Buttons ==================== */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 24px;
  border-radius: var(--radius);
  font-size: 0.9375rem;
  font-weight: 500;
  cursor: pointer;
  border: none;
  transition: opacity 0.2s;
}

.btn:hover {
  opacity: 0.9;
  text-decoration: none;
}

.btn-primary {
  background: linear-gradient(135deg, var(--accent-start), var(--accent-end));
  color: #fff;
}

.btn-secondary {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text-secondary);
}

.btn-secondary:hover {
  border-color: var(--text-secondary);
  color: var(--text-primary);
}

/* ==================== Cards ==================== */
.card {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 24px;
}

/* ==================== Grid ==================== */
.grid-2 {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: var(--card-gap);
}

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

/* ==================== Navbar ==================== */
#navbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1000;
  background: rgba(15, 23, 42, 0.8);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid transparent;
  transition: border-color 0.3s, background 0.3s;
}

#navbar.scrolled {
  border-bottom-color: var(--border);
  background: rgba(15, 23, 42, 0.95);
}

.navbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 64px;
}

.navbar-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 1.125rem;
  font-weight: 600;
  color: var(--text-primary);
}

.navbar-brand:hover {
  text-decoration: none;
}

.navbar-links {
  display: flex;
  align-items: center;
  gap: 32px;
}

.navbar-links a {
  color: var(--text-secondary);
  font-size: 0.875rem;
  transition: color 0.2s;
}

.navbar-links a:hover {
  color: var(--text-primary);
  text-decoration: none;
}

.btn-sm {
  padding: 8px 16px;
  font-size: 0.8125rem;
}

.navbar-toggle {
  display: none;
  flex-direction: column;
  gap: 5px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px;
}

.navbar-toggle span {
  display: block;
  width: 24px;
  height: 2px;
  background: var(--text-primary);
  border-radius: 1px;
  transition: transform 0.3s, opacity 0.3s;
}

body {
  padding-top: 64px;
}

/* ==================== Hero ==================== */
.hero {
  text-align: center;
  padding-top: 32px;
  padding-bottom: 40px;
}

.hero-logo {
  margin: 0 auto 20px;
  object-fit: contain;
}

.hero-badge {
  display: inline-block;
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 6px 16px;
  font-size: 0.8125rem;
  color: #bfdbfe;
  margin-bottom: 24px;
}

.hero-title {
  font-size: 3.25rem;
  font-weight: 700;
  line-height: 1.15;
  margin-bottom: 20px;
}

.hero-subtitle {
  font-size: 1.1875rem;
  color: var(--text-secondary);
  max-width: 560px;
  margin: 0 auto 32px;
  line-height: 1.6;
}

.hero-cta {
  display: flex;
  gap: 12px;
  justify-content: center;
  margin-bottom: 48px;
}

.hero-badges {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 24px;
}

.trust-badge {
  text-align: center;
}

.trust-badge-value {
  display: block;
  font-size: 1.5rem;
  font-weight: 700;
}

.trust-badge-label {
  display: block;
  font-size: 0.75rem;
  color: var(--text-muted);
}

.trust-badge-divider {
  width: 1px;
  height: 40px;
  background: var(--border);
}

/* ==================== Features ==================== */
.features-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--card-gap);
}

.feature-icon {
  font-size: 1.75rem;
  margin-bottom: 12px;
  width: 48px;
  height: 48px;
  background: linear-gradient(135deg, var(--accent-start), var(--accent-end));
  border-radius: var(--radius);
  display: flex;
  align-items: center;
  justify-content: center;
}

.feature-title {
  font-size: 1.0625rem;
  font-weight: 600;
  margin-bottom: 8px;
}

.feature-desc {
  font-size: 0.9375rem;
  color: var(--text-secondary);
  line-height: 1.6;
}

/* ==================== Code Example ==================== */
.terminal {
  background: #111827;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  max-width: 720px;
  margin: 0 auto;
}

.terminal-header {
  display: flex;
  gap: 8px;
  padding: 14px 16px;
  background: #1a1f2e;
  border-bottom: 1px solid var(--border);
}

.terminal-dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
}

.terminal-body {
  padding: 24px;
  overflow-x: auto;
}

.terminal-body code {
  font-family: var(--font-mono);
  font-size: 0.875rem;
  line-height: 1.8;
  color: var(--text-secondary);
}

.code-comment {
  color: var(--text-muted);
}

.code-cmd {
  color: var(--code-green);
}

.code-str {
  color: var(--code-blue);
}

.code-output {
  color: var(--code-green);
  font-weight: 600;
}

/* ==================== How It Works ==================== */
.steps {
  position: relative;
  align-items: start;
  grid-template-columns: 1fr auto 1fr auto 1fr;
}

.step {
  text-align: center;
  padding: 24px 16px;
}

.step-number {
  width: 48px;
  height: 48px;
  background: linear-gradient(135deg, var(--accent-start), var(--accent-end));
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.25rem;
  font-weight: 700;
  margin: 0 auto 16px;
}

.step-title {
  font-size: 1.125rem;
  font-weight: 600;
  margin-bottom: 8px;
}

.step-desc {
  font-size: 0.9375rem;
  color: var(--text-secondary);
  line-height: 1.6;
}

.step-desc code {
  font-family: var(--font-mono);
  font-size: 0.8125rem;
  background: var(--bg-surface);
  border: 1px solid var(--border);
  padding: 2px 8px;
  border-radius: var(--radius-sm);
}

.step-connector {
  width: 48px;
  height: 2px;
  background: var(--border);
  align-self: center;
  margin-top: -20px;
}

/* ==================== Comparison ==================== */
.table-wrapper {
  overflow-x: auto;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
}

.compare-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9375rem;
}

.compare-table th,
.compare-table td {
  padding: 14px 20px;
  text-align: left;
  border-bottom: 1px solid var(--border);
}

.compare-table thead th {
  background: var(--bg-surface);
  font-weight: 600;
  font-size: 0.875rem;
  color: var(--text-secondary);
}

.compare-table tbody td {
  color: var(--text-secondary);
}

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

.compare-highlight {
  background: rgba(59, 130, 246, 0.08);
  color: var(--text-primary) !important;
  font-weight: 500;
}

.compare-table thead .compare-highlight {
  color: var(--accent-start) !important;
  font-weight: 700;
}

/* ==================== SDKs ==================== */
.sdk-card {
  text-align: center;
  transition: border-color 0.2s;
  display: block;
  color: inherit;
}

.sdk-card:hover {
  border-color: var(--accent-start);
  text-decoration: none;
}

.sdk-icon {
  font-size: 2rem;
  margin-bottom: 12px;
}

.sdk-name {
  font-size: 1.0625rem;
  font-weight: 600;
  margin-bottom: 4px;
}

.sdk-pkg {
  font-family: var(--font-mono);
  font-size: 0.8125rem;
  color: var(--text-muted);
}

.sdk-coming-soon {
  text-align: center;
  margin-top: 24px;
  font-size: 0.875rem;
  color: var(--text-muted);
  font-style: italic;
}

/* ==================== Self-Hosted Pitch ==================== */
.pitch-item {
  text-align: center;
  padding: 16px;
}

.pitch-icon {
  font-size: 2.5rem;
  margin-bottom: 16px;
}

.pitch-title {
  font-size: 1.125rem;
  font-weight: 600;
  margin-bottom: 8px;
}

.pitch-desc {
  font-size: 0.9375rem;
  color: var(--text-secondary);
  line-height: 1.6;
}

/* ==================== Open Source CTA ==================== */
.open-source-cta {
  text-align: center;
  max-width: 600px;
}

.open-source-text {
  font-size: 1.125rem;
  color: var(--text-secondary);
  margin-bottom: 32px;
  line-height: 1.6;
}

/* ==================== Footer ==================== */
#footer {
  border-top: 1px solid var(--border);
  padding: 48px 24px 24px;
}

.footer-top {
  display: flex;
  justify-content: space-between;
  margin-bottom: 40px;
}

.footer-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 1rem;
  font-weight: 600;
}

.footer-columns {
  display: flex;
  gap: 64px;
}

.footer-col {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.footer-col h4 {
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--text-primary);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 4px;
}

.footer-col a {
  font-size: 0.875rem;
  color: var(--text-secondary);
}

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

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

.footer-bottom a {
  color: var(--text-secondary);
}

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

/* ==================== Responsive ==================== */
@media (max-width: 768px) {
  .hero-title {
    font-size: 2rem;
  }

  .hero-subtitle {
    font-size: 1rem;
  }

  .hero-cta {
    flex-direction: column;
    align-items: center;
  }

  .hero-badges {
    gap: 16px;
  }

  .trust-badge-value {
    font-size: 1.25rem;
  }

  /* Navbar mobile */
  .navbar-toggle {
    display: flex;
  }

  .navbar-links {
    display: none;
    position: absolute;
    top: 64px;
    left: 0;
    right: 0;
    background: rgba(15, 23, 42, 0.98);
    backdrop-filter: blur(12px);
    flex-direction: column;
    padding: 16px 24px;
    gap: 16px;
    border-bottom: 1px solid var(--border);
  }

  .navbar-links.open {
    display: flex;
  }

  .navbar-toggle.active span:nth-child(1) {
    transform: rotate(45deg) translate(5px, 5px);
  }

  .navbar-toggle.active span:nth-child(2) {
    opacity: 0;
  }

  .navbar-toggle.active span:nth-child(3) {
    transform: rotate(-45deg) translate(5px, -5px);
  }

  /* Grids become single column */
  .grid-2,
  .grid-3,
  .features-grid {
    grid-template-columns: 1fr;
  }

  /* Steps vertical */
  .steps {
    grid-template-columns: 1fr;
  }

  .step-connector {
    width: 2px;
    height: 32px;
    margin: 0 auto;
  }

  /* Footer */
  .footer-top {
    flex-direction: column;
    gap: 32px;
  }

  .footer-columns {
    flex-direction: column;
    gap: 24px;
  }

  .footer-bottom {
    flex-direction: column;
    gap: 8px;
    text-align: center;
  }

  section {
    padding: 48px 16px;
  }
}

@media (min-width: 769px) and (max-width: 1024px) {
  .features-grid {
    grid-template-columns: repeat(2, 1fr);
  }

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