/*
======================================================
   WASEEM PORTFOLIO - GSAP SCROLL ANIMATIONS
   Advanced ScrollTrigger-based animations
   10 Unique Styles for Each Landing Page Variation
   Version: 2026.2.0
======================================================
*/

/* ============================================
   GLOBAL SCROLL ANIMATION FOUNDATIONS
   ============================================ */

/* Smooth scrolling behavior */
html.lenis, html.lenis body {
    height: auto;
}

.lenis.lenis-smooth {
    scroll-behavior: auto !important;
}

.lenis.lenis-smooth [data-lenis-prevent] {
    overscroll-behavior: contain;
}

.lenis.lenis-stopped {
    overflow: hidden;
}

/* Initial states for scroll-triggered elements */
[data-gsap] {
    will-change: transform, opacity;
}

[data-gsap="fade-up"] {
    opacity: 0;
    transform: translateY(100px);
}

[data-gsap="fade-down"] {
    opacity: 0;
    transform: translateY(-100px);
}

[data-gsap="fade-left"] {
    opacity: 0;
    transform: translateX(100px);
}

[data-gsap="fade-right"] {
    opacity: 0;
    transform: translateX(-100px);
}

[data-gsap="scale-up"] {
    opacity: 0;
    transform: scale(0.8);
}

[data-gsap="rotate-in"] {
    opacity: 0;
    transform: rotate(-15deg) scale(0.9);
}

[data-gsap="clip-up"] {
    clip-path: inset(100% 0 0 0);
}

[data-gsap="clip-down"] {
    clip-path: inset(0 0 100% 0);
}

[data-gsap="blur-in"] {
    opacity: 0;
    filter: blur(20px);
}

/* ============================================
   SCROLL PROGRESS INDICATOR
   ============================================ */
