/* =============================================
   VESTADZ - Animations Stylesheet
   Scroll-triggered animations & micro-interactions
   ============================================= */

/* =============================================
   BASE ANIMATION CLASSES
   ============================================= */

/* Fade animations */
.fade-in {
    opacity: 0;
    transition: opacity 0.8s ease;
}

.fade-in.animated {
    opacity: 1;
}

/* Fade with directional slide */
.fade-up {
    opacity: 0;
    transform: translateY(40px);
    transition: opacity 0.8s ease, transform 0.8s ease;
}

.fade-up.animated {
    opacity: 1;
    transform: translateY(0);
}

.fade-down {
    opacity: 0;
    transform: translateY(-40px);
    transition: opacity 0.8s ease, transform 0.8s ease;
}

.fade-down.animated {
    opacity: 1;
    transform: translateY(0);
}

.fade-left {
    opacity: 0;
    transform: translateX(40px);
    transition: opacity 0.8s ease, transform 0.8s ease;
}

.fade-left.animated {
    opacity: 1;
    transform: translateX(0);
}

.fade-right {
    opacity: 0;
    transform: translateX(-40px);
    transition: opacity 0.8s ease, transform 0.8s ease;
}

.fade-right.animated {
    opacity: 1;
    transform: translateX(0);
}

/* Scale animations */
.scale-in {
    opacity: 0;
    transform: scale(0.9);
    transition: opacity 0.8s ease, transform 0.8s ease;
}

.scale-in.animated {
    opacity: 1;
    transform: scale(1);
}

.scale-up {
    opacity: 0;
    transform: scale(0.8) translateY(20px);
    transition: opacity 0.8s ease, transform 0.8s ease;
}

.scale-up.animated {
    opacity: 1;
    transform: scale(1) translateY(0);
}

/* Rotate animations */
.rotate-in {
    opacity: 0;
    transform: rotate(-5deg) scale(0.95);
    transition: opacity 0.8s ease, transform 0.8s ease;
}

.rotate-in.animated {
    opacity: 1;
    transform: rotate(0) scale(1);
}

/* Blur animations */
.blur-in {
    opacity: 0;
    filter: blur(10px);
    transition: opacity 0.8s ease, filter 0.8s ease;
}

.blur-in.animated {
    opacity: 1;
    filter: blur(0);
}

/* Clip animations */
.clip-up {
    clip-path: inset(100% 0 0 0);
    transition: clip-path 0.8s ease;
}

.clip-up.animated {
    clip-path: inset(0 0 0 0);
}

.clip-down {
    clip-path: inset(0 0 100% 0);
    transition: clip-path 0.8s ease;
}

.clip-down.animated {
    clip-path: inset(0 0 0 0);
}

.clip-left {
    clip-path: inset(0 100% 0 0);
    transition: clip-path 0.8s ease;
}

.clip-left.animated {
    clip-path: inset(0 0 0 0);
}

.clip-right {
    clip-path: inset(0 0 0 100%);
    transition: clip-path 0.8s ease;
}

.clip-right.animated {
    clip-path: inset(0 0 0 0);
}

/* =============================================
   STAGGERED ANIMATIONS
   ============================================= */
.stagger-children > * {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.6s ease, transform 0.6s ease;
}

.stagger-children.animated > *:nth-child(1) { transition-delay: 0ms; }
.stagger-children.animated > *:nth-child(2) { transition-delay: 100ms; }
.stagger-children.animated > *:nth-child(3) { transition-delay: 200ms; }
.stagger-children.animated > *:nth-child(4) { transition-delay: 300ms; }
.stagger-children.animated > *:nth-child(5) { transition-delay: 400ms; }
.stagger-children.animated > *:nth-child(6) { transition-delay: 500ms; }
.stagger-children.animated > *:nth-child(7) { transition-delay: 600ms; }
.stagger-children.animated > *:nth-child(8) { transition-delay: 700ms; }
.stagger-children.animated > *:nth-child(9) { transition-delay: 800ms; }
.stagger-children.animated > *:nth-child(10) { transition-delay: 900ms; }

.stagger-children.animated > * {
    opacity: 1;
    transform: translateY(0);
}

/* Grid stagger - for card grids */
.stagger-grid > * {
    opacity: 0;
    transform: translateY(40px) scale(0.95);
    transition: opacity 0.6s ease, transform 0.6s ease;
}

