/* AUTONOMY ENGINE™ — Premium Professional Theme */
:root {
  /* Colors - Sophisticated depth */
  --bg: #000000;
  --bg-elevated: #0D0D0D;
  --surface: #141414;
  --surface-hover: #1A1A1A;
  --surface-elevated: #1F1F1F;
  --border: #2A2A2A;
  --border-subtle: #1A1A1A;
  --border-hover: #3A3A3A;
  
  --text: #FFFFFF;
  --text-secondary: #B4B4B4;
  --muted: #737373;
  --subtle: #525252;
  
  /* Brand accent - Refined white/gray scale */
  --accent: #FFFFFF;
  --accent-secondary: #999999;
  --accent-hover: #E5E5E5;
  
  /* Functional colors */
  --success: #22C55E;
  --warning: #F59E0B;
  --error: #EF4444;
  
  /* Premium effects */
  --glow: rgba(255, 255, 255, 0.03);
  --glow-strong: rgba(255, 255, 255, 0.08);
  
  /* Spacing */
  --max: 1280px;
  --max-narrow: 960px;
  --s-1: 2px;
  --s-2: 4px;
  --s-3: 8px;
  --s-4: 12px;
  --s-5: 16px;
  --s-6: 20px;
  --s-7: 24px;
  --s-8: 32px;
  --s-9: 40px;
  --s-10: 48px;
  --s-11: 56px;
  --s-12: 64px;
  --s-14: 80px;
  --s-16: 96px;
  --s-20: 128px;
  --s-24: 160px;
  
  /* Border radius */
  --r-sm: 6px;
  --r-md: 8px;
  --r-lg: 12px;
  --r-xl: 16px;
  --r-2xl: 20px;
  
  /* Typography - Premium scale */
  --h1: clamp(44px, 7vw, 80px);
  --h2: clamp(32px, 5vw, 56px);
  --h3: clamp(22px, 3vw, 32px);
  --h4: 20px;
  --lead: clamp(18px, 2.5vw, 22px);
  --body: 16px;
  --small: 14px;
  --tiny: 12px;
  
  /* Shadows - Subtle depth */
  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.6);
  --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.7);
  --shadow-lg: 0 12px 32px rgba(0, 0, 0, 0.8);
  --shadow-xl: 0 24px 48px rgba(0, 0, 0, 0.9);
  --shadow-inset: inset 0 1px 2px rgba(255, 255, 255, 0.03);
  
  /* Transitions */
  --transition-fast: 150ms cubic-bezier(0.4, 0, 0.2, 1);
  --transition-base: 250ms cubic-bezier(0.4, 0, 0.2, 1);
  --transition-slow: 400ms cubic-bezier(0.22, 1, 0.36, 1);
}

/* Base styles */
* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  scroll-padding-top: 80px;
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

body {
  margin: 0;
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  font-size: var(--body);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
  font-weight: 400;
  position: relative;
  opacity: 0;
  animation: fadeInPage 0.6s ease-out forwards;
}

@keyframes fadeInPage {
  to { opacity: 1; }
}

/* Premium grid background - Enhanced */
body::before {
  content: '';
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-image: 
    linear-gradient(rgba(255, 255, 255, 0.05) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.05) 1px, transparent 1px),
    linear-gradient(rgba(255, 255, 255, 0.02) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.02) 1px, transparent 1px);
  background-size: 40px 40px, 40px 40px, 8px 8px, 8px 8px;
  background-position: 0 0, 0 0, 0 0, 0 0;
  pointer-events: none;
  z-index: 0;
  animation: gridPulse 8s ease-in-out infinite, gridShift 20s linear infinite;
}

@keyframes gridPulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.7; }
}

@keyframes gridShift {
  0% { background-position: 0 0, 0 0, 0 0, 0 0; }
  100% { background-position: 40px 40px, 40px 40px, 8px 8px, 8px 8px; }
}

body::after {
  content: '';
  position: fixed;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 100%;
  max-width: 1400px;
  height: 800px;
  background: radial-gradient(ellipse at top, rgba(255, 255, 255, 0.08) 0%, rgba(255, 255, 255, 0.03) 30%, transparent 70%);
  pointer-events: none;
  z-index: 0;
  animation: glowPulse 6s ease-in-out infinite alternate;
}

@keyframes glowPulse {
  0% { opacity: 0.6; }
  100% { opacity: 1; }
}

main {
  position: relative;
  z-index: 1;
}

::selection {
  background: rgba(255, 255, 255, 0.99);
  color: var(--bg);
}

/* Layout utilities */
.container {
  max-width: var(--max);
  margin: 0 auto;
  padding: 0 var(--s-8);
}

@media (max-width: 768px) {
  .container {
    padding: 0 var(--s-6);
  }
}

.section {
  padding: var(--s-20) 0;
  position: relative;
}

.section:not(:first-child) {
  border-top: 1px solid var(--border-subtle);
}

@media (max-width: 768px) {
  .section {
    padding: var(--s-14) 0;
  }
}

.narrow {
  max-width: var(--max-narrow);
  margin: 0 auto;
}

/* Typography */
.h1 {
  font-family: 'Space Grotesk', 'Inter', sans-serif;
  font-size: var(--h1);
  line-height: 1.05;
  letter-spacing: -0.045em;
  margin: 0 0 var(--s-8);
  font-weight: 600;
  color: var(--text);
}

.h2 {
  font-family: 'Space Grotesk', 'Inter', sans-serif;
  font-size: var(--h2);
  line-height: 1.15;
  margin: 0 0 var(--s-7);
  font-weight: 600;
  letter-spacing: -0.035em;
  color: var(--text);
}

.h3 {
  font-family: 'Space Grotesk', 'Inter', sans-serif;
  font-size: var(--h3);
  line-height: 1.25;
  margin: 0 0 var(--s-5);
  font-weight: 600;
  letter-spacing: -0.025em;
  color: var(--text);
}

h4 {
  font-size: var(--h4);
  line-height: 1.4;
  margin: 0 0 var(--s-4);
  font-weight: 600;
  letter-spacing: -0.015em;
  color: var(--text);
}

h5 {
  font-size: var(--small);
  line-height: 1.4;
  margin: 0 0 var(--s-4);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--muted);
}

.lead {
  font-size: var(--lead);
  color: var(--text-secondary);
  max-width: 720px;
  margin: 0 0 var(--s-10);
  line-height: 1.6;
  font-weight: 400;
}

.muted {
  color: var(--muted);
}

.fine {
  font-size: var(--tiny);
  line-height: 1.5;
}

p {
  margin: 0 0 var(--s-5);
  line-height: 1.65;
}

strong {
  font-weight: 600;
  color: var(--text);
}

a {
  color: var(--text);
  text-decoration: none;
  transition: color var(--transition-fast);
}

a:hover {
  color: var(--text-secondary);
}

/* Remove underline on brand logo */
.brand {
  text-decoration: none !important;
}

.brand:hover {
  text-decoration: none !important;
}

/* Section headers */
.section-header {
  text-align: center;
  max-width: 800px;
  margin: 0 auto var(--s-14);
}

.section-subtitle {
  font-size: var(--body);
  color: var(--muted);
  margin: 0;
  font-weight: 400;
}

/* Utilities */
.row {
  display: flex;
}

.wrap {
  flex-wrap: wrap;
}

.center {
  align-items: center;
}

.space-between {
  justify-content: space-between;
}

.gap-12 {
  gap: var(--s-4);
}

.gap-16 {
  gap: var(--s-5);
}

.gap-24 {
  gap: var(--s-7);
}
