/* Homepage agency-style motion layer. Keep this file homepage-only. */

.agency-motion-page {
    --agency-ease: cubic-bezier(0.16, 1, 0.3, 1);
    --agency-ease-slow: cubic-bezier(0.19, 1, 0.22, 1);
}

.agency-loader {
    position: fixed;
    inset: 0;
    z-index: 9999;
    display: grid;
    place-items: center;
    overflow: hidden;
    pointer-events: none;
    color: #eaf6ff;
    background:
        linear-gradient(90deg, rgba(53, 216, 255, 0.12) 0 1px, transparent 1px 100%),
        linear-gradient(180deg, rgba(255, 255, 255, 0.08) 0 1px, transparent 1px 100%),
        radial-gradient(circle at 72% 22%, rgba(49, 184, 255, 0.22), transparent 34%),
        #030813;
    background-size: 96px 96px, 96px 96px, auto, auto;
    animation: agencyLoaderExit 0.9s var(--agency-ease-slow) 2.05s forwards;
}

.agency-loader__panel {
    position: absolute;
    left: 0;
    right: 0;
    background:
        linear-gradient(90deg, rgba(4, 8, 18, 0.96), rgba(6, 18, 38, 0.9)),
        #030813;
    border-color: rgba(115, 216, 255, 0.2);
    border-style: solid;
    border-width: 0;
    will-change: transform;
}

.agency-loader__panel--top {
    top: 0;
    bottom: 50%;
    border-bottom-width: 1px;
    animation: agencyPanelTop 1.05s var(--agency-ease-slow) 1.5s forwards;
}

.agency-loader__panel--bottom {
    top: 50%;
    bottom: 0;
    border-top-width: 1px;
    animation: agencyPanelBottom 1.05s var(--agency-ease-slow) 1.5s forwards;
}

.agency-loader__mark {
    position: relative;
    z-index: 2;
    font-size: clamp(13px, 1.5vw, 22px);
    font-weight: 800;
    line-height: 1;
    letter-spacing: 0;
    text-transform: uppercase;
    opacity: 0;
    transform: translate3d(0, 24px, 0) scaleX(0.72);
    transform-origin: left center;
    animation: agencyLoaderMark 1.35s var(--agency-ease-slow) 0.18s forwards;
}