.stagger-grid.animated > *:nth-child(1) { transition-delay: 0ms; }
.stagger-grid.animated > *:nth-child(2) { transition-delay: 80ms; }
.stagger-grid.animated > *:nth-child(3) { transition-delay: 160ms; }
.stagger-grid.animated > *:nth-child(4) { transition-delay: 240ms; }
.stagger-grid.animated > *:nth-child(5) { transition-delay: 320ms; }
.stagger-grid.animated > *:nth-child(6) { transition-delay: 400ms; }

.stagger-grid.animated > * {
    opacity: 1;
    transform: translateY(0) scale(1);
}

/* =============================================
   ANIMATION DELAYS
   ============================================= */
.delay-100 { transition-delay: 100ms !important; }
.delay-200 { transition-delay: 200ms !important; }
.delay-300 { transition-delay: 300ms !important; }
.delay-400 { transition-delay: 400ms !important; }
.delay-500 { transition-delay: 500ms !important; }
.delay-600 { transition-delay: 600ms !important; }
.delay-700 { transition-delay: 700ms !important; }
.delay-800 { transition-delay: 800ms !important; }

/* =============================================
   ANIMATION DURATIONS
   ============================================= */
.duration-fast { transition-duration: 0.4s !important; }
.duration-normal { transition-duration: 0.6s !important; }
.duration-slow { transition-duration: 0.8s !important; }
.duration-slower { transition-duration: 1s !important; }
.duration-slowest { transition-duration: 1.2s !important; }

/* =============================================
   HERO ANIMATIONS
   ============================================= */

/* Hero badge animation */
.hero__badge {
    opacity: 0;
    transform: translateY(20px);
    animation: heroFadeUp 0.8s ease forwards;
    animation-delay: 0.2s;
}

/* Hero title animation */
.hero__title {
    opacity: 0;
    animation: heroTitleReveal 1s ease forwards;
    animation-delay: 0.4s;
}

.hero__title .word {
    display: inline-block;
    opacity: 0;
    transform: translateY(100%);
}

/* Hero subtitle animation */
.hero__subtitle {
    opacity: 0;
    transform: translateY(20px);
    animation: heroFadeUp 0.8s ease forwards;
    animation-delay: 0.8s;
}

/* Hero CTA animation */
.hero__cta {
    opacity: 0;
    transform: translateY(20px);
    animation: heroFadeUp 0.8s ease forwards;
    animation-delay: 1s;
}

/* Hero scroll indicator */
.hero__scroll {
    opacity: 0;
    animation: heroFadeUp 0.8s ease forwards;
    animation-delay: 1.2s;
}

