/* ============================================================
   Khamsa Landing Page — Design Tokens & Styles
   ============================================================ */

:root {
  /* Brand */
  --primary: #4338ca;
  --primary-light: #eef2ff;
  --primary-hover: #3730a3;
  --primary-dark: #312e81;

  /* Accent */
  --purple: #7c3aed;
  --green: #12b76a;
  --orange: #f79009;
  --red: #f04438;
  --cyan: #06b6d4;

  /* Tints */
  --green-tint: #ecfdf5;
  --blue-tint: #eef2ff;
  --purple-tint: #f5f3ff;
  --orange-tint: #fffaeb;
  --red-tint: #fff1f0;
  --cyan-tint: #ecfeff;

  /* Neutral */
  --canvas: #f9fafb;
  --surface: #ffffff;
  --ink: #0f172a;
  --ink-secondary: #475569;
  --ink-muted: #94a3b8;
  --rule: #e2e8f0;
  --rule-light: #f1f5f9;

  /* Sizing */
  --radius: 12px;
  --radius-sm: 8px;
  --radius-lg: 16px;
  --radius-xl: 20px;
  --radius-full: 9999px;

  /* Shadows */
  --shadow-xs: 0 1px 2px rgba(0,0,0,0.04);
  --shadow-sm: 0 1px 3px rgba(0,0,0,0.05), 0 4px 12px rgba(0,0,0,0.05);
  --shadow: 0 2px 8px rgba(0,0,0,0.06), 0 8px 24px rgba(0,0,0,0.06);
  --shadow-md: 0 4px 16px rgba(0,0,0,0.08), 0 12px 32px rgba(0,0,0,0.07);
  --shadow-lg: 0 8px 32px rgba(0,0,0,0.10), 0 24px 56px rgba(0,0,0,0.08);

  /* Motion */
  --ease: cubic-bezier(0.4, 0, 0.2, 1);
  --duration: 150ms;
}

/* ============================================================
   Reset & Base
   ============================================================ */

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

html {
  scroll-behavior: smooth;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  color: var(--ink);
  background: var(--canvas);
  line-height: 1.6;
  overflow-x: hidden;
}

img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }

.container {
  max-width: 1120px;
  margin: 0 auto;
  padding: 0 24px;
}

/* ============================================================
   Nav
   ============================================================ */

.nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  padding: 16px 0;
  transition: background var(--duration) var(--ease), box-shadow var(--duration) var(--ease), padding var(--duration) var(--ease);
}

.nav--scrolled {
  background: rgba(255,255,255,0.85);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  box-shadow: var(--shadow-xs);
  padding: 10px 0;
}

.nav__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.nav__brand {
  display: flex;
  align-items: center;
  gap: 10px;
}

.nav__logo {
  height: 32px;
  width: auto;
}

.nav__name {
  font-weight: 700;
  font-size: 1.2rem;
  letter-spacing: -0.02em;
}

.nav__links {
  display: flex;
  align-items: center;
  gap: 32px;
}

.nav__link {
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--ink-secondary);
  transition: color var(--duration) var(--ease);
}

.nav__link:hover { color: var(--ink); }

/* ============================================================
   Buttons
   ============================================================ */

.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: inherit;
  font-weight: 600;
  font-size: 0.9rem;
  padding: 10px 20px;
  border: none;
  border-radius: var(--radius);
  background: var(--primary);
  color: #fff;
  cursor: pointer;
  transition: background var(--duration) var(--ease), transform var(--duration) var(--ease), box-shadow var(--duration) var(--ease);
  white-space: nowrap;
}

.btn:hover {
  background: var(--primary-hover);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(67, 56, 202, 0.3);
}

.btn:active { transform: translateY(0); }

.btn--sm { padding: 8px 16px; font-size: 0.85rem; border-radius: var(--radius-sm); }
.btn--lg { padding: 14px 28px; font-size: 1rem; border-radius: var(--radius); }

/* ============================================================
   Badge
   ============================================================ */

.badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 14px;
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  color: var(--primary);
  background: var(--primary-light);
  border: 1px solid rgba(67, 56, 202, 0.15);
  border-radius: var(--radius-full);
}

/* ============================================================
   Hero
   ============================================================ */

.hero {
  position: relative;
  padding: 160px 0 100px;
  text-align: center;
  overflow: hidden;
}

.hero__inner {
  position: relative;
  z-index: 1;
}

.hero__badge {
  margin-bottom: 24px;
}

