/* ============================================================
   Home page animations — subtle, modern, mobile-friendly.
   All effects are decorative; do not change any DOM/JS logic.
   ============================================================ */

/* --------- Keyframes --------- */
@keyframes mj-fade-up {
    from { opacity: 0; transform: translate3d(0, 24px, 0); }
    to   { opacity: 1; transform: translate3d(0, 0, 0); }
}

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

@keyframes mj-pop-in {
    0%   { opacity: 0; transform: scale(0.94); }
    60%  { opacity: 1; transform: scale(1.02); }
    100% { transform: scale(1); }
}

@keyframes mj-float {
    0%, 100% { transform: translate3d(0, 0, 0); }
    50%      { transform: translate3d(0, -10px, 0); }
}

@keyframes mj-blob-drift {
    0%, 100% { transform: translate(-50%, -50%) scale(1); }
    50%      { transform: translate(-50%, -55%) scale(1.08); }
}

@keyframes mj-shimmer {
    0%   { background-position: -200% 0; }
    100% { background-position: 200% 0; }
}

@keyframes mj-pulse-ring {
    0%   { box-shadow: 0 0 0 0 rgba(99, 49, 148, 0.45); }
    70%  { box-shadow: 0 0 0 14px rgba(99, 49, 148, 0); }
    100% { box-shadow: 0 0 0 0 rgba(99, 49, 148, 0); }
}

@keyframes mj-gradient-shift {
    0%, 100% { background-position: 0% 50%; }
    50%      { background-position: 100% 50%; }
}

/* --------- Hero search bar entrance --------- */
.mj-hero-search {
    animation: mj-pop-in 0.7s cubic-bezier(0.22, 1, 0.36, 1) both;
}

/* Soft pulse on the main "Find Jobs" CTA */
.mj-cta-pulse {
    position: relative;
    animation: mj-pulse-ring 2.4s ease-out infinite;
}
.mj-cta-pulse:hover {
    animation: none;
}

/* --------- Scroll reveal (used with IntersectionObserver) --------- */
.mj-reveal {
    opacity: 0;
    transform: translate3d(0, 28px, 0);
    transition: opacity 0.7s cubic-bezier(0.22, 1, 0.36, 1),
                transform 0.7s cubic-bezier(0.22, 1, 0.36, 1);
    will-change: opacity, transform;
}
.mj-reveal.is-visible {
    opacity: 1;
    transform: translate3d(0, 0, 0);
}

/* Stagger children: data-mj-stagger increases delay per index */
.mj-reveal[data-mj-delay="1"] { transition-delay: 0.08s; }
.mj-reveal[data-mj-delay="2"] { transition-delay: 0.16s; }
.mj-reveal[data-mj-delay="3"] { transition-delay: 0.24s; }
.mj-reveal[data-mj-delay="4"] { transition-delay: 0.32s; }
.mj-reveal[data-mj-delay="5"] { transition-delay: 0.40s; }
.mj-reveal[data-mj-delay="6"] { transition-delay: 0.48s; }

/* --------- Section title accent strip shimmer --------- */
.mj-title-strip {
    background: linear-gradient(
        90deg,
        #FFC107 0%,
        #FFD54F 35%,
        #FFFFFF 50%,
        #FFD54F 65%,
        #FFC107 100%
    );
    background-size: 200% 100%;
    animation: mj-shimmer 4.5s linear infinite;
}

.mj-divider-shimmer {
    background: linear-gradient(
        90deg,
        #FFC107 0%,
        #FFFFFF 50%,
        #FFC107 100%
    );
    background-size: 200% 100%;
    animation: mj-shimmer 3.5s linear infinite;
}

/* --------- Company logo card lift --------- */
.mj-logo-card {
    transition: transform 0.45s cubic-bezier(0.22, 1, 0.36, 1),
                box-shadow 0.45s ease,
                border-color 0.35s ease;
}
.mj-logo-card img {
    transition: transform 0.5s cubic-bezier(0.22, 1, 0.36, 1),
                filter 0.4s ease;
    filter: grayscale(20%);
}
.mj-logo-card:hover img {
    transform: scale(1.08);
    filter: grayscale(0%);
}

/* --------- Job card subtle floating shadow on hover --------- */
.mj-job-card {
    transition: transform 0.5s cubic-bezier(0.22, 1, 0.36, 1),
                box-shadow 0.5s ease;
}
.mj-job-card::after {
    content: "";
    position: absolute;
    inset: 0;
    border-radius: inherit;
    pointer-events: none;
    box-shadow: 0 0 0 0 rgba(99, 49, 148, 0);
    transition: box-shadow 0.5s ease;
}
.mj-job-card:hover::after {
    box-shadow: 0 30px 60px -20px rgba(99, 49, 148, 0.25);
}
.mj-job-card .save-btn {
    transition: transform 0.25s ease, color 0.25s ease;
}
.mj-job-card .save-btn:hover {
    transform: scale(1.15) rotate(-6deg);
}

/* --------- Mobile app section floating blob & store buttons --------- */
.mj-blob {
    animation: mj-blob-drift 8s ease-in-out infinite;
}

.mj-float-slow {
    animation: mj-float 6s ease-in-out infinite;
}

.mj-store-btn {
    transition: transform 0.35s cubic-bezier(0.22, 1, 0.36, 1),
                background-color 0.3s ease,
                box-shadow 0.35s ease;
}
.mj-store-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 12px 30px -8px rgba(255, 193, 7, 0.35);
}

/* --------- Animated gradient text for hero / promo headings --------- */
.mj-gradient-text {
    background: linear-gradient(
        90deg,
        #FFFFFF 0%,
        #FFD54F 50%,
        #FFFFFF 100%
    );
    background-size: 200% auto;
    -webkit-background-clip: text;
            background-clip: text;
    color: transparent;
    animation: mj-gradient-shift 6s ease-in-out infinite;
}

/* --------- Mobile tuning --------- */
@media (max-width: 640px) {
    /* Tone down on small screens to keep things snappy */
    .mj-job-card:hover { transform: none; }
    .mj-logo-card:hover img { transform: scale(1.04); }
    .mj-blob { animation-duration: 10s; }
    .mj-cta-pulse { animation-duration: 3s; }
}

/* --------- Respect user motion preferences --------- */
@media (prefers-reduced-motion: reduce) {
    .mj-hero-search,
    .mj-reveal,
    .mj-blob,
    .mj-float-slow,
    .mj-title-strip,
    .mj-divider-shimmer,
    .mj-gradient-text,
    .mj-cta-pulse {
        animation: none !important;
        transition: none !important;
    }
    .mj-reveal {
        opacity: 1;
        transform: none;
    }
    .mj-gradient-text {
        color: #FFD54F;
    }
}
