/* ============================================
   NOVASTACK DESIGN SYSTEM
   ============================================ */

/* --------------------------------------------
   1. COLOR PALETTE & THEME
   -------------------------------------------- */
:root {
  /* Light Theme (Default) */
  --bg: #F9FAFB;
  --surface: #FFFFFF;
  --surface-translucent: rgba(255, 255, 255, 0.7);
  --text-main: #111827;
  --text-muted: #6B7280;
  --brand: #4F46E5;
  --brand-hover: #4338CA;
  --brand-glow: rgba(79, 70, 229, 0.15);
  --border: #E5E7EB;
  --border-strong: #D1D5DB;
  --grid-color: rgba(0, 0, 0, 0.04);

  /* Typography */
  --font-display: 'Space Grotesk', system-ui, -apple-system, sans-serif;
  --font-body: 'Inter', system-ui, -apple-system, sans-serif;

  /* Type Scale */
  --text-xs: 0.75rem;
  --text-sm: 0.875rem;
  --text-base: 1rem;
  --text-lg: 1.125rem;
  --text-xl: 1.25rem;
  --text-2xl: 1.5rem;
  --text-3xl: 1.875rem;
  --text-4xl: 2.25rem;
  --text-5xl: 3rem;
  --text-6xl: 3.75rem;

  /* Spacing (8px base) */
  --space-1: 0.25rem;
  --space-2: 0.5rem;
  --space-3: 0.75rem;
  --space-4: 1rem;
  --space-5: 1.25rem;
  --space-6: 1.5rem;
  --space-8: 2rem;
  --space-10: 2.5rem;
  --space-12: 3rem;
  --space-16: 4rem;
  --space-20: 5rem;
  --space-24: 6rem;
  --space-32: 8rem;

  /* Layout */
  --container-xl: 1000px;
  --radius-sm: 4px;
  --radius-md: 8px;
  --radius-lg: 12px;
  --radius-xl: 16px;
  --radius-2xl: 24px;
  --radius-full: 9999px;

  /* Shadows */
  --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
  --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1);
  --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1);
  --shadow-xl: 0 20px 25px -5px rgb(0 0 0 / 0.1);

  /* Transitions */
  --transition-fast: 150ms ease;
  --transition-base: 200ms ease;
  --transition-slow: 300ms ease;
}

/* Dark Theme */
[data-theme="dark"] {
  --bg: #0B1120;
  --surface: #1E293B;
  --surface-translucent: rgba(30, 41, 59, 0.7);
  --text-main: #F3F4F6;
  --text-muted: #94A3B8;
  --brand: #6366F1;
  --brand-hover: #818CF8;
  --brand-glow: rgba(99, 102, 241, 0.2);
  --border: #334155;
  --border-strong: #475569;
  --grid-color: rgba(255, 255, 255, 0.03);
}

/* ============================================
   RESET & BASE
   ============================================ */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  font-family: var(--font-body);
  font-size: var(--text-base);
  line-height: 1.6;
  background-color: var(--bg);
  color: var(--text-main);
  overflow-x: hidden;
  transition: background-color var(--transition-slow), color var(--transition-slow);
}

img, picture, video, svg {
  display: block;
  max-width: 100%;
}

/* ============================================
   BACKGROUND EFFECTS
   ============================================ */
.background-grid {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-image:
    linear-gradient(var(--grid-color) 1px, transparent 1px),
    linear-gradient(90deg, var(--grid-color) 1px, transparent 1px);
  background-size: 40px 40px;
  z-index: -2;
  pointer-events: none;
}

.glow-effect {
  position: fixed;
  top: -10%;
  left: 50%;
  width: 800px;
  height: 800px;
  background: radial-gradient(circle, var(--brand-glow) 0%, transparent 70%);
  transform: translateX(-50%);
  z-index: -1;
  pointer-events: none;
}

/* ============================================
   TYPOGRAPHY
   ============================================ */
h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-display);
  font-weight: 700;
  line-height: 1.15;
  letter-spacing: -0.02em;
  color: var(--text-main);
}

