:root {
  --bg: #ffffff;
  --bg-alt: #f7f8fb;
  --text: #14151a;
  --text-muted: #5b5f6d;
  --border: #e6e8ee;
  --primary: #4f46e5;
  --primary-dark: #4338ca;
  --primary-light: #eef0ff;
  --accent: #7c3aed;
  --radius: 14px;
  --shadow: 0 1px 2px rgba(16, 18, 30, 0.04), 0 8px 24px rgba(16, 18, 30, 0.06);
  --shadow-lg: 0 20px 50px rgba(16, 18, 30, 0.12);
  --max-width: 1160px;
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0d0e14;
    --bg-alt: #14151f;
    --text: #f3f4f8;
    --text-muted: #9ca0b0;
    --border: #24262f;
    --primary: #818cf8;
    --primary-dark: #6366f1;
    --primary-light: #1c1d2c;
    --accent: #a78bfa;
    --shadow: 0 1px 2px rgba(0, 0, 0, 0.3), 0 8px 24px rgba(0, 0, 0, 0.35);
    --shadow-lg: 0 20px 50px rgba(0, 0, 0, 0.45);
    color-scheme: dark;
  }
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

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

.container {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 24px;
}

.container-narrow { max-width: 760px; }

h1, h2, h3, h4 {
  font-weight: 800;
  line-height: 1.15;
  margin: 0 0 16px;
  letter-spacing: -0.02em;
}

h2 { font-size: clamp(1.8rem, 3vw, 2.4rem); }
h3 { font-size: 1.15rem; }

p { color: var(--text-muted); margin: 0 0 16px; }

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

ul { padding: 0; margin: 0; list-style: none; }

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--primary);
  background: var(--primary-light);
  padding: 6px 14px;
  border-radius: 999px;
  margin-bottom: 16px;
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 20px;
  border-radius: 10px;
  font-weight: 600;
  font-size: 0.95rem;
  border: 1px solid transparent;
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.15s ease, background 0.15s ease, border-color 0.15s ease;
  white-space: nowrap;
}
.btn:hover { transform: translateY(-1px); }

.btn-primary {
  background: linear-gradient(135deg, var(--primary), var(--accent));
  color: #fff;
  box-shadow: 0 6px 16px rgba(79, 70, 229, 0.3);
}
.btn-primary:hover { box-shadow: 0 10px 24px rgba(79, 70, 229, 0.4); }

.btn-outline {
  background: transparent;
  border-color: var(--border);
  color: var(--text);
}
.btn-outline:hover { border-color: var(--primary); color: var(--primary); }

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

.btn-lg { padding: 14px 28px; font-size: 1.02rem; }
.btn-block { width: 100%; margin-top: 8px; }

.play-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 18px; height: 18px;
  font-size: 0.6rem;
  background: var(--primary-light);
  color: var(--primary);
  border-radius: 50%;
}

/* Header */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: color-mix(in srgb, var(--bg) 85%, transparent);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 16px;
  padding-bottom: 16px;
  gap: 24px;
}

.logo {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 800;
  font-size: 1.15rem;
}

.logo-mark {
  width: 26px; height: 26px;
  border-radius: 8px;
  background: linear-gradient(135deg, var(--primary), var(--accent));
  box-shadow: 0 4px 10px rgba(79, 70, 229, 0.35);
}

.nav {
  display: flex;
  gap: 28px;
  flex: 1;
  justify-content: center;
}

.nav a {
  color: var(--text-muted);
  font-weight: 500;
  font-size: 0.95rem;
  transition: color 0.15s ease;
}
.nav a:hover { color: var(--text); }

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

.menu-toggle {
  display: none;
  flex-direction: column;
  gap: 4px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 8px;
}
.menu-toggle span {
  width: 22px; height: 2px;
  background: var(--text);
  border-radius: 2px;
}

/* Hero */
.hero { padding: 72px 0 0; position: relative; overflow: hidden; }

.hero-inner {
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: 48px;
  align-items: center;
  padding-bottom: 64px;
}

.hero h1 {
  font-size: clamp(2.4rem, 5vw, 3.6rem);
}

.lead {
  font-size: 1.15rem;
  max-width: 520px;
}

.hero-actions {
  display: flex;
  gap: 14px;
  flex-wrap: wrap;
  margin: 28px 0 14px;
}

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

.hero-visual {
  position: relative;
  height: 380px;
}

