:root {
  --bg: #0b0b12;
  --bg-alt: #10101a;
  --surface: rgba(255, 255, 255, 0.04);
  --surface-hover: rgba(255, 255, 255, 0.08);
  --border: rgba(255, 255, 255, 0.1);
  --text: #f2f2f7;
  --text-dim: #a1a1b5;
  --grad-1: #6d5cff;
  --grad-2: #00d4ff;
  --grad-3: #b967ff;
  --shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
  --radius: 20px;
  --maxw: 1080px;
}

@media (prefers-color-scheme: light) {
  :root:not([data-theme]) {
    --bg: #f7f7fb;
    --bg-alt: #eef0f8;
    --surface: rgba(13, 13, 30, 0.04);
    --surface-hover: rgba(13, 13, 30, 0.08);
    --border: rgba(13, 13, 30, 0.1);
    --text: #14141f;
    --text-dim: #55556b;
    --shadow: 0 20px 60px rgba(30, 30, 80, 0.1);
  }
}

html[data-theme="dark"] {
  --bg: #0b0b12;
  --bg-alt: #10101a;
  --surface: rgba(255, 255, 255, 0.04);
  --surface-hover: rgba(255, 255, 255, 0.08);
  --border: rgba(255, 255, 255, 0.1);
  --text: #f2f2f7;
  --text-dim: #a1a1b5;
  --shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
}

html[data-theme="light"] {
  --bg: #f7f7fb;
  --bg-alt: #eef0f8;
  --surface: rgba(13, 13, 30, 0.04);
  --surface-hover: rgba(13, 13, 30, 0.08);
  --border: rgba(13, 13, 30, 0.1);
  --text: #14141f;
  --text-dim: #55556b;
  --shadow: 0 20px 60px rgba(30, 30, 80, 0.1);
}

* { margin: 0; padding: 0; box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Inter, "Helvetica Neue", Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.65;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  transition: background 0.4s ease, color 0.4s ease;
}

::selection { background: var(--grad-1); color: #fff; }

/* ---------- backgrounds ---------- */
.bg-glow {
  position: fixed;
  inset: 0;
  z-index: -2;
  background:
    radial-gradient(600px 400px at 15% 10%, rgba(109, 92, 255, 0.28), transparent 65%),
    radial-gradient(700px 500px at 85% 20%, rgba(0, 212, 255, 0.18), transparent 65%),
    radial-gradient(600px 500px at 55% 85%, rgba(185, 103, 255, 0.16), transparent 65%),
    var(--bg);
  transition: background 0.4s ease;
}

.noise {
  position: fixed;
  inset: 0;
  z-index: -1;
  opacity: 0.035;
  pointer-events: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='120' height='120'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='1'/%3E%3C/svg%3E");
}

/* ---------- nav ---------- */
.nav {
  position: sticky;
  top: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1rem max(1.5rem, calc((100% - var(--maxw)) / 2));
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  background: color-mix(in srgb, var(--bg) 72%, transparent);
  border-bottom: 1px solid var(--border);
}

.logo {
  font-size: 1.25rem;
  font-weight: 800;
  text-decoration: none;
  color: var(--text);
  letter-spacing: -0.02em;
}

.logo span {
  background: linear-gradient(90deg, var(--grad-1), var(--grad-2));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.nav nav { display: flex; align-items: center; gap: 1.75rem; }

.nav nav a {
  color: var(--text-dim);
  text-decoration: none;
  font-size: 0.95rem;
  font-weight: 500;
  transition: color 0.2s ease;
}

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

.nav-cta {
  padding: 0.5rem 1.1rem;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--grad-1), var(--grad-2));
  color: #fff !important;
  font-weight: 600;
  box-shadow: 0 4px 20px rgba(109, 92, 255, 0.35);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.nav-cta:hover { transform: translateY(-1px); box-shadow: 0 6px 26px rgba(109, 92, 255, 0.5); }

/* ---------- theme toggle ---------- */
.theme-toggle {
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  width: 42px;
  height: 42px;
  border-radius: 12px;
  cursor: pointer;
  display: grid;
  place-items: center;
  transition: background 0.2s ease, transform 0.2s ease;
}

.theme-toggle:hover { background: var(--surface-hover); transform: scale(1.05); }

.theme-toggle svg { width: 19px; height: 19px; }

.icon-sun { display: none; }
html[data-theme="light"] .icon-moon { display: none; }
html[data-theme="light"] .icon-sun { display: block; }

/* ---------- hero ---------- */
.hero {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: clamp(4rem, 12vh, 8rem) 1.5rem 3rem;
  text-align: center;
}

.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.45rem 1.1rem;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--surface);
  font-size: 0.85rem;
  color: var(--text-dim);
  margin-bottom: 1.75rem;
}

.hero-title {
  font-size: clamp(2.5rem, 7vw, 4.5rem);
  font-weight: 800;
  letter-spacing: -0.035em;
  line-height: 1.08;
  margin-bottom: 1.5rem;
}

.grad {
  background: linear-gradient(100deg, var(--grad-1), var(--grad-2), var(--grad-3));
  background-size: 200% 200%;
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  animation: gradShift 6s ease-in-out infinite;
}

@keyframes gradShift {
  0%, 100% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
}

.hero-sub {
  max-width: 640px;
  margin: 0 auto 2.25rem;
  font-size: 1.15rem;
  color: var(--text-dim);
}

