/* CSS Variables */
:root {
  /* Colors - Light Mode */
  --primary: #2563eb;
  --primary-hover: #1d4ed8;
  --secondary: #64748b;
  --accent: #3b82f6;
  --background: #ffffff;
  --surface: #f8fafc;
  --surface-hover: #f1f5f9;
  --text-primary: #0f172a;
  --text-secondary: #475569;
  --text-muted: #64748b;
  --border: #e2e8f0;
  --border-light: #f1f5f9;
  
  /* Spacing */
  --spacing-xs: 0.5rem;
  --spacing-sm: 1rem;
  --spacing-md: 1.5rem;
  --spacing-lg: 2rem;
  --spacing-xl: 3rem;
  --spacing-2xl: 4rem;
  
  /* Border radius */
  --radius: 0.5rem;
  --radius-sm: 0.25rem;
  --radius-lg: 1rem;
  
  /* Fonts */
  --font-sans: 'Inter', system-ui, sans-serif;
  --font-mono: 'JetBrains Mono', monospace;
  
  /* Shadows */
  --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
  --shadow: 0 1px 3px 0 rgb(0 0 0 / 0.1), 0 1px 2px -1px rgb(0 0 0 / 0.1);
  --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
  --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
}

/* Dark Mode */
[data-theme="dark"] {
  --primary: #3b82f6;
  --primary-hover: #2563eb;
  --secondary: #94a3b8;
  --accent: #60a5fa;
  --background: #0f172a;
  --surface: #1e293b;
  --surface-hover: #334155;
  --text-primary: #f8fafc;
  --text-secondary: #cbd5e1;
  --text-muted: #94a3b8;
  --border: #334155;
  --border-light: #1e293b;
}

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

html {
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-sans);
  background-color: var(--background);
  color: var(--text-primary);
  line-height: 1.6;
}

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

/* Utility Classes */
.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 var(--spacing-md);
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* Grid System */
.grid {
  display: grid;
  gap: var(--spacing-lg);
}

.grid--2 {
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
}

.grid--3 {
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
}

.grid--4 {
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
}

@media (max-width: 768px) {
  .grid--3,
  .grid--4 {
    grid-template-columns: 1fr;
  }
}

/* Typography */
h1, h2, h3, h4, h5, h6 {
  font-weight: 600;
  line-height: 1.2;
  color: var(--text-primary);
}

h1 {
  font-size: clamp(2rem, 5vw, 3.5rem);
  font-weight: 700;
}

h2 {
  font-size: clamp(1.5rem, 4vw, 2.5rem);
}

h3 {
  font-size: clamp(1.25rem, 3vw, 1.75rem);
}

p {
  color: var(--text-secondary);
}

.section-title {
  text-align: center;
  margin-bottom: var(--spacing-xl);
}

.section-subtitle {
  text-align: center;
  color: var(--text-muted);
  margin-bottom: var(--spacing-lg);
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--spacing-xs);
  padding: var(--spacing-sm) var(--spacing-md);
  border: 1px solid transparent;
  border-radius: var(--radius);
  font-size: 0.875rem;
  font-weight: 500;
  text-decoration: none;
  cursor: pointer;
  transition: all 0.2s ease;
  white-space: nowrap;
}

.btn:focus {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
}

.btn--primary {
  background-color: var(--primary);
  color: white;
  border-color: var(--primary);
}

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

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

.btn--secondary:hover {
  background-color: var(--surface-hover);
}

.btn--outline {
  background-color: transparent;
  color: var(--primary);
  border-color: var(--primary);
}

.btn--outline:hover {
  background-color: var(--primary);
  color: white;
}

.btn--ghost {
  background-color: transparent;
  color: var(--text-secondary);
}

.btn--ghost:hover {
  background-color: var(--surface);
  color: var(--text-primary);
}

.btn--large {
  padding: var(--spacing-md) var(--spacing-lg);
  font-size: 1rem;
}

.btn--icon {
  padding: var(--spacing-xs);
  width: 2.5rem;
  height: 2.5rem;
}

/* Cards */
.card {
  background-color: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: var(--spacing-lg);
  transition: all 0.2s ease;
}

