:root {
  --bg: #0a0b0f;
  --bg-elevated: #12141c;
  --bg-card: #181b26;
  --text: #f4f5f7;
  --text-muted: #9aa3b2;
  --accent: #6c5ce7;
  --accent-hover: #7d6ff0;
  --accent-glow: rgba(108, 92, 231, 0.35);
  --green: #00d2a0;
  --border: rgba(255, 255, 255, 0.08);
  --radius: 16px;
  --radius-sm: 10px;
  --font: "Segoe UI", system-ui, -apple-system, sans-serif;
  --mono: "SF Mono", "Fira Code", "Consolas", monospace;
  --max-width: 1120px;
}

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

html {
  scroll-behavior: smooth;
}

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

a {
  color: inherit;
  text-decoration: none;
}

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

.container {
  width: min(100% - 2rem, var(--max-width));
  margin-inline: auto;
}

/* Header */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  backdrop-filter: blur(12px);
  background: rgba(10, 11, 15, 0.85);
  border-bottom: 1px solid var(--border);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 0;
  gap: 1rem;
}

.logo {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  font-weight: 700;
  font-size: 1.15rem;
  letter-spacing: -0.02em;
}

.logo-mark {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  background: linear-gradient(135deg, var(--accent), var(--green));
}

.nav-actions {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.lang-toggle {
  display: flex;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 3px;
}

.lang-btn {
  border: none;
  background: transparent;
  color: var(--text-muted);
  font: inherit;
  font-size: 0.8rem;
  font-weight: 600;
  padding: 0.35rem 0.75rem;
  border-radius: 999px;
  cursor: pointer;
  transition: color 0.2s, background 0.2s;
}

.lang-btn.active {
  background: var(--accent);
  color: #fff;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.75rem 1.35rem;
  border-radius: 999px;
  font: inherit;
  font-weight: 600;
  font-size: 0.95rem;
  border: none;
  cursor: pointer;
  transition: transform 0.15s, box-shadow 0.2s, background 0.2s;
}

.btn:hover {
  transform: translateY(-1px);
}

.btn-primary {
  background: linear-gradient(135deg, var(--accent), #8b5cf6);
  color: #fff;
  box-shadow: 0 4px 24px var(--accent-glow);
}

.btn-primary:hover {
  box-shadow: 0 8px 32px var(--accent-glow);
}

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

.btn-secondary:hover {
  background: var(--bg-elevated);
}

.btn-sm {
  padding: 0.5rem 1rem;
  font-size: 0.875rem;
}

/* Hero */
.hero {
  position: relative;
  padding: 5rem 0 4rem;
  overflow: hidden;
}

.hero::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse 80% 60% at 50% -10%, var(--accent-glow), transparent),
    radial-gradient(ellipse 50% 40% at 80% 20%, rgba(0, 210, 160, 0.12), transparent);
  pointer-events: none;
}

.hero-grid {
  position: relative;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 3rem;
  align-items: center;
}

.hero-badge {
  display: inline-block;
  padding: 0.35rem 0.85rem;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: 999px;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--green);
  margin-bottom: 1.25rem;
}

.hero h1 {
  font-size: clamp(2.25rem, 5vw, 3.5rem);
  font-weight: 800;
  line-height: 1.1;
  letter-spacing: -0.03em;
  margin-bottom: 1.25rem;
}

.hero-sub {
  font-size: 1.15rem;
  color: var(--text-muted);
  max-width: 32rem;
  margin-bottom: 2rem;
}

.hero-cta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.85rem;
}

.hero-visual {
  position: relative;
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid var(--border);
  box-shadow: 0 24px 64px rgba(0, 0, 0, 0.4);
}

/* Interactive demo widget */
.demo-widget {
  background: var(--bg-card);
  padding: 1.25rem;
}

.demo-widget-header {
  margin-bottom: 1rem;
}

.demo-quota {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--green);
  background: rgba(0, 210, 160, 0.1);
  border: 1px solid rgba(0, 210, 160, 0.25);
  padding: 0.4rem 0.85rem;
  border-radius: 999px;
}

.demo-quota.quota-exhausted {
  color: #ffb347;
  background: rgba(255, 179, 71, 0.1);
  border-color: rgba(255, 179, 71, 0.3);
}

