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

:root {
  --primary: #6366f1;
  --primary-dark: #4f46e5;
  --primary-light: #a5b4fc;
  --bg: #0f0f14;
  --bg-card: #1a1a24;
  --bg-card-hover: #22223a;
  --text: #e2e8f0;
  --text-muted: #94a3b8;
  --border: #2d2d3d;
  --success: #10b981;
  --radius: 12px;
}

html {
  scroll-behavior: smooth;
}

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

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

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

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

.logo {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--text);
  text-decoration: none;
}

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

.nav-links a {
  color: var(--text-muted);
  text-decoration: none;
  font-size: 0.9rem;
  transition: color 0.2s;
}

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

/* Buttons */
.btn {
  display: inline-block;
  padding: 10px 20px;
  border-radius: 8px;
  font-weight: 600;
  font-size: 0.9rem;
  text-decoration: none;
  cursor: pointer;
  border: none;
  transition: all 0.2s;
  background: var(--primary);
  color: white;
}

.btn:hover {
  background: var(--primary-dark);
  transform: translateY(-1px);
}

.btn-sm {
  padding: 6px 14px;
  font-size: 0.8rem;
}

.btn-lg {
  padding: 14px 28px;
  font-size: 1rem;
}

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

.btn-outline:hover {
  border-color: var(--primary);
  background: rgba(99, 102, 241, 0.1);
}

.btn-block {
  display: block;
  width: 100%;
  text-align: center;
}

/* Hero */
.hero {
  padding: 160px 0 80px;
  text-align: center;
}

.badge {
  display: inline-block;
  padding: 6px 16px;
  background: rgba(99, 102, 241, 0.15);
  border: 1px solid rgba(99, 102, 241, 0.3);
  border-radius: 20px;
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--primary-light);
  margin-bottom: 24px;
}

.hero h1 {
  font-size: clamp(2.5rem, 6vw, 4rem);
  font-weight: 800;
  line-height: 1.1;
  margin-bottom: 24px;
}

.gradient-text {
  background: linear-gradient(135deg, var(--primary), #ec4899);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.hero-sub {
  font-size: 1.2rem;
  color: var(--text-muted);
  max-width: 600px;
  margin: 0 auto 32px;
}

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

.hero-stats {
  display: flex;
  justify-content: center;
  gap: 48px;
}

.stat {
  display: flex;
  flex-direction: column;
  align-items: center;
}

.stat-num {
  font-size: 1.8rem;
  font-weight: 700;
  color: var(--primary-light);
}

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

/* How it works */
.how-it-works {
  padding: 80px 0;
}

.how-it-works h2,
.demo h2,
.pricing h2,
.api-docs h2 {
  font-size: 2rem;
  font-weight: 700;
  text-align: center;
  margin-bottom: 12px;
}

.section-sub {
  text-align: center;
  color: var(--text-muted);
  margin-bottom: 48px;
  font-size: 1.05rem;
}

.steps-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
}

.step-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 32px 24px;
  text-align: center;
}

.step-num {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  background: var(--primary);
  border-radius: 50%;
  font-weight: 700;
  margin-bottom: 16px;
}

.step-card h3 {
  margin-bottom: 8px;
  font-size: 1.1rem;
}

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

/* Demo */
.demo {
  padding: 80px 0;
}

.demo-container {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
}

.demo-input label {
  font-weight: 600;
  margin-bottom: 8px;
  display: block;
}

.demo-input textarea {
  width: 100%;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
  color: var(--text);
  font-family: inherit;
  font-size: 0.9rem;
  resize: vertical;
  margin-bottom: 16px;
}

.demo-input textarea:focus {
  outline: none;
  border-color: var(--primary);
}

.demo-controls {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.format-toggles {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.toggle {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.85rem;
  color: var(--text-muted);
  cursor: pointer;
}

.toggle input[type="checkbox"] {
  accent-color: var(--primary);
}

.demo-output {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  max-height: 600px;
  overflow-y: auto;
}

.output-placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 100%;
  min-height: 300px;
  color: var(--text-muted);
}

.output-section {
  margin-bottom: 24px;
}

.output-section:last-child {
  margin-bottom: 0;
}

.output-section h4 {
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--primary-light);
  margin-bottom: 8px;
}

.output-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 8px;
}

.output-header h4 {
  margin-bottom: 0;
}

.copy-output-btn {
  background: var(--primary);
  color: white;
  border: none;
  padding: 4px 12px;
  border-radius: 6px;
  font-size: 0.75rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
}

.copy-output-btn:hover {
  background: var(--primary-dark);
}

.copy-output-btn.copied {
  background: var(--success);
}

.output-section p,
.output-section li {
  font-size: 0.9rem;
  color: var(--text-muted);
  line-height: 1.7;
}

.output-section ul {
  list-style: none;
  padding: 0;
}

.output-section li {
  padding: 6px 0;
  border-bottom: 1px solid rgba(45, 45, 61, 0.5);
}

.output-section li:last-child {
  border-bottom: none;
}

/* Pricing */
.pricing {
  padding: 80px 0;
}

.pricing-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
  align-items: start;
}

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

.price-card.popular {
  border-color: var(--primary);
  transform: scale(1.05);
}

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

.price-tier {
  font-size: 1rem;
  font-weight: 600;
  margin-bottom: 8px;
}

.price-amount {
  font-size: 2.5rem;
  font-weight: 800;
  margin-bottom: 24px;
}

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

.price-features {
  list-style: none;
  padding: 0;
  margin-bottom: 24px;
}

.price-features li {
  padding: 8px 0;
  font-size: 0.9rem;
  color: var(--text-muted);
  border-bottom: 1px solid rgba(45, 45, 61, 0.5);
}

