/**
 * ANTIGRAVITY DESIGN SYSTEM
 * Dark theme variables and base styles
 * Based on antigravity.google design specification
 */

:root {
  /* ═══ BACKGROUNDS ═══ */
  --bg-deepest: #000000;
  --bg-surface: #1a1a1a;
  --bg-surface-hover: #252528;
  --bg-elevated: #2a2a2a;
  
  /* ═══ BORDERS ═══ */
  --border-subtle: rgba(255, 255, 255, 0.08);
  --border-default: rgba(255, 255, 255, 0.12);
  --border-hover: rgba(255, 255, 255, 0.2);
  
  /* ═══ TEXT COLORS ═══ */
  --text-primary: #ffffff;
  --text-secondary: rgba(255, 255, 255, 0.7);
  --text-muted: rgba(255, 255, 255, 0.5);
  --text-disabled: rgba(255, 255, 255, 0.3);
  
  /* ═══ ACCENT COLORS ═══ */
  --accent-blue: #3b82f6;
  --accent-blue-hover: #2563eb;
  --accent-purple: #8b5cf6;
  --accent-glow: rgba(59, 130, 246, 0.15);
  
  /* ═══ GRADIENTS ═══ */
  --gradient-primary: linear-gradient(135deg, #FF8C00, #D2691E);
  --gradient-primary-from: #FF8C00;
  --gradient-primary-to: #D2691E;
  
  /* ═══ GLASSMORPHISM ═══ */
  --glass-bg: rgba(0, 0, 0, 0.6);
  --glass-blur: 12px;
  
  /* ═══ SPACING SYSTEM (8px grid) ═══ */
  --space-xs: 0.25rem;    /* 4px */
  --space-sm: 0.5rem;     /* 8px */
  --space-md: 1rem;       /* 16px */
  --space-lg: 1.5rem;     /* 24px */
  --space-xl: 2rem;       /* 32px */
  --space-2xl: 3rem;      /* 48px */
  --space-3xl: 4rem;      /* 64px */
  --space-4xl: 5rem;      /* 80px */
  --space-5xl: 7.5rem;    /* 120px */
  
  /* ═══ TYPOGRAPHY SCALE ═══ */
  --text-4xl: 3.5rem;     /* 56px - Hero H1 */
  --text-3xl: 2.5rem;     /* 40px - Section H2 */
  --text-2xl: 1.75rem;    /* 28px - Card H3 */
  --text-xl: 1.25rem;     /* 20px - Body large */
  --text-lg: 1.125rem;    /* 18px - Body large */
  --text-base: 1rem;      /* 16px - Body */
  --text-sm: 0.875rem;    /* 14px - Small */
  --text-xs: 0.8125rem;   /* 13px - Caption */
  
  /* ═══ FONT WEIGHTS ═══ */
  --font-regular: 400;
  --font-medium: 500;
  --font-bold: 700;
  
  /* ═══ LINE HEIGHTS ═══ */
  --leading-tight: 1.1;
  --leading-snug: 1.25;
  --leading-normal: 1.5;
  --leading-relaxed: 1.6;
  
  /* ═══ LETTER SPACING ═══ */
  --tracking-tighter: -0.02em;
  --tracking-tight: -0.01em;
  --tracking-normal: 0;
  --tracking-wide: 0.02em;
  
  /* ═══ TRANSITIONS ═══ */
  --transition-fast: 200ms ease;
  --transition-base: 300ms ease;
  --transition-slow: 600ms cubic-bezier(0.16, 1, 0.3, 1);
  --transition-reveal: opacity 0.6s cubic-bezier(0.16, 1, 0.3, 1), 
                       transform 0.6s cubic-bezier(0.16, 1, 0.3, 1);
  
  /* ═══ BORDER RADIUS ═══ */
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-xl: 24px;      /* Pill buttons */
  --radius-full: 9999px;
  
  /* ═══ SHADOWS ═══ */
  --shadow-subtle: 0 2px 8px rgba(0, 0, 0, 0.3);
  --shadow-elevated: 0 8px 24px rgba(0, 0, 0, 0.4);
  --shadow-glow: 0 0 20px var(--accent-glow);
}

/* ═══════════════════════════════════════════════════════════
   BASE STYLES
   ═══════════════════════════════════════════════════════════ */

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

body {
  background: var(--bg-deepest);
  color: var(--text-primary);
  font-family: 'Plus Jakarta Sans', system-ui, -apple-system, sans-serif;
  font-size: var(--text-base);
  line-height: var(--leading-normal);
  font-weight: var(--font-regular);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* Typography */
h1, h2, h3, h4, h5, h6 {
  color: var(--text-primary);
  font-weight: var(--font-bold);
  line-height: var(--leading-tight);
  letter-spacing: var(--tracking-tighter);
}

h1 {
  font-size: var(--text-4xl);
  line-height: 1.1;
}

h2 {
  font-size: var(--text-3xl);
  line-height: 1.15;
  letter-spacing: var(--tracking-tight);
}

h3 {
  font-size: var(--text-2xl);
  font-weight: var(--font-medium);
  line-height: var(--leading-snug);
  letter-spacing: var(--tracking-normal);
}

p {
  color: var(--text-secondary);
  line-height: var(--leading-relaxed);
}

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

a:hover {
  opacity: 0.8;
}

/* Selection */
::selection {
  background-color: var(--accent-blue);
  color: var(--text-primary);
}

/* ═══════════════════════════════════════════════════════════
   BUTTONS
   ═══════════════════════════════════════════════════════════ */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-family: inherit;
  font-weight: var(--font-medium);
  font-size: var(--text-sm);
  padding: 12px 24px;
  border-radius: var(--radius-xl);
  border: none;
  cursor: pointer;
  transition: var(--transition-fast);
  text-decoration: none;
  white-space: nowrap;
}

/* .btn-primary и .btn-secondary перенесены в shared.css с полными стилями glass морфизма */

/* Hero buttons with transition effects */
a.btn-primary:hover,
a[style*="background: var(--accent-blue)"]:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(59, 130, 246, 0.3);
}