.hero__title {
  font-size: clamp(2.4rem, 5.5vw, 4rem);
  font-weight: 800;
  line-height: 1.1;
  letter-spacing: -0.03em;
  margin-bottom: 20px;
}

.hero__accent {
  background: linear-gradient(135deg, var(--primary) 0%, var(--purple) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.hero__lead {
  font-size: clamp(1.05rem, 2vw, 1.2rem);
  color: var(--ink-secondary);
  max-width: 560px;
  margin: 0 auto 36px;
  line-height: 1.7;
}

.hero__cta {
  margin-bottom: 56px;
}

.hero__sub {
  margin-top: 12px;
  font-size: 0.82rem;
  color: var(--ink-muted);
}

.hero__stats {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 32px;
}

.stat { text-align: center; }

.stat__number {
  display: block;
  font-size: 1.8rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  background: linear-gradient(135deg, var(--ink) 0%, var(--ink-secondary) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.stat__label {
  font-size: 0.82rem;
  color: var(--ink-muted);
  font-weight: 500;
}

.stat__divider {
  width: 1px;
  height: 40px;
  background: var(--rule);
}

.hero__glow {
  position: absolute;
  top: -200px;
  left: 50%;
  transform: translateX(-50%);
  width: 800px;
  height: 800px;
  background: radial-gradient(circle, rgba(67, 56, 202, 0.08) 0%, rgba(124, 58, 237, 0.04) 40%, transparent 70%);
  pointer-events: none;
  z-index: 0;
}

/* ============================================================
   Section Header
   ============================================================ */

.section-header {
  text-align: center;
  margin-bottom: 56px;
}

.section-tag {
  display: inline-block;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--primary);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: 12px;
}

.section-title {
  font-size: clamp(1.8rem, 3.5vw, 2.4rem);
  font-weight: 800;
  letter-spacing: -0.025em;
  line-height: 1.2;
}

/* ============================================================
   Features
   ============================================================ */

.features {
  padding: 100px 0;
}

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

.feature-card {
  background: var(--surface);
  border: 1px solid var(--rule-light);
  border-radius: var(--radius-lg);
  padding: 32px 28px;
  transition: transform 0.3s var(--ease), box-shadow 0.3s var(--ease), border-color 0.3s var(--ease);
  /* Animation */
  opacity: 0;
  transform: translateY(20px);
}

.feature-card.is-visible {
  opacity: 1;
  transform: translateY(0);
  transition: opacity 0.5s var(--ease), transform 0.5s var(--ease), box-shadow 0.3s var(--ease), border-color 0.3s var(--ease);
}

.feature-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-md);
  border-color: var(--rule);
}

.feature-card__icon {
  width: 48px;
  height: 48px;
  border-radius: var(--radius);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 20px;
}

.feature-card__icon--green  { background: var(--green-tint);  color: var(--green);  }
.feature-card__icon--blue   { background: var(--blue-tint);   color: var(--primary); }
.feature-card__icon--purple { background: var(--purple-tint); color: var(--purple); }
.feature-card__icon--orange { background: var(--orange-tint); color: var(--orange); }
.feature-card__icon--red    { background: var(--red-tint);    color: var(--red);    }
.feature-card__icon--cyan   { background: var(--cyan-tint);   color: var(--cyan);   }

.feature-card__title {
  font-size: 1.05rem;
  font-weight: 700;
  margin-bottom: 8px;
  letter-spacing: -0.01em;
}

.feature-card__desc {
  font-size: 0.9rem;
  color: var(--ink-secondary);
  line-height: 1.65;
}

/* ============================================================
   How it works
   ============================================================ */

.how {
  padding: 100px 0;
  background: var(--surface);
}

.how__steps {
  max-width: 600px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  align-items: stretch;
}

.step {
  display: flex;
  align-items: flex-start;
  gap: 24px;
  /* Animation */
  opacity: 0;
  transform: translateX(-20px);
}

.step.is-visible {
  opacity: 1;
  transform: translateX(0);
  transition: opacity 0.5s var(--ease), transform 0.5s var(--ease);
}

.step__number {
  flex-shrink: 0;
  width: 48px;
  height: 48px;
  border-radius: var(--radius-full);
  background: linear-gradient(135deg, var(--primary), var(--purple));
  color: #fff;
  font-weight: 800;
  font-size: 1.2rem;
  display: flex;
  align-items: center;
  justify-content: center;
}

.step__content { padding-top: 4px; }

.step__title {
  font-size: 1.1rem;
  font-weight: 700;
  margin-bottom: 4px;
  letter-spacing: -0.01em;
}

.step__desc {
  font-size: 0.9rem;
  color: var(--ink-secondary);
  line-height: 1.6;
}

.step__connector {
  width: 2px;
  height: 32px;
  margin-left: 23px;
  background: linear-gradient(to bottom, var(--primary), var(--purple));
  opacity: 0.2;
  border-radius: 1px;
}

/* ============================================================
   CTA / Waitlist
   ============================================================ */

.cta {
  padding: 100px 0 120px;
}

.cta__card {
  position: relative;
  background: var(--surface);
  border: 1px solid var(--rule);
  border-radius: var(--radius-xl);
  padding: 64px 48px;
  text-align: center;
  overflow: hidden;
  /* Animation */
  opacity: 0;
  transform: translateY(20px);
}

.cta__card.is-visible {
  opacity: 1;
  transform: translateY(0);
  transition: opacity 0.6s var(--ease), transform 0.6s var(--ease);
}

.cta__glow {
  position: absolute;
  top: -100px;
  left: 50%;
  transform: translateX(-50%);
  width: 500px;
  height: 500px;
  background: radial-gradient(circle, rgba(67, 56, 202, 0.06) 0%, transparent 60%);
  pointer-events: none;
}

.cta__title {
  font-size: clamp(1.6rem, 3vw, 2.2rem);
  font-weight: 800;
  letter-spacing: -0.025em;
  margin-bottom: 12px;
  position: relative;
}

.cta__desc {
  font-size: 1rem;
  color: var(--ink-secondary);
  max-width: 480px;
  margin: 0 auto 32px;
  line-height: 1.7;
  position: relative;
}

.cta__form { position: relative; }

.cta__input-group {
  display: flex;
  gap: 12px;
  max-width: 460px;
  margin: 0 auto;
}

.cta__input {
  flex: 1;
  padding: 14px 18px;
  font-family: inherit;
  font-size: 0.95rem;
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  background: var(--canvas);
  color: var(--ink);
  outline: none;
  transition: border-color var(--duration) var(--ease), box-shadow var(--duration) var(--ease);
}

.cta__input::placeholder { color: var(--ink-muted); }

.cta__input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(67, 56, 202, 0.1);
}

