:root {
  --primary: #7c3aed;
  --primary-hover: #6d28d9;
  --primary-soft: #f5f3ff;
  --cta: #7c3aed;
  --cta-hover: #6d28d9;
  --ink: #0f172a;
  --ink-soft: #475569;
  --ink-mute: #64748b;
  --border: #e2e8f0;
  --border-strong: #cbd5e1;
  --surface: #ffffff;
  --surface-alt: #f8fafc;
  --error-bg: #fef2f2;
  --error-ink: #b91c1c;
  --error-border: #fecaca;
  --shadow-sm: 0 1px 2px rgba(15, 23, 42, 0.04);
  --shadow-md: 0 1px 3px rgba(15, 23, 42, 0.06), 0 1px 2px rgba(15, 23, 42, 0.04);
  --shadow-lg: 0 10px 24px rgba(15, 23, 42, 0.08), 0 2px 6px rgba(15, 23, 42, 0.04);
  --radius-sm: 6px;
  --radius-md: 8px;
  --radius-lg: 12px;
  --radius-xl: 16px;
  --font-sans: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Monaco, Consolas, monospace;
}

* { box-sizing: border-box; }

html {
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-size-adjust: 100%;
}

body {
  margin: 0;
  background: var(--surface);
  color: var(--ink);
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.55;
}

a {
  color: var(--primary);
  text-decoration: none;
  transition: color 0.15s ease;
}

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

h1, h2, h3, h4 {
  margin: 0;
  font-weight: 600;
  letter-spacing: -0.01em;
  color: var(--ink);
}

h1 { font-size: 44px; line-height: 1.15; letter-spacing: -0.025em; }
h2 { font-size: 28px; line-height: 1.25; letter-spacing: -0.02em; }
h3 { font-size: 18px; line-height: 1.4; }

p { margin: 0; color: var(--ink-soft); }

code {
  font-family: var(--font-mono);
  font-size: 13px;
  background: var(--surface-alt);
  padding: 2px 6px;
  border-radius: var(--radius-sm);
  color: var(--ink);
}

pre {
  font-family: var(--font-mono);
  font-size: 12px;
  background: var(--surface-alt);
  border: 1px solid var(--border);
  padding: 14px 16px;
  border-radius: var(--radius-md);
  overflow-x: auto;
  margin: 0;
  color: var(--ink);
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: 1px solid transparent;
  border-radius: var(--radius-md);
  padding: 12px 22px;
  font-family: inherit;
  font-size: 15px;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease, transform 0.05s ease;
  text-decoration: none;
  white-space: nowrap;
}

.btn-primary {
  background: var(--cta);
  color: #ffffff;
  border-color: var(--cta);
  box-shadow: var(--shadow-sm);
}

.btn-primary:hover {
  background: var(--cta-hover);
  border-color: var(--cta-hover);
  color: #ffffff;
}

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

.btn-secondary {
  background: var(--surface);
  color: var(--ink);
  border-color: var(--border-strong);
}

.btn-secondary:hover {
  background: var(--surface-alt);
  color: var(--ink);
}

.btn-ghost {
  background: transparent;
  color: var(--primary);
  padding: 10px 12px;
}

.btn-ghost:hover {
  background: var(--primary-soft);
  color: var(--primary-hover);
}

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

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

.site-header {
  position: sticky;
  top: 0;
  z-index: 10;
  background: rgba(255, 255, 255, 0.85);
  backdrop-filter: saturate(140%) blur(8px);
  border-bottom: 1px solid var(--border);
}

.site-header .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 64px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-weight: 600;
  font-size: 17px;
  color: var(--ink);
  letter-spacing: -0.01em;
}

.brand-mark {
  width: 28px;
  height: 28px;
  border-radius: 7px;
  background: linear-gradient(135deg, var(--primary), #a78bfa);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #ffffff;
  font-weight: 700;
  font-size: 14px;
}

.brand-logo {
  width: 32px;
  height: 32px;
  object-fit: contain;
  flex-shrink: 0;
}

.site-footer .footer-brand {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  margin-bottom: 12px;
}

.site-footer .footer-brand img {
  width: 28px;
  height: 28px;
}

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

.nav-links a:not(.btn) {
  color: var(--ink-soft);
  font-size: 14px;
  font-weight: 500;
  padding: 8px 12px;
  border-radius: var(--radius-sm);
}

.nav-links a:not(.btn):hover {
  color: var(--ink);
  background: var(--surface-alt);
}

.hero {
  padding: 96px 0 72px;
  text-align: center;
  background:
    radial-gradient(circle at 18% 0%, rgba(124, 58, 237, 0.10), transparent 50%),
    radial-gradient(circle at 82% 0%, rgba(167, 139, 250, 0.08), transparent 50%);
}

.hero-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--primary-soft);
  color: var(--primary);
  font-size: 13px;
  font-weight: 500;
  padding: 6px 12px;
  border-radius: 999px;
  margin-bottom: 20px;
  letter-spacing: 0;
}

.hero h1 {
  max-width: 820px;
  margin: 0 auto 18px;
}

.hero p.lede {
  max-width: 640px;
  margin: 0 auto 32px;
  font-size: 18px;
  color: var(--ink-soft);
  line-height: 1.55;
}

.hero-actions {
  display: inline-flex;
  gap: 12px;
  flex-wrap: wrap;
  justify-content: center;
}

