* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --menu-bar-height: 24px;
    --dock-height: 70px;
    --window-header-height: 28px;

    /* macOS Colors - Dark Mode */
    --bg-primary: #1e1e1e;
    --bg-secondary: #2d2d2d;
    --bg-tertiary: #3d3d3d;
    --text-primary: #ffffff;
    --text-secondary: rgba(255, 255, 255, 0.7);
    --accent-blue: #007AFF;
    --accent-red: #FF3B30;
    --accent-yellow: #FFCC00;
    --accent-green: #34C759;

    /* Glassmorphism */
    --glass-bg: rgba(30, 30, 30, 0.7);
    --glass-border: rgba(255, 255, 255, 0.1);
    --glass-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.37);
}

/* Light Mode */
body.light-mode {
    --bg-primary: #f5f5f7;
    --bg-secondary: #ffffff;
    --bg-tertiary: #e8e8ed;
    --text-primary: #1d1d1f;
    --text-secondary: rgba(0, 0, 0, 0.6);

    /* Glassmorphism for light mode */
    --glass-bg: rgba(255, 255, 255, 0.7);
    --glass-border: rgba(0, 0, 0, 0.1);
    --glass-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.15);
}

body.light-mode::before {
    background:
        radial-gradient(circle at 20% 50%, rgba(0, 122, 255, 0.05) 0%, transparent 50%),
        radial-gradient(circle at 80% 80%, rgba(52, 199, 89, 0.05) 0%, transparent 50%);
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    overflow: hidden;
    width: 100vw;
    height: 100vh;
    background: url('hinh-nen-macos-26-4.jpg') center/cover no-repeat fixed;
    position: relative;
}

/* Animated Background Overlay */
body::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background:
        radial-gradient(circle at 20% 50%, rgba(0, 122, 255, 0.1) 0%, transparent 50%),
        radial-gradient(circle at 80% 80%, rgba(52, 199, 89, 0.1) 0%, transparent 50%);
    animation: backgroundShift 20s ease infinite;
    z-index: 0;
    pointer-events: none;
}

/* Lock Screen */
.lock-screen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: url('hinh-nen-macos-26-4.jpg') center/cover no-repeat fixed;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    transition: opacity 0.8s ease, transform 0.8s ease;
}

.lock-screen.unlocking {
    opacity: 0;
    transform: scale(1.05);
    pointer-events: none;
}

.lock-screen-content {
    text-align: center;
    color: white;
    cursor: pointer;
    transition: transform 0.3s ease;
    position: relative;
}

.lock-screen-content:hover {
    transform: translateY(-5px);
}

.lock-time-container {
    margin-bottom: 80px;
    animation: fadeInDown 1s ease;
}

.lock-time {
    font-size: 120px;
    font-weight: 200;
    letter-spacing: -2px;
    text-shadow: 0 4px 20px rgba(0, 0, 0, 0.5);
    margin-bottom: 10px;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

.lock-date {
    font-size: 32px;
    font-weight: 400;
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.5);
    opacity: 0.95;
}

.lock-user-container {
    animation: fadeInUp 1s ease 0.3s both;
}

.lock-avatar {
    width: 200px;
    height: 200px;
    margin: 0 auto 30px;
    border-radius: 50%;
    overflow: hidden;
    border: 5px solid rgba(255, 255, 255, 0.3);
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.4);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
}

.lock-avatar:hover {
    transform: scale(1.05);
    box-shadow: 0 15px 50px rgba(0, 0, 0, 0.5);
}

.lock-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.lock-username {
    font-size: 36px;
    font-weight: 500;
    margin-bottom: 15px;
    text-shadow: 0 2px 15px rgba(0, 0, 0, 0.5);
}

.lock-hint {
    font-size: 18px;
    opacity: 0.8;
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.5);
    animation: pulse 2s ease-in-out infinite;
}

.lock-bottom {
    position: fixed;
    bottom: 40px;
    left: 50%;
    transform: translateX(-50%);
    animation: fadeIn 1s ease 0.6s both;
    z-index: 10;
}

