/*
 * Sannidhya Portfolio - Animations Stylesheet
 * Theme: Wheel of Time - Flowing Threads
 */

/* Splitting.js Text Animations */
.word, .char {
    display: inline-block;
}

/* General splitting animation for all elements with data-splitting */
[data-splitting]:not(.hero-title):not(.hero-subtitle) .char {
    opacity: 0;
    transform: translateY(40px);
    transition: transform 0.8s cubic-bezier(0.3, 0, 0.2, 1), opacity 0.8s cubic-bezier(0.3, 0, 0.2, 1);
}

[data-splitting]:not(.hero-title):not(.hero-subtitle).animate .char {
    opacity: 1;
    transform: translateY(0);
}

/* Staggered character animation delays */
[data-splitting] .char:nth-child(1) { transition-delay: 0.02s; }
[data-splitting] .char:nth-child(2) { transition-delay: 0.04s; }
[data-splitting] .char:nth-child(3) { transition-delay: 0.06s; }
[data-splitting] .char:nth-child(4) { transition-delay: 0.08s; }
[data-splitting] .char:nth-child(5) { transition-delay: 0.10s; }
[data-splitting] .char:nth-child(6) { transition-delay: 0.12s; }
[data-splitting] .char:nth-child(7) { transition-delay: 0.14s; }
[data-splitting] .char:nth-child(8) { transition-delay: 0.16s; }
[data-splitting] .char:nth-child(9) { transition-delay: 0.18s; }
[data-splitting] .char:nth-child(10) { transition-delay: 0.20s; }
[data-splitting] .char:nth-child(11) { transition-delay: 0.22s; }
[data-splitting] .char:nth-child(12) { transition-delay: 0.24s; }
[data-splitting] .char:nth-child(13) { transition-delay: 0.26s; }
[data-splitting] .char:nth-child(14) { transition-delay: 0.28s; }
[data-splitting] .char:nth-child(15) { transition-delay: 0.30s; }
[data-splitting] .char:nth-child(16) { transition-delay: 0.32s; }
[data-splitting] .char:nth-child(17) { transition-delay: 0.34s; }
[data-splitting] .char:nth-child(18) { transition-delay: 0.36s; }
[data-splitting] .char:nth-child(19) { transition-delay: 0.38s; }
[data-splitting] .char:nth-child(20) { transition-delay: 0.40s; }

/* Page Transition Animations */
.page-transition {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: var(--color-background);
    z-index: 9999;
    transform: scaleY(0);
    transform-origin: bottom;
}

.page-transition.enter {
    transform: scaleY(1);
    transition: transform 0.7s cubic-bezier(0.76, 0, 0.24, 1);
}

.page-transition.exit {
    transform: scaleY(0);
    transform-origin: top;
    transition: transform 0.7s cubic-bezier(0.76, 0, 0.24, 1);
}

/* Scroll-triggered animations */
.fade-up {
    opacity: 0;
    transform: translateY(60px);
    transition: opacity 1.2s ease, transform 1.2s cubic-bezier(0.16, 1, 0.3, 1);
}

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

.fade-in {
    opacity: 0;
    transition: opacity 1.2s ease;
}

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

.scale-in {
    opacity: 0;
    transform: scale(0.92);
    transition: opacity 1.2s cubic-bezier(0.16, 1, 0.3, 1), transform 1.2s cubic-bezier(0.16, 1, 0.3, 1);
}

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

/* Staggered animations for children */
.stagger-children > * {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.8s cubic-bezier(0.16, 1, 0.3, 1), transform 0.8s cubic-bezier(0.16, 1, 0.3, 1);
}

.stagger-children.visible > *:nth-child(1) {
    opacity: 1;
    transform: translateY(0);
    transition-delay: 0.1s;
}

.stagger-children.visible > *:nth-child(2) {
    opacity: 1;
    transform: translateY(0);
    transition-delay: 0.2s;
}

.stagger-children.visible > *:nth-child(3) {
    opacity: 1;
    transform: translateY(0);
    transition-delay: 0.3s;
}

.stagger-children.visible > *:nth-child(4) {
    opacity: 1;
    transform: translateY(0);
    transition-delay: 0.4s;
}

.stagger-children.visible > *:nth-child(5) {
    opacity: 1;
    transform: translateY(0);
    transition-delay: 0.5s;
}

/* Reveal Animations */
.reveal-left, .reveal-right, .reveal-top, .reveal-bottom {
    position: relative;
    overflow: hidden;
}

.reveal-left::after,
.reveal-right::after,
.reveal-top::after,
.reveal-bottom::after {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(to right, var(--color-thread-gold), var(--color-thread-silver));
    z-index: 10;
}