.card:hover {
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
}

.card-icon {
  font-size: 2rem;
  margin-bottom: var(--spacing-md);
}

.card-title {
  margin-bottom: var(--spacing-sm);
}

.card-description {
  color: var(--text-secondary);
  margin-bottom: var(--spacing-md);
}

.card-image {
  margin: calc(-1 * var(--spacing-lg)) calc(-1 * var(--spacing-lg)) var(--spacing-md);
  border-radius: var(--radius-lg) var(--radius-lg) 0 0;
  overflow: hidden;
  aspect-ratio: 16/9;
  background-color: var(--border-light);
}

.card-content {
  flex: 1;
}

.card-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: var(--spacing-sm);
  margin-bottom: var(--spacing-sm);
}

.card-footer {
  margin-top: var(--spacing-md);
}

.card--indicator {
  display: flex;
  flex-direction: column;
  height: 100%;
}

.card--testimonial {
  text-align: center;
}

/* Badge */
.badge {
  display: inline-block;
  padding: 0.25rem 0.5rem;
  background-color: var(--primary);
  color: white;
  font-size: 0.75rem;
  font-weight: 500;
  border-radius: var(--radius-sm);
  white-space: nowrap;
}

/* Feature List */
.feature-list {
  list-style: none;
  margin: var(--spacing-sm) 0;
}

.feature-list li {
  color: var(--text-secondary);
  font-size: 0.875rem;
  margin-bottom: 0.25rem;
}

.feature-list li:before {
  content: "• ";
  color: var(--primary);
  font-weight: bold;
  margin-right: 0.5rem;
}

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

.nav-content {
  display: flex;
  justify-content: space-between;
  align-items: center;
  height: 4rem;
}

.nav-brand {
  display: flex;
  align-items: center;
  gap: var(--spacing-xs);
  font-weight: 600;
  color: var(--primary);
}

.logo {
  width: 2rem;
  height: 2rem;
}

.nav-menu {
  display: flex;
  align-items: center;
  gap: var(--spacing-lg);
}

.nav-link {
  color: var(--text-secondary);
  text-decoration: none;
  font-weight: 500;
  transition: color 0.2s ease;
}

.nav-link:hover {
  color: var(--primary);
}

.nav-actions {
  display: flex;
  align-items: center;
  gap: var(--spacing-sm);
}

.nav-toggle {
  display: none;
  flex-direction: column;
  background: none;
  border: none;
  cursor: pointer;
  padding: var(--spacing-xs);
}

.nav-toggle span {
  width: 1.5rem;
  height: 2px;
  background-color: var(--text-primary);
  margin: 2px 0;
  transition: 0.3s;
}

@media (max-width: 768px) {
  .nav-menu {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background-color: var(--background);
    border-bottom: 1px solid var(--border);
    flex-direction: column;
    padding: var(--spacing-lg);
    gap: var(--spacing-md);
  }

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

  .nav-toggle {
    display: flex;
  }

  .nav-actions {
    width: 100%;
    justify-content: space-between;
    margin-top: var(--spacing-md);
  }
}

/* Theme Toggle */
.theme-toggle {
  position: relative;
  padding: var(--spacing-xs);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--text-primary);
  cursor: pointer;
  transition: all 0.3s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
}

.theme-toggle:hover {
  background: var(--surface-hover);
  border-color: var(--primary);
  transform: scale(1.05);
}

.theme-toggle:active {
  transform: scale(0.95);
}

.icon-sun,
.icon-moon {
  position: absolute;
  transition: all 0.3s ease;
  opacity: 1;
  transform: scale(1) rotate(0deg);
}

/* Light theme: show sun, hide moon */
[data-theme="light"] .icon-sun,
[data-theme=""] .icon-sun {
  opacity: 1;
  transform: scale(1) rotate(0deg);
}

[data-theme="light"] .icon-moon,
[data-theme=""] .icon-moon {
  opacity: 0;
  transform: scale(0.8) rotate(180deg);
}

/* Dark theme: show moon, hide sun */
[data-theme="dark"] .icon-sun {
  opacity: 0;
  transform: scale(0.8) rotate(-180deg);
}

