/* CSS-переменные для божественной палитры */
:root {
    --color-background: #0B0F19; /* Глубокая ночь космоса */
    --color-surface: #111625; /* Темный мрамор храма */
    --color-text-primary: #EAE6E0; /* Сияющий пергамент */
    --color-text-secondary: #A09A90; /* Дымка древних рун */
    --color-gold-leaf: #D4AF37; /* Золотой блеск богов */
    --color-gold-glow: rgba(212, 175, 55, 0.4); /* Божественное сияние */
    --color-border: rgba(212, 175, 55, 0.25); /* Золотая кайма */
    --color-starlight: rgba(255, 255, 255, 0.1); /* Звездный свет */
    --font-header: 'Cinzel', serif; /* Шрифт для величественных заголовков */
    --font-body: 'EB Garamond', serif; /* Шрифт для текстов */
}

/* Сброс стилей для единообразия */
*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* Анимация мерцания звездного неба */
@keyframes stars-twinkle {
    0% { background-position: 0 0; }
    100% { background-position: -10000px 5000px; }
}

/* Глобальные стили */
html {
    scroll-behavior: smooth;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body {
    background-color: var(--color-background);
    color: var(--color-text-primary);
    font-family: var(--font-body);
    font-size: 18px;
    line-height: 1.8;
    background: linear-gradient(180deg, var(--color-background) 0%, #1a2238 100%);
    overflow-x: hidden;
    position: relative;
}

body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: radial-gradient(circle at center, var(--color-starlight) 0%, transparent 70%);
    opacity: 0.2;
    z-index: -1;
    animation: pulse-background 15s infinite ease-in-out;
}

/* Анимация фона */
@keyframes pulse-background {
    0% { opacity: 0.2; transform: scale(1); }
    50% { opacity: 0.4; transform: scale(1.05); }
    100% { opacity: 0.2; transform: scale(1); }
}

/* Контейнер */
.container {
    width: 100%;
    max-width: 1100px;
    margin: 0 auto;
    padding: 0 1.5rem;
}

/* Заголовок страницы */
.main-header {
    padding: 2rem 0;
    display: flex;
    justify-content: center;
    align-items: center;
    perspective: 500px;
    position: relative;
    z-index: 1;
}

.main-header::before, .main-header::after {
    content: '';
    position: absolute;
    left: 0;
    right: 0;
    height: 2px;
    background: linear-gradient(to right, transparent, var(--color-gold-leaf), transparent);
    opacity: 0.5;
}

.main-header::before {
    top: 0;
}

.main-header::after {
    bottom: 0;
}

/* Логотип с анимацией */
.logo {
    font-family: var(--font-header);
    font-size: 2.5rem;
    font-weight: 900;
    letter-spacing: 5px;
    color: var(--color-text-primary);
    text-decoration: none;
    display: flex;
    cursor: pointer;
    transform-style: preserve-3d;
    position: relative;
    text-shadow: 0 0 15px var(--color-gold-glow);
}

.logo span {
    display: inline-block;
    position: relative;
    transition: transform 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.logo .accent-char {
    color: var(--color-gold-leaf);
    text-shadow: 0 0 20px var(--color-gold-glow);
}

@keyframes assemble {
    0% {
        opacity: 0;
        transform: translateZ(250px) translateY(60px) rotateX(-90deg);
        filter: blur(6px);
    }
    100% {
        opacity: 1;
        transform: translateZ(0) translateY(0) rotateX(0deg);
        filter: blur(0);
    }
}

@keyframes disassemble {
    to {
        opacity: 0;
        transform: 
            translateX(calc(var(--x, 0) * 40px)) 
            translateY(calc(var(--y, 0) * 40px)) 
            translateZ(calc(var(--z, 0) * 150px))
            rotate(calc(var(--r, 0) * 15deg));
        filter: blur(4px);
    }
}

.logo.is-assembling span {
    opacity: 0;
    transform: translateZ(250px) translateY(60px) rotateX(-90deg);
    animation: assemble 0.8s forwards cubic-bezier(0.175, 0.885, 0.32, 1.275);
    animation-delay: calc(var(--i) * 0.05s);
}

.logo.is-disassembling span {
    animation: disassemble 0.7s forwards ease-out;
    animation-delay: calc(var(--i) * 0.02s);
}

/* Заголовки */
h1, h2, h3 {
    font-family: var(--font-header);
    font-weight: 700;
    text-align: center;
    letter-spacing: 1px;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.5), 0 0 10px var(--color-gold-glow);
}

h1 {
    font-size: clamp(2.8rem, 6vw, 4.5rem);
    line-height: 1.2;
    color: var(--color-text-primary);
    position: relative;
    animation: fade-in 1s ease-in-out;
}

h1::before {
    content: '⚡';
    position: absolute;
    top: -30px;
    left: 50%;
    transform: translateX(-50%);
    font-size: 2rem;
    color: var(--color-gold-glow);
    opacity: 0.4;
}

h2 {
    font-size: clamp(2.2rem, 5vw, 3.2rem);
    margin-bottom: 1.5rem;
    color: var(--color-gold-leaf);
}

h3 {
    font-size: clamp(1.2rem, 3vw, 1.5rem);
    color: var(--color-text-secondary);
    margin-bottom: 1rem;
}

/* Подзаголовок и описание секции */
.subtitle, .section-description {
    max-width: 700px;
    margin: 1.5rem auto;
    text-align: center;
    font-size: clamp(1.1rem, 3vw, 1.25rem);
    color: var(--color-text-secondary);
    animation: fade-in 1s ease-in-out 0.2s;
}

.subtitle {
    margin-bottom: 4rem;
    font-style: italic;
}

.section-description {
    margin-bottom: 2.5rem;
    line-height: 1.7;
}

/* Секции */
section {
    padding: 6rem 0;
    position: relative;
    z-index: 1;
}

section::before, section::after {
    content: '';
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    width: 80%;
    height: 1px;
    background: linear-gradient(to right, transparent, var(--color-gold-leaf), transparent);
    opacity: 0.3;
}

section::before {
    top: 0;
}

section:not(:last-of-type)::after {
    bottom: 0;
}

/* Секция героя */
.hero-section {
    min-height: 95vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    padding: 5vh 0;
    background: linear-gradient(135deg, var(--color-background) 0%, #1a2238 100%);
    position: relative;
    overflow: hidden;
}

.hero-section::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: radial-gradient(circle at center, var(--color-starlight) 0%, transparent 70%);
    animation: pulse-background 10s infinite ease-in-out;
    z-index: -1;
}

.hero-content {
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.hero-section .cta-button-container {
    padding-top: 2rem;
}

/* Кнопка CTA */
.cta-button {
    display: inline-block;
    padding: 1rem 3rem;
    font-family: var(--font-header);
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--color-gold-leaf);
    background: transparent;
    border: 2px solid var(--color-gold-leaf);
    border-radius: 2px;
    text-decoration: none;
    transition: all 0.3s ease;
    box-shadow: 0 0 15px var(--color-gold-glow), inset 0 0 5px rgba(212, 175, 55, 0.2);
    position: relative;
    animation: fade-in 1s ease-in-out 0.4s;
}

.cta-button:hover, .cta-button:focus {
    background: var(--color-gold-leaf);
    color: var(--color-background);
    box-shadow: 0 0 30px var(--color-gold-glow);
    transform: translateY(-3px);
    animation: pulse-cta 1.5s infinite;
}

@keyframes pulse-cta {
    0% { box-shadow: 0 0 0 0 var(--color-gold-glow); }
    70% { box-shadow: 0 0 0 15px rgba(212, 175, 55, 0); }
    100% { box-shadow: 0 0 0 0 rgba(212, 175, 55, 0); }
}

.cta-subtext {
    margin-top: 1rem;
    font-style: italic;
    color: var(--color-text-secondary);
    font-size: 0.9rem;
    animation: fade-in 1s ease-in-out 0.6s;
}

/* Сетка проблем и решений */
.problem-solution-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
    margin-top: 4rem;
}