.lock-icon {
    width: 60px;
    height: 60px;
    background: rgba(255, 255, 255, 0.15);
    backdrop-filter: blur(20px);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 2px solid rgba(255, 255, 255, 0.3);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
    transition: all 0.3s ease;
}

.lock-icon:hover {
    background: rgba(255, 255, 255, 0.25);
    transform: scale(1.1);
}

.lock-icon svg {
    color: white;
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.3));
}

/* Lock Screen Animations */
@keyframes fadeInDown {
    from {
        opacity: 0;
        transform: translateY(-30px);
    }

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

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }

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

@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

/* Responsive Lock Screen */
@media (max-width: 768px) {
    .lock-time {
        font-size: 80px;
    }

    .lock-date {
        font-size: 24px;
    }

    .lock-avatar {
        width: 150px;
        height: 150px;
    }

    .lock-username {
        font-size: 28px;
    }

    .lock-hint {
        font-size: 16px;
    }

    .lock-time-container {
        margin-bottom: 50px;
    }



    .lock-bottom {
        bottom: 30px;
    }
}

@media (max-width: 480px) {
    .lock-time {
        font-size: 60px;
    }

    .lock-date {
        font-size: 18px;
    }

    .lock-avatar {
        width: 120px;
        height: 120px;
    }

    .lock-username {
        font-size: 24px;
    }

    .lock-hint {
        font-size: 14px;
    }

    .lock-time-container {
        margin-bottom: 30px;
    }



    .lock-bottom {
        bottom: 20px;
    }

    .lock-icon {
        width: 50px;
        height: 50px;
    }
}

@keyframes backgroundShift {

    0%,
    100% {
        opacity: 0.5;
    }

    50% {
        opacity: 0.3;
    }
}

/* Menu Bar */
.menu-bar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: var(--menu-bar-height);
    background: var(--glass-bg);
    backdrop-filter: blur(20px) saturate(180%);
    -webkit-backdrop-filter: blur(20px) saturate(180%);
    border-bottom: 1px solid var(--glass-border);
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 12px;
    font-size: 13px;
    color: var(--text-primary);
    z-index: 1000;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.menu-left,
.menu-right {
    display: flex;
    align-items: center;
    gap: 16px;
}

.menu-item {
    cursor: pointer;
    padding: 2px 8px;
    border-radius: 4px;
    transition: background 0.2s ease;
    font-weight: 500;
}

.menu-item:hover {
    background: rgba(255, 255, 255, 0.1);
}

.menu-item.active {
    font-weight: 600;
}

.apple-logo {
    font-size: 16px;
    padding: 2px 6px;
}

.menu-icon {
    cursor: pointer;
    padding: 2px;
    border-radius: 4px;
    transition: background 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.menu-icon:hover {
    background: rgba(255, 255, 255, 0.1);
}

.menu-time {
    font-weight: 500;
    font-size: 12px;
}

/* Desktop */
.desktop {
    position: fixed;
    top: var(--menu-bar-height);
    left: 0;
    right: 0;
    bottom: var(--dock-height);
    z-index: 1;
    overflow: hidden;
}

/* Window Styles */
.window {
    position: absolute;
    background: var(--glass-bg);
    backdrop-filter: blur(40px) saturate(180%);
    -webkit-backdrop-filter: blur(40px) saturate(180%);
    border-radius: 12px;
    box-shadow: var(--glass-shadow);
    border: 1px solid var(--glass-border);
    overflow: hidden;
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1),
        opacity 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    min-width: 400px;
    min-height: 300px;
}

.window.minimizing {
    transform: scale(0.1);
    opacity: 0;
}

.window.maximized {
    top: 10px !important;
    left: 10px !important;
    right: 10px !important;
    bottom: 10px !important;
    width: calc(100vw - 20px) !important;
    height: calc(100vh - var(--menu-bar-height) - var(--dock-height) - 20px) !important;
}