.price-features li:last-child {
  border-bottom: none;
}

.price-features li::before {
  content: "\2713 ";
  color: var(--success);
  margin-right: 8px;
}

/* API Docs */
.api-docs {
  padding: 80px 0;
}

.api-section {
  margin-bottom: 40px;
}

.api-section h3 {
  font-size: 1.3rem;
  font-weight: 600;
  margin-bottom: 12px;
  color: var(--text);
}

.api-text {
  color: var(--text-muted);
  font-size: 0.95rem;
  margin-bottom: 16px;
}

.api-text code,
.format-list code,
.params-table code {
  background: rgba(99, 102, 241, 0.15);
  padding: 2px 6px;
  border-radius: 4px;
  font-size: 0.85rem;
  color: var(--primary-light);
}

.endpoint-badge {
  display: inline-block;
  background: rgba(16, 185, 129, 0.15);
  border: 1px solid rgba(16, 185, 129, 0.3);
  color: var(--success);
  padding: 4px 12px;
  border-radius: 6px;
  font-size: 0.85rem;
  font-weight: 600;
  font-family: monospace;
  margin-bottom: 12px;
}

.format-list {
  list-style: none;
  padding: 0;
}

.format-list li {
  padding: 6px 0;
  color: var(--text-muted);
  font-size: 0.9rem;
}

.format-list li code {
  margin-right: 8px;
}

.params-table {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}

.param-row {
  display: grid;
  grid-template-columns: 1fr 1fr 0.7fr 2fr;
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
  font-size: 0.85rem;
  color: var(--text-muted);
}

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

.param-row.header {
  background: rgba(99, 102, 241, 0.08);
  font-weight: 600;
  color: var(--text);
}

.method-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 32px;
}

.method-num {
  display: inline-block;
  background: var(--primary);
  color: white;
  font-size: 0.75rem;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: 12px;
  margin-bottom: 12px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.method-card h3 {
  margin-bottom: 8px;
}

.steps-simple {
  margin-top: 20px;
}

.simple-step {
  display: flex;
  gap: 16px;
  align-items: flex-start;
  padding: 16px 0;
  border-bottom: 1px solid var(--border);
}

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

.step-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 32px;
  height: 32px;
  background: var(--primary);
  border-radius: 50%;
  font-weight: 700;
  font-size: 0.85rem;
}

.simple-step div strong {
  display: block;
  margin-bottom: 4px;
  color: var(--text);
}

.simple-step div p {
  color: var(--text-muted);
  font-size: 0.9rem;
  margin: 0;
}

.url-code {
  display: inline-block;
  background: rgba(99, 102, 241, 0.1);
  padding: 4px 8px;
  border-radius: 4px;
  font-size: 0.8rem;
  color: var(--primary-light);
  margin-top: 4px;
  word-break: break-all;
}

.format-cards {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
}

.format-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
}

.format-icon {
  font-size: 1.5rem;
  margin-bottom: 8px;
}

.format-card h4 {
  margin-bottom: 8px;
  font-size: 1rem;
}

.format-card p {
  color: var(--text-muted);
  font-size: 0.85rem;
  line-height: 1.6;
}

.faq-list {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.faq-item {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px 24px;
}

.faq-item strong {
  display: block;
  margin-bottom: 8px;
  color: var(--text);
  font-size: 0.95rem;
}

.faq-item p {
  color: var(--text-muted);
  font-size: 0.9rem;
  margin: 0;
}

@media (max-width: 768px) {
  .format-cards {
    grid-template-columns: 1fr;
  }

  .param-row {
    grid-template-columns: 1fr 1fr;
    gap: 4px;
  }

  .param-row.header span:nth-child(3),
  .param-row.header span:nth-child(4),
  .param-row span:nth-child(3),
  .param-row span:nth-child(4) {
    display: none;
  }
}

.code-block {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  margin-bottom: 24px;
}

.code-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 16px;
  background: rgba(99, 102, 241, 0.1);
  border-bottom: 1px solid var(--border);
  font-size: 0.85rem;
  font-weight: 500;
}

.copy-btn {
  background: var(--primary);
  color: white;
  border: none;
  padding: 4px 12px;
  border-radius: 6px;
  font-size: 0.75rem;
  cursor: pointer;
}

.code-block pre {
  padding: 16px;
  overflow-x: auto;
  font-size: 0.85rem;
  line-height: 1.8;
}

.code-block code {
  color: var(--text-muted);
  font-family: 'JetBrains Mono', monospace;
}

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

.footer-inner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 24px;
}

.footer-brand p {
  color: var(--text-muted);
  font-size: 0.85rem;
  margin-top: 4px;
}

.footer-links {
  display: flex;
  gap: 24px;
}

.footer-links a {
  color: var(--text-muted);
  text-decoration: none;
  font-size: 0.9rem;
}

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

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

/* Loading state */
.loading {
  opacity: 0.7;
  pointer-events: none;
}

.spinner {
  display: inline-block;
  width: 16px;
  height: 16px;
  border: 2px solid rgba(255, 255, 255, 0.3);
  border-top-color: white;
  border-radius: 50%;
  animation: spin 0.6s linear infinite;
  margin-right: 8px;
  vertical-align: middle;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* Responsive */
@media (max-width: 768px) {
  .steps-grid,
  .pricing-grid,
  .demo-container {
    grid-template-columns: 1fr;
  }

  .price-card.popular {
    transform: none;
  }

  .hero-stats {
    gap: 24px;
  }

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

  .nav-links a:not(.btn) {
    display: none;
  }

  .footer-inner {
    flex-direction: column;
    gap: 16px;
    text-align: center;
  }
}
