/* ============================================
   Khaos Machine — Static Site Styles
   ============================================ */

/* Fonts */
@font-face {
  font-family: 'Inter';
  font-style: normal;
  font-weight: 300 900;
  font-display: fallback;
  src: url('../fonts/Inter-Variable.woff2') format('woff2');
  font-stretch: normal;
}

@font-face {
  font-family: 'Sora';
  font-style: normal;
  font-weight: 400;
  font-display: fallback;
  src: url('../fonts/sora-400.woff2') format('woff2');
}

@font-face {
  font-family: 'Sora';
  font-style: normal;
  font-weight: 600;
  font-display: fallback;
  src: url('../fonts/sora-600.woff2') format('woff2');
}

/* Design Tokens — Light Mode */
:root {
  --color-base: #ffffff;
  --color-contrast: #111111;
  --color-contrast-2: #636363;
  --color-contrast-3: #0c0a3e;
  --color-accent: #070623;
  --color-gold: #ffcc00;
  --color-muted: #adadad;
  --color-bg-dark: #070623;
  --color-bg-light: #ffffff;
  --color-bg-alt: #f7f7f8;
  --color-border: #eeeeee;
  --color-input-bg: #ffffff;
  --color-input-border: rgba(0, 0, 0, 0.25);

  --font-body: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --font-heading: 'Sora', 'Inter', sans-serif;

  --spacing-sm: 1rem;
  --spacing-md: 2rem;
  --spacing-lg: 3rem;
  --spacing-xl: 5rem;

  --max-width: 1200px;
  --radius: 1.5rem;
  --radius-lg: 2.5rem;
  --shadow-1: 0 4px 20px rgba(0, 0, 0, 0.08);
  --shadow-2: 0 8px 40px rgba(0, 0, 0, 0.12);

  color-scheme: light dark;
}

/* Dark Mode */
@media (prefers-color-scheme: dark) {
  :root {
    --color-base: #0d0b2e;
    --color-contrast: #e8e8e8;
    --color-contrast-2: #a0a0a0;
    --color-contrast-3: #1a1845;
    --color-bg-light: #0d0b2e;
    --color-bg-alt: #111040;
    --color-border: #1a1845;
    --color-input-bg: #1a1845;
    --color-input-border: rgba(255, 255, 255, 0.15);
  }
}

/* Reset */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }

body {
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.6;
  color: var(--color-contrast);
  background: var(--color-bg-light);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

img { max-width: 100%; height: auto; display: block; }
a { color: inherit; text-decoration: none; }
ul { list-style: none; }

/* Layout */
.container {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 var(--spacing-md);
}

.section {
  padding: var(--spacing-xl) 0;
}

/* ============================================
   Scroll Animations
   ============================================ */
.fade-in {
  opacity: 0;
  transform: translateY(30px);
  transition: opacity 0.7s ease-out, transform 0.7s ease-out;
}

.fade-in.visible {
  opacity: 1;
  transform: translateY(0);
}

.fade-in-left {
  opacity: 0;
  transform: translateX(-40px);
  transition: opacity 0.7s ease-out, transform 0.7s ease-out;
}

.fade-in-left.visible {
  opacity: 1;
  transform: translateX(0);
}

.fade-in-right {
  opacity: 0;
  transform: translateX(40px);
  transition: opacity 0.7s ease-out, transform 0.7s ease-out;
}

.fade-in-right.visible {
  opacity: 1;
  transform: translateX(0);
}

/* Stagger children */
.stagger-children .fade-in:nth-child(1) { transition-delay: 0s; }
.stagger-children .fade-in:nth-child(2) { transition-delay: 0.1s; }
.stagger-children .fade-in:nth-child(3) { transition-delay: 0.2s; }
.stagger-children .fade-in:nth-child(4) { transition-delay: 0.3s; }

/* ============================================
   Header / Nav
   ============================================ */
.site-header {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  padding: var(--spacing-sm) 0;
}

.site-header .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.site-brand {
  display: flex;
  align-items: center;
  gap: 0;
}

.site-brand img {
  width: 56px;
  height: 56px;
}

.site-brand h1 {
  font-family: var(--font-heading);
  font-size: 1.5rem;
  font-weight: 600;
  text-transform: lowercase;
  letter-spacing: -0.04em;
  color: var(--color-gold);
}

.site-brand h1 a { color: inherit; }

.nav-links {
  display: flex;
  align-items: center;
  gap: var(--spacing-md);
}

.nav-links a {
  color: #ffffff;
  font-size: 0.9rem;
  transition: opacity 0.2s;
}

.nav-links a:hover { opacity: 0.8; }

/* Mobile nav toggle */
.nav-toggle {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  padding: 8px;
}

.nav-toggle svg { fill: #ffffff; }

/* Button */
.btn {
  display: inline-block;
  padding: 0.65rem 1.5rem;
  border-radius: 6px;
  font-size: 0.9rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.3s;
  border: none;
}

.btn-primary {
  background: var(--color-gold);
  color: #070623 !important;
  font-weight: 600;
}

.btn-primary:hover {
  background: #ffe033;
  color: #070623 !important;
  transform: translateY(-2px);
  box-shadow: 0 4px 15px rgba(255, 204, 0, 0.3);
}

.btn-primary-dark {
  background: var(--color-accent);
  color: var(--color-base);
}

.btn-primary-dark:hover {
  background: #0a0836;
  transform: translateY(-2px);
  box-shadow: 0 4px 15px rgba(7, 6, 35, 0.4);
}

/* ============================================
   Hero — Parallax
   ============================================ */
.hero {
  position: relative;
  min-height: 90vh;
  display: flex;
  align-items: center;
  overflow: hidden;
}

.hero-bg {
  position: absolute;
  inset: -20% 0;
  z-index: 0;
  will-change: transform;
}

.hero-bg img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: 0% 100%;
}

.hero-bg::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(
    135deg,
    rgba(7, 6, 35, 0.85) 0%,
    rgba(7, 6, 35, 0.65) 50%,
    rgba(7, 6, 35, 0.75) 100%
  );
}

