/* Animation Keyframes */
@keyframes float {
    0% {
        transform: translateY(0px) rotate(0deg);
    }
    50% {
        transform: translateY(-15px) rotate(2deg);
    }
    100% {
        transform: translateY(0px) rotate(0deg);
    }
}

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

@keyframes slideInLeft {
    from {
        opacity: 0;
        transform: translateX(-50px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes slideInRight {
    from {
        opacity: 0;
        transform: translateX(50px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes scaleUp {
    from {
        opacity: 0;
        transform: scale(0.8);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

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

/* Animation Classes */
.animate-on-scroll {
    opacity: 0;
    transition: opacity 0.8s ease, transform 0.8s ease;
}

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

/* Specific Animation for Animal Illustration */
.image-frame img.animal-illustration {
    transition: transform 0.6s cubic-bezier(0.215, 0.61, 0.355, 1);
}

.image-frame img.animal-illustration.animated {
    animation: float 6s ease-in-out infinite;
}

/* Parallax Effect Classes */
.parallax {
    transition: transform 0.5s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    will-change: transform;
}

/* Text Animation Classes */
.text-fade-in {
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.8s ease, transform 0.8s ease;
}

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

.text-slide-left {
    opacity: 0;
    transform: translateX(-30px);
    transition: opacity 0.8s ease, transform 0.8s ease;
}

.text-slide-left.visible {
    opacity: 1;
    transform: translateX(0);
}

.text-slide-right {
    opacity: 0;
    transform: translateX(30px);
    transition: opacity 0.8s ease, transform 0.8s ease;
}

.text-slide-right.visible {
    opacity: 1;
    transform: translateX(0);
}

.text-scale {
    opacity: 0;
    transform: scale(0.9);
    transition: opacity 0.8s ease, transform 0.8s ease;
}

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

.text-highlight {
    background: linear-gradient(90deg, rgba(255,111,97,0) 0%, rgba(255,111,97,0.2) 50%, rgba(255,111,97,0) 100%);
    background-size: 200% 100%;
    background-position: -100% 0;
    transition: background-position 1.5s ease;
}

.text-highlight.visible {
    background-position: 100% 0;
}

/* Staggered Animation Delays */
.delay-100 { transition-delay: 0.1s; }
.delay-200 { transition-delay: 0.2s; }
.delay-300 { transition-delay: 0.3s; }
.delay-400 { transition-delay: 0.4s; }
.delay-500 { transition-delay: 0.5s; }
.delay-600 { transition-delay: 0.6s; }
.delay-700 { transition-delay: 0.7s; }
.delay-800 { transition-delay: 0.8s; }

/* Intro Section Specific Animations */
.intro-section .text-column {
    /* Add proper spacing for the entire text column */
    padding-left: 5px;
}
.intro-section .text-column h2 {
    display: inline-block;
    position: relative;
    overflow: hidden;
    margin-left: 4px; /* Align with paragraphs */
}

.intro-section .text-column h2::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 2px;
    background-color: #ff6f61;
    transform: scaleX(0);
    transform-origin: left;
    transition: transform 0.8s ease 0.3s;
}

.intro-section .text-column h2.visible::after {
    transform: scaleX(1);
}

.intro-section .text-column h1 {
    display: inline-block;
    background-image: linear-gradient(to right, transparent, transparent);
    background-size: 100% 0.1em;
    background-position: 0 88%;
    background-repeat: no-repeat;
    transition: background-size 0.8s ease;
    margin-left: 4px; /* Align with paragraphs */
}

.intro-section .text-column h1.visible {
    background-image: linear-gradient(to right, rgba(255,111,97,0.2), rgba(255,111,97,0.2));
    background-size: 100% 0.1em;
}

.intro-section .text-column p {
    position: relative;
    overflow: hidden;
    padding-left: 15px; /* Add padding to prevent text collision with the orange line */
    margin-left: 4px; /* Add margin to create space for the orange line */
}

.intro-section .text-column p::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 4px;
    height: 0;
    background-color: #ff6f61;
    transition: height 0.8s ease;
    z-index: 1; /* Ensure the line appears above the text */
}

.intro-section .text-column p.visible::before {
    height: 100%;
}

/* Word-by-word animation helper */
.word-animation span {
    display: inline-block;
    opacity: 0;
    transform: translateY(10px);
    transition: opacity 0.3s ease, transform 0.3s ease;
}

.word-animation.visible span {
    opacity: 1;
    transform: translateY(0);
}
