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

:root {
  --primary: #6366f1;
  --primary-dark: #4f46e5;
  --secondary: #8b5cf6;
  --accent: #f59e0b;
  --bg: #ffffff;
  --bg-secondary: #f8fafc;
  --bg-dark: #0f172a;
  --text: #1e293b;
  --text-muted: #64748b;
  --border: #e2e8f0;
  --gradient: linear-gradient(135deg, var(--primary), var(--secondary));
  --shadow-sm: 0 1px 2px rgba(0,0,0,0.05);
  --shadow: 0 4px 6px -1px rgba(0,0,0,0.1), 0 2px 4px -2px rgba(0,0,0,0.1);
  --shadow-lg: 0 10px 15px -3px rgba(0,0,0,0.1), 0 4px 6px -4px rgba(0,0,0,0.1);
  --shadow-xl: 0 20px 25px -5px rgba(0,0,0,0.1), 0 8px 10px -6px rgba(0,0,0,0.1);
  --radius: 12px;
  --radius-lg: 16px;
  --nav-bg: rgba(255,255,255,0.9);
  --code-bg: #0f172a;
  --firebase-orange: #f59e0b;
}

/* Dark mode */
[data-theme="dark"] {
  --bg: #0f172a;
  --bg-secondary: #1e293b;
  --bg-dark: #020617;
  --text: #f1f5f9;
  --text-muted: #94a3b8;
  --border: #334155;
  --shadow-sm: 0 1px 2px rgba(0,0,0,0.3);
  --shadow: 0 4px 6px -1px rgba(0,0,0,0.4), 0 2px 4px -2px rgba(0,0,0,0.3);
  --shadow-lg: 0 10px 15px -3px rgba(0,0,0,0.4), 0 4px 6px -4px rgba(0,0,0,0.3);
  --shadow-xl: 0 20px 25px -5px rgba(0,0,0,0.5), 0 8px 10px -6px rgba(0,0,0,0.4);
  --nav-bg: rgba(15,23,42,0.9);
  --code-bg: #020617;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0f172a;
    --bg-secondary: #1e293b;
    --bg-dark: #020617;
    --text: #f1f5f9;
    --text-muted: #94a3b8;
    --border: #334155;
    --shadow-sm: 0 1px 2px rgba(0,0,0,0.3);
    --shadow: 0 4px 6px -1px rgba(0,0,0,0.4), 0 2px 4px -2px rgba(0,0,0,0.3);
    --shadow-lg: 0 10px 15px -3px rgba(0,0,0,0.4), 0 4px 6px -4px rgba(0,0,0,0.3);
    --shadow-xl: 0 20px 25px -5px rgba(0,0,0,0.5), 0 8px 10px -6px rgba(0,0,0,0.4);
    --nav-bg: rgba(15,23,42,0.9);
    --code-bg: #020617;
  }
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  color: var(--text);
  line-height: 1.6;
  background: var(--bg);
}

.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 24px;
}

/* Typography */
h1, h2, h3, h4 {
  line-height: 1.2;
  font-weight: 700;
}

h1 { font-size: clamp(2.5rem, 5vw, 4rem); }
h2 { font-size: clamp(2rem, 4vw, 3rem); }
h3 { font-size: 1.25rem; }

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

code {
  background: var(--bg-secondary);
  padding: 2px 8px;
  border-radius: 6px;
  font-size: 0.875em;
  font-family: 'SF Mono', Monaco, 'Cascadia Code', monospace;
  border: 1px solid var(--border);
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 12px 24px;
  font-size: 0.95rem;
  font-weight: 600;
  border-radius: var(--radius);
  text-decoration: none;
  transition: all 0.2s;
  cursor: pointer;
  border: none;
}

.btn-primary {
  background: var(--gradient);
  color: white;
  box-shadow: var(--shadow);
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg);
}

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

.btn-secondary:hover {
  background: var(--bg-secondary);
  border-color: var(--text-muted);
}

.btn-lg {
  padding: 16px 32px;
  font-size: 1.05rem;
}

