/* =====================================================
   UAinns Scroll Effects - World-Class Animations
   "Midnight Elegance" Theme
   ===================================================== */

/* =====================================================
   Smooth Scroll Behavior
   ===================================================== */
html {
    scroll-behavior: smooth;
}

body {
    overflow-x: hidden;
}

/* =====================================================
   Parallax Container System
   ===================================================== */
.parallax-container {
    position: relative;
    overflow: hidden;
}

.parallax-bg {
    position: absolute;
    top: -20%;
    left: -10%;
    width: 120%;
    height: 140%;
    pointer-events: none;
    will-change: transform;
}

.parallax-layer {
    position: absolute;
    will-change: transform;
    transition: transform 0.1s linear;
}

.parallax-layer--deep {
    z-index: 1;
}

.parallax-layer--mid {
    z-index: 2;
}

.parallax-layer--front {
    z-index: 3;
}

/* =====================================================
   Scroll-Triggered Reveal Animations
   ===================================================== */
[data-scroll] {
    transition: all 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}

/* Elements visible immediately - no waiting for JavaScript */
[data-scroll] {
    opacity: 1;
}

[data-scroll="fade-up"] {
    transform: translateY(60px);
}

[data-scroll="fade-down"] {
    transform: translateY(-60px);
}

[data-scroll="fade-left"] {
    transform: translateX(80px);
}

[data-scroll="fade-right"] {
    transform: translateX(-80px);
}

[data-scroll="zoom-in"] {
    transform: scale(0.9);
}

[data-scroll="zoom-out"] {
    transform: scale(1.1);
}

[data-scroll="rotate-in"] {
    transform: rotate(-5deg) scale(0.95);
}

[data-scroll="clip-reveal"] {
    clip-path: inset(100% 0 0 0);
}

/* Active states - MUST override with higher specificity */
[data-scroll].is-visible,
.is-visible[data-scroll] {
    opacity: 1 !important;
    transform: none !important;
    filter: none !important;
    clip-path: inset(0 0 0 0) !important;
}

/* Stagger delays */
[data-scroll-delay="1"] {
    transition-delay: 0.1s;
}

[data-scroll-delay="2"] {
    transition-delay: 0.2s;
}

[data-scroll-delay="3"] {
    transition-delay: 0.3s;
}

[data-scroll-delay="4"] {
    transition-delay: 0.4s;
}

[data-scroll-delay="5"] {
    transition-delay: 0.5s;
}

/* =====================================================
   Sticky Scroll Sections
   ===================================================== */
.sticky-section {
    position: sticky;
    top: 0;
    height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
}

.sticky-content {
    transition: all 0.5s cubic-bezier(0.16, 1, 0.3, 1);
}

/* =====================================================
   Image Morph Effects
   ===================================================== */
.morph-image {
    will-change: transform, filter, opacity;
    transition: all 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}

.morph-image--scale {
    transform: scale(var(--morph-scale, 1));
}

.morph-image--rotate {
    transform: rotate(var(--morph-rotate, 0deg));
}

.morph-image--translate {
    transform: translate(var(--morph-x, 0), var(--morph-y, 0));
}

/* =====================================================
   Horizontal Scroll Section
   ===================================================== */
.horizontal-scroll-wrapper {
    position: relative;
    height: 250vh;
    /* Balanced for smooth scroll experience */
}

.horizontal-scroll-container {
    position: sticky;
    top: 0;
    height: 100vh;
    display: flex;
    align-items: center;
    overflow: hidden;
}

.horizontal-scroll-track {
    display: flex;
    gap: 4rem;
    padding: 0 10vw;
    will-change: transform;
    transition: transform 0.1s linear;
}

.horizontal-scroll-item {
    flex-shrink: 0;
    width: 80vw;
    max-width: 600px;
}

/* =====================================================
   Cinematic Hero
   ===================================================== */
.hero-cinematic {
    position: relative;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    overflow: hidden;
    background: #0B0B0B;
}

.hero-title {
    font-family: 'Inter', sans-serif;
    font-size: clamp(3rem, 12vw, 10rem);
    font-weight: 800;
    letter-spacing: -0.04em;
    line-height: 0.9;
    color: #F5F5F0;
    text-align: center;
    margin: 0;
}

.hero-title span {
    display: block;
}

.hero-subtitle {
    font-family: 'Inter', sans-serif;
    font-size: clamp(1rem, 2.5vw, 1.5rem);
    font-weight: 300;
    color: #8A8A85;
    text-align: center;
    margin-top: 2rem;
    max-width: 600px;
    line-height: 1.6;
}

