
/* Кастомные стили для красивой типографики */
:root {
  --primary-font: 'Montserrat', -apple-system, BlinkMacSystemFont, sans-serif;
  --secondary-font: 'Roboto', -apple-system, BlinkMacSystemFont, sans-serif;
  --font-weight-light: 300;
  --font-weight-normal: 400;
  --font-weight-medium: 500;
  --font-weight-bold: 700;
  --font-weight-black: 800;
}

/* Полноэкранный фон */
html, body {
  height: 100% !important;
  width: 100% !important;
  margin: 0 !important;
  padding: 0 !important;
  overflow-x: hidden !important;
}

#root {
  min-height: 100vh !important;
  min-width: 100vw !important;
}

/* Переопределяем глобальные стили */
body, html {
  font-family: var(--secondary-font) !important;
  font-weight: var(--font-weight-normal) !important;
  line-height: 1.6 !important;
  letter-spacing: 0.01em !important;
  -webkit-font-smoothing: antialiased !important;
  -moz-osx-font-smoothing: grayscale !important;
}

/* Заголовки */
h1, h2, h3, h4, h5, h6, 
.text-3xl, .text-2xl, .text-xl, .text-lg {
  font-family: var(--primary-font) !important;
  font-weight: var(--font-weight-bold) !important;
  letter-spacing: -0.02em !important;
}

/* Основной текст */
p, span, div, a, button {
  font-family: var(--secondary-font) !important;
}

/* Улучшенные кнопки и интерактивные элементы */
button, .btn, [role="button"] {
  font-family: var(--primary-font) !important;
  font-weight: var(--font-weight-medium) !important;
  letter-spacing: 0.025em !important;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  overflow: hidden;
  transform-style: preserve-3d;
}

button:hover, .btn:hover, [role="button"]:hover {
  transform: translateY(-2px) translateZ(10px);
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
  letter-spacing: 0.035em;
}

button:active, .btn:active, [role="button"]:active {
  transform: translateY(0) translateZ(0);
  transition: all 0.1s ease-out;
}

/* Эффект пульсации для активных элементов */
button::after, .btn::after, [role="button"]::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 0;
  height: 0;
  background: rgba(255, 255, 255, 0.3);
  border-radius: 50%;
  transform: translate(-50%, -50%);
  transition: width 0.6s ease-out, height 0.6s ease-out;
}

button:hover::after, .btn:hover::after, [role="button"]:hover::after {
  width: 300px;
  height: 300px;
}

