/* ===== Общие стили для обеих страниц ===== */
:root {
    /* Светлая тема (по умолчанию) */
    --black: #0a0a0a;
    --white: #ffffff;
    --gray-50: #fafafa;
    --gray-100: #f5f5f5;
    --gray-200: #e5e5e5;
    --gray-300: #d4d4d4;
    --gray-700: #404040;
    --gray-800: #262626;
    --gray-900: #171717;
    --primary: #2563eb;
    --primary-dark: #1d4ed8;
    
    --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    --font-serif: 'Playfair Display', Georgia, serif;
    
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
    
    --max-width: 1300px;
    --border-radius: 12px;
}

/* Темная тема */
[data-theme="dark"] {
    --black: #fafafa;
    --white: #0a0a0a;
    --gray-50: #171717;
    --gray-100: #262626;
    --gray-200: #404040;
    --gray-300: #525252;
    --gray-700: #d4d4d4;
    --gray-800: #e5e5e5;
    --gray-900: #f5f5f5;
    --primary: #3b82f6;
    --primary-dark: #60a5fa;
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.3);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.4);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.5);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
    font-size: 16px;
    overflow-x: hidden;
    max-width: 100%;
}

body {
    font-family: var(--font-sans);
    line-height: 1.7;
    color: var(--gray-800);
    background-color: var(--white);
    overflow-x: hidden;
    max-width: 100%;
    transition: background-color 0.5s ease, color 0.5s ease;
}

/* ===== Типография ===== */
h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-serif);
    font-weight: 600;
    line-height: 1.2;
    margin-bottom: 1.5rem;
    color: var(--black);
    transition: color 0.5s ease;
}

h1 {
    font-size: 3.5rem;
    font-weight: 700;
    letter-spacing: -0.5px;
    margin-bottom: 1rem;
    background: linear-gradient(135deg, var(--black) 0%, var(--gray-700) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}
.pointer{
    color:#2563eb;
    padding-left: 5px;
}
h2 {
    font-size: 2.5rem;
    position: relative;
    display: inline-block;
    margin-top: 4rem;
    margin-bottom: 2rem;
}

h2:after {
    content: '';
    position: absolute;
    bottom: -10px;
    left: 0;
    width: 60px;
    height: 3px;
    background: linear-gradient(90deg, var(--primary), var(--primary-dark));
    transition: all 0.5s ease;
}

h3 {
    font-size: 1.5rem;
    margin-top: 2.5rem;
    margin-bottom: 1rem;
}

p {
    margin-bottom: 1.5rem;
    font-size: 1.1rem;
    color: var(--gray-700);
    transition: color 0.5s ease;
}

a {
    color: inherit;
    text-decoration: none;
    transition: var(--transition);
}

.text-lead {
    font-size: 1.3rem;
    font-weight: 300;
    line-height: 1.6;
    color: var(--gray-700);
}

.text-small {
    font-size: 0.9rem;
    color: var(--gray-700);
}

/* ===== Навигация ===== */
header {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    z-index: 1000;
    background-color: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--gray-200);
    padding: 1.2rem 0;
    transition: var(--transition);
}

[data-theme="dark"] header {
    background-color: rgba(10, 10, 10, 0.95);
    border-bottom: 1px solid var(--gray-800);
}

header.scrolled {
    padding: 0.8rem 0;
    box-shadow: var(--shadow-md);
}

.container {
    max-width: var(--max-width);
    margin: auto;
    padding: 0 0rem;
}

.nav-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    font-family: var(--font-serif);
    font-size: 1.8rem;
    font-weight: 700;
    color: var(--black);
    letter-spacing: -0.5px;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.logo-icon {
    color: var(--primary);
    font-size: 1.5rem;
}

.nav-links {
    display: flex;
    list-style: none;
    gap: 2.5rem;
}

.nav-link {
    font-weight: 500;
    font-size: 0.95rem;
    letter-spacing: 0.5px;
    text-transform: uppercase;
    position: relative;
    padding: 0.5rem 0;
    color: var(--gray-800);
}

.nav-link:after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 0;
    height: 2px;
    background: linear-gradient(90deg, var(--primary), var(--primary-dark));
    transition: var(--transition);
}

.nav-link:hover:after {
    width: 100%;
}

.mobile-menu-btn {
    display: none;
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: var(--black);
    z-index: 1001;
}

/* ===== Кнопка темы ===== */
.theme-toggle {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    border: none;
    color: white;
    font-size: 1.5rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: var(--shadow-lg);
    z-index: 999;
    transition: var(--transition);
    overflow: hidden;
}

.theme-toggle:hover {
    transform: scale(1.1) rotate(15deg);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.2);
}