h1 {
  font-size: clamp(40px, 5vw, 64px);
  margin-bottom: var(--space-6);
  background: linear-gradient(to bottom right, var(--text-main), var(--text-muted));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

h2 {
  font-size: var(--text-4xl);
  margin-bottom: var(--space-6);
}

h3 {
  font-size: var(--text-xl);
  margin-bottom: var(--space-4);
}

p {
  color: var(--text-muted);
  max-width: 65ch;
}

p + p {
  margin-top: var(--space-4);
}

.text-center { text-align: center; }
.text-muted { color: var(--text-muted); }
.muted { color: var(--text-muted); font-size: var(--text-sm); }

/* ============================================
   LAYOUT
   ============================================ */
.container {
  width: 100%;
  max-width: var(--container-xl);
  margin-left: auto;
  margin-right: auto;
  padding-left: var(--space-6);
  padding-right: var(--space-6);
}

section {
  padding-top: var(--space-24);
  padding-bottom: var(--space-24);
}

.section-muted {
  background: var(--surface);
}

/* Grid */
.grid {
  display: grid;
  gap: var(--space-6);
}

.grid-2 { grid-template-columns: repeat(2, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }

/* Flex */
.flex { display: flex; }
.items-center { align-items: center; }
.justify-center { justify-content: center; }
.justify-between { justify-content: space-between; }
.gap-4 { gap: var(--space-4); }

/* ============================================
   NAVBAR
   ============================================ */
.navbar {
  position: fixed;
  top: 0;
  width: 100%;
  padding: var(--space-5) var(--space-6);
  z-index: 100;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-bottom: 1px solid transparent;
  transition: border-color var(--transition-base);
}

.navbar.scrolled {
  border-bottom-color: var(--border);
}

.nav-container {
  max-width: var(--container-xl);
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.brand {
  font-family: var(--font-display);
  font-size: 20px;
  font-weight: 700;
  color: var(--text-main);
  text-decoration: none;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: var(--space-6);
}

.nav-links a {
  color: var(--text-muted);
  text-decoration: none;
  font-size: var(--text-sm);
  font-weight: 500;
  transition: color var(--transition-fast);
}

.nav-links a:hover {
  color: var(--text-main);
}

#theme-toggle {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text-main);
  padding: var(--space-2);
  border-radius: var(--radius-md);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all var(--transition-base);
}

#theme-toggle:hover {
  background: var(--surface);
  border-color: var(--brand);
}

#theme-toggle svg {
  width: 20px;
  height: 20px;
}

/* ============================================
   BUTTONS
   ============================================ */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  padding: 14px 28px;
  font-family: var(--font-body);
  font-size: var(--text-base);
  font-weight: 500;
  line-height: 1;
  text-decoration: none;
  border: none;
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: all var(--transition-base);
}

.btn:focus-visible {
  outline: 2px solid var(--brand);
  outline-offset: 2px;
}

/* Primary Button */
.btn-primary {
  background: var(--brand);
  color: #fff;
  box-shadow: 0 4px 14px var(--brand-glow);
}

.btn-primary:hover {
  background: var(--brand-hover);
  transform: translateY(-2px);
  box-shadow: 0 8px 20px var(--brand-glow);
  color: #fff;
}

/* Secondary Button */
.btn-secondary {
  background: var(--surface);
  color: var(--text-main);
  border: 1px solid var(--border);
}

.btn-secondary:hover {
  background: var(--bg);
  border-color: var(--brand);
}

/* Ghost Button */
.btn-ghost {
  background: transparent;
  color: var(--text-main);
}

.btn-ghost:hover {
  color: var(--brand);
}

/* Text Button */
.btn-text {
  background: transparent;
  color: var(--text-main);
  padding: 14px 16px;
}

.btn-text:hover {
  color: var(--brand);
}

/* Button Sizes */
.btn-sm {
  padding: var(--space-2) var(--space-4);
  font-size: var(--text-sm);
}

.btn-lg {
  padding: var(--space-5) var(--space-10);
  font-size: var(--text-lg);
}

/* ============================================
   LINKS
   ============================================ */
a {
  color: var(--brand);
  text-decoration: none;
  transition: color var(--transition-fast);
}

a:hover {
  color: var(--brand-hover);
}

.link {
  color: var(--brand);
  font-weight: 500;
}

.link:hover {
  text-decoration: underline;
}

/* ============================================
   CARDS
   ============================================ */
.card {
  background: var(--surface-translucent);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  padding: var(--space-10);
  backdrop-filter: blur(12px);
  transition: transform var(--transition-slow), border-color var(--transition-slow);
}

.card:hover {
  transform: translateY(-4px);
}

.card h3 {
  margin-bottom: var(--space-4);
}

.card p {
  margin-bottom: var(--space-4);
}

.card-highlight {
  border-color: var(--brand);
  box-shadow: 0 20px 40px -10px var(--brand-glow);
}

/* ============================================
   HERO
   ============================================ */
.hero {
  padding-top: 180px;
  padding-bottom: var(--space-24);
  text-align: center;
}

.hero p {
  font-size: var(--text-lg);
  max-width: 680px;
  margin-left: auto;
  margin-right: auto;
  margin-bottom: var(--space-6);
}