.hero-glow {
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at 70% 30%, rgba(124, 58, 237, 0.25), transparent 60%);
  filter: blur(10px);
  z-index: 0;
}

.hero-card {
  position: absolute;
  width: 260px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  padding: 20px;
  z-index: 1;
}

.card-a { top: 10px; left: 20px; transform: rotate(-4deg); }
.card-b { bottom: 10px; right: 0; transform: rotate(3deg); }

.hc-dot {
  width: 14px; height: 14px;
  border-radius: 50%;
  margin-bottom: 14px;
}
.dot-green { background: #22c55e; }
.dot-purple { background: var(--accent); }

.hc-line {
  height: 9px;
  border-radius: 6px;
  background: var(--border);
  margin-bottom: 9px;
}
.w-70 { width: 70%; } .w-40 { width: 40%; }
.w-60 { width: 60%; } .w-90 { width: 90%; } .w-30 { width: 30%; }

.logo-strip {
  display: flex;
  align-items: center;
  gap: 24px;
  flex-wrap: wrap;
  padding: 28px 24px;
  border-top: 1px solid var(--border);
  color: var(--text-muted);
  font-size: 0.85rem;
}

.logo-strip-marks {
  display: flex;
  gap: 32px;
  flex-wrap: wrap;
  font-weight: 700;
  color: var(--text);
  opacity: 0.55;
}

/* Sections */
section { padding: 88px 0; }

.section-head {
  text-align: center;
  max-width: 620px;
  margin: 0 auto 48px;
}
.section-head p { font-size: 1.05rem; }

.features, .how-it-works { background: var(--bg-alt); }

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

.feature-card {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 28px;
  box-shadow: var(--shadow);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.feature-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-lg); }

.feature-icon {
  width: 46px; height: 46px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.3rem;
  background: var(--primary-light);
  border-radius: 10px;
  margin-bottom: 16px;
}

.feature-card p { margin: 0; }

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

.step { text-align: center; padding: 0 12px; }

.step-number {
  width: 40px; height: 40px;
  margin: 0 auto 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--primary), var(--accent));
  color: #fff;
  font-weight: 700;
}

.step p { margin: 0; }

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

.testimonial {
  margin: 0;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 28px;
  box-shadow: var(--shadow);
}

.testimonial p {
  color: var(--text);
  font-size: 1.02rem;
  margin-bottom: 20px;
}

.testimonial footer {
  display: flex;
  align-items: center;
  gap: 12px;
}

