/* ===== Theme tokens ===== */
:root,
[data-theme="dark"] {
  --bg: #0d0e12;
  --bg-elev: #131419;
  --surface: #15171d;
  --surface-2: #1b1d25;
  --border: #23262f;
  --border-strong: #2e323d;
  --text: #f4f5f8;
  --text-muted: #8b919e;
  --primary: #ff4655;
  --primary-strong: #ff2d40;
  --primary-soft: rgba(255, 70, 85, 0.12);
  --on-primary: #ffffff;
  --ring: rgba(255, 70, 85, 0.55);
  --shadow: 0 8px 24px rgba(0, 0, 0, 0.35);
  --glow: rgba(255, 70, 85, 0.22);
  --radius: 10px;
}

[data-theme="light"] {
  --bg: #ffffff;
  --bg-elev: #f7f8fa;
  --surface: #ffffff;
  --surface-2: #f4f5f7;
  --border: #e6e8ed;
  --border-strong: #d4d8df;
  --text: #14161b;
  --text-muted: #616773;
  --primary: #f5293a;
  --primary-strong: #d81a2c;
  --primary-soft: rgba(245, 41, 58, 0.08);
  --on-primary: #ffffff;
  --ring: rgba(245, 41, 58, 0.4);
  --shadow: 0 6px 20px rgba(20, 23, 28, 0.08);
  --glow: rgba(245, 41, 58, 0.14);
  --radius: 10px;
}

/* ===== Base ===== */
* { box-sizing: border-box; }

::selection {
  background: var(--primary);
  color: var(--on-primary);
}

::-moz-selection {
  background: var(--primary);
  color: var(--on-primary);
}

html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: "Lexend", system-ui, -apple-system, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  transition: background-color 0.25s ease, color 0.25s ease;
}

h1, h2, h3 { line-height: 1.15; letter-spacing: -0.02em; margin: 0; }

p { margin: 0; }

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

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

:focus-visible {
  outline: 2px solid var(--ring);
  outline-offset: 3px;
  border-radius: 6px;
}

/* ===== Layout ===== */
.container {
  width: 100%;
  max-width: 1140px;
  margin: 0 auto;
  padding: 0 24px;
}

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

.section { padding: 48px 0; }
.section + .section { padding-top: 0; }

.section-head { max-width: 720px; margin: 0 0 28px; }
.section-head h2 { font-size: clamp(1.5rem, 2.6vw, 2rem); font-weight: 700; }
.section-head p { color: var(--text-muted); margin-top: 10px; font-size: 1rem; max-width: 60ch; }

/* ===== Buttons ===== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 11px 20px;
  font-size: 0.94rem;
  font-weight: 600;
  font-family: inherit;
  border-radius: var(--radius);
  border: 1px solid transparent;
  cursor: pointer;
  transition: background-color 0.18s ease, border-color 0.18s ease, color 0.18s ease;
}
.btn-sm { padding: 8px 14px; font-size: 0.88rem; }

.btn-primary {
  background: var(--primary);
  color: var(--on-primary);
}
.btn-primary:hover { background: var(--primary-strong); }

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

/* ===== Header ===== */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: color-mix(in srgb, var(--bg) 82%, transparent);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
}
.header-inner {
  display: flex;
  align-items: center;
  gap: 20px;
  height: 64px;
}

.brand { display: inline-flex; align-items: center; gap: 9px; font-weight: 700; }
.brand-logo { width: 28px; height: 28px; display: block; border-radius: 7px; }
.brand-name { font-size: 1.05rem; letter-spacing: -0.01em; }

.nav { display: flex; gap: 26px; margin-left: auto; }
.nav a { color: var(--text-muted); font-size: 0.85rem; font-weight: 500; transition: color 0.2s ease; }
.nav a:hover { color: var(--text); }

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

.theme-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  border-radius: 9px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  cursor: pointer;
  transition: border-color 0.2s ease, color 0.2s ease;
}
.theme-toggle:hover { border-color: var(--primary); color: var(--primary); }
.theme-toggle .icon-sun { display: none; }
.theme-toggle .icon-moon { display: block; }
[data-theme="light"] .theme-toggle .icon-sun { display: block; }
[data-theme="light"] .theme-toggle .icon-moon { display: none; }

/* hamburger */
.nav-toggle {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 38px;
  height: 38px;
  border-radius: 9px;
  border: 1px solid var(--border);
  background: var(--surface);
  cursor: pointer;
}
.nav-toggle span {
  display: block;
  width: 18px;
  height: 2px;
  margin: 0 auto;
  background: var(--text);
  transition: transform 0.25s ease, opacity 0.2s ease;
}
.nav-toggle[aria-expanded="true"] span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.nav-toggle[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
.nav-toggle[aria-expanded="true"] span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* ===== Hero ===== */
.hero { position: relative; overflow: hidden; padding: 56px 0 52px; border-bottom: 1px solid var(--border); }
.hero-glow {
  position: absolute;
  top: -260px;
  left: 12%;
  transform: translateX(-50%);
  width: 600px;
  height: 600px;
  background: radial-gradient(circle, var(--glow) 0%, transparent 60%);
  pointer-events: none;
  z-index: 0;
}
.hero-inner {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: 0.9fr 1.25fr;
  align-items: center;
  gap: 44px;
}
.hero-copy { max-width: 460px; }

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: "JetBrains Mono", monospace;
  font-size: 0.72rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 20px;
}
.eyebrow::before {
  content: "";
  width: 22px;
  height: 1px;
  background: var(--primary);
}
.hero-title { font-size: clamp(1.7rem, 3.2vw, 2.4rem); font-weight: 700; }
.hero-desc { color: var(--text-muted); font-size: 0.96rem; margin-top: 14px; }
.hero-actions { display: flex; gap: 12px; flex-wrap: wrap; margin-top: 24px; }
.hero-note {
  margin-top: 18px;
  font-size: 0.76rem;
  color: var(--text-muted);
}

