/* ==========================================================================
   DEV KUMAR RAY - CYBERSECURITY & AI DEVELOPER PORTFOLIO
   Responsive Stylesheet (responsive.css)
   ========================================================================== */

/* ==========================================================================
   MOBILE BREAKPOINT (Max-Width: 767px)
   MOBILE-ONLY RULES — Desktop is controlled by style.css
   ========================================================================== */
@media (max-width: 767px) {
    /* Mobile navigation - hide desktop nav, show hamburger */
    .mobile-menu-toggle {
        display: flex;
        z-index: calc(var(--z-header) - 1);
    }
    .nav-links {
        display: none;
    }

    /* Mobile hero section - content-driven, no large gaps */
    .hero-section {
        min-height: auto !important;
        padding-top: calc(var(--header-height) + 16px);
        padding-bottom: clamp(24px, 6vw, 40px);
        align-items: flex-start;
    }
    .hero-container {
        display: flex;
        flex-direction: column;
        gap: 16px;
    }

    /* Mobile hero spacing - compact */
    .hero-status-badge {
        margin-top: 12px;
        margin-bottom: 12px;
    }
    .hero-greeting {
        margin-bottom: 6px;
    }
    .hero-title {
        margin-bottom: 10px;
        font-size: clamp(1.8rem, 9vw, 2.8rem);
    }
    .hero-typing {
        margin-bottom: 14px;
        min-height: 1.5em;
        font-size: clamp(0.9rem, 3.5vw, 1.15rem);
    }
    .hero-description {
        margin-bottom: 18px;
        font-size: clamp(0.9rem, 2.5vw, 1rem);
    }
    .btn-group.hero-cta {
        margin-bottom: 14px;
    }
    .hero-socials {
        margin-bottom: 20px;
    }

    /* Mobile hero terminal hidden */
    .hero-visual-wrapper {
        display: none;
    }

    /* Mobile About Me - stack biography above info cards, full content width */
    .about-grid {
        grid-template-columns: minmax(0, 1fr);
        gap: 20px;
    }
    .about-info-cards {
        display: grid;
        grid-template-columns: minmax(0, 1fr);
        gap: 12px;
    }
    .about-info-card {
        min-width: 0;
        max-width: 100%;
    }

    /* Mobile container */
    .container {
        padding: 0 20px;
    }

    /* Mobile section header */
    .section-header {
        margin-bottom: clamp(16px, 4vw, 28px);
    }

    /* Mobile cards */
    .card {
        padding: 20px;
    }

    /* Mobile grids */
    .skill-items,
    .projects-grid,
    .certificates-grid,
    .contact-grid,
    .about-grid {
        grid-template-columns: 1fr;
    }
    .project-card {
        min-width: 0;
    }
    .contact-card-item {
        padding: 16px 18px;
        gap: 12px;
        justify-content: flex-start;
        flex-wrap: nowrap;
        overflow: hidden;
    }
    .contact-item-left {
        flex: 1 0 0%;
        min-width: 0;
    }
    .contact-item-icon {
        width: 40px;
        height: 40px;
        font-size: 1.1rem;
    }
    .contact-item-value {
        font-size: 0.95rem;
    }
    .contact-action-btn {
        padding: 7px 10px;
        font-size: 0.85rem;
    }

    /* Mobile timeline */
    .timeline {
        padding-left: 28px;
    }
    .timeline-dot {
        left: -32px;
    }
    .timeline-card {
        padding: 20px;
    }

    /* Mobile buttons - full width */
    .btn-group {
        flex-direction: column;
        width: 100%;
    }
    .btn-group .btn {
        width: 100%;
        text-align: center;
    }

    /* Mobile gallery */
    .gallery-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
    }
    .gallery-item img {
        height: 160px;
    }
    .lightbox-btn {
        width: 36px;
        height: 36px;
        font-size: 0.95rem;
    }
    .lightbox-prev { left: 8px; }
    .lightbox-next { right: 8px; }
    .lightbox-close-btn { top: 10px; right: 10px; }

    /* Mobile footer */
    .footer {
        padding: 26px 18px calc(18px + env(safe-area-inset-bottom));
        text-align: left;
    }
    .footer-nav {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }
    .footer-socials {
        justify-content: flex-start;
        gap: 10px;
    }
    .footer-roles {
        display: none;
    }
    #back-to-top {
        right: 16px;
        bottom: calc(16px + env(safe-area-inset-bottom));
        width: 38px;
        height: 38px;
        font-size: 1rem;
    }

    /* ==========================================================================
       MOBILE NAV DRAWER (Active state)
       ========================================================================== */
    .nav-links.active {
        display: flex;
        position: fixed;
        top: 0;
        left: 0;
        width: 100vw;
        height: 100vh;
        height: 100dvh;
        background: var(--bg-main);
        backdrop-filter: blur(24px);
        -webkit-backdrop-filter: blur(24px);
        flex-direction: column;
        justify-content: center;
        align-items: flex-start;
        padding: 40px 30px;
        gap: 22px;
        opacity: 1;
        visibility: visible;
        transform: none;
        z-index: var(--z-header);
    }
    .nav-links.active a {
        font-size: clamp(1.4rem, 5vw, 1.75rem);
        font-weight: 700;
        color: var(--text-muted);
        width: 100%;
        display: flex;
        align-items: center;
        gap: 14px;
        padding: 10px 0;
    }
    .nav-links.active a::after {
        display: none;
    }
    .nav-links.active a::before {
        content: ">";
        font-family: var(--font-mono);
        color: var(--primary);
        font-size: 1.3rem;
        opacity: 1;
        transform: none;
    }
    .nav-links.active a.active,
    .nav-links.active a:hover {
        color: var(--text-bright);
    }
}

