/* Smooth scroll behavior */
html {
    scroll-behavior: smooth;
}

/* Section animation classes */
section {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.8s ease-out, transform 0.8s ease-out;
}

section.visible {
    opacity: 1;
    transform: translateY(0);
}

/* Staggered animation for cards */
.problem-card,
.outsource-card,
.service-card,
.step {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.6s ease-out, transform 0.6s ease-out;
}

.visible .problem-card,
.visible .outsource-card,
.visible .service-card,
.visible .step {
    opacity: 1;
    transform: translateY(0);
}

/* Stagger delays */
.visible .problem-card:nth-child(1),
.visible .outsource-card:nth-child(1),
.visible .service-card:nth-child(1),
.visible .step:nth-child(1) { transition-delay: 0.1s; }
.visible .problem-card:nth-child(2),
.visible .outsource-card:nth-child(2),
.visible .service-card:nth-child(2),
.visible .step:nth-child(2) { transition-delay: 0.2s; }
.visible .problem-card:nth-child(3),
.visible .outsource-card:nth-child(3),
.visible .service-card:nth-child(3),
.visible .step:nth-child(3) { transition-delay: 0.3s; }
.visible .service-card:nth-child(4) { transition-delay: 0.1s; }
.visible .service-card:nth-child(5) { transition-delay: 0.2s; }
.visible .service-card:nth-child(6) { transition-delay: 0.3s; }
.visible .service-card:nth-child(7) { transition-delay: 0.4s; }
.visible .service-card:nth-child(8) { transition-delay: 0.5s; }
.visible .service-card:nth-child(9) { transition-delay: 0.6s; }
.visible .step:nth-child(4) { transition-delay: 0.4s; }

/* Hero section should be visible immediately */
.hero {
    opacity: 1 !important;
    transform: none !important;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

body {
    background-color: #f5f7fa;
    color: #1e293b;
    line-height: 1.5;
}

:root {
    --primary: #0b2b4f;      /* глубокий синий */
    --primary-dark: #051a2f;
    --primary-light: #1e4a6f;
    --accent: #2563eb;        /* яркий синий для акцентов */
    --accent-soft: #60a5fa;
    --text: #334155;
    --text-light: #64748b;
    --light-bg: #ffffff;
    --border: #e2e8f0;
    --success: #059669;
}

h1, h2, h3, h4 {
    font-weight: 600;
    line-height: 1.2;
    color: var(--primary);
}

h1 {
    font-size: 3.2rem;
    margin-bottom: 1.5rem;
    color: white;
}

h2 {
    font-size: 2.5rem;
    margin-bottom: 2rem;
    position: relative;
}

h2:after {
    content: '';
    position: absolute;
    bottom: -12px;
    left: 0;
    width: 70px;
    height: 3px;
    background: var(--accent);
}

.container {
    max-width: 1280px;
    margin: 0 auto;
    padding: 0 2rem;
}

.btn {
    display: inline-block;
    background: var(--accent);
    color: white;
    font-weight: 600;
    padding: 0.9rem 2rem;
    border-radius: 6px;
    text-decoration: none;
    transition: all 0.2s;
    border: none;
    cursor: pointer;
    font-size: 1rem;
    box-shadow: 0 4px 6px rgba(37, 99, 235, 0.2);
}

.btn:hover {
    background: var(--primary-light);
    transform: translateY(-2px);
    box-shadow: 0 8px 15px rgba(37, 99, 235, 0.3);
}

.btn-outline {
    background: transparent;
    border: 2px solid white;
    color: white;
    box-shadow: none;
}

.btn-outline:hover {
    background: white;
    color: var(--primary);
}

/* Шапка */
.header {
    background: var(--primary);
    color: white;
    padding: 1rem 0;
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: 0 4px 20px rgba(11, 43, 79, 0.2);
}

.header .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    font-size: 1.8rem;
    font-weight: 700;
    letter-spacing: -0.02em;
    color: white;
}

.logo span {
    color: var(--accent-soft);
    font-weight: 800;
}

.nav a {
    color: rgba(255,255,255,0.9);
    text-decoration: none;
    margin-left: 2rem;
    font-weight: 500;
    transition: color 0.3s ease, transform 0.3s ease;
    display: inline-block;
}

.nav a:hover {
    color: var(--accent-soft);
    transform: translateY(-2px);
}

.nav a:active {
    transform: translateY(0);
}

