/*
  Mobile motion for Сектор Икс.
  Profile gate: html[data-sx-profile="mobile"] only.
  Transform and opacity. The desktop fade in club.css is untouched.

  Menu rows are not repositioned here. The shell places them on the
  skewed panel (straight column or diagonal). Stagger uses the
  translate property, which is relative to each item and composes
  with a layout transform. See js/motion-mobile.js.
*/

html[data-sx-profile="mobile"] #pages {
    perspective: 1100px;
    touch-action: none;
}

html[data-sx-profile="mobile"] #pages .page {
    transform-origin: 50% 42%;
}

html[data-sx-profile="mobile"] .request-form,
html[data-sx-profile="mobile"] .request-form input,
html[data-sx-profile="mobile"] .request-form textarea,
html[data-sx-profile="mobile"] .request-form button,
html[data-sx-profile="mobile"] .request-form label {
    touch-action: manipulation;
}

/* Gold laser under the heading, not the slogan beneath it.
   Absolute, so the locked stage does not grow. */
html[data-sx-profile="mobile"] .page[data-sx-state="enter"] h2.section-heading::after,
html[data-sx-profile="mobile"] .page[data-sx-state="enter"] h1.home-page-title::after,
html[data-sx-profile="mobile"] .page[data-sx-state="enter"] [data-sx-role="title"]::after,
html[data-sx-profile="mobile"] .page[data-sx-state="enter"] [data-sx-role="heading"]::after {
    content: "";
    position: absolute;
    left: 0;
    top: calc(100% + 3px);
    width: 3.4rem;
    height: 2px;
    pointer-events: none;
    background: linear-gradient(90deg, #d4af37 0%, #b48e3d 72%, transparent 100%);
    transform-origin: left center;
    animation: sx-m-rule 640ms cubic-bezier(0.16, 1, 0.3, 1) both;
}

html[data-sx-profile="mobile"] .page[data-sx-state="enter"] h1.home-page-title::after,
html[data-sx-profile="mobile"] .page[data-sx-state="enter"] [data-sx-role="title"]::after {
    left: 50%;
    width: 4.6rem;
    margin-left: -2.3rem;
    transform-origin: center center;
}

@keyframes sx-m-rule {
    0% { opacity: 0; transform: scaleX(0); }
    38% { opacity: 1; transform: scaleX(1); }
    100% { opacity: 0; transform: scaleX(1); }
}

/* Viewport laser. Same 14° lean as the desktop cut. */
html[data-sx-profile="mobile"] .sx-m-beam {
    position: absolute;
    top: -18%;
    bottom: -18%;
    left: -15%;
    width: 55%;
    z-index: 4;
    pointer-events: none;
    background: linear-gradient(90deg,
        transparent 0%,
        rgba(45, 45, 45, 0) 40%,
        rgba(180, 142, 61, 0.55) 46%,
        #d4af37 48.6%,
        #fff 50%,
        #b48e3d 51.4%,
        #499f37 53.2%,
        transparent 64%);
    opacity: 0;
    transform: translate3d(120%, 0, 0) skewX(-14deg);
}

html[data-sx-profile="mobile"] .sx-m-beam.is-on.is-forward {
    animation: sx-m-beam 520ms cubic-bezier(0.22, 0.8, 0.2, 1) both;
}

html[data-sx-profile="mobile"] .sx-m-beam.is-on.is-back {
    animation: sx-m-beam-back 520ms cubic-bezier(0.22, 0.8, 0.2, 1) both;
}

@keyframes sx-m-beam {
    0% { opacity: 0; transform: translate3d(130%, 0, 0) skewX(-14deg); }
    22% { opacity: 1; }
    100% { opacity: 0; transform: translate3d(-210%, 0, 0) skewX(-14deg); }
}

@keyframes sx-m-beam-back {
    0% { opacity: 0; transform: translate3d(-210%, 0, 0) skewX(-14deg); }
    22% { opacity: 1; }
    100% { opacity: 0; transform: translate3d(130%, 0, 0) skewX(-14deg); }
}

/* Same laser, inside the panel so it inherits the panel skew.
   It does not take a cell in the list. */
html[data-sx-profile="mobile"] #menu-mobile .sx-m-menu-beam {
    position: absolute;
    inset: -12% -20%;
    z-index: 0;
    pointer-events: none;
    background: linear-gradient(100deg,
        transparent 43%,
        rgba(212, 175, 55, 0.35) 48%,
        #fff 50%,
        #d4af37 51.2%,
        rgba(73, 159, 55, 0.85) 52.4%,
        transparent 58%);
    opacity: 0;
}