.theme-toggle:before {
    content: '';
    position: absolute;
    width: 100%;
    height: 100%;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 50%;
    transform: scale(0);
    transition: transform 0.3s ease;
}

.theme-toggle:active:before {
    transform: scale(1);
}

.theme-icon {
    position: absolute;
    transition: transform 0.5s ease, opacity 0.5s ease;
}

.sun-icon {
    transform: rotate(0deg);
    opacity: 1;
}

[data-theme="dark"] .sun-icon {
    transform: rotate(90deg);
    opacity: 0;
}

.moon-icon {
    transform: rotate(-90deg);
    opacity: 0;
}

[data-theme="dark"] .moon-icon {
    transform: rotate(0deg);
    opacity: 1;
}

/* ===== Секции ===== */
section {
    padding: 5rem 0;
    position: relative;
}

.section-alt {
    background-color: var(--gray-50);
}

.section-title {
    text-align: center;
    margin-bottom: 3rem;
}

.section-title h2 {
    margin-top: 0;
}

.section-title h2:after {
    left: 50%;
    transform: translateX(-50%);
}

/* ===== Карточки ===== */
.research-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
    margin-top: 3rem;
}

.card {
    background-color: var(--white);
    border-radius: var(--border-radius);
    padding: 2.5rem;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--gray-200);
    transition: var(--transition);
    height: 100%;
    position: relative;
    overflow: hidden;
}

.card:before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 4px;
    height: 100%;
    background: linear-gradient(to bottom, var(--primary), var(--primary-dark));
    transition: width 0.3s ease;
}

.card:hover {
    transform: translateY(-10px);
    box-shadow: var(--shadow-lg);
}

.card:hover:before {
    width: 8px;
}

.card-icon {
    font-size: 2.5rem;
    margin-bottom: 1.5rem;
    color: var(--primary);
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* ===== Кнопки ===== */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.9rem 2.2rem;
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    color: white;
    border: none;
    border-radius: var(--border-radius);
    font-weight: 500;
    font-size: 0.95rem;
    letter-spacing: 0.5px;
    transition: var(--transition);
    cursor: pointer;
    text-transform: uppercase;
    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.7s ease;
}

.btn:hover:before {
    left: 100%;
}

.btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 10px 20px rgba(37, 99, 235, 0.2);
}

.btn-outline {
    background: transparent;
    color: var(--primary);
    border: 2px solid var(--primary);
}

.btn-outline:hover {
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    color: white;
}