/* Анимация загрузки */
.loading-spinner {
  width: 20px;
  height: 20px;
  border: 2px solid rgba(255, 255, 255, 0.3);
  border-top: 2px solid #fff;
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

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

/* Улучшенная читаемость */
.font-medium {
  font-weight: var(--font-weight-medium) !important;
}

/* Улучшенные анимации перехода языка */
.language-transition-enter {
  opacity: 0;
  transform: translateY(15px) scale(0.95) rotateX(10deg);
  transition: all 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  filter: blur(2px);
}

.language-transition-enter-active {
  opacity: 1;
  transform: translateY(0) scale(1) rotateX(0deg);
  filter: blur(0px);
}

.language-transition-exit {
  opacity: 1;
  transform: translateY(0) scale(1) rotateX(0deg);
  transition: all 0.4s cubic-bezier(0.68, -0.55, 0.265, 1.55);
  filter: blur(0px);
}

.language-transition-exit-active {
  opacity: 0;
  transform: translateY(-15px) scale(0.95) rotateX(-10deg);
  filter: blur(2px);
}

.font-bold {
  font-weight: var(--font-weight-bold) !important;
}

.font-black {
  font-weight: var(--font-weight-black) !important;
}

/* Специальные стили для заголовков с анимацией */
.text-3xl, .text-4xl, .text-5xl {
  font-family: var(--primary-font) !important;
  font-weight: var(--font-weight-black) !important;

/* ========== УЛУЧШЕННЫЕ АНИМАЦИИ ========== */

/* Анимация появления элементов */
@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(30px) scale(0.95);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@keyframes fadeInLeft {
  from {
    opacity: 0;
    transform: translateX(-30px) rotateY(-15deg);
  }
  to {
    opacity: 1;
    transform: translateX(0) rotateY(0deg);
  }
}

@keyframes fadeInRight {
  from {
    opacity: 0;
    transform: translateX(30px) rotateY(15deg);
  }
  to {
    opacity: 1;
    transform: translateX(0) rotateY(0deg);
  }
}

/* Анимация плавающих элементов */
@keyframes float-enhanced {
  0%, 100% {
    transform: translateY(0px) rotate(0deg);
  }
  25% {
    transform: translateY(-8px) rotate(1deg);
  }
  50% {
    transform: translateY(-15px) rotate(0deg);
  }
  75% {
    transform: translateY(-8px) rotate(-1deg);
  }
}

/* Анимация пульсации с цветом */
@keyframes pulse-color {
  0%, 100% {
    transform: scale(1);
    filter: hue-rotate(0deg) brightness(1);
  }
  50% {
    transform: scale(1.05);
    filter: hue-rotate(10deg) brightness(1.1);
  }
}

/* Анимация волнового эффекта */
@keyframes wave {
  0%, 100% {
    transform: rotate(0deg);
  }
  25% {
    transform: rotate(3deg);
  }
  75% {
    transform: rotate(-3deg);
  }
}

/* Анимация появления с пружинным эффектом */
@keyframes bounceIn {
  0% {
    opacity: 0;
    transform: scale(0.3) rotate(-10deg);
  }
  50% {
    opacity: 1;
    transform: scale(1.05) rotate(2deg);
  }
  70% {
    transform: scale(0.9) rotate(-1deg);
  }
  100% {
    opacity: 1;
    transform: scale(1) rotate(0deg);
  }
}

/* Анимация скольжения */
@keyframes slideInScale {
  0% {
    opacity: 0;
    transform: translateX(-100px) scale(0.8);
  }
  60% {
    opacity: 0.8;
    transform: translateX(10px) scale(1.1);
  }
  100% {
    opacity: 1;
    transform: translateX(0) scale(1);
  }
}

/* Классы для применения анимаций */
.animate-fade-in-up {
  animation: fadeInUp 0.8s cubic-bezier(0.25, 0.46, 0.45, 0.94) both;
}

.animate-fade-in-left {
  animation: fadeInLeft 0.8s cubic-bezier(0.25, 0.46, 0.45, 0.94) both;
}

.animate-fade-in-right {
  animation: fadeInRight 0.8s cubic-bezier(0.25, 0.46, 0.45, 0.94) both;
}

.animate-float-enhanced {
  animation: float-enhanced 4s ease-in-out infinite;
}

.animate-pulse-color {
  animation: pulse-color 2s ease-in-out infinite;
}

.animate-wave {
  animation: wave 2s ease-in-out infinite;
}

.animate-bounce-in {
  animation: bounceIn 0.8s cubic-bezier(0.68, -0.55, 0.265, 1.55) both;
}

.animate-slide-in-scale {
  animation: slideInScale 1s cubic-bezier(0.25, 0.46, 0.45, 0.94) both;
}

/* Задержки для последовательной анимации */
.animate-delay-100 { animation-delay: 0.1s; }
.animate-delay-200 { animation-delay: 0.2s; }
.animate-delay-300 { animation-delay: 0.3s; }
.animate-delay-400 { animation-delay: 0.4s; }
.animate-delay-500 { animation-delay: 0.5s; }

/* Эффекты при наведении */
.hover-lift {
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.hover-lift:hover {
  transform: translateY(-8px) scale(1.02);
}

.hover-glow {
  transition: all 0.3s ease;
}

.hover-glow:hover {
  box-shadow: 0 0 20px rgba(59, 130, 246, 0.5);
  transform: scale(1.02);
}

.hover-rotate {
  transition: transform 0.3s ease;
}

.hover-rotate:hover {
  transform: rotate(5deg) scale(1.05);
}

/* Продвинутые переходы */
.transition-smooth {
  transition: all 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.transition-bounce {
  transition: all 0.4s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

.transition-elastic {
  transition: all 0.6s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

/* Анимация для фокуса */
.focus-ring {
  transition: all 0.2s ease;
}

.focus-ring:focus {
  outline: none;
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.5);
  transform: scale(1.02);
}

/* Анимация прогресса */
@keyframes progress-bar {
  0% {
    width: 0%;
  }
  100% {
    width: 100%;
  }
}

.animate-progress {
  animation: progress-bar 2s ease-out forwards;
}

/* Улучшенная анимация загрузки */
@keyframes spin-smooth {
  0% {
    transform: rotate(0deg);
  }
  100% {
    transform: rotate(360deg);
  }
}

.animate-spin-smooth {
  animation: spin-smooth 1.5s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}

/* Эффект печатной машинки для текста */
@keyframes typewriter {
  from {
    width: 0;
  }
  to {
    width: 100%;
  }
}

.typewriter-effect {
  overflow: hidden;
  white-space: nowrap;
  border-right: 2px solid;
  animation: typewriter 3s steps(40, end), blink-caret 0.75s step-end infinite;
}

@keyframes blink-caret {
  from, to {
    border-color: transparent;
  }
  50% {
    border-color: currentColor;
  }
}

/* Респонсивные анимации */
@media (prefers-reduced-motion: reduce) {
  * {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* Оптимизация производительности */
.will-change-auto {
  will-change: auto;
}

.will-change-transform {
  will-change: transform;
}

.will-change-opacity {
  will-change: opacity;
}

/* Анимация для появления контента при скролле */
.reveal-on-scroll {
  opacity: 0;
  transform: translateY(50px);
  transition: all 0.6s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

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

  line-height: 1.1 !important;
  transition: all 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
  position: relative;
  overflow: hidden;
}

.text-3xl:hover, .text-4xl:hover, .text-5xl:hover {
  transform: translateY(-2px) scale(1.02);
  text-shadow: 0 8px 20px rgba(0, 0, 0, 0.15);
  letter-spacing: 0.02em;
}

.text-3xl::before, .text-4xl::before, .text-5xl::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.1), transparent);
  transition: left 0.8s ease-in-out;
}

.text-3xl:hover::before, .text-4xl:hover::before, .text-5xl:hover::before {
  left: 100%;
}

/* Мелкий текст с плавной анимацией */
.text-sm, .text-xs {
  font-family: var(--secondary-font) !important;
  font-weight: var(--font-weight-normal) !important;
  letter-spacing: 0.015em !important;
  transition: all 0.3s ease-out;
}

.text-sm:hover, .text-xs:hover {
  transform: translateY(-1px);
  opacity: 0.8;
}
