/* ============================================================
   MOBILE.CSS  –  Clean, single-source-of-truth mobile styles
   ============================================================ */

/* ── Overlay backdrop ── */
.mobile-menu-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.65);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    z-index: 1040;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.35s ease, visibility 0.35s ease;
}

.mobile-menu-overlay.active {
    opacity: 1;
    visibility: visible;
}

/* ── Hamburger button ── */
.navbar-toggler {
    display: none;
    position: relative;
    z-index: 1060;
    border: none;
    background: transparent;
    padding: 0;
    cursor: pointer;
    width: 40px;
    height: 40px;
    align-items: center;
    justify-content: center;
    border-radius: 10px;
    transition: background 0.2s ease;
}

.navbar-toggler:hover {
    background: rgba(6, 182, 212, 0.1);
}

/* Three-bar icon drawn with spans */
.navbar-toggler-icon {
    position: relative;
    display: block;
    width: 22px;
    height: 2px;
    background: var(--text-primary);
    border-radius: 2px;
    transition: background 0.3s ease, transform 0.35s cubic-bezier(0.23, 1, 0.32, 1);
}

.navbar-toggler-icon::before,
.navbar-toggler-icon::after {
    content: '';
    position: absolute;
    left: 0;
    width: 22px;
    height: 2px;
    background: var(--text-primary);
    border-radius: 2px;
    transition: transform 0.35s cubic-bezier(0.23, 1, 0.32, 1),
                top 0.35s cubic-bezier(0.23, 1, 0.32, 1),
                bottom 0.35s cubic-bezier(0.23, 1, 0.32, 1),
                width 0.35s ease;
}

.navbar-toggler-icon::before { top: -7px; }
.navbar-toggler-icon::after  { bottom: -7px; }

/* Active → X shape */
.navbar-toggler.active .navbar-toggler-icon {
    background: transparent;
}

.navbar-toggler.active .navbar-toggler-icon::before {
    top: 0;
    transform: rotate(45deg);
    background: var(--accent-primary);
}

.navbar-toggler.active .navbar-toggler-icon::after {
    bottom: 0;
    transform: rotate(-45deg);
    background: var(--accent-primary);
}

/* ── Slide-in nav drawer ── */
.navbar-collapse {
    z-index: 1050;
    /* Desktop: no special styles needed */
}

/* ── Desktop nav ── */
@media (min-width: 992px) {
    .navbar-toggler { display: none !important; }
    .mobile-menu-overlay { display: none !important; }

    .navbar-collapse {
        position: static !important;
        height: auto !important;
        width: auto !important;
        background: transparent !important;
        padding: 0 !important;
        box-shadow: none !important;
        transform: none !important;
        overflow: visible !important;
    }

    .navbar-nav {
        flex-direction: row !important;
        align-items: center !important;
        gap: 0.25rem !important;
        margin-top: 0 !important;
    }

    .nav-item { width: auto; margin: 0 0.25rem; }

    .nav-link {
        padding: 0.5rem 0.75rem !important;
        border-bottom: none !important;
        font-size: 1rem !important;
    }

    .resume-btn {
        margin-top: 0 !important;
        width: auto !important;
    }
}

