:root {
    --backgroundMain: #3c455b;
    /* Dark bluish-grey */
    --windowLight: #eaf0f1;
    /* Off-white / light grey */
    --peachHeader: #f4b266;
    /* Warm peach */
    --skyBlue: #84b6f4;
    /* Bright sky blue */
    --mintGreen: #8dd3a9;
    /* Soft mint green */
    --fontMain: #1a1a1a;
    /* Nearly black */
    --borderColor: #2e3440;
    /* Darker bluish-grey for borders */
    --buttonHover: #ffffff44;
    /* Semi-transparent white for hover */
    --shadowColor: rgba(0, 0, 0, 0.4);
    /* Darker shadow */
    --taskbarColor: #c0c0c0;
    /* Classic grey taskbar */
    --taskbarBorder: #808080;
    /* Darker grey for taskbar borders */
    --taskbarActiveBorder: #000000;
    /* Black for active item border */


    /* Retro UI elements - Enhanced for 90s look */
    --ui-border-thickness: 3px;
    --ui-border-radius: 4px;
    /* More square corners for 90s feel */
    --ui-shadow-offset: 8px;
    /* Larger shadow */
    --ui-pixel-texture-size: 4px;
    /* Larger pixel texture for more noticeable effect */
}

/* Custom Cursors */
body {
    cursor: url('./assets/cursors/default-pointer.png'), auto;
    /* Default system pointer */
    margin: 0;
    /* background-color handled by classes now */
    font-family: 'Poppins', sans-serif;
    /* Modern general font */
    color: var(--fontMain);
    font-size: 1rem;
    /* Base font size */
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    align-items: center;
    min-height: 100vh;
    /* Ensure body takes full viewport height */
    overflow: hidden;
    /* Hide scrollbars if windows go slightly out of bounds initially */
    position: relative;
    /* For mobile menu positioning */
    transition: background-image 0.5s ease, background-color 0.5s ease;
    /* Smooth background transitions */
}

button,
a,
.project-icon,
.mobile-start-menu-toggle,
#retro-avatar,
.taskbar-item {
    /* Added .taskbar-item */
    cursor: url('./assets/cursors/hand-pointer.png'), pointer;
    /* Hand pointer for clickable elements */
}

.desktop {
    display: flex;
    flex-wrap: wrap;
    /* Allow windows to wrap on smaller screens */
    justify-content: flex-start;
    /* Align items to the top-left */
    align-items: flex-start;
    /* Align items to the top */
    padding: 2rem;
    gap: 2rem;
    width: 100%;
    /* Take full width */
    max-width: 1200px;
    /* Limit desktop width */
    position: relative;
    /* For z-index context */
    flex-grow: 1;
    /* Allow desktop to take available space */
    padding-bottom: 70px;
    /* Space for the taskbar at the bottom */
}

/* Windows */
.window {
    background-color: var(--windowLight);
    border: var(--ui-border-thickness) solid var(--borderColor);
    border-radius: var(--ui-border-radius);
    box-shadow: var(--ui-shadow-offset) var(--ui-shadow-offset) var(--shadowColor);
    width: 320px;
    /* Default width for windows */
    min-height: 200px;
    position: absolute;
    /* Allows for dragging and layering on desktop */
    transition: opacity 0.3s ease-out, transform 0.3s ease-out;
    /* Smooth transition for opening/minimizing */
    opacity: 0;
    transform: scale(0.9);
    /* Start slightly smaller */
    pointer-events: none;
    /* Disable interaction when hidden */
    z-index: 10;
    /* Default z-index */
    /* Initial positioning for all windows, overridden by JS for welcome */
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%) scale(0.9);
    display: flex;
    /* Make window itself a flex container */
    flex-direction: column;
    /* Stack header and body vertically */
}

/* Specific styling for the WELCOME WINDOW to make it larger and prominent */
#welcome-window {
    width: 450px;
    /* Significantly larger */
    min-height: 280px;
    /* Increased min-height */
    z-index: 101;
    /* Higher initial z-index to ensure prominence */
    left: 50%;
    /* Center it directly on desktop */
    top: 50%;
    transform: translate(-50%, -50%);
    /* Centering transform */
    opacity: 1;
    /* Ensure it's visible immediately */
    pointer-events: auto;
    /* Ensure it's interactive immediately */
}

/* Make the Curriculum window larger when visible */
#curriculum-window.visible {
    width: 800px;
    /* Adjust to your desired width */
    height: 90vh;
    /* Make it almost full height */
    max-width: 90vw;
    /* Ensure it doesn't exceed viewport width */
    max-height: 90vh;
    /* Ensure it doesn't exceed viewport height */
}

/* Display Settings Window specific sizing (can be adjusted) */
#display-settings-window {
    width: 400px;
    min-height: 250px;
}


.window.visible {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1);
    /* Fully visible and scaled, applies to draggable */
    pointer-events: auto;
    /* Enable interaction */
}

/* When not maximized or minimized, make sure it applies the standard centering */
.window:not(.maximized):not(.minimized).visible {
    transform: translate(-50%, -50%) scale(1);
}

.window.hidden {
    display: none;
    /* Only use display: none for initial load to avoid layout shifts */
    /* For transitions, we rely on opacity/transform and pointer-events */
}

/* Minimize window state */
.window.minimized {
    opacity: 0;
    transform: scale(0);
    /* Shrink and hide */
    pointer-events: none;
    /* Disable interaction */
    /* Position off-screen or very small if needed, but opacity/scale handles visual */
}

.window.maximized {
    width: 90vw !important;
    height: 90vh !important;
    top: 50% !important;
    left: 50% !important;
    transform: translate(-50%, -50%) !important;
    /* Always center when maximized */
    transition: all 0.3s ease-in-out;
}

/* Headers - Made a little bit bigger */
.window-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.8rem 1.2rem;
    /* Increased padding */
    font-family: 'Press Start 2P', cursive;
    /* Pixelated font for headers */
    font-size: 0.75rem;
    /* Slightly larger font size */
    border-bottom: var(--ui-border-thickness) solid var(--borderColor);
    cursor: grab;
    /* Indicates draggable */
    flex-shrink: 0;
    /* Prevent header from shrinking when body grows */
}

.window-header:active {
    cursor: grabbing;
    /* Indicates active dragging */
}

.header-buttons {
    display: flex;
    gap: 5px;
}

.peach {
    background-color: var(--peachHeader);
}

.sky {
    background-color: var(--skyBlue);
}

.mint {
    background-color: var(--mintGreen);
}

