/* ============================================
   CSS Variables - Ретро дизайн-система с дополнительной цветовой схемой
   ============================================ */
:root {
  /* Основные цвета - дополнительная схема (оранжевый + фиолетовый) */
  --primary-color: #e67e22;
  --primary-dark: #d35400;
  --primary-light: #f39c12;
  --secondary-color: #9b59b6;
  --secondary-dark: #8e44ad;
  --secondary-light: #bb8fce;
  
  /* Акцентные цвета */
  --accent-color: #ff6b6b;
  --accent-secondary: #4ecdc4;
  --warning-color: #f1c40f;
  --success-color: #2ecc71;
  --error-color: #e74c3c;
  
  /* Нейтральные цвета */
  --white: #ffffff;
  --black: #2c3e50;
  --gray-100: #f8f9fa;
  --gray-200: #e9ecef;
  --gray-300: #dee2e6;
  --gray-400: #ced4da;
  --gray-500: #6c757d;
  --gray-600: #495057;
  --gray-700: #343a40;
  --gray-800: #212529;
  --gray-900: #1a1a1a;
  
  /* Градиенты */
  --gradient-primary: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
  --gradient-secondary: linear-gradient(135deg, var(--secondary-color) 0%, var(--primary-color) 100%);
  --gradient-accent: linear-gradient(135deg, var(--accent-color) 0%, var(--accent-secondary) 100%);
  --gradient-overlay: linear-gradient(rgba(0,0,0,0.6), rgba(0,0,0,0.4));
  --gradient-overlay-light: linear-gradient(rgba(0,0,0,0.3), rgba(0,0,0,0.1));
  
  /* Типографика - адаптивные размеры */
  --font-primary: 'Montserrat', sans-serif;
  --font-secondary: 'Merriweather', serif;
  
  --text-xs: clamp(0.75rem, 0.5vw + 0.5rem, 0.875rem);
  --text-sm: clamp(0.875rem, 0.7vw + 0.6rem, 1rem);
  --text-base: clamp(1rem, 1vw + 0.7rem, 1.125rem);
  --text-lg: clamp(1.125rem, 1.2vw + 0.8rem, 1.25rem);
  --text-xl: clamp(1.25rem, 1.5vw + 0.9rem, 1.5rem);
  --text-2xl: clamp(1.5rem, 2vw + 1rem, 2rem);
  --text-3xl: clamp(1.875rem, 2.5vw + 1.2rem, 2.5rem);
  --text-4xl: clamp(2.25rem, 3vw + 1.5rem, 3rem);
  --text-5xl: clamp(3rem, 4vw + 2rem, 4rem);
  --text-6xl: clamp(3.75rem, 5vw + 2.5rem, 5rem);
  --text-7xl: clamp(4.5rem, 6vw + 3rem, 6rem);
  
  /* Отступы и размеры */
  --spacing-xs: 0.25rem;
  --spacing-sm: 0.5rem;
  --spacing-md: 1rem;
  --spacing-lg: 1.5rem;
  --spacing-xl: 2rem;
  --spacing-2xl: 3rem;
  --spacing-3xl: 4rem;
  --spacing-4xl: 6rem;
  
  /* Радиусы */
  --radius-sm: 0.375rem;
  --radius-md: 0.5rem;
  --radius-lg: 0.75rem;
  --radius-xl: 1rem;
  --radius-full: 9999px;
  
  /* Тени */
  --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
  --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
  --shadow-2xl: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
  
  /* Переходы */
  --transition-fast: 0.15s ease-in-out;
  --transition-normal: 0.3s ease-in-out;
  --transition-slow: 0.5s ease-in-out;
  
  /* Z-index */
  --z-dropdown: 1000;
  --z-sticky: 1020;
  --z-fixed: 1030;
  --z-modal-backdrop: 1040;
  --z-modal: 1050;
  --z-popover: 1060;
  --z-tooltip: 1070;
}

/* ============================================
   Базовые стили и сброс
   ============================================ */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
  font-size: 16px;
}

body {
  font-family: var(--font-secondary);
  font-size: var(--text-base);
  line-height: 1.7;
  color: var(--gray-700);
  background-color: var(--white);
  overflow-x: hidden;
}

/* ============================================
   Типографика
   ============================================ */
h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-primary);
  font-weight: 700;
  line-height: 1.2;
  color: var(--black);
  margin-bottom: var(--spacing-md);
}

h1 {
  font-size: var(--text-6xl);
  font-weight: 800;
}

h2 {
  font-size: var(--text-5xl);
  font-weight: 700;
}

