/* Animation Styles */

/* Scroll-triggered animations */
@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 rotateIn {
    from {
        opacity: 0;
        transform: rotate(-10deg) scale(0.8);
    }
    to {
        opacity: 1;
        transform: rotate(0deg) scale(1);
    }
}

/* Floating animation for decorative elements */
@keyframes float {
    0%, 100% {
        transform: var(--float-base-transform, translateY(0px)) translateY(0px);
    }
    50% {
        transform: var(--float-base-transform, translateY(0px)) translateY(-10px);
    }
}

@keyframes floatSlow {
    0%, 100% {
        transform: var(--float-base-transform, translateY(0px)) translateY(0px);
    }
    50% {
        transform: var(--float-base-transform, translateY(0px)) translateY(-15px);
    }
}

/* Parallax scrolling effects */
.parallax-element {
    will-change: transform;
}

.parallax-slow {
    transform: translateY(var(--parallax-offset-slow, 0));
}

.parallax-medium {
    transform: translateY(var(--parallax-offset-medium, 0));
}

.parallax-fast {
    transform: translateY(var(--parallax-offset-fast, 0));
}

/* Scroll reveal animations */
.reveal {
    opacity: 0;
    transform: translateY(30px);
    transition: all var(--animation-slow) var(--ease-out);
}

.reveal.revealed {
    opacity: 1;
    transform: translateY(0);
}

.reveal-left {
    opacity: 0;
    transform: translateX(-30px);
    transition: all var(--animation-slow) var(--ease-out);
}

.reveal-left.revealed {
    opacity: 1;
    transform: translateX(0);
}

.reveal-right {
    opacity: 0;
    transform: translateX(30px);
    transition: all var(--animation-slow) var(--ease-out);
}

.reveal-right.revealed {
    opacity: 1;
    transform: translateX(0);
}

.reveal-scale {
    opacity: 0;
    transform: scale(0.8);
    transition: all var(--animation-slow) var(--ease-out);
}

.reveal-scale.revealed {
    opacity: 1;
    transform: scale(1);
}

/* Staggered animations for gallery items */
.stagger-item {
    opacity: 0;
    transform: translateY(20px) scale(0.9);
    transition: all var(--animation-medium) var(--ease-out);
}

.stagger-item.animate {
    opacity: 1;
    transform: translateY(0) scale(1);
}

.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; }
.stagger-item:nth-child(7) { transition-delay: 0.7s; }
.stagger-item:nth-child(8) { transition-delay: 0.8s; }
.stagger-item:nth-child(9) { transition-delay: 0.9s; }
.stagger-item:nth-child(10) { transition-delay: 1.0s; }

/* Hover animations */
.hover-lift {
    transition: transform var(--animation-medium) var(--ease-out),
                box-shadow var(--animation-medium) var(--ease-out);
}

.hover-lift:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-heavy);
}

.hover-rotate {
    transition: transform var(--animation-medium) var(--ease-out);
}

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

.hover-scale {
    transition: transform var(--animation-medium) var(--ease-bounce);
}

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

/* Loading animations */
@keyframes pulse {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.5;
    }
}

.loading {
    animation: pulse 1.5s ease-in-out infinite;
}

@keyframes spin {
    from {
        transform: rotate(0deg);
    }
    to {
        transform: rotate(360deg);
    }
}

.spinner {
    animation: spin 1s linear infinite;
}

/* Page transition animations */
.page-transition {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: var(--cream-bg);
    z-index: var(--z-modal);
    opacity: 0;
    visibility: hidden;
    transition: all var(--animation-slow) var(--ease-in-out);
}

.page-transition.active {
    opacity: 1;
    visibility: visible;
}

/* Organic clip-path transitions */
.clip-transition {
    clip-path: circle(0% at 50% 50%);
    transition: clip-path var(--animation-very-slow) var(--ease-in-out);
}

.clip-transition.expand {
    clip-path: circle(150% at 50% 50%);
}

/* Text reveal animations */
.text-reveal {
    overflow: hidden;
}

.text-reveal .line {
    display: block;
    transform: translateY(100%);
    transition: transform var(--animation-slow) var(--ease-out);
}

.text-reveal.revealed .line {
    transform: translateY(0);
}

.text-reveal .line:nth-child(1) { transition-delay: 0.1s; }
.text-reveal .line:nth-child(2) { transition-delay: 0.2s; }
.text-reveal .line:nth-child(3) { transition-delay: 0.3s; }
.text-reveal .line:nth-child(4) { transition-delay: 0.4s; }

/* Decorative line animations */
.decorative-lines svg path {
    stroke-dasharray: 1000;
    stroke-dashoffset: 1000;
    animation: drawLine 2s ease-in-out forwards;
}

@keyframes drawLine {
    to {
        stroke-dashoffset: 0;
    }
}

.decorative-lines .line-1 {
    animation-delay: 0.5s;
}

.decorative-lines .line-2 {
    animation-delay: 1s;
}

.decorative-lines .line-3 {
    animation-delay: 1.5s;
}

/* Navigation bubble animations */
.nav-bubble {
    position: relative;
    overflow: hidden;
}

.nav-bubble::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    transform: translate(-50%, -50%);
    transition: all var(--animation-medium) var(--ease-out);
}

.nav-bubble:hover::before {
    width: 100%;
    height: 100%;
}

/* Gallery item entrance animations */
.gallery-item {
    animation: galleryItemEntrance var(--animation-slow) var(--ease-out) forwards;
    opacity: 0;
}

@keyframes galleryItemEntrance {
    from {
        opacity: 0;
        transform: scale(0.8) rotate(10deg);
    }
    to {
        opacity: 1;
        transform: scale(1) rotate(var(--item-rotation, 0deg));
    }
}

/* Writing content animations */
.writing-content {
    opacity: 0;
    animation: fadeInContent var(--animation-very-slow) var(--ease-out) forwards;
    animation-delay: 0.3s;
}

@keyframes fadeInContent {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Lightbox animations */
.lightbox-content {
    transform: scale(0.8);
    transition: transform var(--animation-medium) var(--ease-bounce);
}

.lightbox.active .lightbox-content {
    transform: scale(1);
}

/* Mobile-specific animations */
@media (max-width: 768px) {
    .stagger-item:nth-child(n) {
        transition-delay: 0.1s;
    }
    
    .decorative-lines svg path {
        animation: none;
        stroke-dasharray: none;
        stroke-dashoffset: 0;
    }
    
    .parallax-element {
        transform: none !important;
    }
}

/* Reduced motion support */
@media (prefers-reduced-motion: reduce) {
    .reveal,
    .reveal-left,
    .reveal-right,
    .reveal-scale,
    .stagger-item,
    .gallery-item,
    .writing-content {
        animation: none;
        transition: none;
        opacity: 1;
        transform: none;
    }
    
    .decorative-lines svg path {
        animation: none;
        stroke-dasharray: none;
        stroke-dashoffset: 0;
    }
    
    .parallax-element {
        transform: none !important;
    }
    
    .nav-bubble::before {
        display: none;
    }
}

/* Performance optimizations */
.will-change-transform {
    will-change: transform;
}

.will-change-opacity {
    will-change: opacity;
}

.gpu-accelerated {
    transform: translateZ(0);
    backface-visibility: hidden;
    perspective: 1000px;
}