.reveal-left::after {
    transform: translateX(0);
    transition: transform 1.2s cubic-bezier(0.76, 0, 0.24, 1);
}

.reveal-right::after {
    transform: translateX(-100%);
    transition: transform 1.2s cubic-bezier(0.76, 0, 0.24, 1);
}

.reveal-top::after {
    transform: translateY(0);
    transition: transform 1.2s cubic-bezier(0.76, 0, 0.24, 1);
}

.reveal-bottom::after {
    transform: translateY(-100%);
    transition: transform 1.2s cubic-bezier(0.76, 0, 0.24, 1);
}

.reveal-left.visible::after {
    transform: translateX(100%);
}

.reveal-right.visible::after {
    transform: translateX(0);
}

.reveal-top.visible::after {
    transform: translateY(100%);
}

.reveal-bottom.visible::after {
    transform: translateY(0);
}

/* Hover Animations */
.hover-scale {
    transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

.hover-scale:hover {
    transform: scale(1.05);
}

.hover-lift {
    transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

.hover-lift:hover {
    transform: translateY(-8px);
}

/* Stat Counters Animation */
.stat-number.animate {
    animation: countUp 2s ease-out forwards;
}

@keyframes countUp {
    from {
        content: "0";
    }
    to {
        content: attr(data-value);
    }
}

/* Buttons and Link Animations */
.animated-link {
    position: relative;
    display: inline-block;
}

.animated-link::after {
    content: "";
    position: absolute;
    left: 0;
    bottom: -3px;
    width: 100%;
    height: 1px;
    background-color: var(--color-accent);
    transform: scaleX(0);
    transform-origin: right;
    transition: transform var(--transition-medium);
}

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

.btn {
    position: relative;
    display: inline-block;
    padding: 1rem 2rem;
    background-color: transparent;
    border: 1px solid var(--color-accent);
    color: var(--color-accent);
    font-family: var(--font-body);
    font-size: 0.9rem;
    font-weight: 500;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    overflow: hidden;
    transition: color 0.4s ease;
}

.btn::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: var(--color-accent);
    transform: translateX(-100%);
    transition: transform 0.4s cubic-bezier(0.76, 0, 0.24, 1);
    z-index: -1;
}

.btn:hover {
    color: var(--color-background);
}

.btn:hover::before {
    transform: translateX(0);
}

/* Image Parallax Effects */
.parallax-wrapper {
    overflow: hidden;
    position: relative;
}

.parallax-image {
    position: absolute;
    top: -20%;
    left: 0;
    width: 100%;
    height: 140%;
    background-size: cover;
    background-position: center;
}

/* Loading Animations */
.loader {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    background-color: var(--color-background);
    z-index: 999999;
}

.loader-content {
    text-align: center;
}

.loader-logo {
    font-family: var(--font-heading);
    font-size: 5rem;
    color: var(--color-accent);
    margin-bottom: 2rem;
    opacity: 0;
    animation: fadeIn 0.6s ease forwards 0.3s;
}

.loader-progress {
    width: 200px;
    height: 1px;
    background-color: rgba(248, 249, 250, 0.1);
    position: relative;
    margin: 0 auto;
}

.loader-progress-bar {
    position: absolute;
    top: 0;
    left: 0;
    height: 100%;
    width: 0;
    background-color: var(--color-accent);
    animation: loadingProgress 2.5s ease forwards;
}

.loader.finished {
    transform: translateY(-100%);
    transition: transform 0.7s cubic-bezier(0.76, 0, 0.24, 1);
}

@keyframes loadingProgress {
    0% { width: 0; }
    100% { width: 100%; }
}

@keyframes fadeIn {
    0% { opacity: 0; }
    100% { opacity: 1; }
}

/* Image Reveal Effects */
.image-reveal {
    position: relative;
    overflow: hidden;
}

.image-reveal img {
    transform: scale(1.2);
    opacity: 0;
    transition: transform 1.5s cubic-bezier(0.215, 0.61, 0.355, 1), opacity 0.6s ease;
}

.image-reveal.visible img {
    transform: scale(1);
    opacity: 1;
}

.image-reveal::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(to right, var(--color-thread-gold), var(--color-thread-silver));
    transform: translateX(-100%);
    animation: revealRight 1.5s cubic-bezier(0.76, 0, 0.24, 1) forwards;
}

@keyframes revealRight {
    0% {
        transform: translateX(-100%);
    }
    50% {
        transform: translateX(0);
    }
    100% {
        transform: translateX(100%);
    }
}