.window-body {
    padding: 1rem;
    font-family: 'VT323', monospace;
    /* Retro terminal font for body text */
    font-size: 1.1rem;
    /* Pixel texture fill - More visible now */
    background-image: radial-gradient(circle at 1px 1px, rgba(0, 0, 0, 0.05) 1px, transparent 0);
    background-size: var(--ui-pixel-texture-size) var(--ui-pixel-texture-size);
    flex: 1;
    /* ALLOWS THE WINDOW BODY TO GROW AND TAKE UP REMAINING SPACE */
    overflow: auto;
    /* Add scrollbars if content overflows, especially for curriculum */
}

/* Override for curriculum window body specifically */
#curriculum-window .window-body {
    padding: 0;
    /* Remove padding for PDF iframe to go edge-to-edge */
    overflow: hidden;
    /* Hide scrollbars, PDF viewer usually has its own */
    display: flex;
    /* Make it a flex container as well */
    flex-direction: column;
    /* Stack contents (just iframe) vertically */
}


.window-body h1 {
    font-family: 'Press Start 2P', cursive;
    /* Pixelated font for main titles */
    font-size: 1.8rem;
    /* Larger for prominence */
    margin-bottom: 0.5rem;
    text-shadow: 2px 2px rgba(0, 0, 0, 0.1);
    /* Subtle text shadow for pop */
}

.window-body h2 {
    font-family: 'Press Start 2P', cursive;
    /* Pixelated font for subtitles */
    font-size: 1.2rem;
    margin-top: 1.5rem;
    margin-bottom: 0.5rem;
    color: var(--borderColor);
}

.window-body p {
    line-height: 1.4;
    margin-bottom: 0.8rem;
}

.window-body a {
    color: var(--skyBlue);
    text-decoration: none;
    border-bottom: 1px dashed var(--skyBlue);
}

.window-body a:hover {
    color: var(--peachHeader);
    border-bottom: 1px solid var(--peachHeader);
}


/* Buttons - More classic UI style */
.button-group {
    display: flex;
    flex-wrap: wrap;
    /* Allow buttons to wrap */
    gap: 0.8rem;
    /* Increased gap */
    margin-top: 1.5rem;
    /* More space */
}

.button-group button,
.close-btn,
.maximize-btn,
.minimize-btn,
.project-link-btn {
    font-family: 'Press Start 2P', cursive;
    /* Pixelated font for buttons */
    font-size: 0.7rem;
    background-color: var(--mintGreen);
    /* Default button color */
    border: var(--ui-border-thickness) solid var(--borderColor);
    border-radius: var(--ui-border-radius);
    /* Use global border radius */
    padding: 0.7rem 1rem;
    /* Larger tap targets */
    cursor: pointer;
    transition: background-color 0.1s ease, transform 0.05s ease, box-shadow 0.05s ease;
    /* Faster transitions for 'click' feel */
    box-shadow: 2px 2px var(--shadowColor);
    /* Smaller button shadow */
    color: var(--fontMain);
    /* Ensure text is visible */
}

.close-btn {
    background-color: #ff6f6f;
    /* More distinct red for close */
    font-size: 0.6rem;
    /* Smaller text for X */
    padding: 0.4rem 0.6rem;
}

.maximize-btn {
    background-color: #6fbaff;
    /* Distinct blue for maximize */
    font-size: 0.6rem;
    /* Smaller text for maximize */
    padding: 0.4rem 0.6rem;
}

/* Minimize button specific style */
.minimize-btn {
    background-color: #ffd700;
    /* Gold/yellow for minimize */
    font-size: 0.6rem;
    padding: 0.4rem 0.6rem;
}

.button-group button:hover,
.close-btn:hover,
.maximize-btn:hover,
.minimize-btn:hover,
.project-link-btn:hover {
    background-color: var(--buttonHover);
    transform: translate(1px, 1px);
    /* Slight 'pressed' effect */
    box-shadow: 1px 1px var(--shadowColor);
}

/* Project Explorer styles */
.project-explorer {
    display: flex;
    flex-wrap: wrap;
    gap: 1.5rem;
    padding: 1rem;
}

/* Desktop Icons (Project/Experience/Contact/etc.) and Project Icons */
.project-icon {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    width: 80px;
    /* Fixed width for icon block */
    cursor: pointer;
    user-select: none;
    /* Prevent text selection on double click */
    position: relative;
    /* Back to relative positioning for flow */
    z-index: 5;
    /* Lower than windows but higher than background */
    transition: transform 0.1s ease, filter 0.1s ease;
    /* Smooth hover effect */
    margin-bottom: 20px;
    /* Add some spacing when stacked */
}

.project-icon img {
    width: 60px;
    /* Icon size */
    height: 60px;
    margin-bottom: 0.5rem;
    filter: drop-shadow(2px 2px rgba(0, 0, 0, 0.2));
    /* Subtle icon shadow */
}

.project-icon img.exp-icon-img {
    object-fit: contain;
}

.project-icon span {
    font-family: 'VT323', monospace;
    font-size: 1rem;
    color: var(--fontMain);
    /* Default text color for project icons (inside window) */
    text-shadow: none;
    /* No text shadow needed here */
    white-space: nowrap;
    /* Prevent breaking icon name */
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 100%;
}

.project-icon:hover img {
    transform: translateY(-3px);
    /* Lift effect on hover */
}

.project-icon:hover span {
    filter: brightness(1.2);
    /* Slightly brighten text on hover */
}


/* Project Details Window */
.project-details-window {
    z-index: 20;
    /* Ensure detail windows are on top */
    width: 550px;
    /* Larger width for details */
    max-width: 90vw;
    /* Responsive max width */
    height: 70vh;
    /* Give it a default height to make its body fill */
    max-height: 90vh;
    /* Don't let it get too tall */
    display: flex;
    /* Ensure it's a flex container */
    flex-direction: column;
    /* Stack header and body */
}

/* This is the key: Make the window-body inside project-details-window a flex container */
.project-details-window .window-body {
    display: flex;
    flex-direction: column;
    /* Stack its internal content (image, text, links) vertically */
    flex: 1;
    /* Allow this body to grow and fill the available height of its parent (.project-details-window) */
    overflow-y: auto;
    /* Add vertical scrollbar if content overflows */
    padding: 1rem;
    /* Re-add padding that was removed for iframe */
}

/* Ensure the image and links are properly constrained within the flex body */
.project-image {
    max-width: 100%;
    height: auto;
    border: var(--ui-border-thickness) solid var(--borderColor);
    margin-bottom: 1rem;
    box-shadow: 4px 4px var(--shadowColor);
    flex-shrink: 0;
    /* Prevent image from shrinking if space is tight */
}