.hero-demo {
  margin-top: 56px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-lg);
  overflow: hidden;
  max-width: 880px;
  margin-left: auto;
  margin-right: auto;
}

.hero-demo-bar {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 12px 16px;
  background: var(--surface-alt);
  border-bottom: 1px solid var(--border);
}

.hero-demo-bar span {
  width: 11px;
  height: 11px;
  border-radius: 50%;
  background: var(--border-strong);
}

.hero-demo-body {
  display: grid;
  grid-template-columns: 1fr 1fr;
  min-height: 280px;
}

.hero-demo-sheet, .hero-demo-form {
  padding: 20px;
  text-align: left;
}

.hero-demo-sheet {
  background: var(--surface-alt);
  border-right: 1px solid var(--border);
}

.hero-demo-label {
  font-size: 11px;
  font-weight: 600;
  color: var(--ink-mute);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: 10px;
}

.demo-table {
  font-family: var(--font-mono);
  font-size: 12px;
  width: 100%;
  border-collapse: collapse;
}

.demo-table th, .demo-table td {
  padding: 6px 10px;
  border: 1px solid var(--border);
  text-align: left;
  background: var(--surface);
}

.demo-table th {
  background: var(--primary-soft);
  color: var(--primary);
  font-weight: 600;
}

.demo-form-field {
  margin-bottom: 16px;
}

.demo-form-field label {
  display: block;
  font-size: 12px;
  color: var(--ink-mute);
  margin-bottom: 4px;
}

.demo-form-field .field-box {
  background: var(--surface);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  padding: 8px 10px;
  font-size: 13px;
  color: var(--ink);
}

.demo-arrow {
  position: relative;
  color: var(--cta);
  font-size: 11px;
  font-weight: 600;
  margin-bottom: 8px;
}

.section {
  padding: 80px 0;
}

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

.section-header {
  text-align: center;
  margin-bottom: 48px;
}

.section-header h2 {
  margin-bottom: 12px;
}

.section-header p {
  max-width: 600px;
  margin: 0 auto;
  font-size: 17px;
}

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

.step-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 28px;
  box-shadow: var(--shadow-sm);
}

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

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

.use-cases {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 20px;
}

.use-case {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 24px;
}

.use-case h3 {
  margin-bottom: 8px;
  font-size: 16px;
}

.use-case p {
  font-size: 14px;
  color: var(--ink-soft);
  margin-bottom: 12px;
}

.use-case-prompt {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--ink-mute);
  background: var(--surface-alt);
  padding: 8px 12px;
  border-radius: var(--radius-sm);
  border-left: 3px solid var(--primary);
}

.cta-band {
  background:
    linear-gradient(135deg, rgba(124, 58, 237, 0.08), rgba(167, 139, 250, 0.06)),
    var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  padding: 48px;
  text-align: center;
  margin: 0 auto;
  max-width: 720px;
}

.cta-band h2 { margin-bottom: 12px; }

.cta-band p {
  margin-bottom: 28px;
  font-size: 16px;
}

.site-footer {
  border-top: 1px solid var(--border);
  padding: 32px 0;
  text-align: center;
  color: var(--ink-mute);
  font-size: 13px;
}

.site-footer a {
  color: var(--ink-soft);
  margin: 0 8px;
}

.site-footer .footer-copyright a {
  margin: 0;
}

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

.hero-eyebrow:hover {
  color: var(--primary-hover);
}

@media (max-width: 768px) {
  h1 { font-size: 32px; }
  h2 { font-size: 24px; }
  .hero { padding: 64px 0 48px; }
  .hero p.lede { font-size: 16px; }
  .section { padding: 56px 0; }
  .steps { grid-template-columns: 1fr; }
  .use-cases { grid-template-columns: 1fr; }
  .hero-demo-body { grid-template-columns: 1fr; }
  .hero-demo-sheet { border-right: 0; border-bottom: 1px solid var(--border); }
  .nav-links { display: none; }
  .cta-band { padding: 32px 20px; }
}

.connect-page {
  background: var(--surface-alt);
  min-height: 100vh;
  padding: 56px 16px;
}

.connect-card {
  max-width: 480px;
  margin: 0 auto;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 36px;
  box-shadow: var(--shadow-md);
}

.connect-card h1 {
  font-size: 24px;
  margin-bottom: 8px;
}

.connect-card .subtitle {
  margin: 0 0 28px;
  font-size: 15px;
  color: var(--ink-soft);
}

.step {
  margin-top: 8px;
}

.step .btn { width: 100%; }

.hidden { display: none; }

.hint {
  margin-top: 14px;
  font-size: 13px;
  color: var(--ink-mute);
}

.spinner {
  width: 22px;
  height: 22px;
  border: 2.5px solid var(--border);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  margin: 12px auto 0;
}

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

.success-icon {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: rgba(124, 58, 237, 0.12);
  color: var(--cta);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 16px;
  font-size: 22px;
  font-weight: 700;
}

.error {
  margin-top: 16px;
  padding: 12px 14px;
  background: var(--error-bg);
  border: 1px solid var(--error-border);
  border-radius: var(--radius-md);
  color: var(--error-ink);
  font-size: 14px;
}

.connect-back-link {
  display: inline-block;
  margin-top: 20px;
  font-size: 13px;
  color: var(--ink-mute);
}

.connect-back-link:hover { color: var(--primary); }
