/* Taifun Premium Cinematic Scroll v2.0.0
   Apple / modern automotive inspired motion layer.
   Loaded only when settings.scroll_animation_enabled = 1.
*/

#taifun-home[data-scroll-animations="1"] {
    --taifun-motion-ease: cubic-bezier(.16, 1, .3, 1);
    --taifun-motion-ease-soft: cubic-bezier(.22, .61, .36, 1);
    --taifun-motion-duration: 1100ms;
    --taifun-motion-distance: 54px;
    --taifun-motion-blur: 10px;
    --taifun-cinematic-black: #050607;
    --taifun-cinematic-graphite: #111317;
    --taifun-cinematic-line: rgba(255,255,255,.12);
    overflow: clip;
}

/* Progressive enhancement: content stays fully visible until JS marks the page ready. */
html.taifun-cinematic-ready #taifun-home[data-scroll-animations="1"] [data-taifun-reveal] {
    opacity: 0;
    transform: translate3d(0, var(--taifun-motion-distance), 0) scale(.985);
    filter: blur(var(--taifun-motion-blur));
    transition:
        opacity 780ms var(--taifun-motion-ease-soft),
        transform var(--taifun-motion-duration) var(--taifun-motion-ease),
        filter 820ms var(--taifun-motion-ease-soft);
    transition-delay: var(--taifun-delay, 0ms);
    will-change: transform, opacity, filter;
}

html.taifun-cinematic-ready #taifun-home[data-scroll-animations="1"] [data-taifun-reveal="left"] {
    transform: translate3d(calc(0px - var(--taifun-motion-distance)), 0, 0) scale(.985);
}

html.taifun-cinematic-ready #taifun-home[data-scroll-animations="1"] [data-taifun-reveal="right"] {
    transform: translate3d(var(--taifun-motion-distance), 0, 0) scale(.985);
}

html.taifun-cinematic-ready #taifun-home[data-scroll-animations="1"] [data-taifun-reveal="scale"] {
    transform: translate3d(0, 22px, 0) scale(.94);
}

html.taifun-cinematic-ready #taifun-home[data-scroll-animations="1"] [data-taifun-reveal].is-inview {
    opacity: 1;
    transform: none;
    filter: blur(0);
    will-change: auto;
}

#taifun-home[data-scroll-animations="1"] .taifun-cinematic-section {
    position: relative;
    isolation: isolate;
}

/* Fine metallic separator that appears while moving between major scenes. */
#taifun-home[data-scroll-animations="1"] .taifun-cinematic-section:not(.taifun-scene--hero)::after {
    content: "";
    position: absolute;
    z-index: 8;
    left: max(20px, calc((100% - 1440px) / 2));
    right: max(20px, calc((100% - 1440px) / 2));
    top: 0;
    height: 1px;
    pointer-events: none;
    background: linear-gradient(90deg, transparent, rgba(17,24,39,.10) 16%, rgba(17,24,39,.10) 84%, transparent);
    transform: scaleX(var(--taifun-line-progress, .25));
    transform-origin: left center;
    opacity: .7;
}

/* HERO — slow zoom, image drift and content exit similar to premium launch pages. */
#taifun-home[data-scroll-animations="1"] #heroSlider.taifun-cinematic-hero {
    --taifun-hero-progress: 0;
    --taifun-hero-media-shift: 0px;
    --taifun-hero-scale: 1.045;
    --taifun-hero-caption-shift: 0px;
    --taifun-hero-content-opacity: 1;
    --taifun-hero-indicator-shift: 0px;
    --taifun-hero-cue-opacity: .85;
    min-height: 680px;
    background: var(--taifun-cinematic-black);
}

#taifun-home[data-scroll-animations="1"] #heroSlider.taifun-cinematic-hero .hero-bg,
#taifun-home[data-scroll-animations="1"] #heroSlider.taifun-cinematic-hero .hero-video {
    animation: none !important;
    transform:
        translate3d(0, var(--taifun-hero-media-shift), 0)
        scale(var(--taifun-hero-scale)) !important;
    transform-origin: center center;
    transition: none !important;
    will-change: transform;
}