@keyframes heroFadeUp {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes heroTitleReveal {
    to {
        opacity: 1;
    }
}

/* Split text animation */
.split-text .char {
    display: inline-block;
    opacity: 0;
    transform: translateY(100%);
    animation: charReveal 0.6s ease forwards;
}

@keyframes charReveal {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* =============================================
   TEXT REVEAL ANIMATIONS
   ============================================= */

/* Line reveal */
.line-reveal {
    overflow: hidden;
}

.line-reveal span {
    display: block;
    transform: translateY(100%);
    transition: transform 0.8s cubic-bezier(0.77, 0, 0.175, 1);
}

.line-reveal.animated span {
    transform: translateY(0);
}

/* Mask reveal */
.mask-reveal {
    position: relative;
    overflow: hidden;
}

.mask-reveal::after {
    content: '';
    position: absolute;
    inset: 0;
    background-color: var(--color-primary);
    transform: scaleX(1);
    transform-origin: right;
    transition: transform 0.8s cubic-bezier(0.77, 0, 0.175, 1);
}

.mask-reveal.animated::after {
    transform: scaleX(0);
}

/* Type effect */
.type-effect {
    border-right: 2px solid var(--color-primary);
    white-space: nowrap;
    overflow: hidden;
    animation: typing 3s steps(40) 1s forwards, blink 0.75s step-end infinite;
    width: 0;
}

@keyframes typing {
    to {
        width: 100%;
    }
}

@keyframes blink {
    50% {
        border-color: transparent;
    }
}

/* =============================================
   IMAGE ANIMATIONS
   ============================================= */

/* Image reveal */
.img-reveal {
    position: relative;
    overflow: hidden;
}

.img-reveal::before {
    content: '';
    position: absolute;
    inset: 0;
    background-color: var(--bg-primary);
    z-index: 1;
    transform: scaleY(1);
    transform-origin: top;
    transition: transform 1s cubic-bezier(0.77, 0, 0.175, 1);
}

.img-reveal.animated::before {
    transform: scaleY(0);
    transform-origin: bottom;
}

.img-reveal img {
    transform: scale(1.2);
    transition: transform 1.2s cubic-bezier(0.77, 0, 0.175, 1);
}

.img-reveal.animated img {
    transform: scale(1);
}

/* Parallax image */
.parallax-container {
    overflow: hidden;
}

.parallax-img {
    will-change: transform;
    transform: translateY(0);
    transition: transform 0.1s linear;
}

/* Tilt effect on hover */
.tilt-effect {
    transform-style: preserve-3d;
    perspective: 1000px;
}

/* Ken Burns effect */
.ken-burns {
    overflow: hidden;
}

.ken-burns img {
    animation: kenBurns 20s ease infinite alternate;
}

@keyframes kenBurns {
    0% {
        transform: scale(1) translate(0, 0);
    }
    100% {
        transform: scale(1.1) translate(-2%, -2%);
    }
}

/* =============================================
   CARD ANIMATIONS
   ============================================= */

/* Card hover lift */
.card-hover {
    transition: transform 0.4s ease, box-shadow 0.4s ease;
}

.card-hover:hover {
    transform: translateY(-8px);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
}

/* Card border animation */
.card-border-anim {
    position: relative;
}

.card-border-anim::before {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: inherit;
    padding: 2px;
    background: linear-gradient(135deg, var(--color-primary), transparent, var(--color-primary));
    -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    -webkit-mask-composite: xor;
    mask-composite: exclude;
    opacity: 0;
    transition: opacity 0.4s ease;
}

.card-border-anim:hover::before {
    opacity: 1;
}

/* Card shine effect */
.card-shine {
    position: relative;
    overflow: hidden;
}

.card-shine::after {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: linear-gradient(
        to bottom right,
        transparent 40%,
        rgba(255, 255, 255, 0.1) 50%,
        transparent 60%
    );
    transform: rotate(45deg) translateX(-100%);
    transition: transform 0.6s ease;
}

.card-shine:hover::after {
    transform: rotate(45deg) translateX(100%);
}

/* =============================================
   BUTTON ANIMATIONS
   ============================================= */

/* Button ripple effect */
.btn-ripple {
    position: relative;
    overflow: hidden;
}

.btn-ripple::after {
    content: '';
    position: absolute;
    width: 100%;
    height: 100%;
    top: 0;
    left: 0;
    background: radial-gradient(circle, rgba(255, 255, 255, 0.3) 0%, transparent 60%);
    transform: scale(0);
    opacity: 0;
    transition: transform 0.5s ease, opacity 0.5s ease;
}

.btn-ripple:active::after {
    transform: scale(2);
    opacity: 1;
    transition: 0s;
}

/* Button slide effect */
.btn-slide {
    position: relative;
    overflow: hidden;
    z-index: 1;
}

.btn-slide::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: var(--color-primary-dark);
    transform: scaleX(0);
    transform-origin: right;
    transition: transform 0.4s ease;
    z-index: -1;
}

.btn-slide:hover::before {
    transform: scaleX(1);
    transform-origin: left;
}

/* Button magnetic effect container */
.btn-magnetic {
    display: inline-block;
    cursor: pointer;
}

/* =============================================
   LINK ANIMATIONS
   ============================================= */

/* Underline slide */
.link-underline {
    position: relative;
}

.link-underline::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    width: 100%;
    height: 2px;
    background-color: var(--color-primary);
    transform: scaleX(0);
    transform-origin: right;
    transition: transform 0.4s ease;
}

.link-underline:hover::after {
    transform: scaleX(1);
    transform-origin: left;
}

/* Underline expand */
.link-expand {
    position: relative;
}

.link-expand::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 50%;
    width: 0;
    height: 2px;
    background-color: var(--color-primary);
    transition: width 0.4s ease, left 0.4s ease;
}

.link-expand:hover::after {
    width: 100%;
    left: 0;
}

/* Link highlight */
.link-highlight {
    background: linear-gradient(transparent 60%, rgba(174, 0, 121, 0.2) 60%);
    transition: background 0.3s ease;
}

.link-highlight:hover {
    background: linear-gradient(transparent 60%, rgba(174, 0, 121, 0.4) 60%);
}

/* =============================================
   LOADING ANIMATIONS
   ============================================= */

/* Page loader */
.page-loader {
    position: fixed;
    inset: 0;
    background-color: var(--bg-primary);
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: opacity 0.5s ease, visibility 0.5s ease;
}

.page-loader.loaded {
    opacity: 0;
    visibility: hidden;
}

/* Logo loader */
.logo-loader {
    width: 80px;
    height: 80px;
    position: relative;
}

.logo-loader::before {
    content: 'V';
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: var(--font-display);
    font-size: 2rem;
    font-weight: 700;
    color: var(--color-primary);
    animation: logoScale 1.5s ease-in-out infinite;
}

