/* ==========================================================================
   ThemeSwitcher (Force Dark Mode) — Design System & Stylesheet
   Modern, ultra-fast, accessible dark-first CSS with glassmorphism & fluid typography
   ========================================================================== */

:root {
  /* Color Tokens */
  --bg-base: #090b0e;
  --bg-surface: #11141a;
  --bg-surface-elevated: #181d25;
  --bg-surface-soft: #202632;
  --bg-glass: rgba(17, 20, 26, 0.75);
  --border-subtle: rgba(255, 255, 255, 0.08);
  --border-focus: #6366f1;
  --border-hover: rgba(255, 255, 255, 0.16);

  --text-primary: #f8fafc;
  --text-secondary: #94a3b8;
  --text-muted: #64748b;

  --accent-primary: #6366f1;
  --accent-primary-hover: #4f46e5;
  --accent-cyan: #38bdf8;
  --accent-glow: rgba(99, 102, 241, 0.25);
  --accent-success: #10b981;
  --accent-warning: #f59e0b;

  /* Typography */
  --font-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen, Ubuntu, Cantarell, "Open Sans", "Helvetica Neue", sans-serif;
  --font-mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, "Liberation Mono", monospace;

  /* Spacing */
  --container-max: 1200px;
  --header-height: 72px;

  /* Radius */
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 20px;
  --radius-full: 9999px;

  /* Transitions */
  --transition-fast: 0.15s ease;
  --transition-normal: 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

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

html {
  font-family: var(--font-sans);
  background-color: var(--bg-base);
  color: var(--text-primary);
  line-height: 1.6;
  scroll-behavior: smooth;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  overflow-x: hidden;
  background: 
    radial-gradient(ellipse 80% 50% at 50% -20%, rgba(99, 102, 241, 0.18), transparent 70%),
    radial-gradient(ellipse 60% 40% at 100% 60%, rgba(56, 189, 248, 0.08), transparent 60%),
    var(--bg-base);
}

/* Accessibility Focus States */
:focus-visible {
  outline: 2px solid var(--accent-cyan);
  outline-offset: 3px;
}

.skip-link {
  position: absolute;
  top: -999px;
  left: 20px;
  background: var(--accent-primary);
  color: #fff;
  padding: 10px 18px;
  border-radius: var(--radius-sm);
  z-index: 9999;
  font-weight: 600;
  text-decoration: none;
}
.skip-link:focus {
  top: 20px;
}

/* Typography Helpers */
h1, h2, h3, h4, h5, h6 {
  color: var(--text-primary);
  font-weight: 700;
  line-height: 1.25;
  letter-spacing: -0.02em;
}

h1 { font-size: clamp(2.2rem, 5vw, 3.75rem); }
h2 { font-size: clamp(1.75rem, 3.5vw, 2.5rem); margin-bottom: 1rem; }
h3 { font-size: clamp(1.25rem, 2.2vw, 1.6rem); margin-bottom: 0.75rem; }
p { color: var(--text-secondary); margin-bottom: 1rem; }
p:last-child { margin-bottom: 0; }

a {
  color: var(--accent-cyan);
  text-decoration: none;
  transition: color var(--transition-fast);
}
a:hover {
  color: #7dd3fc;
}

/* Container */
.container {
  width: 100%;
  max-width: var(--container-max);
  margin-left: auto;
  margin-right: auto;
  padding-left: 1.5rem;
  padding-right: 1.5rem;
}

/* Header & Navigation */
.site-header {
  position: sticky;
  top: 0;
  z-index: 1000;
  height: var(--header-height);
  background: var(--bg-glass);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
}

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

.logo-brand {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  color: var(--text-primary);
  font-weight: 700;
  font-size: 1.2rem;
  letter-spacing: -0.01em;
}

.logo-icon {
  width: 32px;
  height: 32px;
  border-radius: var(--radius-sm);
  box-shadow: 0 0 16px var(--accent-glow);
}

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

.nav-link {
  color: var(--text-secondary);
  font-size: 0.95rem;
  font-weight: 500;
  transition: color var(--transition-fast);
}
.nav-link:hover, .nav-link.active {
  color: var(--text-primary);
}

.nav-cta {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.mobile-toggle {
  display: none;
  background: transparent;
  border: 1px solid var(--border-subtle);
  color: var(--text-primary);
  padding: 0.5rem;
  border-radius: var(--radius-sm);
  cursor: pointer;
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.75rem 1.5rem;
  font-size: 0.95rem;
  font-weight: 600;
  border-radius: var(--radius-full);
  border: 1px solid transparent;
  cursor: pointer;
  transition: all var(--transition-normal);
  text-decoration: none;
  white-space: nowrap;
}

.btn-primary {
  background: linear-gradient(135deg, var(--accent-primary), #4338ca);
  color: #ffffff;
  box-shadow: 0 4px 20px var(--accent-glow);
}
.btn-primary:hover {
  background: linear-gradient(135deg, var(--accent-primary-hover), #3730a3);
  transform: translateY(-2px);
  box-shadow: 0 6px 28px rgba(99, 102, 241, 0.4);
  color: #ffffff;
}

.btn-secondary {
  background: var(--bg-surface-elevated);
  color: var(--text-primary);
  border-color: var(--border-subtle);
}
.btn-secondary:hover {
  background: var(--bg-surface-soft);
  border-color: var(--border-hover);
  color: var(--text-primary);
}

.btn-lg {
  padding: 0.95rem 2rem;
  font-size: 1.05rem;
}

/* Badges */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.35rem 0.85rem;
  font-size: 0.8rem;
  font-weight: 600;
  border-radius: var(--radius-full);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  background: rgba(99, 102, 241, 0.12);
  color: #a5b4fc;
  border: 1px solid rgba(99, 102, 241, 0.3);
  margin-bottom: 1.5rem;
}

.badge-dot {
  width: 6px;
  height: 6px;
  background-color: var(--accent-success);
  border-radius: 50%;
  box-shadow: 0 0 8px var(--accent-success);
}

/* Hero Section */
.hero {
  padding: 5rem 0 4rem;
  text-align: center;
  position: relative;
}

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

.hero-title {
  margin-bottom: 1.5rem;
}

.hero-title .gradient-text {
  background: linear-gradient(135deg, #ffffff 40%, var(--accent-cyan) 80%, var(--accent-primary));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.hero-subtitle {
  font-size: clamp(1.1rem, 2vw, 1.35rem);
  color: var(--text-secondary);
  line-height: 1.7;
  margin-bottom: 2.25rem;
}

.hero-actions {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  flex-wrap: wrap;
  margin-bottom: 2rem;
}

.hero-trust {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 2rem;
  font-size: 0.85rem;
  color: var(--text-muted);
}

.trust-item {
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

/* Interactive Interactive Demo Card */
.demo-section {
  padding: 2rem 0 5rem;
}

.demo-wrapper {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: 0 20px 40px -15px rgba(0, 0, 0, 0.6);
  position: relative;
}

.browser-chrome {
  background: #14171f;
  padding: 0.85rem 1.25rem;
  display: flex;
  align-items: center;
  gap: 1rem;
  border-bottom: 1px solid var(--border-subtle);
}

.traffic-dots {
  display: flex;
  gap: 6px;
}
.traffic-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #333842;
}
.traffic-dot.red { background: #ef4444; }
.traffic-dot.yellow { background: #f59e0b; }
.traffic-dot.green { background: #10b981; }

.address-bar {
  flex: 1;
  background: var(--bg-surface-elevated);
  border-radius: var(--radius-sm);
  padding: 0.35rem 1rem;
  font-family: var(--font-mono);
  font-size: 0.85rem;
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.demo-controls {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.demo-toggle-btn {
  background: var(--accent-primary);
  color: white;
  border: none;
  padding: 0.35rem 0.85rem;
  border-radius: var(--radius-sm);
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 0.4rem;
  transition: opacity var(--transition-fast);
}
.demo-toggle-btn:hover {
  opacity: 0.9;
}

.demo-preview-viewport {
  padding: 3rem 2.5rem;
  min-height: 380px;
  transition: all var(--transition-normal);
  display: flex;
  flex-direction: column;
  justify-content: center;
}

/* Light simulation mode */
.demo-preview-viewport.is-light {
  background: #f8fafc;
  color: #0f172a;
}
.demo-preview-viewport.is-light h3,
.demo-preview-viewport.is-light p {
  color: #0f172a;
}
.demo-preview-viewport.is-light .demo-card {
  background: #ffffff;
  border: 1px solid #e2e8f0;
  box-shadow: 0 4px 6px -1px rgba(0,0,0,0.05);
}
.demo-preview-viewport.is-light .demo-card p {
  color: #475569;
}

/* Dark simulation mode (Active Extension) */
.demo-preview-viewport.is-dark {
  background: #0f1115;
  color: #e8eaed;
}
.demo-preview-viewport.is-dark h3 {
  color: #e8eaed;
}
.demo-preview-viewport.is-dark p {
  color: #b8bec7;
}
.demo-preview-viewport.is-dark .demo-card {
  background: #171a20;
  border: 1px solid #343b46;
}
.demo-preview-viewport.is-dark .demo-card p {
  color: #b8bec7;
}

.demo-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 1.5rem;
  margin-top: 1.5rem;
}

.demo-card {
  padding: 1.5rem;
  border-radius: var(--radius-md);
  transition: all var(--transition-normal);
}

/* Feature Sections & Grid */
.features-section {
  padding: 5rem 0;
}

.section-header {
  text-align: center;
  max-width: 680px;
  margin: 0 auto 3.5rem;
}

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

.feature-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 2.25rem;
  transition: all var(--transition-normal);
  position: relative;
  overflow: hidden;
}
.feature-card:hover {
  transform: translateY(-4px);
  border-color: var(--border-hover);
  box-shadow: 0 12px 24px -8px rgba(0, 0, 0, 0.5);
}

.feature-icon-wrapper {
  width: 52px;
  height: 52px;
  background: rgba(99, 102, 241, 0.1);
  border: 1px solid rgba(99, 102, 241, 0.25);
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 1.5rem;
  color: var(--accent-cyan);
}

.feature-card h3 {
  margin-bottom: 0.75rem;
}

/* Engine Comparison Table */
.comparison-section {
  padding: 5rem 0;
  background: var(--bg-surface);
  border-top: 1px solid var(--border-subtle);
  border-bottom: 1px solid var(--border-subtle);
}

.table-responsive {
  width: 100%;
  overflow-x: auto;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-subtle);
}

.comparison-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
  background: var(--bg-base);
}

.comparison-table th, 
.comparison-table td {
  padding: 1.2rem 1.5rem;
  border-bottom: 1px solid var(--border-subtle);
}

.comparison-table th {
  background: var(--bg-surface-elevated);
  color: var(--text-primary);
  font-weight: 600;
  font-size: 0.95rem;
}

.comparison-table tr:hover td {
  background: rgba(255, 255, 255, 0.02);
}

.check-yes {
  color: var(--accent-success);
  font-weight: bold;
}
.check-no {
  color: var(--text-muted);
}

/* FAQ Accordion */
.faq-section {
  padding: 5rem 0;
}

.faq-list {
  max-width: 800px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.faq-item {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  overflow: hidden;
  transition: border-color var(--transition-fast);
}

.faq-item:focus-within {
  border-color: var(--accent-primary);
}

.faq-question {
  width: 100%;
  padding: 1.25rem 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: transparent;
  border: none;
  color: var(--text-primary);
  font-size: 1.05rem;
  font-weight: 600;
  text-align: left;
  cursor: pointer;
}

.faq-icon {
  font-size: 1.2rem;
  transition: transform var(--transition-normal);
}

.faq-item.open .faq-icon {
  transform: rotate(45deg);
}

.faq-answer {
  padding: 0 1.5rem 1.25rem;
  color: var(--text-secondary);
  line-height: 1.7;
}

/* Blog & Guide Article Layout */
.article-container {
  max-width: 780px;
  margin: 3rem auto 5rem;
  padding: 0 1.5rem;
}

.article-header {
  margin-bottom: 2.5rem;
  text-align: left;
}

.article-meta {
  display: flex;
  gap: 1rem;
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-bottom: 1rem;
}

.article-content h2 {
  margin-top: 2.5rem;
  margin-bottom: 1rem;
}

.article-content h3 {
  margin-top: 1.75rem;
  margin-bottom: 0.75rem;
}

.article-content ul, 
.article-content ol {
  margin-left: 1.5rem;
  margin-bottom: 1.5rem;
  color: var(--text-secondary);
}

.article-content li {
  margin-bottom: 0.5rem;
}

.callout-box {
  background: var(--bg-surface-elevated);
  border-left: 4px solid var(--accent-primary);
  padding: 1.25rem 1.5rem;
  border-radius: var(--radius-sm);
  margin: 2rem 0;
}

/* CTA Banner */
.cta-banner {
  padding: 4rem 2rem;
  background: linear-gradient(135deg, rgba(99, 102, 241, 0.15), rgba(56, 189, 248, 0.1));
  border: 1px solid rgba(99, 102, 241, 0.25);
  border-radius: var(--radius-lg);
  text-align: center;
  margin: 4rem auto;
}

.cta-banner h2 {
  margin-bottom: 1rem;
}

.cta-banner p {
  max-width: 600px;
  margin: 0 auto 2rem;
}

/* Footer */
.site-footer {
  background: var(--bg-surface);
  border-top: 1px solid var(--border-subtle);
  padding: 4rem 0 2rem;
  margin-top: auto;
}

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

.footer-brand p {
  margin-top: 1rem;
  max-width: 320px;
}

.footer-col h4 {
  color: var(--text-primary);
  font-size: 0.95rem;
  margin-bottom: 1.25rem;
}

.footer-links {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.footer-links a {
  color: var(--text-secondary);
  font-size: 0.9rem;
}
.footer-links a:hover {
  color: var(--text-primary);
}

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

/* Responsive Breakpoints */
@media (max-width: 900px) {
  .footer-grid {
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
  }
}

@media (max-width: 768px) {
  .mobile-toggle {
    display: block;
  }

  .nav-menu {
    position: fixed;
    top: var(--header-height);
    left: 0;
    right: 0;
    background: var(--bg-surface-elevated);
    border-bottom: 1px solid var(--border-subtle);
    flex-direction: column;
    padding: 1.5rem;
    gap: 1.25rem;
    display: none;
  }
  .nav-menu.open {
    display: flex;
  }

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

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

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