#taifun-home[data-scroll-animations="1"] #heroSlider.taifun-cinematic-hero .hero-overlay {
    background:
        radial-gradient(circle at 72% 48%, transparent 0, rgba(0,0,0,.08) 24%, rgba(0,0,0,.34) 58%, rgba(0,0,0,.65) 100%),
        linear-gradient(90deg, rgba(0,0,0,.91), rgba(0,0,0,.58) 40%, rgba(0,0,0,.12) 74%, rgba(0,0,0,.28));
}

#taifun-home[data-scroll-animations="1"] #heroSlider.taifun-cinematic-hero .hero-caption {
    max-width: 880px !important;
    transform: translate3d(0, calc(-50% - var(--taifun-hero-caption-shift)), 0) !important;
    opacity: var(--taifun-hero-content-opacity);
    will-change: transform, opacity;
}

#taifun-home[data-scroll-animations="1"] #heroSlider.taifun-cinematic-hero .hero-title {
    max-width: 880px !important;
    font-size: clamp(42px, 6.2vw, 92px) !important;
    line-height: .98 !important;
    letter-spacing: -.052em !important;
    font-weight: 900 !important;
    text-wrap: balance;
    text-shadow: 0 18px 55px rgba(0,0,0,.22);
}

#taifun-home[data-scroll-animations="1"] #heroSlider.taifun-cinematic-hero .hero-title-long {
    font-size: clamp(38px, 5.4vw, 78px) !important;
}

#taifun-home[data-scroll-animations="1"] #heroSlider.taifun-cinematic-hero .hero-title-xlong {
    font-size: clamp(34px, 4.8vw, 68px) !important;
}

#taifun-home[data-scroll-animations="1"] #heroSlider.taifun-cinematic-hero .hero-title-xxlong {
    font-size: clamp(30px, 4.1vw, 58px) !important;
}

#taifun-home[data-scroll-animations="1"] #heroSlider.taifun-cinematic-hero .hero-desc {
    max-width: 680px !important;
    font-size: clamp(14px, 1.12vw, 18px) !important;
    line-height: 1.65 !important;
    color: rgba(255,255,255,.78) !important;
    border-left: 0 !important;
    padding-left: 0 !important;
}

#taifun-home[data-scroll-animations="1"] #heroSlider.taifun-cinematic-hero .hero-badge {
    background: rgba(15,17,20,.34) !important;
    border-color: rgba(255,255,255,.20) !important;
    box-shadow: inset 0 1px rgba(255,255,255,.06), 0 12px 40px rgba(0,0,0,.14);
    backdrop-filter: blur(18px) saturate(130%);
}

#taifun-home[data-scroll-animations="1"] #heroSlider.taifun-cinematic-hero .btn-tego {
    min-height: 48px;
    padding: 0 24px !important;
    border-radius: 999px !important;
    box-shadow: 0 16px 42px rgba(var(--site-primary-rgb,220,35,33),.25) !important;
}

#taifun-home[data-scroll-animations="1"] #heroSlider.taifun-cinematic-hero .carousel-indicators {
    opacity: calc(1 - var(--taifun-hero-progress));
    transform: translate3d(-50%, var(--taifun-hero-indicator-shift), 0);
}

/* Slider category cards become the first floating automotive-style control deck. */
#taifun-home[data-scroll-animations="1"] .category-strip.taifun-cinematic-deck {
    position: relative;
    z-index: 30;
    perspective: 1200px;
}

#taifun-home[data-scroll-animations="1"] .category-strip.taifun-cinematic-deck .category-card {
    border-color: rgba(15,23,42,.06);
    box-shadow: 0 24px 70px rgba(0,0,0,.11);
    backdrop-filter: blur(12px);
}

/* ABOUT — visual gets a controlled slow parallax while copy comes in as layers. */
#taifun-home[data-scroll-animations="1"] .taifun-scene--about .about4-image,
#taifun-home[data-scroll-animations="1"] .taifun-scene--about [class*="image"] {
    overflow: hidden;
}

#taifun-home[data-scroll-animations="1"] .taifun-scene--about .about4-image img,
#taifun-home[data-scroll-animations="1"] .taifun-scene--about [data-taifun-media="parallax"] {
    transform: translate3d(0, var(--taifun-section-parallax-y, 0px), 0) scale(1.055);
    transition: transform 90ms linear;
    will-change: transform;
}