.window-header {
    height: var(--window-header-height);
    background: rgba(255, 255, 255, 0.05);
    border-bottom: 1px solid var(--glass-border);
    display: flex;
    align-items: center;
    padding: 0 12px;
    cursor: move;
    user-select: none;
}

.window-controls {
    display: flex;
    gap: 8px;
    margin-right: 12px;
}

.window-control {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    cursor: pointer;
    transition: transform 0.2s ease, filter 0.2s ease;
    position: relative;
}

.window-control:hover {
    transform: scale(1.1);
    filter: brightness(1.2);
}

.window-control.close {
    background: #FF5F57;
}

.window-control.minimize {
    background: #FFBD2E;
}

.window-control.maximize {
    background: #28CA42;
}

.window-control::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    opacity: 0;
    transition: opacity 0.2s ease;
}

.window-header:hover .window-control::after {
    opacity: 1;
}

.window-control.close::after {
    width: 6px;
    height: 2px;
    background: #4D0000;
    transform: translate(-50%, -50%) rotate(45deg);
    box-shadow: 0 0 0 2px #4D0000;
    clip-path: polygon(0 40%, 100% 40%, 100% 60%, 0 60%);
}

.window-title {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-primary);
    flex: 1;
    text-align: center;
    margin-right: 32px;
}

.window-content {
    height: calc(100% - var(--window-header-height));
    overflow-y: auto;
    padding: 24px;
    color: var(--text-primary);
}

.window-content::-webkit-scrollbar {
    width: 8px;
}

.window-content::-webkit-scrollbar-track {
    background: transparent;
}

.window-content::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.2);
    border-radius: 4px;
}

.window-content::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.3);
}

/* Window Resize Handle */
.resize-handle {
    position: absolute;
    bottom: 0;
    right: 0;
    width: 20px;
    height: 20px;
    cursor: nwse-resize;
    z-index: 10;
}

.resize-handle::after {
    content: '';
    position: absolute;
    bottom: 2px;
    right: 2px;
    width: 12px;
    height: 12px;
    background: linear-gradient(135deg,
            transparent 0%,
            transparent 40%,
            rgba(255, 255, 255, 0.2) 40%,
            rgba(255, 255, 255, 0.2) 45%,
            transparent 45%,
            transparent 55%,
            rgba(255, 255, 255, 0.2) 55%,
            rgba(255, 255, 255, 0.2) 60%,
            transparent 60%);
}


/* Dock */
.dock-container {
    position: fixed;
    bottom: 12px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 1000;
    padding: 12px;
    /* Allow overflow for expansion */
    overflow: visible;
    max-width: 95vw;
}

.dock {
    background: var(--glass-bg);
    backdrop-filter: blur(40px) saturate(180%);
    -webkit-backdrop-filter: blur(40px) saturate(180%);
    border: 1px solid var(--glass-border);
    border-radius: 20px;
    padding: 12px 16px;
    display: flex;
    align-items: flex-end;
    justify-content: center;
    flex-wrap: nowrap;
    gap: 12px;
    box-shadow: var(--glass-shadow);
    min-height: 90px;
    /* Allow dock to expand */
    transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
    overflow: visible;
    width: auto;
    max-width: 100%;
}

.dock-item {
    position: relative;
    cursor: pointer;
    transition: all 0.15s cubic-bezier(0.34, 1.56, 0.64, 1);
    transform-origin: bottom center;
    /* Prevent layout shift */
    flex-shrink: 0;
}

.dock-icon {
    width: 64px;
    height: 64px;
    transition: all 0.15s cubic-bezier(0.34, 1.56, 0.64, 1);
    transform-origin: bottom center;
    display: flex;
    align-items: center;
    justify-content: center;
}

.dock-icon img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    filter: drop-shadow(0 6px 12px rgba(0, 0, 0, 0.4));
    transition: filter 0.15s ease;
    /* Improve rendering */
    will-change: filter;
}

.dock-item:hover .dock-icon img {
    filter: drop-shadow(0 8px 16px rgba(0, 0, 0, 0.5));
}

