/* MITSURO Portfolio Website - Animations */

/* Scroll Animations */
.fade-in {
    opacity: 0;
    transform: translateY(30px);
    transition: all 0.6s ease-out;
}

.fade-in.visible {
    opacity: 1;
    transform: translateY(0);
}

.slide-in-left {
    opacity: 0;
    transform: translateX(-50px);
    transition: all 0.6s ease-out;
}

.slide-in-left.visible {
    opacity: 1;
    transform: translateX(0);
}

.slide-in-right {
    opacity: 0;
    transform: translateX(50px);
    transition: all 0.6s ease-out;
}

.slide-in-right.visible {
    opacity: 1;
    transform: translateX(0);
}

.scale-in {
    opacity: 0;
    transform: scale(0.8);
    transition: all 0.6s ease-out;
}

.scale-in.visible {
    opacity: 1;
    transform: scale(1);
}

/* Hover Animations */
.hover-lift {
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.hover-lift:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.15);
}

.hover-scale {
    transition: transform 0.3s ease;
}

.hover-scale:hover {
    transform: scale(1.05);
}

.hover-rotate {
    transition: transform 0.3s ease;
}

.hover-rotate:hover {
    transform: rotate(5deg);
}

/* Button Animations */
.btn-pulse {
    position: relative;
    overflow: hidden;
}

.btn-pulse::before {
    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 ease, height 0.6s ease;
}

.btn-pulse:hover::before {
    width: 300px;
    height: 300px;
}

/* Loading Animations */
.spinner {
    width: 40px;
    height: 40px;
    border: 4px solid #f3f3f3;
    border-top: 4px solid var(--primary-red);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

.pulse {
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.05);
    }
    100% {
        transform: scale(1);
    }
}

/* Text Animations */
.typewriter {
    overflow: hidden;
    border-right: 2px solid var(--primary-red);
    white-space: nowrap;
    animation: typing 3.5s steps(40, end), blink-caret 0.75s step-end infinite;
}

@keyframes typing {
    from { width: 0; }
    to { width: 100%; }
}

@keyframes blink-caret {
    from, to { border-color: transparent; }
    50% { border-color: var(--primary-red); }
}

/* Parallax Effects */
.parallax {
    background-attachment: fixed;
    background-position: center;
    background-repeat: no-repeat;
    background-size: cover;
}

/* Staggered Animations */
.stagger-item {
    opacity: 0;
    transform: translateY(30px);
    transition: all 0.6s ease-out;
}

.stagger-item.visible {
    opacity: 1;
    transform: translateY(0);
}

.stagger-item:nth-child(1) { transition-delay: 0.1s; }
.stagger-item:nth-child(2) { transition-delay: 0.2s; }
.stagger-item:nth-child(3) { transition-delay: 0.3s; }
.stagger-item:nth-child(4) { transition-delay: 0.4s; }
.stagger-item:nth-child(5) { transition-delay: 0.5s; }
.stagger-item:nth-child(6) { transition-delay: 0.6s; }

/* Floating Animation */
.float {
    animation: float 3s ease-in-out infinite;
}

@keyframes float {
    0%, 100% {
        transform: translateY(0px);
    }
    50% {
        transform: translateY(-10px);
    }
}

/* Bounce Animation */
.bounce {
    animation: bounce 2s infinite;
}

@keyframes bounce {
    0%, 20%, 50%, 80%, 100% {
        transform: translateY(0);
    }
    40% {
        transform: translateY(-10px);
    }
    60% {
        transform: translateY(-5px);
    }
}

/* Shake Animation */
.shake {
    animation: shake 0.5s ease-in-out;
}

@keyframes shake {
    0%, 100% {
        transform: translateX(0);
    }
    25% {
        transform: translateX(-5px);
    }
    75% {
        transform: translateX(5px);
    }
}

/* Fade In Up Animation */
.fade-in-up {
    opacity: 0;
    transform: translateY(30px);
    transition: all 0.6s ease-out;
}

.fade-in-up.visible {
    opacity: 1;
    transform: translateY(0);
}

/* Slide In From Left */
.slide-in-from-left {
    opacity: 0;
    transform: translateX(-50px);
    transition: all 0.6s ease-out;
}

.slide-in-from-left.visible {
    opacity: 1;
    transform: translateX(0);
}

/* Slide In From Right */
.slide-in-from-right {
    opacity: 0;
    transform: translateX(50px);
    transition: all 0.6s ease-out;
}

.slide-in-from-right.visible {
    opacity: 1;
    transform: translateX(0);
}

/* Zoom In Animation */
.zoom-in {
    opacity: 0;
    transform: scale(0.8);
    transition: all 0.6s ease-out;
}

.zoom-in.visible {
    opacity: 1;
    transform: scale(1);
}

/* Rotate In Animation */
.rotate-in {
    opacity: 0;
    transform: rotate(-180deg) scale(0.8);
    transition: all 0.6s ease-out;
}

.rotate-in.visible {
    opacity: 1;
    transform: rotate(0deg) scale(1);
}

/* Flip Animation */
.flip {
    perspective: 1000px;
}

.flip-inner {
    transition: transform 0.6s;
    transform-style: preserve-3d;
}

.flip:hover .flip-inner {
    transform: rotateY(180deg);
}

/* Glow Effect */
.glow {
    transition: all 0.3s ease;
}

.glow:hover {
    box-shadow: 0 0 20px rgba(172, 49, 58, 0.5);
}

/* Gradient Text Animation */
.gradient-text {
    background: linear-gradient(45deg, var(--primary-red), #d6454a, var(--primary-red));
    background-size: 200% 200%;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    animation: gradient-shift 3s ease infinite;
}

@keyframes gradient-shift {
    0% {
        background-position: 0% 50%;
    }
    50% {
        background-position: 100% 50%;
    }
    100% {
        background-position: 0% 50%;
    }
}

/* Progress Bar Animation */
.progress-bar {
    width: 0%;
    transition: width 1s ease-in-out;
}

.progress-bar.animate {
    width: 100%;
}

/* Counter Animation */
.counter {
    display: inline-block;
}

.counter.animate {
    animation: count-up 2s ease-out;
}

@keyframes count-up {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Responsive Animations */
@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* Mobile Optimizations */
@media (max-width: 768px) {
    .parallax {
        background-attachment: scroll;
    }
    
    .typewriter {
        white-space: normal;
        border-right: none;
        animation: none;
    }
} 