.project-details-window .window-body h2 {
    flex-shrink: 0;
    /* Prevent heading from shrinking */
}

.project-details-window .window-body p {
    flex-grow: 1;
    /* Allow paragraphs to grow and take space, or shrink */
    /* If you want text to expand, use flex-grow. If you want it to wrap and not expand, remove flex-grow */
    /* For simple text, flex-grow isn't strictly necessary, but can help with vertical distribution */
}

/* Hero photo in experience detail windows */
.exp-photo-img {
    width: 100%;
    max-height: 320px;
    height: auto;
    object-fit: contain;
    object-position: center;
    padding: 0;
    background-color: #e8e8e8;
}

/* Experience Details Window */
.experience-details-window {
    z-index: 20;
    width: 550px;
    max-width: 90vw;
    height: 70vh;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
}

.experience-details-window .window-body {
    display: flex;
    flex-direction: column;
    flex: 1;
    overflow-y: auto;
    padding: 1rem;
}

.experience-details-window .window-body h2 { flex-shrink: 0; }
.experience-details-window .window-body p { flex-grow: 1; }

.project-links {
    display: flex;
    flex-wrap: wrap;
    /* Allow links to wrap */
    gap: 1rem;
    margin-top: auto;
    /* Push links to the bottom if space allows */
    flex-shrink: 0;
    /* Prevent link group from shrinking */
    padding-top: 1rem;
    /* Add some space above the links */
    border-top: 1px solid var(--borderColor);
    /* Add a separator line above links */
}

.project-link-btn {
    background-color: var(--skyBlue);
    display: flex;
    align-items: center;
    gap: 0.3rem;
    text-decoration: none;
    color: var(--fontMain);
}

.project-link-btn.github-btn {
    background-color: #24292e;
    color: #ffffff;
}

.project-link-btn.demo-btn {
    background-color: #2d8a4e;
    color: #ffffff;
}

.project-link-btn.social-btn {
    background-color: #c13584;
    color: #ffffff;
}

/* Contact Window / Login Box */
.login-box label {
    display: block;
    font-family: 'Press Start 2P', cursive;
    font-size: 0.8rem;
    margin-bottom: 0.3rem;
    color: var(--borderColor);
}

.login-box input[type="text"],
.login-box input[type="password"] {
    width: calc(100% - 10px);
    /* Account for padding */
    padding: 0.5rem;
    border: var(--ui-border-thickness) solid var(--borderColor);
    background-color: #c0c0c0;
    /* Classic grey input background */
    font-family: 'VT323', monospace;
    font-size: 1.1rem;
    margin-bottom: 1rem;
    box-shadow: inset 1px 1px 2px rgba(0, 0, 0, 0.2);
    /* Inset shadow for input field */
    color: var(--fontMain);
}

.login-box input[type="text"]:focus,
.login-box input[type="password"]:focus {
    outline: none;
    border-color: var(--skyBlue);
}

#contact-info {
    margin-top: 1.5rem;
    padding-top: 1rem;
    border-top: 2px dashed var(--borderColor);
}

/* Mobile Start Menu */
.mobile-start-menu-toggle {
    display: none;
    /* Hidden by default on desktop */
    position: fixed;
    bottom: 20px;
    left: 20px;
    background-color: var(--skyBlue);
    border: var(--ui-border-thickness) solid var(--borderColor);
    border-radius: var(--ui-border-radius);
    padding: 0.8rem 1.2rem;
    font-family: 'Press Start 2P', cursive;
    font-size: 1rem;
    box-shadow: var(--ui-shadow-offset) var(--ui-shadow-offset) var(--shadowColor);
    z-index: 100;
    /* Ensure it's on top */
    text-shadow: 1px 1px rgba(0, 0, 0, 0.2);
    color: var(--fontMain);
    transition: background-color 0.2s ease, transform 0.1s ease;
}

.mobile-start-menu-toggle:hover {
    background-color: var(--buttonHover);
    transform: translate(1px, 1px);
    box-shadow: 1px 1px var(--shadowColor);
}

.mobile-menu {
    display: none;
    /* Hidden by default, will be block for transition */
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    background-color: var(--backgroundMain);
    border-top: var(--ui-border-thickness) solid var(--borderColor);
    box-shadow: 0 -6px 10px rgba(0, 0, 0, 0.3);
    z-index: 99;
    padding: 1rem 0;
    /* Transition properties for animation */
    transition: transform 0.3s ease-out, opacity 0.3s ease-out;
    transform: translateY(100%);
    /* Start hidden off-screen */
    opacity: 0;
    pointer-events: none;
    /* Not interactive when hidden */
}

/* Class to trigger the "open" state for animation */
.mobile-menu.mobile-menu-active {
    transform: translateY(0);
    /* Slide up into view */
    opacity: 1;
    pointer-events: auto;
    /* Interactive when active */
}

.mobile-menu.hidden {
    display: none;
    /* Finally hide the element after transition */
}

.mobile-menu ul {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.mobile-menu button {
    width: calc(100% - 2rem);
    /* Full width with padding */
    margin: 0 1rem;
    background-color: var(--windowLight);
    border: var(--ui-border-thickness) solid var(--borderColor);
    border-radius: 5px;
    padding: 0.8rem;
    font-family: 'Press Start 2P', cursive;
    font-size: 0.9rem;
    color: var(--fontMain);
    box-shadow: 2px 2px var(--shadowColor);
    transition: background-color 0.2s ease, transform 0.1s ease;
}

.mobile-menu button:hover {
    background-color: var(--buttonHover);
    transform: translate(1px, 1px);
    box-shadow: 1px 1px var(--shadowColor);
}

/* Retro Avatar Icon */
#retro-avatar-container {
    position: fixed;
    bottom: 30px;
    right: 30px;
    z-index: 1000;
    /* Ensure it's on top of everything */
    display: flex;
    flex-direction: column;
    align-items: flex-end;
}

#retro-avatar {
    width: 80px;
    /* Adjust size */
    height: 80px;
    image-rendering: pixelated;
    /* Essential for crisp pixel art */
    cursor: pointer;
    transition: transform 0.1s ease;
    border: 3px solid var(--borderColor);
    border-radius: 50%;
    box-shadow: var(--ui-shadow-offset) var(--ui-shadow-offset) var(--shadowColor);
    object-fit: cover;
    background-color: var(--mintGreen);
    /* Background color for avatar */
}

#retro-avatar:hover {
    transform: translateY(-5px);
}