.hero-subtitle {
  font-family: var(--font-display);
  font-size: 20px;
  color: var(--brand);
  font-weight: 500;
  margin-top: calc(var(--space-4) * -1);
  margin-bottom: var(--space-8);
}

.hero-supporting {
  font-size: var(--text-lg);
  color: var(--text-muted);
  max-width: 680px;
  margin: 0 auto var(--space-6);
}

.hero-buttons {
  display: flex;
  gap: var(--space-4);
  justify-content: center;
  flex-wrap: wrap;
  margin-bottom: var(--space-16);
}

/* ============================================
   BADGES
   ============================================ */
.badge {
  display: inline-block;
  padding: 6px 12px;
  font-size: 13px;
  font-weight: 600;
  color: var(--brand);
  background: var(--brand-glow);
  border-radius: var(--radius-full);
  margin-bottom: var(--space-6);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

/* ============================================
   SECTION INTRO
   ============================================ */
.section-intro {
  max-width: 720px;
  margin-bottom: var(--space-12);
}

.section-intro h2 {
  margin-bottom: var(--space-4);
}

/* ============================================
   FEATURES
   ============================================ */
.features {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: var(--space-20);
  align-items: start;
}

.feature-content h2 {
  margin-bottom: var(--space-4);
}

.feature-content p {
  margin-bottom: var(--space-6);
}

/* ============================================
   LISTS
   ============================================ */
ul {
  list-style: none;
}

.list-check li {
  position: relative;
  padding-left: var(--space-8);
  margin-bottom: var(--space-4);
  color: var(--text-main);
  font-weight: 500;
}

.list-check li::before {
  content: "✓";
  position: absolute;
  left: 0;
  color: var(--brand);
  font-weight: 700;
}

/* ============================================
   PRICING
   ============================================ */
.pricing-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--space-6);
}

.pricing-card {
  background: var(--surface-translucent);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  padding: var(--space-10);
  backdrop-filter: blur(12px);
  text-align: center;
}

.pricing-card.featured {
  border-color: var(--brand);
  box-shadow: 0 20px 40px -10px var(--brand-glow);
  transform: scale(1.02);
}

.pricing-card h3 {
  margin-bottom: var(--space-2);
}

.pricing-card .price {
  font-family: var(--font-display);
  font-size: var(--text-4xl);
  font-weight: 700;
  color: var(--text-main);
  margin-bottom: var(--space-6);
}

.pricing-card .price span {
  font-size: var(--text-base);
  font-weight: 400;
  color: var(--text-muted);
}

.pricing-card ul {
  margin-bottom: var(--space-8);
  text-align: left;
}

.pricing-card .btn {
  width: 100%;
}

/* ============================================
   PRODUCT CARD
   ============================================ */
.product-card {
  background: var(--surface-translucent);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  padding: var(--space-12);
  backdrop-filter: blur(12px);
}

.product-card h3 {
  font-size: var(--text-2xl);
  margin-bottom: var(--space-4);
}

.product-card .btn {
  margin-top: var(--space-6);
}

/* ============================================
   CTA
   ============================================ */
.cta {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-2xl);
  padding: var(--space-16) var(--space-6);
  text-align: center;
}

.cta h2 {
  color: var(--text-main);
}

.cta p {
  color: var(--text-muted);
  margin-left: auto;
  margin-right: auto;
  margin-bottom: var(--space-8);
}

/* ============================================
   FOOTER
   ============================================ */
footer {
  border-top: 1px solid var(--border);
  padding: var(--space-10) var(--space-6);
  text-align: center;
  color: var(--text-muted);
  font-size: var(--text-sm);
  background: var(--bg);
}

/* ============================================
   RESPONSIVE
   ============================================ */
@media (max-width: 1024px) {
  .pricing-grid {
    grid-template-columns: 1fr;
    max-width: 400px;
    margin-left: auto;
    margin-right: auto;
  }

  .pricing-card.featured {
    transform: none;
  }

  .features {
    grid-template-columns: 1fr;
    gap: var(--space-12);
  }

  .grid-3 {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 768px) {
  h1 {
    font-size: var(--text-4xl);
  }

  h2 {
    font-size: var(--text-3xl);
  }

  section {
    padding-top: var(--space-16);
    padding-bottom: var(--space-16);
  }

  .hero {
    padding-top: 140px;
    padding-bottom: var(--space-16);
  }

  .grid-2 {
    grid-template-columns: 1fr;
  }

  .nav-links {
    display: none;
  }
}

@media (max-width: 480px) {
  .container {
    padding-left: var(--space-4);
    padding-right: var(--space-4);
  }

  .hero-buttons {
    flex-direction: column;
  }

  .hero-buttons .btn {
    width: 100%;
  }
}