.dock-label {
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%) translateY(0);
    background: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(10px);
    color: white;
    padding: 6px 12px;
    border-radius: 8px;
    font-size: 12px;
    font-weight: 500;
    white-space: nowrap;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s ease, transform 0.2s ease;
    margin-bottom: 12px;
    z-index: 10;
}

.dock-item:hover .dock-label {
    opacity: 1;
    transform: translateX(-50%) translateY(-8px);
}

.dock-divider {
    width: 1px;
    height: 48px;
    background: rgba(255, 255, 255, 0.2);
    margin: 0 4px;
}

.dock-item.active::after {
    content: '';
    position: absolute;
    bottom: -4px;
    left: 50%;
    transform: translateX(-50%);
    width: 4px;
    height: 4px;
    background: rgba(255, 255, 255, 0.8);
    border-radius: 50%;
}

/* Content Sections */
.content-section {
    animation: fadeIn 0.5s ease;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

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

.section-title {
    font-size: 28px;
    font-weight: 700;
    margin-bottom: 24px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.section-subtitle {
    font-size: 18px;
    font-weight: 600;
    margin: 20px 0 12px;
    color: var(--text-primary);
}

.section-text {
    font-size: 14px;
    line-height: 1.6;
    color: var(--text-secondary);
    margin-bottom: 16px;
}

/* Project Cards */
.projects-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 20px;
    margin-top: 20px;
}

.project-card {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--glass-border);
    border-radius: 12px;
    padding: 20px;
    transition: transform 0.3s ease, box-shadow 0.3s ease, background 0.3s ease;
    cursor: pointer;
}

.project-card:hover {
    transform: translateY(-4px);
    background: rgba(255, 255, 255, 0.08);
    box-shadow: 0 12px 24px rgba(0, 0, 0, 0.3);
}

.project-icon {
    width: 48px;
    height: 48px;
    border-radius: 10px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    margin-bottom: 16px;
}

.project-title {
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 8px;
    color: var(--text-primary);
}

.project-description {
    font-size: 13px;
    color: var(--text-secondary);
    line-height: 1.5;
    margin-bottom: 12px;
}

.project-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.project-tag {
    padding: 4px 10px;
    background: rgba(102, 126, 234, 0.2);
    border: 1px solid rgba(102, 126, 234, 0.3);
    border-radius: 12px;
    font-size: 11px;
    color: #a5b4fc;
    font-weight: 500;
}

/* Project Images */
.project-images {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
    margin: 16px 0;
}

.project-screenshot {
    width: 100%;
    height: auto;
    border-radius: 8px;
    border: 1px solid var(--glass-border);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    cursor: pointer;
}

.project-screenshot:hover {
    transform: scale(1.05);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
}


/* Skills Grid */
.skills-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 16px;
    margin-top: 20px;
}

.skill-item {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--glass-border);
    border-radius: 10px;
    padding: 16px;
    text-align: center;
    transition: transform 0.3s ease, background 0.3s ease;
}

.skill-item:hover {
    transform: translateY(-4px) scale(1.05);
    background: rgba(255, 255, 255, 0.08);
}

.skill-icon {
    font-size: 32px;
    margin-bottom: 8px;
}

.skill-name {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 4px;
}

.skill-level {
    font-size: 11px;
    color: var(--text-secondary);
}

/* Contact Form */
.contact-form {
    max-width: 500px;
    margin-top: 20px;
}

.form-group {
    margin-bottom: 20px;
}

.form-label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 8px;
}

.form-input,
.form-textarea {
    width: 100%;
    padding: 12px 16px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--glass-border);
    border-radius: 8px;
    color: var(--text-primary);
    font-size: 14px;
    font-family: inherit;
    transition: border-color 0.3s ease, background 0.3s ease;
}

.form-input:focus,
.form-textarea:focus {
    outline: none;
    border-color: rgba(102, 126, 234, 0.5);
    background: rgba(255, 255, 255, 0.08);
}

