/* ==========================================================================
   CoderDojo Kamiyacho — Decorative Animations (Warm Dojo edition)
   ========================================================================== */

/* ---------- Gentle Float (for decorative SVGs) ---------- */
@keyframes gentle-float {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-8px); }
}

/* ---------- Gentle Spin (for star/sparkle) ---------- */
@keyframes gentle-spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* ---------- Wave Drift ---------- */
@keyframes wave-drift {
    0%   { transform: translateX(0); }
    100% { transform: translateX(-33.333%); }
}

/* ---------- Scroll Hint ---------- */
@keyframes scroll-hint {
    0%, 100% { transform: translateY(0); opacity: 1; }
    50% { transform: translateY(6px); opacity: 0.5; }
}

/* ---------- Decoration Base ---------- */
.deco {
    position: absolute;
    pointer-events: none;
}

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

.deco--float-delay {
    animation: gentle-float 4s ease-in-out infinite;
    animation-delay: 2s;
}

.deco--spin-slow {
    animation: gentle-spin 20s linear infinite;
}

/* ---------- Scroll Indicator ---------- */
.scroll-indicator__arrow {
    animation: scroll-hint 2s ease-in-out infinite;
}

/* ---------- Page Top Button ---------- */
.page-top-btn {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    z-index: 900;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 48px;
    height: 48px;
    border-radius: 50%;
    border: none;
    background: var(--color-dojo-purple, #7A2684);
    color: #ffffff;
    box-shadow: 0 4px 12px rgba(0,0,0,0.12);
    cursor: pointer;
    opacity: 0;
    visibility: hidden;
    transform: translateY(12px);
    transition: opacity 0.3s ease, visibility 0.3s ease, transform 0.3s ease, background-color 0.2s ease;
}

.page-top-btn.is-visible {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.page-top-btn:hover {
    background: #5c1d63;
    transform: translateY(-2px);
}

.page-top-btn.is-visible:hover {
    transform: translateY(-2px);
}

/* ---------- Typing Effect ---------- */
.typing {
    display: inline;
}

.typing__cursor {
    display: inline-block;
    width: 2px;
    height: 1em;
    background: currentColor;
    margin-left: 2px;
    vertical-align: text-bottom;
    animation: blink-cursor 0.7s step-end infinite;
}

.typing__cursor--done {
    animation: blink-cursor 0.7s step-end 3;
    animation-fill-mode: forwards;
    opacity: 0;
}

@keyframes blink-cursor {
    0%, 100% { opacity: 0; }
    50% { opacity: 1; }
}

/* ---------- Scroll Parallax Decorations ---------- */
.scroll-deco {
    position: fixed;
    inset: 0;
    z-index: 10;
    pointer-events: none;
}

.scroll-deco__item {
    position: absolute;
    opacity: 0.45;
    will-change: transform;
}

@media (max-width: 1399px) {
    .scroll-deco__item {
        opacity: 0.3;
    }
}

@media (max-width: 767px) {
    .scroll-deco {
        display: none;
    }
}

/* ---------- Reduced Motion ---------- */
@media (prefers-reduced-motion: reduce) {
    .deco--float,
    .deco--float-delay,
    .deco--spin-slow,
    .section-wave__layer {
        animation: none !important;
    }

    .scroll-indicator__arrow {
        animation: none !important;
    }

    .page-top-btn {
        transition: none !important;
    }

    .fade-in-up {
        opacity: 1 !important;
        transform: none !important;
        transition: none !important;
    }

    .menu-toggle__bar {
        transition: none !important;
    }

    .post-card,
    .about-card,
    .cta-card,
    .btn {
        transition: none !important;
    }

    .post-card__thumbnail img {
        transition: none !important;
    }

    .scroll-deco__item {
        transform: none !important;
    }
}