/* ===== Анимации ===== */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeInRight {
    from {
        opacity: 0;
        transform: translateX(30px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.fade-in {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.8s ease, transform 0.8s ease;
}

.fade-in.visible {
    opacity: 1;
    transform: translateY(0);
}

/* ===== Прогресс бар для чтения ===== */
.progress-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 4px;
    background: transparent;
    z-index: 1001;
}

.progress-bar {
    height: 4px;
    background: linear-gradient(90deg, var(--primary), var(--primary-dark));
    width: 0%;
    transition: width 0.3s ease;
}

/* ===== Утилиты ===== */
.text-center {
    text-align: center;
}

.mt-1 { margin-top: 1rem; }
.mt-2 { margin-top: 2rem; }
.mt-3 { margin-top: 3rem; }
.mt-4 { margin-top: 4rem; }
.mb-1 { margin-bottom: 1rem; }
.mb-2 { margin-bottom: 2rem; }
.mb-3 { margin-bottom: 3rem; }
.mb-4 { margin-bottom: 4rem; }
.ml-2 { margin-left: 0.5rem; }

/* ===== НАЧАЛО ИСПРАВЛЕНИЙ ДЛЯ КНОПОК ===== */
.hero-text .mt-3 {
    /* 1. Заставляем контейнер принять ширину содержимого */
    width: -moz-fit-content; /* Для совместимости с Firefox */
    width: fit-content;
    
    /* 2. Центрируем сам контейнер по горизонтали */
    margin-left: 0;
    margin-right: auto;
    
    /* 3. Используем Flexbox для управления кнопками */
    display: flex;
    flex-wrap: wrap;         /* Разрешаем перенос на новую строку */
    justify-content: flex-start; /* Выравниваем кнопки по левому краю ВНУТРИ контейнера */
    gap: 1rem;               /* Задаем красивый отступ между кнопками */
}

/* Убираем лишний отступ слева у кнопок на мобильных, чтобы он не мешал */
.hero-text .mt-3 .ml-2 {
    margin-left: 0;
}
/* ===== КОНЕЦ ИСПРАВЛЕНИЙ ДЛЯ КНОПОК ===== */


/* ===== Адаптивность ===== */
@media (max-width: 1024px) {
    h1 {
        font-size: 2.8rem;
    }
    
    h2 {
        font-size: 2.2rem;
    }
    
    .theme-toggle {
        bottom: 1.5rem;
        right: 1.5rem;
        width: 50px;
        height: 50px;
        font-size: 1.3rem;
    }
}

@media (max-width: 768px) {
    .container {
        padding: 0 1.5rem;
    }
    
    .mobile-menu-btn {
        display: block;
    }
    
    .nav-links {
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        height: 100vh;
        background-color: var(--white);
        flex-direction: column;
        justify-content: center;
        align-items: center;
        padding: 2rem;
        transform: translateX(-100%);
        opacity: 0;
        visibility: hidden;
        transition: var(--transition);
        z-index: 999;
    }
    
    [data-theme="dark"] .nav-links {
        background-color: var(--gray-900);
    }
    
    .nav-links.active {
        transform: translateX(0);
        opacity: 1;
        visibility: visible;
    }
    
    .footer-content {
        flex-direction: column;
        gap: 2rem;
    }
    
    h1 {
        font-size: 2.3rem;
    }
    
    h2 {
        font-size: 1.9rem;
    }
    
    section {
        padding: 3rem 0;
    }
}

@media (max-width: 480px) {
    .container {
        padding: 0 1rem;
    }
    
    h1 {
        font-size: 2rem;
    }
    
    .text-lead {
        font-size: 1.1rem;
    }
    
    .card {
        padding: 1.8rem;
    }
    
    .theme-toggle {
        bottom: 1rem;
        right: 1rem;
        width: 45px;
        height: 45px;
        font-size: 1.2rem;
    }
}

/* ===== Стили для второй страницы ===== */
.practice-category {
    margin-bottom: 3rem;
    padding-bottom: 2rem;
    border-bottom: 1px solid var(--gray-200);
}

.practice-category:last-child {
    border-bottom: none;
}

.practice-list {
    list-style: none;
    margin-top: 1.5rem;
}

.practice-list li {
    margin-bottom: 1rem;
    padding-left: 1.5rem;
    position: relative;
}

.practice-list li:before {
    content: '•';
    position: absolute;
    left: 0;
    color: var(--primary);
    font-size: 1.5rem;
}

.practice-icon {
    font-size: 2rem;
    margin-right: 1rem;
    color: var(--primary);
}

.page-switcher {
    display: flex;
    justify-content: center;
    gap: 1rem;
    margin-top: 3rem;
    padding-top: 2rem;
    border-top: 1px solid var(--gray-200);
}

/* ===== НАЧАЛО: Стили для единого блока контактов ===== */
        .contact-unified-card {
            background-color: var(--white);
            border-radius: var(--border-radius);
            padding: 3rem;
            box-shadow: var(--shadow-lg);
            max-width: 700px;
            margin: 3rem auto 0;
            border: 1px solid var(--gray-200);
            transition: var(--transition);
        }

        .contact-unified-card:hover {
            transform: translateY(-5px);
            box-shadow: 0 15px 25px rgba(0, 0, 0, 0.15);
        }
        
        .contact-row {
            display: flex;
            align-items: flex-start;
            gap: 1.5rem;
            margin-bottom: 2rem;
        }

        .contact-row:last-child {
            margin-bottom: 0;
        }
        
        .contact-icon {
            font-size: 1.8rem;
            color: var(--primary);
            margin-top: 0.2rem;
            background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
            -webkit-background-clip: text;
            -webkit-text-fill-color: transparent;
            background-clip: text;
            flex-shrink: 0;
        }
        
        .contact-details h4 {
            margin-top: 0;
            margin-bottom: 0.4rem;
            font-size: 1.25rem;
        }
        
        .contact-details p {
            margin-bottom: 0.2rem;
            font-size: 1rem;
            word-break: break-word;
        }

        .contact-details .text-small {
            margin-top: 0.5rem;
        }
        
        .contact-email {
            font-family: monospace;
            font-size: 1rem;
            color: var(--primary);
            background: var(--gray-50);
            padding: 0.3rem 0.6rem;
            border-radius: 4px;
            display: inline-block;
            max-width: 100%;
            overflow-wrap: break-word;
            word-break: break-all;
            border: 1px solid var(--gray-200);
            transition: all 0.5s ease;
        }
        /* ===== КОНЕЦ: Стили для единого блока контактов ===== */

/* ===== Цитата ===== */
.quote-block {
    max-width: 800px;
    margin: 4rem auto;
    padding: 3rem;
    position: relative;
    background-color: var(--gray-50);
    border-radius: var(--border-radius);
    border-left: 4px solid var(--primary);
}

.quote-block:before {
    content: '"';
    position: absolute;
    top: -20px;
    left: 30px;
    font-family: var(--font-serif);
    font-size: 8rem;
    color: var(--gray-300);
    line-height: 1;
}

.quote-text {
    font-size: 1.5rem;
    font-style: italic;
    color: var(--gray-800);
    margin-bottom: 1.5rem;
    position: relative;
    z-index: 1;
}

/* ===== Футер ===== */
footer {
    background-color: var(--gray-900);
    color: var(--white);
    padding: 4rem 0 2rem;
    position: relative;
    overflow: hidden;
}

footer:before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, rgba(37, 99, 235, 0.1) 0%, transparent 100%);
    pointer-events: none;
}

