:root {
  --bg: #0b0a1a;
  --bg-soft: #11102a;
  --surface: #ffffff;
  --surface-2: #f6f5fb;
  --ink: #16142b;
  --ink-soft: #514f6b;
  --ink-mut: #8b88a3;
  --line: #e7e5f1;
  --brand: #6d5efc;
  --brand-2: #a855f7;
  --accent: #22d3ee;
  --grad: linear-gradient(120deg, #6d5efc 0%, #a855f7 55%, #ec4899 100%);
  --grad-soft: linear-gradient(120deg, rgba(109,94,252,.14), rgba(168,85,247,.12));
  --shadow-sm: 0 2px 8px rgba(20, 16, 50, .06);
  --shadow-md: 0 14px 40px rgba(35, 24, 90, .12);
  --shadow-lg: 0 30px 80px rgba(35, 24, 90, .22);
  --radius: 18px;
  --radius-sm: 12px;
  --container: 1140px;
  --font-sans: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --font-display: "Sora", var(--font-sans);
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: var(--font-sans);
  color: var(--ink);
  background: var(--surface-2);
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

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

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

code {
  font-family: ui-monospace, "SF Mono", "Cascadia Code", Menlo, Consolas, monospace;
  font-size: .88em;
  background: rgba(109, 94, 252, .1);
  color: #5a4bdb;
  padding: .12em .45em;
  border-radius: 7px;
}

.container {
  width: 100%;
  max-width: var(--container);
  margin-inline: auto;
  padding-inline: clamp(20px, 5vw, 40px);
}

.skip-link {
  position: absolute;
  left: -999px;
  top: 0;
  background: var(--brand);
  color: #fff;
  padding: 10px 16px;
  border-radius: 0 0 10px 0;
  z-index: 100;
}
.skip-link:focus { left: 0; }

/* ---------- Header ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(11, 10, 26, .72);
  backdrop-filter: saturate(160%) blur(14px);
  border-bottom: 1px solid rgba(255, 255, 255, .08);
}
.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 72px;
}
.brand { display: flex; align-items: center; gap: 10px; color: #fff; }
.brand-mark {
  display: grid;
  place-items: center;
  width: 40px; height: 40px;
  border-radius: 12px;
  background: rgba(255,255,255,.06);
  border: 1px solid rgba(255,255,255,.12);
}
.brand-name {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 1.18rem;
  letter-spacing: -.01em;
}
.nav-links {
  display: flex;
  align-items: center;
  gap: clamp(14px, 2.4vw, 30px);
  list-style: none;
  margin: 0; padding: 0;
}
.nav-links a {
  color: rgba(255,255,255,.82);
  font-weight: 500;
  font-size: .96rem;
  transition: color .2s ease;
}
.nav-links a:hover { color: #fff; }
.nav-cta {
  background: var(--grad);
  color: #fff !important;
  padding: 9px 18px;
  border-radius: 999px;
  box-shadow: 0 8px 24px rgba(109, 94, 252, .4);
}
.nav-cta:hover { transform: translateY(-1px); }
.nav-toggle {
  display: none;
  flex-direction: column;
  gap: 5px;
  width: 42px; height: 42px;
  border: 1px solid rgba(255,255,255,.18);
  border-radius: 10px;
  background: transparent;
  cursor: pointer;
  padding: 10px;
}
.nav-toggle span {
  height: 2px; width: 100%;
  background: #fff;
  border-radius: 2px;
  transition: transform .25s ease, opacity .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;
  background: radial-gradient(1200px 600px at 80% -10%, rgba(168,85,247,.35), transparent 60%),
              radial-gradient(900px 500px at 0% 10%, rgba(109,94,252,.35), transparent 55%),
              var(--bg);
  color: #fff;
  overflow: hidden;
  padding-top: clamp(40px, 7vw, 90px);
}
.hero-bg {
  position: absolute; inset: 0;
  background-image:
    linear-gradient(rgba(255,255,255,.04) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,.04) 1px, transparent 1px);
  background-size: 48px 48px;
  mask-image: radial-gradient(circle at 50% 30%, #000 30%, transparent 75%);
}
.hero-inner {
  position: relative;
  display: grid;
  grid-template-columns: 1.05fr .95fr;
  gap: clamp(30px, 5vw, 70px);
  align-items: center;
  padding-block: clamp(30px, 5vw, 60px) clamp(70px, 9vw, 120px);
}
.eyebrow {
  display: inline-block;
  font-weight: 600;
  letter-spacing: .14em;
  text-transform: uppercase;
  font-size: .78rem;
  color: #c9c4ff;
  padding: 6px 14px;
  border: 1px solid rgba(255,255,255,.18);
  border-radius: 999px;
  margin-bottom: 22px;
}
.hero-copy h1 {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: clamp(2.3rem, 5.4vw, 3.9rem);
  line-height: 1.06;
  letter-spacing: -.02em;
  margin: 0 0 20px;
}
.grad-text {
  background: var(--grad);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.lede {
  font-size: clamp(1.02rem, 1.6vw, 1.18rem);
  color: rgba(255,255,255,.78);
  max-width: 54ch;
  margin: 0 0 30px;
}
.hero-actions { display: flex; flex-wrap: wrap; gap: 14px; margin-bottom: 38px; }

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  font-size: 1rem;
  padding: 13px 26px;
  border-radius: 999px;
  cursor: pointer;
  border: 1px solid transparent;
  transition: transform .2s ease, box-shadow .2s ease, background .2s ease;
}
.btn-primary {
  background: var(--grad);
  color: #fff;
  box-shadow: 0 14px 36px rgba(109, 94, 252, .45);
}
.btn-primary:hover { transform: translateY(-2px); box-shadow: 0 20px 46px rgba(109, 94, 252, .55); }
.btn-ghost {
  background: rgba(255,255,255,.07);
  color: #fff;
  border-color: rgba(255,255,255,.22);
}
.btn-ghost:hover { background: rgba(255,255,255,.14); transform: translateY(-2px); }
.btn-lg { padding: 16px 34px; font-size: 1.08rem; }

.hero-stats {
  display: flex;
  gap: clamp(20px, 4vw, 44px);
  margin: 0;
}
.hero-stats div { display: flex; flex-direction: column; }
.hero-stats dt {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 1.9rem;
  line-height: 1;
  color: #fff;
}
.hero-stats dd {
  margin: 6px 0 0;
  font-size: .86rem;
  color: rgba(255,255,255,.6);
}

/* Hero visual */
.hero-visual {
  position: relative;
  display: grid;
  place-items: center;
  min-height: 360px;
}
.device {
  position: relative;
  width: min(300px, 78vw);
  aspect-ratio: 9 / 19;
  border-radius: 38px;
  padding: 12px;
  background: linear-gradient(160deg, #1d1b3a, #0e0d22);
  border: 1px solid rgba(255,255,255,.12);
  box-shadow: var(--shadow-lg);
  animation: floaty 6s ease-in-out infinite;
}
.device-notch {
  position: absolute;
  top: 12px; left: 50%; transform: translateX(-50%);
  width: 110px; height: 18px;
  background: #0e0d22;
  border-radius: 0 0 12px 12px;
  z-index: 2;
}
.device-screen {
  height: 100%;
  border-radius: 28px;
  background: linear-gradient(180deg, #13122b, #1a1838);
  padding: 34px 16px 18px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.card-mini {
  background: rgba(255,255,255,.06);
  border: 1px solid rgba(255,255,255,.1);
  border-radius: 14px;
  padding: 14px;
  font-size: .82rem;
  color: rgba(255,255,255,.86);
  backdrop-filter: blur(6px);
}
.card-note { display: flex; align-items: center; gap: 8px; }
.card-note .dot {
  width: 9px; height: 9px; border-radius: 50%;
  background: var(--accent); box-shadow: 0 0 10px var(--accent);
}
.card-flash strong { color: #fff; }
.card-flash .flip { display: block; margin-top: 8px; font-size: .72rem; color: #c9c4ff; }
.card-quiz .meter {
  height: 8px; border-radius: 999px;
  background: rgba(255,255,255,.12);
  overflow: hidden; margin-bottom: 8px;
}
.card-quiz .meter i { display: block; height: 100%; background: var(--grad); }
.float-chip {
  position: absolute;
  background: rgba(255,255,255,.9);
  color: var(--ink);
  font-size: .8rem;
  font-weight: 600;
  padding: 8px 14px;
  border-radius: 999px;
  box-shadow: var(--shadow-md);
}
.chip-1 { top: 8%; left: -6%; animation: floaty 5s ease-in-out infinite reverse; }
.chip-2 { bottom: 12%; right: -8%; animation: floaty 7s ease-in-out infinite; }

@keyframes floaty {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-14px); }
}

.wave {
  position: absolute;
  left: 0; right: 0; bottom: -1px;
  height: 70px;
  background: var(--surface-2);
  clip-path: polygon(0 100%, 100% 100%, 100% 38%, 75% 60%, 50% 30%, 25% 60%, 0 42%);
  opacity: .9;
}

/* ---------- Sections ---------- */
.section { padding-block: clamp(60px, 9vw, 110px); }
.section-alt { background: var(--surface); }
.section-kicker {
  text-transform: uppercase;
  letter-spacing: .16em;
  font-size: .78rem;
  font-weight: 700;
  color: var(--brand);
  margin: 0 0 12px;
}
.section-title {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: clamp(1.7rem, 3.6vw, 2.6rem);
  line-height: 1.12;
  letter-spacing: -.02em;
  margin: 0 0 clamp(28px, 4vw, 46px);
  max-width: 22ch;
}

.prose-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: clamp(20px, 4vw, 44px);
  max-width: 980px;
}
.prose-grid p { margin: 0; color: var(--ink-soft); font-size: 1.06rem; }

/* Features */
.feature-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  gap: 20px;
}
.feature-card {
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 26px 24px;
  transition: transform .25s ease, box-shadow .25s ease, border-color .25s ease;
}
.section-alt .feature-card { background: #fff; }
.feature-card:hover {
  transform: translateY(-6px);
  box-shadow: var(--shadow-md);
  border-color: rgba(109,94,252,.4);
}
.feature-icon {
  width: 52px; height: 52px;
  display: grid; place-items: center;
  font-size: 1.5rem;
  border-radius: 14px;
  background: var(--grad-soft);
  margin-bottom: 16px;
}
.feature-card h3 {
  font-family: var(--font-display);
  font-size: 1.16rem;
  margin: 0 0 8px;
}
.feature-card p { margin: 0; color: var(--ink-soft); font-size: .98rem; }

/* Steps */
.steps {
  list-style: none;
  margin: 0; padding: 0;
  display: grid;
  gap: 18px;
  counter-reset: step;
}
.step {
  display: flex;
  gap: 20px;
  align-items: flex-start;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 22px 24px;
  transition: box-shadow .25s ease, transform .25s ease;
}
.step:hover { box-shadow: var(--shadow-md); transform: translateX(4px); }
.step-num {
  flex: none;
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 1.5rem;
  background: var(--grad);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  min-width: 56px;
}
.step h3 { margin: 0 0 4px; font-family: var(--font-display); font-size: 1.12rem; }
.step p { margin: 0; color: var(--ink-soft); }

.steps.compact {
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 14px;
}
.steps.compact .step { padding: 18px 20px; }
.steps.compact .step-num { font-size: 1.2rem; min-width: 40px; }

/* Runtime */
.runtime-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 18px;
}
.runtime-card {
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 24px;
}
.runtime-card h3 { font-family: var(--font-display); margin: 0 0 10px; font-size: 1.1rem; }
.runtime-card p { margin: 0; color: var(--ink-soft); font-size: .98rem; }

/* Stack */
.stack-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 16px;
}
.stack-item {
  position: relative;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 22px 22px 20px;
  overflow: hidden;
}
.stack-item::before {
  content: "";
  position: absolute; inset: 0 0 auto 0;
  height: 4px;
  background: var(--grad);
}
.stack-item strong { display: block; font-family: var(--font-display); font-size: 1.25rem; margin: 6px 0 4px; }
.stack-item small { color: var(--ink-soft); }
.stack-tag {
  display: inline-block;
  font-size: .72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .12em;
  color: var(--brand);
}

/* Tree */
.tree {
  list-style: none;
  margin: 0; padding: 0;
  display: grid;
  gap: 12px;
  max-width: 820px;
}
.tree li {
  background: #fff;
  border: 1px solid var(--line);
  border-left: 3px solid var(--brand);
  border-radius: 10px;
  padding: 13px 18px;
  color: var(--ink-soft);
  font-size: .98rem;
}

/* Setup */
.setup-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: clamp(24px, 4vw, 50px);
  align-items: start;
}
.notes { display: grid; gap: 16px; }
.note {
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 20px 22px;
}
.note h3 { margin: 0 0 8px; font-family: var(--font-display); font-size: 1.08rem; }
.note p { margin: 0; color: var(--ink-soft); font-size: .96rem; }

/* CTA */
.cta {
  background: radial-gradient(800px 400px at 50% 0%, rgba(168,85,247,.3), transparent 60%), var(--bg);
  color: #fff;
  padding-block: clamp(60px, 9vw, 110px);
}
.cta-inner { text-align: center; max-width: 640px; }
.cta h2 {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: clamp(1.8rem, 4vw, 2.8rem);
  margin: 0 0 14px;
}
.cta p { color: rgba(255,255,255,.78); margin: 0 0 28px; font-size: 1.08rem; }

/* Footer */
.site-footer {
  background: #07060f;
  color: rgba(255,255,255,.7);
  padding-block: 48px;
}
.footer-inner {
  display: flex;
  flex-wrap: wrap;
  gap: 28px;
  justify-content: space-between;
  align-items: center;
}
.footer-brand .brand-name { color: #fff; font-size: 1.2rem; }
.footer-brand p { margin: 6px 0 0; font-size: .92rem; color: rgba(255,255,255,.55); }
.footer-nav { display: flex; flex-wrap: wrap; gap: 18px; }
.footer-nav a { color: rgba(255,255,255,.72); font-size: .95rem; }
.footer-nav a:hover { color: #fff; }
.footer-copy { width: 100%; margin: 18px 0 0; font-size: .85rem; color: rgba(255,255,255,.45); }
.footer-copy code { color: #c9c4ff; background: rgba(255,255,255,.08); }

/* Reveal animation */
.reveal {
  opacity: 0;
  transform: translateY(22px);
  transition: opacity .6s ease, transform .6s ease;
}
.reveal.in { opacity: 1; transform: none; }

/* Responsive */
@media (max-width: 900px) {
  .hero-inner { grid-template-columns: 1fr; }
  .hero-visual { order: -1; min-height: 320px; }
  .prose-grid { grid-template-columns: 1fr; }
  .setup-grid { grid-template-columns: 1fr; }
  .nav-toggle { display: flex; }
  .nav-links {
    position: absolute;
    top: 72px; left: 0; right: 0;
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    background: rgba(11, 10, 26, .97);
    border-bottom: 1px solid rgba(255,255,255,.1);
    padding: 10px clamp(20px, 5vw, 40px) 20px;
    max-height: 0;
    overflow: hidden;
    transition: max-height .3s ease;
  }
  .nav-links.open { max-height: 420px; }
  .nav-links li { padding: 4px 0; }
  .nav-links a { display: block; padding: 10px 0; }
  .nav-cta { text-align: center; margin-top: 8px; }
  .footer-inner { flex-direction: column; align-items: flex-start; }
}

@media (max-width: 520px) {
  .hero-stats { flex-wrap: wrap; gap: 18px; }
  .float-chip { display: none; }
  .section-title { max-width: none; }
}

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