/* ============================================================
   Shared Design System — 10x Website
   ============================================================ */

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

:root {
  /* ---- Color Palette ---- */
  --bg-primary: #0a0a0f;
  --bg-secondary: #12121a;
  --bg-card: #16161f;
  --bg-card-hover: #1c1c28;
  --text-primary: #f0f0f5;
  --text-secondary: #a0a0b0;
  --text-muted: #6a6a7a;
  --accent-primary: #7C3AED;
  --border-color: #2a2a3a;

  /* ---- Background Layers (alternating section depth) ---- */
  --bg-layer-0: #08080d;
  --bg-layer-1: #0a0a0f;
  --bg-layer-2: #0e0e16;
  --bg-layer-3: #13131c;

  /* ---- Activity Pattern Colors (muted for marketing) ---- */
  --ap-deep: #4A90D9;
  --ap-shallow: #D4A056;
  --ap-distraction: #D97A8E;
  --ap-positive: #10B981;
  --ap-sidebar-bg: #111118;

  /* ---- Fonts ---- */
  --font-sans: 'Inter', -apple-system, system-ui, sans-serif;
  --font-mono: 'JetBrains Mono', ui-monospace, monospace;

  /* ---- Type Scale (modular ~1.25 major third) ---- */
  --text-xs:   clamp(0.75rem, 0.7rem + 0.15vw, 0.8125rem);
  --text-sm:   clamp(0.8125rem, 0.78rem + 0.18vw, 0.875rem);
  --text-base: clamp(0.9375rem, 0.9rem + 0.2vw, 1rem);
  --text-lg:   clamp(1.0625rem, 1rem + 0.3vw, 1.125rem);
  --text-xl:   clamp(1.25rem, 1.1rem + 0.5vw, 1.375rem);
  --text-2xl:  clamp(1.5rem, 1.3rem + 0.7vw, 1.75rem);
  --text-3xl:  clamp(1.875rem, 1.5rem + 1.2vw, 2.25rem);
  --text-4xl:  clamp(2.25rem, 1.8rem + 1.8vw, 3rem);
  --text-5xl:  clamp(2.75rem, 2rem + 2.5vw, 4rem);

  /* ---- Leading (line-height) ---- */
  --leading-tight:   1.1;
  --leading-snug:    1.25;
  --leading-normal:  1.5;
  --leading-relaxed: 1.7;

  /* ---- Tracking (letter-spacing) ---- */
  --tracking-tight:   -0.025em;
  --tracking-normal:   0em;
  --tracking-wide:     0.05em;
  --tracking-wider:    0.1em;
  --tracking-widest:   0.15em;

  /* ---- Spacing Scale ---- */
  --space-xs:  clamp(0.5rem, 0.4rem + 0.3vw, 0.75rem);
  --space-sm:  clamp(0.75rem, 0.6rem + 0.5vw, 1rem);
  --space-md:  clamp(1.5rem, 1.2rem + 1vw, 2rem);
  --space-lg:  clamp(2.5rem, 2rem + 1.5vw, 3.5rem);
  --space-xl:  clamp(4rem, 3rem + 3vw, 6rem);
  --space-2xl: clamp(6rem, 4.5rem + 5vw, 10rem);
  --space-3xl: clamp(8rem, 6rem + 6.5vw, 14rem);

  /* ---- Max Widths ---- */
  --max-w-prose:   680px;
  --max-w-content: 1100px;
  --max-w-wide:    1280px;

  /* ---- Easing Curves ---- */
  --ease-out-expo: cubic-bezier(0.16, 1, 0.3, 1);
  --ease-out-quad: cubic-bezier(0.25, 0.46, 0.45, 0.94);
  --ease-in-out:   cubic-bezier(0.65, 0, 0.35, 1);

  /* ---- Durations ---- */
  --duration-fast:   150ms;
  --duration-normal: 300ms;
  --duration-slow:   500ms;
}

/* ---- Base ---- */
html {
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-sans);
  background: var(--bg-layer-0);
  color: var(--text-primary);
  margin: 0;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* ---- Noise Texture ---- */