.logo-loader::after {
    content: '';
    position: absolute;
    inset: 0;
    border: 3px solid transparent;
    border-top-color: var(--color-primary);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes logoScale {
    0%, 100% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.1);
    }
}

/* Dots loader */
.dots-loader {
    display: flex;
    gap: 8px;
}

.dots-loader span {
    width: 12px;
    height: 12px;
    background-color: var(--color-primary);
    border-radius: 50%;
    animation: dotBounce 1.4s ease-in-out infinite both;
}

.dots-loader span:nth-child(1) { animation-delay: -0.32s; }
.dots-loader span:nth-child(2) { animation-delay: -0.16s; }
.dots-loader span:nth-child(3) { animation-delay: 0s; }

@keyframes dotBounce {
    0%, 80%, 100% {
        transform: scale(0);
    }
    40% {
        transform: scale(1);
    }
}

/* Progress bar loader */
.progress-loader {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 3px;
    background-color: var(--color-gray-800);
    z-index: 9999;
}

.progress-loader__bar {
    height: 100%;
    background-color: var(--color-primary);
    width: 0;
    transition: width 0.3s ease;
}

/* =============================================
   COUNTER ANIMATIONS
   ============================================= */

/* Number counter */
.counter {
    font-variant-numeric: tabular-nums;
}

/* =============================================
   SCROLL-TRIGGERED SPECIFIC ANIMATIONS
   ============================================= */

/* Section divider animation */
.section-divider {
    width: 100%;
    height: 1px;
    background: linear-gradient(90deg, transparent, var(--color-gray-700), transparent);
    transform: scaleX(0);
    transition: transform 1s ease;
}

.section-divider.animated {
    transform: scaleX(1);
}

/* Process line animation */
.process-line {
    position: absolute;
    left: 24px;
    top: 0;
    width: 2px;
    height: 0;
    background: linear-gradient(to bottom, var(--color-primary), var(--color-gray-800));
    transition: height 1.5s ease;
}

.process-line.animated {
    height: 100%;
}

/* Skills bar animation */
.skill-bar {
    height: 8px;
    background-color: var(--color-gray-800);
    border-radius: var(--radius-full);
    overflow: hidden;
}

.skill-bar__fill {
    height: 100%;
    background-color: var(--color-primary);
    border-radius: var(--radius-full);
    width: 0;
    transition: width 1.5s ease;
}

.skill-bar__fill.animated {
    width: var(--skill-level, 0%);
}

/* =============================================
   HOVER MICRO-INTERACTIONS
   ============================================= */

/* Icon bounce */
.icon-bounce {
    transition: transform 0.3s ease;
}

.icon-bounce:hover {
    animation: iconBounce 0.6s ease;
}

@keyframes iconBounce {
    0%, 100% { transform: translateY(0); }
    25% { transform: translateY(-6px); }
    50% { transform: translateY(0); }
    75% { transform: translateY(-3px); }
}

/* Icon rotate */
.icon-rotate {
    transition: transform 0.4s ease;
}

.icon-rotate:hover {
    transform: rotate(360deg);
}

