/* Hero: полноширинная сцена «почти касание» - machine слева · loader · human справа */

.hero-touch {
    --touch-ring: rgb(24 24 27);
    --hero-fade-color: #fafafa;
}

.dark .hero-touch {
    --touch-ring: rgb(250 250 250);
    --hero-fade-color: #09090b;
}

.hero-touch--full {
    position: relative;
    width: 100%;
    max-width: none;
    margin: 0;
    overflow: hidden;
}

.hero-touch__scene {
    position: relative;
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
    column-gap: clamp(0.25rem, 1.5vw, 1rem);
    align-items: center;
    width: 100%;
    min-height: clamp(280px, 50vh, 580px);
    padding: 0 0 5.5rem;
    isolation: isolate;
}

.hero-touch__scene::before {
    content: '';
    position: absolute;
    inset: 0;
    background-image:
        linear-gradient(rgba(113, 113, 122, 0.07) 1px, transparent 1px),
        linear-gradient(90deg, rgba(113, 113, 122, 0.07) 1px, transparent 1px);
    background-size: 32px 32px;
    mask-image: radial-gradient(ellipse 85% 75% at 50% 50%, black 15%, transparent 72%);
    pointer-events: none;
    z-index: 0;
}

.dark .hero-touch__scene::before {
    background-image:
        linear-gradient(rgba(255, 255, 255, 0.05) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255, 255, 255, 0.05) 1px, transparent 1px);
}

/* Переход к hero-more - только между секциями, не поверх perks */
.hero-touch__fade {
    display: none;
}

.hero-touch__hand {
    position: relative;
    z-index: 2;
    margin: 0;
    min-width: 0;
    display: flex;
    align-items: center;
    opacity: 0;
}

.hero-touch__hand img {
    display: block;
    width: auto;
    max-width: 100%;
    height: clamp(260px, 48vh, 600px);
    object-fit: contain;
    pointer-events: none;
    user-select: none;
    -webkit-user-drag: none;
    mix-blend-mode: screen;
}

/* Робот чуть дальше от центра, человек - ближе */
.hero-touch__hand--machine {
    grid-column: 1;
    justify-content: flex-start;
    transform: translateX(-5%);
}

.hero-touch__hand--machine img {
    object-position: 72% center;
    margin-right: 0.75rem;
    filter: saturate(0.92) contrast(1.04);
}

.dark .hero-touch__hand--machine img {
    mix-blend-mode: lighten;
    filter: saturate(0.9) contrast(1.06) brightness(1.08);
}

.hero-touch__hand--human {
    grid-column: 3;
    justify-content: flex-end;
    overflow: hidden;
    transform: translateX(3%);
}

.hero-touch__hand--human img {
    width: 100%;
    max-width: none;
    object-position: right center;
    margin: 0;
}

.dark .hero-touch__hand--human img {
    mix-blend-mode: lighten;
}

.hero-touch__perks {
    position: absolute;
    left: 50%;
    bottom: 2.25rem;
    z-index: 5;
    width: min(calc(100% - 2rem), 52rem);
    transform: translateX(-50%);
    pointer-events: none;
}

.hero-touch__perks-bar {
    display: flex;
    align-items: stretch;
    width: 100%;
    border-radius: 0.625rem;
    border: 1px solid rgba(228, 228, 231, 0.9);
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(8px);
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.04), 0 12px 32px rgba(0, 0, 0, 0.08);
    overflow: hidden;
}

.dark .hero-touch__perks-bar {
    border-color: rgba(82, 82, 91, 0.95);
    background: rgba(24, 24, 27, 0.88);
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.35), 0 0 0 1px rgba(255, 255, 255, 0.06);
}

.hero-touch__perk {
    flex: 1 1 0;
    min-width: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.2rem;
    padding: 0.85rem 1rem;
    text-align: center;
    border-right: 1px solid rgba(228, 228, 231, 0.85);
}

.hero-touch__perk:last-child {
    border-right: none;
}

.dark .hero-touch__perk {
    border-right-color: rgba(63, 63, 70, 0.95);
}

.hero-touch__perk-value {
    font-size: clamp(1.125rem, 2.2vw, 1.5rem);
    font-weight: 700;
    line-height: 1.1;
    color: rgb(24 24 27);
    letter-spacing: -0.02em;
}

.dark .hero-touch__perk-value {
    color: rgb(250 250 250);
}

.hero-touch__perk-label {
    font-size: clamp(0.6875rem, 1.2vw, 0.8125rem);
    font-weight: 500;
    line-height: 1.25;
    color: rgb(113 113 122);
}

.dark .hero-touch__perk-label {
    color: rgb(161 161 170);
}

.hero-touch__bridge {
    position: relative;
    z-index: 3;
    grid-column: 2;
    align-self: center;
    flex: 0 0 auto;
    width: clamp(5.5rem, 11vw, 9rem);
    height: clamp(5.5rem, 11vw, 9rem);
    margin: 0 0 clamp(2.5rem, 9vh, 5.5rem);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
}

.hero-touch__loader {
    position: relative;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--touch-ring);
}

/* Классический спиннер из 12 палочек */
.hero-touch__spinner {
    position: relative;
    width: clamp(4rem, 10vw, 6.25rem);
    height: clamp(4rem, 10vw, 6.25rem);
}

.hero-touch__spinner span {
    position: absolute;
    left: 50%;
    top: 50%;
    width: 5px;
    height: 26%;
    margin-left: -2.5px;
    border-radius: 999px;
    background: currentColor;
    transform-origin: center 145%;
    opacity: 0.12;
    animation: hero-spinner-bar 1.2s linear infinite;
}

