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

:root {
  --bg: #fafafa;
  --surface: #ffffff;
  --border: #e2e2e2;
  --text: #1a1a1a;
  --text-secondary: #666;
  --accent: #6366f1;
  --accent-hover: #4f46e5;
  --source-local: #818cf8;
  --source-plugin: #2dd4bf;
  --tag-bg: #f0f0f0;
  --tag-text: #555;
  --radius: 10px;
  --shadow: 0 1px 3px rgba(0,0,0,0.06), 0 1px 2px rgba(0,0,0,0.04);
  --shadow-lg: 0 4px 12px rgba(0,0,0,0.08);
  --shadow-xl: 0 20px 60px rgba(0,0,0,0.12);
  --max-width: 1100px;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #111111;
    --surface: #1a1a1a;
    --border: #2a2a2a;
    --text: #e5e5e5;
    --text-secondary: #999;
    --tag-bg: #2a2a2a;
    --tag-text: #aaa;
    --shadow: 0 1px 3px rgba(0,0,0,0.2);
    --shadow-lg: 0 4px 12px rgba(0,0,0,0.3);
    --shadow-xl: 0 20px 60px rgba(0,0,0,0.4);
  }
}

html {
  scroll-behavior: smooth;
}

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

/* ── Nav ─────────────────────────────────────── */

.nav {
  position: sticky;
  top: 0;
  z-index: 100;
  padding: 0 32px;
  height: 60px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  transition: background 0.2s, border-color 0.2s;
  border-bottom: 1px solid transparent;
}

.nav.scrolled {
  background: var(--surface);
  border-bottom-color: var(--border);
}

.nav-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: var(--text);
  font-size: 18px;
  font-weight: 700;
  letter-spacing: -0.4px;
}

.nav-logo svg {
  flex-shrink: 0;
}

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

/* ── Buttons ─────────────────────────────────── */

.btn {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 9px 18px;
  border-radius: var(--radius);
  font-size: 14px;
  font-weight: 500;
  text-decoration: none;
  cursor: pointer;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  transition: all 0.15s;
}

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

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

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

.btn-lg {
  padding: 13px 28px;
  font-size: 15px;
  border-radius: 12px;
}

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

.btn-ghost:hover {
  background: var(--tag-bg);
  border-color: transparent;
  color: var(--text);
}

/* ── Sections / layout ───────────────────────── */

.section {
  padding: 96px 32px;
}

.section-sm {
  padding: 64px 32px;
}

.container {
  max-width: var(--max-width);
  margin: 0 auto;
}

/* ── Hero ─────────────────────────────────────── */

.hero {
  padding: 80px 32px 96px;
  text-align: center;
}

.hero-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  color: var(--accent);
  background: rgba(99,102,241,0.08);
  padding: 5px 12px;
  border-radius: 20px;
  margin-bottom: 24px;
}

.hero h1 {
  font-size: clamp(36px, 6vw, 64px);
  font-weight: 800;
  letter-spacing: -1.5px;
  line-height: 1.08;
  margin-bottom: 24px;
  max-width: 800px;
  margin-left: auto;
  margin-right: auto;
}

