/* ==========================================================================
   AVE Design Studio — слайдер главного экрана (index.php, js/hero-slider.js)
   ========================================================================== */

.ave-slider {
    --sl-red: #c80000;
    --sl-red-hover: #a90000;
    --sl-ink: #14161b;
    --sl-ease: cubic-bezier(.16, 1, .3, 1);

    position: relative;
    z-index: 0;
    overflow: hidden;
    background: var(--sl-ink);
    color: #fff;
    font-family: 'Open Sans', Arial, sans-serif;
    -webkit-font-smoothing: antialiased;
}

.ave-slider__track {
    display: grid;
    touch-action: pan-y;
}

/* ---------- Slide ---------- */

.ave-slide {
    grid-area: 1 / 1;
    position: relative;
    z-index: 0;
    display: flex;
    align-items: center;
    min-height: 700px;
    padding: 48px 0 84px;
    overflow: hidden;
    opacity: 0;
    visibility: hidden;
    transition: opacity .8s ease, visibility 0s linear .8s;
}

.ave-slide.is-active {
    z-index: 1;
    opacity: 1;
    visibility: visible;
    transition: opacity .8s ease;
}

.ave-slide__bg {
    position: absolute;
    top: 0;
    right: 0;
    bottom: 0;
    left: 0;
    z-index: -4;
    background-position: center top;
    background-size: cover;
    background-repeat: no-repeat;
}

.ave-slide--audit .ave-slide__bg {
    background-image: url("../images/sliders/rev_slider/slide2/bg.jpg");
    background-position: 30% top;
    background-size: auto 118%;
}
.ave-slide--flavor .ave-slide__bg { background-image: url("../images/sliders/rev_slider/slide3/bg.jpg"); }
.ave-slide__bg--poster {
    background-image: url("../images/videos/mothership_futuredeluxe.jpg");
    background-position: center;
}

.ave-slide__video {
    position: absolute;
    top: 0;
    right: 0;
    bottom: 0;
    left: 0;
    z-index: -3;
    overflow: hidden;
    opacity: 0;
    transition: opacity .8s ease;
}
.ave-slide__video.is-ready { opacity: 1; }

.ave-slide__video iframe {
    position: absolute;
    top: 50%;
    left: 50%;
    border: 0;
    pointer-events: none;
    -webkit-transform: translate(-50%, -50%) scale(1.18);
    transform: translate(-50%, -50%) scale(1.18);
}

/* ---------- Blurred, slightly darkened photo behind the text ---------- */