h3 {
  font-size: var(--text-3xl);
  font-weight: 600;
}

h4 {
  font-size: var(--text-2xl);
  font-weight: 600;
}

h5 {
  font-size: var(--text-xl);
  font-weight: 600;
}

h6 {
  font-size: var(--text-lg);
  font-weight: 600;
}

p {
  margin-bottom: var(--spacing-lg);
  color: var(--gray-600);
}

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

a:hover {
  color: var(--primary-dark);
}

/* ============================================
   Глобальные стили кнопок
   ============================================ */
.btn, 
button, 
input[type='submit'], 
input[type='button'],
.retro-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: var(--spacing-md) var(--spacing-xl);
  font-family: var(--font-primary);
  font-size: var(--text-base);
  font-weight: 600;
  line-height: 1;
  text-align: center;
  text-decoration: none;
  border: none;
  border-radius: var(--radius-lg);
  cursor: pointer;
  transition: all var(--transition-normal);
  position: relative;
  overflow: hidden;
  white-space: nowrap;
  min-height: 48px;
}

.btn::before,
button::before,
input[type='submit']::before,
input[type='button']::before,
.retro-button::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.2), transparent);
  transition: left var(--transition-slow);
}

.btn:hover::before,
button:hover::before,
input[type='submit']:hover::before,
input[type='button']:hover::before,
.retro-button:hover::before {
  left: 100%;
}

/* Варианты кнопок */
.btn-primary,
.retro-button {
  background: var(--gradient-primary);
  color: var(--white);
  box-shadow: var(--shadow-md);
}

.btn-primary:hover,
.retro-button:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-xl);
}

.btn-secondary {
  background: var(--gradient-secondary);
  color: var(--white);
  box-shadow: var(--shadow-md);
}

.btn-secondary:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-xl);
}

.btn-outline {
  background: transparent;
  color: var(--primary-color);
  border: 2px solid var(--primary-color);
}

.btn-outline:hover {
  background: var(--primary-color);
  color: var(--white);
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg);
}

.btn-ghost {
  background: transparent;
  color: var(--white);
  border: 2px solid var(--white);
}

.btn-ghost:hover {
  background: var(--white);
  color: var(--primary-color);
  transform: translateY(-2px);
}

/* ============================================
   Анимации - Рисованный стиль
   ============================================ */
@keyframes drawLine {
  0% {
    stroke-dashoffset: 100%;
  }
  100% {
    stroke-dashoffset: 0;
  }
}

@keyframes fadeInUp {
  0% {
    opacity: 0;
    transform: translateY(30px);
  }
  100% {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes fadeInDown {
  0% {
    opacity: 0;
    transform: translateY(-30px);
  }
  100% {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes scaleIn {
  0% {
    opacity: 0;
    transform: scale(0.9);
  }
  100% {
    opacity: 1;
    transform: scale(1);
  }
}

@keyframes slideInRight {
  0% {
    opacity: 0;
    transform: translateX(30px);
  }
  100% {
    opacity: 1;
    transform: translateX(0);
  }
}

@keyframes bounce {
  0%, 20%, 53%, 80%, 100% {
    transform: translate3d(0,0,0);
  }
  40%, 43% {
    transform: translate3d(0, -8px, 0);
  }
  70% {
    transform: translate3d(0, -4px, 0);
  }
  90% {
    transform: translate3d(0, -2px, 0);
  }
}

@keyframes pulse {
  0% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.05);
  }
  100% {
    transform: scale(1);
  }
}

@keyframes wobble {
  0%, 100% {
    transform: translateX(0%);
  }
  15% {
    transform: translateX(-25px) rotate(-5deg);
  }
  30% {
    transform: translateX(20px) rotate(3deg);
  }
  45% {
    transform: translateX(-15px) rotate(-3deg);
  }
  60% {
    transform: translateX(10px) rotate(2deg);
  }
  75% {
    transform: translateX(-5px) rotate(-1deg);
  }
}

/* Классы анимаций */
.animate-fade-in {
  animation: fadeInUp 0.8s ease-out;
}

.animate-fade-in-down {
  animation: fadeInDown 0.8s ease-out;
}

.animate-scale-in {
  animation: scaleIn 0.6s ease-out;
}

.animate-slide-right {
  animation: slideInRight 0.8s ease-out;
}

.animate-bounce {
  animation: bounce 2s infinite;
}

.animate-pulse {
  animation: pulse 2s infinite;
}

.animate-wobble {
  animation: wobble 1s ease-in-out;
}

/* ============================================
   Hero Section
   ============================================ */
.hero-section {
  position: relative;
  background-size: cover;
  background-repeat: no-repeat;
  background-position: center center;
  background-attachment: fixed;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  overflow: hidden;
}

.hero-section::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: var(--gradient-overlay);
  z-index: 1;
}

.hero-section * {
  position: relative;
  z-index: 2;
  color: var(--white) !important;
}

.hero-section h1 {
  color: var(--white) !important;
  text-shadow: 2px 2px 4px rgba(0,0,0,0.5);
  margin-bottom: var(--spacing-lg);
}

.hero-section p {
  color: var(--white) !important;
  text-shadow: 1px 1px 2px rgba(0,0,0,0.5);
  font-size: var(--text-xl);
  max-width: 800px;
  margin: 0 auto var(--spacing-2xl) auto;
}

/* ============================================
   Navigation
   ============================================ */
header {
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  background: linear-gradient(135deg, 
    rgba(230, 126, 34, 0.95) 0%, 
    rgba(155, 89, 182, 0.95) 100%);
}

nav a {
  position: relative;
  transition: all var(--transition-normal);
}

nav a::after {
  content: '';
  position: absolute;
  bottom: -2px;
  left: 0;
  width: 0;
  height: 2px;
  background: var(--white);
  transition: width var(--transition-normal);
}

nav a:hover::after {
  width: 100%;
}

/* ============================================
   Cards и компоненты
   ============================================ */
.card,
.item,
.testimonial,
.team-member,
.product-card,
.resource-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  background: var(--white);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-md);
  transition: all var(--transition-normal);
  overflow: hidden;
  height: 100%;
}

