/* Animation Styles */

/* Keyframe Animations */
@keyframes bounce {

    0%,
    20%,
    50%,
    80%,
    100% {
        transform: translateY(0) rotate(45deg);
    }

    40% {
        transform: translateY(-10px) rotate(45deg);
    }

    60% {
        transform: translateY(-5px) rotate(45deg);
    }
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }

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

@keyframes fadeInLeft {
    from {
        opacity: 0;
        transform: translateX(-30px);
    }

    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes fadeInRight {
    from {
        opacity: 0;
        transform: translateX(30px);
    }

    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes scaleIn {
    from {
        opacity: 0;
        transform: scale(0.8);
    }

    to {
        opacity: 1;
        transform: scale(1);
    }
}

@keyframes slideInFromTop {
    from {
        opacity: 0;
        transform: translateY(-50px);
    }

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

@keyframes pulse {
    0% {
        transform: scale(1);
    }

    50% {
        transform: scale(1.05);
    }

    100% {
        transform: scale(1);
    }
}

/* progressBar keyframe removed - not used in current design */

@keyframes countUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

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

/* Animation Classes */
.animate-fade-in-up {
    animation: fadeInUp 0.6s ease-out forwards;
}

.animate-fade-in-left {
    animation: fadeInLeft 0.6s ease-out forwards;
}

.animate-fade-in-right {
    animation: fadeInRight 0.6s ease-out forwards;
}

.animate-scale-in {
    animation: scaleIn 0.5s ease-out forwards;
}

.animate-slide-in-top {
    animation: slideInFromTop 0.6s ease-out forwards;
}

.animate-pulse {
    animation: pulse 2s ease-in-out infinite;
}

/* Stagger Animation Delays */
.animate-stagger-1 {
    animation-delay: 0.1s;
}

.animate-stagger-2 {
    animation-delay: 0.2s;
}

.animate-stagger-3 {
    animation-delay: 0.3s;
}

.animate-stagger-4 {
    animation-delay: 0.4s;
}

.animate-stagger-5 {
    animation-delay: 0.5s;
}

.animate-stagger-6 {
    animation-delay: 0.6s;
}

/* Initial States for Animations */
.animate-on-scroll {
    opacity: 0;
    transform: translateY(30px);
    transition: all 0.6s ease-out;
}

.animate-on-scroll.animate-in {
    opacity: 1;
    transform: translateY(0);
}

.animate-on-scroll-left {
    opacity: 0;
    transform: translateX(-30px);
    transition: all 0.6s ease-out;
}

.animate-on-scroll-left.animate-in {
    opacity: 1;
    transform: translateX(0);
}

.animate-on-scroll-right {
    opacity: 0;
    transform: translateX(30px);
    transition: all 0.6s ease-out;
}

.animate-on-scroll-right.animate-in {
    opacity: 1;
    transform: translateX(0);
}

.animate-on-scroll-scale {
    opacity: 0;
    transform: scale(0.8);
    transition: all 0.6s ease-out;
}

.animate-on-scroll-scale.animate-in {
    opacity: 1;
    transform: scale(1);
}

/* Counter Animation */
.metric__value {
    animation: countUp 0.6s ease-out forwards;
}

.metric-card__number {
    animation: countUp 0.6s ease-out forwards;
}

/* Progress Bar Animation - REMOVED (not used in current design) */

/* Timeline Animation */
.timeline__item {
    opacity: 1;
    transform: translateY(0);
    transition: all 0.8s ease-out;
    z-index: 10;
}

.timeline__item.animate-in {
    opacity: 1;
    transform: translateY(0);
}

.timeline__item:nth-child(odd).animate-in {
    animation: fadeInLeft 0.8s ease-out forwards;
    z-index: 10;
}

.timeline__item:nth-child(even).animate-in {
    animation: fadeInRight 0.8s ease-out forwards;
    z-index: 10;
}

/* Challenge Card Hover Effects */
.challenge-card {
    transition: transform var(--transition-base);
}

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

.challenge-card__front,
.challenge-card__back {
    transition: transform 0.8s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

/* Metric Card Animations */
.metric-card {
    opacity: 1;
    transform: translateY(0);
    transition: all 0.6s ease-out;
}

.metric-card.animate-in {
    opacity: 1;
    transform: translateY(0);
}

.metric-card:hover {
    transform: translateY(-8px) scale(1.02);
    box-shadow: var(--shadow-xl);
}

/* Success Story Animations */
.success-story {
    opacity: 1;
    transform: translateX(0);
    transition: all 0.6s ease-out;
}

.success-story.animate-in {
    opacity: 1;
    transform: translateX(0);
}

.success-story:nth-child(even) {
    transform: translateX(30px);
}

/* Impact Item Animations */
.impact__item {
    opacity: 1;
    transform: scale(1);
    transition: all 0.6s ease-out;
}

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

/* Button Hover Effects */
.btn {
    position: relative;
    overflow: hidden;
}

.btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: left 0.5s;
}

.btn:hover::before {
    left: 100%;
}

/* Navigation Animation */
.nav {
    transform: translateY(0);
    animation: slideInFromTop 0.6s ease-out 0.2s both;
}

.nav__link {
    position: relative;
    overflow: hidden;
}

.nav__link::before {
    content: '';
    position: absolute;
    bottom: -8px;
    left: 0;
    width: 0;
    height: 2px;
    background: var(--color-secondary);
    transition: width var(--transition-base);
}

.nav__link:hover::before {
    width: 100%;
}

/* Hero Content Animation */
.hero__name {
    animation: fadeInUp 0.8s ease-out 0.3s both;
}

.hero__role {
    animation: fadeInUp 0.8s ease-out 0.5s both;
}

.hero__project {
    animation: fadeInUp 0.8s ease-out 0.7s both;
}

.hero__mission {
    animation: fadeInUp 0.8s ease-out 0.9s both;
}

.hero__metrics {
    animation: fadeInUp 0.8s ease-out 1.1s both;
}

/* Scroll Indicator Animation */
.hero__scroll-indicator {
    animation: fadeInUp 0.6s ease-out 1.5s both;
}

/* Pain Point Animations */
.pain-point {
    opacity: 1;
    transform: translateX(0);
    transition: all 0.6s ease-out;
}

.pain-point.animate-in {
    opacity: 1;
    transform: translateX(0);
}

.pain-point:nth-child(even) {
    transform: translateX(30px);
}

/* Philosophy Quote Animation */
.philosophy blockquote {
    opacity: 1;
    transform: scale(1);
    transition: all 0.8s ease-out;
}

.philosophy blockquote.animate-in {
    opacity: 1;
    transform: scale(1);
}

/* Contact Section Animation */
.contact__content>* {
    opacity: 1;
    transform: translateY(0);
    transition: all 0.6s ease-out;
}

.contact__content.animate-in>* {
    opacity: 1;
    transform: translateY(0);
}

.contact__content.animate-in>*:nth-child(1) {
    transition-delay: 0.1s;
}

.contact__content.animate-in>*:nth-child(2) {
    transition-delay: 0.2s;
}

.contact__content.animate-in>*:nth-child(3) {
    transition-delay: 0.3s;
}

.contact__content.animate-in>*:nth-child(4) {
    transition-delay: 0.4s;
}

.contact__content.animate-in>*:nth-child(5) {
    transition-delay: 0.5s;
}

/* Reduced Motion Support */
@media (prefers-reduced-motion: reduce) {

    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }

    .scroll-arrow {
        animation: none;
    }

    .animate-pulse {
        animation: none;
    }
}

/* High Contrast Mode Support */
@media (prefers-contrast: high) {
    .metric {
        border: 2px solid var(--color-gray-800);
    }

    .challenge-card__front,
    .challenge-card__back {
        border: 2px solid var(--color-gray-800);
    }

    .btn {
        border-width: 3px;
    }
}

/* Final pol
ish animations and micro-interactions */

/* Loading animation for the entire page */
@keyframes pageLoad {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

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

body {
    animation: pageLoad 0.6s ease-out;
}

/* Enhanced button interactions */
.btn {
    position: relative;
    overflow: hidden;
    transform: translateZ(0);
    /* Force hardware acceleration */
}

.btn::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    background: rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    transform: translate(-50%, -50%);
    transition: width 0.6s, height 0.6s;
}

.btn:active::after {
    width: 300px;
    height: 300px;
}

/* Refined scroll progress animation */
.scroll-progress-fill {
    background: linear-gradient(90deg, var(--color-primary), var(--color-secondary), var(--color-accent));
    background-size: 200% 100%;
    animation: gradientShift 3s ease-in-out infinite;
}

@keyframes gradientShift {

    0%,
    100% {
        background-position: 0% 50%;
    }

    50% {
        background-position: 100% 50%;
    }
}

/* Enhanced metric card animations - DISABLED to prevent visual artifacts */
.metric-card {
    position: relative;
    overflow: hidden;
}

/* Removed metric card overlay effect that was causing unwanted visual elements */

/* Timeline marker pulse effect - DISABLED to prevent visual artifacts */
.timeline__marker {
    position: relative;
}

/* Removed timeline marker pulse effect that was causing unwanted visual elements */

/* Enhanced challenge card flip with depth */
.challenge-card {
    transform-style: preserve-3d;
    transition: transform 0.8s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.challenge-card:hover {
    transform: translateY(-8px) rotateX(5deg);
}

.challenge-card--flipped {
    transform: rotateY(180deg);
}

.challenge-card--flipped:hover {
    transform: rotateY(180deg) translateY(-8px) rotateX(-5deg);
}

/* Sophisticated text reveal animation */
.text-reveal {
    overflow: hidden;
    position: relative;
}

.text-reveal::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: var(--color-white);
    transform: translateX(-100%);
    animation: textReveal 1s ease-out forwards;
}

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

    50% {
        transform: translateX(0%);
    }

    100% {
        transform: translateX(100%);
    }
}

/* Floating elements animation */
@keyframes float {

    0%,
    100% {
        transform: translateY(0px);
    }

    50% {
        transform: translateY(-10px);
    }
}

.hero__scroll-indicator {
    animation: float 3s ease-in-out infinite;
}

/* Enhanced contact section animation - DISABLED to prevent visual artifacts */
.contact__content {
    position: relative;
}

/* Removed contact section overlay effect that was causing unwanted visual elements */

/* Refined loading states */
.loading {
    position: relative;
    overflow: hidden;
}

.loading::after {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.4), transparent);
    animation: shimmer 1.5s infinite;
}