/* Hero */
.hero {
    background: linear-gradient(135deg, var(--primary-dark) 0%, var(--primary) 100%);
    color: white;
    padding: 5rem 0;
    position: relative;
    overflow: hidden;
}

.hero::after {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    width: 600px;
    height: 100%;
    background: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 200 200" opacity="0.05"><path fill="white" d="M45,-70.6C58.9,-63.1,71.1,-51.1,78.3,-36.7C85.5,-22.3,87.8,-5.6,83.9,9.6C80,24.8,69.9,38.6,57.8,49.5C45.7,60.4,31.6,68.5,16.2,73.5C0.8,78.5,-15.9,80.4,-30.7,75.9C-45.5,71.4,-58.3,60.5,-68.6,46.9C-78.9,33.3,-86.6,16.9,-85.2,1.4C-83.8,-14.1,-73.3,-28.7,-61.2,-40.2C-49.1,-51.7,-35.4,-60.2,-21.3,-66.6C-7.1,-73,7.4,-77.3,22.3,-75.7C37.2,-74.1,52.6,-66.5,45,-70.6Z" transform="translate(100 100)" /></svg>') no-repeat;
    background-position: center right;
    background-size: contain;
}

.hero .container {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 4rem;
    align-items: center;
    position: relative;
    z-index: 2;
}

.hero h1 {
    font-size: 3rem;
    line-height: 1.2;
}

.hero .accent-text {
    color: var(--accent-soft);
}

.hero-features {
    margin: 2rem 0;
}

.hero-feature {
    display: flex;
    align-items: center;
    gap: 0.8rem;
    margin: 1rem 0;
}

.hero-feature span {
    width: 24px;
    height: 24px;
    background: rgba(96, 165, 250, 0.2);
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: var(--accent-soft);
}

.hero-buttons {
    display: flex;
    gap: 1rem;
    margin-top: 2rem;
}

/* Картинка в hero */
.hero-image {
    background: rgba(255,255,255,0.03);
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 24px;
    padding: 2rem;
    backdrop-filter: blur(5px);
}

.stat-item {
    display: flex;
    justify-content: space-between;
    padding: 1rem 0;
    border-bottom: 1px solid rgba(255,255,255,0.1);
}

.stat-item:last-child {
    border-bottom: none;
}

.stat-label {
    color: rgba(255,255,255,0.7);
}

.stat-value {
    font-weight: 700;
    color: var(--accent-soft);
}

/* Проблема */
.problem {
    padding: 5rem 0;
    background: white;
}

.problem-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 2rem;
    margin-top: 3rem;
}

.problem-card {
    background: #f8fafc;
    padding: 2rem;
    border-radius: 16px;
    border-top: 4px solid var(--accent);
    box-shadow: 0 10px 25px -5px rgba(0,0,0,0.05);
    transition: all 0.3s ease;
}

.problem-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 15px 35px -5px rgba(0,0,0,0.1);
}

.problem-icon {
    font-size: 2.5rem;
    margin-bottom: 1rem;
}

/* Преимущества аутсорсинга */
.outsource {
    padding: 5rem 0;
    background: linear-gradient(135deg, #f1f5f9 0%, #e6edf5 100%);
}

.outsource-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 2rem;
    margin: 3rem 0;
}

.outsource-card {
    background: white;
    padding: 2rem;
    border-radius: 16px;
    box-shadow: 0 10px 30px -10px rgba(11, 43, 79, 0.1);
    transition: all 0.3s ease;
}

.outsource-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 15px 40px -10px rgba(11, 43, 79, 0.15);
}

.outsource-card h3 {
    margin: 1rem 0;
}

.badge {
    background: var(--accent);
    color: white;
    padding: 0.2rem 1rem;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 600;
    display: inline-block;
}

/* Услуги */
.services {
    padding: 5rem 0;
    background: white;
}

.services-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 2rem;
    margin-top: 3rem;
}

.service-card {
    background: white;
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 2rem;
    transition: all 0.3s;
    position: relative;
}

.service-card:hover {
    border-color: var(--accent);
    box-shadow: 0 20px 30px -10px rgba(37, 99, 235, 0.15);
}

.service-icon {
    font-size: 2.2rem;
    margin-bottom: 1rem;
}

.service-card h3 {
    font-size: 1.3rem;
    margin-bottom: 1rem;
}

.service-card p {
    color: var(--text-light);
    font-size: 0.95rem;
}

/* Схема работы */
.workflow {
    padding: 5rem 0;
    background: #f1f5f9;
}

.workflow-steps {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 2rem;
    margin-top: 3rem;
}