.hero h1 .gradient {
  background: linear-gradient(135deg, var(--accent) 0%, var(--source-plugin) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.hero-sub {
  font-size: 18px;
  color: var(--text-secondary);
  max-width: 560px;
  margin: 0 auto 40px;
  line-height: 1.6;
}

.hero-ctas {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
  flex-wrap: wrap;
  margin-bottom: 20px;
}

.hero-trust {
  font-size: 12px;
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  flex-wrap: wrap;
}

.hero-trust span {
  display: flex;
  align-items: center;
  gap: 5px;
}

.hero-screenshot {
  margin-top: 64px;
  max-width: 900px;
  margin-left: auto;
  margin-right: auto;
}

.browser-chrome {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  box-shadow: var(--shadow-xl);
  overflow: hidden;
}

.browser-chrome-bar {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
  background: var(--bg);
}

.browser-dots {
  display: flex;
  gap: 6px;
}

.browser-dots span {
  width: 12px;
  height: 12px;
  border-radius: 50%;
}

.browser-dots .dot-red    { background: #ff5f57; }
.browser-dots .dot-yellow { background: #ffbd2e; }
.browser-dots .dot-green  { background: #28c840; }

.browser-url {
  flex: 1;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 4px 12px;
  font-size: 12px;
  font-family: 'SF Mono', 'Fira Code', 'Consolas', monospace;
  color: var(--text-secondary);
  text-align: center;
}

.browser-body {
  background: var(--bg);
  min-height: 360px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.browser-body img {
  width: 100%;
  display: block;
}

/* Placeholder when no screenshot */
.screenshot-placeholder {
  width: 100%;
  min-height: 400px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 16px;
  color: var(--text-secondary);
  font-size: 13px;
  background: var(--bg);
  padding: 48px;
}

.screenshot-placeholder .mock-ui {
  width: 100%;
  max-width: 700px;
  background: var(--surface);
  border-radius: var(--radius);
  border: 1px solid var(--border);
  overflow: hidden;
}

.mock-header {
  padding: 14px 20px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.mock-title {
  font-size: 15px;
  font-weight: 700;
  letter-spacing: -0.3px;
}

.mock-search {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 6px 14px;
  font-size: 13px;
  color: var(--text-secondary);
  width: 160px;
}

.mock-tabs {
  display: flex;
  border-bottom: 1px solid var(--border);
  padding: 0 20px;
  gap: 4px;
}

.mock-tab {
  padding: 9px 16px;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-secondary);
  border-bottom: 2px solid transparent;
  display: flex;
  align-items: center;
  gap: 6px;
}

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

.mock-tab-count {
  font-size: 11px;
  background: var(--accent);
  color: white;
  padding: 1px 6px;
  border-radius: 8px;
}

.mock-tab-count-plain {
  font-size: 11px;
  background: var(--tag-bg);
  color: var(--tag-text);
  padding: 1px 6px;
  border-radius: 8px;
}

.mock-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  padding: 16px 20px;
}

.mock-card {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 14px;
  border-left-width: 3px;
}

.mock-card.local { border-left-color: var(--source-local); }
.mock-card.plugin { border-left-color: var(--source-plugin); }

.mock-card-name {
  font-size: 13px;
  font-weight: 600;
  margin-bottom: 6px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.mock-card-desc {
  font-size: 11px;
  color: var(--text-secondary);
  margin-bottom: 10px;
  line-height: 1.4;
}

.source-badge {
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.3px;
  padding: 2px 7px;
  border-radius: 4px;
}

.source-badge.local {
  color: var(--source-local);
  background: rgba(129, 140, 248, 0.12);
}

.source-badge.plugin {
  color: var(--source-plugin);
  background: rgba(45, 212, 191, 0.12);
}

/* ── Problem strip ───────────────────────────── */

.problem-strip {
  background: var(--surface);
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}

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

.problem-item {
  padding: 40px 32px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.problem-item + .problem-item {
  border-left: 1px solid var(--border);
}

.problem-icon {
  font-size: 28px;
  line-height: 1;
}

.problem-item h3 {
  font-size: 15px;
  font-weight: 600;
}

.problem-item p {
  font-size: 14px;
  color: var(--text-secondary);
  line-height: 1.6;
}

/* ── Features ────────────────────────────────── */

.features-heading {
  text-align: center;
  margin-bottom: 72px;
}

.features-heading h2 {
  font-size: clamp(28px, 4vw, 42px);
  font-weight: 800;
  letter-spacing: -1px;
  margin-bottom: 12px;
}

.features-heading p {
  font-size: 17px;
  color: var(--text-secondary);
  max-width: 480px;
  margin: 0 auto;
}

.feature-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 64px;
  align-items: center;
  margin-bottom: 96px;
}

.feature-row:last-child {
  margin-bottom: 0;
}

.feature-row.reverse {
  direction: rtl;
}

.feature-row.reverse > * {
  direction: ltr;
}

.feature-text h3 {
  font-size: 24px;
  font-weight: 700;
  letter-spacing: -0.5px;
  margin-bottom: 12px;
}

.feature-text p {
  font-size: 16px;
  color: var(--text-secondary);
  line-height: 1.7;
  margin-bottom: 20px;
}

.feature-tags {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.feature-tag {
  font-size: 12px;
  padding: 4px 10px;
  background: var(--tag-bg);
  color: var(--tag-text);
  border-radius: 6px;
  font-weight: 500;
}

.feature-visual {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 24px;
  box-shadow: var(--shadow-lg);
  min-height: 220px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

/* ── How it works ────────────────────────────── */

.how-it-works {
  background: var(--surface);
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}

.how-heading {
  text-align: center;
  margin-bottom: 48px;
}

.how-heading h2 {
  font-size: clamp(28px, 4vw, 42px);
  font-weight: 800;
  letter-spacing: -1px;
  margin-bottom: 12px;
}

.how-heading p {
  font-size: 17px;
  color: var(--text-secondary);
}

.install-tabs {
  display: flex;
  justify-content: center;
  gap: 8px;
  margin-bottom: 40px;
}

.install-tab {
  padding: 9px 20px;
  border-radius: var(--radius);
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  border: 1px solid var(--border);
  background: var(--bg);
  color: var(--text-secondary);
  transition: all 0.15s;
}

.install-tab.active {
  background: var(--accent);
  color: white;
  border-color: var(--accent);
}

.install-content {
  display: none;
  max-width: 640px;
  margin: 0 auto;
}

.install-content.active {
  display: block;
}

.install-steps {
  display: flex;
  flex-direction: column;
  gap: 0;
}

.install-step {
  display: flex;
  gap: 20px;
  padding: 24px 0;
  border-bottom: 1px solid var(--border);
}

.install-step:last-child {
  border-bottom: none;
}

.step-num {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--accent);
  color: white;
  font-size: 14px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  margin-top: 2px;
}

.step-body h4 {
  font-size: 15px;
  font-weight: 600;
  margin-bottom: 6px;
}

.step-body p {
  font-size: 14px;
  color: var(--text-secondary);
  line-height: 1.6;
}

.code-block {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 12px 16px;
  font-family: 'SF Mono', 'Fira Code', 'Consolas', monospace;
  font-size: 13px;
  color: var(--text);
  margin-top: 10px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.copy-btn {
  font-size: 11px;
  padding: 3px 8px;
  border-radius: 5px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text-secondary);
  cursor: pointer;
  flex-shrink: 0;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
  transition: all 0.15s;
}

.copy-btn:hover {
  border-color: var(--accent);
  color: var(--accent);
}

/* ── CLI section ─────────────────────────────── */

.cli-table-wrap {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  overflow: hidden;
  box-shadow: var(--shadow);
  max-width: 680px;
  margin: 0 auto;
}

.cli-row {
  display: grid;
  grid-template-columns: 220px 1fr;
  gap: 0;
  border-bottom: 1px solid var(--border);
}

.cli-row:last-child {
  border-bottom: none;
}

.cli-cmd {
  padding: 14px 20px;
  font-family: 'SF Mono', 'Fira Code', 'Consolas', monospace;
  font-size: 13px;
  color: var(--accent);
  background: var(--bg);
  border-right: 1px solid var(--border);
}

.cli-desc {
  padding: 14px 20px;
  font-size: 13px;
  color: var(--text-secondary);
  display: flex;
  align-items: center;
}

/* ── Open source CTA ─────────────────────────── */

.oss-cta {
  text-align: center;
}

.oss-cta h2 {
  font-size: clamp(28px, 4vw, 42px);
  font-weight: 800;
  letter-spacing: -1px;
  margin-bottom: 16px;
}

.oss-cta p {
  font-size: 17px;
  color: var(--text-secondary);
  max-width: 520px;
  margin: 0 auto 36px;
  line-height: 1.7;
}

.oss-buttons {
  display: flex;
  gap: 14px;
  justify-content: center;
  flex-wrap: wrap;
  margin-bottom: 24px;
}

.oss-made-by {
  font-size: 13px;
  color: var(--text-secondary);
}

.oss-made-by a {
  color: var(--accent);
  text-decoration: none;
}

.oss-made-by a:hover {
  text-decoration: underline;
}

/* ── Footer ──────────────────────────────────── */

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

.footer-left {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 13px;
  color: var(--text-secondary);
}

.footer-left a {
  color: var(--text-secondary);
  text-decoration: none;
}

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

.footer-sep {
  color: var(--border);
}

.footer-right {
  font-size: 13px;
  color: var(--text-secondary);
}

.footer-right a {
  color: var(--accent);
  text-decoration: none;
  font-weight: 500;
}

.footer-right a:hover {
  text-decoration: underline;
}

/* ── Responsive ──────────────────────────────── */

@media (max-width: 768px) {
  .nav { padding: 0 20px; }
  .section { padding: 64px 20px; }
  .section-sm { padding: 48px 20px; }
  .hero { padding: 56px 20px 72px; }

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

  .problem-item + .problem-item {
    border-left: none;
    border-top: 1px solid var(--border);
  }

  .feature-row {
    grid-template-columns: 1fr;
    gap: 32px;
    margin-bottom: 64px;
  }

  .feature-row.reverse {
    direction: ltr;
  }

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

  .footer {
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
  }
}

@media (max-width: 480px) {
  .mock-grid {
    grid-template-columns: 1fr;
  }

  .nav-links .btn-ghost {
    display: none;
  }

  .hero-ctas {
    flex-direction: column;
    align-items: stretch;
    max-width: 280px;
    margin-left: auto;
    margin-right: auto;
  }

  .hero-ctas .btn {
    justify-content: center;
  }
}
