/* =====================================================================
   ZIAYN — MOTION & INTERACTIVE LAYER
   Sits on top of tenqai-revamp.css ("Vibrant Pop").
   Adds: scroll-reveal, animated hero backdrop + interactive canvas,
   live category marquee, animated counters, button shimmer, card entrances.
   Everything is gated behind prefers-reduced-motion where it moves.
   ===================================================================== */

body.tenqai-ui {
    --zn-grad: linear-gradient(120deg, #ff2d8b 0%, #ff6a13 58%, #ffc328 100%);
    --zn-ease: cubic-bezier(.22, 1, .36, 1);
}

/* ---------------------------------------------------------------------
   1. SCROLL REVEAL
   JS adds .zn-in when the element enters the viewport.
   --------------------------------------------------------------------- */
body.tenqai-ui .zn-reveal {
    opacity: 0;
    transform: translateY(34px);
    transition:
        opacity .8s var(--zn-ease),
        transform .8s var(--zn-ease);
    transition-delay: var(--zn-d, 0ms);
    will-change: opacity, transform;
}
body.tenqai-ui .zn-reveal.zn-in {
    opacity: 1;
    transform: none;
}
body.tenqai-ui .zn-reveal--zoom { transform: translateY(34px) scale(.965); }
body.tenqai-ui .zn-reveal--left  { transform: translateX(-40px); }
body.tenqai-ui .zn-reveal--right { transform: translateX(40px); }

/* stagger children (product columns, tiles, benefit cards …) */
body.tenqai-ui .zn-stagger > * {
    opacity: 0;
    transform: translateY(26px);
    transition: opacity .7s var(--zn-ease), transform .7s var(--zn-ease);
}
body.tenqai-ui .zn-stagger.zn-in > * {
    opacity: 1;
    transform: none;
}
body.tenqai-ui .zn-stagger.zn-in > *:nth-child(1) { transition-delay: .00s; }
body.tenqai-ui .zn-stagger.zn-in > *:nth-child(2) { transition-delay: .06s; }
body.tenqai-ui .zn-stagger.zn-in > *:nth-child(3) { transition-delay: .12s; }
body.tenqai-ui .zn-stagger.zn-in > *:nth-child(4) { transition-delay: .18s; }
body.tenqai-ui .zn-stagger.zn-in > *:nth-child(5) { transition-delay: .24s; }
body.tenqai-ui .zn-stagger.zn-in > *:nth-child(6) { transition-delay: .30s; }
body.tenqai-ui .zn-stagger.zn-in > *:nth-child(7) { transition-delay: .36s; }
body.tenqai-ui .zn-stagger.zn-in > *:nth-child(8) { transition-delay: .42s; }

/* ---------------------------------------------------------------------
   2. HERO BACKDROP — animated aurora + interactive canvas
   .zn-hero-stage-fx is injected as the first child of .tenqai-landing-stage
   --------------------------------------------------------------------- */
body.tenqai-ui .tenqai-landing-stage { isolation: isolate; }
body.tenqai-ui .tenqai-landing-stage > .home-banner-area { position: relative; z-index: 2; }
body.tenqai-ui .tenqai-landing-stage #particles-js { display: none !important; }

body.tenqai-ui .zn-hero-stage-fx {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 660px;
    z-index: 0;
    pointer-events: none;
    overflow: hidden;
    border-radius: 28px;
    background:
        radial-gradient(1100px 460px at 8% -8%, rgba(255, 45, 139, .18), transparent 60%),
        radial-gradient(900px 420px at 100% 0%, rgba(123, 63, 242, .14), transparent 55%),
        radial-gradient(700px 380px at 60% 100%, rgba(255, 195, 40, .16), transparent 60%);
}
@media (max-width: 991px) {
    body.tenqai-ui .zn-hero-stage-fx { height: 520px; border-radius: 20px; }
}

body.tenqai-ui .zn-hero-canvas {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    display: block;
    opacity: .9;
}

body.tenqai-ui .zn-orb {
    position: absolute;
    border-radius: 50%;
    filter: blur(42px);
    opacity: .55;
    mix-blend-mode: multiply;
    animation: znOrbFloat 16s var(--zn-ease) infinite;
}
body.tenqai-ui .zn-orb--a { width: 340px; height: 340px; left: -60px;  top: 30px;
    background: radial-gradient(circle at 35% 35%, #ff2d8b, transparent 70%); }
body.tenqai-ui .zn-orb--b { width: 300px; height: 300px; right: -40px; top: -40px;
    background: radial-gradient(circle at 40% 40%, #ff6a13, transparent 70%); animation-delay: -4s; animation-duration: 19s; }
body.tenqai-ui .zn-orb--c { width: 260px; height: 260px; right: 20%;  top: 240px;
    background: radial-gradient(circle at 40% 40%, #ffc328, transparent 70%); animation-delay: -9s; animation-duration: 22s; }
body.tenqai-ui .zn-orb--d { width: 220px; height: 220px; left: 24%;   top: 300px;
    background: radial-gradient(circle at 40% 40%, #7b3ff2, transparent 70%); animation-delay: -6s; animation-duration: 24s; }

@keyframes znOrbFloat {
    0%, 100% { transform: translate3d(0, 0, 0) scale(1); }
    33%      { transform: translate3d(40px, -30px, 0) scale(1.08); }
    66%      { transform: translate3d(-24px, 26px, 0) scale(.94); }
}

/* pointer-parallax hooks (JS sets --zn-px / --zn-py in range -1..1) */
body.tenqai-ui .zn-hero-stage-fx .zn-orb {
    translate: calc(var(--zn-px, 0) * 26px) calc(var(--zn-py, 0) * 20px);
    transition: translate .35s var(--zn-ease);
}

/* ---------------------------------------------------------------------
   3. HERO COPY — entrance + shimmering headline
   --------------------------------------------------------------------- */
body.tenqai-ui .tenqai-hero-copy > * {
    opacity: 0;
    transform: translateY(18px);
    animation: znHeroIn .8s var(--zn-ease) forwards;
}
body.tenqai-ui .aiz-carousel .slick-active .tenqai-hero-copy > *,
body.tenqai-ui .tenqai-home-hero-frame .tenqai-hero-copy > * { animation-play-state: running; }
body.tenqai-ui .tenqai-hero-copy > *:nth-child(1) { animation-delay: .10s; }
body.tenqai-ui .tenqai-hero-copy > *:nth-child(2) { animation-delay: .20s; }
body.tenqai-ui .tenqai-hero-copy > *:nth-child(3) { animation-delay: .30s; }
body.tenqai-ui .tenqai-hero-copy > *:nth-child(4) { animation-delay: .40s; }
body.tenqai-ui .tenqai-hero-copy > *:nth-child(5) { animation-delay: .50s; }
@keyframes znHeroIn { to { opacity: 1; transform: none; } }

/* ---------------------------------------------------------------------
   4. LIVE CATEGORY MARQUEE
   --------------------------------------------------------------------- */
body.tenqai-ui .zn-marquee {
    position: relative;
    z-index: 2;
    margin: 22px 0 6px;
    padding: 4px 0;
    -webkit-mask-image: linear-gradient(90deg, transparent, #000 6%, #000 94%, transparent);
            mask-image: linear-gradient(90deg, transparent, #000 6%, #000 94%, transparent);
    overflow: hidden;
}
body.tenqai-ui .zn-marquee__track {
    display: flex;
    gap: 12px;
    width: max-content;
    animation: znMarquee 42s linear infinite;
}
body.tenqai-ui .zn-marquee:hover .zn-marquee__track { animation-play-state: paused; }
@keyframes znMarquee { to { transform: translateX(-50%); } }

body.tenqai-ui .zn-chip {
    display: inline-flex;
    align-items: center;
    gap: 9px;
    padding: 8px 16px 8px 8px;
    border-radius: 999px;
    background: #fff;
    border: 1px solid var(--pop-line, #ece8f0);
    box-shadow: 0 8px 22px rgba(29, 23, 38, .08);
    font-weight: 700;
    font-size: 13px;
    color: var(--pop-ink, #1d1726);
    white-space: nowrap;
    transition: transform .2s var(--zn-ease), box-shadow .2s var(--zn-ease), border-color .2s var(--zn-ease);
}
body.tenqai-ui .zn-chip img {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    object-fit: cover;
    flex: none;
}
body.tenqai-ui .zn-chip:hover {
    transform: translateY(-3px);
    border-color: transparent;
    box-shadow: 0 14px 30px rgba(255, 45, 139, .22);
    color: var(--pop-pink-deep, #d6006e);
}

/* ---------------------------------------------------------------------
   5. ANIMATED COUNTERS (commerce-film stats + [data-zn-count])
   --------------------------------------------------------------------- */
body.tenqai-ui .zn-count { font-variant-numeric: tabular-nums; }

/* ---------------------------------------------------------------------
   6. BUTTON SHIMMER SWEEP
   --------------------------------------------------------------------- */
body.tenqai-ui .btn-primary,
body.tenqai-ui .demo-section-link,
body.tenqai-ui .tenqai-hero-btn-primary {
    position: relative;
    overflow: hidden;
}
body.tenqai-ui .btn-primary::after,
body.tenqai-ui .demo-section-link::after,
body.tenqai-ui .tenqai-hero-btn-primary::after {
    content: "";
    position: absolute;
    top: 0;
    left: -75%;
    width: 45%;
    height: 100%;
    background: linear-gradient(120deg, transparent, rgba(255, 255, 255, .55), transparent);
    transform: skewX(-20deg);
    transition: left .6s var(--zn-ease);
    pointer-events: none;
}
body.tenqai-ui .btn-primary:hover::after,
body.tenqai-ui .demo-section-link:hover::after,
body.tenqai-ui .tenqai-hero-btn-primary:hover::after { left: 125%; }

/* ---------------------------------------------------------------------
   7. SECTION HEADINGS — animated gradient underline on reveal
   --------------------------------------------------------------------- */
body.tenqai-ui .demo-section-title {
    position: relative;
    display: inline-block;
    padding-bottom: 10px;
}
body.tenqai-ui .demo-section-title::after {
    content: "";
    position: absolute;
    left: 0;
    bottom: 0;
    height: 4px;
    width: 0;
    border-radius: 999px;
    background: var(--zn-grad);
    transition: width .9s var(--zn-ease) .15s;
}
body.tenqai-ui .zn-in .demo-section-title::after,
body.tenqai-ui .demo-section-title.zn-in::after { width: 68px; }

/* ---------------------------------------------------------------------
   8. FLOATING "AI" / SCROLL CUES + film stage pointer parallax
   --------------------------------------------------------------------- */
body.tenqai-ui .ziayn-film-stage {
    --zn-px: 0;
    --zn-py: 0;
}
body.tenqai-ui .ziayn-film-stage .ziayn-film-card {
    translate: calc(var(--zn-px) * 14px) calc(var(--zn-py) * 12px);
}
body.tenqai-ui .ziayn-film-stage .ziayn-film-card--b { translate: calc(var(--zn-px) * -18px) calc(var(--zn-py) * -14px); }
body.tenqai-ui .ziayn-film-stage .ziayn-film-card--d { translate: calc(var(--zn-px) * 22px) calc(var(--zn-py) * -10px); }

/* ---------------------------------------------------------------------
   9. PRODUCT CARD — pointer glow follow
   --------------------------------------------------------------------- */
body.tenqai-ui .aiz-card-box {
    position: relative;
}
body.tenqai-ui .aiz-card-box::before {
    content: "";
    position: absolute;
    inset: 0;
    border-radius: inherit;
    background: radial-gradient(220px circle at var(--zn-mx, 50%) var(--zn-my, 0%),
        rgba(255, 45, 139, .12), transparent 60%);
    opacity: 0;
    transition: opacity .3s var(--zn-ease);
    pointer-events: none;
    z-index: 1;
}
body.tenqai-ui .aiz-card-box:hover::before { opacity: 1; }

/* ---------------------------------------------------------------------
   10. BACK-TO-TOP progress ring pulse
   --------------------------------------------------------------------- */
body.tenqai-ui #scroll-top.zn-show {
    animation: znPop .4s var(--zn-ease);
}
@keyframes znPop { 0% { transform: scale(.6); opacity: 0; } 100% { transform: scale(1); opacity: 1; } }

/* ---------------------------------------------------------------------
   REDUCED MOTION — stop everything that moves, keep content visible
   --------------------------------------------------------------------- */
@media (prefers-reduced-motion: reduce) {
    body.tenqai-ui .zn-reveal,
    body.tenqai-ui .zn-stagger > *,
    body.tenqai-ui .tenqai-hero-copy > * {
        opacity: 1 !important;
        transform: none !important;
        transition: none !important;
        animation: none !important;
    }
    body.tenqai-ui .zn-orb,
    body.tenqai-ui .zn-marquee__track { animation: none !important; }
    body.tenqai-ui .zn-hero-canvas { display: none !important; }
    body.tenqai-ui .demo-section-title::after { transition: none; width: 68px; }
}