#avatar-info-box {
    position: absolute;
    bottom: 90px;
    /* Position above the avatar */
    right: 0;
    width: 250px;
    /* Small window size */
    min-height: unset;
    transform-origin: bottom right;
    /* Animate from avatar */
    z-index: 1001;
    /* Ensure info box is above avatar */
    transition: opacity 0.3s ease-out, transform 0.3s ease-out;
    /* Match window transitions */
    opacity: 0;
    transform: scale(0.9);
    /* Start slightly scaled down */
    pointer-events: none;
    /* Not interactive when hidden */
}

#avatar-info-box.visible {
    opacity: 1;
    transform: scale(1);
    /* Show at natural size */
    pointer-events: auto;
    /* Make interactive */
    /* On desktop, this will be relative to #retro-avatar-container, which has fixed positioning.
       No need for translate(-50%,-50%) here. */
}

/* Vintage Clock Styles */
#vintage-clock {
    position: fixed;
    bottom: 60px;
    /* Adjusted to be above the 50px taskbar + some padding */
    left: 20px;
    background-color: var(--windowLight);
    border: var(--ui-border-thickness) solid var(--borderColor);
    border-radius: var(--ui-border-radius);
    padding: 10px 15px;
    font-family: 'VT323', monospace;
    /* Classic terminal font */
    font-size: 1.8rem;
    /* Large, easy-to-read size */
    color: var(--fontMain);
    box-shadow: var(--ui-shadow-offset) var(--ui-shadow-offset) var(--shadowColor);
    z-index: 1000;
    /* Ensure it's on top */
    text-shadow: 1px 1px rgba(0, 0, 0, 0.2);
    /* Subtle shadow for depth */
}

/* Taskbar Styles */
#taskbar {
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 50px;
    /* Standard taskbar height */
    background-color: var(--taskbarColor);
    border-top: var(--ui-border-thickness) solid var(--taskbarBorder);
    display: flex;
    align-items: center;
    padding: 0 10px;
    box-sizing: border-box;
    /* Include padding in width/height */
    z-index: 999;
    /* Below clock/avatar, above windows */
    gap: 5px;
    /* Space between taskbar items */
}

.taskbar-item {
    font-family: 'Press Start 2P', cursive;
    font-size: 0.65rem;
    padding: 8px 12px;
    background-color: var(--taskbarColor);
    border: 2px outset var(--taskbarBorder);
    /* Classic 3D button effect */
    box-shadow: none;
    /* Remove default button shadow */
    color: var(--fontMain);
    white-space: nowrap;
    /* Prevent text wrapping */
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 150px;
    /* Limit width of taskbar items */
    height: 30px;
    /* Consistent height for items */
    display: flex;
    /* For aligning text */
    align-items: center;
    justify-content: center;
    transition: background-color 0.1s ease, border 0.1s ease;
}

.taskbar-item:hover {
    background-color: #d0d0d0;
    /* Slightly lighter on hover */
    border: 2px outset var(--taskbarBorder);
    /* Maintain 3D effect */
    transform: none;
    /* No movement on hover */
    box-shadow: none;
}

/* "Pressed" state for active/minimized taskbar items */
.taskbar-item.active {
    background-color: var(--mintGreen);
    /* Indicate active window */
    border: 2px inset var(--taskbarActiveBorder);
    /* Inset border for active/pressed look */
    text-shadow: 1px 1px rgba(0, 0, 0, 0.2);
    /* Subtle shadow for active text */
}

.taskbar-item.minimized-taskbar-item {
    background-color: #a0a0a0;
    /* Slightly darker for minimized items */
    border: 2px inset var(--taskbarBorder);
    /* Inset border */
}

.taskbar-item.start-button {
    background-color: var(--mintGreen);
    font-weight: bold;
    color: var(--fontMain);
    border: 2px outset var(--borderColor);
    text-shadow: 1px 1px rgba(0, 0, 0, 0.2);
    padding: 8px 15px;
    /* Slightly wider start button */
    margin-right: 10px;
}

.taskbar-item.start-button:hover {
    background-color: #a0f0c0;
    /* Lighter mint on hover */
    border: 2px outset var(--borderColor);
}


/* Desktop Backgrounds */
body.bg-default-blue {
    background-color: var(--backgroundMain);
    /* Your original dark blue */
}

body.bg-clouds {
    background-image: url('https://upload.wikimedia.org/wikipedia/commons/thumb/e/e0/Win95_clouds.png/2560px-Win95_clouds.png');
    /* Classic Win95 clouds */
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    background-color: #5d98e8;
    /* Fallback/blend color */
}

body.bg-matrix-grid {
    background-color: #1a1a1a;
    background-image: linear-gradient(0deg, transparent 24%, rgba(255, 255, 255, .05) 25%, rgba(255, 255, 255, .05) 26%, transparent 27%, transparent 74%, rgba(255, 255, 255, .05) 75%, rgba(255, 255, 255, .05) 76%, transparent 77%, transparent), linear-gradient(90deg, transparent 24%, rgba(255, 255, 255, .05) 25%, rgba(255, 255, 255, .05) 26%, transparent 27%, transparent 74%, rgba(255, 255, 255, .05) 75%, rgba(255, 255, 255, .05) 76%, transparent 77%, transparent);
    background-size: 50px 50px;
    background-position: -2px -2px;
    /* Adjust slightly for visual */
}

body.bg-solid-black {
    background-color: #000000;
}


/* --- Skills Window --- */
#skills-window {
    width: 500px;
    max-width: 92vw;
    max-height: 85vh;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.skills-body {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    padding-bottom: 0.25rem;
}

.skills-intro {
    margin: 0 0 0.25rem;
    line-height: 1.45;
}

.skills-body .skill-group {
    margin: 0;
}

.skills-body h3 {
    font-family: 'Press Start 2P', cursive;
    font-size: 0.55rem;
    color: var(--borderColor);
    margin: 0 0 0.45rem;
    letter-spacing: 0.3px;
    line-height: 1.5;
}

.skill-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.45rem;
}

.skill-tag {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    font-family: 'VT323', monospace;
    font-size: 1.05rem;
    line-height: 1.2;
    padding: 0.35rem 0.6rem 0.35rem 0.45rem;
    border: 2px solid var(--borderColor);
    border-radius: 4px;
    background: linear-gradient(180deg, #f6faf8 0%, #dceee4 100%);
    box-shadow: 2px 2px 0 var(--shadowColor);
    color: var(--fontMain);
}

.skill-tag .skill-tag-txt {
    line-height: 1.2;
}

/* Devicon + Remix icons inside tags */
.skill-tag-ico {
    font-size: 1.42rem;
    line-height: 1;
    flex-shrink: 0;
    width: 1.42rem;
    text-align: center;
    display: inline-block;
    vertical-align: middle;
}

.skill-tag-ico[class^="ri-"] {
    font-size: 1.28rem;
    width: 1.28rem;
}

.skill-tag-ico--accent {
    color: #2d6a9f;
}

/* --- Teaching Window --- */
#teaching-window {
    width: 480px;
    max-height: 82vh;
}