/* Text Splitting Animation for Hero */
/* Creative title animation for "Sannidhya" */
.hero-title .char {
    animation: titleCharReveal 0.8s cubic-bezier(0.16, 1, 0.3, 1) forwards;
    animation-delay: calc(0.08s * var(--char-index));
    opacity: 0;
    transform: translateY(60px) rotateX(40deg);
    transform-origin: bottom center;
    filter: blur(8px);
    text-shadow: 0 0 12px rgba(212, 175, 55, 0.6), 0 0 20px rgba(224, 224, 224, 0.4);
}

/* Enhanced section title animations */
.section-title .char {
    animation: sectionTitleReveal 0.5s cubic-bezier(0.5, 0, 0.3, 1.3) forwards;
    animation-delay: calc(0.04s * var(--char-index));
    opacity: 0;
    transform: translateY(30px);
    display: inline-block;
    transform-origin: bottom center;
}

@keyframes sectionTitleReveal {
    0% {
        opacity: 0;
        transform: translateY(30px);
    }
    60% {
        transform: translateY(-5px);
    }
    100% {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes titleCharReveal {
    0% {
        opacity: 0;
        transform: translateY(60px) rotateX(40deg);
        filter: blur(8px);
        color: var(--color-thread-gold);
    }
    60% {
        opacity: 0.8;
        filter: blur(4px);
    }
    100% {
        opacity: 1;
        transform: translateY(0) rotateX(0);
        filter: blur(0);
        color: var(--color-text);
    }
}

/* Creative subtitle animation for "Entrepreneur • Visionary • Creator" */
.hero-subtitle .char {
    animation: subtitleCharReveal 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94) forwards;
    animation-delay: calc(0.04s * var(--char-index) + 0.8s);
    opacity: 0;
    transform: translateY(20px) scale(0.8);
    transform-origin: center;
    display: inline-block;
}

@keyframes subtitleCharReveal {
    0% {


/* Creative Timeline Animations */
.timeline-item {
    position: relative;
    opacity: 0; /* Start hidden */
}

.timeline-item::before { /* Add a marker circle */
    content: '';
    position: absolute;
    left: -6px; /* Adjust based on line thickness in styles.css */
    top: 10px; /* Align with text */
    width: 15px;
    height: 15px;
    background-color: var(--color-background);
    border: 2px solid var(--color-thread-gold);
    box-shadow: 0 0 10px rgba(212, 175, 55, 0.4);
    border-radius: 50%;
    z-index: 1;
    transform: scale(0); /* Start scaled down */
    transition: transform 0.5s cubic-bezier(0.68, -0.55, 0.27, 1.55); /* Elastic scale */
}

.timeline-item.visible::before {
    transform: scale(1); /* Scale up when visible */
}

.timeline-year {
    transform: translateX(-50%) scale(0.8); /* Start slightly smaller */
    opacity: 0;
    transition: transform 0.6s ease-out, opacity 0.6s ease-out;
    transition-delay: 0.2s; /* Delay after marker */
}

.timeline-item.visible .timeline-year {
    transform: translateX(-50%) scale(1);
    opacity: 1;
}

.timeline-content {
    transform: translateX(-30px); /* Start shifted left */
    opacity: 0;
    transition: transform 0.7s ease-out, opacity 0.7s ease-out;
    transition-delay: 0.4s; /* Delay after year */
}

.timeline-item.visible .timeline-content {
    transform: translateX(0);
    opacity: 1;
}

/* Animate the main timeline line */
.timeline-wrapper::before {
    transform: scaleY(0);
    transform-origin: top;
    transition: transform 1s ease-in-out;
}

.timeline-wrapper.visible::before {
    transform: scaleY(1);
}
        opacity: 0;
        transform: translateY(20px) scale(0.8);
    }
    50% {
        opacity: 1;
        transform: translateY(-5px) scale(1.1);
        color: var(--color-thread-gold);
        text-shadow: 0 0 8px rgba(212, 175, 55, 0.4);
    }
    100% {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

/* Special animation for bullet points in subtitle */
.hero-subtitle .char:nth-child(13),
.hero-subtitle .char:nth-child(25) {
    animation-name: bulletReveal;
    animation-duration: 0.6s;
}

@keyframes bulletReveal {
    0% {
        opacity: 0;
        transform: scale(0);
    }
    60% {
        opacity: 1;
        transform: scale(1.5);
        color: var(--color-thread-silver);
        text-shadow: 0 0 8px rgba(224, 224, 224, 0.4);
    }
    100% {
        opacity: 1;
        transform: scale(1);
    }
}

/* Marquee Animation */
.marquee {
    overflow: hidden;
    white-space: nowrap;
}

.marquee-content {
    display: inline-block;
    animation: marquee 30s linear infinite;
}

@keyframes marquee {
    0% {
        transform: translateX(0);
    }
    100% {
        transform: translateX(-50%);
    }
}