/* ============================================================
   DESIGN TOKENS
============================================================ */
:root {
  --bg: oklch(12% 0.03 250);
  --bg-2: oklch(20% 0.038 250);
  --surface: oklch(19% 0.045 250);
  --surface-hover: oklch(25% 0.042 250);
  --border: oklch(30% 0.04 250);
  --border-hover: oklch(65% 0.18 285);
  --text: oklch(95% 0.01 250);
  --text-2: oklch(85% 0.02 250);
  --text-muted: oklch(70% 0.03 250);
  --violet: oklch(72% 0.22 285);
  --violet-hover: oklch(78% 0.22 285);
  --violet-dim: oklch(32% 0.14 285);

  --font: "Inter", ui-sans-serif, system-ui, -apple-system, sans-serif;

  --r-sm: 0.25rem;
  --r-md: 0.375rem;
  --r-lg: 0.5rem;
  --r-xl: 0.75rem;
  --r-2xl: 1rem;
  --r-full: 9999px;

  --max-w: 1120px;
  --pad-x: 1.5rem;
  --nav-h: 64px;
}

/* ============================================================
   RESET
============================================================ */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}
html {
  scroll-behavior: smooth;
}
body {
  font-family: var(--font);
  background-color: var(--bg);
  color: var(--text);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}
a {
  color: inherit;
  text-decoration: none;
}
ul {
  list-style: none;
}
img,
svg {
  display: block;
}
button {
  font-family: inherit;
  border: none;
  background: none;
  cursor: pointer;
}

/* ============================================================
   NOISE TEXTURE OVERLAY
============================================================ */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 9998;
  opacity: 0.05;
  mix-blend-mode: soft-light;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='300' height='300'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.72' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='300' height='300' filter='url(%23n)'/%3E%3C/svg%3E");
  background-repeat: repeat;
  background-size: 200px 200px;
}

/* ============================================================
   LUCIDE ICONS
============================================================ */
i[data-lucide] {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

/* ============================================================
   LAYOUT
============================================================ */
.container {
  max-width: var(--max-w);
  margin-inline: auto;
  padding-inline: var(--pad-x);
}

section {
  padding-block: 6rem;
}

.section-eyebrow {
  display: block;
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: var(--violet);
  margin-bottom: 0.625rem;
}

.section-heading {
  font-size: clamp(1.75rem, 3.5vw, 2.625rem);
  font-weight: 800;
  line-height: 1.12;
  letter-spacing: -0.025em;
  color: var(--text);
  margin-bottom: 0.875rem;
}

.section-sub {
  font-size: 1.0625rem;
  color: var(--text-2);
  line-height: 1.65;
  max-width: 520px;
}

/* ============================================================
   BUTTONS
============================================================ */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-family: var(--font);
  font-weight: 600;
  border-radius: var(--r-lg);
  border: 1px solid transparent;
  cursor: pointer;
  white-space: nowrap;
  line-height: 1;
  text-decoration: none;
  transition:
    background 130ms ease,
    color 130ms ease,
    border-color 130ms ease,
    transform 80ms ease;
}
.btn:active {
  transform: scale(0.97);
}

.btn-sm {
  font-size: 0.8125rem;
  padding: 0.4375rem 0.9375rem;
}
.btn-lg {
  font-size: 1rem;
  padding: 0.8125rem 1.625rem;
}

.btn-primary {
  background: var(--violet);
  color: oklch(10% 0.02 250);
  border-color: var(--violet);
}
.btn-primary:hover {
  background: var(--violet-hover);
  border-color: var(--violet-hover);
}

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

/* ============================================================
   STICKY NAV
============================================================ */
#nav {
  position: sticky;
  top: 0;
  height: var(--nav-h);
  z-index: 200;
  background: oklch(12% 0.03 250 / 0.82);
  backdrop-filter: blur(14px) saturate(1.4);
  -webkit-backdrop-filter: blur(14px) saturate(1.4);
  border-bottom: 1px solid var(--border);
}

.nav-inner {
  max-width: var(--max-w);
  margin-inline: auto;
  padding-inline: var(--pad-x);
  height: 100%;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.nav-logo {
  display: flex;
  align-items: center;
  flex-shrink: 0;
  margin-right: auto;
}

.nav-logo img {
  display: block;
  height: 40px;
  width: auto;
}

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

.nav-links li:not(.nav-cta) a {
  display: block;
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--text-muted);
  padding: 0.5rem 0.8125rem;
  border-radius: var(--r-md);
  transition:
    color 130ms,
    background 130ms;
}
.nav-links li:not(.nav-cta) a:hover {
  color: var(--text);
  background: var(--surface-hover);
}

.nav-cta {
  margin-left: 0.625rem;
}

.nav-hamburger {
  display: none;
  align-items: center;
  justify-content: center;
  color: var(--text);
  padding: 0.5rem;
  border-radius: var(--r-md);
  transition: background 130ms;
  margin-left: auto;
}
.nav-hamburger:hover {
  background: var(--surface-hover);
}