.teaching-body {
    display: flex;
    flex-direction: column;
    gap: 12px;
    overflow-y: auto;
    padding: 14px;
}

/* Top row: title block + compact rating pill */
.teaching-top {
    display: flex;
    align-items: flex-start;
    gap: 14px;
}

.teaching-title-block {
    flex: 1;
}

.teaching-org {
    font-family: 'Press Start 2P', monospace;
    font-size: 0.55rem;
    color: var(--peachHeader);
    margin: 2px 0 8px;
    letter-spacing: 0.5px;
}

.teaching-desc {
    font-family: 'VT323', monospace;
    font-size: 1.05rem;
    line-height: 1.4;
    margin: 0;
}

/* Compact star rating pill */
.teaching-rating-compact {
    background: rgba(0, 0, 0, 0.05);
    border: 2px solid var(--borderColor);
    border-radius: 6px;
    padding: 8px 12px;
    text-align: center;
    min-width: 90px;
    flex-shrink: 0;
}

.rating-stars-sm {
    display: flex;
    gap: 1px;
    justify-content: center;
}

.star {
    font-size: 1.1rem;
    line-height: 1;
    color: #ccc;
}

.star.full {
    color: #f4b266;
    text-shadow: 0 0 3px rgba(244, 178, 102, 0.5);
}

.star.half {
    position: relative;
    color: #ccc;
}

.star.half::before {
    content: '★';
    position: absolute;
    left: 0;
    top: 0;
    color: #f4b266;
    width: 50%;
    overflow: hidden;
    display: block;
}

.rating-num-sm {
    font-family: 'VT323', monospace;
    font-size: 1.6rem;
    margin: 2px 0 0;
    line-height: 1;
}

.rating-max-sm {
    font-size: 1rem;
    color: #888;
}

.rating-caption-sm {
    font-family: 'Press Start 2P', monospace;
    font-size: 0.45rem;
    color: #666;
    margin: 3px 0 0;
    line-height: 1.4;
}

/* Full-width rating strip below images */
.teaching-rating-full {
    flex-direction: row;
    align-items: center;
    gap: 12px;
    padding: 8px 14px;
    min-width: 100px;
    text-align: left;
    justify-content: flex-start;
}

.teaching-rating-full .rating-stars-sm {
    justify-content: flex-start;
}

.teaching-rating-full .rating-num-sm {
    margin: 0;
    font-size: 1.5rem;
}

.teaching-rating-full .rating-caption-sm {
    margin: 0;
    font-size: 0.4rem;
}

/* Bottom: images left + chart right */
.teaching-bottom {
    display: flex;
    gap: 14px;
    align-items: flex-start;
    min-height: 220px;
}

/* Vertical image strip — full width column */
.teaching-images-v {
    display: flex;
    flex-direction: column;
    gap: 8px;
    width: 100%;
}

.teaching-img-slot-v {
    border: 2px solid var(--borderColor);
    box-shadow: 3px 3px var(--shadowColor);
    overflow: hidden;
    width: 100%;
}

.teaching-img-slot-v img {
    width: 100%;
    height: 200px;
    object-fit: cover;
    display: block;
}