/* ==========================================================================
   SMALL MOBILE BREAKPOINT (Max-Width: 480px)
   ========================================================================== */
@media (max-width: 480px) {
    .hero-title {
        font-size: clamp(1.75rem, 9vw, 2.5rem);
    }
    .hero-typing {
        font-size: clamp(0.85rem, 3.5vw, 1rem);
    }
    .section-title {
        font-size: clamp(1.6rem, 6vw, 2rem);
    }
    .gallery-grid {
        grid-template-columns: 1fr;
    }
    .cert-actions {
        grid-template-columns: 1fr;
    }
    .contact-grid {
        grid-template-columns: 1fr;
    }
    .contact-card-item {
        padding: 14px 16px;
        gap: 10px;
        justify-content: flex-start;
        flex-wrap: wrap;
    }
    .contact-item-left {
        flex: 1 1 0%;
        min-width: 0;
        max-width: 100%;
    }
    .contact-item-icon {
        width: 36px;
        height: 36px;
        font-size: 1rem;
        flex-shrink: 0;
    }
    .contact-item-action {
        margin-left: auto;
        flex-shrink: 0;
    }
    .contact-item-value {
        font-size: 0.85rem;
        word-break: break-all;
    }
    .contact-item-label {
        font-size: 0.7rem;
    }
}

/* ==========================================================================
   TABLET BREAKPOINT (768px - 1023px)
   ========================================================================== */
