
:root {
  --bg: #f7f5f8;
  --surface: #ffffff;
  --surface-2: #0f172a;
  --text: #0f172a;
  --muted: #475569;
  --line: #e2e8f0;
  --primary: #833cf6;
  --primary-strong: #7429ef;
  --primary-soft: rgba(131, 60, 246, 0.12);
  --action: #833cf6;
  --gradient-start: #ffffff;
  --gradient-end: #f2eef8;
  --header-bg: rgba(247, 245, 248, 0.88);
  --soft-surface: #f9fafc;
  --hover-surface: #eef2ff;
  --switch-off: #64748b;
  --shadow: rgba(15, 23, 42, 0.1);
  color-scheme: light;
}

/* Native switches control the real page; no script or API dependency. */
:root:has(#demo-dark:checked) {
  --bg: #10121c;
  --surface: #191c2b;
  --text: #f1f2fa;
  --muted: #b6bdd2;
  --line: #35394d;
  --primary: #bb9aff;
  --primary-strong: #7429ef;
  --primary-soft: rgba(187, 154, 255, 0.13);
  --gradient-start: #222035;
  --gradient-end: #151322;
  --header-bg: rgba(16, 18, 28, 0.9);
  --soft-surface: #202335;
  --hover-surface: #29263f;
  --switch-off: #69758e;
  --shadow: rgba(0, 0, 0, 0.3);
  color-scheme: dark;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
  min-height: 100%;
  font-family: Inter, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  color: var(--text);
  background: radial-gradient(circle at 10% -10%, var(--gradient-start) 0%, var(--bg) 45%, var(--gradient-end) 100%);
}

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

.page {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.container {
  width: min(1120px, 100% - 40px);
  margin: 0 auto;
}

.header {
  position: sticky;
  top: 0;
  z-index: 20;
  backdrop-filter: blur(12px);
  background: var(--header-bg);
  border-bottom: 1px solid rgba(131, 60, 246, 0.12);
}

.header-inner {
  height: 78px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-weight: 800;
  font-size: 22px;
}

.brand-mark {
  width: 40px;
  height: 40px;
  border-radius: 12px;
  display: grid;
  place-items: center;
  color: #fff;
  background: var(--action);
  box-shadow: 0 8px 24px rgba(131, 60, 246, 0.35);
  font-weight: 700;
}

.nav {
  display: inline-flex;
  align-items: center;
  gap: 30px;
  font-size: 14px;
  font-weight: 600;
  color: var(--muted);
}

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

.header-actions {
  display: inline-flex;
  align-items: center;
  gap: 12px;
}

.btn {
  border: 0;
  border-radius: 12px;
  padding: 11px 18px;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}

.btn-primary {
  color: #fff;
  background: var(--action);
  box-shadow: 0 12px 24px rgba(131, 60, 246, 0.28);
}

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

.btn-ghost {
  color: var(--muted);
  background: transparent;
}

.btn-ghost:hover {
  background: var(--hover-surface);
}

.hero {
  padding: 56px 0 88px;
}

.hero-grid {
  display: grid;
  gap: 44px;
  grid-template-columns: 1.1fr 0.9fr;
  align-items: center;
}

.pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  width: fit-content;
  padding: 8px 12px;
  border-radius: 999px;
  background: var(--primary-soft);
  color: var(--primary);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.pill-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--action);
}

.hero h1 {
  margin: 22px 0 20px;
  font-size: clamp(38px, 5.4vw, 72px);
  line-height: 1.08;
  letter-spacing: -0.03em;
}

.hero h1 span {
  color: var(--primary);
}

.lead {
  margin: 0;
  max-width: 620px;
  color: var(--muted);
  font-size: clamp(17px, 2.2vw, 22px);
  line-height: 1.6;
}

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

.btn-secondary {
  border: 2px solid var(--line);
  background: var(--surface);
  color: var(--text);
}

.btn-secondary:hover {
  background: var(--soft-surface);
}

.hero-meta {
  margin-top: 22px;
  display: flex;
  gap: 20px;
  flex-wrap: wrap;
  color: var(--muted);
  font-size: 14px;
  font-weight: 600;
}

.hero-meta span {
  display: inline-flex;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  align-items: center;
  justify-content: center;
  margin-right: 6px;
  color: #fff;
  background: #16a34a;
  font-size: 12px;
}