.card:hover,
.item:hover,
.testimonial:hover,
.team-member:hover,
.product-card:hover,
.resource-card:hover {
  transform: translateY(-5px);
  box-shadow: var(--shadow-2xl);
}

.card-image {
  width: 100%;
  overflow: hidden;
  border-radius: var(--radius-lg) var(--radius-lg) 0 0;
  height: 200px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.card-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  transition: transform var(--transition-slow);
}

.card:hover .card-image img,
.item:hover .card-image img,
.product-card:hover .card-image img {
  transform: scale(1.1);
}

.card-content {
  padding: var(--spacing-lg);
  flex-grow: 1;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  text-align: center;
  width: 100%;
}

/* ============================================
   Contact Form
   ============================================ */
.contact-form {
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-2xl);
  padding: var(--spacing-2xl);
}

.contact-form input,
.contact-form select,
.contact-form textarea {
  width: 100%;
  padding: var(--spacing-md);
  border: 2px solid var(--gray-300);
  border-radius: var(--radius-lg);
  font-family: var(--font-secondary);
  font-size: var(--text-base);
  transition: border-color var(--transition-normal);
  background: var(--white);
}

.contact-form input:focus,
.contact-form select:focus,
.contact-form textarea:focus {
  outline: none;
  border-color: var(--primary-color);
  box-shadow: 0 0 0 3px rgba(230, 126, 34, 0.1);
}

.contact-form label {
  display: block;
  margin-bottom: var(--spacing-sm);
  font-family: var(--font-primary);
  font-weight: 600;
  color: var(--black);
}

/* ============================================
   Vision Section
   ============================================ */
.vision-content {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--spacing-3xl);
  align-items: center;
}

.vision-content img {
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-xl);
  width: 100%;
  height: auto;
}

/* ============================================
   News Section
   ============================================ */
.news-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
  gap: var(--spacing-2xl);
}

/* ============================================
   Clientele Section
   ============================================ */
.clientele-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: var(--spacing-2xl);
}

.clientele-item {
  text-align: center;
  padding: var(--spacing-lg);
}

.clientele-number {
  width: 80px;
  height: 80px;
  background: var(--gradient-primary);
  border-radius: var(--radius-full);
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto var(--spacing-md) auto;
  font-family: var(--font-primary);
  font-size: var(--text-2xl);
  font-weight: 800;
  color: var(--white);
  box-shadow: var(--shadow-lg);
  transition: transform var(--transition-normal);
}

.clientele-item:hover .clientele-number {
  transform: scale(1.1);
}

/* ============================================
   Blog Section
   ============================================ */
.blog-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(500px, 1fr));
  gap: var(--spacing-3xl);
}

.read-more {
  display: inline-flex;
  align-items: center;
  color: var(--primary-color);
  font-family: var(--font-primary);
  font-weight: 600;
  text-decoration: none;
  transition: all var(--transition-normal);
  position: relative;
}