@media (min-width: 768px) and (max-width: 1023px) {
    :root {
        --header-height: clamp(60px, 5vw, 74px);
        --space-section: clamp(50px, 6vw, 75px);
    }
    .container {
        padding: 0 24px;
    }
    .section-header {
        margin-bottom: 40px;
    }
    /* Show desktop nav on tablet */
    .mobile-menu-toggle {
        display: none;
    }
    .nav-links {
        display: flex !important;
        gap: 24px;
    }
    /* Hero - single column on tablet */
    .hero-container {
        grid-template-columns: 1fr;
        gap: 30px;
    }
    .hero-visual-wrapper {
        order: 2;
        margin-top: 20px;
    }
    .hero-terminal-card {
        max-width: 100%;
    }
    .about-grid {
        grid-template-columns: 1fr;
        gap: 40px;
    }
    .contact-grid {
        grid-template-columns: 1fr;
        gap: 40px;
    }
    .gallery-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    .skill-items {
        grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    }
    .certificates-grid {
        grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    }
    /* Footer - center aligned on tablet */
    .footer {
        text-align: center;
    }
    .footer-nav {
        flex-direction: row;
        justify-content: center;
    }
    .footer-socials {
        justify-content: center;
    }
    /* Show footer roles on tablet and up */
    .footer-roles {
        display: block;
    }
}

/* ==========================================================================
   DESKTOP BREAKPOINT (1024px+)
   RESET ANY MOBILE RULES THAT LEAK THROUGH
   ========================================================================== */
@media (min-width: 1024px) {
    :root {
        --header-height: 74px;
        --space-section: 90px;
    }
    .mobile-menu-toggle {
        display: none;
    }
    .nav-links {
        display: flex;
        gap: clamp(24px, 3vw, 32px);
    }
    .nav-links a::before {
        content: normal;
        opacity: 0;
        transform: none;
    }
    /* Force desktop hero layout */
    .hero-section {
        min-height: 100vh !important;
        align-items: center !important;
    }
    .hero-container {
        display: grid !important;
        grid-template-columns: 1.15fr 0.85fr !important;
        gap: 50px !important;
        align-items: center !important;
    }
    .hero-visual-wrapper {
        display: flex !important;
    }
    .hero-terminal-card {
        max-width: 440px;
    }
    /* Force desktop button layout */
    .btn-group {
        flex-direction: row !important;
        width: auto !important;
    }
    .btn-group .btn {
        width: auto !important;
        text-align: left !important;
    }
    /* Force desktop footer */
    .footer {
        text-align: center !important;
    }
    .footer-nav {
        flex-direction: row !important;
        justify-content: center !important;
    }
    .footer-socials {
        justify-content: center !important;
    }
    .footer-roles {
        display: block !important;
    }
}

/* Large desktop */
@media (min-width: 1280px) {
    .container {
        padding: 0 24px;
    }
    .hero-title {
        font-size: clamp(3rem, 5vw, 5.2rem);
    }
    .hero-typing {
        font-size: clamp(1.15rem, 2vw, 1.7rem);
    }
}

/* ==========================================================================
   VERY SMALL PHONES (Max-Width: 359px)
   ========================================================================== */
@media (max-width: 359px) {
    .container {
        padding: 0 16px;
    }
    .hero-title {
        font-size: clamp(1.5rem, 9vw, 2rem);
    }
    .section-title {
        font-size: clamp(1.4rem, 6vw, 1.8rem);
    }
    .hero-status-badge {
        font-size: 0.75rem;
        padding: 5px 12px;
    }
    .skill-items {
        grid-template-columns: 1fr;
    }
    .certificates-grid {
        grid-template-columns: 1fr;
    }
    .projects-grid {
        grid-template-columns: 1fr;
    }
    .btn {
        padding: 11px 20px;
        font-size: 0.88rem;
    }
    .interest-pill {
        padding: 10px 20px;
        font-size: 0.9rem;
    }
    .contact-card-item {
        padding: 12px 14px;
    }
    .contact-item-value {
        font-size: 0.82rem;
    }
}

/* ==========================================================================
   TOUCH OPTIMIZATIONS
   ========================================================================== */
@media (hover: none) and (pointer: coarse) {
    .btn:hover,
    .card:hover,
    .social-icon:hover,
    .interest-pill:hover {
        transform: none;
    }
    .btn:active,
    .card:active,
    .social-icon:active,
    .interest-pill:active {
        transform: scale(0.98);
        transition: transform 0.1s ease;
    }
}