.cta__btn {
  flex-shrink: 0;
}

.cta__hint {
  margin-top: 12px;
  font-size: 0.82rem;
  color: var(--ink-muted);
}

.cta__success {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--green);
  padding: 20px;
  animation: fadeIn 0.4s var(--ease);
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ============================================================
   Footer
   ============================================================ */

.footer {
  padding: 32px 0;
  border-top: 1px solid var(--rule-light);
}

.footer__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

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

.footer__logo {
  height: 24px;
  width: auto;
}

.footer__copy {
  font-size: 0.82rem;
  color: var(--ink-muted);
}

.footer__links {
  display: flex;
  gap: 20px;
}

.footer__link {
  font-size: 0.85rem;
  color: var(--ink-secondary);
  font-weight: 500;
  transition: color var(--duration) var(--ease);
}

.footer__link:hover { color: var(--primary); }

/* ============================================================
   Responsive
   ============================================================ */

@media (max-width: 768px) {
  .hero { padding: 120px 0 72px; }

  .hero__stats { gap: 20px; }

  .stat__number { font-size: 1.4rem; }

  .features__grid {
    grid-template-columns: 1fr;
    gap: 16px;
  }

  .nav__links .nav__link { display: none; }

  .cta__card { padding: 48px 24px; }

  .cta__input-group {
    flex-direction: column;
  }

  .footer__inner {
    flex-direction: column;
    gap: 12px;
    text-align: center;
  }
}

@media (min-width: 769px) and (max-width: 1024px) {
  .features__grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

/* Staggered animation delays for feature cards */
.feature-card:nth-child(1) { transition-delay: 0s; }
.feature-card:nth-child(2) { transition-delay: 0.08s; }
.feature-card:nth-child(3) { transition-delay: 0.16s; }
.feature-card:nth-child(4) { transition-delay: 0.24s; }
.feature-card:nth-child(5) { transition-delay: 0.32s; }
.feature-card:nth-child(6) { transition-delay: 0.40s; }

/* Staggered animation delays for steps */
.step:nth-of-type(1) { transition-delay: 0s; }
.step:nth-of-type(2) { transition-delay: 0.12s; }
.step:nth-of-type(3) { transition-delay: 0.24s; }
.step:nth-of-type(4) { transition-delay: 0.36s; }