a[style*="border: 1px solid"]:hover {
  border-color: rgba(255, 255, 255, 0.6) !important;
  background: rgba(255, 255, 255, 0.05) !important;
  transform: translateY(-1px);
}

.btn-ghost {
  background: none;
  color: var(--text-primary);
  padding: 8px 16px;
}

.btn-ghost:hover {
  opacity: 0.8;
}

.btn-large {
  padding: 14px 32px;
  font-size: var(--text-base);
  border-radius: 28px;
}

/* ═══════════════════════════════════════════════════════════
   CARDS
   ═══════════════════════════════════════════════════════════ */

.card {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: var(--space-lg);
  overflow: hidden;
  transition: border-color var(--transition-base), 
              background-color var(--transition-base);
}

.card:hover {
  border-color: var(--border-hover);
  background: var(--bg-surface-hover);
}

.card-content {
  position: relative;
  z-index: 1;
}

.card-image {
  width: 100%;
  height: auto;
  border-radius: var(--radius-md);
  margin-bottom: var(--space-md);
}

/* ═══════════════════════════════════════════════════════════
   LAYOUT
   ═══════════════════════════════════════════════════════════ */

.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 var(--space-lg);
}

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

.section-hero {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
}

/* ═══════════════════════════════════════════════════════════
   GLASSMORPHISM
   ═══════════════════════════════════════════════════════════ */

.glass {
  background: var(--glass-bg);
  backdrop-filter: blur(var(--glass-blur));
  -webkit-backdrop-filter: blur(var(--glass-blur));
}

/* ═══════════════════════════════════════════════════════════
   SCROLL REVEAL ANIMATIONS
   ═══════════════════════════════════════════════════════════ */

.reveal {
  opacity: 0;
  transform: translateY(24px);
  transition: var(--transition-reveal);
}

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

/* Stagger delays for sequential reveals */
.reveal-stagger > .reveal:nth-child(1) { transition-delay: 0ms; }
.reveal-stagger > .reveal:nth-child(2) { transition-delay: 100ms; }
.reveal-stagger > .reveal:nth-child(3) { transition-delay: 200ms; }
.reveal-stagger > .reveal:nth-child(4) { transition-delay: 300ms; }
.reveal-stagger > .reveal:nth-child(5) { transition-delay: 400ms; }
.reveal-stagger > .reveal:nth-child(6) { transition-delay: 500ms; }

/* Hero initial animation */
.hero-animate .hero-title {
  opacity: 0;
  transform: translateY(24px);
  animation: fadeInUp 0.7s cubic-bezier(0.16, 1, 0.3, 1) 0ms forwards;
}

.hero-animate .hero-subtitle {
  opacity: 0;
  transform: translateY(24px);
  animation: fadeInUp 0.7s cubic-bezier(0.16, 1, 0.3, 1) 200ms forwards;
}

.hero-animate .hero-buttons {
  opacity: 0;
  transform: translateY(24px);
  animation: fadeInUp 0.7s cubic-bezier(0.16, 1, 0.3, 1) 400ms forwards;
}

@keyframes fadeInUp {
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* ═══════════════════════════════════════════════════════════
   RESPONSIVE
   ═══════════════════════════════════════════════════════════ */

@media (max-width: 1024px) {
  :root {
    --text-4xl: 2.5rem;   /* 40px */
    --text-3xl: 2rem;     /* 32px */
    --text-2xl: 1.5rem;   /* 24px */
    --space-4xl: 4rem;    /* 64px */
    --space-5xl: 5rem;    /* 80px */
  }
  
  .section {
    padding: var(--space-3xl) 0;
  }
}

@media (max-width: 768px) {
  :root {
    --text-4xl: 2.25rem;  /* 36px */
    --text-3xl: 1.75rem;  /* 28px */
    --text-2xl: 1.25rem;  /* 20px */
    --space-4xl: 3rem;    /* 48px */
    --space-5xl: 4rem;    /* 64px */
  }
  
  .container {
    padding: 0 var(--space-md);
  }
  
  .section {
    padding: var(--space-2xl) 0;
  }
  
  .btn {
    width: 100%;
  }
  
  h1 {
    line-height: 1.15;
  }
}

/* ═══════════════════════════════════════════════════════════
   ACCESSIBILITY
   ═══════════════════════════════════════════════════════════ */

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
  
  .reveal {
    opacity: 1;
    transform: none;
  }
}

/* Focus visible */
*:focus-visible {
  outline: 2px solid var(--accent-blue);
  outline-offset: 2px;
}