.hero-content {
  position: relative;
  z-index: 1;
  max-width: 565px;
  padding: 8rem 0 var(--spacing-xl);
}

.hero-content h1 {
  font-family: var(--font-heading);
  font-size: clamp(2.25rem, 5vw, 3.25rem);
  font-weight: 600;
  line-height: 1.12;
  color: #ffffff;
  margin-bottom: var(--spacing-sm);
}

.hero-content p {
  color: rgba(255, 255, 255, 0.85);
  font-size: 1.15rem;
  margin-bottom: var(--spacing-md);
  line-height: 1.7;
}

/* ============================================
   Feature Screenshot — Parallax
   ============================================ */
.feature-screenshot {
  padding: var(--spacing-lg) 0;
  position: relative;
}

.feature-screenshot .container {
  position: relative;
}

.feature-screenshot img {
  width: 100%;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-2);
  transition: transform 0.3s ease-out;
}

/* ============================================
   Features Grid
   ============================================ */
.features-grid {
  display: grid;
  grid-template-columns: 1.2fr 1fr 1fr 1fr;
  gap: var(--spacing-md);
  align-items: start;
}

.features-grid .features-heading {
  font-family: var(--font-heading);
  font-size: 1.75rem;
  font-weight: 600;
  line-height: 1.2;
  color: var(--color-contrast);
}

.features-grid .feature-item {
  padding: var(--spacing-sm) 0;
}

.features-grid .feature-item h3 {
  font-size: 1.1rem;
  font-weight: 600;
  margin-bottom: 0.5rem;
}

.features-grid .feature-item p {
  color: var(--color-contrast-2);
  font-size: 0.95rem;
  line-height: 1.6;
}

/* Feature video */
.feature-video {
  margin-top: var(--spacing-md);
}

.feature-video video {
  width: 100%;
  border-radius: var(--radius);
  box-shadow: var(--shadow-1);
}

/* ============================================
   Two-Column Feature — Parallax Image
   ============================================ */
.split-feature {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--spacing-xl);
  align-items: center;
}

.split-feature .feature-list {
  display: flex;
  flex-direction: column;
  gap: var(--spacing-md);
}

.split-feature h2 {
  font-family: var(--font-heading);
  font-size: clamp(1.75rem, 4vw, 2.5rem);
  font-weight: 600;
  line-height: 1.15;
  margin-bottom: var(--spacing-sm);
}

.feature-row {
  display: flex;
  gap: var(--spacing-sm);
  align-items: flex-start;
}

.feature-row .feature-icon {
  font-size: 1.5rem;
  color: var(--color-contrast-2);
  flex-shrink: 0;
  width: 2rem;
  text-align: center;
}

.feature-row h3 {
  font-size: 1.1rem;
  font-weight: 600;
  margin-bottom: 0.25rem;
}

.feature-row p {
  color: var(--color-contrast-2);
  font-size: 0.95rem;
}

