/*
 * SAPL Premium Hero & Motion Layer
 * Scope: homepage hero, typography, and non-layout reveal animation only.
 * Existing Elementor layouts outside the hero are intentionally untouched.
 */

:root {
    --sapl-display-font: "Montserrat", "Avenir Next", Arial, sans-serif;
    --sapl-body-font: "Open Sans", Inter, Arial, sans-serif;
    --sapl-hero-gold: #fca311;
    --sapl-hero-gold-soft: #ffd36a;
    --sapl-hero-navy: #071224;
    --sapl-hero-ease: cubic-bezier(.2, .72, .2, 1);
}

body,
button,
input,
select,
textarea {
    font-family: var(--sapl-body-font);
}

h1,
h2,
h3,
h4,
h5,
h6,
.elementor-heading-title,
.elementor-button {
    font-family: var(--sapl-display-font);
}

/* Homepage hero only. No following section layout is selected or overridden. */
.sapl-premium-hero {
    position: relative;
    isolation: isolate;
    overflow: hidden;
    min-height: clamp(540px, 68vh, 700px);
    padding: clamp(92px, 9vw, 145px) clamp(24px, 6vw, 96px) !important;
    background-position: center center !important;
    box-shadow: inset 0 -1px 0 rgba(255, 211, 106, .3);
}

/* Elementor uses this pseudo-element as the configured background overlay. */
.sapl-premium-hero::before {
    content: "";
    position: absolute;
    inset: 0;
    display: block;
    z-index: 0;
    opacity: 1 !important;
    background:
        radial-gradient(circle at 69% 38%, rgba(252, 163, 17, .23) 0, rgba(252, 163, 17, .08) 22%, transparent 43%),
        linear-gradient(90deg, rgba(4, 10, 24, .98) 0%, rgba(7, 18, 40, .94) 36%, rgba(8, 18, 38, .68) 58%, rgba(4, 10, 24, .40) 78%, rgba(4, 10, 24, .55) 100%),
        repeating-linear-gradient(115deg, rgba(255,255,255,.018) 0 1px, transparent 1px 7px) !important;
}

.sapl-premium-hero > .elementor-element,
.sapl-premium-hero > .e-con-inner {
    position: relative;
    z-index: 2;
}

.sapl-premium-hero__content {
    width: min(50%, 620px) !important;
    max-width: 620px;
}

.sapl-premium-hero__title .elementor-heading-title {
    margin: 0;
    color: #fff !important;
    font-size: clamp(42px, 3.8vw, 60px) !important;
    font-weight: 800;
    line-height: .99;
    letter-spacing: -.045em;
    text-transform: none !important;
    text-wrap: balance;
    text-shadow: 0 10px 34px rgba(0, 0, 0, .34);
}

.sapl-premium-hero__title .elementor-heading-title::before {
    content: "PREMIUM MOTORCYCLE LUBRICANTS";
    display: flex;
    align-items: center;
    gap: 10px;
    width: max-content;
    max-width: 100%;
    margin: 0 0 18px;
    color: var(--sapl-hero-gold-soft);
    font-family: var(--sapl-display-font);
    font-size: 12px;
    font-weight: 800;
    line-height: 1.2;
    letter-spacing: .2em;
    text-transform: uppercase;
    text-shadow: none;
}

.sapl-premium-hero__title .elementor-heading-title::after {
    content: "";
    display: block;
    width: 78px;
    height: 3px;
    margin-top: 24px;
    border-radius: 99px;
    background: linear-gradient(90deg, var(--sapl-hero-gold), var(--sapl-hero-gold-soft), transparent);
    box-shadow: 0 0 24px rgba(252, 163, 17, .38);
}

.sapl-hero-line {
    display: block;
}

