/**
 * Animation Library
 * Premium, fluid micro-interactions and scroll animations
 */

/* ═══════════════════════════════════════════════════════════════ */
/* ENTRANCE ANIMATIONS */
/* ═══════════════════════════════════════════════════════════════ */

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

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

@keyframes fadeDown {
    from {
        opacity: 0;
        transform: translateY(-40px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

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

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

@keyframes scaleIn {
    from {
        opacity: 0;
        transform: scale(0.92);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

/* ═══════════════════════════════════════════════════════════════ */
/* SCROLL TRIGGERED ANIMATIONS */
/* ═══════════════════════════════════════════════════════════════ */

.fade-up {
    animation: fadeUp 0.8s cubic-bezier(0.25, 0.46, 0.45, 0.94) both;
}

.fade-down {
    animation: fadeDown 0.8s cubic-bezier(0.25, 0.46, 0.45, 0.94) both;
}

.fade-in {
    animation: fadeIn 0.6s ease-out both;
}

.scale-in {
    animation: scaleIn 0.6s cubic-bezier(0.34, 1.56, 0.64, 1) both;
}

.slide-in {
    animation: slideIn 0.7s cubic-bezier(0.25, 0.46, 0.45, 0.94) both;
}

/* Stagger delays for grouped elements */
.stagger-0 {
    animation-delay: 0ms;
}

.stagger-1 {
    animation-delay: 100ms;
}

.stagger-2 {
    animation-delay: 200ms;
}

.stagger-3 {
    animation-delay: 300ms;
}

.stagger-4 {
    animation-delay: 400ms;
}

.stagger-5 {
    animation-delay: 500ms;
}

.delay-100 {
    animation-delay: 100ms;
}

.delay-200 {
    animation-delay: 200ms;
}

.delay-300 {
    animation-delay: 300ms;
}

/* ═══════════════════════════════════════════════════════════════ */
/* HOVER EFFECTS */
/* ═══════════════════════════════════════════════════════════════ */

.hover-lift {
    transition: all var(--transition-smooth);
}

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

.hover-scale {
    transition: all var(--transition-smooth);
}

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

.hover-glow {
    transition: box-shadow var(--transition-smooth);
}

.hover-glow:hover {
    box-shadow: 0 0 30px rgba(27, 94, 32, 0.4);
}

.hover-accent-glow:hover {
    box-shadow: 0 0 30px rgba(255, 143, 0, 0.4);
}

/* ═══════════════════════════════════════════════════════════════ */
/* COUNTER ANIMATION */
/* ═══════════════════════════════════════════════════════════════ */

@keyframes countUp {
    from {
        counter-increment: counter 0;
    }
}

.counter {
    counter-reset: counter;
}

/* ═══════════════════════════════════════════════════════════════ */
/* PULSE & BREATHING */
/* ═══════════════════════════════════════════════════════════════ */

@keyframes pulse {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.6;
    }
}

@keyframes breathe {
    0%, 100% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.05);
    }
}

.pulse {
    animation: pulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}

.breathe {
    animation: breathe 3s ease-in-out infinite;
}

/* ═══════════════════════════════════════════════════════════════ */
/* FLOATING & DRIFT */
/* ═══════════════════════════════════════════════════════════════ */

@keyframes float {
    0%, 100% {
        transform: translateY(0px);
    }
    50% {
        transform: translateY(-20px);
    }
}

@keyframes drift {
    0%, 100% {
        transform: translateX(0px) translateY(0px);
    }
    50% {
        transform: translateX(10px) translateY(-10px);
    }
}

.float {
    animation: float 4s ease-in-out infinite;
}

.drift {
    animation: drift 6s ease-in-out infinite;
}

/* ═══════════════════════════════════════════════════════════════ */
/* SHIMMER & GRADIENT ANIMATIONS */
/* ═══════════════════════════════════════════════════════════════ */

@keyframes shimmer {
    0% {
        background-position: -1000px 0;
    }
    100% {
        background-position: 1000px 0;
    }
}

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

.shimmer {
    background-size: 1000px 100%;
    animation: shimmer 3s infinite;
}

.gradient-shift {
    background-size: 200% 200%;
    animation: gradientShift 4s ease infinite;
}

/* ═══════════════════════════════════════════════════════════════ */
/* GLOW EFFECTS */
/* ═══════════════════════════════════════════════════════════════ */

@keyframes glowPulse {
    0%, 100% {
        box-shadow: 0 0 20px rgba(27, 94, 32, 0.3);
    }
    50% {
        box-shadow: 0 0 40px rgba(27, 94, 32, 0.6);
    }
}

@keyframes accentGlowPulse {
    0%, 100% {
        box-shadow: 0 0 20px rgba(255, 143, 0, 0.3);
    }
    50% {
        box-shadow: 0 0 40px rgba(255, 143, 0, 0.6);
    }
}

.glow-pulse {
    animation: glowPulse 3s ease-in-out infinite;
}

.accent-glow-pulse {
    animation: accentGlowPulse 3s ease-in-out infinite;
}

/* ═══════════════════════════════════════════════════════════════ */
/* ROTATE & SPIN */
/* ═══════════════════════════════════════════════════════════════ */

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

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

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

.slow-spin {
    animation: slowSpin 8s linear infinite;
}

/* ═══════════════════════════════════════════════════════════════ */
/* FLIP & BOUNCE */
/* ═══════════════════════════════════════════════════════════════ */

@keyframes flip {
    0% {
        transform: rotateY(0deg);
    }
    50% {
        transform: rotateY(90deg);
    }
    100% {
        transform: rotateY(0deg);
    }
}

@keyframes bounce {
    0%, 100% {
        transform: translateY(0);
    }
    50% {
        transform: translateY(-10px);
    }
}

@keyframes bounceIn {
    0% {
        opacity: 0;
        transform: scale(0.3);
    }
    50% {
        opacity: 1;
    }
    100% {
        transform: scale(1);
    }
}

.flip {
    animation: flip 2s ease-in-out infinite;
    perspective: 1000px;
}

.bounce {
    animation: bounce 1s ease-in-out infinite;
}

.bounce-in {
    animation: bounceIn 0.6s cubic-bezier(0.68, -0.55, 0.265, 1.55) both;
}

/* ═══════════════════════════════════════════════════════════════ */
/* UNDERLINE & TEXT EFFECTS */
/* ═══════════════════════════════════════════════════════════════ */

@keyframes underlineExpand {
    from {
        left: 0;
        right: auto;
        width: 0;
    }
    to {
        left: 0;
        right: auto;
        width: 100%;
    }
}

@keyframes underlineSlide {
    from {
        transform: scaleX(0);
    }
    to {
        transform: scaleX(1);
    }
}

.underline-expand {
    position: relative;
}

.underline-expand::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 0;
    height: 2px;
    background: linear-gradient(90deg, var(--primary) 0%, var(--accent) 100%);
    transition: width var(--transition-smooth);
}

.underline-expand:hover::after {
    width: 100%;
}

/* ═══════════════════════════════════════════════════════════════ */
/* PARALLAX EFFECT */
/* ═══════════════════════════════════════════════════════════════ */

.parallax {
    background-attachment: fixed;
    background-position: center;
    background-repeat: no-repeat;
    background-size: cover;
}

/* ═══════════════════════════════════════════════════════════════ */
/* MORPHING SHAPES */
/* ═══════════════════════════════════════════════════════════════ */

@keyframes morph {
    0% {
        border-radius: 60% 40% 30% 70% / 60% 30% 70% 40%;
    }
    50% {
        border-radius: 30% 60% 70% 40% / 50% 60% 30% 60%;
    }
    100% {
        border-radius: 60% 40% 30% 70% / 60% 30% 70% 40%;
    }
}

.morph {
    animation: morph 8s ease-in-out infinite;
}

/* ═══════════════════════════════════════════════════════════════ */
/* TEXT ANIMATIONS */
/* ═══════════════════════════════════════════════════════════════ */

@keyframes typewriter {
    from {
        width: 0;
    }
    to {
        width: 100%;
    }
}

@keyframes blink {
    0%, 49%, 100% {
        border-right-color: transparent;
    }
    50%, 99% {
        border-right-color: var(--primary);
    }
}

.typewriter {
    overflow: hidden;
    border-right: 2px solid var(--primary);
    white-space: nowrap;
    animation: typewriter 4s steps(40, end), blink 0.75s step-end infinite;
}

/* ═══════════════════════════════════════════════════════════════ */
/* REVEAL ANIMATIONS */
/* ═══════════════════════════════════════════════════════════════ */

@keyframes reveal {
    from {
        clip-path: polygon(0 0, 0 0, 0 100%, 0 100%);
    }
    to {
        clip-path: polygon(0 0, 100% 0, 100% 100%, 0 100%);
    }
}

@keyframes revealDown {
    from {
        clip-path: polygon(0 0, 100% 0, 100% 0, 0 0);
    }
    to {
        clip-path: polygon(0 0, 100% 0, 100% 100%, 0 100%);
    }
}

.reveal {
    animation: reveal 0.8s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.reveal-down {
    animation: revealDown 0.8s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

/* ═══════════════════════════════════════════════════════════════ */
/* BLOB ANIMATIONS */
/* ═══════════════════════════════════════════════════════════════ */

@keyframes blobAnimation {
    0%, 100% {
        transform: translate(0, 0) scale(1);
    }
    25% {
        transform: translate(20px, -50px) scale(1.1);
    }
    50% {
        transform: translate(-20px, 20px) scale(0.9);
    }
    75% {
        transform: translate(50px, 50px) scale(1.05);
    }
}

.blob {
    animation: blobAnimation 8s cubic-bezier(0.42, 0, 0.58, 1) infinite;
}

/* ═══════════════════════════════════════════════════════════════ */
/* GRADIENT BORDER */
/* ═══════════════════════════════════════════════════════════════ */

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

.gradient-border {
    background: linear-gradient(90deg, var(--primary), var(--accent), var(--primary)) 0 0 / 200% 100%;
    animation: gradientBorder 3s ease infinite;
}

/* ═══════════════════════════════════════════════════════════════ */
/* CHECKBOX & TOGGLE ANIMATIONS */
/* ═══════════════════════════════════════════════════════════════ */

@keyframes checkmark {
    0% {
        stroke-dasharray: 0;
        stroke-dashoffset: 0;
    }
    100% {
        stroke-dasharray: 100;
        stroke-dashoffset: 0;
    }
}

.checkmark {
    animation: checkmark 0.6s cubic-bezier(0.65, 0, 0.45, 1) forwards;
}

/* ═══════════════════════════════════════════════════════════════ */
/* MEDIA QUERIES - REDUCE MOTION */
/* ═══════════════════════════════════════════════════════════════ */

@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;
    }
}