/* Bar chart */
.teach-chart {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.chart-title {
    font-family: 'Press Start 2P', monospace;
    font-size: 0.5rem;
    margin: 0 0 4px;
    color: var(--borderColor);
    line-height: 1.5;
}

.chart-area {
    display: flex;
    align-items: flex-end;
    gap: 8px;
    height: 180px;
    border-left: 2px solid var(--borderColor);
    border-bottom: 2px solid var(--borderColor);
    padding: 6px 4px 0 6px;
}

.chart-row {
    display: flex;
    flex-direction: column;
    align-items: center;
    flex: 1;
    height: 100%;
}

.chart-label {
    font-family: 'Press Start 2P', monospace;
    font-size: 0.38rem;
    color: #444;
    text-align: center;
    line-height: 1.5;
    margin-top: 4px;
    writing-mode: vertical-rl;
    text-orientation: mixed;
    transform: rotate(180deg);
    max-height: 90px;
    overflow: hidden;
}

.chart-bars {
    display: flex;
    gap: 2px;
    align-items: flex-end;
    height: 100%;
    width: 100%;
    justify-content: center;
}

.bar {
    width: 10px;
    min-height: 2px;
    border-radius: 2px 2px 0 0;
    position: relative;
    transition: height 0.6s ease;
}

.bar span {
    position: absolute;
    top: -14px;
    left: 50%;
    transform: translateX(-50%);
    font-family: 'VT323', monospace;
    font-size: 0.75rem;
    white-space: nowrap;
    color: #333;
}

.bar.agree {
    background: #2d6a9f;
}

.bar.neutral {
    background: #84b6f4;
}

.bar.disagree {
    background: #d0e4f7;
}

/* Legend */
.chart-legend {
    display: flex;
    gap: 12px;
    font-family: 'VT323', monospace;
    font-size: 1rem;
    align-items: center;
    flex-wrap: wrap;
}

.legend-dot {
    display: inline-block;
    width: 12px;
    height: 12px;
    border-radius: 2px;
    margin-right: 3px;
    vertical-align: middle;
}

.agree-dot {
    background: #2d6a9f;
}

.neutral-dot {
    background: #84b6f4;
}

.disagree-dot {
    background: #d0e4f7;
    border: 1px solid #aaa;
}



/* Responsive Design */

@media (max-width: 768px) {
    body {
        align-items: flex-start;
        /* Align to top on mobile */
        padding-bottom: 70px;
        /* Space for clock & mobile menu on mobile, including taskbar area */
        overflow-y: auto;
        /* Allow scrolling on mobile */
        min-height: auto;
    }

    .desktop {
        flex-direction: column;
        gap: 1.5rem;
        padding: 0;
        position: static;
        /* Stack windows on mobile, no absolute positioning context needed for desktop */
        padding-bottom: 70px;
        /* Ensure desktop has space for taskbar */
        align-items: center;
        /* Center items in the flex column */
    }

    .window {
        width: 95vw;
        /* Almost full screen width */
        position: relative !important;
        /* Stack windows on mobile, override absolute positioning */
        left: auto !important;
        /* Override any absolute positioning */
        top: auto !important;
        /* Override any absolute positioning */
        transform: none !important;
        /* Clear any transforms */
        margin: 0 auto 1.5rem auto;
        /* Center with margin and provide spacing */
        box-shadow: var(--ui-shadow-offset) var(--ui-shadow-offset) var(--shadowColor);
        /* Re-apply shadow */
        transition: opacity 0.3s ease-out, transform 0.3s ease-out, width 0.3s ease-out, height 0.3s ease-out, left 0.3s ease-out, top 0.3s ease-out;
        /* Add all properties for smooth transitions */
    }

    /* Specific adjustment for the welcome window on mobile */
    #welcome-window {
        width: 95vw;
        min-height: auto;
        /* Allow height to shrink */
        transform: none !important;
        left: auto !important;
        top: auto !important;
        position: relative !important;
        /* Ensure it stacks */
        margin: 0 auto 1.5rem auto;
    }

    /* Make the Curriculum window larger on mobile when visible */
    #curriculum-window.visible {
        width: 95vw;
        height: 90vh;
        /* Keep it tall */
        max-width: 95vw;
        max-height: 90vh;
    }

    .window.maximized {
        width: 95vw !important;
        height: auto !important;
        /* Auto height for content */
        min-height: 90vh;
        /* Ensure it still takes up significant space */
        overflow-y: auto;
        /* Allow scrolling within maximized window if content overflows */
        left: auto !important;
        top: auto !important;
        transform: none !important;
        /* Ensure it's not trying to translate */
        margin: 0 auto;
        /* Center while maximized */
    }

    /* Hide the mobile menu when it's supposed to be hidden (after transition) */
    .mobile-menu.hidden {
        display: none;
    }

    /* Adjust font sizes for mobile legibility */
    .window-body {
        font-size: 1rem;
    }

    .window-body h1 {
        font-size: 1.1rem;
        line-height: 1.4;
    }

    .window-body h2 {
        font-size: 0.9rem;
    }

    .button-group button,
    .close-btn,
    .maximize-btn,
    .minimize-btn,
    .project-link-btn {
        font-size: 0.62rem;
        padding: 0.75rem 1rem;
        min-height: 44px;
    }

    .mobile-start-menu-toggle {
        display: block;
        /* Show mobile menu toggle */
        bottom: 20px;
        left: 20px;
        padding: 0.6rem 1rem;
        font-size: 0.8rem;
        z-index: 1000;
        /* Ensure it's above taskbar */
    }

    /* On mobile, only the welcome window should be visible by default.
     Other windows should be hidden until explicitly opened via the menu. */
    .desktop>.window:not(#welcome-window):not(#avatar-info-box):not(.visible) {
        /* Exclude avatar-info-box too */
        display: none;
    }

    /* Make sure welcome window is visible by default on mobile */
    #welcome-window {
        display: block;
        opacity: 1;
        pointer-events: auto;
    }

    /* For mobile, if a window is opened via the menu, it should become visible */
    .window.visible {
        display: block;
    }

    /* Avatar container position on mobile */
    #retro-avatar-container {
        bottom: 60px;
        /* Adjust to not overlap clock or mobile menu toggle */
        right: 15px;
        z-index: 1000;
        /* Ensure it's above taskbar */
    }

    /* Vintage clock on mobile */
    #vintage-clock {
        bottom: 60px;
        /* Stays above mobile menu toggle / potential footer */
        left: 10px;
        font-size: 1.5rem;
        /* Slightly smaller for mobile */
        padding: 8px 12px;
        z-index: 1000;
        /* Ensure it's above taskbar */
    }

    /* Hide taskbar on mobile */
    #taskbar {
        display: none;
    }
}

/* ====== ECON / IB PORTFOLIO THEME ====== */

body.theme-econ {
    background-color: #F8F7F3 !important;
    background-image: none !important;
    overflow-y: auto;
    overflow-x: hidden;
    align-items: flex-start;
    justify-content: flex-start;
}

/* Hide all retro elements */
body.theme-econ .desktop,
body.theme-econ #taskbar,
body.theme-econ #vintage-clock,
body.theme-econ #retro-avatar-container,
body.theme-econ .mobile-start-menu-toggle,
body.theme-econ .mobile-menu {
    display: none !important;
}

/* Econ portfolio: hidden by default, shown in econ mode */
#econ-portfolio {
    display: none;
    width: 100%;
}

body.theme-econ #econ-portfolio {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    width: 100%;
    background-color: #F8F7F3;
}

/* ── Header ── */
#econ-header {
    position: sticky;
    top: 0;
    z-index: 100;
    background-color: #FFFFFF;
    border-bottom: 1px solid #E4DDD4;
    padding: 1rem 2.5rem;
    display: flex;
    align-items: center;
    gap: 2rem;
    box-shadow: 0 1px 4px rgba(0,0,0,0.04);
}

#econ-brand { flex: 1; }

#econ-name-heading {
    font-family: 'Playfair Display', Georgia, serif;
    font-size: 1.2rem;
    font-weight: 700;
    color: #0D2B45;
    margin: 0;
    letter-spacing: 0.01em;
}

#econ-brand-sub {
    font-family: 'Inter', sans-serif;
    font-size: 0.73rem;
    color: #9A9A9A;
    margin: 0;
    letter-spacing: 0.01em;
}

#econ-nav {
    display: flex;
    gap: 0;
}

.econ-nav-btn {
    font-family: 'Inter', sans-serif;
    font-size: 0.82rem;
    font-weight: 500;
    color: #6B6B6B;
    background: transparent;
    border: none;
    border-bottom: 2px solid transparent;
    padding: 0.4rem 0.85rem;
    cursor: pointer;
    letter-spacing: 0.01em;
    border-radius: 0;
    box-shadow: none;
    transition: color 0.15s, border-color 0.15s;
}

.econ-nav-btn:hover {
    color: #0D2B45;
    border-bottom-color: #0D2B45;
    background: transparent;
    transform: none;
    box-shadow: none;
}

.econ-nav-btn.active {
    color: #0D2B45;
    border-bottom-color: #0D2B45;
    font-weight: 600;
    background: transparent;
}

#econ-retro-btn {
    font-family: 'Inter', sans-serif;
    font-size: 0.76rem;
    font-weight: 500;
    color: #9A9A9A;
    background: transparent;
    border: 1px solid #D8D3CA;
    border-radius: 4px;
    padding: 0.38rem 0.8rem;
    cursor: pointer;
    letter-spacing: 0.01em;
    box-shadow: none;
    transition: color 0.15s, border-color 0.15s;
}

