/* Animations CSS - Card and UI transition animations */

/* Card entrance animations - fade only, no transform to preserve positioning */
.card {
    opacity: 0;
    animation: card-fade-in 0.6s ease-out forwards;
}

@keyframes card-fade-in {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

/* Grouping blob - subtle breathing animation, no heavy filters */
.grouping-blob {
    opacity: 0.85;
    animation: blob-breathe 8s ease-in-out infinite;
}

@keyframes blob-breathe {
    0%, 100% {
        stroke-width: 1.5;
        opacity: 0.4;
    }
    50% {
        stroke-width: 3;
        opacity: 1;
    }
}

/* Staggered card appearance */
.card:nth-child(1) { animation-delay: 0.1s; }
.card:nth-child(2) { animation-delay: 0.15s; }
.card:nth-child(3) { animation-delay: 0.2s; }
.card:nth-child(4) { animation-delay: 0.25s; }
.card:nth-child(5) { animation-delay: 0.3s; }
.card:nth-child(6) { animation-delay: 0.35s; }
.card:nth-child(7) { animation-delay: 0.4s; }
.card:nth-child(8) { animation-delay: 0.45s; }
.card:nth-child(9) { animation-delay: 0.5s; }
.card:nth-child(10) { animation-delay: 0.55s; }
.card:nth-child(11) { animation-delay: 0.6s; }
.card:nth-child(12) { animation-delay: 0.65s; }
.card:nth-child(13) { animation-delay: 0.7s; }
.card:nth-child(14) { animation-delay: 0.75s; }
.card:nth-child(15) { animation-delay: 0.8s; }

/* Nav hint fade animation */
.nav-hint {
    animation: hint-pulse 3s ease-in-out infinite;
}

@keyframes hint-pulse {
    0%, 100% {
        opacity: 0.7;
    }
    50% {
        opacity: 1;
    }
}

.nav-hint.hidden {
    animation: none;
}

/* Smooth scrolling for focus */
.card:focus-within {
    z-index: 10;
}

/* Hover effects - handled in main.css with proper transform preservation */

/* Link hover underline animation */
.external-link {
    position: relative;
}

.external-link::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    width: 0;
    height: 1px;
    background: var(--text-secondary);
    transition: width 0.3s ease;
}

.external-link:hover::after {
    width: 100%;
}

/* Reduced motion preference */
@media (prefers-reduced-motion: reduce) {
    .card {
        animation: none;
        opacity: 1;
    }

    .nav-hint {
        animation: none;
    }

    .grouping-blob {
        animation: none;
        filter: none;
    }

    .card,
    .pdf-link,
    .link-list a,
    .external-link::after {
        transition: none;
    }

    /* Hide canvas background entirely for reduced motion */
    #bg-canvas {
        display: none;
    }
}