/* ===== Demo ===== */
.demo-frame {
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid var(--border);
  background: var(--surface);
  box-shadow: var(--shadow);
}
.demo-frame video { width: 100%; aspect-ratio: 16 / 9; background: #000; pointer-events: none; }
.hero-demo { width: 100%; }

/* ===== Bento grid ===== */
.bento {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--border);
  gap: 1px;
}
.card {
  background: var(--surface);
  padding: 24px 22px;
  transition: background-color 0.18s ease;
}
.card:hover { background: var(--surface-2); }

.card-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: 9px;
  background: var(--primary-soft);
  color: var(--primary);
  margin-bottom: 16px;
}
.card h3 { font-size: 1.05rem; font-weight: 600; margin-bottom: 8px; }
.card p { color: var(--text-muted); font-size: 0.94rem; line-height: 1.6; }

/* ===== Steps ===== */
.steps {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--border);
  gap: 1px;
}
.step {
  background: var(--surface);
  padding: 22px 20px;
}
.step-num {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-family: "JetBrains Mono", monospace;
  font-weight: 700;
  font-size: 0.85rem;
  color: var(--primary);
  margin-bottom: 14px;
}
.step-num::before { content: "0"; }
.step p { color: var(--text); font-size: 0.94rem; }

/* ===== FAQ ===== */
.faq {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}
.faq details { border-bottom: 1px solid var(--border); }
.faq details:last-child { border-bottom: none; }
.faq summary {
  cursor: pointer;
  list-style: none;
  padding: 18px 20px;
  font-weight: 500;
  font-size: 0.98rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  transition: color 0.18s ease;
}
.faq summary:hover { color: var(--primary); }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after {
  content: "";
  flex: none;
  width: 9px;
  height: 9px;
  border-right: 1.5px solid currentColor;
  border-bottom: 1.5px solid currentColor;
  transform: rotate(45deg);
  transition: transform 0.2s ease;
}
.faq details[open] summary { color: var(--text); }
.faq details[open] summary::after { transform: rotate(-135deg); }
.faq-body { padding: 0 20px 18px; color: var(--text-muted); font-size: 0.94rem; }

/* ===== CTA ===== */
.cta-inner {
  text-align: center;
  border-top: 1px solid var(--border);
  padding: 48px 24px 0;
}
.cta-inner h2 { font-size: clamp(1.5rem, 2.8vw, 2.1rem); font-weight: 700; }
.cta-inner > p { color: var(--text-muted); margin-top: 10px; }
.cta-inner .hero-actions { margin-top: 24px; justify-content: center; }

/* ===== Footer ===== */
.site-footer {
  border-top: 1px solid var(--border);
  background: var(--bg-elev);
  padding: 28px 0;
  margin-top: 48px;
}
.footer-inner { display: flex; flex-direction: column; gap: 20px; }
.footer-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 16px;
  padding-bottom: 20px;
  border-bottom: 1px solid var(--border);
}
.footer-brand { display: inline-flex; align-items: center; gap: 8px; font-weight: 700; }
.footer-brand .brand-logo { width: 24px; height: 24px; border-radius: 6px; }
.footer-brand .brand-name { font-size: 0.98rem; }
.footer-links { display: flex; flex-wrap: wrap; gap: 24px; }
.footer-links a { color: var(--text-muted); font-size: 0.82rem; transition: color 0.18s ease; }
.footer-links a:hover { color: var(--text); }
.footer-bottom { display: flex; flex-direction: column; gap: 8px; }
.footer-credit { color: var(--text-muted); font-size: 0.8rem; }
.footer-credit a { color: var(--text); font-weight: 500; transition: color 0.18s ease; }
.footer-credit a:hover { color: var(--primary); }
.footer-disclaimer { color: var(--text-muted); font-size: 0.76rem; max-width: 760px; opacity: 0.7; line-height: 1.55; }

/* ===== Scroll reveal ===== */
.reveal {
  opacity: 0;
  transform: translateY(10px);
  transition: opacity 0.45s ease, transform 0.45s ease;
}
.reveal.is-visible { opacity: 1; transform: none; }

/* ===== Responsive ===== */
@media (max-width: 900px) {
  .hero { padding: 44px 0; }
  .hero-inner { grid-template-columns: 1fr; gap: 28px; }
  .hero-copy { max-width: 100%; }
  .hero-glow { left: 50%; }

  .bento { grid-template-columns: repeat(2, 1fr); }
  .steps { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 720px) {
  .section { padding: 40px 0; }

  .nav {
    position: fixed;
    top: 64px;
    left: 0;
    right: 0;
    flex-direction: column;
    gap: 0;
    background: var(--bg-elev);
    border-bottom: 1px solid var(--border);
    margin: 0;
    padding: 8px 0;
    transform: translateY(-12px);
    opacity: 0;
    pointer-events: none;
    transition: transform 0.2s ease, opacity 0.2s ease;
  }
  .nav.open { transform: none; opacity: 1; pointer-events: auto; }
  .nav a { padding: 14px 24px; }

  .header-actions { margin-left: auto; }
  .nav-toggle { display: flex; }
  .header-actions .btn-sm { display: none; }
}

@media (max-width: 560px) {
  .bento { grid-template-columns: 1fr; }
  .steps { grid-template-columns: 1fr; }
  .btn { width: 100%; }
  .hero-actions { flex-direction: column; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .reveal { opacity: 1; transform: none; transition: none; }
}
