[id] {
    scroll-margin-top: 6.5rem;
}

html {
    overflow-x: clip;
}

.hero-mesh {
    background-color: #fafafa;
    background-image:
        radial-gradient(at 20% 20%, rgba(24, 24, 27, 0.05) 0, transparent 50%),
        radial-gradient(at 80% 0%, rgba(24, 24, 27, 0.07) 0, transparent 45%),
        radial-gradient(at 50% 100%, rgba(24, 24, 27, 0.05) 0, transparent 50%);
}

.dark .hero-mesh {
    background-color: #09090b;
    background-image:
        radial-gradient(at 30% 10%, rgba(255, 255, 255, 0.06) 0, transparent 45%),
        radial-gradient(at 90% 30%, rgba(255, 255, 255, 0.04) 0, transparent 40%),
        radial-gradient(at 50% 90%, rgba(255, 255, 255, 0.03) 0, transparent 50%);
}

.nav-link-active {
    color: rgb(24 24 27);
    background: rgb(244 244 245);
    border-radius: 0.5rem;
}

.dark .nav-link-active {
    color: rgb(255 255 255);
    background: rgb(39 39 42);
}

.site-logo {
    filter: none;
}

.dark .site-logo {
    filter: brightness(0) invert(1) contrast(1.05);
}

@media (min-width: 768px) {
    .nav-bar {
        grid-template-columns: 1fr auto 1fr;
    }
}

.nav-float {
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.04), 0 12px 32px rgba(0, 0, 0, 0.08);
}

.dark .nav-float {
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.4), 0 0 0 1px rgba(255, 255, 255, 0.05);
}

.nav-mobile.is-open {
    display: block;
}

#nav-toggle[aria-expanded="true"] .nav-toggle__icon-open {
    display: none;
}

#nav-toggle[aria-expanded="true"] .nav-toggle__icon-close {
    display: block;
}

/* Первый экран: только заголовок + сцена рук */
.hero-viewport {
    height: 100dvh;
    height: 100svh;
    max-height: 100dvh;
    max-height: 100svh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.hero-viewport__head {
    flex: 0 0 auto;
}

/* Единый фон hero + карусель; мягкий стык с hero-mesh без наложения на perks */
.hero-viewport__foot {
    position: relative;
    background-color: #fafafa;
    padding-top: 0.5rem;
    padding-bottom: 1.5rem;
}

.hero-viewport__foot::before {
    content: '';
    position: absolute;
    left: 0;
    right: 0;
    top: 0;
    height: 2.5rem;
    transform: translateY(-100%);
    pointer-events: none;
    background: linear-gradient(to bottom, transparent, #fafafa);
}

.dark .hero-viewport__foot {
    background-color: #09090b;
}

.dark .hero-viewport__foot::before {
    background: linear-gradient(to bottom, transparent, #09090b);
}

@media (min-width: 640px) {
    .hero-viewport__foot {
        padding-bottom: 2rem;
    }
}

.hero-viewport > .hero-touch--full {
    flex: 1 1 0;
    min-height: 0;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
}

.hero-viewport .hero-touch__scene {
    flex: 1;
    width: 100%;
    min-height: 0;
    max-height: 100%;
}

.hero-viewport .hero-touch__hand img {
    height: auto;
    max-height: clamp(160px, 52vh, 640px);
}

@media (max-width: 640px) {
    .hero-viewport {
        height: auto;
        max-height: none;
        min-height: 0;
        overflow: visible;
    }

    .hero-viewport > .hero-touch--full {
        flex: 0 0 auto;
        justify-content: flex-start;
        min-height: clamp(260px, 72vw, 380px);
    }

    .hero-viewport .hero-touch__scene {
        flex: 1 1 auto;
        min-height: clamp(240px, 68vw, 360px);
        max-height: none;
        height: auto;
        padding-bottom: 7.25rem;
    }

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

@media (min-width: 1280px) {
    .hero-viewport .hero-touch__hand img {
        max-height: clamp(280px, 50vh, 680px);
    }
}

.section-cta {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.625rem 1.25rem;
    font-size: 0.875rem;
    font-weight: 600;
    line-height: 1.25;
    border-radius: 0.5rem;
    border: none;
    cursor: pointer;
    text-decoration: none;
    color: #fff;
    background: rgb(24 24 27);
    transition: opacity 0.2s ease;
}

.section-cta:hover {
    opacity: 0.9;
}

.dark .section-cta {
    color: rgb(24 24 27);
    background: #fff;
}

.section-cta svg {
    flex-shrink: 0;
}