.btn-block {
  width: 100%;
}

/* Announcement Bar - scrolls with page */
.announcement-bar {
  background: linear-gradient(135deg, #f97316, #ea580c);
  color: white;
  padding: 12px 0;
  text-align: center;
  font-size: 0.9rem;
}

.announcement-bar p {
  margin: 0;
}

.announcement-bar a {
  color: white;
  text-decoration: underline;
  font-weight: 600;
}

.announcement-bar a:hover {
  opacity: 0.9;
}

/* Navigation - sticky at top */
.nav {
  position: sticky;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  background: var(--nav-bg);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
}

.nav-container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 72px;
}

.logo {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: var(--text);
  font-size: 1.25rem;
  font-weight: 700;
}

.logo-icon {
  width: 36px;
  height: 36px;
  background: var(--gradient);
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
}

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

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

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

.mobile-menu-btn {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  padding: 8px;
  color: var(--text);
}

/* Theme Toggle */
.theme-toggle {
  background: none;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  cursor: pointer;
  padding: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text);
  transition: all 0.2s;
}

.theme-toggle:hover {
  background: var(--bg-secondary);
  border-color: var(--text-muted);
}

.theme-toggle svg {
  width: 20px;
  height: 20px;
}

.theme-toggle .sun-icon {
  display: none;
}

.theme-toggle .moon-icon {
  display: block;
}

[data-theme="dark"] .theme-toggle .sun-icon {
  display: block;
}

[data-theme="dark"] .theme-toggle .moon-icon {
  display: none;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .theme-toggle .sun-icon {
    display: block;
  }
  :root:not([data-theme="light"]) .theme-toggle .moon-icon {
    display: none;
  }
}

.mobile-theme-toggle {
  display: none;
}

/* Hero */
.hero {
  padding: 80px 0; /* Normal padding, no need to account for fixed nav */
  text-align: center;
  background: linear-gradient(180deg, var(--bg-secondary) 0%, var(--bg) 100%);
}

.hero-badge {
  display: inline-block;
  padding: 8px 16px;
  background: rgba(99, 102, 241, 0.1);
  color: var(--primary);
  border-radius: 100px;
  font-size: 0.875rem;
  font-weight: 600;
  margin-bottom: 24px;
}

.hero h1 {
  margin-bottom: 24px;
}

.hero-subtitle {
  font-size: 1.25rem;
  color: var(--text-muted);
  max-width: 600px;
  margin: 0 auto 40px;
}

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

.hero-stats {
  display: flex;
  justify-content: center;
  gap: 60px;
  margin-bottom: 40px;
}

.stat {
  display: flex;
  flex-direction: column;
}

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

.stat-label {
  font-size: 0.875rem;
  color: var(--text-muted);
}

/* Platform Support */
.platform-support {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  margin-bottom: 60px;
}

.platform-support > span {
  color: var(--text-muted);
  font-size: 0.875rem;
}

.platforms {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  justify-content: center;
}

.platform-badge {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 16px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 100px;
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--text);
}

.platform-badge svg {
  width: 18px;
  height: 18px;
}

/* Hero Image / Mock Dashboard */
.hero-image {
  max-width: 1000px;
  margin: 0 auto;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-xl);
  overflow: hidden;
  border: 1px solid var(--border);
}

.hero-image-placeholder {
  background: var(--bg-secondary);
  aspect-ratio: 16/10;
}

.mock-dashboard {
  height: 100%;
  display: flex;
}

