/* =========================================
   MOBILE / RESPONSIVE LAYOUT (FINAL FIX)
   ========================================= */

/* --- 1. ANIMATION DEFINITION --- */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(15px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* --- 2. TABLET / SMALL LAPTOP (Max-width: 900px) --- */
@media (max-width: 900px) {

    .container,
    .nav-content-wrapper {
        max-width: 100%;
    }
}

/* =========================================
   📱 UNIFIED MOBILE (MAX-WIDTH: 768px)
   ========================================= */
@media (max-width: 768px) {

    /* -------------------------------------
       HEADER / NAV TOP BAR (combined)
    -------------------------------------- */
    header {
        display: flex !important;
        flex-direction: column !important;
        /* Stack items vertically */
        align-items: center !important;
        /* Center search/links horizontally */
        padding: 15px 10px !important;
        /* Top padding reserves space for Logo/Hamburger */
        position: relative !important;
        height: auto !important;
        gap: 15px !important;
    }

    header .logo {
        height: 40px !important;
    }

    .hamburger {
        position: absolute !important;
        top: 22px !important;
        left: 20px !important;
        display: flex !important;
        margin: 0 !important;
        order: unset !important;
    }

    /* 4. NAV MENU (Drops down below everything else) */
    nav {
        display: none !important;
        /* Hidden until active */
        width: 100% !important;
        flex-direction: column !important;
        text-align: center !important;
        gap: 15px !important;
        padding: 10px 0 !important;
        order: unset !important;
    }

    /* JS adds 'active' class to show menu */
    nav.active {
        display: flex !important;
    }

    nav a {
        font-size: 1.1rem !important;
        padding: 10px 0 !important;
        border-bottom: none !important;
        width: 100% !important;
        display: block !important;
        margin: 0 auto !important;
    }

    .search-box {
        width: 85% !important;
        /* compact, not full width */
        max-width: 260px !important;
        /* ideal size for mobile */
        margin: 0 auto !important;
        /* center nicely */
        padding: 10px 16px !important;
        /* comfortable touch size */
        border-radius: 26px !important;
        /* rounded but not too pill */
        background: rgba(255, 255, 255, 0.07) !important;
        gap: 10px !important;
    }

    .search-box input {
        font-size: 0.95rem !important;
    }

    .search-box i {
        font-size: 1.1rem !important;
    }

    .search-btn {
        padding: 0 !important;
        margin: 0 !important;
    }

    .category-scroll {
        mask-image: linear-gradient(to right, black 85%, transparent 100%);
        -webkit-mask-image: linear-gradient(to right, black 85%, transparent 100%);
    }

    /* -------------------------------------
       GRID / LAYOUT
    -------------------------------------- */
    .grid-layout {
        grid-template-columns: 1fr !important;
        gap: 20px !important;
    }

    .container {
        padding: 0 15px !important;
        margin-top: 1rem;
    }

    /* -------------------------------------
       CARD ANIMATIONS
    -------------------------------------- */
    .project-card {
        animation: fadeInUp 0.5s ease-out forwards;
        opacity: 0;
    }

    .project-card:nth-child(1) {
        animation-delay: 0.1s;
    }

    .project-card:nth-child(2) {
        animation-delay: 0.2s;
    }

    .project-card:nth-child(3) {
        animation-delay: 0.3s;
    }

    .project-card:nth-child(4) {
        animation-delay: 0.4s;
    }

    .project-card:nth-child(5) {
        animation-delay: 0.5s;
    }

    /* -------------------------------------
       FOOTER + TEXT
    -------------------------------------- */
    .card-footer {
        flex-wrap: wrap;
        gap: 10px;
    }

    .stat {
        font-size: 0.7rem;
    }

    .hero-card {
        padding: 1.5rem 1rem;
    }

    .neon-text {
        font-size: 1.3rem;
    }

    .action-row {
        flex-direction: column;
        gap: 10px;
    }
}