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

:root {
  --bg-primary: #0a0a0f;
  --bg-secondary: #111118;
  --bg-card: #16161f;
  --bg-elevated: #1c1c28;
  --border: #2a2a3a;
  --text-primary: #e8e8ed;
  --text-secondary: #9494a8;
  --text-muted: #6b6b80;
  --accent: #7c3aed;
  --accent-hover: #8b5cf6;
  --accent-glow: rgba(124, 58, 237, 0.15);
  --green: #22c55e;
  --radius: 12px;
  --radius-sm: 8px;
  --max-width: 900px;
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-mono: "SF Mono", "Cascadia Code", "Fira Code", "JetBrains Mono", Consolas, monospace;
}

html {
  scroll-behavior: smooth;
  scroll-padding-top: 72px;
}

body {
  font-family: var(--font);
  background: var(--bg-primary);
  color: var(--text-primary);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

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

img, svg {
  display: block;
  max-width: 100%;
}

code {
  font-family: var(--font-mono);
  font-size: 0.875em;
  background: var(--bg-elevated);
  padding: 0.15em 0.4em;
  border-radius: 4px;
}

pre code {
  background: none;
  padding: 0;
}

/* Nav */
.nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  background: rgba(10, 10, 15, 0.8);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
}

.nav-inner {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 20px;
  height: 56px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.nav-logo {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--text-primary);
  font-weight: 600;
  font-size: 1.1rem;
}
.nav-logo:hover {
  color: var(--text-primary);
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 20px;
}
.nav-links a {
  font-size: 0.875rem;
  color: var(--text-secondary);
  transition: color 0.2s;
}
.nav-links a:hover {
  color: var(--text-primary);
}

.nav-gh {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  border: 1px solid var(--border);
  border-radius: 6px;
  transition: border-color 0.2s;
}
.nav-gh:hover {
  border-color: var(--text-muted);
}

/* Hero */
.hero {
  position: relative;
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 80px 20px 60px;
  overflow: hidden;
}

.hero-bg {
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse at 50% 0%, rgba(124, 58, 237, 0.08) 0%, transparent 60%),
              radial-gradient(ellipse at 80% 50%, rgba(34, 197, 94, 0.04) 0%, transparent 50%);
  pointer-events: none;
}

.hero-content {
  position: relative;
  text-align: center;
  max-width: 640px;
}

.hero-icon {
  display: inline-flex;
  margin-bottom: 24px;
  filter: drop-shadow(0 0 40px rgba(124, 58, 237, 0.3));
}

.hero-title {
  font-size: clamp(3rem, 10vw, 5rem);
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1.1;
  background: linear-gradient(135deg, #e8e8ed 0%, #7c3aed 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.hero-subtitle {
  margin-top: 16px;
  font-size: 1.25rem;
  color: var(--text-secondary);
  line-height: 1.5;
}

.hero-cta {
  display: flex;
  gap: 12px;
  justify-content: center;
  margin-top: 32px;
  flex-wrap: wrap;
}

.hero-badges {
  display: flex;
  gap: 8px;
  justify-content: center;
  margin-top: 28px;
  opacity: 0.7;
}
.hero-badges img {
  height: 20px;
}

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

.btn-primary {
  background: var(--accent);
  color: white;
}
.btn-primary:hover {
  background: var(--accent-hover);
  color: white;
  transform: translateY(-1px);
  box-shadow: 0 4px 20px rgba(124, 58, 237, 0.3);
}

.btn-secondary {
  background: transparent;
  color: var(--text-primary);
  border: 1px solid var(--border);
}
.btn-secondary:hover {
  border-color: var(--text-muted);
  color: var(--text-primary);
  background: var(--bg-elevated);
}

/* Screenshots carousel */
.screenshots {
  display: flex;
  justify-content: center;
  padding: 0 20px 60px;
}
.screenshots .swiper {
  max-width: 280px;
  width: 100%;
  padding-bottom: 40px;
}
.screenshots .swiper-slide {
  text-align: center;
}
.screenshots .swiper-slide img {
  width: 100%;
  height: auto;
  display: block;
  border-radius: var(--radius);
  border: 1px solid var(--border);
}
.screenshots .swiper-slide figcaption {
  margin-top: 10px;
  font-size: 0.85rem;
  color: var(--text-muted);
}
.screenshots .swiper-pagination-bullet {
  background: var(--text-muted);
  opacity: 0.5;
}
.screenshots .swiper-pagination-bullet-active {
  background: var(--accent);
  opacity: 1;
}
.screenshots .swiper-button-prev,
.screenshots .swiper-button-next {
  color: white;
  background: rgba(0,0,0,0.5);
  width: 32px;
  height: 32px;
  border-radius: 50%;
}
.screenshots .swiper-button-prev::after,
.screenshots .swiper-button-next::after {
  font-size: 14px;
  font-weight: bold;
}

/* Sections */
.section {
  padding: 80px 20px;
}

.section-alt {
  background: var(--bg-secondary);
}

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

.section-title {
  font-size: 2rem;
  font-weight: 700;
  text-align: center;
  letter-spacing: -0.02em;
}

.section-desc {
  text-align: center;
  color: var(--text-secondary);
  margin-top: 8px;
  margin-bottom: 48px;
  font-size: 1.1rem;
}

/* Features Grid */
.features-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 16px;
}

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

.feature-card:hover {
  border-color: var(--accent);
  transform: translateY(-2px);
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.2);
}

.feature-icon {
  display: inline;
  font-size: 1.75rem;
  margin-right: 8px;
}

.feature-card h3 {
  display: inline;
  font-size: 1rem;
  font-weight: 600;
}