.split-feature .feature-image {
  position: relative;
  overflow: hidden;
  border-radius: var(--radius);
}

.split-feature .feature-image img {
  border-radius: var(--radius);
  box-shadow: var(--shadow-2);
  width: 100%;
  transition: transform 6s ease-out;
}

.split-feature .feature-image:hover img {
  transform: scale(1.03);
}

/* ============================================
   Collaborate Cards — Parallax Overlapping
   ============================================ */
.collab-section {
  background: var(--color-bg-alt);
  padding: var(--spacing-xl) 0;
}

.collab-heading {
  text-align: center;
  font-family: var(--font-heading);
  font-size: clamp(1.5rem, 3vw, 2rem);
  font-weight: 600;
  margin-bottom: var(--spacing-lg);
}

.collab-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0;
  box-shadow: var(--shadow-2);
  border-radius: 20px;
  overflow: hidden;
}

.collab-card {
  position: relative;
  min-height: 50vh;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding: 48px;
  overflow: hidden;
}

.collab-card img {
  position: absolute;
  inset: -10%;
  width: 120%;
  height: 120%;
  object-fit: cover;
  filter: brightness(0.45) saturate(0.8);
  transition: transform 0.5s ease-out, filter 0.5s ease-out;
  will-change: transform;
}

.collab-card:hover img {
  transform: scale(1.05);
  filter: brightness(0.55) saturate(1);
}

.collab-card .card-content {
  position: relative;
  z-index: 1;
  transform: translateY(0);
  transition: transform 0.3s ease-out;
}

.collab-card:hover .card-content {
  transform: translateY(-5px);
}

.collab-card h3 {
  color: var(--color-base);
  font-size: 1.3rem;
  font-weight: 600;
  margin-bottom: 0.25rem;
}

.collab-card p {
  color: rgba(255, 255, 255, 0.75);
  font-size: 0.95rem;
}

/* ============================================
   CTA Section — Parallax BG
   ============================================ */
.cta-section {
  background: var(--color-accent);
  color: var(--color-base);
  text-align: center;
  padding: var(--spacing-xl) 0;
  position: relative;
  overflow: hidden;
}

/* Subtle animated gradient */
.cta-section::before {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(
    ellipse at 30% 50%,
    rgba(54, 80, 181, 0.15) 0%,
    transparent 60%
  ),
  radial-gradient(
    ellipse at 70% 50%,
    rgba(255, 204, 0, 0.05) 0%,
    transparent 50%
  );
  pointer-events: none;
}

.cta-section .container {
  position: relative;
  z-index: 1;
}

.cta-section h2 {
  font-family: var(--font-heading);
  font-size: clamp(1.75rem, 4vw, 2.5rem);
  font-weight: 600;
  margin-bottom: var(--spacing-sm);
  color: var(--color-gold);
}

.cta-section p {
  max-width: 600px;
  margin: 0 auto var(--spacing-md);
  opacity: 0.85;
  font-size: 1.05rem;
  line-height: 1.7;
  color: #ffffff;
}

.cta-section .btn {
  background: var(--color-gold);
  color: var(--color-accent);
  font-weight: 600;
  padding: 0.8rem 2rem;
}

.cta-section .btn:hover {
  background: #fff;
  transform: translateY(-2px);
  box-shadow: 0 4px 20px rgba(255, 204, 0, 0.3);
}

/* ============================================
   Footer
   ============================================ */
.site-footer {
  padding: var(--spacing-xl) 0 var(--spacing-lg);
  border-top: 1px solid var(--color-border);
}

.footer-grid {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: var(--spacing-lg);
}

.footer-brand {
  display: flex;
  flex-direction: column;
  gap: var(--spacing-sm);
}

.footer-brand .site-brand h1 {
  color: var(--color-contrast);
}

.footer-socials {
  display: flex;
  gap: 1rem;
}

.footer-socials a {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  color: var(--color-contrast);
  transition: color 0.2s;
}

.footer-socials a:hover { color: var(--color-gold); }
.footer-socials svg { width: 24px; height: 24px; fill: currentColor; }

.footer-links-group h4 {
  font-size: 1rem;
  font-weight: 600;
  margin-bottom: var(--spacing-sm);
}