/* ── Mobile nav drawer ── */
@media (max-width: 991px) {
    .navbar-toggler {
        display: flex;
    }

    .navbar-collapse {
        position: fixed;
        top: 0;
        right: -300px;
        width: 280px;
        height: 100vh;
        background: var(--bg-card);
        border-left: 1px solid var(--border-color);
        padding: 0;
        overflow-y: auto;
        box-shadow: -8px 0 32px rgba(0, 0, 0, 0.4);
        transition: right 0.38s cubic-bezier(0.23, 1, 0.32, 1);
        display: block !important;
    }

    .navbar-collapse.show {
        right: 0;
    }

    /* Drawer header area */
    .navbar-collapse::before {
        content: 'Menu';
        display: block;
        padding: 1.5rem 1.5rem 1rem;
        font-size: 0.7rem;
        font-weight: 700;
        letter-spacing: 0.12em;
        text-transform: uppercase;
        color: var(--text-muted);
        border-bottom: 1px solid var(--border-color);
        margin-bottom: 0.5rem;
    }

    .navbar-nav {
        flex-direction: column !important;
        align-items: stretch !important;
        gap: 0 !important;
        margin-top: 0 !important;
        padding: 0.5rem 1rem 1.5rem;
        width: 100%;
    }

    .nav-item {
        width: 100%;
        margin: 0;
    }

    .nav-link {
        display: flex !important;
        align-items: center;
        padding: 0.85rem 0.75rem !important;
        font-size: 1rem !important;
        font-weight: 500;
        color: var(--text-secondary) !important;
        border-radius: 10px;
        border-bottom: none !important;
        transition: color 0.2s ease, background 0.2s ease, transform 0.2s ease;
        position: relative;
    }

    .nav-link::before {
        content: '';
        position: absolute;
        left: 0;
        top: 50%;
        transform: translateY(-50%) scaleY(0);
        width: 3px;
        height: 60%;
        background: var(--accent-primary);
        border-radius: 0 3px 3px 0;
        transition: transform 0.2s ease;
    }

    .nav-link:hover,
    .nav-link:focus {
        color: var(--accent-primary) !important;
        background: rgba(6, 182, 212, 0.07);
        transform: translateX(4px);
    }

    .nav-link:hover::before {
        transform: translateY(-50%) scaleY(1);
    }

    /* Stagger nav items when menu opens */
    .navbar-collapse.show .nav-item {
        animation: navItemSlide 0.3s ease both;
    }
    .navbar-collapse.show .nav-item:nth-child(1) { animation-delay: 0.05s; }
    .navbar-collapse.show .nav-item:nth-child(2) { animation-delay: 0.1s; }
    .navbar-collapse.show .nav-item:nth-child(3) { animation-delay: 0.15s; }
    .navbar-collapse.show .nav-item:nth-child(4) { animation-delay: 0.2s; }
    .navbar-collapse.show .nav-item:nth-child(5) { animation-delay: 0.25s; }

    @keyframes navItemSlide {
        from { opacity: 0; transform: translateX(20px); }
        to   { opacity: 1; transform: translateX(0); }
    }

    .resume-btn {
        display: block !important;
        margin: 0.75rem 0.75rem 0 !important;
        width: calc(100% - 1.5rem) !important;
        text-align: center !important;
        padding: 0.75rem !important;
    }

    /* Prevent body scroll when menu is open */
    body.menu-open {
        overflow: hidden;
    }

    /* Scroll indicator: lower on mobile */
    .scroll-indicator {
        bottom: 1.5rem;
    }
}

/* ── Navbar scrolled state ── */
.navbar {
    position: fixed;
    width: 100%;
    top: 0;
    left: 0;
    z-index: 1100;
    transition: padding 0.3s ease, box-shadow 0.3s ease, background 0.3s ease;
}

.navbar.scrolled {
    padding-top: 0.4rem;
    padding-bottom: 0.4rem;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.25);
    background: var(--bg-overlay);
}

/* ── Responsive typography & layout ── */
@media (max-width: 991px) {
    .hero-section {
        padding: 80px 0 50px;
    }
    .hero-name     { font-size: 2.4rem; }
    .hero-title    { font-size: 1.4rem; }
    .hero-subtitle { font-size: 1rem; }
    .hero-actions  { flex-direction: column; gap: 10px; }
    .hero-actions .btn { width: 100%; max-width: 280px; }
    .section-title { font-size: 2rem; }
    .about-content { flex-direction: column; gap: 2rem; }
    .about-text, .about-image { width: 100%; }
    .contact-content { grid-template-columns: 1fr; gap: 2rem; }
    .skills-grid { grid-template-columns: 1fr; }
}

@media (max-width: 768px) {
    .container { padding: 0 1rem; }
    .hero-name     { font-size: 2rem; }
    .hero-title    { font-size: 1.2rem; }
    .section-title { font-size: 1.75rem; }
    .experience-cards { grid-template-columns: 1fr; }
    .projects-grid    { grid-template-columns: 1fr; }
    .footer-content   { flex-direction: column; text-align: center; gap: 1rem; }
    .footer-social    { justify-content: center; }
}

@media (max-width: 480px) {
    .hero-name     { font-size: 1.75rem; }
    .section-title { font-size: 1.5rem; }
    .contact-form  { padding: 1.25rem; }
    .scroll-indicator { bottom: 1rem; }
}

