/*!
 * craft-animate.css — entrance animations and easing tokens
 * Craft Framework · Copyright (c) 2026 Antonio Santos · MIT
 *
 * Apply with a class (`.craft-fade-in-up`) or reference the keyframes
 * directly from your own rules. Everything here is disabled automatically for
 * visitors who ask for reduced motion.
 */

:root {
    --craft-ease-out-expo: cubic-bezier(0.16, 1, 0.3, 1);
    --craft-ease-out-back: cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes craft-fade-in-down {
    from { opacity: 0; transform: translateY(-16px); }
    to   { opacity: 1; transform: translateY(0); }
}

@keyframes craft-fade-in-up {
    from { opacity: 0; transform: translateY(16px); }
    to   { opacity: 1; transform: translateY(0); }
}

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

@keyframes craft-scale-in {
    from { opacity: 0; transform: scale(0.96); }
    to   { opacity: 1; transform: scale(1); }
}

@keyframes craft-pulse-dot {
    0%, 100% { opacity: 1; transform: scale(1); }
    50%      { opacity: 0.5; transform: scale(0.85); }
}

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

.craft-fade-in-down { animation: craft-fade-in-down 0.7s var(--craft-ease-out-expo) both; }
.craft-fade-in-up   { animation: craft-fade-in-up 0.8s var(--craft-ease-out-expo) both; }
.craft-fade-in      { animation: craft-fade-in 0.5s var(--craft-ease-out-expo) both; }
.craft-scale-in     { animation: craft-scale-in 0.4s var(--craft-ease-out-back) both; }
.craft-spin         { animation: craft-spin 1s linear infinite; }

/* Stagger children without writing a rule per item. */
.craft-stagger > *  { animation: craft-fade-in-up 0.6s var(--craft-ease-out-expo) both; }
.craft-stagger > *:nth-child(1) { animation-delay: 0.05s; }
.craft-stagger > *:nth-child(2) { animation-delay: 0.10s; }
.craft-stagger > *:nth-child(3) { animation-delay: 0.15s; }
.craft-stagger > *:nth-child(4) { animation-delay: 0.20s; }
.craft-stagger > *:nth-child(5) { animation-delay: 0.25s; }
.craft-stagger > *:nth-child(6) { animation-delay: 0.30s; }

/* Revealed by craft.js as the element scrolls into view. */
.craft-reveal {
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.6s var(--craft-ease-out-expo),
                transform 0.6s var(--craft-ease-out-expo);
}
.craft-reveal.is-visible { opacity: 1; transform: none; }

@media (prefers-reduced-motion: reduce) {
    .craft-fade-in-down,
    .craft-fade-in-up,
    .craft-fade-in,
    .craft-scale-in,
    .craft-spin,
    .craft-stagger > * {
        animation: none;
    }
    .craft-reveal { opacity: 1; transform: none; transition: none; }
}