.mock-sidebar {
  width: 60px;
  background: var(--bg-dark);
  padding: 16px 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.mock-logo {
  width: 36px;
  height: 36px;
  background: var(--gradient);
  border-radius: 8px;
  margin-bottom: 16px;
}

.mock-nav-item {
  width: 36px;
  height: 36px;
  background: rgba(255,255,255,0.1);
  border-radius: 8px;
}

.mock-nav-item.active {
  background: var(--primary);
}

.mock-main {
  flex: 1;
  display: flex;
  flex-direction: column;
}

.mock-header {
  padding: 16px 24px;
  background: var(--bg);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.mock-title {
  font-weight: 600;
  color: var(--text);
}

.mock-search {
  width: 200px;
  height: 36px;
  background: var(--bg-secondary);
  border-radius: 8px;
  border: 1px solid var(--border);
}

.mock-content {
  flex: 1;
  padding: 24px;
  background: var(--bg-secondary);
}

.mock-stats-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  margin-bottom: 24px;
}

.mock-stat-card {
  background: var(--bg);
  border-radius: var(--radius);
  padding: 20px;
  border: 1px solid var(--border);
}

.mock-stat-label {
  width: 60%;
  height: 12px;
  background: var(--border);
  border-radius: 4px;
  margin-bottom: 12px;
}

.mock-stat-value {
  width: 40%;
  height: 24px;
  background: var(--gradient);
  border-radius: 4px;
  opacity: 0.6;
}

.mock-chart {
  background: var(--bg);
  border-radius: var(--radius);
  height: 200px;
  border: 1px solid var(--border);
}

/* Trusted */
.trusted {
  padding: 60px 0;
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}

.trusted-label {
  text-align: center;
  color: var(--text-muted);
  font-size: 0.875rem;
  margin-bottom: 24px;
}

.trusted-logos {
  display: flex;
  justify-content: center;
  gap: 48px;
  flex-wrap: wrap;
}

.logo-placeholder {
  color: var(--text-muted);
  font-weight: 600;
  font-size: 1.125rem;
  opacity: 0.5;
}

/* Features */
.features {
  padding: 120px 0;
}

.section-header {
  text-align: center;
  max-width: 600px;
  margin: 0 auto 60px;
}

.section-header p {
  color: var(--text-muted);
  font-size: 1.125rem;
  margin-top: 16px;
}

.features-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 24px;
}

.feature-card {
  padding: 32px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  transition: all 0.2s;
}

.feature-card:hover {
  border-color: var(--primary);
  box-shadow: var(--shadow-lg);
  transform: translateY(-4px);
}

.feature-icon {
  font-size: 2rem;
  margin-bottom: 16px;
}

.feature-card h3 {
  margin-bottom: 12px;
}

.feature-card p {
  color: var(--text-muted);
}

.feature-card code {
  font-size: 0.8em;
}

/* Firebase Migration Section */
.migrate {
  padding: 120px 0;
  background: linear-gradient(135deg, rgba(249, 115, 22, 0.05), rgba(234, 88, 12, 0.05));
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}

.migrate-content {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 60px;
  align-items: center;
}

.migrate-badge {
  display: inline-block;
  padding: 8px 16px;
  background: rgba(249, 115, 22, 0.1);
  color: #ea580c;
  border-radius: 100px;
  font-size: 0.875rem;
  font-weight: 600;
  margin-bottom: 16px;
}

.migrate-text h2 {
  margin-bottom: 16px;
}

.migrate-text > p {
  color: var(--text-muted);
  font-size: 1.125rem;
  margin-bottom: 24px;
}

.migrate-benefits {
  list-style: none;
  margin-bottom: 32px;
}

.migrate-benefits li {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 0;
  color: var(--text);
}

.migrate-benefits svg {
  width: 20px;
  height: 20px;
  color: #10b981;
  flex-shrink: 0;
}

.migrate-steps-visual {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.migrate-step {
  display: flex;
  align-items: flex-start;
  gap: 16px;
  background: var(--bg);
  padding: 24px;
  border-radius: var(--radius);
  border: 1px solid var(--border);
}

.migrate-step-number {
  width: 40px;
  height: 40px;
  background: var(--gradient);
  color: white;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  flex-shrink: 0;
}

.migrate-step-content h4 {
  margin-bottom: 4px;
  font-size: 1rem;
}

.migrate-step-content p {
  color: var(--text-muted);
  font-size: 0.9rem;
}

.migrate-step-arrow {
  text-align: center;
  color: var(--text-muted);
  font-size: 1.5rem;
  padding: 0 56px;
}

/* How It Works */
.how-it-works {
  padding: 120px 0;
  background: var(--bg-secondary);
}

.steps {
  display: flex;
  align-items: flex-start;
  justify-content: center;
  gap: 24px;
  flex-wrap: wrap;
}

.step {
  flex: 1;
  min-width: 200px;
  max-width: 250px;
  text-align: center;
}

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

.step h3 {
  margin-bottom: 8px;
}

.step p {
  color: var(--text-muted);
  font-size: 0.95rem;
}

.step p strong {
  color: var(--text);
}

.step-arrow {
  color: var(--text-muted);
  font-size: 1.5rem;
  margin-top: 24px;
}

/* Code Section */
.code-section {
  padding: 120px 0;
}

.code-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 60px;
  align-items: center;
}