/* ============================================================
   HERO
============================================================ */
#hero {
  position: relative;
  overflow: hidden;
  padding-block: 7rem 5rem;
}

.hero-glow {
  position: absolute;
  width: 900px;
  height: 900px;
  border-radius: 50%;
  background: radial-gradient(
    circle at center,
    oklch(72% 0.22 285 / 0.14) 0%,
    oklch(72% 0.22 285 / 0.05) 42%,
    transparent 70%
  );
  left: 62%;
  top: 50%;
  transform: translate(-50%, -50%);
  pointer-events: none;
  z-index: 0;
}

#hero .container {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4rem;
  align-items: center;
}

.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.6875rem;
  font-weight: 600;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: var(--violet);
  background: var(--violet-dim);
  border: 1px solid oklch(72% 0.22 285 / 0.28);
  padding: 0.3125rem 0.9375rem;
  border-radius: var(--r-full);
  margin-bottom: 1.625rem;
}

#hero h1 {
  font-size: clamp(2.75rem, 5.5vw, 4.375rem);
  font-weight: 800;
  line-height: 1.03;
  letter-spacing: -0.035em;
  color: var(--text);
  margin-bottom: 1.5rem;
}

#hero h1 em {
  font-style: italic;
  color: var(--violet);
}

.hero-sub {
  font-size: 1.125rem;
  color: var(--text-2);
  line-height: 1.65;
  margin-bottom: 2.25rem;
  max-width: 460px;
}

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

.demo-frame {
  border: 1px solid var(--border);
  border-radius: var(--r-2xl);
  aspect-ratio: 16 / 10;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--surface);
  color: var(--text-muted);
  font-size: 0.875rem;
  font-weight: 500;
  gap: 0.625rem;
  flex-direction: column;
}

.demo-frame i[data-lucide] {
  opacity: 0.35;
}

/* ============================================================
   HOW IT WORKS
============================================================ */
#how-it-works {
  background: var(--bg-2);
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}

.section-header-center {
  text-align: center;
  margin-bottom: 3.5rem;
}
.section-header-center .section-sub {
  margin-inline: auto;
}

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

.step-card {
  position: relative;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-xl);
  padding: 1.875rem 1.75rem;
  overflow: hidden;
  transition:
    background 200ms ease,
    border-color 200ms ease,
    transform 200ms ease;
}

.step-card::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: linear-gradient(
    90deg,
    transparent,
    var(--violet) 50%,
    transparent
  );
  opacity: 0.45;
  transition: opacity 200ms ease;
}

.step-card::after {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 80px;
  background: linear-gradient(
    to bottom,
    oklch(72% 0.22 285 / 0.05),
    transparent
  );
  pointer-events: none;
}

.step-card:hover {
  background: var(--surface-hover);
  border-color: var(--border-hover);
  transform: translateY(-3px);
}
.step-card:hover::before {
  opacity: 1;
}

.step-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.375rem;
}

.step-icon-wrap {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 2.625rem;
  height: 2.625rem;
  border-radius: var(--r-lg);
  background: var(--violet-dim);
  border: 1px solid oklch(72% 0.22 285 / 0.2);
  color: var(--violet);
  transition:
    background 200ms ease,
    border-color 200ms ease;
}
.step-card:hover .step-icon-wrap {
  background: oklch(36% 0.16 285);
  border-color: oklch(72% 0.22 285 / 0.45);
}

.step-num {
  font-size: 1.625rem;
  font-weight: 800;
  letter-spacing: -0.05em;
  line-height: 1;
  color: var(--border);
  transition: color 200ms ease;
}
.step-card:hover .step-num {
  color: var(--border-hover);
}

.step-card h3 {
  font-size: 1.125rem;
  font-weight: 700;
  letter-spacing: -0.015em;
  color: var(--text);
  margin-bottom: 0.5rem;
}
.step-card p {
  font-size: 0.9375rem;
  color: var(--text-2);
  line-height: 1.6;
}

/* ============================================================
   FEATURES
============================================================ */
#features .section-header {
  margin-bottom: 3rem;
}

.features-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1.25rem;
}

.feature-item {
  position: relative;
  display: flex;
  gap: 1.125rem;
  align-items: flex-start;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-xl);
  padding: 1.625rem 1.5rem;
  overflow: hidden;
  transition:
    background 200ms ease,
    border-color 200ms ease,
    transform 200ms ease;
}

.feature-item::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: linear-gradient(
    90deg,
    transparent,
    var(--violet) 50%,
    transparent
  );
  opacity: 0.45;
  transition: opacity 200ms ease;
}

.feature-item::after {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 80px;
  background: linear-gradient(
    to bottom,
    oklch(72% 0.22 285 / 0.05),
    transparent
  );
  pointer-events: none;
}

.feature-item:hover {
  background: var(--surface-hover);
  border-color: var(--border-hover);
  transform: translateY(-3px);
}
.feature-item:hover::before {
  opacity: 1;
}