.hero-scroll-indicator {
    position: absolute;
    bottom: 3rem;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    color: #8A8A85;
    font-size: 0.75rem;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    animation: float 2s ease-in-out infinite;
}

.hero-scroll-indicator::after {
    content: '';
    width: 1px;
    height: 40px;
    background: linear-gradient(to bottom, #5E5AFF, transparent);
    animation: scroll-line 1.5s ease-in-out infinite;
}

@keyframes float {

    0%,
    100% {
        transform: translateX(-50%) translateY(0);
    }

    50% {
        transform: translateX(-50%) translateY(-10px);
    }
}

@keyframes scroll-line {
    0% {
        opacity: 0;
        transform: scaleY(0);
        transform-origin: top;
    }

    50% {
        opacity: 1;
        transform: scaleY(1);
    }

    100% {
        opacity: 0;
        transform: scaleY(0);
        transform-origin: bottom;
    }
}

/* =====================================================
   COSMIC BACKGROUND - Stars & Shooting Stars Tunnel
   ===================================================== */
.cosmic-bg {
    position: absolute;
    inset: 0;
    overflow: hidden;
    pointer-events: none;
    z-index: 1;
}

/* Star Field */
.star-field {
    position: absolute;
    width: 100%;
    height: 100%;
}

.star {
    position: absolute;
    width: 2px;
    height: 2px;
    background: #fff;
    border-radius: 50%;
    opacity: 0;
    animation: twinkle 4s ease-in-out infinite;
}

/* Distribute stars randomly */
.star:nth-child(1) {
    top: 10%;
    left: 15%;
    animation-delay: 0s;
}

.star:nth-child(2) {
    top: 20%;
    left: 85%;
    animation-delay: 0.5s;
}

.star:nth-child(3) {
    top: 5%;
    left: 45%;
    animation-delay: 1s;
    width: 3px;
    height: 3px;
}

.star:nth-child(4) {
    top: 30%;
    left: 25%;
    animation-delay: 1.5s;
}

.star:nth-child(5) {
    top: 15%;
    left: 70%;
    animation-delay: 2s;
}

.star:nth-child(6) {
    top: 40%;
    left: 10%;
    animation-delay: 0.3s;
}

.star:nth-child(7) {
    top: 35%;
    left: 90%;
    animation-delay: 0.8s;
    width: 3px;
    height: 3px;
}

.star:nth-child(8) {
    top: 8%;
    left: 60%;
    animation-delay: 1.3s;
}

.star:nth-child(9) {
    top: 25%;
    left: 5%;
    animation-delay: 1.8s;
}

.star:nth-child(10) {
    top: 45%;
    left: 75%;
    animation-delay: 2.3s;
}

.star:nth-child(11) {
    top: 55%;
    left: 20%;
    animation-delay: 0.2s;
}

.star:nth-child(12) {
    top: 60%;
    left: 95%;
    animation-delay: 0.7s;
    width: 3px;
    height: 3px;
}

.star:nth-child(13) {
    top: 50%;
    left: 55%;
    animation-delay: 1.2s;
}

.star:nth-child(14) {
    top: 65%;
    left: 35%;
    animation-delay: 1.7s;
}

.star:nth-child(15) {
    top: 70%;
    left: 80%;
    animation-delay: 2.2s;
}

.star:nth-child(16) {
    top: 75%;
    left: 8%;
    animation-delay: 0.4s;
}

.star:nth-child(17) {
    top: 80%;
    left: 65%;
    animation-delay: 0.9s;
}

.star:nth-child(18) {
    top: 85%;
    left: 40%;
    animation-delay: 1.4s;
    width: 3px;
    height: 3px;
}

.star:nth-child(19) {
    top: 90%;
    left: 88%;
    animation-delay: 1.9s;
}

.star:nth-child(20) {
    top: 95%;
    left: 30%;
    animation-delay: 2.4s;
}

.star:nth-child(21) {
    top: 12%;
    left: 52%;
    animation-delay: 0.6s;
}

.star:nth-child(22) {
    top: 28%;
    left: 78%;
    animation-delay: 1.1s;
}

.star:nth-child(23) {
    top: 42%;
    left: 42%;
    animation-delay: 1.6s;
    width: 3px;
    height: 3px;
}

.star:nth-child(24) {
    top: 58%;
    left: 12%;
    animation-delay: 2.1s;
}

.star:nth-child(25) {
    top: 72%;
    left: 58%;
    animation-delay: 2.6s;
}

.star:nth-child(26) {
    top: 88%;
    left: 22%;
    animation-delay: 0.1s;
}

.star:nth-child(27) {
    top: 3%;
    left: 92%;
    animation-delay: 0.55s;
}

.star:nth-child(28) {
    top: 48%;
    left: 3%;
    animation-delay: 1.05s;
}

.star:nth-child(29) {
    top: 62%;
    left: 48%;
    animation-delay: 1.55s;
    width: 3px;
    height: 3px;
}

.star:nth-child(30) {
    top: 78%;
    left: 72%;
    animation-delay: 2.05s;
}

@keyframes twinkle {

    0%,
    100% {
        opacity: 0.2;
        transform: scale(1);
    }

    50% {
        opacity: 0.8;
        transform: scale(1.2);
    }
}

/* Shooting Stars - Tunnel Effect */
.shooting-stars {
    position: absolute;
    width: 100%;
    height: 100%;
    perspective: 1000px;
}

.shooting-star {
    position: absolute;
    width: 150px;
    height: 2px;
    background: linear-gradient(90deg, rgba(255, 255, 255, 0.9), rgba(94, 90, 255, 0.6), transparent);
    border-radius: 100px;
    opacity: 0;
    animation: shoot-towards-center 3s ease-out infinite;
}

/* Position shooting stars around the edges, moving towards center */
.shooting-star:nth-child(1) {
    top: 10%;
    left: 0;
    transform: rotate(35deg);
    animation-delay: 0s;
}

.shooting-star:nth-child(2) {
    top: 0;
    left: 70%;
    transform: rotate(120deg);
    animation-delay: 0.8s;
}

.shooting-star:nth-child(3) {
    top: 30%;
    right: 0;
    transform: rotate(-145deg);
    animation-delay: 1.5s;
}

.shooting-star:nth-child(4) {
    bottom: 20%;
    left: 5%;
    transform: rotate(-35deg);
    animation-delay: 2.2s;
}

.shooting-star:nth-child(5) {
    top: 5%;
    left: 20%;
    transform: rotate(55deg);
    animation-delay: 0.4s;
}

.shooting-star:nth-child(6) {
    bottom: 10%;
    right: 10%;
    transform: rotate(-125deg);
    animation-delay: 1.2s;
}

.shooting-star:nth-child(7) {
    top: 50%;
    left: 0;
    transform: rotate(15deg);
    animation-delay: 1.8s;
}

.shooting-star:nth-child(8) {
    top: 20%;
    right: 5%;
    transform: rotate(-160deg);
    animation-delay: 2.5s;
}

@keyframes shoot-towards-center {
    0% {
        opacity: 0;
        transform: translateX(0) translateY(0) scale(1);
    }

    10% {
        opacity: 1;
    }

    70% {
        opacity: 0.6;
    }

    100% {
        opacity: 0;
        transform: translateX(calc(50vw - 50%)) translateY(calc(50vh - 50%)) scale(0.1);
    }
}

/* Central Nebula Glow */
.nebula-glow {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 500px;
    height: 500px;
    background: radial-gradient(ellipse at center,
            rgba(94, 90, 255, 0.15) 0%,
            rgba(94, 90, 255, 0.08) 30%,
            rgba(94, 90, 255, 0.02) 60%,
            transparent 80%);
    border-radius: 50%;
    animation: nebula-pulse 8s ease-in-out infinite;
}

@keyframes nebula-pulse {

    0%,
    100% {
        transform: translate(-50%, -50%) scale(1);
        opacity: 0.8;
    }

    50% {
        transform: translate(-50%, -50%) scale(1.2);
        opacity: 1;
    }
}

/* Cosmic Rings */
.cosmic-ring {
    position: absolute;
    top: 50%;
    left: 50%;
    border: 1px solid rgba(94, 90, 255, 0.1);
    border-radius: 50%;
    transform: translate(-50%, -50%);
}

.cosmic-ring--1 {
    width: 300px;
    height: 300px;
    animation: ring-expand 12s ease-out infinite;
}

.cosmic-ring--2 {
    width: 300px;
    height: 300px;
    animation: ring-expand 12s ease-out infinite 6s;
}

@keyframes ring-expand {
    0% {
        width: 100px;
        height: 100px;
        opacity: 0.5;
        border-color: rgba(94, 90, 255, 0.3);
    }

    100% {
        width: 800px;
        height: 800px;
        opacity: 0;
        border-color: rgba(94, 90, 255, 0);
    }
}

/* =====================================================
   Floating Geometric Elements - SUBTLE
   ===================================================== */
.floating-shape {
    position: absolute;
    border-radius: 50%;
    background: radial-gradient(circle at 30% 30%, rgba(94, 90, 255, 0.04), transparent 70%);
    filter: blur(80px);
    pointer-events: none;
    will-change: transform;
    opacity: 0.5;
}

.floating-shape--1 {
    width: 600px;
    height: 600px;
    top: -20%;
    left: -20%;
    animation: float-shape 30s ease-in-out infinite;
}

.floating-shape--2 {
    width: 400px;
    height: 400px;
    bottom: -10%;
    right: -10%;
    animation: float-shape 35s ease-in-out infinite reverse;
}

.floating-shape--3 {
    display: none;
    /* Remove 3rd shape for cleaner look */
}

@keyframes float-shape {

    0%,
    100% {
        transform: translate(0, 0) scale(1);
    }

    25% {
        transform: translate(30px, -30px) scale(1.1);
    }

    50% {
        transform: translate(-20px, 20px) scale(0.95);
    }

    75% {
        transform: translate(20px, 10px) scale(1.05);
    }
}

/* =====================================================
   Showcase Gallery - Asymmetric Grid
   ===================================================== */
.showcase-gallery {
    display: grid;
    grid-template-columns: repeat(12, 1fr);
    grid-template-rows: repeat(3, auto);
    gap: 2rem;
    padding: 8rem 5vw;
}

.showcase-item {
    position: relative;
    overflow: hidden;
    border-radius: 1.5rem;
    background: linear-gradient(135deg, #111 0%, #1a1a1f 100%);
    min-height: 250px;
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.showcase-item:nth-child(1) {
    grid-column: 1 / 7;
    grid-row: 1 / 3;
}

.showcase-item:nth-child(2) {
    grid-column: 7 / 13;
    grid-row: 1 / 2;
}

.showcase-item:nth-child(3) {
    grid-column: 7 / 10;
    grid-row: 2 / 3;
}

.showcase-item:nth-child(4) {
    grid-column: 10 / 13;
    grid-row: 2 / 3;
}

.showcase-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.8s cubic-bezier(0.16, 1, 0.3, 1);
}

.showcase-item:hover .showcase-image {
    transform: scale(1.05);
}

.showcase-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(to top, rgba(11, 11, 11, 0.9), transparent 50%);
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    padding: 2rem;
    opacity: 0;
    transition: opacity 0.5s ease;
}

.showcase-item:hover .showcase-overlay {
    opacity: 1;
}

/* =====================================================
   Services Cards - Stack Effect
   ===================================================== */
.services-stack {
    position: relative;
    padding: 4rem 5vw 6rem;
}

.service-card {
    position: sticky;
    top: 20vh;
    background: rgba(17, 17, 17, 0.8);
    backdrop-filter: blur(20px);
    border: 1px solid rgba(245, 245, 240, 0.08);
    border-radius: 2rem;
    padding: 3rem;
    margin-bottom: 2rem;
    transition: all 0.5s cubic-bezier(0.16, 1, 0.3, 1);
}

.services-stack .service-card:nth-of-type(1) {
    z-index: 10 !important;
}

.services-stack .service-card:nth-of-type(2) {
    z-index: 20 !important;
    top: 22vh;
}

.services-stack .service-card:nth-of-type(3) {
    z-index: 30 !important;
    top: 24vh;
}

.services-stack .service-card:nth-of-type(4) {
    z-index: 40 !important;
    top: 26vh;
}

.service-card:hover {
    transform: translateY(-10px);
    border-color: rgba(94, 90, 255, 0.3);
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
}

.service-icon {
    width: 60px;
    height: 60px;
    margin-bottom: 1.5rem;
    color: #5E5AFF;
}

.service-title {
    font-size: 1.75rem;
    font-weight: 600;
    color: #F5F5F0;
    margin-bottom: 1rem;
}

.service-description {
    font-size: 1rem;
    color: #8A8A85;
    line-height: 1.7;
}

/* =====================================================
   Process Timeline - Horizontal Scroll
   ===================================================== */
.process-section {
    background: #0A0A0A;
}

.process-step {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    padding: 3rem;
    background: rgba(17, 17, 17, 0.5);
    border: 1px solid rgba(245, 245, 240, 0.05);
    border-radius: 1.5rem;
}

.process-number {
    font-family: 'Inter', sans-serif;
    font-size: 5rem;
    font-weight: 800;
    color: rgba(94, 90, 255, 0.2);
    line-height: 1;
    margin-bottom: 1rem;
}

.process-title {
    font-size: 1.5rem;
    font-weight: 600;
    color: #F5F5F0;
    margin-bottom: 1rem;
}

.process-text {
    font-size: 1rem;
    color: #8A8A85;
    line-height: 1.6;
}

/* =====================================================
   CTA Section - Full Impact
   ===================================================== */
.cta-impact {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
    padding: 4rem 2rem;
    background: radial-gradient(ellipse at center, rgba(94, 90, 255, 0.05) 0%, transparent 60%),
        #0B0B0B;
}

.cta-impact-title {
    font-size: clamp(2.5rem, 8vw, 6rem);
    font-weight: 800;
    color: #F5F5F0;
    line-height: 1.1;
    margin-bottom: 2rem;
}

.cta-impact-subtitle {
    font-size: 1.25rem;
    color: #8A8A85;
    max-width: 500px;
    margin-bottom: 3rem;
}

.cta-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.75rem;
    padding: 1.25rem 2.5rem;
    background: #5E5AFF;
    color: #0B0B0B;
    font-size: 1rem;
    font-weight: 600;
    border: none;
    border-radius: 100px;
    cursor: pointer;
    text-decoration: none;
    transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

.cta-btn:hover {
    transform: scale(1.05);
    box-shadow: 0 0 40px rgba(94, 90, 255, 0.4);
}

.cta-btn svg {
    width: 20px;
    height: 20px;
    transition: transform 0.3s ease;
}

.cta-btn:hover svg {
    transform: translateX(5px);
}

/* =====================================================
   Visual Thread - Connecting Line
   ===================================================== */
.visual-thread {
    position: fixed;
    left: 50%;
    top: 0;
    width: 1px;
    height: 100%;
    background: linear-gradient(to bottom,
            transparent 0%,
            rgba(94, 90, 255, 0.3) 20%,
            rgba(94, 90, 255, 0.1) 80%,
            transparent 100%);
    pointer-events: none;
    z-index: 0;
    opacity: 0.5;
}

/* =====================================================
   Responsive Adjustments
   ===================================================== */
@media (max-width: 768px) {
    .showcase-gallery {
        grid-template-columns: 1fr;
        grid-template-rows: auto;
    }

    .showcase-item:nth-child(n) {
        grid-column: 1;
        grid-row: auto;
    }

    .horizontal-scroll-item {
        width: 85vw;
    }

    .service-card {
        position: relative;
        top: 0 !important;
    }
}

/* =====================================================
   Mobile & Tablet - Disable Horizontal Scroll Effect
   Display process steps vertically for better UX
   ===================================================== */
@media (max-width: 1024px) {

    /* Remove the tall wrapper that enables horizontal scroll */
    .horizontal-scroll-wrapper {
        height: auto !important;
        min-height: auto !important;
    }

    /* Remove sticky positioning */
    .horizontal-scroll-container {
        position: relative !important;
        height: auto !important;
        overflow: visible !important;
        padding: 2rem 0;
    }

    /* Stack items vertically instead of horizontal track */
    .horizontal-scroll-track {
        display: flex !important;
        flex-direction: column !important;
        gap: 1.5rem !important;
        padding: 0 1rem !important;
        transform: none !important;
        transition: none !important;
    }

    /* Full width items stacked vertically */
    .horizontal-scroll-item {
        flex-shrink: 1 !important;
        width: 100% !important;
        max-width: 100% !important;
    }

    /* Style the process steps like cards */
    .horizontal-scroll-item .process-step {
        padding: 2rem;
        margin: 0;
    }

    .process-number {
        font-size: 3rem;
    }

    .process-title {
        font-size: 1.25rem;
    }

    .process-text {
        font-size: 0.95rem;
    }
}

/* =====================================================
   Reduced Motion Support
   ===================================================== */
@media (prefers-reduced-motion: reduce) {
    [data-scroll] {
        opacity: 1;
        transform: none;
        filter: none;
        transition: none;
    }

    .floating-shape {
        animation: none;
    }

    .hero-scroll-indicator {
        animation: none;
    }

    .hero-scroll-indicator::after {
        animation: none;
    }
}