.agency-loader__line {
    position: absolute;
    z-index: 2;
    width: min(560px, 72vw);
    height: 1px;
    margin-top: 54px;
    transform: scaleX(0);
    transform-origin: left center;
    background: linear-gradient(90deg, transparent, #7be9ff, #ffd568, transparent);
    box-shadow: 0 0 24px rgba(123, 233, 255, 0.56);
    animation: agencyLoaderLine 1.45s var(--agency-ease-slow) 0.32s forwards;
}

.agency-motion-page .hero {
    isolation: isolate;
}

.agency-motion-page .hero-content {
    perspective: 1200px;
}

.agency-motion-page .hero-kicker span,
.agency-motion-page .hero-logo,
.agency-motion-page .hero-subtitle,
.agency-motion-page .hero-stats .stat-item {
    opacity: 0;
    transform: translate3d(0, 24px, 0);
    animation: agencyHeroSoftIn 0.95s var(--agency-ease) forwards;
}

.agency-motion-page .hero-kicker span:nth-child(1) {
    animation-delay: 1.22s;
}

.agency-motion-page .hero-kicker span:nth-child(2) {
    animation-delay: 1.34s;
}

.agency-motion-page .hero-logo {
    animation-delay: 1.45s;
}

.agency-motion-page .hero-subtitle {
    animation-delay: 2.02s;
}

.agency-motion-page .hero-stats .stat-item:nth-child(1) {
    animation-delay: 2.14s;
}

.agency-motion-page .hero-stats .stat-item:nth-child(2) {
    animation-delay: 2.26s;
}

.agency-motion-page .hero-stats .stat-item:nth-child(3) {
    animation-delay: 2.38s;
}

.agency-hero-title {
    display: block;
    max-width: 980px;
    overflow: visible;
}

.agency-hero-title span {
    display: block;
    background: linear-gradient(135deg, #ffffff 0%, rgba(233, 248, 255, 0.96) 40%, #7edaff 72%, #f7bd62 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    color: transparent;
    opacity: 0;
    clip-path: inset(0 100% 0 0);
    transform: translate3d(-58px, 34px, 0) scaleX(0.72);
    transform-origin: left center;
    animation: agencyHeroTitleIn 1.2s var(--agency-ease-slow) forwards;
    will-change: transform, opacity, clip-path;
}

.agency-hero-title span:nth-child(1) {
    animation-delay: 1.55s;
}

.agency-hero-title span:nth-child(2) {
    animation-delay: 1.74s;
}

.agency-hero-title .hero-deepseek-badge {
    opacity: 0;
    transform: scale(0.8);
    animation: agencyHeroSoftIn 0.6s var(--agency-ease) 2.2s forwards;
}

.agency-motion-page .hero-bg.agency-parallax {
    transform: translate3d(0, var(--agency-parallax-y, 0px), 0) scale(1.035);
    transform-origin: center top;
    will-change: transform;
}

.agency-motion-page .reveal {
    opacity: 1;
    transform: none;
    transition: none;
}

.agency-motion-section {
    position: relative;
    isolation: isolate;
    overflow: clip;
}

.agency-motion-section > .container,
.agency-motion-section > .control-hero-shell,
.agency-motion-section > .about-content {
    position: relative;
    z-index: 2;
}

.agency-section-heading {
    position: relative;
    z-index: 1;
    width: min(1180px, calc(100vw - 64px));
    margin: 0 auto -18px;
    pointer-events: none;
}

.agency-section-title {
    display: block;
    max-width: 780px;
    font-size: 44px;
    font-weight: 900;
    line-height: 0.9;
    letter-spacing: 0;
    color: rgba(219, 246, 255, 0.18);
    text-transform: uppercase;
    opacity: 0;
    clip-path: inset(0 0 100% 0);
    transform: translate3d(-8vw, 118px, 0) scaleY(0.68);
    transform-origin: left bottom;
    transition:
        opacity 0.85s var(--agency-ease),
        clip-path 1.2s var(--agency-ease-slow),
        transform 1.2s var(--agency-ease-slow);
    will-change: transform, opacity, clip-path;
}

.agency-motion-section.is-inview .agency-section-title {
    opacity: 1;
    clip-path: inset(0);
    transform: none;
}

.agency-motion-section.is-inview .agency-section-title {
    opacity: 0.24;
}

.agency-motion-item {
    opacity: 0 !important;
    clip-path: inset(16% 0 0 0 round 10px);
    transform: translate3d(0, 72px, 0) scale(0.96) !important;
    transform-origin: center bottom;
    transition:
        opacity 0.86s var(--agency-ease),
        clip-path 1.06s var(--agency-ease-slow),
        transform 1.06s var(--agency-ease-slow) !important;
    transition-delay: var(--agency-stagger, 0ms) !important;
    will-change: transform, opacity, clip-path;
}

.agency-motion-section.is-inview .agency-motion-item {
    opacity: 1 !important;
    clip-path: inset(0 0 0 0 round 0);
    transform: none !important;
}

.agency-motion-page .ai-experts-grid--slanted .ai-expert-card.agency-motion-item {
    transform: translate3d(0, 72px, 0) scale(0.96) skewX(-9deg) !important;
}

.agency-motion-page .agency-motion-section.is-inview .ai-experts-grid--slanted .ai-expert-card.agency-motion-item {
    transform: skewX(-9deg) !important;
}

.agency-motion-page .agency-motion-section.is-inview .ai-experts-grid--slanted .ai-expert-card.agency-motion-item:hover {
    transform: translateY(-10px) skewX(-9deg) !important;
}

.agency-image-reveal {
    overflow: hidden;
}

.agency-image-reveal img {
    transform: translate3d(0, var(--agency-parallax-y, 0px), 0) scale(1.08);
    transition: transform 1.2s var(--agency-ease-slow);
    will-change: transform;
}

.agency-motion-section.is-inview .agency-image-reveal img {
    transform: translate3d(0, var(--agency-parallax-y, 0px), 0) scale(1);
}

.agency-motion-page .coverflow-wrapper.agency-motion-item {
    clip-path: inset(10% 0 10% 0 round 20px);
}

.agency-motion-page .circular-feature-gallery.agency-motion-item {
    clip-path: none;
}

.agency-motion-page .coverflow-wrapper.agency-motion-item,
.agency-motion-page .circular-feature-gallery.agency-motion-item,
.agency-motion-page .control-dashboard.agency-motion-item {
    transform: translate3d(0, 86px, 0) scale(0.94) !important;
}

.agency-motion-page .agency-motion-section.is-inview .coverflow-wrapper.agency-motion-item,
.agency-motion-page .agency-motion-section.is-inview .circular-feature-gallery.agency-motion-item,
.agency-motion-page .agency-motion-section.is-inview .control-dashboard.agency-motion-item {
    transform: none !important;
}

@keyframes agencyLoaderMark {
    0% {
        opacity: 0;
        clip-path: inset(0 100% 0 0);
        transform: translate3d(0, 24px, 0) scaleX(0.72);
    }
    100% {
        opacity: 1;
        clip-path: inset(0);
        transform: translate3d(0, 0, 0) scaleX(1);
    }
}

@keyframes agencyLoaderLine {
    0% {
        opacity: 0;
        transform: scaleX(0);
    }
    35% {
        opacity: 1;
    }
    100% {
        opacity: 0.74;
        transform: scaleX(1);
    }
}

@keyframes agencyPanelTop {
    0% {
        transform: translate3d(0, 0, 0);
    }
    100% {
        transform: translate3d(0, -104%, 0);
    }
}

@keyframes agencyPanelBottom {
    0% {
        transform: translate3d(0, 0, 0);
    }
    100% {
        transform: translate3d(0, 104%, 0);
    }
}

@keyframes agencyLoaderExit {
    0% {
        opacity: 1;
        visibility: visible;
    }
    100% {
        opacity: 0;
        visibility: hidden;
    }
}

@keyframes agencyHeroSoftIn {
    0% {
        opacity: 0;
        transform: translate3d(0, 24px, 0);
    }
    100% {
        opacity: 1;
        transform: translate3d(0, 0, 0);
    }
}

@keyframes agencyHeroTitleIn {
    0% {
        opacity: 0;
        clip-path: inset(0 100% 0 0);
        transform: translate3d(-58px, 34px, 0) scaleX(0.72);
    }
    62% {
        opacity: 1;
        clip-path: inset(0);
        transform: translate3d(10px, 0, 0) scaleX(1.03);
    }
    100% {
        opacity: 1;
        clip-path: inset(0);
        transform: translate3d(0, 0, 0) scaleX(1);
    }
}

@media (min-width: 769px) and (max-width: 1180px) {
    .agency-section-title {
        max-width: 680px;
        font-size: 36px;
    }
}

@media (max-width: 768px) {
    .agency-section-heading {
        width: min(100% - 32px, 560px);
        margin-bottom: -6px;
    }

    .agency-section-title {
        font-size: 26px;
        line-height: 0.92;
    }

    .agency-motion-item {
        clip-path: inset(10% 0 0 0 round 8px);
        transform: translate3d(0, 48px, 0) scale(0.97) !important;
    }

    .agency-motion-page .hero-bg.agency-parallax {
        transform: none;
    }
}

@media (prefers-reduced-motion: reduce) {
    .agency-loader {
        display: none !important;
    }

    .agency-motion-page .hero-kicker span,
    .agency-motion-page .hero-logo,
    .agency-motion-page .hero-subtitle,
    .agency-motion-page .hero-stats .stat-item,
    .agency-hero-title span,
    .agency-section-title,
    .agency-motion-item,
    .agency-image-reveal img {
        opacity: 1 !important;
        clip-path: inset(0) !important;
        transform: none !important;
        animation: none !important;
        transition: none !important;
    }

    .agency-motion-section .agency-section-title {
        opacity: 0.22 !important;
    }
}