.feature-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 2.625rem;
  height: 2.625rem;
  min-width: 2.625rem;
  border-radius: var(--r-lg);
  background: var(--violet-dim);
  border: 1px solid oklch(72% 0.22 285 / 0.2);
  color: var(--violet);
  flex-shrink: 0;
  transition:
    background 200ms ease,
    border-color 200ms ease;
}
.feature-item:hover .feature-icon {
  background: oklch(36% 0.16 285);
  border-color: oklch(72% 0.22 285 / 0.45);
}

.feature-item h3 {
  font-size: 1rem;
  font-weight: 600;
  letter-spacing: -0.01em;
  color: var(--text);
  margin-bottom: 0.3rem;
}
.feature-item p {
  font-size: 0.875rem;
  color: var(--text-2);
  line-height: 1.55;
}

/* ============================================================
   OPEN SOURCE BANNER
============================================================ */
#open-source {
  padding-block: 5rem;
}

.oss-card {
  position: relative;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-2xl);
  padding: 4.5rem 2rem;
  text-align: center;
  overflow: hidden;
}

.oss-card::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: linear-gradient(
    90deg,
    transparent,
    var(--violet) 50%,
    transparent
  );
  opacity: 0.45;
}

.oss-card::after {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 120px;
  background: linear-gradient(
    to bottom,
    oklch(72% 0.22 285 / 0.05),
    transparent
  );
  pointer-events: none;
}

.oss-card h2 {
  font-size: clamp(1.875rem, 3.5vw, 2.75rem);
  font-weight: 800;
  letter-spacing: -0.025em;
  line-height: 1.1;
  color: var(--text);
  margin-bottom: 1rem;
}
.oss-card > p {
  font-size: 1.0625rem;
  color: var(--text-2);
  max-width: 480px;
  margin-inline: auto;
  margin-bottom: 2.25rem;
  line-height: 1.65;
}

/* ============================================================
   FOOTER
============================================================ */
footer {
  border-top: 1px solid var(--border);
  padding-block: 2.5rem;
}

.footer-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
  flex-wrap: wrap;
}

.footer-brand {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.footer-brand img {
  display: block;
  width: 20px;
  height: 20px;
  object-fit: contain;
}

.footer-copy {
  font-size: 0.875rem;
  color: var(--text-muted);
}

.footer-links {
  display: flex;
  gap: 1.625rem;
}
.footer-links a {
  font-size: 0.875rem;
  color: var(--text-muted);
  transition: color 130ms;
}
.footer-links a:hover {
  color: var(--text);
}

/* ============================================================
   FADE-UP ANIMATIONS
============================================================ */
@keyframes fadeUp {
  from {
    opacity: 0;
    transform: translateY(22px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.fade-up {
  opacity: 0;
  transform: translateY(22px);
}

.fade-up.visible {
  animation: fadeUp 0.55s cubic-bezier(0, 0, 0.2, 1) both;
  animation-delay: var(--delay, 0ms);
}

/* ============================================================
   RESPONSIVE
============================================================ */
@media (max-width: 768px) {
  section {
    padding-block: 4rem;
  }
  #hero {
    padding-block: 5.5rem 4rem;
  }

  .nav-hamburger {
    display: flex;
  }
  .nav-links {
    display: none;
    position: fixed;
    top: var(--nav-h);
    left: 0;
    right: 0;
    z-index: 201;
    flex-direction: column;
    align-items: stretch;
    background: oklch(17% 0.036 250);
    border-bottom: 1px solid var(--border);
    padding: 0.5rem 1.5rem 1.25rem;
    gap: 0;
  }
  .nav-links.open {
    display: flex;
  }
  .nav-links li:not(.nav-cta) a {
    padding: 0.8125rem 0.375rem;
    border-radius: 0;
    border-bottom: 1px solid var(--border);
    font-size: 0.9375rem;
  }
  .nav-links li:not(.nav-cta):last-of-type a {
    border-bottom: none;
  }
  .nav-cta {
    margin-left: 0;
    margin-top: 0.75rem;
  }
  .nav-cta .btn {
    display: flex;
    justify-content: center;
  }

  #hero .container {
    grid-template-columns: 1fr;
    gap: 3rem;
  }
  .hero-sub {
    max-width: 100%;
  }
  .hero-glow {
    width: 600px;
    height: 600px;
    left: 50%;
    top: 25%;
  }

  .steps {
    grid-template-columns: 1fr;
    gap: 1rem;
  }
  .features-grid {
    grid-template-columns: 1fr;
  }

  .oss-card {
    padding: 3rem 1.5rem;
  }

  .footer-inner {
    flex-direction: column;
    align-items: flex-start;
    gap: 1rem;
  }
}

@media (max-width: 480px) {
  .hero-actions {
    flex-direction: column;
  }
  .hero-actions .btn {
    justify-content: center;
  }
}