.problem-solution-card {
    background: linear-gradient(145deg, var(--color-surface), #0f131e);
    padding: 2rem;
    border-radius: 4px;
    border: 1px solid var(--color-border);
    border-bottom: 3px solid var(--color-border);
    position: relative;
    animation: fade-in 1s ease-in-out;
    transition: transform 0.3s ease-in-out, box-shadow 0.3s ease-in-out;
}

.problem-solution-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.2), 0 0 20px var(--color-gold-glow);
}

.problem-solution-card::before {
    content: '';
    position: absolute;
    top: 1.5rem;
    left: 1.5rem;
    width: 20px;
    height: 3px;
    background: var(--color-gold-leaf);
    opacity: 0.7;
}

.problem-solution-card h4 {
    margin-bottom: 1rem;
    color: var(--color-text-primary);
}

.problem-solution-card p {
    color: var(--color-text-secondary);
    font-size: 1rem;
    line-height: 1.7;
}

.problem-solution-card .solution {
    margin-top: 1.5rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--color-border);
    color: var(--color-text-primary);
    font-weight: 500;
}

.problem-solution-card .solution strong {
    color: var(--color-gold-leaf);
    font-weight: 700;
}

/* Секция отзывов */
.testimonials-section {
    background: linear-gradient(180deg, var(--color-surface), #0f131e);
    padding: 6rem 0;
    border-top: 1px solid var(--color-border);
    border-bottom: 1px solid var(--color-border);
    position: relative;
    overflow: hidden;
}

.testimonials-section::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: radial-gradient(circle at center, var(--color-starlight) 0%, transparent 70%);
    opacity: 0.2;
    z-index: -1;
}

