/* Главная: без лишнего отступа под фиксированную шапку */
.page-content:has(.main-stage) {
    padding-top: 0;
    min-height: calc(100vh - var(--header-offset, 158px));
    padding-bottom: 0;
    position: relative;
}

/* -----------------------------------
   ГЛАВНАЯ СЦЕНА
----------------------------------- */
.main-stage {
    position: absolute;
    --home-header-offset: var(--header-offset, 130px);
    --home-footer-offset: 0px;
    top: calc(var(--home-header-offset) + (100vh - var(--home-header-offset) - var(--home-footer-offset)) / 2);
    left: 50%;
    transform: translate(-50%, -50%);
    width: 1200px;
    height: 800px;
    /* ось: центр логотипа = центр 4 плашек = центр крысы */
    --home-axis-y: 50%;
    --pest-v-step: 8.8%;
    --stripe-btn-h: 65px;
    --stripe-gap: 15px;
    --stripes-block-h: calc(4 * var(--stripe-btn-h) + 3 * var(--stripe-gap));
}

/* -----------------------------------
   БЛОК КНОПОК И СХОДЯЩИХСЯ ХВОСТОВ
----------------------------------- */
.stripes-wrapper {
    position: absolute;
    top: var(--home-axis-y);
    left: 50px;
    transform: translateY(calc(-0.5 * var(--stripes-block-h)));
    display: flex;
    align-items: center;
    z-index: 10;
}

.stripes-container {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.stripe-btn {
    display: flex;
    align-items: center;
    background-color: #d90429;
    color: #ffffff;
    height: 65px;
    width: 340px;
    padding-left: 25px;
    font-size: 20px;
    text-decoration: none;
    font-weight: bold;
    white-space: nowrap;
    transition: background-color 0.2s ease;
}

.stripe-btn:hover {
    background-color: #ef233c;
}

.stripe-btn:active {
    transform: translateY(2px) scale(0.98);
}

.stripes-tails-img {
    height: 305px;
    width: auto;
    display: block;
    margin-left: -1px;
    user-select: none;
    pointer-events: none;
}

/* -----------------------------------
   ЦЕНТРАЛЬНЫЙ ЛОГОТИП VISTA
----------------------------------- */
.center-logo-block {
    position: absolute;
    top: calc(var(--home-axis-y) - 20px);
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 8;
}

.center-logo-img {
    width: 200px;
    height: auto;
    display: block;
}

/* -----------------------------------
   ВРЕДИТЕЛИ (дуга, % — масштаб под экран)
----------------------------------- */
.insects-container {
    position: absolute;
    inset: 0;
    z-index: 5;
    pointer-events: none;
}

.pest-item {
    position: absolute;
    display: flex;
    align-items: center;
    gap: clamp(6px, 0.9vw, 12px);
    text-decoration: none;
    pointer-events: auto;
    cursor: pointer;
    transform: translateY(-50%);
}

/* дуга 5 пунктов; pest-item-3 — крыса на оси */
.pest-item-1 { top: calc(var(--home-axis-y) - 2 * var(--pest-v-step)); left: calc(54% + 13% * sin(0deg) + 40px); }
.pest-item-2 { top: calc(var(--home-axis-y) - var(--pest-v-step)); left: calc(54% + 13% * sin(45deg)); }
.pest-item-3 { top: var(--home-axis-y); left: calc(54% + 13% * sin(90deg)); }
.pest-item-4 { top: calc(var(--home-axis-y) + var(--pest-v-step)); left: calc(54% + 13% * sin(135deg)); }
.pest-item-5 { top: calc(var(--home-axis-y) + 2 * var(--pest-v-step)); left: calc(54% + 13% * sin(180deg) + 40px); }

.pest-thumb {
    height: clamp(48px, 6.3vw, 78px);
    width: auto;
    max-width: clamp(72px, 10.5vw, 135px);
    object-fit: contain;
    display: block;
    flex-shrink: 0;
    user-select: none;
}

.pest-thumb-rat {
    height: clamp(66px, 8.25vw, 108px);
    max-width: clamp(84px, 13.5vw, 165px);
}

.pest-label {
    font-family: 'Roboto', sans-serif;
    font-style: italic;
    font-weight: 400;
    font-size: clamp(15px, 1.45vw, 20px);
    line-height: 1.2;
    color: #3f4094;
    white-space: nowrap;
    transition: color 0.2s ease, font-weight 0.2s ease;
}

.pest-item:hover .pest-label {
    color: #8bbc08;
    font-weight: 700;
}

.pest-item:hover .pest-thumb {
    animation: bug-alive 0.8s ease-in-out infinite alternate !important;
}

@keyframes bug-alive {
    0% { transform: rotate(0deg) scale(1) translateX(0); }
    25% { transform: rotate(3deg) scale(1.08) translateX(2px); }
    50% { transform: rotate(-2deg) scale(1.04) translateX(-2px); }
    75% { transform: rotate(4deg) scale(1.09) translateX(3px); }
    100% { transform: rotate(-1deg) scale(1.12) translateX(-2px); }
}

@media (max-width: 768px) {
    .page-content:has(.main-stage) {
        padding-top: 96px;
        min-height: 0;
    }

    .main-stage {
        position: relative;
        top: auto;
        left: auto;
        transform: none;
        width: 100%;
        height: auto;
        padding: 16px 15px 24px;
    }

    .stripes-wrapper {
        position: static;
        transform: none;
        flex-direction: column;
        align-items: stretch;
        width: 100%;
    }

    .stripes-container {
        width: 100%;
        gap: 10px;
    }

    .stripe-btn {
        width: 100%;
        height: 52px;
        font-size: 16px;
        padding-left: 18px;
        white-space: normal;
    }

    .stripes-tails-img {
        display: none;
    }

    .center-logo-block {
        position: static;
        transform: none;
        text-align: center;
        margin: 28px auto 24px;
    }

    .center-logo-img {
        width: min(176px, 56vw);
        margin: 0 auto;
    }

    .insects-container {
        position: static;
        inset: auto;
        display: flex;
        flex-direction: column;
        gap: 14px;
        max-width: 320px;
        margin: 0 auto;
        padding: 0 12px;
        pointer-events: auto;
    }

    .pest-item {
        position: static;
        transform: none;
    }

    .pest-thumb {
        height: 60px;
        max-width: 108px;
    }

    .pest-thumb-rat {
        height: 78px;
        max-width: 132px;
    }

    .pest-label {
        font-size: 16px;
        white-space: normal;
    }
}