/* mascots.css - Recurring Pixel-Art Mascots Styling & Animations */

/* Base Wrapper & Image Styles */
.mascot-wrapper {
    display: inline-flex;
    align-items: center;
    position: relative;
    z-index: 10;
    pointer-events: none; /* Never block buttons or text */
    opacity: 0;
    transform: translateY(10px);
    transition: opacity 0.6s ease, transform 0.6s ease;
}

.mascot-wrapper.is-visible {
    opacity: 1;
    transform: translateY(0);
}

.mascot-img {
    height: 140px; /* Desktop size: 120-180px */
    width: auto;
    object-fit: contain;
    filter: drop-shadow(0 4px 6px rgba(0, 0, 0, 0.08));
    will-change: transform;
    transition: transform 0.3s ease;
}

/* Subtle idle breathing for all characters */
.mascot-wrapper.is-visible .mascot-breathe {
    animation: mascotBreathe 4s ease-in-out infinite;
}

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

/* Simulated natural blink via subtle squish */
.mascot-wrapper.is-blinking .mascot-img {
    transform: scaleY(0.88) !important;
    transition: transform 0.1s ease !important;
}

/* 1. Coffee Character (Contact Page) */
.mascot-coffee {
    margin: 1rem 0;
}
.coffee-steam {
    position: absolute;
    top: 15px;
    left: 50%;
    width: 12px;
    height: 12px;
    background: rgba(200, 200, 200, 0.5);
    border-radius: 50%;
    filter: blur(4px);
    opacity: 0;
    pointer-events: none;
    transform: translateX(-50%);
}
.mascot-coffee.is-visible .coffee-steam {
    animation: coffeeSteam 3s ease-out infinite;
}
@keyframes coffeeSteam {
    0% { opacity: 0; transform: translate(-50%, 0) scale(0.8); }
    50% { opacity: 0.6; }
    100% { opacity: 0; transform: translate(-50%, -25px) scale(1.6); }
}

/* 2. Laptop Character (Projects Section) */
.mascot-laptop {
    margin-left: 1rem;
}
.laptop-glow {
    position: absolute;
    bottom: 25px;
    left: 45%;
    width: 35px;
    height: 20px;
    background: rgba(59, 130, 246, 0.2);
    filter: blur(8px);
    pointer-events: none;
    animation: laptopGlow 4s ease-in-out infinite;
}
@keyframes laptopGlow {
    0%, 100% { opacity: 0.5; }
    50% { opacity: 0.9; }
}
.mascot-laptop.typing .mascot-img {
    animation: mascotTyping 0.15s ease-in-out infinite;
}
@keyframes mascotTyping {
    0%, 100% { transform: translateY(0) rotate(0deg); }
    50% { transform: translateY(-1px) rotate(0.5deg); }
}

/* 3. Waving Character (Contact Success) */
#mascot-waving-container {
    display: none;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
    margin-top: 2rem;
    opacity: 0;
    transform: translateY(15px);
    transition: opacity 0.5s ease, transform 0.5s ease;
}
#mascot-waving-container.visible {
    display: flex;
    opacity: 1;
    transform: translateY(0);
}
.mascot-waving.is-visible .mascot-img {
    animation: mascotWave 1.5s ease-in-out infinite;
}
@keyframes mascotWave {
    0%, 100% { transform: rotate(0deg); }
    25% { transform: rotate(8deg); }
    75% { transform: rotate(-8deg); }
}
.waving-message {
    font-family: 'Caveat', cursive, sans-serif;
    font-size: 2rem;
    color: var(--text-color, #111);
    text-align: center;
    line-height: 1.2;
}

/* Mobile Responsiveness */
@media (max-width: 768px) {
    .mascot-img {
        height: 100px; /* Scaled down for mobile */
    }
    .mascot-laptop {
        margin-left: 0;
        margin-top: 1rem;
        display: block;
    }
}

/* Respect prefers-reduced-motion */
@media (prefers-reduced-motion: reduce) {
    .mascot-wrapper *,
    .mascot-wrapper .mascot-img {
        animation: none !important;
        transition: none !important;
        transform: none !important;
    }
}
