/*Скрываем до анимации*/
.hero-title span,
.hero-subtitle,
.cta-buttons {
    visibility: hidden;
}

/* Класс для показа после инициализации JS */
.js-loaded .hero-title span,
.js-loaded .hero-subtitle,
.js-loaded .cta-buttons {
    visibility: visible;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary: #2563eb;
    --primary-dark: #1d4ed8;
    --secondary: #64748b;
    --accent: #06b6d4;
    --background: #ffffff;
    --surface: #f8fafc;
    --text: #1e293b;
    --text-light: #64748b;
    --border: #e2e8f0;
    --shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 20px 25px -5px rgba(0, 0, 0, 0.1);
    --shadow-xl: 0 25px 50px -12px rgba(0, 0, 0, 0.15);
    
    --muted: #f8fafc;
    --blue: #2563eb; 
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    line-height: 1.6;
    color: var(--text);
    background: var(--background);
    overflow-x: hidden;
    position: relative;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* Background Elements */
.background-elements {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: -1;
}

.bg-circle {
    position: absolute;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--accent) 0%, var(--primary) 100%);
    opacity: 0.03;
    filter: blur(60px);
}

.circle-1 {
    width: 800px;
    height: 800px;
    top: -300px;
    right: -300px;
    animation: float 20s ease-in-out infinite;
}

.circle-2 {
    width: 600px;
    height: 600px;
    bottom: -200px;
    left: -200px;
    animation: float 25s ease-in-out infinite reverse;
}

.circle-3 {
    width: 400px;
    height: 400px;
    top: 30%;
    left: 10%;
    animation: float 30s ease-in-out infinite;
}

.bg-grid {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: 
        linear-gradient(rgba(0, 77, 255, 0.1) 1px, transparent 1px),
        linear-gradient(90deg, rgba(0, 77, 255, 0.1) 1px, transparent 1px);
    background-size: 60px 60px;
    animation: gridMove 100s linear infinite;
}

@keyframes float {
    0%, 100% { transform: translateY(0px) rotate(0deg); }
    50% { transform: translateY(-20px) rotate(180deg); }
}

@keyframes gridMove {
    0% { transform: translateX(0) translateY(0); }
    100% { transform: translateX(-60px) translateY(-60px); }
}

/* Hero Section */
.hero-section {
    padding: 200px 0 150px;
    min-height: 100vh;
    display: flex;
    align-items: center;
    position: relative;
}

.hero-content {
    max-width: 800px;
    margin: 0 auto;
    text-align: center;
}

/* Изначальное состояние элементов для анимации */
.hero-subtitle,
.cta-buttons {
    opacity: 0;
    transform: translateY(20px);
}

/* Класс для активации анимации */
.hero-subtitle.animate-in {
    opacity: 1;
    transform: translateY(0);
    transition: opacity 0.8s ease 0.3s, transform 0.8s ease 0.3s;
}

.cta-buttons.animate-in {
    opacity: 1;
    transform: translateY(0);
    transition: opacity 0.6s ease 0.6s, transform 0.6s ease 0.6s;
}

/* Hero Title Styles - ИСПРАВЛЕНО ДЛЯ ПРЕДОТВРАЩЕНИЯ ПЕРЕНОСА */
.hero-title {
    font-size: clamp(3rem, 6vw, 4.5rem);
    font-weight: 700;
    line-height: 1.1;
    margin-bottom: 32px;
    position: relative;
    display: block;
    text-align: center;
    word-break: keep-all;
    overflow-wrap: normal;
}

.title-line {
    display: block;
    position: relative;
    line-height: 1.1;
    margin-bottom: 5px;
    width: 100%;
    text-align: center;
    white-space: nowrap;
}

.title-line:last-child {
    margin-bottom: 0;
}

.title-line.accent {
    background: linear-gradient(135deg, var(--primary), var(--accent));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.hero-title::after {
    content: '';
    position: absolute;
    bottom: -10px;
    left: 50%;
    transform: translateX(-50%);
    width: 100px;
    height: 4px;
    background: linear-gradient(90deg, var(--primary), var(--accent));
    border-radius: 2px;
}

.hero-subtitle {
    opacity: 0;
    font-size: 1.375rem;
    color: var(--text-light);
    margin-bottom: 48px;
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
    line-height: 1.6;
    font-weight: 400;
}

.cta-buttons {
    display: flex;
    gap: 20px;
    justify-content: center;
    flex-wrap: wrap;
}

.btn {
    padding: 18px 36px;
    border: none;
    border-radius: 14px;
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    position: relative;
    overflow: hidden;
}

.btn::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 0.6s ease;
}