html[data-sx-profile="mobile"] #menu-mobile .menu-nav-wrapper {
    position: relative;
    z-index: 1;
}

html[data-sx-profile="mobile"] body[data-sx-menu="open"] #menu-mobile .sx-m-menu-beam {
    animation: sx-m-menu-beam 720ms cubic-bezier(0.22, 0.8, 0.2, 1) 220ms both;
}

@keyframes sx-m-menu-beam {
    0% { opacity: 0; transform: translate3d(35%, 0, 0); }
    30% { opacity: 0.9; }
    100% { opacity: 0; transform: translate3d(-35%, 0, 0); }
}

/* Tap. The scale property composes with any layout transform.
   Home controls are the gold CTA and the phone link, by role. */
html[data-sx-profile="mobile"] :is(
    a.button-the,
    [data-sx-role="cta"],
    [data-sx-role="phone"],
    a[href^="tel:"],
    .sx-phone,
    .c-btn,
    .sx-link,
    .vk-link,
    .max-link,
    .logo,
    #menu-mobile a,
    #menu-mobile-caller,
    .sx-shots img
) {
    transition-property: color, background-color, border-color, scale, opacity;
    transition-duration: 0.18s, 0.18s, 0.18s, 0.12s, 0.12s;
    transition-timing-function: ease;
}

html[data-sx-profile="mobile"] :is(
    a.button-the,
    [data-sx-role="cta"],
    [data-sx-role="phone"],
    a[href^="tel:"],
    .sx-phone,
    .c-btn,
    .sx-link,
    .vk-link,
    .max-link,
    .logo,
    #menu-mobile a,
    #menu-mobile-caller
):active {
    scale: 0.96;
    opacity: 0.86;
}

html[data-sx-profile="mobile"] .sx-shots a:active img {
    scale: 0.97;
}

html[data-sx-profile="mobile"] .hero-bg {
    transform-origin: center center;
}

@media (prefers-reduced-motion: reduce) {
    html[data-sx-profile="mobile"] .page[data-sx-state="enter"] :is(h1, h2, [data-sx-role="title"], [data-sx-role="heading"])::after,
    html[data-sx-profile="mobile"] .sx-m-beam,
    html[data-sx-profile="mobile"] #menu-mobile .sx-m-menu-beam {
        animation: none !important;
        opacity: 0 !important;
        content: none;
    }

    html[data-sx-profile="mobile"] :is(
        a.button-the,
        [data-sx-role="cta"],
        [data-sx-role="phone"],
        a[href^="tel:"],
        .sx-phone,
        .c-btn,
        .sx-link,
        .vk-link,
        .max-link,
        .logo,
        #menu-mobile a,
        #menu-mobile-caller,
        .sx-shots img
    ):active {
        scale: none;
        opacity: 1;
        transition: none;
    }
}

html[data-sx-profile="mobile"][data-sx-reduced="true"] .page[data-sx-state="enter"] :is(h1, h2, [data-sx-role="title"], [data-sx-role="heading"])::after,
html[data-sx-profile="mobile"][data-sx-reduced="true"] .sx-m-beam,
html[data-sx-profile="mobile"][data-sx-reduced="true"] body[data-sx-menu="open"] #menu-mobile .sx-m-menu-beam {
    animation: none !important;
    opacity: 0 !important;
}