.site-demo {
  position: relative;
  min-width: 0;
  width: 100%;
  max-width: 500px;
  margin: 0 auto;
  padding: 30px;
  border: 1px solid var(--line);
  border-radius: 24px;
  background: var(--surface);
  box-shadow: 0 24px 64px var(--shadow);
  scroll-margin-top: 20px;
}
.demo-eyebrow { display: flex; align-items: center; gap: 8px; color: var(--primary); font-size: 12px; font-weight: 700; }
.site-demo h2 { margin: 18px 0 12px; font-size: clamp(30px, 3.2vw, 42px); line-height: 1.1; letter-spacing: -0.035em; }
.demo-intro { margin: 0 0 24px; color: var(--muted); font-size: 15px; line-height: 1.65; }
.demo-flag { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 76px; padding: 14px; margin-top: 10px; border: 1px solid var(--line); border-radius: 14px; background: var(--soft-surface); cursor: pointer; }
.demo-flag:hover, .demo-flag:has(input:checked) { border-color: var(--primary); }
.demo-flag:has(input:checked) { background: var(--primary-soft); }
.demo-flag-copy { min-width: 0; display: grid; gap: 6px; }
.demo-flag-title { color: var(--text); font-size: 14px; font-weight: 650; }
.demo-flag code { color: var(--muted); font-size: 11px; overflow-wrap: anywhere; }
.demo-flag-action { position: relative; display: flex; align-items: center; gap: 8px; flex-shrink: 0; }
.demo-flag-action input { position: absolute; right: 0; top: 0; width: 44px; height: 26px; margin: 0; opacity: 0; cursor: pointer; }
.demo-flag-state { color: var(--muted); font-size: 11px; width: 30px; text-align: right; }
.demo-on { display: none; color: var(--primary); }
.demo-switch { display: block; width: 44px; height: 26px; padding: 3px; background: var(--switch-off); border-radius: 99px; pointer-events: none; }
.demo-switch::after { content: ''; display: block; width: 20px; height: 20px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px #0003; transition: transform 0.2s ease; }
.demo-flag input:checked ~ .demo-switch { background: var(--action); }
.demo-flag input:checked ~ .demo-switch::after { transform: translateX(18px); }
.demo-flag input:checked ~ .demo-flag-state .demo-off { display: none; }
.demo-flag input:checked ~ .demo-flag-state .demo-on { display: inline; }
.demo-flag input:focus-visible ~ .demo-switch { outline: 3px solid var(--primary); outline-offset: 4px; }
.demo-result { display: flex; align-items: flex-start; gap: 10px; margin-top: 24px; padding-top: 20px; border-top: 1px solid var(--line); }
.demo-result-icon { color: var(--primary); font-size: 24px; line-height: 1; }
.demo-result p { margin: 0; font-size: 12px; line-height: 1.65; }
.demo-result strong, .demo-result p > span { display: block; }
.demo-result p > span { color: var(--muted); }
.demo-values { display: flex; flex-wrap: wrap; gap: 8px 16px; padding-top: 18px; color: var(--muted); font-size: 10px; }
.demo-values code > span { color: var(--primary); }
.demo-dark-true, .demo-header-true { display: none; }
:root:has(#demo-dark:checked) .demo-dark-false,
:root:has(#demo-header:checked) .demo-header-false { display: none; }
:root:has(#demo-dark:checked) .demo-dark-true,
:root:has(#demo-header:checked) .demo-header-true { display: inline; }

.brand-name { display: grid; gap: 3px; }
.header-version, .cta-compact { display: none; }
:root:has(#demo-header:checked) .header { padding: 6px 0; background: transparent; border-bottom-color: transparent; }
:root:has(#demo-header:checked) .header-inner { height: 66px; padding: 0 18px; border: 1px solid var(--primary); border-radius: 22px; background: var(--surface); box-shadow: 0 10px 30px var(--shadow); }
:root:has(#demo-header:checked) .header .brand-mark { transform: rotate(-8deg); border-radius: 14px 14px 5px 14px; background: linear-gradient(135deg, #6d28d9, #a855f7); }
:root:has(#demo-header:checked) .header-version { display: block; color: var(--primary); font-size: 8px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.08em; }
:root:has(#demo-header:checked) .nav { gap: 18px; padding: 12px 16px; border-radius: 14px; background: var(--primary-soft); }
.header, .header-inner, .brand-mark, .site-demo, .demo-flag, .feature, .price, .footer, .section-light, .btn-secondary {
  transition: background-color 0.2s ease, color 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
}

.section {
  padding: 88px 0;
}

.section-light {
  background: var(--surface);
}

.section-accent {
  background: linear-gradient(180deg, rgba(131, 60, 246, 0.08), rgba(131, 60, 246, 0.02));
}

.section-title {
  margin: 0;
  font-size: clamp(32px, 3.5vw, 52px);
  letter-spacing: -0.02em;
}

.section-kicker {
  margin: 0 0 12px;
  color: var(--primary);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.2em;
  text-transform: uppercase;
}

.section-subtitle {
  margin: 14px 0 0;
  color: var(--muted);
  font-size: 18px;
}

.center {
  text-align: center;
}

.features-grid {
  margin-top: 44px;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 20px;
}

.feature {
  border: 1px solid var(--line);
  border-radius: 18px;
  background: var(--soft-surface);
  padding: 26px;
}

.feature-icon {
  width: 52px;
  height: 52px;
  border-radius: 14px;
  display: grid;
  place-items: center;
  background: var(--primary-soft);
  color: var(--primary);
  font-weight: 700;
}

.feature h3 {
  margin: 16px 0 8px;
  font-size: 22px;
}

.feature p {
  margin: 0;
  color: var(--muted);
  line-height: 1.6;
}

.workflow-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 36px;
  align-items: center;
}

.code-card {
  min-width: 0;
  border-radius: 18px;
  overflow: hidden;
  background: #0f172a;
  box-shadow: 0 26px 44px rgba(2, 6, 23, 0.38);
}

.code-top {
  padding: 11px 14px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  background: #1e293b;
  color: #94a3b8;
  font-size: 12px;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, 'Liberation Mono', 'Courier New', monospace;
}

.code {
  overflow-x: auto;
  margin: 0;
  padding: 18px;
  color: #cbd5e1;
  font-size: 14px;
  line-height: 1.65;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, 'Liberation Mono', 'Courier New', monospace;
}

.code .kw {
  color: #60a5fa;
}

.code .fn {
  color: #facc15;
}

.code .str {
  color: #4ade80;
}

.check-list {
  margin: 24px 0 0;
  padding: 0;
  list-style: none;
  display: grid;
  gap: 12px;
}

.check-list li {
  display: flex;
  gap: 10px;
}

.check-list b {
  display: block;
  margin-bottom: 2px;
}

.check {
  margin-top: 3px;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  color: var(--primary);
  background: var(--primary-soft);
  font-size: 13px;
  font-weight: 700;
}

.pricing-grid {
  margin-top: 42px;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 20px;
}

.price {
  border: 1px solid var(--line);
  border-radius: 18px;
  background: var(--surface);
  padding: 28px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.price.featured {
  border-width: 2px;
  border-color: var(--primary);
  position: relative;
  box-shadow: 0 20px 40px rgba(131, 60, 246, 0.18);
}

.price-badge {
  position: absolute;
  left: 50%;
  top: -12px;
  transform: translateX(-50%);
  border-radius: 999px;
  background: var(--action);
  color: #fff;
  padding: 6px 11px;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.price h3 {
  margin: 0;
  font-size: 24px;
}

.price-value {
  margin: 0;
  font-size: 44px;
  font-weight: 800;
  letter-spacing: -0.03em;
}

.price-value small {
  font-size: 16px;
  color: var(--muted);
  font-weight: 600;
}

.price p {
  margin: 0;
  color: var(--muted);
}

.price ul {
  margin: 14px 0 0;
  padding: 0;
  list-style: none;
  display: grid;
  gap: 10px;
  color: var(--muted);
}

.price li::before {
  content: '✓';
  margin-right: 8px;
  color: var(--primary);
  font-weight: 700;
}

.price .btn {
  margin-top: 14px;
  width: 100%;
}

.footer {
  border-top: 1px solid var(--line);
  background: var(--surface);
  padding: 48px 0 34px;
}

.footer-grid {
  display: grid;
  grid-template-columns: 1.5fr 1fr 1fr 1fr;
  gap: 26px;
}

.footer h4 {
  margin: 0 0 12px;
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.footer p,
.footer a,
.footer li {
  font-size: 14px;
  color: var(--muted);
}

.footer ul {
  margin: 0;
  padding: 0;
  list-style: none;
  display: grid;
  gap: 8px;
}

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

.footer-bottom {
  margin-top: 30px;
  border-top: 1px solid var(--line);
  padding-top: 20px;
  text-align: center;
  color: var(--muted);
  font-size: 14px;
}

@media (max-width: 1000px) {
  .nav {
    display: none;
  }

  .hero-grid,
  .workflow-grid,
  .features-grid,
  .pricing-grid,
  .footer-grid {
    grid-template-columns: 1fr;
  }

  .section {
    padding: 70px 0;
  }

  .footer-grid {
    gap: 20px;
  }
}

@media (max-width: 640px) {
  .site-demo { padding: 22px; }
  .container {
    width: min(1120px, 100% - 26px);
  }

  .header-inner {
    height: 72px;
  }

  :root:has(#demo-header:checked) .header-inner { height: 60px; padding-inline: 12px; }

  .header-actions .btn-ghost {
    display: none;
  }

  .hero {
    padding-top: 44px;
  }

  .hero-meta {
    gap: 10px;
    font-size: 13px;
  }
}

.btn { display: inline-flex; align-items: center; justify-content: center; text-align: center; }
:focus-visible { outline: 3px solid var(--primary); outline-offset: 4px; }
html { scroll-padding-top: 96px; }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; } }

@media (max-width: 480px) {
  .header-inner { gap: 10px; }
  .header .brand { gap: 8px; font-size: 20px; }
  .header .brand-mark { width: 34px; height: 34px; font-size: 14px; }
  .cta-full { display: none; }
  .cta-compact { display: inline; }
  .site-demo { padding: 20px; }
  .demo-flag { padding: 12px 10px; gap: 8px; }
  .demo-flag-title { font-size: 13px; }
  .demo-flag-action { gap: 5px; }
}