.form-textarea {
    resize: vertical;
    min-height: 120px;
}

.form-button {
    padding: 12px 32px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border: none;
    border-radius: 8px;
    color: white;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.form-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 16px rgba(102, 126, 234, 0.4);
}

.form-button:active {
    transform: translateY(0);
}

/* Social Links */
.social-links {
    display: flex;
    gap: 16px;
    margin-top: 20px;
}

.social-link {
    width: 44px;
    height: 44px;
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--glass-border);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-primary);
    text-decoration: none;
    font-size: 20px;
    transition: transform 0.3s ease, background 0.3s ease;
}

.social-link:hover {
    transform: translateY(-4px);
    background: rgba(255, 255, 255, 0.1);
}

/* Responsive Design */

/* iPad & Large Tablets (1024px - 1400px) */
@media (max-width: 1400px) and (min-width: 1024px) {
    .dock-icon {
        width: 56px;
        height: 56px;
    }

    .dock {
        gap: 10px;
        padding: 10px 14px;
        min-height: 80px;
    }

    .widgets-container {
        right: 15px;
        top: 35px;
    }

    .widget {
        width: 260px !important;
    }

    .project-images {
        grid-template-columns: repeat(3, 1fr);
    }
}

/* Tablet Portrait & Small Laptops (768px - 1024px) */
@media (max-width: 1024px) and (min-width: 768px) {
    .menu-bar {
        font-size: 12px;
        padding: 0 10px;
    }

    .menu-left .menu-item:not(.apple-logo) {
        display: none;
    }

    .menu-left .menu-item.active {
        display: block;
    }

    .dock-icon {
        width: 52px;
        height: 52px;
    }

    .dock {
        gap: 8px;
        padding: 10px 12px;
        min-height: 75px;
    }

    .dock-container {
        max-width: 98vw;
    }

    .window {
        min-width: 85vw !important;
        max-width: 90vw !important;
        left: 5vw !important;
    }

    .widgets-container {
        right: 10px;
        top: 30px;
        gap: 10px;
    }

    .widget {
        width: 220px !important;
    }

    .clock-time {
        font-size: 42px;
    }

    .weather-temp {
        font-size: 36px;
    }

    .projects-grid {
        grid-template-columns: 1fr;
    }

    .skills-grid {
        grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    }

    .project-images {
        grid-template-columns: repeat(2, 1fr);
    }

    /* Hide non-essential dock icons on iPad */
    .dock-item[data-app="message"],
    .dock-item[data-app="facetime"],
    .dock-item[data-app="calendar"],
    .dock-item[data-app="reminder"],
    .dock-item[data-app="note"],
    .dock-item[data-app="map"],
    .dock-item[data-app="picture"],
    .dock-item[data-app="appstore"],
    .dock-item[data-app="chatgpt"],
    .dock-item[data-app="spotify"],
    .dock-item[data-app="keynote"],
    .dock-item[data-app="pages"],
    .dock-item[data-app="word"] {
        display: none;
    }

    /* Keep only: Finder, Mail, VS Code */
}