.hero-actions {
  display: flex;
  justify-content: center;
  gap: 1rem;
  flex-wrap: wrap;
  margin-bottom: 4rem;
}

.btn {
  display: inline-block;
  padding: 0.85rem 1.9rem;
  border-radius: 999px;
  text-decoration: none;
  font-weight: 600;
  font-size: 0.98rem;
  transition: transform 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}

.btn:hover { transform: translateY(-2px); }

.btn-primary {
  background: linear-gradient(90deg, var(--grad-1), var(--grad-2));
  color: #fff;
  box-shadow: 0 8px 30px rgba(109, 92, 255, 0.4);
}

.btn-primary:hover { box-shadow: 0 12px 40px rgba(109, 92, 255, 0.55); }

.btn-ghost {
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
}

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

.hero-stats {
  display: flex;
  justify-content: center;
  gap: clamp(2rem, 10vw, 5rem);
  flex-wrap: wrap;
}

.hero-stats div { display: flex; flex-direction: column; }

.hero-stats strong {
  font-size: 2rem;
  font-weight: 800;
  background: linear-gradient(90deg, var(--grad-1), var(--grad-2));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.hero-stats span { font-size: 0.9rem; color: var(--text-dim); }

/* ---------- sections ---------- */
.section {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: clamp(3.5rem, 9vh, 6rem) 1.5rem;
}

.section-alt {
  max-width: none;
  background: var(--bg-alt);
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  transition: background 0.4s ease;
}

.eyebrow {
  text-transform: uppercase;
  letter-spacing: 0.14em;
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--grad-2);
  margin-bottom: 0.75rem;
}

.section-title {
  font-size: clamp(1.8rem, 4vw, 2.7rem);
  font-weight: 800;
  letter-spacing: -0.03em;
  margin-bottom: 3rem;
}

/* ---------- cards ---------- */
.cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1.25rem;
}

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.75rem;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  transition: transform 0.25s ease, border-color 0.25s ease, background 0.25s ease, box-shadow 0.25s ease;
}

.card:hover {
  transform: translateY(-6px);
  border-color: rgba(109, 92, 255, 0.45);
  background: var(--surface-hover);
  box-shadow: var(--shadow);
}

.card-icon {
  font-size: 1.7rem;
  margin-bottom: 1rem;
  width: 52px;
  height: 52px;
  display: grid;
  place-items: center;
  border-radius: 14px;
  background: linear-gradient(135deg, rgba(109, 92, 255, 0.18), rgba(0, 212, 255, 0.18));
  border: 1px solid var(--border);
}

.card h3 { font-size: 1.15rem; margin-bottom: 0.5rem; letter-spacing: -0.01em; }

.card p { color: var(--text-dim); font-size: 0.95rem; }

/* ---------- steps ---------- */
.steps {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1.25rem;
}

.step {
  padding: 1.75rem;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: var(--surface);
  transition: transform 0.25s ease;
}

.step:hover { transform: translateY(-4px); }

.step-num {
  font-size: 0.85rem;
  font-weight: 800;
  letter-spacing: 0.1em;
  background: linear-gradient(90deg, var(--grad-1), var(--grad-2));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.step h3 { margin: 0.6rem 0 0.4rem; font-size: 1.1rem; }

.step p { color: var(--text-dim); font-size: 0.95rem; }

/* ---------- about ---------- */
.about-text {
  max-width: 720px;
  color: var(--text-dim);
  font-size: 1.05rem;
  margin-bottom: 2rem;
}

.stack {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.stack span {
  padding: 0.5rem 1.1rem;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--surface);
  font-size: 0.88rem;
  font-weight: 500;
  color: var(--text);
  transition: border-color 0.2s ease, transform 0.2s ease;
}

.stack span:hover {
  border-color: rgba(0, 212, 255, 0.5);
  transform: translateY(-2px);
}

/* ---------- cta ---------- */
.section-cta {
  text-align: center;
  padding-bottom: 5rem;
}

.section-cta h2 {
  font-size: clamp(2rem, 5vw, 3.2rem);
  font-weight: 800;
  letter-spacing: -0.03em;
  margin-bottom: 1rem;
}

.section-cta p {
  max-width: 560px;
  margin: 0 auto 2rem;
  color: var(--text-dim);
}

.btn-lg { padding: 1rem 2.4rem; font-size: 1.05rem; }

/* ---------- footer ---------- */
.footer {
  border-top: 1px solid var(--border);
  padding: 2.5rem max(1.5rem, calc((100% - var(--maxw)) / 2));
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 2rem;
  flex-wrap: wrap;
  background: var(--bg-alt);
  transition: background 0.4s ease;
}

.footer p { color: var(--text-dim); font-size: 0.9rem; margin-top: 0.35rem; }

.footer nav { display: flex; gap: 1.5rem; }

.footer nav a {
  color: var(--text-dim);
  text-decoration: none;
  font-size: 0.92rem;
  transition: color 0.2s ease;
}

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

.copyright { width: 100%; text-align: center; margin-top: 1rem; }

/* ---------- reveal animation ---------- */
.reveal {
  opacity: 0;
  transform: translateY(26px);
  transition: opacity 0.7s ease, transform 0.7s ease;
}

.reveal.visible { opacity: 1; transform: none; }

/* ---------- responsive ---------- */
@media (max-width: 720px) {
  .nav nav { display: none; }
  .hero-actions { flex-direction: column; align-items: center; }
  .footer { justify-content: center; text-align: center; }
}

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