.hero-touch__spinner span:nth-child(1) { transform: rotate(0deg); animation-delay: -1.1s; }
.hero-touch__spinner span:nth-child(2) { transform: rotate(30deg); animation-delay: -1s; }
.hero-touch__spinner span:nth-child(3) { transform: rotate(60deg); animation-delay: -0.9s; }
.hero-touch__spinner span:nth-child(4) { transform: rotate(90deg); animation-delay: -0.8s; }
.hero-touch__spinner span:nth-child(5) { transform: rotate(120deg); animation-delay: -0.7s; }
.hero-touch__spinner span:nth-child(6) { transform: rotate(150deg); animation-delay: -0.6s; }
.hero-touch__spinner span:nth-child(7) { transform: rotate(180deg); animation-delay: -0.5s; }
.hero-touch__spinner span:nth-child(8) { transform: rotate(210deg); animation-delay: -0.4s; }
.hero-touch__spinner span:nth-child(9) { transform: rotate(240deg); animation-delay: -0.3s; }
.hero-touch__spinner span:nth-child(10) { transform: rotate(270deg); animation-delay: -0.2s; }
.hero-touch__spinner span:nth-child(11) { transform: rotate(300deg); animation-delay: -0.1s; }
.hero-touch__spinner span:nth-child(12) { transform: rotate(330deg); animation-delay: 0s; }

@keyframes hero-spinner-bar {
    0%,
    39%,
    100% {
        opacity: 0.15;
    }
    40% {
        opacity: 1;
    }
}

/* Появление при первой загрузке */
@media (prefers-reduced-motion: no-preference) {
    .hero-touch__hand--machine {
        animation: hero-hand-enter-left 1.15s cubic-bezier(0.22, 1, 0.36, 1) 0.08s both;
    }

    .hero-touch__hand--human {
        animation: hero-hand-enter-right 1.15s cubic-bezier(0.22, 1, 0.36, 1) 0.22s both;
    }

    .hero-touch__bridge {
        animation: hero-bridge-enter 0.85s cubic-bezier(0.22, 1, 0.36, 1) 0.42s both;
    }
}

@keyframes hero-hand-enter-left {
    from {
        opacity: 0;
        transform: translateX(-28vw);
    }
    to {
        opacity: 1;
        transform: translateX(-5%);
    }
}

@keyframes hero-hand-enter-right {
    from {
        opacity: 0;
        transform: translateX(28vw);
    }
    to {
        opacity: 1;
        transform: translateX(3%);
    }
}

@keyframes hero-bridge-enter {
    from {
        opacity: 0;
        transform: scale(0.65) translateY(0.5rem);
    }
    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

@media (max-width: 640px) {
    .hero-touch__scene {
        min-height: clamp(240px, 68vw, 360px);
        height: auto;
        padding: 0.75rem 0 7.25rem;
        column-gap: 0.125rem;
    }

    .hero-touch__hand img {
        height: auto;
        max-height: clamp(170px, 42vw, 220px);
    }

    .hero-touch__hand--machine {
        transform: translateX(-3%);
    }

    .hero-touch__hand--machine img {
        margin-right: 0.35rem;
        object-position: 68% center;
    }

    .hero-touch__hand--human {
        transform: translateX(2%);
    }

    .hero-touch__bridge {
        width: 4.5rem;
        height: 4.5rem;
        margin-bottom: 1.5rem;
    }

    .hero-touch__spinner {
        width: 3.5rem;
        height: 3.5rem;
    }

    .hero-touch__spinner span {
        width: 4px;
    }

    .hero-touch__perks {
        bottom: 1rem;
        width: calc(100% - 0.75rem);
    }

    .hero-touch__perks-bar {
        display: grid;
        grid-template-columns: 1fr 1fr;
    }

    .hero-touch__perk {
        padding: 0.6rem 0.65rem;
        border-right: 1px solid rgba(228, 228, 231, 0.85);
        border-bottom: 1px solid rgba(228, 228, 231, 0.85);
    }

    .dark .hero-touch__perk {
        border-right-color: rgba(63, 63, 70, 0.95);
        border-bottom-color: rgba(63, 63, 70, 0.95);
    }

    .hero-touch__perk:nth-child(2n) {
        border-right: none;
    }

    .hero-touch__perk:nth-last-child(-n + 2) {
        border-bottom: none;
    }

    .hero-touch__perk-value {
        font-size: 0.9375rem;
    }

    .hero-touch__perk-label {
        font-size: 0.5625rem;
        line-height: 1.2;
    }

    .hero-touch__fade {
        height: 2rem;
    }
}

@media (max-width: 380px) {
    .hero-touch__perk-label {
        font-size: 0.5rem;
        letter-spacing: -0.01em;
    }

    .hero-touch__perk-value {
        font-size: 0.875rem;
    }
}

@media (min-width: 1280px) {
    .hero-touch__scene {
        min-height: clamp(360px, 52vh, 640px);
    }

    .hero-touch__hand img {
        height: clamp(320px, 52vh, 640px);
    }

    .hero-touch__hand--machine {
        transform: translateX(-6%);
    }

    .hero-touch__hand--human {
        transform: translateX(4%);
    }
}

@media (prefers-reduced-motion: reduce) {
    .hero-touch__hand,
    .hero-touch__bridge {
        opacity: 1;
    }

    .hero-touch__hand--machine {
        transform: translateX(-5%);
    }

    .hero-touch__hand--human {
        transform: translateX(3%);
    }

    .hero-touch__spinner span {
        animation: none;
        opacity: 0.85;
    }

}