.avatar {
  width: 40px; height: 40px;
  border-radius: 50%;
  background: var(--primary-light);
  color: var(--primary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.8rem;
  flex-shrink: 0;
}

.testimonial cite {
  font-style: normal;
  font-weight: 700;
  display: block;
  font-size: 0.92rem;
}
.testimonial footer span { font-size: 0.82rem; color: var(--text-muted); }

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

.price-card {
  position: relative;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 32px 28px;
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
}

.price-card.featured {
  border-color: var(--primary);
  box-shadow: var(--shadow-lg);
  transform: scale(1.03);
}

.badge {
  position: absolute;
  top: -13px;
  left: 50%;
  transform: translateX(-50%);
  background: linear-gradient(135deg, var(--primary), var(--accent));
  color: #fff;
  font-size: 0.75rem;
  font-weight: 700;
  padding: 5px 14px;
  border-radius: 999px;
}

.price {
  font-size: 2.4rem;
  font-weight: 800;
  color: var(--text);
  margin: 4px 0 0;
}
.price span { font-size: 0.95rem; font-weight: 500; color: var(--text-muted); }

.price-desc { font-size: 0.9rem; margin-bottom: 20px; }

.price-card ul { margin-bottom: 24px; flex: 1; }

.price-card li {
  padding: 8px 0;
  font-size: 0.92rem;
  border-top: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: 8px;
}
.price-card li:first-child { border-top: none; }
.price-card li::before {
  content: "✓";
  color: var(--primary);
  font-weight: 700;
}

/* FAQ */
.faq-item {
  border-bottom: 1px solid var(--border);
  padding: 18px 0;
}
.faq-item summary {
  cursor: pointer;
  font-weight: 600;
  font-size: 1.02rem;
  list-style: none;
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.faq-item summary::-webkit-details-marker { display: none; }
.faq-item summary::after {
  content: "+";
  font-size: 1.3rem;
  color: var(--primary);
  transition: transform 0.2s ease;
}
.faq-item[open] summary::after { transform: rotate(45deg); }
.faq-item p { margin: 12px 0 0; }

/* CTA */
.cta {
  background: linear-gradient(135deg, var(--primary), var(--accent));
  border-radius: 24px;
  margin: 0 24px 88px;
  color: #fff;
}
.cta-inner {
  text-align: center;
  max-width: 620px;
}
.cta h2 { color: #fff; }
.cta p { color: rgba(255,255,255,0.85); font-size: 1.05rem; }
.cta .btn-primary {
  background: #fff;
  color: var(--primary-dark);
  box-shadow: 0 6px 16px rgba(0,0,0,0.15);
}

/* Footer */
.site-footer {
  border-top: 1px solid var(--border);
  padding-top: 56px;
  background: var(--bg-alt);
}

.footer-inner {
  display: flex;
  justify-content: space-between;
  gap: 48px;
  flex-wrap: wrap;
  padding-bottom: 40px;
}

.footer-brand { max-width: 280px; }
.footer-brand p { margin-top: 12px; font-size: 0.9rem; }

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

.footer-col h4 {
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
  margin-bottom: 14px;
}
.footer-col a {
  display: block;
  color: var(--text-muted);
  font-size: 0.92rem;
  padding: 5px 0;
}
.footer-col a:hover { color: var(--text); }

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

/* Responsive */
@media (max-width: 900px) {
  .hero-inner { grid-template-columns: 1fr; }
  .hero-visual { height: 300px; margin-top: 24px; }
  .feature-grid, .steps, .testimonial-grid, .pricing-grid { grid-template-columns: 1fr; }
  .price-card.featured { transform: none; }
  .nav { display: none; }
  .header-actions .btn-ghost { display: none; }
  .menu-toggle { display: flex; }
}

@media (max-width: 900px) {
  .nav.open {
    display: flex;
    flex-direction: column;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--bg);
    border-bottom: 1px solid var(--border);
    padding: 16px 24px 24px;
    gap: 16px;
  }
}

@media (max-width: 560px) {
  section { padding: 64px 0; }
  .cta { margin: 0 16px 64px; padding: 48px 24px; }
}

/* Auth dialogs (join / login) */
.auth-dialog {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 32px;
  width: 100%;
  max-width: 420px;
  background: var(--bg);
  color: var(--text);
  box-shadow: var(--shadow-lg);
}

.auth-dialog::backdrop {
  background: rgba(13, 14, 20, 0.55);
  backdrop-filter: blur(2px);
}

.auth-dialog h3 { margin-bottom: 6px; }
.dialog-sub { margin-bottom: 20px; font-size: 0.92rem; }

.dialog-close {
  position: absolute;
  top: 16px;
  right: 16px;
  width: 32px;
  height: 32px;
  border: none;
  background: var(--bg-alt);
  border-radius: 50%;
  font-size: 1.1rem;
  line-height: 1;
  cursor: pointer;
  color: var(--text-muted);
}
.dialog-close:hover { color: var(--text); }

.auth-dialog form label {
  display: block;
  font-size: 0.85rem;
  font-weight: 600;
  margin-bottom: 14px;
}

.auth-dialog form input,
.auth-dialog form select {
  display: block;
  width: 100%;
  margin-top: 6px;
  padding: 10px 12px;
  font-size: 0.95rem;
  font-family: inherit;
  color: var(--text);
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 8px;
}
.auth-dialog form input:focus,
.auth-dialog form select:focus {
  outline: none;
  border-color: var(--primary);
}

.auth-alert {
  font-size: 0.88rem;
  padding: 10px 14px;
  border-radius: 8px;
  margin-bottom: 16px;
}
.auth-alert.success {
  background: rgba(34, 197, 94, 0.12);
  color: #16a34a;
}
.auth-alert.error {
  background: rgba(239, 68, 68, 0.12);
  color: #dc2626;
}

.dialog-switch {
  margin: 20px 0 0;
  text-align: center;
  font-size: 0.88rem;
}
.dialog-switch a {
  color: var(--primary);
  font-weight: 600;
}

/* Header auth state */
.auth-greeting {
  font-size: 0.9rem;
  color: var(--text-muted);
}
.auth-greeting strong { color: var(--text); }
#auth-user {
  display: flex;
  align-items: center;
  gap: 14px;
}
#auth-user[hidden],
#auth-guest[hidden] {
  display: none;
}