.ave-slide__soften {
    position: absolute;
    top: 0;
    right: 0;
    bottom: 0;
    left: 0;
    z-index: -2;
    pointer-events: none;
    background:
        linear-gradient(0deg, rgba(10, 12, 16, .42) 0%, rgba(10, 12, 16, 0) 38%),
        linear-gradient(90deg, rgba(10, 12, 16, .5) 0%, rgba(10, 12, 16, .34) 42%, rgba(10, 12, 16, 0) 72%);
    -webkit-backdrop-filter: blur(12px) saturate(110%);
    backdrop-filter: blur(12px) saturate(110%);
    -webkit-mask-image: linear-gradient(90deg, #000 0%, #000 38%, rgba(0, 0, 0, .55) 52%, transparent 66%);
    mask-image: linear-gradient(90deg, #000 0%, #000 38%, rgba(0, 0, 0, .55) 52%, transparent 66%);
}

@supports not ((-webkit-backdrop-filter: blur(1px)) or (backdrop-filter: blur(1px))) {
    .ave-slide__soften {
        background: linear-gradient(90deg, rgba(10, 12, 16, .78) 0%, rgba(10, 12, 16, .6) 42%, rgba(10, 12, 16, 0) 72%);
    }
}

.ave-slide__device {
    position: absolute;
    top: 118px;
    right: calc(50% - 570px);
    z-index: -1;
    width: 380px;
    max-width: none;
    height: auto;
    filter: drop-shadow(0 30px 40px rgba(8, 10, 14, .45));
}

.ave-slide__inner {
    position: relative;
    z-index: 1;
}

.ave-slide__copy {
    max-width: 680px;
    text-shadow: 0 1px 2px rgba(8, 10, 14, .25), 0 2px 24px rgba(8, 10, 14, .3);
}

/* ---------- Typography ---------- */

.ave-slider p { margin: 0; }

.ave-slider .ave-slide__kicker {
    margin-bottom: 18px;
    font-family: 'Open Sans', Arial, sans-serif;
    font-size: 14px;
    font-weight: 700;
    line-height: 1.4;
    letter-spacing: .12em;
    text-transform: uppercase;
    color: rgba(255, 255, 255, .9);
}

.ave-slider .ave-slide__title {
    margin: 0 0 18px;
    padding: 0;
    font-family: 'Source Sans Pro', 'Open Sans', Arial, sans-serif;
    font-size: 56px;
    font-weight: 900;
    line-height: 1.04;
    letter-spacing: -.005em;
    color: #fff;
    text-transform: none;
    text-wrap: balance;
}

.ave-slider .ave-slide__title--light {
    font-family: 'Open Sans', Arial, sans-serif;
    font-size: 52px;
    font-weight: 300;
    line-height: 1.14;
    letter-spacing: -.02em;
}
.ave-slide__title--light b { font-weight: 700; }

.ave-slide__accent {
    display: inline-block;
    margin: .04em 0 .06em;
    padding: 0 .16em .04em;
    border-radius: 6px;
    background: var(--sl-red);
    color: #fff;
    font-weight: 700;
    line-height: 1.12;
    white-space: nowrap;
    text-shadow: none;
}

.ave-slider .ave-slide__lead {
    max-width: 34em;
    margin-bottom: 30px;
    font-size: 19px;
    line-height: 1.5;
    color: rgba(255, 255, 255, .92);
    text-wrap: pretty;
}
.ave-slide__lead b { font-weight: 700; color: #fff; }

.ave-slider .ave-slide__perks {
    display: flex;
    flex-wrap: wrap;
    gap: 10px 28px;
    margin: 30px 0 0;
    padding: 0;
    list-style: none;
}
.ave-slide__perks li {
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 0;
    font-size: 14px;
    font-weight: 600;
    line-height: 1.35;
    color: rgba(255, 255, 255, .92);
}
.ave-slide__perks li::before {
    content: "";
    flex: 0 0 8px;
    width: 8px;
    height: 8px;
    border-radius: 2px;
    background: var(--sl-red);
}

/* ---------- Buttons ---------- */

.ave-slide__actions {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
}

.ave-slider a.ave-slide__btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 56px;
    padding: 0 30px;
    border: 1px solid transparent;
    border-radius: 8px;
    font-family: 'Open Sans', Arial, sans-serif;
    font-size: 16px;
    font-weight: 700;
    line-height: 1.2;
    text-align: center;
    text-decoration: none;
    text-shadow: none;
    transition: background-color .25s var(--sl-ease), border-color .25s var(--sl-ease),
                color .25s var(--sl-ease), transform .25s var(--sl-ease);
}
.ave-slider a.ave-slide__btn:active { transform: translateY(1px) scale(.98); }
.ave-slider a.ave-slide__btn:focus { outline: none; }
.ave-slider a.ave-slide__btn:focus-visible { outline: 2px solid #fff; outline-offset: 3px; }

.ave-slider a.ave-slide__btn--primary,
.ave-slider a.ave-slide__btn--primary:visited {
    background: var(--sl-red);
    color: #fff;
    box-shadow: 0 14px 30px -12px rgba(200, 0, 0, .8);
}
.ave-slider a.ave-slide__btn--primary:hover,
.ave-slider a.ave-slide__btn--primary:focus { background: var(--sl-red-hover); color: #fff; }

.ave-slider a.ave-slide__btn--ghost,
.ave-slider a.ave-slide__btn--ghost:visited {
    background: rgba(255, 255, 255, .08);
    border-color: rgba(255, 255, 255, .55);
    color: #fff;
}
.ave-slider a.ave-slide__btn--ghost:hover,
.ave-slider a.ave-slide__btn--ghost:focus { background: #fff; border-color: #fff; color: var(--sl-ink); }

/* ---------- Slide 3: studio ---------- */

.ave-slide--studio .ave-slide__copy { max-width: 720px; }

.ave-slider .ave-slide__brand {
    font-family: 'Source Sans Pro', 'Open Sans', Arial, sans-serif;
    font-size: 68px;
    font-weight: 900;
    line-height: 1;
    color: #fff;
}
.ave-slider .ave-slide__sub {
    margin: 10px 0 12px;
    font-family: 'Source Sans Pro', 'Open Sans', Arial, sans-serif;
    font-size: 26px;
    font-weight: 300;
    line-height: 1.25;
    color: rgba(255, 255, 255, .94);
}
.ave-slider .ave-slide__list {
    margin-bottom: 18px;
    font-family: 'Source Sans Pro', 'Open Sans', Arial, sans-serif;
    font-size: 34px;
    font-weight: 900;
    line-height: 1.08;
    text-transform: uppercase;
    color: #fff;
}
.ave-slider .ave-slide__text {
    max-width: 58ch;
    margin-bottom: 28px;
    font-size: 16px;
    line-height: 1.6;
    color: rgba(255, 255, 255, .9);
}

/* ---------- Slide 2: video + single CTA in the middle ---------- */

.ave-slide--cta { padding-top: 84px; }
.ave-slide--cta .ave-slide__copy {
    max-width: 760px;
    margin: 0 auto;
    text-align: center;
}
.ave-slider .ave-slide--cta .ave-slide__lead { margin-left: auto; margin-right: auto; }
.ave-slide--cta .ave-slide__actions { justify-content: center; }
.ave-slide--cta .ave-slide__soften {
    background: radial-gradient(ellipse 50% 60% at 50% 52%, rgba(10, 12, 16, .55) 0%, rgba(10, 12, 16, .32) 70%, rgba(10, 12, 16, .18) 100%);
    -webkit-mask-image: radial-gradient(ellipse 85% 95% at 50% 52%, #000 60%, transparent 100%);
    mask-image: radial-gradient(ellipse 85% 95% at 50% 52%, #000 60%, transparent 100%);
}

/* ---------- Slide 4: video + audit offer ---------- */

.ave-slide--offer .ave-slide__copy { max-width: 640px; }
.ave-slide--offer .ave-slide__soften {
    background:
        linear-gradient(0deg, rgba(10, 12, 16, .42) 0%, rgba(10, 12, 16, 0) 38%),
        linear-gradient(90deg, rgba(10, 12, 16, .68) 0%, rgba(10, 12, 16, .55) 50%, rgba(10, 12, 16, 0) 82%);
    -webkit-mask-image: linear-gradient(90deg, #000 0%, #000 56%, rgba(0, 0, 0, .55) 68%, transparent 82%);
    mask-image: linear-gradient(90deg, #000 0%, #000 56%, rgba(0, 0, 0, .55) 68%, transparent 82%);
}

/* ---------- Slide 5: flavor ---------- */

.ave-slide--flavor .ave-slide__copy { max-width: 720px; }
.ave-slider .ave-slide__title--xl {
    margin-bottom: 28px;
    font-size: 74px;
    line-height: .98;
    text-transform: uppercase;
}

/* ---------- Controls ---------- */

.ave-slider__arrow {
    position: absolute;
    top: 50%;
    z-index: 3;
    margin-top: -24px;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 48px;
    height: 48px;
    padding: 0;
    border: 1px solid rgba(255, 255, 255, .28);
    border-radius: 50%;
    background: rgba(14, 16, 21, .35);
    -webkit-backdrop-filter: blur(8px);
    backdrop-filter: blur(8px);
    color: #fff;
    cursor: pointer;
    transition: background-color .25s var(--sl-ease), border-color .25s var(--sl-ease);
}
.ave-slider__arrow--prev { left: 16px; }
.ave-slider__arrow--next { right: 16px; }
.ave-slider__arrow:hover { background: var(--sl-red); border-color: var(--sl-red); }
.ave-slider__arrow:focus { outline: none; }
.ave-slider__arrow:focus-visible { outline: 2px solid #fff; outline-offset: 3px; }
.ave-slider__arrow svg {
    width: 22px;
    height: 22px;
    fill: none;
    stroke: currentColor;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.ave-slider__dots {
    position: absolute;
    bottom: 26px;
    left: 0;
    right: 0;
    z-index: 3;
    display: flex;
    justify-content: center;
    gap: 4px;
}

.ave-slider__dot {
    position: relative;
    width: 26px;
    height: 26px;
    padding: 0;
    border: 0;
    background: none;
    cursor: pointer;
}
.ave-slider__dot::before {
    content: "";
    position: absolute;
    top: 50%;
    left: 50%;
    width: 10px;
    height: 10px;
    margin: -5px 0 0 -5px;
    border-radius: 5px;
    background: rgba(255, 255, 255, .55);
    box-shadow: 0 0 0 1px rgba(14, 16, 21, .35);
    transition: background-color .25s ease, width .25s ease, margin .25s ease;
}
.ave-slider__dot[aria-selected="true"]::before {
    width: 22px;
    margin-left: -11px;
    background: var(--sl-red);
}
.ave-slider__dot:focus { outline: none; }
.ave-slider__dot:focus-visible::before { box-shadow: 0 0 0 2px #fff; }

.ave-slider__progress {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 3;
    height: 3px;
    background: rgba(14, 16, 21, .25);
}
.ave-slider__progress span {
    display: block;
    height: 100%;
    background: var(--sl-red);
    -webkit-transform: scaleX(0);
    transform: scaleX(0);
    -webkit-transform-origin: 0 50%;
    transform-origin: 0 50%;
}

@keyframes aveSliderProgress {
    from { transform: scaleX(0); }
    to   { transform: scaleX(1); }
}

/* Single-slide mode: <section ... data-single> */
.ave-slider.is-single .ave-slider__arrow,
.ave-slider.is-single .ave-slider__dots,
.ave-slider.is-single .ave-slider__progress { display: none; }
.ave-slider.is-single .ave-slide { padding-bottom: 56px; }

/* ---------- Caption entrance ---------- */

.ave-slide.is-active .ave-slide__copy {
    animation: aveSlideIn .9s .2s var(--sl-ease) both;
}
.ave-slide.is-active .ave-slide__device {
    animation: aveDeviceIn 1.1s .35s var(--sl-ease) both;
}

@keyframes aveSlideIn {
    from { opacity: 0; transform: translateY(28px); }
    to   { opacity: 1; transform: none; }
}

@keyframes aveDeviceIn {
    from { opacity: 0; transform: translateY(40px) rotate(-4deg); }
    to   { opacity: 1; transform: rotate(-4deg); }
}

.ave-slide__device { transform: rotate(-4deg); }

@media (prefers-reduced-motion: reduce) {
    .ave-slide,
    .ave-slide.is-active,
    .ave-slide__video { transition: none; }
    .ave-slide.is-active .ave-slide__copy,
    .ave-slide.is-active .ave-slide__device { animation: none; }
    .ave-slider__progress { display: none; }
}

/* ---------- Responsive ---------- */

/* below 1280px the side margin is narrower than an arrow — swipe, dots and keyboard remain */
@media (max-width: 1279px) {
    .ave-slider__arrow { display: none; }
}

@media (max-width: 1199px) {
    .ave-slide { min-height: 620px; padding: 44px 0 76px; }
    .ave-slide__copy { max-width: 560px; }
    .ave-slide__device { top: 130px; right: calc(50% - 470px); width: 300px; }
    .ave-slider .ave-slide__title { font-size: 48px; }
    .ave-slider .ave-slide__title--light { font-size: 44px; }
    .ave-slider .ave-slide__lead { font-size: 18px; }
    .ave-slider .ave-slide__brand { font-size: 58px; }
    .ave-slider .ave-slide__list { font-size: 30px; }
    .ave-slider .ave-slide__title--xl { font-size: 64px; }
    .ave-slide__soften {
        -webkit-mask-image: linear-gradient(90deg, #000 0%, #000 44%, rgba(0, 0, 0, .55) 58%, transparent 72%);
        mask-image: linear-gradient(90deg, #000 0%, #000 44%, rgba(0, 0, 0, .55) 58%, transparent 72%);
    }
}

@media (max-width: 991px) {
    .ave-slide { min-height: 580px; }
    .ave-slide__device { display: none; }
    .ave-slide__copy { max-width: 600px; }
    .ave-slider .ave-slide__title { font-size: 40px; }
    .ave-slider .ave-slide__title--light { font-size: 40px; }
    .ave-slider .ave-slide__lead { font-size: 17px; }
    .ave-slider .ave-slide__brand { font-size: 50px; }
    .ave-slider .ave-slide__sub { font-size: 22px; }
    .ave-slider .ave-slide__list { font-size: 26px; }
    .ave-slider .ave-slide__title--xl { font-size: 56px; }
    .ave-slide__soften {
        -webkit-mask-image: linear-gradient(90deg, #000 0%, #000 60%, transparent 92%);
        mask-image: linear-gradient(90deg, #000 0%, #000 60%, transparent 92%);
    }
}

@media (max-width: 767px) {
    .ave-slide { min-height: 640px; padding: 44px 0 60px; }
    .ave-slide--audit,
    .ave-slide--offer { align-items: flex-end; }
    .ave-slide--cta { padding-top: 60px; }
    .ave-slide--offer .ave-slide__soften {
        background: linear-gradient(180deg, rgba(10, 12, 16, .3) 0%, rgba(10, 12, 16, .6) 40%, rgba(10, 12, 16, .7) 100%);
        -webkit-mask-image: none;
        mask-image: none;
    }
    .ave-slide--cta .ave-slide__soften {
        background: rgba(10, 12, 16, .42);
        -webkit-mask-image: none;
        mask-image: none;
    }
    .ave-slide__inner { width: 100%; }
    .ave-slide--audit .ave-slide__bg { background-position: 22% top; background-size: auto 130%; }

    .ave-slide__soften {
        background: linear-gradient(180deg, rgba(10, 12, 16, .2) 0%, rgba(10, 12, 16, .5) 40%, rgba(10, 12, 16, .62) 100%);
        -webkit-mask-image: linear-gradient(180deg, rgba(0, 0, 0, .35) 0%, #000 28%, #000 100%);
        mask-image: linear-gradient(180deg, rgba(0, 0, 0, .35) 0%, #000 28%, #000 100%);
    }

    .ave-slider .ave-slide__kicker { margin-bottom: 12px; font-size: 12px; letter-spacing: .1em; }
    .ave-slider .ave-slide__title { margin-bottom: 12px; font-size: 32px; line-height: 1.06; }
    .ave-slider .ave-slide__title--light { font-size: 31px; line-height: 1.16; letter-spacing: -.015em; }
    .ave-slider .ave-slide__lead { margin-bottom: 22px; font-size: 16px; }

    .ave-slider .ave-slide__brand { font-size: 36px; }
    .ave-slider .ave-slide__sub { margin: 6px 0 10px; font-size: 18px; }
    .ave-slider .ave-slide__list { margin-bottom: 20px; font-size: 22px; }
    .ave-slider .ave-slide__text { display: none; }
    .ave-slider .ave-slide__title--xl { margin-bottom: 20px; font-size: 40px; }

    .ave-slide__actions { flex-direction: column; gap: 10px; }
    .ave-slider a.ave-slide__btn { width: 100%; min-height: 52px; padding: 0 18px; }

    .ave-slider .ave-slide__perks { flex-direction: column; gap: 8px; width: auto; margin-top: 20px; }
    .ave-slide__perks li { font-size: 13px; }

    .ave-slider__dots { bottom: 16px; }
}

@media (max-width: 359px) {
    .ave-slider .ave-slide__title,
    .ave-slider .ave-slide__title--light { font-size: 28px; }
}

/* ---------- Slide 1 on desktop: [tablet] [text] [worker in the sharp photo] ----------
   --L          left edge of the container content (= logo left edge)
   --head-x     where the worker's head should start, measured from --L
   --head-in-img  head position inside the scaled photo (bg.jpg, height 112%) */

@media (min-width: 992px) {
    .ave-slide--audit {
        --L: calc(50% - 470px);
        --tab-max: 300px;
        --tab-gap: 20px;
        --copy-x: 236px;
        --copy-w: 400px;
        --head-x: 700px;
        --head-in-img: 254px;
        --blur-full: 470px;
        --blur-end: 680px;
    }

    .ave-slide--audit .ave-slide__bg {
        left: calc(var(--L) + var(--head-x) - var(--head-in-img));
        right: auto;
        width: 100%;
        background-position: 0 top;
        background-size: auto 112%;
    }

    /* sky continuing the photo's left edge (generated from bg.jpg, not mirrored); it always sits under the blur */
    .ave-slide--audit .ave-slide__bg::before {
        content: "";
        position: absolute;
        top: 0;
        bottom: 0;
        right: 100%;
        width: 200%;
        background: url("../images/hero/worker-sky-left.jpg") right top / auto 112% repeat-x;
    }

    .ave-slide--audit .ave-slide__soften {
        background:
            linear-gradient(0deg, rgba(10, 12, 16, .42) 0%, rgba(10, 12, 16, 0) 38%),
            linear-gradient(90deg, rgba(10, 12, 16, .52) 0, rgba(10, 12, 16, .38) calc(var(--L) + var(--blur-full)), rgba(10, 12, 16, 0) calc(var(--L) + var(--blur-end)));
        -webkit-mask-image: linear-gradient(90deg, #000 0, #000 calc(var(--L) + var(--blur-full)), transparent calc(var(--L) + var(--blur-end)));
        mask-image: linear-gradient(90deg, #000 0, #000 calc(var(--L) + var(--blur-full)), transparent calc(var(--L) + var(--blur-end)));
    }

    /* big tablet rising from the bottom edge, its lower part cropped by the slider;
       its right edge stops --tab-gap before the text, the left edge never leaves the screen */
    .ave-slide--audit .ave-slide__device {
        --tab-w: min(var(--tab-max), var(--L) + var(--copy-x) - var(--tab-gap) - 32px);
        top: auto;
        bottom: 0;
        left: calc(var(--L) + var(--copy-x) - var(--tab-gap) - var(--tab-w));
        right: auto;
        width: var(--tab-w);
        margin-bottom: calc(var(--tab-w) * -.3);
        -webkit-transform: rotate(-3deg);
        transform: rotate(-3deg);
        -webkit-transform-origin: 50% 100%;
        transform-origin: 50% 100%;
    }
    .ave-slide--audit.is-active .ave-slide__device {
        animation: aveDeviceRise 1.2s .3s var(--sl-ease) both;
    }

    .ave-slide--audit .ave-slide__copy {
        max-width: var(--copy-w);
        margin-left: var(--copy-x);
    }

    .ave-slider .ave-slide--audit .ave-slide__title--light { font-size: 38px; }
    .ave-slider .ave-slide--audit .ave-slide__lead { font-size: 17px; }
}

@media (min-width: 1200px) {
    .ave-slide--audit {
        --L: calc(50% - 570px);
        --tab-max: 520px;
        --tab-gap: 28px;
        --copy-x: 344px;
        --copy-w: 480px;
        --head-x: 900px;
        --head-in-img: 282px;
        --blur-full: 640px;
        --blur-end: 880px;
    }

    .ave-slider .ave-slide--audit .ave-slide__title--light { font-size: 46px; }
    .ave-slider .ave-slide--audit .ave-slide__lead { font-size: 18px; }
    .ave-slider .ave-slide--offer .ave-slide__title--light { font-size: 46px; }
}

@keyframes aveDeviceRise {
    from { opacity: 0; transform: translateY(70%) rotate(2deg); }
    to   { opacity: 1; transform: rotate(-3deg); }
}

@media (prefers-reduced-motion: reduce) {
    .ave-slide--audit.is-active .ave-slide__device { animation: none; }
}