.feature-card p {
  margin-top: 8px;
  font-size: 0.875rem;
  color: var(--text-secondary);
  line-height: 1.6;
}

/* Diagram */
.diagram {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 48px;
  padding: 32px 20px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

.diagram-node {
  text-align: center;
  padding: 16px 20px;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  min-width: 120px;
}
.diagram-node span {
  display: block;
  font-weight: 600;
  font-size: 0.95rem;
  white-space: nowrap;
}
.diagram-node small {
  display: block;
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-top: 4px;
}

.diagram-arrow {
  font-size: 0.8rem;
  color: var(--text-muted);
  font-family: var(--font-mono);
  white-space: nowrap;
}
.arrow-v {
  display: none;
}

/* Steps */
.steps {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 20px;
}

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

.step-num {
  width: 40px;
  height: 40px;
  margin: 0 auto 12px;
  border-radius: 50%;
  background: var(--accent);
  color: white;
  font-weight: 700;
  font-size: 1rem;
  display: flex;
  align-items: center;
  justify-content: center;
}

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

/* Tabs */
.tabs {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  margin-bottom: 32px;
}

.tab-nav {
  display: flex;
  border-bottom: 1px solid var(--border);
  overflow-x: auto;
  overflow-y: hidden;
  touch-action: pan-x;
}

.tab-btn {
  flex: 1;
  padding: 12px 16px;
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 0.85rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s;
  font-family: var(--font-mono);
  white-space: nowrap;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
}
.tab-btn:hover {
  color: var(--text-secondary);
}
.tab-btn.active {
  color: var(--accent);
  border-bottom-color: var(--accent);
}

.tab-content {
  display: none;
  padding: 0;
}
.tab-content.active {
  display: block;
}

.tab-desc {
  padding: 16px 20px 0;
  font-size: 0.9rem;
  color: var(--text-secondary);
}

/* Code Block */
.code-block {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  background: var(--bg-elevated);
  margin: 16px;
  border-radius: var(--radius-sm);
  overflow: hidden;
}
.code-block pre {
  flex: 1;
  padding: 16px 20px;
  overflow-x: auto;
  overflow-y: hidden;
  touch-action: pan-x;
}
.code-block code {
  font-family: var(--font-mono);
  font-size: 0.85rem;
  line-height: 1.6;
  color: var(--text-primary);
}

.code-copy {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  margin: 8px;
  padding: 0;
  background: none;
  border: none;
  border-radius: 4px;
  color: var(--text-muted);
  cursor: pointer;
  transition: all 0.2s;
}
.code-copy:hover {
  color: var(--text-primary);
  background: var(--bg-card);
}
.code-copy.copied {
  color: var(--green);
}

.code-copy svg {
  display: block;
}

.code-copy .check-icon {
  display: none;
}
.code-copy.copied .copy-icon {
  display: none;
}
.code-copy.copied .check-icon {
  display: block;
}

/* Usage */
.usage {
  text-align: center;
}
.usage h3 {
  font-size: 1.2rem;
  font-weight: 600;
  margin-bottom: 16px;
}
.usage .code-block {
  max-width: 500px;
  margin: 0 auto;
}
.usage .code-block pre {
  text-align: left;
}
.usage-note {
  margin-top: 16px;
  font-size: 0.9rem;
  color: var(--text-secondary);
}

/* FAQ */
.faq-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.faq-item {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  overflow: hidden;
}

.faq-item summary {
  padding: 16px 20px;
  font-weight: 600;
  font-size: 0.95rem;
  cursor: pointer;
  user-select: none;
  list-style: none;
  display: flex;
  align-items: center;
  gap: 8px;
}
.faq-item summary::-webkit-details-marker {
  display: none;
}
.faq-item summary::before {
  content: "+";
  font-size: 1.1rem;
  color: var(--accent);
  font-weight: 700;
  transition: transform 0.2s;
  flex-shrink: 0;
}
.faq-item[open] summary::before {
  content: "−";
}

.faq-item p, .faq-item pre {
  padding: 0 20px 16px;
  font-size: 0.9rem;
  color: var(--text-secondary);
  line-height: 1.6;
}

/* Animations */
.feature-card, .step {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.5s ease, transform 0.5s ease;
  transition-delay: var(--delay, 0s);
}
.feature-card.visible, .step.visible {
  opacity: 1;
  transform: translateY(0);
}

/* Footer */
.footer {
  border-top: 1px solid var(--border);
  padding: 40px 20px;
  text-align: center;
}

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

.footer-brand {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-weight: 600;
  font-size: 1.1rem;
  margin-bottom: 8px;
}

.footer-desc {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-bottom: 20px;
}

.footer-links {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 20px;
  margin-bottom: 20px;
}
.footer-links a {
  font-size: 0.85rem;
  color: var(--text-secondary);
}
.footer-links a:hover {
  color: var(--text-primary);
}

.footer-legal {
  font-size: 0.8rem;
  color: var(--text-muted);
}

/* Responsive */
@media (max-width: 640px) {
  .nav-links a:not(.nav-gh) {
    display: none;
  }

  .section {
    padding: 60px 16px;
  }

  .section-title {
    font-size: 1.6rem;
  }

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

  .diagram {
    flex-direction: column;
    gap: 2px;
  }
  .diagram-arrow {
    transform: none;
    padding: 6px 0;
    white-space: nowrap;
  }
  .arrow-h {
    display: none;
  }
  .arrow-v {
    display: inline;
  }

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

  .tab-btn {
    font-size: 0.8rem;
    padding: 10px 12px;
  }
}

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