body::after {
  content: '';
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 9999;
  opacity: 0.015;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  background-repeat: repeat;
  background-size: 256px 256px;
}

/* ============================================================
   Navigation
   ============================================================ */
nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  padding: 1rem 2rem;
  background: rgba(8, 8, 13, 0.8);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border-color);
}

.nav-inner {
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.logo {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--accent-primary);
  text-decoration: none;
}

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

.nav-links a {
  color: var(--text-secondary);
  text-decoration: none;
  font-size: var(--text-sm);
  transition: color var(--duration-fast) var(--ease-out-quad);
  position: relative;
}

.nav-links a::after {
  content: '';
  position: absolute;
  bottom: -4px;
  left: 0;
  width: 0;
  height: 1px;
  background: var(--accent-primary);
  transition: width var(--duration-normal) var(--ease-out-expo);
}

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

.nav-links a:hover::after {
  width: 100%;
}

.nav-links a.active {
  color: var(--text-primary);
}

/* ============================================================
   Buttons
   ============================================================ */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.875rem 1.75rem;
  border-radius: 12px;
  font-size: var(--text-base);
  font-weight: 600;
  text-decoration: none;
  transition: transform var(--duration-fast) var(--ease-out-expo),
              box-shadow var(--duration-normal) var(--ease-out-expo),
              background var(--duration-fast) var(--ease-out-quad),
              border-color var(--duration-fast) var(--ease-out-quad);
  cursor: pointer;
  border: none;
}

.btn-primary {
  background: var(--accent-primary);
  color: #fff;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.2),
              0 4px 16px rgba(124, 58, 237, 0.25);
}

.btn-primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2),
              0 8px 24px rgba(124, 58, 237, 0.35);
}

.btn-primary:active {
  transform: translateY(0);
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.2),
              0 2px 8px rgba(124, 58, 237, 0.2);
}

.btn-secondary {
  background: rgba(255, 255, 255, 0.04);
  color: var(--text-primary);
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.btn-secondary:hover {
  background: rgba(255, 255, 255, 0.07);
  border-color: rgba(255, 255, 255, 0.12);
}

/* ============================================================
   Footer
   ============================================================ */
footer {
  padding: 3rem 2rem;
  border-top: 1px solid var(--border-color);
  background: var(--bg-layer-0);
}

.footer-inner {
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 1.5rem;
}

.footer-links {
  display: flex;
  gap: 2rem;
}

.footer-links a {
  color: var(--text-secondary);
  text-decoration: none;
  font-size: var(--text-sm);
  transition: color var(--duration-fast) var(--ease-out-quad);
}

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

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

/* ============================================================
   Scroll Reveal (progressive enhancement — visible by default)
   ============================================================ */

/* Only hide elements when JS has proven it's running */
.js .reveal {
  opacity: 0;
  transform: translateY(30px);
  transition: opacity 0.8s var(--ease-out-expo),
              transform 0.8s var(--ease-out-expo);
}

.js .reveal.visible {
  opacity: 1;
  transform: translateY(0);
}

/* Stagger children within a reveal-group */
.js .reveal-group .reveal:nth-child(1) { transition-delay: 0ms; }
.js .reveal-group .reveal:nth-child(2) { transition-delay: 80ms; }
.js .reveal-group .reveal:nth-child(3) { transition-delay: 160ms; }
.js .reveal-group .reveal:nth-child(4) { transition-delay: 240ms; }
.js .reveal-group .reveal:nth-child(5) { transition-delay: 320ms; }
.js .reveal-group .reveal:nth-child(6) { transition-delay: 400ms; }

/* ============================================================
   Responsive — Nav
   ============================================================ */
@media (max-width: 640px) {
  nav {
    padding: 1rem;
  }

  .nav-links {
    gap: 1rem;
  }

  .footer-inner {
    flex-direction: column;
    text-align: center;
  }
}

/* ============================================================
   Reduced Motion
   ============================================================ */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }

  html {
    scroll-behavior: auto;
  }

  .js .reveal {
    opacity: 1;
    transform: none;
    transition: none;
  }

  body::after {
    display: none;
  }
}