.scroll-progress-bar {
    position: fixed;
    top: 0;
    left: 0;
    width: 0%;
    height: 3px;
    background: linear-gradient(90deg, #667eea, #764ba2, #f093fb, #f5576c, #4facfe);
    background-size: 200% 100%;
    animation: gradientMove 3s ease infinite;
    z-index: 9999;
    transform-origin: left;
}

@keyframes gradientMove {
    0%, 100% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
}

/* ============================================
   PINNED SECTION STYLES
   ============================================ */
.scroll-pin-section {
    position: relative;
    overflow: hidden;
}

.scroll-pin-content {
    position: sticky;
    top: 0;
    height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* ============================================
   V1 - HERO SPOTLIGHT: CINEMATIC PARALLAX
   Split-scroll hero with text reveal
   ============================================ */
.waseem-v1-spotlight .v1-hero {
    overflow: hidden;
}

.v1-hero-parallax-layer {
    position: absolute;
    inset: 0;
    will-change: transform;
}

.v1-hero-parallax-layer.layer-1 { z-index: 1; }
.v1-hero-parallax-layer.layer-2 { z-index: 2; }
.v1-hero-parallax-layer.layer-3 { z-index: 3; }

.v1-text-reveal {
    overflow: hidden;
    display: inline-block;
}

.v1-text-reveal .word {
    display: inline-block;
    transform: translateY(100%);
    opacity: 0;
}

.v1-hero-mask {
    position: absolute;
    inset: 0;
    background: linear-gradient(to bottom, transparent 0%, var(--waseem-dark) 100%);
    transform-origin: bottom;
}

.v1-section-transition {
    position: relative;
    min-height: 200vh;
}

.v1-sticky-content {
    position: sticky;
    top: 0;
    height: 100vh;
}

/* ============================================
   V2 - BENTO GRID: 3D CARD REVEALS
   Staggered floating card animations
   ============================================ */
.waseem-v2-bento .bento-card {
    transform: perspective(1000px) translateZ(0);
    transition: transform 0.1s linear;
}

.bento-card[data-gsap-3d] {
    opacity: 0;
    transform: perspective(1000px) rotateX(20deg) rotateY(-10deg) translateZ(-100px);
}

.bento-float-particle {
    position: absolute;
    width: 6px;
    height: 6px;
    background: rgba(139, 92, 246, 0.6);
    border-radius: 50%;
    pointer-events: none;
}

.bento-grid-line {
    position: absolute;
    background: linear-gradient(90deg, transparent, rgba(139, 92, 246, 0.2), transparent);
    height: 1px;
    width: 100%;
    transform: scaleX(0);
    transform-origin: left;
}

/* ============================================
   V3 - TIMELINE: HORIZONTAL SCROLL
   Path drawing animation with journey cards
   ============================================ */
.waseem-v3-timeline .timeline-horizontal {
    overflow-x: hidden;
}

.timeline-track {
    display: flex;
    width: fit-content;
    gap: var(--space-8);
    padding: var(--space-16) var(--space-8);
}

.timeline-path-svg {
    position: absolute;
    top: 50%;
    left: 0;
    width: 100%;
    height: 4px;
    overflow: visible;
}

.timeline-path-svg path {
    stroke: url(#timelineGradient);
    stroke-width: 4;
    stroke-linecap: round;
    fill: none;
    stroke-dasharray: 2000;
    stroke-dashoffset: 2000;
}

.timeline-card {
    flex-shrink: 0;
    width: 400px;
    opacity: 0;
    transform: translateY(50px) scale(0.9);
}

.timeline-marker {
    width: 24px;
    height: 24px;
    background: var(--v3-gradient-aurora);
    border-radius: 50%;
    position: relative;
    transform: scale(0);
}

.timeline-marker::after {
    content: '';
    position: absolute;
    inset: -8px;
    border: 2px solid rgba(139, 92, 246, 0.3);
    border-radius: 50%;
    animation: markerPulse 2s ease-in-out infinite;
}

@keyframes markerPulse {
    0%, 100% { transform: scale(1); opacity: 1; }
    50% { transform: scale(1.5); opacity: 0; }
}

/* ============================================
   V4 - DARK MINIMAL: SUBTLE REVEALS
   Elegant fade with text pinning
   ============================================ */
.waseem-v4-minimal [data-gsap-minimal] {
    opacity: 0;
    transform: translateY(30px);
}

.v4-pin-text {
    position: sticky;
    top: 50%;
    transform: translateY(-50%);
}

.v4-accent-line {
    width: 0;
    height: 3px;
    background: var(--v4-gradient-aurora);
    transition: width 0.8s cubic-bezier(0.16, 1, 0.3, 1);
}

.v4-accent-line.active {
    width: 60px;
}

.v4-reveal-mask {
    overflow: hidden;
}

.v4-reveal-mask > * {
    transform: translateY(100%);
    opacity: 0;
}

/* ============================================
   V5 - GRADIENT FLOW: MORPHING SHAPES
   Color transitions and blob morphing
   ============================================ */
.waseem-v5-gradient .gradient-morph {
    position: absolute;
    border-radius: 50%;
    filter: blur(100px);
    mix-blend-mode: screen;
    will-change: transform, border-radius;
}

.gradient-morph-1 {
    width: 500px;
    height: 500px;
    background: rgba(139, 92, 246, 0.4);
}

.gradient-morph-2 {
    width: 400px;
    height: 400px;
    background: rgba(236, 72, 153, 0.4);
}

.gradient-morph-3 {
    width: 300px;
    height: 300px;
    background: rgba(6, 182, 212, 0.4);
}

.v5-color-shift {
    transition: background 0.5s ease;
}

.v5-wave-reveal {
    clip-path: polygon(0 100%, 100% 100%, 100% 100%, 0 100%);
}

/* ============================================
   V6 - PROJECT SHOWCASE: GALLERY SCROLL
   Image zoom/pan with case study reveals
   ============================================ */
.waseem-v6-showcase .showcase-gallery {
    position: relative;
}

.showcase-item {
    position: relative;
    overflow: hidden;
}

.showcase-item-image {
    transform: scale(1.2);
    transition: transform 0.1s linear;
}

.showcase-item-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(to top, rgba(0, 0, 0, 0.8), transparent);
    opacity: 0;
}

.showcase-item-content {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: var(--space-8);
    transform: translateY(100%);
}

.showcase-counter {
    font-size: clamp(4rem, 15vw, 12rem);
    font-weight: 900;
    -webkit-text-stroke: 2px rgba(139, 92, 246, 0.3);
    color: transparent;
    position: absolute;
    right: var(--space-8);
    top: 50%;
    transform: translateY(-50%);
    opacity: 0.1;
}

/* ============================================
   V7 - SPLIT SCREEN: DUAL PANEL SCROLL
   Opposing direction panels
   ============================================ */
.waseem-v7-split .split-container {
    display: flex;
    min-height: 100vh;
}

.split-panel {
    flex: 1;
    position: relative;
    overflow: hidden;
}

.split-panel-left .split-inner {
    will-change: transform;
}

.split-panel-right .split-inner {
    will-change: transform;
}

.split-reveal-line {
    position: absolute;
    top: 0;
    bottom: 0;
    width: 2px;
    background: var(--v7-gradient-aurora);
    left: 50%;
    transform: scaleY(0);
    transform-origin: top;
}

.split-content-block {
    opacity: 0;
    transform: translateX(-50px);
}

.split-panel-right .split-content-block {
    transform: translateX(50px);
}

/* ============================================
   V8 - TECH STACK: INFINITE MARQUEE
   Skill card reveals with floating badges
   ============================================ */
.waseem-v8-tech .tech-marquee {
    overflow: hidden;
    white-space: nowrap;
}

.tech-marquee-track {
    display: flex;
    animation: marquee 30s linear infinite;
}

.tech-marquee:hover .tech-marquee-track {
    animation-play-state: paused;
}

@keyframes marquee {
    0% { transform: translateX(0); }
    100% { transform: translateX(-50%); }
}

.tech-card {
    opacity: 0;
    transform: translateY(80px) rotateX(15deg);
    transform-origin: bottom;
}

.tech-orbit {
    position: absolute;
    width: 400px;
    height: 400px;
    border: 1px dashed rgba(139, 92, 246, 0.2);
    border-radius: 50%;
    animation: orbitRotate 20s linear infinite;
}

@keyframes orbitRotate {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

.tech-badge {
    position: absolute;
    padding: var(--space-2) var(--space-4);
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-full);
    font-size: var(--text-sm);
    white-space: nowrap;
    opacity: 0;
    transform: scale(0.5);
}

/* ============================================
   V9 - KINETIC TEXT: TYPOGRAPHY MOTION
   Large text split and movement
   ============================================ */
.waseem-v9-kinetic .kinetic-text {
    font-size: clamp(4rem, 15vw, 12rem);
    font-weight: 900;
    line-height: 0.9;
    overflow: hidden;
}

.kinetic-char {
    display: inline-block;
    will-change: transform;
}

.kinetic-line {
    overflow: hidden;
    display: block;
}

.kinetic-word {
    display: inline-block;
    transform: translateY(100%);
    opacity: 0;
}

.kinetic-scrub-text {
    position: sticky;
    top: 50%;
    transform: translateY(-50%);
}

.kinetic-counter {
    font-variant-numeric: tabular-nums;
    font-weight: 700;
}

.kinetic-stroke-text {
    -webkit-text-stroke: 2px currentColor;
    color: transparent;
}

.kinetic-fill-text {
    position: absolute;
    top: 0;
    left: 0;
    clip-path: inset(0 100% 0 0);
}

/* ============================================
   V10 - PARALLAX LAYERS: MULTI-DEPTH 3D
   Layered depth with perspective
   ============================================ */
.waseem-v10-parallax {
    perspective: 1000px;
    perspective-origin: center;
}

.parallax-layer {
    position: absolute;
    inset: 0;
    will-change: transform;
    transform-style: preserve-3d;
}

.parallax-layer-bg { z-index: 1; transform: translateZ(-200px) scale(1.2); }
.parallax-layer-mid { z-index: 2; transform: translateZ(-100px) scale(1.1); }
.parallax-layer-front { z-index: 3; transform: translateZ(0); }
.parallax-layer-hero { z-index: 4; transform: translateZ(50px) scale(0.95); }

.parallax-card {
    transform-style: preserve-3d;
    transition: transform 0.3s ease;
}

.parallax-card:hover {
    transform: translateZ(30px);
}

.parallax-depth-indicator {
    position: fixed;
    right: var(--space-6);
    top: 50%;
    transform: translateY(-50%);
    display: flex;
    flex-direction: column;
    gap: var(--space-2);
    z-index: 100;
}

.parallax-depth-dot {
    width: 8px;
    height: 8px;
    background: rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    transition: all 0.3s ease;
}

.parallax-depth-dot.active {
    background: var(--v10-accent-purple);
    transform: scale(1.5);
}

/* ============================================
   SCROLL INDICATOR ANIMATIONS
   ============================================ */
.scroll-indicator {
    position: absolute;
    bottom: var(--space-8);
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--space-3);
    opacity: 1;
    transition: opacity 0.5s ease;
}

.scroll-indicator.hidden {
    opacity: 0;
    pointer-events: none;
}

.scroll-mouse {
    width: 26px;
    height: 42px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 15px;
    position: relative;
}

.scroll-wheel {
    width: 4px;
    height: 8px;
    background: var(--waseem-accent, #8b5cf6);
    border-radius: 2px;
    position: absolute;
    top: 8px;
    left: 50%;
    transform: translateX(-50%);
    animation: scrollWheel 2s ease-in-out infinite;
}

@keyframes scrollWheel {
    0%, 100% { opacity: 1; transform: translateX(-50%) translateY(0); }
    50% { opacity: 0.3; transform: translateX(-50%) translateY(12px); }
}

.scroll-text {
    font-size: var(--text-xs);
    color: var(--gray-500);
    text-transform: uppercase;
    letter-spacing: 0.15em;
}

.scroll-arrow {
    animation: scrollArrow 1.5s ease-in-out infinite;
}

@keyframes scrollArrow {
    0%, 100% { transform: translateY(0); opacity: 1; }
    50% { transform: translateY(8px); opacity: 0.5; }
}

/* ============================================
   LOADING STATES FOR SCROLL ANIMATIONS
   ============================================ */
.scroll-loading {
    position: fixed;
    inset: 0;
    background: var(--waseem-dark);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    opacity: 1;
    transition: opacity 0.5s ease;
}

.scroll-loading.loaded {
    opacity: 0;
    pointer-events: none;
}

.scroll-loader {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--space-6);
}

.scroll-loader-ring {
    width: 60px;
    height: 60px;
    border: 3px solid rgba(139, 92, 246, 0.1);
    border-top-color: var(--v1-accent-purple);
    border-radius: 50%;
    animation: loaderSpin 1s linear infinite;
}

@keyframes loaderSpin {
    to { transform: rotate(360deg); }
}

.scroll-loader-text {
    font-size: var(--text-sm);
    color: var(--gray-400);
    letter-spacing: 0.1em;
}

/* ============================================
   SECTION TRANSITIONS
   ============================================ */
.section-divider {
    height: 200px;
    position: relative;
    overflow: hidden;
}

.section-divider-wave {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 200%;
    height: 100%;
}

.section-divider-wave path {
    fill: var(--waseem-darker);
}

.section-overlap {
    margin-top: -100px;
    position: relative;
    z-index: 10;
}

/* ============================================
   SCROLL-TRIGGERED COUNTERS
   ============================================ */
.scroll-counter {
    font-variant-numeric: tabular-nums;
    font-weight: 700;
}

.scroll-counter-wrapper {
    overflow: hidden;
    display: inline-flex;
}

.scroll-counter-digit {
    display: inline-flex;
    flex-direction: column;
}

/* ============================================
   MOBILE OPTIMIZATIONS
   ============================================ */
@media (max-width: 768px) {
    [data-gsap] {
        transform: none !important;
        opacity: 1 !important;
    }

    .waseem-scroll-animations .scroll-pin-section {
        height: auto !important;
    }

    .waseem-scroll-animations .scroll-pin-content {
        position: relative !important;
        height: auto !important;
    }

    .timeline-track {
        flex-direction: column;
        width: 100%;
    }

    .timeline-card {
        width: 100%;
        max-width: 100%;
    }

    .split-container {
        flex-direction: column;
    }

    .kinetic-text {
        font-size: clamp(2rem, 10vw, 4rem);
    }

    .parallax-layer {
        transform: none !important;
    }

    .tech-marquee-track {
        animation-duration: 60s;
    }
}

/* ============================================
   REDUCED MOTION SUPPORT
   ============================================ */
@media (prefers-reduced-motion: reduce) {
    [data-gsap],
    .scroll-progress-bar,
    .scroll-wheel,
    .tech-marquee-track,
    .tech-orbit,
    .timeline-marker::after {
        animation: none !important;
        transition: none !important;
    }

    [data-gsap] {
        opacity: 1 !important;
        transform: none !important;
        filter: none !important;
        clip-path: none !important;
    }
}

/* ============================================
   GPU ACCELERATION HINTS
   ============================================ */
.waseem-scroll-animations [data-gsap],
.waseem-scroll-animations .parallax-layer,
.waseem-scroll-animations .kinetic-char,
.waseem-scroll-animations .bento-card,
.waseem-scroll-animations .showcase-item-image {
    backface-visibility: hidden;
    -webkit-backface-visibility: hidden;
}