/* Mobile Landscape (568px - 768px) */
@media (max-width: 768px) and (min-width: 568px) {
    .menu-bar {
        font-size: 11px;
        padding: 0 8px;
    }

    .menu-left .menu-item:not(.apple-logo) {
        display: none;
    }

    .menu-right .menu-icon:not(#themeToggle) {
        display: none;
    }

    .window {
        min-width: 92vw !important;
        max-width: 95vw !important;
        left: 2.5vw !important;
        top: 30px !important;
        height: calc(100vh - 120px) !important;
    }

    .window-content {
        padding: 16px;
        font-size: 14px;
    }

    .section-title {
        font-size: 22px;
    }

    .section-subtitle {
        font-size: 16px;
    }

    .projects-grid {
        grid-template-columns: 1fr;
        gap: 12px;
    }

    .skills-grid {
        grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
        gap: 10px;
    }

    .dock-icon {
        width: 48px;
        height: 48px;
    }

    .dock {
        padding: 8px 10px;
        gap: 6px;
        border-radius: 16px;
        min-height: 70px;
    }

    .dock-container {
        bottom: 8px;
        padding: 8px;
        max-width: 98vw;
    }

    .dock-label {
        font-size: 11px;
        padding: 5px 10px;
    }

    /* Hide widgets on mobile landscape */
    .widgets-container {
        display: none;
    }

    /* Hide non-essential dock icons on tablet/mobile landscape */
    .dock-item[data-app="message"],
    .dock-item[data-app="facetime"],
    .dock-item[data-app="calendar"],
    .dock-item[data-app="reminder"],
    .dock-item[data-app="note"],
    .dock-item[data-app="map"],
    .dock-item[data-app="picture"],
    .dock-item[data-app="appstore"],
    .dock-item[data-app="chatgpt"],
    .dock-item[data-app="spotify"],
    .dock-item[data-app="keynote"],
    .dock-item[data-app="pages"],
    .dock-item[data-app="word"] {
        display: none;
    }

    /* Keep only essential apps: Finder, Mail, VS Code */

    .project-images {
        grid-template-columns: 1fr;
    }

    /* Make forms more mobile-friendly */
    .contact-form {
        max-width: 100%;
    }

    .form-input,
    .form-textarea {
        font-size: 16px;
        /* Prevent zoom on iOS */
    }
}

/* Mobile Portrait (< 568px) */
@media (max-width: 568px) {
    .menu-bar {
        font-size: 10px;
        padding: 0 6px;
        height: 20px;
    }

    .menu-left {
        gap: 8px;
    }

    .menu-left .menu-item:not(.apple-logo) {
        display: none;
    }

    .menu-right {
        gap: 8px;
    }

    .menu-right .menu-icon:not(#themeToggle) {
        display: none;
    }

    .menu-time {
        font-size: 10px;
    }

    .desktop {
        top: 20px;
    }

    .window {
        min-width: 95vw !important;
        max-width: 95vw !important;
        left: 2.5vw !important;
        top: 25px !important;
        height: calc(100vh - 100px) !important;
        border-radius: 8px;
    }

    .window-header {
        height: 24px;
    }

    .window-control {
        width: 10px;
        height: 10px;
    }

    .window-title {
        font-size: 12px;
    }

    .window-content {
        padding: 12px;
        font-size: 13px;
    }

    .section-title {
        font-size: 20px;
        margin-bottom: 16px;
    }

    .section-subtitle {
        font-size: 15px;
        margin: 16px 0 10px;
    }

    .section-text {
        font-size: 13px;
        line-height: 1.5;
    }

    .projects-grid {
        grid-template-columns: 1fr;
        gap: 10px;
    }

    .project-card {
        padding: 14px;
    }

    .project-icon {
        width: 40px;
        height: 40px;
        font-size: 20px;
        margin-bottom: 12px;
    }

    .project-title {
        font-size: 14px;
    }

    .project-description {
        font-size: 12px;
    }

    .skills-grid {
        grid-template-columns: repeat(auto-fill, minmax(80px, 1fr));
        gap: 8px;
    }

    .skill-item {
        padding: 12px 8px;
    }

    .skill-icon {
        font-size: 24px;
    }

    .skill-name {
        font-size: 11px;
    }

    .skill-level {
        font-size: 10px;
    }

    .dock-icon {
        width: 46px;
        height: 46px;
    }

    .dock {
        padding: 8px 10px;
        gap: 8px;
        min-height: 65px;
        border-radius: 16px;
    }

    .dock-container {
        bottom: 6px;
        padding: 6px;
        max-width: 98vw;
    }

    .dock-label {
        font-size: 10px;
        padding: 4px 8px;
    }

    .dock-divider {
        height: 40px;
        margin: 0 4px;
    }

    /* Hide widgets on mobile */
    .widgets-container {
        display: none;
    }

    /* Show only essential dock icons on mobile portrait */
    /* Hide: Message, FaceTime, Calendar, Reminder, Note, Map, Picture, App Store, ChatGPT, Spotify, Keynote, Pages, Word */
    .dock-item[data-app="message"],
    .dock-item[data-app="facetime"],
    .dock-item[data-app="calendar"],
    .dock-item[data-app="reminder"],
    .dock-item[data-app="note"],
    .dock-item[data-app="map"],
    .dock-item[data-app="picture"],
    .dock-item[data-app="appstore"],
    .dock-item[data-app="chatgpt"],
    .dock-item[data-app="spotify"],
    .dock-item[data-app="keynote"],
    .dock-item[data-app="pages"],
    .dock-item[data-app="word"] {
        display: none;
    }

    /* Keep visible: Finder, Mail, VS Code (3 icons total) */

    .project-images {
        grid-template-columns: 1fr;
    }

    /* Mobile-friendly forms */
    .contact-form {
        max-width: 100%;
    }

    .form-group {
        margin-bottom: 14px;
    }

    .form-label {
        font-size: 12px;
        margin-bottom: 6px;
    }

    .form-input,
    .form-textarea {
        padding: 10px 12px;
        font-size: 16px;
        /* Prevent zoom on iOS */
        border-radius: 6px;
    }

    .form-textarea {
        min-height: 100px;
    }

    .form-button {
        width: 100%;
        padding: 12px;
        font-size: 14px;
    }

    .social-links {
        justify-content: center;
        flex-wrap: wrap;
    }

    .social-link {
        width: 40px;
        height: 40px;
    }

    /* Disable resize handle on mobile */
    .resize-handle {
        display: none;
    }
}