.testimonials-swiper-container {
    width: 100%;
    padding-top: 2rem;
    padding-bottom: 4rem;
}

.testimonial-card {
    background: var(--color-background);
    border: 1px solid var(--color-border);
    border-radius: 4px;
    padding: 2.5rem 2rem 2rem;
    position: relative;
    width: 90%;
    max-width: 500px;
    margin: 0 auto;
    min-height: 280px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
    animation: card-enter 0.5s ease;
    cursor: grab;
}

.testimonial-card:active {
    cursor: grabbing;
}

.testimonial-card::before {
    content: '“';
    position: absolute;
    top: -10px;
    left: 15px;
    font-family: var(--font-header);
    font-size: 6rem;
    color: var(--color-gold-glow);
    line-height: 1;
    opacity: 0.3;
    z-index: 0;
}

.testimonial-text {
    font-size: 1.1rem;
    font-style: italic;
    margin-bottom: 1.5rem;
    position: relative;
    z-index: 1;
    color: var(--color-text-primary);
}

.testimonial-author {
    text-align: right;
    border-top: 1px solid var(--color-border);
    padding-top: 1rem;
    margin-top: auto;
}

.testimonial-author .name {
    font-weight: 700;
    color: var(--color-text-primary);
}

.testimonial-author .role {
    font-size: 0.9rem;
    color: var(--color-text-secondary);
}

.testimonials-swiper-container .swiper-pagination-bullet {
    background: var(--color-text-secondary);
    opacity: 0.5;
    transition: background 0.3s ease, opacity 0.3s ease;
}

.testimonials-swiper-container .swiper-pagination-bullet-active {
    background: var(--color-gold-leaf);
    opacity: 1;
}

@keyframes card-enter {
    from {
        transform: scale(0.9) translateY(20px);
        opacity: 0;
    }
    to {
        transform: scale(1) translateY(0);
        opacity: 1;
    }
}

/* Футер */
.main-footer {
    padding: 4rem 0 2rem;
    text-align: center;
    position: relative;
}

.main-footer::before {
    content: '';
    position: absolute;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 50%;
    height: 1px;
    background: linear-gradient(to right, transparent, var(--color-gold-leaf), transparent);
}

.footer-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1.5rem;
    color: var(--color-text-secondary);
}

/* Стили для информера Яндекс.Метрики */
.metrika-informer {
    display: inline-block;
    opacity: 0.6;
    transition: opacity 0.3s ease, transform 0.3s ease;
    /* --- ДОБАВЛЕНО ДЛЯ НАДЕЖНОСТИ --- */
    /* Резервируем место, даже если картинка заблокирована */
    min-width: 88px;
    min-height: 31px;
}

.metrika-informer:hover, .metrika-informer:focus {
    opacity: 1;
    transform: translateY(-3px);
}

/* Анимация появления */
@keyframes fade-in {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Медиа-запросы для адаптивности */
@media (max-width: 768px) {
    body {
        font-size: 16px;
    }
    section {
        padding: 4rem 0;
    }
    h1 {
        font-size: clamp(2.5rem, 8vw, 2.8rem);
    }
    h2 {
        font-size: clamp(2rem, 7vw, 2.2rem);
    }
    .hero-section {
        min-height: 90vh;
        padding-top: 10vh;
    }
    .logo {
        font-size: 2rem;
    }
}

@media (max-width: 480px) {
    .container {
        padding: 0 1rem;
    }
    h1 {
        font-size: 2.2rem;
    }
    h2 {
        font-size: 1.8rem;
    }
    h3 {
        font-size: 1.3rem;
    }
    .cta-button {
        padding: 0.8rem 2rem;
        font-size: 1rem;
    }
    .problem-solution-card {
        padding: 1.5rem;
    }
    .testimonial-card {
        min-height: 260px;
    }
    .testimonial-text {
        font-size: 1rem;
    }
}

/* Доступность */
:focus-visible {
    outline: 2px solid var(--color-gold-leaf);
    outline-offset: 4px;
    border-radius: 2px;
}
/* Убираем стандартный аутлайн, когда используется :focus-visible */
:focus:not(:focus-visible) {
    outline: none;
}