.btn:hover::before {
    left: 100%;
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    color: white;
    box-shadow: 0 10px 30px rgba(37, 99, 235, 0.3);
}

.btn-primary:hover {
    transform: translateY(-3px) scale(1.02);
    box-shadow: 0 20px 40px rgba(37, 99, 235, 0.4);
}

.btn-secondary {
    background: transparent;
    color: var(--text);
    border: 2px solid var(--border);
    backdrop-filter: blur(10px);
}

.btn-secondary:hover {
    border-color: var(--primary);
    background: rgba(37, 99, 235, 0.05);
    transform: translateY(-3px);
    box-shadow: var(--shadow-lg);
}

/* Section Headers */
.section-header {
    text-align: center;
    margin-bottom: 80px;
    position: relative;
}

.section-title {
    font-size: 3rem;
    font-weight: 700;
    margin-bottom: 20px;
    color: var(--text);
    position: relative;
    display: inline-block;
}

.section-title::after {
    content: '';
    position: absolute;
    bottom: -15px;
    left: 50%;
    transform: translateX(-50%);
    width: 80px;
    height: 4px;
    background: linear-gradient(90deg, var(--primary), var(--accent));
    border-radius: 2px;
}

.section-subtitle {
    font-size: 1.25rem;
    color: var(--text-light);
    max-width: 700px;
    margin: 30px auto 0;
    line-height: 1.7;
}

/* Сервисы */
.services-section {
    padding: 120px 0;
    background: var(--surface);
    position: relative;
}

.services-container {
    display: grid;
    grid-template-columns: 1fr 2fr;
    gap: 60px;
    align-items: start;
}

.services-sidebar {
    position: sticky;
    top: 120px;
    padding: 40px;
    background: var(--background);
    border-radius: 24px;
    box-shadow: var(--shadow-xl);
    border: 1px solid var(--border);
}

.services-nav {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.service-nav-item {
    padding: 20px 24px;
    border: none;
    background: transparent;
    border-radius: 12px;
    font-size: 1.1rem;
    font-weight: 500;
    text-align: left;
    cursor: pointer;
    transition: all 0.3s ease;
    color: var(--text-light);
    border: 2px solid transparent;
    position: relative;
    overflow: hidden;
}

.service-nav-item::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    height: 100%;
    width: 0;
    background: linear-gradient(90deg, var(--primary), transparent);
    transition: width 0.3s ease;
    opacity: 0.1;
}

.service-nav-item:hover {
    color: var(--primary);
    background: rgba(37, 99, 235, 0.05);
    transform: translateX(8px);
}

.service-nav-item.active {
    color: var(--primary);
    background: rgba(37, 99, 235, 0.08);
    border-color: var(--primary);
    transform: translateX(8px);
    box-shadow: 0 8px 25px rgba(37, 99, 235, 0.15);
}

.service-nav-item.active::before {
    width: 4px;
}
/*стили для блоков*/
.services-content-wrapper {
    position: relative;
    min-height: 790px; 
}

.services-content {
    position: relative;
    width: 100%;
}

/* Стили для контейнера карточек*/
.service-cards-container {
    position: relative;
    width: 100%;
    height: 790px;
}

/* Карточки услуг */
.service-card {
    background: var(--background);
    border-radius: 24px;
    padding: 50px;
    box-shadow: var(--shadow-xl);
    border: 1px solid var(--border);
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%; /* ВСЕ карточки одинаковой высоты */
    opacity: 0;
    visibility: hidden;
    transform: translateY(20px);
    transition: all 0.5s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    z-index: 1;
    overflow: hidden;
    box-sizing: border-box;
}

.service-card.active {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
    z-index: 2;
}

/* Внутренняя обертка карточки с flex */
.service-card-inner {
    height: 100%;
    display: flex;
    flex-direction: column;
}

/* Заголовок карточки */
.service-card-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    margin-bottom: 30px;
    gap: 30px;
    flex-shrink: 0;
}

.service-card-title {
    font-size: 2rem;
    font-weight: 700;
    color: var(--text);
    line-height: 1.2;
    margin-bottom: 15px;
}

.service-card-icon {
    width: 80px;
    height: 80px;
    background: var(--primary);
    border: 2px solid var(--primary);
    border-radius: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
    color: white;
    flex-shrink: 0;
    transition: all 0.3s ease;
}

.service-card:hover .service-card-icon {
    background: white;
    color: var(--primary);
    border-color: var(--primary);
}

.service-card-description {
    font-size: 1.2rem;
    color: var(--text-light);
    line-height: 1.7;
    margin-bottom: 35px;
    flex-shrink: 0;
}