/* Arrow move */
.arrow-move {
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.arrow-move .arrow {
    transition: transform 0.3s ease;
}

.arrow-move:hover .arrow {
    transform: translateX(4px);
}

/* =============================================
   MENU ANIMATIONS
   ============================================= */

/* Menu slide down */
.menu-slide {
    opacity: 0;
    transform: translateY(-10px);
    visibility: hidden;
    transition: opacity 0.3s ease, transform 0.3s ease, visibility 0.3s ease;
}

.menu-slide.active {
    opacity: 1;
    transform: translateY(0);
    visibility: visible;
}

/* Mobile menu animation */
.mobile-nav__link {
    transition: opacity 0.4s ease, transform 0.4s ease;
}

.mobile-nav.active .mobile-nav__link:nth-child(1) { transition-delay: 0.1s; }
.mobile-nav.active .mobile-nav__link:nth-child(2) { transition-delay: 0.15s; }
.mobile-nav.active .mobile-nav__link:nth-child(3) { transition-delay: 0.2s; }
.mobile-nav.active .mobile-nav__link:nth-child(4) { transition-delay: 0.25s; }
.mobile-nav.active .mobile-nav__link:nth-child(5) { transition-delay: 0.3s; }
.mobile-nav.active .mobile-nav__link:nth-child(6) { transition-delay: 0.35s; }

/* =============================================
   CURSOR EFFECTS
   ============================================= */

/* Custom cursor (if desired) */
.custom-cursor {
    position: fixed;
    width: 20px;
    height: 20px;
    border: 2px solid var(--color-primary);
    border-radius: 50%;
    pointer-events: none;
    z-index: 10000;
    transition: transform 0.15s ease, opacity 0.15s ease;
    transform: translate(-50%, -50%);
}

.custom-cursor.hover {
    transform: translate(-50%, -50%) scale(1.5);
    background-color: rgba(174, 0, 121, 0.1);
}

.custom-cursor.click {
    transform: translate(-50%, -50%) scale(0.8);
}

/* =============================================
   BACKGROUND ANIMATIONS
   ============================================= */

/* Gradient animation */
.gradient-animate {
    background: linear-gradient(
        -45deg,
        var(--bg-primary),
        var(--bg-secondary),
        rgba(174, 0, 121, 0.1),
        var(--bg-primary)
    );
    background-size: 400% 400%;
    animation: gradientShift 15s ease infinite;
}

@keyframes gradientShift {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

/* Floating particles */
.particle {
    position: absolute;
    width: 4px;
    height: 4px;
    background-color: var(--color-primary);
    border-radius: 50%;
    opacity: 0.3;
    animation: particleFloat 20s linear infinite;
}

@keyframes particleFloat {
    0% {
        transform: translateY(100vh) rotate(0deg);
        opacity: 0;
    }
    10% {
        opacity: 0.3;
    }
    90% {
        opacity: 0.3;
    }
    100% {
        transform: translateY(-100vh) rotate(720deg);
        opacity: 0;
    }
}

/* Pulse ring */
.pulse-ring {
    position: relative;
}

.pulse-ring::before {
    content: '';
    position: absolute;
    inset: -10px;
    border: 2px solid var(--color-primary);
    border-radius: 50%;
    animation: pulseRing 2s ease-out infinite;
}

@keyframes pulseRing {
    0% {
        transform: scale(0.8);
        opacity: 1;
    }
    100% {
        transform: scale(1.5);
        opacity: 0;
    }
}

/* =============================================
   TRANSITION CLASSES
   ============================================= */

/* Page transition overlay */
.page-transition {
    position: fixed;
    inset: 0;
    background-color: var(--color-primary);
    z-index: 9999;
    transform: scaleY(0);
    transform-origin: bottom;
}

.page-transition.enter {
    animation: pageEnter 0.5s ease forwards;
}

.page-transition.exit {
    animation: pageExit 0.5s ease forwards;
}

@keyframes pageEnter {
    0% {
        transform: scaleY(0);
        transform-origin: bottom;
    }
    100% {
        transform: scaleY(1);
        transform-origin: bottom;
    }
}

@keyframes pageExit {
    0% {
        transform: scaleY(1);
        transform-origin: top;
    }
    100% {
        transform: scaleY(0);
        transform-origin: top;
    }
}

/* =============================================
   SPECIAL EFFECTS
   ============================================= */

/* Glitch effect */
.glitch {
    position: relative;
}

.glitch::before,
.glitch::after {
    content: attr(data-text);
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

.glitch::before {
    left: 2px;
    text-shadow: -2px 0 var(--color-primary);
    clip: rect(24px, 550px, 90px, 0);
    animation: glitch-1 2s infinite linear alternate-reverse;
}

.glitch::after {
    left: -2px;
    text-shadow: -2px 0 #00ffff;
    clip: rect(85px, 550px, 140px, 0);
    animation: glitch-2 2s infinite linear alternate-reverse;
}

@keyframes glitch-1 {
    0% { clip: rect(132px, 350px, 101px, 30px); }
    20% { clip: rect(15px, 350px, 35px, 30px); }
    40% { clip: rect(85px, 350px, 140px, 30px); }
    60% { clip: rect(45px, 350px, 75px, 30px); }
    80% { clip: rect(95px, 350px, 115px, 30px); }
    100% { clip: rect(25px, 350px, 65px, 30px); }
}

@keyframes glitch-2 {
    0% { clip: rect(65px, 350px, 119px, 30px); }
    20% { clip: rect(79px, 350px, 99px, 30px); }
    40% { clip: rect(45px, 350px, 75px, 30px); }
    60% { clip: rect(15px, 350px, 35px, 30px); }
    80% { clip: rect(105px, 350px, 140px, 30px); }
    100% { clip: rect(85px, 350px, 95px, 30px); }
}

/* Noise overlay */
.noise-overlay {
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 9998;
    opacity: 0.03;
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.65' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%' height='100%' filter='url(%23noise)'/%3E%3C/svg%3E");
}