.footer-links-group ul {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.footer-links-group a {
  font-size: 0.875rem;
  color: var(--color-contrast-2);
  transition: color 0.2s;
}

.footer-links-group a:hover { color: var(--color-contrast); }

/* ============================================
   About Page
   ============================================ */
.page-hero {
  background: var(--color-accent);
  color: var(--color-base);
  padding: 8rem 0 var(--spacing-xl);
  text-align: center;
  position: relative;
  overflow: hidden;
}

.page-hero::before {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(
    ellipse at 50% 80%,
    rgba(54, 80, 181, 0.2) 0%,
    transparent 60%
  );
  pointer-events: none;
}

.page-hero h1 {
  font-family: var(--font-heading);
  font-size: clamp(2rem, 5vw, 3rem);
  font-weight: 600;
  margin-bottom: var(--spacing-sm);
  position: relative;
  color: #ffffff;
}

.page-hero p {
  max-width: 700px;
  margin: 0 auto;
  opacity: 0.85;
  font-size: 1.1rem;
  position: relative;
  color: #ffffff;
}

.about-section h2 {
  font-family: var(--font-heading);
  font-size: 1.75rem;
  font-weight: 600;
  margin-bottom: var(--spacing-sm);
}

.values-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--spacing-md);
}

.value-card {
  padding: var(--spacing-sm) 0;
}

.value-card h3 {
  font-weight: 600;
  margin-bottom: 0.5rem;
}

.value-card p {
  color: var(--color-contrast-2);
  font-size: 0.95rem;
  line-height: 1.6;
}

/* ============================================
   Waitlist Page
   ============================================ */
.waitlist-section {
  max-width: 600px;
  margin: 0 auto;
  text-align: center;
}

.waitlist-section h1 {
  font-family: var(--font-heading);
  font-size: 2rem;
  margin-bottom: var(--spacing-sm);
}

/* ============================================
   Responsive
   ============================================ */
@media (max-width: 1024px) {
  .features-grid {
    grid-template-columns: 1fr 1fr;
    gap: var(--spacing-lg);
  }
}

@media (max-width: 768px) {
  .nav-links { display: none; }
  .nav-toggle { display: block; }

  .nav-links.active {
    display: flex;
    flex-direction: column;
    position: fixed;
    inset: 0;
    background: var(--color-accent);
    z-index: 200;
    align-items: center;
    justify-content: center;
    gap: var(--spacing-md);
  }

  .hero { min-height: 75vh; }
  .hero-content { padding: 6rem 0 var(--spacing-lg); }
  .hero-bg { inset: -10% 0; }

  .section { padding: var(--spacing-lg) 0; }
  .feature-screenshot { padding: var(--spacing-md) 0; }

  .features-grid { grid-template-columns: 1fr; }
  .split-feature {
    grid-template-columns: 1fr;
    gap: var(--spacing-lg);
  }
  .split-feature .feature-image {
    order: -1;
  }
  .collab-grid { grid-template-columns: 1fr; }
  .collab-card { min-height: 280px; padding: 32px; }

  .footer-grid { grid-template-columns: 1fr; gap: var(--spacing-md); }

  .values-grid { grid-template-columns: 1fr; }
}

/* ============================================
   Dark Mode Overrides
   ============================================ */
@media (prefers-color-scheme: dark) {
  body {
    background: var(--color-bg-light);
    color: var(--color-contrast);
  }

  .site-brand h1 { color: var(--color-gold); }

  .footer-brand .site-brand h1 { color: var(--color-contrast); }

  .footer-links-group a { color: var(--color-contrast-2); }
  .footer-links-group a:hover { color: var(--color-contrast); }

  .features-grid .feature-item p,
  .feature-row p,
  .value-card p {
    color: var(--color-contrast-2);
  }

  .feature-screenshot img,
  .split-feature .feature-image img,
  .feature-video video {
    box-shadow: 0 8px 40px rgba(0, 0, 0, 0.4);
  }

  .collab-grid {
    box-shadow: 0 8px 40px rgba(0, 0, 0, 0.4);
  }

  /* Hero button stays gold in dark mode */
  .hero .btn-primary {
    background: var(--color-gold);
    color: #070623 !important;
  }

  /* CTA section is already dark */
  .cta-section {
    background: #050418;
  }

  /* About page dark section */
  .about-section.dark-section {
    background: var(--color-bg-alt);
  }
}

/* ============================================
   Reduced Motion
   ============================================ */
@media (prefers-reduced-motion: reduce) {
  .fade-in, .fade-in-left, .fade-in-right {
    opacity: 1;
    transform: none;
    transition: none;
  }
  .hero-bg { inset: 0; }
  .collab-card img { inset: 0; width: 100%; height: 100%; }
}