/* Список фич - занимает всё доступное пространство */
.service-features-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 20px;
    margin-bottom: 40px;
    flex-grow: 1; /* Занимает всё свободное пространство */
    overflow-y: auto; /* Скролл если много фич */
    padding-right: 5px;
}

.service-feature {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 20px;
    background: rgba(37, 99, 235, 0.03);
    border-radius: 16px;
    border: 1px solid rgba(37, 99, 235, 0.1);
    transition: all 0.3s ease;
    height: fit-content;
}

.service-feature:hover {
    background: rgba(37, 99, 235, 0.08);
    transform: translateY(-2px);
}

/* УБРАНЫ ГАЛОЧКИ ИЗ ФИЧ */
.service-feature-icon {
    width: 24px;
    height: 24px;
    background: var(--primary);
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 0.9rem;
    font-weight: bold;
    flex-shrink: 0;
    display: none !important; /* Скрываем галочки */
}

.service-feature-text {
    color: var(--text);
    font-weight: 500;
}

/* Кнопка CTA - всегда внизу */
.service-cta-container {
    margin-top: auto; /* Прижимается к низу */
    padding-top: 20px;
    flex-shrink: 0;
    border-top: 1px solid var(--border);
}

.service-cta {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 16px 32px;
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    color: white;
    text-decoration: none;
    border-radius: 12px;
    font-weight: 600;
    transition: all 0.3s ease;
    box-shadow: 0 8px 25px rgba(37, 99, 235, 0.3);
}

.service-cta:hover {
    transform: translateY(-2px);
    box-shadow: 0 15px 35px rgba(37, 99, 235, 0.4);
}

/* Адаптивность */
@media (max-width: 1024px) {
    .services-container {
        grid-template-columns: 1fr;
        gap: 40px;
    }
    
    .services-sidebar {
        position: static;
    }
    
    .services-nav {
        flex-direction: row;
        overflow-x: auto;
        padding-bottom: 10px;
    }
    
    .service-nav-item {
        white-space: nowrap;
        flex-shrink: 0;
    }
    
    .service-cards-container {
        height: 950px;
    }
}

@media (max-width: 768px) {
    .hero-title {
        font-size: clamp(2.5rem, 8vw, 3.5rem);
    }
    
    .title-line {
        white-space: normal;
    }
    
    .service-cards-container {
        height: 700px;
    }
    
    .service-card {
        padding: 30px;
    }
    
    .service-card-header {
        flex-direction: column;
        gap: 20px;
    }
    
    .service-card-title {
        font-size: 1.75rem;
    }
    
    .service-features-grid {
        grid-template-columns: 1fr;
    }
    
    .service-card-icon {
        width: 60px;
        height: 60px;
        font-size: 1.5rem;
    }
}

@media (max-width: 480px) {
    .hero-title {
        font-size: 2.2rem;
    }
    
    .service-cards-container {
        height: 750px;
    }
    
    .service-card {
        padding: 25px;
    }
}

/* Animation for cards */
.fade-in {
    opacity: 0;
    transform: translateY(30px);
    transition: all 0.8s ease;
}

.fade-in.visible {
    opacity: 1;
    transform: translateY(0);
}

/*Стрелка для hero*/
.scroll-down-arrow {
    position: absolute;
    bottom: 60px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 10;
    opacity: 0.8;
    transition: all 0.3s ease;
    cursor: pointer;
    animation: fadeInUp 1s ease 0.8s both;
}

.scroll-down-arrow:hover {
    opacity: 1;
    transform: translateX(-50%) translateY(5px);
}

.arrow-down {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    animation: bounce 2s infinite;
}

.arrow-down i {
    font-size: 28px;
    color: white;
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
}

/* Для светлого фона (если нужно на других секциях) */
.scroll-down-arrow.dark i {
    color: var(--text);
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

@keyframes bounce {
    0%, 20%, 50%, 80%, 100% {
        transform: translateY(0);
    }
    40% {
        transform: translateY(-10px);
    }
    60% {
        transform: translateY(-5px);
    }
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateX(-50%) translateY(20px);
    }
    to {
        opacity: 0.8;
        transform: translateX(-50%) translateY(0);
    }
}

/* Добавьте отступ для скролла, чтобы не скрывалось под фиксированным хедером */
#services {
    scroll-margin-top: 100px;
}

/* Убираем галочки из пунктов меню и карточек */
.services-nav-item i,
.service-card-header i {
    display: none !important;
}

/*для формы*/
#contact .section-title {
    text-align: left;
    display: block;
}

#contact .section-title::after {
    left: 0;
    transform: none;
}