[data-theme="dark"] .icon-moon {
  opacity: 1;
  transform: scale(1) rotate(0deg);
}

/* Ensure proper contrast in both themes */
[data-theme="light"] .theme-toggle {
  color: var(--text-primary);
  background: var(--surface);
}

[data-theme="dark"] .theme-toggle {
  color: var(--text-primary);
  background: var(--surface);
}

/* Sections */
.section {
  padding: var(--spacing-2xl) 0;
}

.section--features {
  background-color: var(--surface);
}

.section--demo {
  background-color: var(--surface);
}

.section--pricing {
  background-color: var(--surface);
}

/* Hero */
.hero {
  padding: var(--spacing-2xl) 0;
  text-align: center;
}

.hero-content {
  max-width: 800px;
  margin: 0 auto;
}

.hero-title {
  margin-bottom: var(--spacing-md);
}

.hero-subtitle {
  font-size: 1.25rem;
  color: var(--text-secondary);
  margin-bottom: var(--spacing-xl);
}

.hero-bullets {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: var(--spacing-lg);
  margin-bottom: var(--spacing-xl);
}

.bullet-item {
  display: flex;
  align-items: center;
  gap: var(--spacing-xs);
  color: var(--text-secondary);
}

.bullet-icon {
  color: var(--primary);
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: var(--spacing-md);
  margin-bottom: var(--spacing-lg);
}

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

@media (max-width: 640px) {
  .hero-bullets {
    flex-direction: column;
    align-items: center;
  }

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

/* Demo */
.demo-container {
  max-width: 900px;
  margin: 0 auto;
}

.chart-embed {
  position: relative;
  background-color: var(--surface);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-lg);
}

.tv-widget {
  aspect-ratio: 16/9;
  background-color: var(--border-light);
}

.gif-demo {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background-color: rgba(0, 0, 0, 0.1);
}

/* Social Proof */
.rating {
  text-align: center;
  margin-bottom: var(--spacing-xl);
}

.stars {
  font-size: 1.5rem;
  margin-bottom: var(--spacing-xs);
}

.testimonial-author {
  display: flex;
  align-items: center;
  gap: var(--spacing-sm);
  margin-top: var(--spacing-md);
}

.avatar {
  width: 2.5rem;
  height: 2.5rem;
  background-color: var(--border);
  border-radius: 50%;
}

/* Pricing */
.pricing-card {
  max-width: 500px;
  margin: 0 auto;
  background-color: var(--background);
  border: 2px solid var(--primary);
  border-radius: var(--radius-lg);
  padding: var(--spacing-xl);
  text-align: center;
}

.price-row {
  margin: var(--spacing-sm) 0 var(--spacing-md);
}

.pricing-toggle {
  display: flex;
  gap: var(--spacing-xs);
  justify-content: center;
  margin: var(--spacing-md) 0;
}

.toggle-option {
  flex: 1;
  max-width: 200px;
  padding: var(--spacing-md);
  border: 2px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--text-secondary);
  font-family: inherit;
  cursor: pointer;
  transition: all 0.3s ease;
  text-align: center;
}

.toggle-option:hover {
  border-color: var(--primary);
  background: var(--surface-hover);
}

