/* ==========================================================================
   ИНДИВИДУАЛЬНАЯ CSS-ДОБАВКА ДЛЯ ГЛАВНОЙ СТРАНИЦЫ HOMSIB.RU
   ========================================================================== */

/* 1. РОДНАЯ ВЛОЖЕННОСТЬ СХЕМЫ И ИНТЕРАКТИВНЫЕ ЭФФЕКТЫ */
.market-schema {
    margin: 50px auto;
    max-width: var(--schema-size);
    width: 100%;
    height: auto;
    overflow: visible;
    transition: max-width 0.3s ease;

    /* Линии связи между узлами */
    & .connection-line {
        stroke: var(--theme-khaki);
        stroke-width: 2;
        stroke-dasharray: 6, 6;
        transition: stroke-dasharray 0.4s ease, stroke 0.4s ease;
        animation: connectLines 0.5s ease 1.1s forwards; /* Авто-замыкание цепи */
    }

    /* Рамки боковых узлов (Продавец / Покупатель) */
    & .node-box {
        fill: transparent;
        stroke: var(--theme-khaki);
        stroke-width: 2;
    }

    /* Строгий печатный шрифт текста внутри всей схемы */
    & .node-text {
        font-family: "Georgia", serif;
        font-size: 14px;
        fill: var(--theme-khaki);
        font-weight: bold;
        letter-spacing: 0.05em;
        pointer-events: none;
    }

    /* Временная текстовая подсказка (Исчезает через 1.1 сек) */
    & .node-hint-text {
        opacity: 1;
        font-size: 11px;
        fill: var(--theme-khaki);
        animation: fadeOutText 0.4s ease 1.1s forwards;
    }

    /* Центральный глобус и его меридианы */
    & .center-hub {
        transform-origin: 300px 100px;
    }

    /* зеленая векторная галочка-подпись */
    & .auto-check-mark {
        opacity: 0;
        /* Мягко вылетает и фиксируется поверх глобуса одновременно с исчезновением текста */
        animation: fadeInCheck 0.6s ease 1.2s forwards;
    }
}

/* 2. СБОРКА СХЕМЫ ПРИ ЗАГРУЗКЕ СТРАНИЦЫ (0.0 сек - 1.1 сек) */
@keyframes slideLeft {
    0% { transform: translateX(-100px); opacity: 0; }
    100% { transform: translateX(0); opacity: 1; }
}
@keyframes slideRight {
    0% { transform: translateX(100px); opacity: 0; }
    100% { transform: translateX(0); opacity: 1; }
}
@keyframes fadeInCenter {
    0% { transform: scale(0.6); opacity: 0; }
    100% { transform: scale(1); opacity: 1; }
}

.animate-left { animation: slideLeft 0.9s cubic-bezier(0.25, 1, 0.5, 1) forwards; }
.animate-right { animation: slideRight 0.9s cubic-bezier(0.25, 1, 0.5, 1) forwards; }
.animate-center { 
    animation: fadeInCenter 0.8s cubic-bezier(0.25, 1, 0.5, 1) forwards;
    transform-origin: 300px 100px;
}

/* 3. КЛЮЧЕВЫЕ КАДРЫ СИНХРОНИЗАЦИИ ФИНАЛА (Срабатывают автоматически через 1.1 сек) */

/* Плавное растворение текста подсказки "ИНТЕРНЕТ" */
@keyframes fadeOutText {
    0% { opacity: 1; transform: scale(1); }
    100% { opacity: 0; transform: scale(0.8); }
}

/* Вылет, инерционный отскок и жесткая фиксация зеленой галочки */
@keyframes fadeInCheck {
    0% { transform: translate(270, 75) scale(0) rotate(-10deg); opacity: 0; }
    70% { transform: translate(270, 75) scale(0.14) rotate(5deg); opacity: 1; }
    100% { transform: translate(270, 75) scale(0.12) rotate(0deg); opacity: 1; }
}

/* Слияние пунктира в сплошную рабочую b2b-линию */
@keyframes connectLines {
    100% {
        stroke-dasharray: 0;
        stroke: #278500;
    }
}

/* 4. ТЕКСТ МАНИФЕСТА  */
.manifesto {
    max-width: 800px;
    margin: 40px auto;
    font-size: var(--base-font);
    text-align: justify;
    text-align-last: center;
    color: var(--font-color);
    transition: font-size 0.3s ease;

    & p {
        margin-bottom: 20px;
        text-indent: 2em; 
    }
}


.communication-channels {
    margin-top: 50px;
    display: flex;
    justify-content: center;
    gap: 20px;

    & a {
        position: relative;
        display: inline-block;
        font-size: 18px;
        font-weight: bold;
        color: var(--theme-khaki) !important;
        text-decoration: none;
        padding: 12px 35px;
        border: 1px solid var(--theme-khaki);
        z-index: 1;
        transition: color 0.3s ease;
        box-sizing: border-box;
        &::after {
            position: absolute;
            content: "";
            left: 0;
            width: 100%;
            height: 0%;
            background: var(--theme-khaki);
            transition: all 0.3s ease 0s;
            top: 50%;
            z-index: -1;
        }
        &:hover {
            color: #fff !important;

            &::after {
                top: 0px;
                height: 100%;
            }
        }
    }
}

/* 6. ФИКСЫ ДЛЯ ЭКРАНОВ СМАРТФОНОВ (ДО 500PX) */
@media screen and (max-width: 500px) {
    .communication-channels {
        flex-direction: column;
        align-items: center;
        gap: 15px;
        
        & a { 
            width: 100%; 
            max-width: 280px; 
        }
    }
    
    .manifesto p {
        text-indent: 0;
    }
}