@keyframes shimmer {
    0% {
        left: -100%;
    }

    100% {
        left: 100%;
    }
}

/* Success state animations */
.success-indicator {
    animation: successPulse 0.6s ease-out;
}

@keyframes successPulse {
    0% {
        transform: scale(1);
    }

    50% {
        transform: scale(1.1);
    }

    100% {
        transform: scale(1);
    }
}

/* Refined focus animations */
.focus-visible {
    animation: focusGlow 0.3s ease-out;
}

@keyframes focusGlow {
    0% {
        box-shadow: 0 0 0 0 var(--color-secondary);
    }

    100% {
        box-shadow: 0 0 0 3px var(--color-secondary);
    }
}

/* Enhanced parallax effect */
.parallax-element {
    transform: translateZ(0);
    will-change: transform;
}

/* Optimized animations for better performance */
.gpu-accelerated {
    transform: translateZ(0);
    backface-visibility: hidden;
    perspective: 1000px;
}

/* Final polish for all interactive elements */
.metric,
.challenge-card,
.metric-card,
.success-story,
.impact__item,
.btn {
    will-change: transform;
    backface-visibility: hidden;
}

/* Smooth state transitions */
* {
    transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1);
}

/* Enhanced mobile animations */
@media (max-width: 767px) {
    .challenge-card:hover {
        transform: translateY(-4px);
    }

    .metric-card:hover {
        transform: translateY(-4px) scale(1.02);
    }

    /* Timeline marker pulse effect already removed above */
}