.code-content h2 {
  margin-bottom: 16px;
}

.code-content > p {
  color: var(--text-muted);
  margin-bottom: 24px;
}

.code-features {
  list-style: none;
  margin-bottom: 32px;
}

.code-features li {
  padding: 8px 0;
  color: var(--text);
}

/* Code Tabs */
.code-block-container {
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-xl);
}

.code-tabs {
  display: flex;
  background: var(--code-bg);
  border-bottom: 1px solid rgba(255,255,255,0.1);
}

.code-tab {
  padding: 12px 20px;
  background: none;
  border: none;
  color: rgba(255,255,255,0.5);
  font-size: 0.875rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s;
  border-bottom: 2px solid transparent;
}

.code-tab:hover {
  color: rgba(255,255,255,0.8);
}

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

.code-block {
  background: var(--code-bg);
}

.code-block.hidden {
  display: none;
}

.code-header {
  padding: 12px 16px;
  background: rgba(255,255,255,0.05);
  display: flex;
  align-items: center;
  gap: 8px;
}

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

.code-dot.red { background: #ff5f57; }
.code-dot.yellow { background: #febc2e; }
.code-dot.green { background: #28c840; }

.code-title {
  margin-left: auto;
  color: rgba(255,255,255,0.5);
  font-size: 0.875rem;
}

.code-block pre {
  padding: 24px;
  overflow-x: auto;
  font-size: 0.85rem;
  line-height: 1.7;
  margin: 0;
}

.code-block code {
  font-family: 'SF Mono', Monaco, 'Cascadia Code', monospace;
  color: #e2e8f0;
  background: none;
  padding: 0;
  border: none;
}

.keyword { color: #c792ea; }
.string { color: #c3e88d; }
.comment { color: #546e7a; }
.number { color: #f78c6c; }

/* Pricing */
.pricing {
  padding: 120px 0;
  background: var(--bg-secondary);
}

.pricing-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
  max-width: 1000px;
  margin: 0 auto;
}

.pricing-card {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 32px;
  position: relative;
}

.pricing-card.featured {
  border-color: var(--primary);
  box-shadow: var(--shadow-lg);
  transform: scale(1.05);
}

.pricing-badge {
  position: absolute;
  top: -12px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--gradient);
  color: white;
  padding: 6px 16px;
  border-radius: 100px;
  font-size: 0.75rem;
  font-weight: 600;
}

.pricing-header {
  text-align: center;
  margin-bottom: 24px;
  padding-bottom: 24px;
  border-bottom: 1px solid var(--border);
}

.pricing-header h3 {
  font-size: 1.25rem;
  margin-bottom: 8px;
}

.price {
  font-size: 2.5rem;
  font-weight: 800;
}

.price span {
  font-size: 1rem;
  font-weight: 400;
  color: var(--text-muted);
}

.pricing-header p {
  color: var(--text-muted);
  font-size: 0.95rem;
  margin-top: 8px;
}

.pricing-features {
  list-style: none;
  margin-bottom: 32px;
}

.pricing-features li {
  padding: 10px 0;
  color: var(--text-muted);
  font-size: 0.95rem;
}

.pricing-features li::before {
  content: '✓';
  color: var(--primary);
  margin-right: 10px;
  font-weight: 600;
}

/* CTA */
.cta {
  padding: 120px 0;
  text-align: center;
  background: var(--bg-dark);
  color: white;
}

.cta h2 {
  margin-bottom: 16px;
}

.cta p {
  color: rgba(255,255,255,0.7);
  font-size: 1.125rem;
  margin-bottom: 32px;
}

.cta-buttons {
  display: flex;
  gap: 16px;
  justify-content: center;
}

.cta .btn-secondary {
  background: transparent;
  color: white;
  border-color: rgba(255,255,255,0.3);
}

.cta .btn-secondary:hover {
  background: rgba(255,255,255,0.1);
  border-color: rgba(255,255,255,0.5);
}

/* Footer */
.footer {
  padding: 80px 0 40px;
  border-top: 1px solid var(--border);
}

.footer-grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr;
  gap: 48px;
  margin-bottom: 48px;
}

.footer-brand p {
  color: var(--text-muted);
  margin-top: 16px;
  max-width: 280px;
}

.footer-links h4 {
  font-size: 0.875rem;
  font-weight: 600;
  margin-bottom: 16px;
  color: var(--text);
}

.footer-links a {
  display: block;
  color: var(--text-muted);
  text-decoration: none;
  padding: 6px 0;
  font-size: 0.95rem;
  transition: color 0.2s;
}

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

.footer-bottom {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-top: 32px;
  border-top: 1px solid var(--border);
}

.footer-bottom p {
  color: var(--text-muted);
  font-size: 0.875rem;
}

.social-links {
  display: flex;
  gap: 16px;
}

.social-links a {
  color: var(--text-muted);
  transition: color 0.2s;
}

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

/* Responsive */
@media (max-width: 968px) {
  .pricing-grid {
    grid-template-columns: 1fr;
    max-width: 400px;
  }
  
  .pricing-card.featured {
    transform: none;
  }
  
  .code-grid {
    grid-template-columns: 1fr;
  }
  
  .migrate-content {
    grid-template-columns: 1fr;
  }
  
  .footer-grid {
    grid-template-columns: 1fr 1fr;
  }
}

@media (max-width: 768px) {
  .announcement-bar {
    padding: 10px 16px;
    font-size: 0.8rem;
  }
  
  .nav-links {
    display: none;
    position: absolute;
    top: 72px;
    left: 0;
    right: 0;
    background: var(--bg);
    flex-direction: column;
    padding: 24px;
    gap: 16px;
    border-bottom: 1px solid var(--border);
  }

  .nav-links.active {
    display: flex;
  }

  .nav-links .theme-toggle {
    display: none;
  }

  .mobile-theme-toggle {
    display: flex;
    padding: 10px;
    min-width: 44px;
    min-height: 44px;
  }

  .mobile-menu-btn {
    display: block;
  }
  
  .hero {
    padding: 60px 0;
  }
  
  .hero-cta {
    flex-direction: column;
    align-items: center;
  }
  
  .hero-stats {
    flex-direction: column;
    gap: 24px;
  }
  
  .platforms {
    gap: 8px;
  }
  
  .platform-badge {
    padding: 6px 12px;
    font-size: 0.8rem;
  }
  
  .mock-sidebar {
    width: 50px;
    padding: 12px 8px;
  }
  
  .mock-logo {
    width: 30px;
    height: 30px;
  }
  
  .mock-nav-item {
    width: 30px;
    height: 30px;
  }
  
  .mock-stats-row {
    grid-template-columns: 1fr;
  }
  
  .migrate-step-arrow {
    padding: 0;
    font-size: 1.25rem;
  }
  
  .steps {
    flex-direction: column;
    align-items: center;
  }
  
  .step-arrow {
    transform: rotate(90deg);
    margin: 0;
  }
  
  .code-tabs {
    overflow-x: auto;
  }
  
  .code-tab {
    padding: 10px 14px;
    font-size: 0.8rem;
    white-space: nowrap;
  }
  
  .footer-grid {
    grid-template-columns: 1fr;
    gap: 32px;
  }
  
  .footer-bottom {
    flex-direction: column;
    gap: 16px;
  }
}