/* Mobile (iOS) UI */
@media (max-width: 768px) {

    .desktop,
    .menu-bar,
    .desktop-icons,
    .dock,
    .theme-toggle {
        display: none !important;
    }

    .mobile-container {
        position: fixed;
        inset: 0;
        background: var(--bg-primary);
        overflow: hidden;
        z-index: 1;
    }

    .mobile-status-bar {
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        height: 44px;
        background: var(--bg-primary);
        display: flex;
        justify-content: space-between;
        align-items: center;
        padding: 0 20px;
        z-index: 1000;
        font-size: 14px;
        font-weight: 600;
    }

    .status-icons {
        display: flex;
        gap: 6px;
        align-items: center;
    }

    .mobile-content {
        position: fixed;
        top: 44px;
        left: 0;
        width: 100%;
        height: calc(100% - 44px - 83px);
        overflow-y: auto;
        overflow-x: hidden;
        padding: 18px;
    }

    .mobile-view {
        display: none;
        width: 100%;
        animation: slideIn .22s ease;
    }

    .mobile-view.active {
        display: block;
    }

    @keyframes slideIn {
        from {
            opacity: 0;
            transform: translateX(18px);
        }

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

    .mobile-bottom-nav {
        position: fixed;
        bottom: 0;
        left: 0;
        width: 100%;
        height: 83px;
        background: var(--bg-primary);
        border-top: 1px solid var(--glass-border);
        display: flex;
        justify-content: space-around;
        align-items: center;
        padding-bottom: 20px;
        z-index: 1000;
    }

    .mobile-nav-item {
        display: flex;
        flex-direction: column;
        align-items: center;
        gap: 4px;
        cursor: pointer;
        transition: var(--transition);
        padding: 6px 14px;
        border-radius: 12px;
    }

    .mobile-nav-item:active {
        transform: scale(0.92);
    }

    .mobile-nav-item.active {
        color: var(--primary-color);
    }

    .mobile-nav-item.active i {
        color: var(--primary-color);
    }

    .mobile-about-image {
        width: 150px;
        height: 150px;
        border-radius: 50%;
        margin: 0 auto 18px;
        overflow: hidden;
        box-shadow: 0 10px 30px rgba(0, 0, 0, .2);
    }

    .mobile-project-tabs {
        display: flex;
        gap: 10px;
        margin-bottom: 16px;
        background: var(--bg-secondary);
        padding: 5px;
        border-radius: 12px;
    }

    .mobile-tab-btn {
        flex: 1;
        padding: 10px;
        border: none;
        background: transparent;
        color: var(--text-secondary);
        border-radius: 9px;
        cursor: pointer;
        transition: var(--transition);
        font-weight: 500;
        font-size: 14px;
    }

    .mobile-tab-btn.active {
        background: var(--primary-color);
        color: #fff;
    }

    .mobile-projects-grid {
        display: grid;
        grid-template-columns: 1fr;
        gap: 14px;
    }

    .mobile-project-card {
        background: var(--glass-bg);
        backdrop-filter: blur(10px);
        -webkit-backdrop-filter: blur(10px);
        border-radius: 16px;
        overflow: hidden;
        border: 1px solid var(--glass-border);
        transition: var(--transition);
    }

    .mobile-project-card:active {
        transform: scale(0.98);
    }

    .mobile-project-image {
        height: 200px;
        overflow: hidden;
    }

    .mobile-resume {
        text-align: center;
        padding: 32px 18px;
    }

    .mobile-btn-download {
        display: inline-flex;
        align-items: center;
        gap: 10px;
        padding: 13px 32px;
        background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
        color: #fff;
        text-decoration: none;
        border-radius: 12px;
        font-weight: 600;
        transition: var(--transition);
    }

    .mobile-btn-download:active {
        transform: scale(0.96);
    }

    .mobile-terminal {
        background: #000;
        border-radius: 16px;
        padding: 15px;
        font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, 'Liberation Mono', 'Courier New', monospace;
        font-size: 12px;
        height: calc(100% - 40px);
        overflow-y: auto;
    }

    .mobile-notification {
        position: fixed;
        top: 60px;
        left: 50%;
        transform: translateX(-50%) translateY(-100px);
        background: var(--glass-bg);
        backdrop-filter: blur(20px);
        -webkit-backdrop-filter: blur(20px);
        padding: 15px 22px;
        border-radius: 12px;
        box-shadow: var(--shadow);
        border: 1px solid var(--glass-border);
        transition: transform .28s ease;
        z-index: 1002;
        max-width: 90%;
    }

    .mobile-notification.show {
        transform: translateX(-50%) translateY(0);
    }
}

/* iPadOS tweaks */
@media (min-width: 769px) and (max-width: 1024px) {
    .dock {
        bottom: 14px;
    }

    .dock-container {
        height: 72px;
    }

    .dock-item {
        width: 56px;
        height: 56px;
    }

    .window {
        border-radius: 18px;
    }

    .window.maximized {
        height: calc(100% - 28px - 90px) !important;
    }

    .desktop-icon {
        width: 96px;
    }

    .desktop-icon::before {
        width: 74px;
        height: 74px;
        border-radius: 18px;
    }

    .desktop-icon i {
        font-size: 32px;
    }
}

/* Desktop only: hide mobile */
@media (min-width: 769px) {

    .mobile-container,
    .mobile-status-bar,
    .dynamic-island,
    .mobile-content,
    .mobile-bottom-nav,
    .mobile-notification {
        display: none !important;
    }
}