/* Very Small Devices (< 375px) */
@media (max-width: 375px) {
    .dock-icon {
        width: 42px;
        height: 42px;
    }

    .dock {
        gap: 6px;
        padding: 6px 8px;
        min-height: 60px;
    }

    .window-content {
        padding: 10px;
    }

    .section-title {
        font-size: 18px;
    }

    .skills-grid {
        grid-template-columns: repeat(auto-fill, minmax(70px, 1fr));
    }

    /* On very small screens, hide even more icons */
    .dock-item[data-app="notion"] {
        display: none;
    }

    /* Keep only: Finder, Launchpad, VS Code, Mail, Settings (5 icons) */
}

/* Large screens - bigger icons */
@media (min-width: 1920px) {
    .dock-icon {
        width: 72px;
        height: 72px;
    }

    .dock {
        gap: 14px;
        padding: 14px 18px;
        min-height: 100px;
        border-radius: 22px;
    }

    .dock-label {
        font-size: 13px;
        padding: 7px 14px;
    }

    .window {
        min-width: 500px;
    }

    .widgets-container {
        right: 25px;
        top: 45px;
    }

    .widget {
        width: 300px !important;
    }

    .clock-time {
        font-size: 64px;
    }
}

/* Touch device optimizations */
@media (hover: none) and (pointer: coarse) {
    .dock-item {
        /* Larger touch targets */
        padding: 4px;
    }

    .window-control {
        /* Larger touch targets for window controls */
        width: 14px;
        height: 14px;
    }

    .menu-icon {
        /* Larger touch targets */
        padding: 4px;
    }

    /* Disable hover effects on touch devices */
    .dock-item:hover .dock-label {
        opacity: 0;
    }

    /* Show label on tap instead */
    .dock-item:active .dock-label {
        opacity: 1;
    }
}

/* Landscape orientation specific */
@media (max-height: 500px) and (orientation: landscape) {
    .window {
        height: calc(100vh - 80px) !important;
        top: 25px !important;
    }

    .dock {
        min-height: 50px;
    }

    .dock-icon {
        width: 40px;
        height: 40px;
    }
}

/* Loading Animation */
@keyframes pulse {

    0%,
    100% {
        opacity: 1;
    }

    50% {
        opacity: 0.5;
    }
}

.loading {
    animation: pulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}