#econ-retro-btn:hover {
    color: #0D2B45;
    border-color: #0D2B45;
    background: transparent;
    transform: none;
    box-shadow: none;
}

/* ── Main ── */
#econ-main {
    flex: 1;
    max-width: 900px;
    width: 100%;
    margin: 0 auto;
    padding: 3rem 2rem 5rem;
    box-sizing: border-box;
}

/* ── Sections ── */
.econ-section { display: none; }
.econ-section.active { display: block; }

.econ-section-title {
    font-family: 'Playfair Display', Georgia, serif;
    font-size: 1.55rem;
    font-weight: 700;
    color: #0D2B45;
    margin: 0 0 2rem;
    padding-bottom: 0.7rem;
    border-bottom: 2px solid #E4DDD4;
    letter-spacing: 0.01em;
}

/* ── About ── */
.econ-about-grid {
    display: grid;
    grid-template-columns: 190px 1fr;
    gap: 3rem;
    align-items: start;
}

#econ-avatar-img {
    width: 100%;
    aspect-ratio: 1;
    object-fit: cover;
    border: 1px solid #E4DDD4;
    display: block;
}

.econ-contact-quick {
    margin-top: 1rem;
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
}

.econ-contact-quick a {
    font-family: 'Inter', sans-serif;
    font-size: 0.75rem;
    color: #7A7A7A;
    text-decoration: none;
    border-bottom: none;
    transition: color 0.12s;
}

.econ-contact-quick a:hover {
    color: #0D2B45;
    border-bottom: none;
}

.econ-bio-col { padding-top: 0.25rem; }

.econ-bio-text {
    font-family: 'Inter', sans-serif;
    font-size: 0.9rem;
    color: #4A4A4A;
    line-height: 1.8;
    margin-bottom: 0.9rem;
}

.econ-tag-row {
    display: flex;
    flex-wrap: wrap;
    gap: 0.45rem;
    margin: 1.4rem 0;
}

.econ-tag {
    font-family: 'Inter', sans-serif;
    font-size: 0.7rem;
    font-weight: 500;
    color: #1B3A5C;
    background-color: #EAF0F7;
    border: 1px solid #C8D8E8;
    padding: 0.28rem 0.65rem;
    letter-spacing: 0.01em;
}

.econ-cta-row {
    display: flex;
    gap: 0.85rem;
    align-items: center;
    flex-wrap: wrap;
    margin-top: 0.5rem;
}

.econ-btn-primary {
    font-family: 'Inter', sans-serif;
    font-size: 0.8rem;
    font-weight: 600;
    color: #FFFFFF;
    background-color: #0D2B45;
    border: 1px solid #0D2B45;
    padding: 0.58rem 1.3rem;
    cursor: pointer;
    text-decoration: none;
    letter-spacing: 0.02em;
    border-radius: 0;
    box-shadow: none;
    transition: background-color 0.15s;
    display: inline-block;
}

.econ-btn-primary:hover {
    background-color: #1B3A5C;
    border-color: #1B3A5C;
    color: #FFFFFF;
    transform: none;
    box-shadow: none;
}

.econ-btn-secondary {
    font-family: 'Inter', sans-serif;
    font-size: 0.8rem;
    font-weight: 500;
    color: #0D2B45;
    background-color: transparent;
    border: 1px solid #C8D8E8;
    padding: 0.55rem 1.1rem;
    cursor: pointer;
    letter-spacing: 0.02em;
    border-radius: 0;
    box-shadow: none;
    transition: border-color 0.15s;
}

.econ-btn-secondary:hover {
    border-color: #0D2B45;
    color: #0D2B45;
    background-color: transparent;
    transform: none;
    box-shadow: none;
}

/* ── Experience ── */
.econ-exp-list {
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
}

.econ-exp-card {
    background-color: #FFFFFF;
    border: 1px solid #E4DDD4;
    padding: 1.4rem 1.5rem;
    transition: border-color 0.15s, box-shadow 0.15s;
}

.econ-exp-card:hover {
    border-color: #B8C8D8;
    box-shadow: 0 2px 14px rgba(13, 43, 69, 0.05);
}

.econ-exp-meta {
    display: flex;
    align-items: flex-start;
    gap: 1rem;
    margin-bottom: 0.8rem;
}

.econ-exp-logo {
    width: 42px;
    height: 42px;
    object-fit: contain;
    flex-shrink: 0;
    border: 1px solid #EEEBE4;
    padding: 4px;
    background: #FAFAF8;
}

.econ-exp-info { flex: 1; }

.econ-exp-info h3 {
    font-family: 'Playfair Display', Georgia, serif;
    font-size: 0.97rem;
    font-weight: 600;
    color: #0D2B45;
    margin: 0 0 0.18rem;
}

.econ-exp-org {
    font-family: 'Inter', sans-serif;
    font-size: 0.76rem;
    color: #8A8A8A;
    margin: 0;
}

.econ-exp-date {
    font-family: 'Inter', sans-serif;
    font-size: 0.7rem;
    color: #ABABAB;
    white-space: nowrap;
    flex-shrink: 0;
    margin-top: 0.15rem;
}

.econ-exp-desc {
    font-family: 'Inter', sans-serif;
    font-size: 0.84rem;
    color: #4A4A4A;
    line-height: 1.72;
    margin-bottom: 0.9rem;
}

.econ-skill-row {
    display: flex;
    flex-wrap: wrap;
    gap: 0.38rem;
}

.econ-skill-row span {
    font-family: 'Inter', sans-serif;
    font-size: 0.68rem;
    color: #5A6B7A;
    background-color: #F0F4F8;
    border: 1px solid #D8E4EC;
    padding: 0.2rem 0.52rem;
    letter-spacing: 0.01em;
}

/* ── Projects ── */
.econ-projects-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(255px, 1fr));
    gap: 1.25rem;
}

.econ-project-card {
    background-color: #FFFFFF;
    border: 1px solid #E4DDD4;
    padding: 1.4rem;
    display: flex;
    flex-direction: column;
    gap: 0.7rem;
    transition: border-color 0.15s, box-shadow 0.15s;
}

.econ-project-card:hover {
    border-color: #B8C8D8;
    box-shadow: 0 2px 14px rgba(13, 43, 69, 0.05);
}