.demo-dropzone {
  border: 2px dashed var(--border);
  border-radius: var(--radius-sm);
  padding: 2rem 1.5rem;
  text-align: center;
  cursor: pointer;
  transition: border-color 0.2s, background 0.2s;
  background: var(--bg-elevated);
}

.demo-dropzone:hover:not(.disabled),
.demo-dropzone.dragover {
  border-color: var(--accent);
  background: rgba(108, 92, 231, 0.08);
}

.demo-dropzone.disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.dropzone-icon {
  font-size: 2rem;
  display: block;
  margin-bottom: 0.75rem;
}

.dropzone-title {
  font-weight: 700;
  font-size: 1rem;
  margin-bottom: 0.35rem;
}

.dropzone-sub {
  color: var(--text-muted);
  font-size: 0.85rem;
}

.demo-status {
  min-height: 1.5rem;
  margin-top: 0.75rem;
  font-size: 0.875rem;
  color: var(--text-muted);
}

.demo-status--loading {
  color: var(--accent);
}

.demo-status--success {
  color: var(--green);
}

.demo-status--error,
.demo-status--limit {
  color: #ff6b6b;
}

.demo-results {
  margin-top: 1.25rem;
}

.demo-preview-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.75rem;
}

.demo-preview-pane {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.demo-preview-label {
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
}

.demo-preview-frame {
  aspect-ratio: 1;
  border-radius: var(--radius-sm);
  overflow: hidden;
  border: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
}

.demo-preview-frame img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.demo-preview-frame--photo {
  background: linear-gradient(160deg, #2d3748 0%, #4a5568 100%);
}

.demo-preview-frame--checker {
  background:
    linear-gradient(45deg, #1a1a2e 25%, transparent 25%),
    linear-gradient(-45deg, #1a1a2e 25%, transparent 25%),
    linear-gradient(45deg, transparent 75%, #1a1a2e 75%),
    linear-gradient(-45deg, transparent 75%, #1a1a2e 75%);
  background-size: 12px 12px;
  background-position: 0 0, 0 6px, 6px -6px, -6px 0;
  background-color: #12141c;
}

.demo-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-top: 1rem;
}

.demo-upgrade {
  margin-top: 1.25rem;
  padding: 1.25rem;
  background: linear-gradient(135deg, rgba(108, 92, 231, 0.15), rgba(0, 210, 160, 0.08));
  border: 1px solid rgba(108, 92, 231, 0.35);
  border-radius: var(--radius-sm);
}

.upgrade-content h3 {
  font-size: 1.05rem;
  font-weight: 700;
  margin-bottom: 0.5rem;
}

.upgrade-content p {
  color: var(--text-muted);
  font-size: 0.9rem;
  margin-bottom: 1rem;
}

.upgrade-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.demo-split {
  display: grid;
  grid-template-columns: 1fr 1fr;
  height: 100%;
}

.demo-before,
.demo-after {
  position: relative;
  display: flex;
  align-items: flex-end;
  padding: 1rem;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.demo-before {
  background: linear-gradient(160deg, #2d3748 0%, #4a5568 50%, #718096 100%);
}

.demo-after {
  background:
    linear-gradient(45deg, #1a1a2e 25%, transparent 25%),
    linear-gradient(-45deg, #1a1a2e 25%, transparent 25%),
    linear-gradient(45deg, transparent 75%, #1a1a2e 75%),
    linear-gradient(-45deg, transparent 75%, #1a1a2e 75%);
  background-size: 16px 16px;
  background-position: 0 0, 0 8px, 8px -8px, -8px 0;
  background-color: #12141c;
}

.demo-label {
  background: rgba(0, 0, 0, 0.5);
  padding: 0.3rem 0.6rem;
  border-radius: 6px;
}

.demo-divider {
  position: absolute;
  top: 0;
  left: 50%;
  width: 3px;
  height: 100%;
  background: var(--accent);
  transform: translateX(-50%);
  box-shadow: 0 0 12px var(--accent-glow);
}

/* Sections */
section {
  padding: 4.5rem 0;
}

.section-label {
  display: inline-block;
  font-size: 0.8rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--accent);
  margin-bottom: 0.75rem;
}

.section-title {
  font-size: clamp(1.75rem, 3vw, 2.25rem);
  font-weight: 800;
  letter-spacing: -0.02em;
  margin-bottom: 0.75rem;
}

.section-desc {
  color: var(--text-muted);
  max-width: 36rem;
  margin-bottom: 2.5rem;
}

.features-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.25rem;
}

.feature-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.75rem;
  transition: border-color 0.2s, transform 0.2s;
}

.feature-card:hover {
  border-color: rgba(108, 92, 231, 0.4);
  transform: translateY(-2px);
}

.feature-icon {
  width: 44px;
  height: 44px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.25rem;
  margin-bottom: 1rem;
  background: var(--bg-elevated);
}

.feature-card h3 {
  font-size: 1.1rem;
  font-weight: 700;
  margin-bottom: 0.5rem;
}

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

/* Pricing — subscription plans (loaded via pricing.js) */
.pricing-root {
  margin-top: 2.5rem;
}

.pricing-loading {
  color: var(--text-muted);
  text-align: center;
  padding: 3rem;
}

.plan-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem;
  max-width: 1100px;
}

.plan-card {
  position: relative;
  display: flex;
  flex-direction: column;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 1.75rem 1.5rem 1.5rem;
  backdrop-filter: blur(12px);
  transition: border-color 0.2s, transform 0.2s;
}

.plan-card:hover {
  border-color: rgba(255, 255, 255, 0.12);
  transform: translateY(-2px);
}

.plan-card--featured {
  border-color: rgba(139, 92, 246, 0.55);
  background: rgba(139, 92, 246, 0.06);
  box-shadow: 0 0 0 1px rgba(139, 92, 246, 0.25), 0 20px 50px rgba(0, 0, 0, 0.35);
}

.plan-badge {
  position: absolute;
  top: -0.65rem;
  left: 50%;
  transform: translateX(-50%);
  background: linear-gradient(135deg, #8b5cf6, #a855f7);
  color: #fff;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  padding: 0.3rem 0.75rem;
  border-radius: 999px;
  white-space: nowrap;
}

.plan-name {
  font-size: 1.25rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  margin-bottom: 0.35rem;
}

.plan-audience {
  font-size: 0.8rem;
  color: var(--text-muted);
  line-height: 1.4;
  min-height: 2.4em;
  margin-bottom: 1.25rem;
}

.plan-price {
  font-size: 2rem;
  font-weight: 800;
  letter-spacing: -0.03em;
  margin-bottom: 1rem;
}

.plan-price-period {
  font-size: 0.95rem;
  font-weight: 500;
  color: var(--text-muted);
  margin-left: 0.15rem;
}

.plan-features {
  list-style: none;
  flex: 1;
  margin: 0 0 1.25rem;
  padding: 0;
}

.plan-features li {
  font-size: 0.85rem;
  color: var(--text-muted);
  padding: 0.35rem 0 0.35rem 1.1rem;
  position: relative;
  line-height: 1.35;
}

.plan-features li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.65rem;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--green);
}

.plan-cta {
  display: block;
  text-align: center;
  padding: 0.75rem 1rem;
  border-radius: 12px;
  font-size: 0.875rem;
  font-weight: 600;
  text-decoration: none;
  color: var(--text);
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--border);
  transition: background 0.2s;
}

.plan-cta:hover {
  background: rgba(255, 255, 255, 0.1);
}

.plan-cta--primary {
  color: #fff;
  background: linear-gradient(135deg, #8b5cf6, #7c3aed);
  border-color: transparent;
}

.plan-cta--primary:hover {
  background: linear-gradient(135deg, #9d6fff, #8b5cf6);
}

.plan-soon {
  margin-top: 0.65rem;
  text-align: center;
  font-size: 0.72rem;
  color: var(--text-muted);
  opacity: 0.75;
}

.plan-cta:disabled {
  cursor: not-allowed;
  opacity: 0.55;
}

.plan-cta:disabled:hover {
  background: rgba(255, 255, 255, 0.06);
}

button.plan-cta {
  width: 100%;
  font: inherit;
  cursor: pointer;
}

.promo-banner {
  max-width: 1100px;
  margin: 0 0 1.5rem;
  padding: 0.85rem 1.25rem;
  border-radius: 14px;
  background: linear-gradient(135deg, rgba(139, 92, 246, 0.18), rgba(168, 85, 247, 0.1));
  border: 1px solid rgba(139, 92, 246, 0.4);
  color: var(--text);
  font-size: 0.9rem;
  font-weight: 600;
  text-align: center;
}

.checkout-status-banner {
  max-width: 1100px;
  margin: 0 0 1.5rem;
  padding: 0.85rem 1.25rem;
  border-radius: 14px;
  font-size: 0.9rem;
  font-weight: 600;
  text-align: center;
}

.checkout-status-banner--success {
  background: rgba(34, 197, 94, 0.12);
  border: 1px solid rgba(34, 197, 94, 0.4);
  color: #4ade80;
}

.checkout-status-banner--cancel {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--border);
  color: var(--text-muted);
}

/* Legacy pricing (deprecated) */
.pricing-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1.25rem;
  max-width: 720px;
}

.pricing-grid--three {
  grid-template-columns: repeat(3, 1fr);
  max-width: 960px;
}

.pricing-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 2rem;
}

.pricing-card.featured {
  border-color: var(--accent);
  box-shadow: 0 0 0 1px var(--accent), 0 8px 32px var(--accent-glow);
}

.pricing-tier {
  font-size: 0.8rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
  margin-bottom: 0.5rem;
}

.pricing-card h3 {
  font-size: 1.35rem;
  font-weight: 800;
  margin-bottom: 0.25rem;
}

.pricing-credits {
  font-size: 2rem;
  font-weight: 800;
  color: var(--green);
  margin: 1rem 0;
}

.pricing-credits span {
  font-size: 1rem;
  font-weight: 600;
  color: var(--text-muted);
}

.pricing-card ul {
  list-style: none;
  margin: 1.25rem 0;
}

.pricing-card li {
  color: var(--text-muted);
  font-size: 0.9rem;
  padding: 0.35rem 0;
  padding-left: 1.25rem;
  position: relative;
}

.pricing-card li::before {
  content: "✓";
  position: absolute;
  left: 0;
  color: var(--green);
  font-weight: 700;
}

.pricing-note {
  margin-top: 1.5rem;
  padding: 1rem 1.25rem;
  background: var(--bg-elevated);
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  color: var(--text-muted);
  font-size: 0.9rem;
}

/* Steps */
.steps {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.5rem;
}

.step {
  text-align: center;
  padding: 1.5rem;
}

.step-num {
  width: 48px;
  height: 48px;
  margin: 0 auto 1rem;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--accent), #8b5cf6);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 1.1rem;
}

.step h3 {
  font-size: 1.05rem;
  font-weight: 700;
  margin-bottom: 0.4rem;
}

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

/* Code */
.code-block {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}

.code-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.75rem 1.25rem;
  background: var(--bg-card);
  border-bottom: 1px solid var(--border);
  font-size: 0.8rem;
  color: var(--text-muted);
}

.copy-btn {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text-muted);
  font: inherit;
  font-size: 0.75rem;
  padding: 0.3rem 0.75rem;
  border-radius: 6px;
  cursor: pointer;
  transition: color 0.2s, border-color 0.2s;
}

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

.code-block pre {
  padding: 1.25rem;
  overflow-x: auto;
  font-family: var(--mono);
  font-size: 0.82rem;
  line-height: 1.7;
  color: #c9d1d9;
}

.code-block .cmd {
  color: var(--green);
}

.code-block .flag {
  color: #79c0ff;
}

.code-block .str {
  color: #a5d6ff;
}

/* Footer */
.site-footer {
  border-top: 1px solid var(--border);
  padding: 2.5rem 0;
  margin-top: 2rem;
}

.footer-inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

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

.footer-links {
  display: flex;
  gap: 1.5rem;
}

.footer-links a {
  color: var(--text-muted);
  font-size: 0.875rem;
  transition: color 0.2s;
}

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

/* Responsive */
@media (max-width: 900px) {
  .hero-grid {
    grid-template-columns: 1fr;
  }

  .hero-visual {
    max-width: 480px;
    margin: 0 auto;
  }

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

  .pricing-grid,
  .pricing-grid--three,
  .plan-grid {
    grid-template-columns: 1fr;
  }

  .demo-preview-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 600px) {
  .header-inner .btn-secondary.nav-docs {
    display: none;
  }

  .hero {
    padding-top: 3rem;
  }

  .hero-cta {
    flex-direction: column;
  }

  .hero-cta .btn {
    width: 100%;
  }
}