.step {
    text-align: center;
    position: relative;
}

.step-number {
    width: 50px;
    height: 50px;
    background: var(--accent);
    color: white;
    font-size: 1.5rem;
    font-weight: 700;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 1.5rem;
    transition: all 0.3s ease;
}

.step:hover .step-number {
    transform: scale(1.1);
    background: var(--primary-light);
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.3);
}

.step:hover {
    transform: translateY(-5px);
}

/* Кейс */
.case {
    padding: 5rem 0;
    background: white;
}

.case-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 4rem;
    align-items: center;
    margin-top: 2rem;
}

.case-stats {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
    margin-top: 2rem;
}

.stat-block {
    background: #f1f5f9;
    padding: 1.5rem;
    border-radius: 12px;
    text-align: center;
    transition: all 0.3s ease;
}

.stat-block:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 25px -5px rgba(0,0,0,0.1);
}

.stat-number {
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--accent);
    transition: all 0.3s ease;
}

.stat-block:hover .stat-number {
    transform: scale(1.05);
}

/* Контакты */
.contacts {
    padding: 5rem 0;
    background: var(--primary);
    color: white;
}

.contacts h2 {
    color: white;
}

.contacts h2:after {
    background: white;
}

.contacts-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 4rem;
    margin-top: 3rem;
}

.contact-info {
    background: rgba(255,255,255,0.05);
    padding: 2.5rem;
    border-radius: 16px;
    backdrop-filter: blur(10px);
}

.contact-item {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin: 2rem 0;
}

.contact-icon {
    width: 48px;
    height: 48px;
    background: var(--accent);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.3rem;
    flex-shrink: 0;
    transition: all 0.3s ease;
}

.contact-icon svg {
    width: 24px;
    height: 24px;
    color: white;
}

.contact-item:hover .contact-icon {
    transform: scale(1.1);
    background: var(--accent-soft);
}

.contact-info a {
    color: white;
    text-decoration: none;
    font-size: 1.2rem;
    transition: color 0.2s;
}

.contact-info a:hover {
    color: var(--accent-soft);
}

.form-group {
    margin-bottom: 1.5rem;
}

.form-group input,
.form-group textarea {
    width: 100%;
    padding: 1rem;
    border: 1px solid rgba(255,255,255,0.2);
    background: rgba(255,255,255,0.05);
    border-radius: 8px;
    color: white;
    font-size: 1rem;
}

.form-group input::placeholder,
.form-group textarea::placeholder {
    color: rgba(255,255,255,0.6);
}

.form-group input:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--accent);
    background: rgba(255,255,255,0.1);
}

/* Modal Styles */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1000;
    animation: fadeIn 0.3s ease;
}

.modal.active {
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(5px);
}

.modal-content {
    position: relative;
    background: white;
    width: 90%;
    max-width: 500px;
    max-height: 90vh;
    overflow-y: auto;
    border-radius: 20px;
    padding: 2.5rem;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
    animation: slideUp 0.3s ease;
    margin: 2rem 0;
}

.modal-close {
    position: absolute;
    top: 1rem;
    right: 1rem;
    width: 40px;
    height: 40px;
    background: var(--border);
    border: none;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    color: var(--text);
}

.modal-close:hover {
    background: var(--accent);
    color: white;
    transform: rotate(90deg);
}

.modal-close svg {
    width: 24px;
    height: 24px;
}

.modal-content h2 {
    font-size: 1.8rem;
    margin-bottom: 0.5rem;
}

.modal-content .form-group input,
.modal-content .form-group textarea {
    background: #f8fafc;
    border: 2px solid var(--border);
    color: var(--text);
}

.modal-content .form-group input::placeholder,
.modal-content .form-group textarea::placeholder {
    color: var(--text-light);
}

.modal-content .form-group input:focus,
.modal-content .form-group textarea:focus {
    background: white;
    border-color: var(--accent);
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Prevent body scroll when modal is open */
body.modal-open {
    overflow: hidden;
}

.footer {
    background: var(--primary-dark);
    color: rgba(255,255,255,0.7);
    padding: 2rem 0;
    text-align: center;
}

@media (max-width: 768px) {
    h1 { font-size: 2.2rem; }
    h2 { font-size: 2rem; }
    
    .hero .container,
    .case-grid,
    .contacts-grid {
        grid-template-columns: 1fr;
    }
    
    .problem-grid,
    .outsource-grid,
    .services-grid,
    .workflow-steps {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }
    
    .nav {
        display: none;
    }
}