.read-more::after {
  content: '→';
  margin-left: var(--spacing-sm);
  transition: transform var(--transition-normal);
}

.read-more:hover {
  color: var(--primary-dark);
  transform: translateX(5px);
}

.read-more:hover::after {
  transform: translateX(3px);
}

/* ============================================
   Webinars Section
   ============================================ */
.webinars-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: var(--spacing-2xl);
}

.webinar-icon {
  width: 64px;
  height: 64px;
  background: var(--gradient-primary);
  border-radius: var(--radius-full);
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto var(--spacing-md) auto;
  transition: transform var(--transition-normal);
}

.webinar-card:hover .webinar-icon {
  transform: scale(1.1);
  animation: pulse 2s infinite;
}

/* ============================================
   Footer
   ============================================ */
footer {
  background: linear-gradient(135deg, var(--gray-900) 0%, var(--black) 100%);
  color: var(--white);
}

footer h3,
footer h4 {
  color: var(--white);
  font-family: var(--font-primary);
  margin-bottom: var(--spacing-md);
}

footer a {
  color: var(--gray-300);
  transition: color var(--transition-normal);
  text-decoration: none;
}

footer a:hover {
  color: var(--white);
}

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

.social-links a {
  display: flex;
  align-items: center;
  padding: var(--spacing-sm);
  border-radius: var(--radius-md);
  transition: all var(--transition-normal);
  position: relative;
}

.social-links a::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 3px;
  background: var(--primary-color);
  transform: scaleY(0);
  transition: transform var(--transition-normal);
  border-radius: var(--radius-sm);
}

.social-links a:hover::before {
  transform: scaleY(1);
}

.social-links a:hover {
  background: rgba(230, 126, 34, 0.1);
  color: var(--primary-color);
  transform: translateX(5px);
}

/* ============================================
   Утилиты для специальных страниц
   ============================================ */
.success-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--gradient-primary);
  color: var(--white);
  text-align: center;
}

.success-content {
  max-width: 600px;
  padding: var(--spacing-3xl);
  background: rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(10px);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-2xl);
}

.privacy-page,
.terms-page {
  padding-top: 100px;
}

/* ============================================
   Responsive Design
   ============================================ */
@media (max-width: 768px) {
  .hero-section {
    background-attachment: scroll;
    min-height: 80vh;
  }
  
  .vision-content {
    grid-template-columns: 1fr;
    gap: var(--spacing-2xl);
  }
  
  .news-grid {
    grid-template-columns: 1fr;
  }
  
  .blog-grid {
    grid-template-columns: 1fr;
  }
  
  .webinars-grid {
    grid-template-columns: 1fr;
  }
  
  .clientele-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  
  h1 {
    font-size: var(--text-4xl);
  }
  
  h2 {
    font-size: var(--text-3xl);
  }
  
  .hero-section h1 {
    font-size: var(--text-5xl);
  }
}

@media (max-width: 480px) {
  .clientele-grid {
    grid-template-columns: 1fr;
  }
  
  .card-image {
    height: 180px;
  }
  
  .contact-form {
    padding: var(--spacing-lg);
  }
}

/* ============================================
   Дополнительные эффекты и анимации
   ============================================ */
.parallax-element {
  transform: translateZ(0);
  will-change: transform;
}

.glass-effect {
  background: rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.2);
}

.gradient-text {
  background: var(--gradient-primary);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.retro-border {
  position: relative;
  border: 3px solid transparent;
  background: linear-gradient(var(--white), var(--white)) padding-box,
              var(--gradient-primary) border-box;
}

/* Плавное появление элементов при скролле */
.fade-in-on-scroll {
  opacity: 0;
  transform: translateY(20px);
  transition: all 0.8s ease-out;
}

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

/* Специальные эффекты для карточек */
.card-float:hover {
  animation: float 3s ease-in-out infinite;
}

@keyframes float {
  0%, 100% {
    transform: translateY(0px);
  }
  50% {
    transform: translateY(-10px);
  }
}

/* Стили для загрузки */
.loading-spinner {
  border: 4px solid var(--gray-200);
  border-top: 4px solid var(--primary-color);
  border-radius: 50%;
  width: 40px;
  height: 40px;
  animation: spin 1s linear infinite;
}

@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

/* Accessibility улучшения */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

/* Высокая контрастность для доступности */
@media (prefers-contrast: high) {
  :root {
    --primary-color: #d35400;
    --secondary-color: #8e44ad;
    --gray-600: #000000;
    --gray-700: #000000;
  }
}