.footer-content {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 3rem;
    position: relative;
    z-index: 1;
}

.footer-logo {
    font-family: var(--font-serif);
    font-size: 2rem;
    font-weight: 700;
    margin-bottom: 1rem;
    color: var(--white);
}

.footer-nav {
    display: flex;
    flex-direction: column;
    gap: 0.8rem;
}

.footer-link {
    color: var(--gray-300);
    transition: var(--transition);
}

.footer-link:hover {
    color: var(--white);
    padding-left: 5px;
}

.copyright {
    text-align: center;
    padding-top: 2rem;
    border-top: 1px solid var(--gray-800);
    color: var(--gray-400);
    font-size: 0.9rem;
    position: relative;
    z-index: 1;
}

/* ===== Герой-секция изображение ===== */
.hero-content {
    display: flex;
    align-items: center;
    gap: 5rem;
}

.hero-text {
    flex: 1;
    opacity: 0;
    transform: translateY(30px);
    animation: fadeInUp 0.8s ease forwards;
}

.hero-image {
    flex: 1;
    position: relative;
    opacity: 0;
    transform: translateX(30px);
    animation: fadeInRight 0.8s ease 0.3s forwards;
}

.image-placeholder {
    width: 100%;
    height: 500px;
    background-color: var(--gray-100);
    border-radius: var(--border-radius);
    position: relative;
    overflow: hidden;
    box-shadow: var(--shadow-lg);
    border: 1px solid var(--gray-200);
}

.image-placeholder:before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, var(--gray-200) 0%, var(--gray-100) 100%);
}

.image-icon {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 8rem;
    color: var(--gray-300);
}

.hero:before {
    content: '';
    position: absolute;
    top: -50%;
    right: -20%;
    width: 800px;
    height: 800px;
    background: radial-gradient(circle, var(--primary) 0%, transparent 70%);
    opacity: 0.05;
    z-index: -1;
}

/* Предотвращаем горизонтальный скролл от декоративного фона на мобильных */
.hero {
    overflow-x: hidden;
}

/* ===== Дополнительные стили для второй страницы ===== */
.practice-category {
    margin-bottom: 3rem;
    padding-bottom: 2rem;
    border-bottom: 1px solid var(--gray-200);
}

.practice-category:last-child {
    border-bottom: none;
}

.practice-list {
    list-style: none;
    margin-top: 1.5rem;
}

.practice-list li {
    margin-bottom: 1rem;
    padding-left: 1.5rem;
    position: relative;
}

.practice-list li:before {
    content: '•';
    position: absolute;
    left: 0;
    color: var(--primary);
    font-size: 1.5rem;
}

.practice-icon {
    font-size: 2rem;
    margin-right: 1rem;
    color: var(--primary);
}

.page-switcher {
    display: flex;
    justify-content: center;
    gap: 1rem;
    margin-top: 3rem;
    padding-top: 2rem;
    border-top: 1px solid var(--gray-200);
}

/* Адаптивность для контактов */
@media (max-width: 768px) {
    .contact-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 1rem;
    }
    
    .contact-item-content {
        width: 100%;
    }
    
    .contact-email {
        font-size: 0.9rem;
        padding: 0.4rem;
        width: 100%;
        box-sizing: border-box;
    }
    
    .hero-content {
        flex-direction: column;
        gap: 3rem;
        text-align: center;
    }
    
    .hero-text {
        order: 2;
    }
    
    .hero-image {
        order: 1;
    }
    
    .image-placeholder {
        height: 350px;
    }
}

@media (max-width: 480px) {
    .contact-item {
        padding: 1.2rem;
    }
    
    .contact-item h3 {
        font-size: 1.1rem;
    }
    
    .contact-email {
        font-size: 0.85rem;
    }
    
    .image-placeholder {
        height: 300px;
    }
}

/* Ограничение ширины внешних виджетов (cookie consent и т.п.) для мобильных */
[data-elfsight-app-lazy] {
    max-width: 100%;
    overflow-x: hidden;
}