.econ-project-header {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.econ-project-icon {
    width: 42px;
    height: 42px;
    object-fit: contain;
    border: 1px solid #EEEBE4;
    padding: 4px;
    background: #FAFAF8;
    flex-shrink: 0;
}

.econ-project-header h3 {
    font-family: 'Playfair Display', Georgia, serif;
    font-size: 0.93rem;
    font-weight: 600;
    color: #0D2B45;
    margin: 0 0 0.15rem;
}

.econ-project-type {
    font-family: 'Inter', sans-serif;
    font-size: 0.68rem;
    color: #9A9A9A;
    margin: 0;
    letter-spacing: 0.01em;
}

.econ-project-desc {
    font-family: 'Inter', sans-serif;
    font-size: 0.82rem;
    color: #4A4A4A;
    line-height: 1.68;
    flex: 1;
    margin: 0;
}

.econ-project-links {
    display: flex;
    gap: 0.75rem;
    padding-top: 0.75rem;
    border-top: 1px solid #F0EBE3;
    margin-top: auto;
}

.econ-project-links a {
    font-family: 'Inter', sans-serif;
    font-size: 0.75rem;
    font-weight: 500;
    color: #7A7A7A;
    text-decoration: none;
    border-bottom: 1px solid transparent;
    transition: color 0.12s, border-color 0.12s;
}

.econ-project-links a:hover {
    color: #0D2B45;
    border-bottom-color: #0D2B45;
}

.econ-project-links .econ-link-primary {
    color: #0D2B45;
    font-weight: 600;
    border-bottom: 1px solid #C8D8E8;
}

.econ-project-links .econ-link-primary:hover {
    border-bottom-color: #0D2B45;
}

/* ── Contact ── */
.econ-contact-wrap { max-width: 580px; }

.econ-contact-intro {
    font-family: 'Inter', sans-serif;
    font-size: 0.9rem;
    color: #4A4A4A;
    line-height: 1.78;
    margin-bottom: 2rem;
}

.econ-contact-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(175px, 1fr));
    gap: 1rem;
}

.econ-contact-card {
    display: flex;
    flex-direction: column;
    gap: 0.3rem;
    background-color: #FFFFFF;
    border: 1px solid #E4DDD4;
    padding: 1.1rem 1.2rem;
    text-decoration: none;
    transition: border-color 0.15s, box-shadow 0.15s;
}

.econ-contact-card:hover {
    border-color: #0D2B45;
    box-shadow: 0 2px 10px rgba(13, 43, 69, 0.07);
}

.econ-contact-label {
    font-family: 'Inter', sans-serif;
    font-size: 0.65rem;
    font-weight: 600;
    color: #ABABAB;
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

.econ-contact-value {
    font-family: 'Inter', sans-serif;
    font-size: 0.8rem;
    color: #0D2B45;
    font-weight: 500;
}

/* ── Footer ── */
#econ-footer {
    background-color: #FFFFFF;
    border-top: 1px solid #E4DDD4;
    padding: 1rem 2.5rem;
    text-align: center;
}

#econ-footer p {
    font-family: 'Inter', sans-serif;
    font-size: 0.73rem;
    color: #ABABAB;
    margin: 0;
}

/* CS-only / Econ-only (keep for compatibility) */
body.theme-econ .cs-only { display: none !important; }
.econ-only { display: none; }
body.theme-econ .econ-only { display: block; }

/* Active theme button */
button.theme-active {
    outline: 2px solid #0D2B45;
    outline-offset: 2px;
}

/* ── Mode selection popup ── */
#mode-select-window {
    width: 380px;
    z-index: 500;
    left: 50%;
    top: 50%;
}

/* ── Responsive ── */
@media (max-width: 768px) {
    #econ-header {
        padding: 0.85rem 1rem;
        flex-wrap: wrap;
        gap: 0.6rem;
    }

    #econ-nav {
        order: 3;
        width: 100%;
        overflow-x: auto;
        padding-bottom: 2px;
    }

    .econ-nav-btn { font-size: 0.78rem; padding: 0.35rem 0.65rem; }

    #econ-retro-btn { font-size: 0.7rem; padding: 0.32rem 0.65rem; }

    #econ-main { padding: 2rem 1rem 3rem; }

    .econ-about-grid {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }

    #econ-avatar-img { width: 130px; }

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

    .econ-contact-grid { grid-template-columns: 1fr; }

    /* Econ experience card: wrap date below org on mobile */
    .econ-exp-meta {
        flex-wrap: wrap;
    }

    .econ-exp-date {
        width: 100%;
        margin-top: 0.2rem;
        color: #ABABAB;
    }

    .econ-section-title { font-size: 1.25rem; }
}

/* ── Mode popup mobile fix ── */
@media (max-width: 768px) {
    #mode-select-window {
        width: 88vw !important;
        left: 50% !important;
        top: 45% !important;
    }
}

/* ── CS mode: better tap targets & readability ── */
@media (max-width: 768px) {
    /* Bigger, easier-to-tap buttons */
    .button-group button,
    .project-link-btn {
        min-height: 44px;
        font-size: 0.62rem;
        padding: 0.75rem 1rem;
    }

    /* Window control buttons: bigger tap area */
    .close-btn,
    .maximize-btn,
    .minimize-btn {
        min-width: 36px;
        min-height: 36px;
        padding: 0.5rem 0.7rem;
        font-size: 0.65rem;
    }

    /* Welcome window h1 less overwhelming */
    #welcome-window .window-body h1 {
        font-size: 1.1rem;
        line-height: 1.4;
    }

    /* Project explorer icons: slightly larger tap area */
    .project-icon {
        width: 90px;
        margin-bottom: 24px;
    }

    .project-icon img {
        width: 68px;
        height: 68px;
    }

    /* Experience photo images: don't overflow */
    .exp-photo-img {
        max-height: 200px;
    }

    /* Project detail windows: full height on mobile */
    .project-details-window,
    .experience-details-window {
        height: auto !important;
        min-height: 60vh;
    }
}

/* ── Sub-375px (small phones) ── */
@media (max-width: 375px) {
    #welcome-window .window-body h1 {
        font-size: 0.95rem;
    }

    .window-body h2 {
        font-size: 0.85rem;
    }

    .button-group button {
        font-size: 0.55rem;
        padding: 0.7rem 0.75rem;
    }

    .window-body {
        font-size: 0.95rem;
    }

    /* Econ mode on very small screens */
    #econ-name-heading { font-size: 1rem; }
    .econ-nav-btn { font-size: 0.72rem; padding: 0.3rem 0.5rem; }
    .econ-section-title { font-size: 1.1rem; }
    .econ-bio-text { font-size: 0.85rem; }
    .econ-exp-info h3 { font-size: 0.88rem; }
    .econ-btn-primary, .econ-btn-secondary { font-size: 0.76rem; padding: 0.5rem 1rem; }
}