.sapl-hero-line--gold {
    color: transparent;
    background: linear-gradient(100deg, #fff1b0 0%, #fca311 45%, #ffd66f 68%, #fca311 100%);
    background-size: 220% auto;
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.sapl-premium-hero__copy {
    max-width: 650px;
    margin-top: 24px;
}

.sapl-premium-hero__copy p {
    margin: 0;
    color: rgba(255, 255, 255, .86) !important;
    font-size: clamp(15px, 1.15vw, 18px);
    line-height: 1.72;
    text-shadow: 0 4px 18px rgba(0, 0, 0, .28);
}

.sapl-premium-hero__actions {
    gap: 14px !important;
    margin-top: 30px;
    align-items: center;
}

.sapl-hero-cta .elementor-button {
    min-height: 50px;
    padding: 15px 24px;
    border: 1px solid transparent;
    border-radius: 5px;
    font-size: 14px;
    font-weight: 800;
    letter-spacing: .015em;
    box-shadow: 0 12px 28px rgba(0, 0, 0, .2);
    transition: transform .25s var(--sapl-hero-ease), box-shadow .25s var(--sapl-hero-ease), background-color .25s ease, border-color .25s ease !important;
}

.sapl-hero-cta .elementor-button:hover,
.sapl-hero-cta .elementor-button:focus-visible {
    transform: translateY(-3px);
    box-shadow: 0 18px 36px rgba(0, 0, 0, .28);
}

.sapl-hero-cta--primary .elementor-button {
    color: #111827 !important;
    background: linear-gradient(135deg, #ffd36a 0%, #fca311 58%, #e98c00 100%) !important;
    border-color: rgba(255, 224, 146, .74) !important;
}

.sapl-hero-cta--primary .elementor-button:hover,
.sapl-hero-cta--primary .elementor-button:focus-visible {
    color: #071224 !important;
    background: linear-gradient(135deg, #ffe095 0%, #ffb52e 100%) !important;
}

.sapl-hero-cta--secondary .elementor-button {
    color: #fff !important;
    background: rgba(255, 255, 255, .075) !important;
    border-color: rgba(255, 255, 255, .48) !important;
    -webkit-backdrop-filter: blur(8px);
    backdrop-filter: blur(8px);
}

.sapl-hero-cta--secondary .elementor-button:hover,
.sapl-hero-cta--secondary .elementor-button:focus-visible {
    color: #fff !important;
    background: rgba(252, 163, 17, .18) !important;
    border-color: var(--sapl-hero-gold-soft) !important;
}

/* Motion is enabled by JS, preventing hidden content when JavaScript is unavailable. */
html.sapl-motion-enabled .sapl-premium-hero__title .elementor-heading-title::before,
html.sapl-motion-enabled .sapl-premium-hero__title .sapl-hero-line,
html.sapl-motion-enabled .sapl-premium-hero__title .elementor-heading-title::after,
html.sapl-motion-enabled .sapl-premium-hero__copy,
html.sapl-motion-enabled .sapl-premium-hero__actions {
    opacity: 0;
    transform: translateY(22px);
}

html.sapl-motion-enabled .sapl-premium-hero.is-sapl-ready .sapl-premium-hero__title .elementor-heading-title::before {
    animation: saplHeroReveal .68s .08s var(--sapl-hero-ease) forwards;
}

html.sapl-motion-enabled .sapl-premium-hero.is-sapl-ready .sapl-hero-line--light {
    animation: saplHeroReveal .82s .18s var(--sapl-hero-ease) forwards;
}

html.sapl-motion-enabled .sapl-premium-hero.is-sapl-ready .sapl-hero-line--gold {
    animation: saplHeroReveal .88s .33s var(--sapl-hero-ease) forwards, saplGoldSweep 6s 1.3s linear infinite;
}

html.sapl-motion-enabled .sapl-premium-hero.is-sapl-ready .sapl-premium-hero__title .elementor-heading-title::after {
    animation: saplHeroLine .78s .52s var(--sapl-hero-ease) forwards;
    transform-origin: left center;
}

html.sapl-motion-enabled .sapl-premium-hero.is-sapl-ready .sapl-premium-hero__copy {
    animation: saplHeroReveal .76s .58s var(--sapl-hero-ease) forwards;
}

html.sapl-motion-enabled .sapl-premium-hero.is-sapl-ready .sapl-premium-hero__actions {
    animation: saplHeroReveal .76s .72s var(--sapl-hero-ease) forwards;
}

html.sapl-motion-enabled .sapl-section-reveal {
    opacity: 0;
    transform: translate3d(0, 24px, 0);
    transition: opacity .82s var(--sapl-hero-ease), transform .82s var(--sapl-hero-ease);
    will-change: opacity, transform;
}

html.sapl-motion-enabled .sapl-section-reveal.is-sapl-visible {
    opacity: 1;
    transform: translate3d(0, 0, 0);
}

@keyframes saplHeroReveal {
    from { opacity: 0; transform: translate3d(0, 28px, 0); }
    to { opacity: 1; transform: translate3d(0, 0, 0); }
}

@keyframes saplHeroLine {
    from { opacity: 0; transform: scaleX(.05); }
    to { opacity: 1; transform: scaleX(1); }
}

@keyframes saplGoldSweep {
    0%, 20% { background-position: 100% center; }
    55%, 100% { background-position: 0% center; }
}

@media (max-width: 1024px) {
    .sapl-premium-hero {
        min-height: 570px;
        padding: 105px 42px !important;
        background-position: 54% center !important;
    }

    .sapl-premium-hero::before {
        background:
            radial-gradient(circle at 68% 38%, rgba(252, 163, 17, .2) 0, transparent 38%),
            linear-gradient(90deg, rgba(4, 10, 24, .97) 0%, rgba(7, 18, 40, .9) 45%, rgba(4, 10, 24, .55) 100%),
            repeating-linear-gradient(115deg, rgba(255,255,255,.016) 0 1px, transparent 1px 7px) !important;
    }

    .sapl-premium-hero__content {
        width: min(64%, 600px) !important;
    }

    .sapl-premium-hero__title .elementor-heading-title {
        font-size: clamp(38px, 5.2vw, 52px) !important;
    }
}

@media (max-width: 767px) {
    .sapl-premium-hero {
        min-height: 580px;
        padding: 74px 18px 64px !important;
        background-position: 52% center !important;
    }

    .sapl-premium-hero::before {
        background:
            radial-gradient(circle at 52% 58%, rgba(252, 163, 17, .18) 0, transparent 36%),
            linear-gradient(180deg, rgba(4, 10, 24, .91) 0%, rgba(6, 16, 35, .86) 48%, rgba(4, 10, 24, .9) 100%),
            repeating-linear-gradient(115deg, rgba(255,255,255,.014) 0 1px, transparent 1px 7px) !important;
    }

    .sapl-premium-hero__content {
        width: 100% !important;
        max-width: 590px;
        margin-inline: auto;
        align-items: center;
    }

    .sapl-premium-hero__title .elementor-heading-title {
        font-size: clamp(34px, 10vw, 43px) !important;
        line-height: 1.02;
        letter-spacing: -.035em;
        text-align: center;
    }

    .sapl-premium-hero__title .elementor-heading-title::before {
        justify-content: center;
        width: 100%;
        margin-bottom: 15px;
        font-size: 10px;
        letter-spacing: .16em;
    }

    .sapl-premium-hero__title .elementor-heading-title::after {
        width: 64px;
        margin: 20px auto 0;
        transform-origin: center center;
    }

    .sapl-premium-hero__copy {
        max-width: 560px;
        margin-top: 20px;
        text-align: center;
    }

    .sapl-premium-hero__copy p {
        font-size: 15px;
        line-height: 1.65;
    }

    .sapl-premium-hero__actions {
        width: min(100%, 360px);
        margin: 26px auto 0;
        flex-direction: column !important;
        align-items: stretch !important;
        gap: 11px !important;
    }

    .sapl-premium-hero__actions > .elementor-widget-button,
    .sapl-premium-hero__actions .elementor-button {
        width: 100%;
    }

    .sapl-hero-cta .elementor-button {
        min-height: 50px;
        padding: 15px 20px;
    }
}

@media (max-width: 360px) {
    .sapl-premium-hero {
        min-height: 600px;
        padding-inline: 14px !important;
    }

    .sapl-premium-hero__title .elementor-heading-title {
        font-size: 32px !important;
    }
}

@media (prefers-reduced-motion: reduce) {
    html.sapl-motion-enabled .sapl-premium-hero__title .elementor-heading-title::before,
    html.sapl-motion-enabled .sapl-premium-hero__title .sapl-hero-line,
    html.sapl-motion-enabled .sapl-premium-hero__title .elementor-heading-title::after,
    html.sapl-motion-enabled .sapl-premium-hero__copy,
    html.sapl-motion-enabled .sapl-premium-hero__actions,
    html.sapl-motion-enabled .sapl-section-reveal {
        opacity: 1 !important;
        transform: none !important;
        animation: none !important;
        transition: none !important;
    }
}