#taifun-home[data-scroll-animations="1"] .taifun-scene--about .about4-image {
    box-shadow: 0 32px 90px rgba(10,12,16,.16);
}

/* COUNTERS — denser graphite / red presentation with subtle depth. */
#taifun-home[data-scroll-animations="1"] .taifun-scene--counter {
    background-position: center calc(50% + var(--taifun-section-bg-shift, 0px)) !important;
}

#taifun-home[data-scroll-animations="1"] .taifun-scene--counter .counter8-ribbon {
    box-shadow: 0 38px 110px rgba(0,0,0,.28);
}

#taifun-home[data-scroll-animations="1"] .taifun-scene--counter .counter8-item {
    transition: background .35s ease, transform .55s var(--taifun-motion-ease);
}

#taifun-home[data-scroll-animations="1"] .taifun-scene--counter .counter8-item:hover {
    transform: translateY(-6px);
}

/* PRODUCT — gallery cards feel like automotive configurator tiles. */
#taifun-home[data-scroll-animations="1"] .taifun-scene--product .product3-heading h2,
#taifun-home[data-scroll-animations="1"] .taifun-scene--blog .blog12-head h2,
#taifun-home[data-scroll-animations="1"] .taifun-scene--project .projects-title {
    letter-spacing: -.06em !important;
    text-wrap: balance;
}

#taifun-home[data-scroll-animations="1"] .taifun-scene--product .product3-card,
#taifun-home[data-scroll-animations="1"] .taifun-scene--blog .blog12-card {
    transform-style: preserve-3d;
    border-color: rgba(15,23,42,.055);
    box-shadow: 0 24px 75px rgba(15,23,42,.09);
    transition: transform .55s var(--taifun-motion-ease), box-shadow .55s ease, border-color .4s ease;
}

#taifun-home[data-scroll-animations="1"] .taifun-scene--product .product3-card:hover,
#taifun-home[data-scroll-animations="1"] .taifun-scene--blog .blog12-card:hover {
    transform: translate3d(0,-10px,0) scale(1.012);
    box-shadow: 0 36px 100px rgba(15,23,42,.16);
    border-color: rgba(var(--site-primary-rgb,220,35,33),.18);
}

#taifun-home[data-scroll-animations="1"] .taifun-scene--product .product3-thumb,
#taifun-home[data-scroll-animations="1"] .taifun-scene--blog .blog12-img {
    background: linear-gradient(145deg,#f6f7f8,#e9ebee);
}

#taifun-home[data-scroll-animations="1"] .taifun-scene--product .product3-thumb img,
#taifun-home[data-scroll-animations="1"] .taifun-scene--blog .blog12-img img {
    transform: scale(var(--taifun-section-media-scale, 1.035));
    will-change: transform;
}

/* PROJECTS — before/after cards emerge as large engineering panels. */
#taifun-home[data-scroll-animations="1"] .taifun-scene--project .ba-container {
    border-radius: 26px;
    box-shadow: 0 30px 90px rgba(10,12,16,.15);
    transition: transform .7s var(--taifun-motion-ease), box-shadow .5s ease;
}

#taifun-home[data-scroll-animations="1"] .taifun-scene--project .ba-container:hover {
    transform: translateY(-7px);
    box-shadow: 0 40px 110px rgba(10,12,16,.20);
}

/* CONTACT — final scene gets a dark premium frame without changing admin colors. */
#taifun-home[data-scroll-animations="1"] .taifun-scene--contact .alp-map-cta-wrap {
    box-shadow: 0 36px 110px rgba(0,0,0,.13);
}

#taifun-home[data-scroll-animations="1"] .taifun-scene--contact .alp-map-box,
#taifun-home[data-scroll-animations="1"] .taifun-scene--contact .alp-cta-card {
    transition: transform .75s var(--taifun-motion-ease), box-shadow .5s ease;
}

