/* ============================================
   KEYFRAMES - Основные анимации
   ============================================ */

/* Плавное появление с эффектом fade + slide */
@keyframes fadeInUp {
    0% {
        opacity: 0;
        transform: translateY(15px);
    }
    100% {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeInDown {
    0% {
        opacity: 0;
        transform: translateY(-15px);
    }
    100% {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeInLeft {
    0% {
        opacity: 0;
        transform: translateX(-15px);
    }
    100% {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes fadeInRight {
    0% {
        opacity: 0;
        transform: translateX(15px);
    }
    100% {
        opacity: 1;
        transform: translateX(0);
    }
}

/* Масштабирование с появлением */
@keyframes scaleIn {
    0% {
        opacity: 0;
        transform: scale(0.8);
    }
    100% {
        opacity: 1;
        transform: scale(1);
    }
}

/* Вращение с появлением */
@keyframes rotateIn {
    0% {
        opacity: 0;
        transform: rotate(-180deg) scale(0.5);
    }
    100% {
        opacity: 1;
        transform: rotate(0deg) scale(1);
    }
}

/* Эффект печатания текста */
@keyframes typewriter {
    0% {
        width: 0;
    }
    100% {
        width: 100%;
    }
}

@keyframes blink {
    0%, 50% {
        border-color: transparent;
    }
    51%, 100% {
        border-color: #f8bf23;
    }
}

/* Пульсация для акцентов */
@keyframes pulse {
    0% {
        transform: scale(1);
        opacity: 1;
    }
    50% {
        transform: scale(1.05);
        opacity: 0.8;
    }
    100% {
        transform: scale(1);
        opacity: 1;
    }
}

/* Плавающий эффект */
@keyframes float {
    0%, 100% {
        transform: translateY(0px);
    }
    50% {
        transform: translateY(-10px);
    }
}

/* Анимация градиента */
@keyframes gradientShift {
    0% {
        background-position: 0% 50%;
    }
    50% {
        background-position: 100% 50%;
    }
    100% {
        background-position: 0% 50%;
    }
}

/* Загрузка линии */
@keyframes lineLoad {
    0% {
        width: 0%;
    }
    100% {
        width: 100%;
    }
}

/* Вращение карточек */
@keyframes cardFlip {
    0% {
        transform: rotateY(0deg);
    }
    50% {
        transform: rotateY(90deg);
    }
    100% {
        transform: rotateY(0deg);
    }
}

/* ============================================
   ПРИМЕНЕНИЕ АНИМАЦИЙ К ЭЛЕМЕНТАМ
   ============================================ */

/* Анимации для Hero секции */
.hero__sub {
    animation: fadeInDown 1s ease-out 0.2s both;
}

.hero__title {
    animation: fadeInUp 1s ease-out 0.4s both;
    position: relative;
}

/* Эффект печатания для заголовка */
.hero__title.typewriter {
    overflow: hidden;
    border-right: 3px solid #f8bf23;
    white-space: nowrap;
    animation: typewriter 2s steps(20) 0.5s both, blink 1s step-end infinite 2.5s;
}

.hero__text.hero__main {
    animation: fadeInLeft 1s ease-out 0.8s both;
}

.hero__text.hero__second {
    animation: fadeInRight 1s ease-out 1s both;
}

/* Анимации для header */
header {
    animation: fadeInDown 0.8s ease-out 0.1s both;
}

header ul li {
    animation: fadeInDown 0.6s ease-out both;
}

header ul li:nth-child(1) { animation-delay: 0.1s; }
header ul li:nth-child(2) { animation-delay: 0.2s; }
header ul li:nth-child(3) { animation-delay: 0.3s; }
header ul li:nth-child(4) { animation-delay: 0.4s; }

/* Анимации для пагинации */
.pagination {
    animation: fadeInUp 0.8s ease-out 1.5s both;
}

.pagination-dot {
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    transform: scale(1);
}

.pagination-dot:hover {
    transform: scale(1.2);
    animation: pulse 1.5s infinite;
}

.pagination-dot.active {
    animation: scaleIn 0.4s ease-out;
}

/* Анимации для Company Group */
.company-group__title {
    animation: fadeInUp 1s ease-out 0.3s both;
}

.company-group__text {
    animation: fadeInUp 1s ease-out 0.5s both;
}

/*
.company-group__circle {
    animation: scaleIn 1.2s ease-out 0.7s both;
    position: relative;
}


.company-group__circle::before {
    content: '';
    position: absolute;
    top: -2px;
    left: -2px;
    width: calc(100% + 4px);
    height: calc(100% + 4px);
    border-radius: inherit;
    background: linear-gradient(45deg, #f8bf23, transparent, #f8bf23);
    background-size: 200% 200%;
    animation: gradientShift 3s ease infinite;
    z-index: -1;
    opacity: 0.7;
}

*/

/* Анимации карточек компаний */
.company-card {
    animation: scaleIn 0.8s ease-out both;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    transform-origin: center;
}

.company-card_1 { animation-delay: 0.9s; }
.company-card_2 { animation-delay: 1.0s; }
.company-card_3 { animation-delay: 1.1s; }
.company-card_4 { animation-delay: 1.2s; }
.company-card_5 { animation-delay: 1.3s; }
.company-card_6 { animation-delay: 1.4s; }
.company-card_7 { animation-delay: 1.5s; }

.company-card:hover {
    transform: translateY(-10px) scale(1.05);
}

.company-card__logo {
    transition: all 0.3s ease;
}

/* Анимация появления описания и кнопки */
.company-card__description,
.company-card__button {
    animation: fadeInUp 0.4s ease-out both;
}

.company-card:hover .company-card__description {
    animation-delay: 0.1s;
}

.company-card:hover .company-card__button {
    animation-delay: 0.2s;
}

.company-card__button {
    transition: all 0.2s ease;
    position: relative;
    overflow: hidden;
}

.company-card__button::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, 
        transparent, 
        rgba(255, 255, 255, 0.3), 
        transparent
    );
    transition: left 0.6s ease;
}

.company-card__button:hover::before {
    left: 100%;
}

/* Анимации для Philosophy секции */
.philosophy__text {
    animation: fadeInUp 1.2s ease-out 0.3s both;
    background: linear-gradient(45deg, #793a16, #a44d1e, #793a16);
    background-size: 200% 200%;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    animation: fadeInUp 1.2s ease-out 0.3s both, gradientShift 4s ease infinite 1.5s;
}

.philosophy__sub {
    animation: fadeInUp 1s ease-out 0.6s both;
}

/* Анимации для Contacts секции */
.contacts__title {
    animation: fadeInUp 1s ease-out 0.3s both;
}

.contacts__list {
    animation: fadeInUp 1s ease-out 0.5s both;
}

/* ============================================
   ДОПОЛНИТЕЛЬНЫЕ ЭФФЕКТЫ
   ============================================ */

/* Анимированный фон для hero */
.hero::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(45deg, 
        rgba(0, 0, 0, 0.3), 
        rgba(0, 0, 0, 0.1), 
        rgba(0, 0, 0, 0.3)
    );
    background-size: 400% 400%;
    animation: gradientShift 8s ease infinite;
    z-index: 1;
}

.hero .container {
    position: relative;
    z-index: 2;
}

/* Прелоадер с анимацией */
.loader {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: #faf7f5;
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 9999;
    animation: fadeInDown 0.5s ease-out reverse 2s both;
}

.loader::before {
    content: '';
    width: 60px;
    height: 60px;
    border: 4px solid #f0f0f0;
    border-top: 4px solid #f8bf23;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Анимация при переходе между слайдами */
.screen {
    transition: opacity 0.6s ease, transform 0.6s ease;
}

.screen.slide-enter {
    opacity: 0;
    transform: translateY(50px);
}

.screen.slide-enter-active {
    opacity: 1;
    transform: translateY(0);
}

.screen.slide-exit {
    opacity: 1;
    transform: translateY(0);
}

.screen.slide-exit-active {
    opacity: 0;
    transform: translateY(-50px);
}

/* ============================================
   АДАПТИВНЫЕ АНИМАЦИИ
   ============================================ */

@media (max-width: 991px) {
    /* Упрощаем анимации на мобильных */
    .hero__image img,
    .philosophy__image img {
        animation-duration: 2s;
    }
    
    .company-card {
        animation-duration: 0.6s;
    }
    
    /* Отключаем float анимации на мобильных для лучшей производительности */
    @media (prefers-reduced-motion: reduce) {
        .hero__image img,
        .philosophy__image img {
            animation: none;
        }
    }
}

/* Поддержка пользователей с ограниченными возможностями */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* ============================================
   HOVER ЭФФЕКТЫ ДЛЯ ИНТЕРАКТИВНОСТИ
   ============================================ */

/* Добавляем микро-анимации при наведении */
header ul li a,
.pagination-dot,
.company-card,
.contacts__list a {
    will-change: transform;
}

/* Плавная анимация для всех интерактивных элементов */
a, button, .company-card, .pagination-dot {
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Эффект ripple для кнопок */
.company-card__button {
    position: relative;
    overflow: hidden;
}

.company-card__button::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.3);
    transform: translate(-50%, -50%);
    transition: width 0.3s ease, height 0.3s ease;
}

.company-card__button:active::after {
    width: 300px;
    height: 300px;
}

