/* ========================================
   Animations & Keyframes
   ======================================== */

/* Staggered reveal delays */
[data-reveal]:nth-child(1) { transition-delay: 0s; }
[data-reveal]:nth-child(2) { transition-delay: 0.1s; }
[data-reveal]:nth-child(3) { transition-delay: 0.2s; }
[data-reveal]:nth-child(4) { transition-delay: 0.3s; }
[data-reveal]:nth-child(5) { transition-delay: 0.4s; }
[data-reveal]:nth-child(6) { transition-delay: 0.5s; }

/* Hero Text Reveal */
.hero-title .title-line {
    opacity: 0;
    transform: translateY(40px);
    transition: opacity 0.8s ease, transform 0.8s ease;
}

.hero-title .title-line:nth-child(1) {
    transition-delay: 0.2s;
}

.hero-title .title-line:nth-child(2) {
    transition-delay: 0.4s;
}

.hero.loaded .hero-title .title-line {
    opacity: 1;
    transform: translateY(0);
}

.hero-subtitle {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.8s ease 0.6s, transform 0.8s ease 0.6s;
}

.hero.loaded .hero-subtitle {
    opacity: 1;
    transform: translateY(0);
}

.hero-cta {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.8s ease 0.8s, transform 0.8s ease 0.8s;
}

.hero.loaded .hero-cta {
    opacity: 1;
    transform: translateY(0);
}

.scroll-indicator {
    opacity: 0;
    transition: opacity 1s ease 1.2s;
}

.hero.loaded .scroll-indicator {
    opacity: 1;
}

/* Pulse Animation */
@keyframes pulse {
    0%, 100% {
        opacity: 1;
        transform: scale(1);
    }
    50% {
        opacity: 0.8;
        transform: scale(1.05);
    }
}

.btn-primary:hover {
    animation: pulse 1s ease infinite;
}

/* Float Animation */
@keyframes float {
    0%, 100% {
        transform: translateY(0);
    }
    50% {
        transform: translateY(-10px);
    }
}

.service-icon {
    animation: float 3s ease-in-out infinite;
    animation-play-state: paused;
}

.service-card:hover .service-icon {
    animation-play-state: running;
}

/* Glow Animation */
@keyframes glow {
    0%, 100% {
        box-shadow: 0 0 20px rgba(232, 90, 79, 0.2);
    }
    50% {
        box-shadow: 0 0 40px rgba(232, 90, 79, 0.4);
    }
}

.pricing-featured {
    animation: glow 2s ease-in-out infinite;
}

/* Counter Animation */
.counter {
    display: inline-block;
}

.counter.counting {
    animation: countUp 0.05s ease-out;
}

@keyframes countUp {
    from {
        transform: translateY(5px);
        opacity: 0.5;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

/* Slide In Animations */
@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 slideInUp {
    from {
        opacity: 0;
        transform: translateY(50px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

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

/* Fade Animations */
@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

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

/* Scale Animations */
@keyframes scaleIn {
    from {
        opacity: 0;
        transform: scale(0.9);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

/* Rotation Animation */
@keyframes rotate {
    from {
        transform: rotate(0deg);
    }
    to {
        transform: rotate(360deg);
    }
}

/* Border Animation for Cards */
@keyframes borderGlow {
    0%, 100% {
        border-color: var(--color-glass-border);
    }
    50% {
        border-color: var(--color-accent);
    }
}

/* Typing cursor */
@keyframes blink {
    0%, 50% {
        opacity: 1;
    }
    51%, 100% {
        opacity: 0;
    }
}

/* Menu Animation */
.nav-overlay-content {
    opacity: 0;
    transform: scale(0.95);
    transition: opacity 0.3s ease 0.1s, transform 0.3s ease 0.1s;
}

.nav-overlay.active .nav-overlay-content {
    opacity: 1;
    transform: scale(1);
}

/* Parallax effect for backgrounds */
.parallax-bg {
    transition: transform 0.1s linear;
}

/* Smooth reveal for sections */
.section {
    opacity: 1;
}

/* Button hover effects */
.btn {
    position: relative;
    overflow: hidden;
}

.btn::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(
        120deg,
        transparent 0%,
        rgba(255, 255, 255, 0.1) 50%,
        transparent 100%
    );
    transform: translateX(-100%);
    transition: transform 0.6s ease;
}

.btn:hover::after {
    transform: translateX(100%);
}

/* Card hover lift effect */
.service-card,
.pricing-card,
.testimonial-card,
.problem-card {
    transition: transform 0.3s ease, box-shadow 0.3s ease, border-color 0.3s ease;
}

/* Smooth scroll indicator animation */
.scroll-indicator {
    animation: fadeInUp 1s ease 1.5s both;
}

/* Image placeholder shimmer */
@keyframes shimmer {
    0% {
        background-position: -200% 0;
    }
    100% {
        background-position: 200% 0;
    }
}

.image-placeholder {
    position: relative;
    overflow: hidden;
}

.image-placeholder::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(
        90deg,
        transparent 0%,
        rgba(255, 255, 255, 0.05) 50%,
        transparent 100%
    );
    background-size: 200% 100%;
    animation: shimmer 2s infinite;
}

/* Focus states for accessibility */
.btn:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible,
a:focus-visible {
    outline: 2px solid var(--color-accent);
    outline-offset: 2px;
}

/* Reduced motion preferences */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }

    .scroll-line {
        animation: none;
    }

    html {
        scroll-behavior: auto;
    }

    [data-reveal] {
        opacity: 1;
        transform: none;
    }

    .hero-title .title-line,
    .hero-subtitle,
    .hero-cta,
    .scroll-indicator {
        opacity: 1;
        transform: none;
    }
}

/* Loading state animation */
.loading {
    position: relative;
    pointer-events: none;
}

.loading::after {
    content: '';
    position: absolute;
    inset: 0;
    background: var(--color-primary);
    display: flex;
    align-items: center;
    justify-content: center;
}

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

/* Form submit animation */
.btn[type="submit"].submitting {
    pointer-events: none;
    opacity: 0.7;
}

.btn[type="submit"].submitting::before {
    content: '';
    width: 20px;
    height: 20px;
    border: 2px solid transparent;
    border-top-color: currentColor;
    border-radius: 50%;
    animation: spin 0.6s linear infinite;
    margin-right: 8px;
}

/* Success animation */
@keyframes checkmark {
    0% {
        stroke-dashoffset: 100;
    }
    100% {
        stroke-dashoffset: 0;
    }
}

/* Quote marks animation */
.testimonial-quote {
    animation: fadeIn 0.5s ease;
}

/* Stats counter glow */
.stat-number {
    text-shadow: 0 0 20px rgba(232, 90, 79, 0.3);
}

/* Pricing card entrance */
.pricing-card {
    animation: fadeInUp 0.6s ease both;
}

.pricing-card:nth-child(1) {
    animation-delay: 0.1s;
}

.pricing-card:nth-child(2) {
    animation-delay: 0.2s;
}

.pricing-card:nth-child(3) {
    animation-delay: 0.3s;
}

/* Link underline animation */
.contact-item a {
    position: relative;
}

.contact-item a::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    width: 0;
    height: 1px;
    background: var(--color-accent);
    transition: width 0.3s ease;
}

.contact-item a:hover::after {
    width: 100%;
}