/* Small motion cue in the lower edge of hero. */
#taifun-home[data-scroll-animations="1"] #heroSlider.taifun-cinematic-hero::after {
    content: "";
    position: absolute;
    z-index: 7;
    left: 50%;
    bottom: 34px;
    width: 1px;
    height: 50px;
    background: linear-gradient(to bottom, rgba(255,255,255,.8), rgba(255,255,255,0));
    transform-origin: top;
    animation: taifunScrollCue 1.8s ease-in-out infinite;
    opacity: var(--taifun-hero-cue-opacity);
}

@keyframes taifunScrollCue {
    0%, 100% { transform: scaleY(.35); opacity: .22; }
    50% { transform: scaleY(1); opacity: .85; }
}

@media (min-width: 1200px) {
    #taifun-home[data-scroll-animations="1"] .taifun-scene--about .about4-visual {
        transform: translate3d(0, var(--taifun-about-shift, 0px), 0);
        will-change: transform;
    }
}

@media (max-width: 991.98px) {
    #taifun-home[data-scroll-animations="1"] {
        --taifun-motion-distance: 36px;
        --taifun-motion-blur: 6px;
    }

    #taifun-home[data-scroll-animations="1"] #heroSlider.taifun-cinematic-hero {
        min-height: 600px;
    }

    #taifun-home[data-scroll-animations="1"] #heroSlider.taifun-cinematic-hero .hero-title,
    #taifun-home[data-scroll-animations="1"] #heroSlider.taifun-cinematic-hero .hero-title-long,
    #taifun-home[data-scroll-animations="1"] #heroSlider.taifun-cinematic-hero .hero-title-xlong,
    #taifun-home[data-scroll-animations="1"] #heroSlider.taifun-cinematic-hero .hero-title-xxlong {
        font-size: clamp(34px, 8.5vw, 62px) !important;
        line-height: 1.01 !important;
    }
}

@media (max-width: 767.98px) {
    #taifun-home[data-scroll-animations="1"] {
        --taifun-motion-distance: 26px;
        --taifun-motion-duration: 850ms;
        --taifun-motion-blur: 4px;
    }

    #taifun-home[data-scroll-animations="1"] #heroSlider.taifun-cinematic-hero {
        min-height: 560px;
    }

    #taifun-home[data-scroll-animations="1"] #heroSlider.taifun-cinematic-hero .hero-caption {
        left: 6% !important;
        right: 6% !important;
        max-width: none !important;
    }

    #taifun-home[data-scroll-animations="1"] #heroSlider.taifun-cinematic-hero .hero-title,
    #taifun-home[data-scroll-animations="1"] #heroSlider.taifun-cinematic-hero .hero-title-long,
    #taifun-home[data-scroll-animations="1"] #heroSlider.taifun-cinematic-hero .hero-title-xlong,
    #taifun-home[data-scroll-animations="1"] #heroSlider.taifun-cinematic-hero .hero-title-xxlong {
        font-size: clamp(31px, 10vw, 50px) !important;
        line-height: 1.02 !important;
    }

    #taifun-home[data-scroll-animations="1"] #heroSlider.taifun-cinematic-hero .hero-desc {
        font-size: 13px !important;
        line-height: 1.55 !important;
    }

    #taifun-home[data-scroll-animations="1"] #heroSlider.taifun-cinematic-hero::after {
        display: none;
    }
}

@media (prefers-reduced-motion: reduce) {
    html.taifun-cinematic-ready #taifun-home[data-scroll-animations="1"] [data-taifun-reveal] {
        opacity: 1 !important;
        transform: none !important;
        filter: none !important;
        transition: none !important;
    }

    #taifun-home[data-scroll-animations="1"] #heroSlider.taifun-cinematic-hero .hero-bg,
    #taifun-home[data-scroll-animations="1"] #heroSlider.taifun-cinematic-hero .hero-video,
    #taifun-home[data-scroll-animations="1"] #heroSlider.taifun-cinematic-hero .hero-caption,
    #taifun-home[data-scroll-animations="1"] .taifun-scene--about .about4-image img,
    #taifun-home[data-scroll-animations="1"] .taifun-scene--about .about4-visual {
        transform: none !important;
        opacity: 1 !important;
        animation: none !important;
        transition: none !important;
    }
}