.toggle-option.active {
  border-color: var(--primary);
  background: var(--primary);
  color: white;
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.toggle-label {
  display: block;
  font-weight: 600;
  font-size: 1rem;
  margin-bottom: var(--spacing-xs);
}

.toggle-price {
  display: block;
  font-size: 0.875rem;
  opacity: 0.9;
}

.toggle-option.active .toggle-label {
  font-weight: 700;
}

.toggle-option.active .toggle-price {
  opacity: 1;
}

.big-price {
  font-size: clamp(1.8rem, 3vw, 2.8rem);
  font-weight: 700;
  margin: var(--spacing-sm) 0 var(--spacing-md);
  color: var(--primary);
  font-family: var(--font-mono);
}

.plan-includes {
  margin: var(--spacing-sm) 0 var(--spacing-md) var(--spacing-md);
  text-align: left;
  list-style: none;
}

.plan-includes li {
  margin-bottom: var(--spacing-xs);
  color: var(--text-secondary);
}

.plan-includes li:before {
  content: "✓ ";
  color: var(--primary);
  font-weight: bold;
  margin-right: var(--spacing-xs);
}

.onboarding-steps {
  margin-top: var(--spacing-xl);
  padding-top: var(--spacing-lg);
  border-top: 1px solid var(--border);
  text-align: left;
}

.steps {
  margin: var(--spacing-md) 0 0 var(--spacing-md);
  color: var(--text-secondary);
}

.steps li {
  margin-bottom: var(--spacing-sm);
}

.disclaimer {
  margin-top: var(--spacing-xl);
  padding: var(--spacing-md);
  background-color: rgba(239, 68, 68, 0.1);
  border: 1px solid rgba(239, 68, 68, 0.2);
  border-radius: var(--radius);
  font-size: 0.875rem;
  color: var(--text-secondary);
}

/* Checklist */
.checklist {
  margin: var(--spacing-sm) 0 0 var(--spacing-md);
  list-style: none;
}

.checklist li {
  margin-bottom: var(--spacing-xs);
  color: var(--text-secondary);
}

.section--community .checklist li::before,
.section--requirements .checklist li::before {
  content: "✓ ";
  color: var(--primary);
  font-weight: bold;
  margin-right: var(--spacing-xs);
}

/* Microcopy */
.microcopy {
  font-size: 0.875rem;
  color: var(--text-muted);
  font-style: italic;
}

/* FAQ */
.faq-container {
  max-width: 800px;
  margin: 0 auto;
}

.faq-item {
  border-bottom: 1px solid var(--border);
}

.faq-question {
  width: 100%;
  padding: var(--spacing-md) 0;
  background: none;
  border: none;
  text-align: left;
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 1rem;
  font-weight: 500;
  color: var(--text-primary);
}

.faq-question:hover {
  color: var(--primary);
}

.faq-question:focus {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
}

.faq-icon {
  font-size: 1.25rem;
  transition: transform 0.2s ease;
}

.faq-question[aria-expanded="true"] .faq-icon {
  transform: rotate(45deg);
}

.faq-answer {
  padding-bottom: var(--spacing-md);
  color: var(--text-secondary);
  display: none;
}

.faq-question[aria-expanded="true"] + .faq-answer {
  display: block;
}

/* Footer */
.footer {
  background-color: var(--surface);
  border-top: 1px solid var(--border);
  padding: var(--spacing-2xl) 0 var(--spacing-lg);
}

.footer-content {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr;
  gap: var(--spacing-xl);
  margin-bottom: var(--spacing-xl);
}

.footer-brand {
  display: flex;
  flex-direction: column;
  gap: var(--spacing-sm);
}

.footer-brand .brand-name {
  font-weight: 600;
  color: var(--primary);
}

.footer-brand p {
  font-size: 0.875rem;
  max-width: 300px;
}

.footer-column h4 {
  margin-bottom: var(--spacing-sm);
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--text-primary);
}

.footer-column ul {
  list-style: none;
}

.footer-column li {
  margin-bottom: var(--spacing-xs);
}

.footer-column a {
  color: var(--text-secondary);
  text-decoration: none;
  font-size: 0.875rem;
  transition: color 0.2s ease;
}

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

.footer-bottom {
  text-align: center;
  padding-top: var(--spacing-lg);
  border-top: 1px solid var(--border);
  color: var(--text-muted);
  font-size: 0.875rem;
}

.footer-disclaimer {
  margin-top: var(--spacing-xs);
}

@media (max-width: 768px) {
  .footer-content {
    grid-template-columns: 1fr;
    gap: var(--spacing-lg);
  }
}

/* Animations */
@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.fade-in {
  animation: fadeIn 0.6s ease forwards;
}

/* Accessibility */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* Focus styles */
a:focus,
button:focus,
input:focus,
textarea:focus,
select:focus {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
}

/* Print styles */
@media print {
  .navbar,
  .footer,
  .btn {
    display: none;
  }
}