/* --- GLOBAL & BODY --- */
* {
    box-sizing: border-box;
}

body {
    background-color: #000;
    color: #00FF00;
    font-family: 'VT323', monospace;
    font-size: 18px;
    overflow: hidden;
    margin: 0;
    padding: 0;
    cursor: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24' 24'%3E%3Cpath fill='%2300FF00' d='M0,0 l20,16 V0 H0z'/%3E%3C/svg%3E") 0 0, auto;
}

/* --- INTERACTIVE ELEMENTS --- */
a, button, .button-control, .nav-button, .desktop-shortcut-item, .taskbar-tab {
    cursor: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24' 24'%3E%3Cpath fill='%2300FF00' d='M5,0 L5,13 L9,13 L9,12 L10,12 L10,11 L11,11 L11,10 L12,10 L12,9 L13,9 L13,8 L14,8 L14,7 L15,7 L15,6 L16,6 L16,5 L17,5 L17,9 L18,9 L18,5 L19,5 L19,9 L20,9 L20,5 L21,5 L21,9 L22,9 L22,0 L5,0 z'/%3E%3C/svg%3E") 6 0, pointer;
}

@keyframes link-glitch {
  0% { transform: translate(0, 0); text-shadow: 0 0 3px #00FF00; }
  25% { transform: translate(2px, -2px); text-shadow: 2px 0 3px #ff00ff; }
  50% { translate(-2px, 2px); text-shadow: -2px 0 3px #00BFFF; }
  75% { transform: translate(2px, 2px); text-shadow: 0 0 3px #00FF00; }
  100% { transform: translate(0, 0); text-shadow: 0 0 3px #00FF00; }
}

a:hover, .nav-button:hover {
    animation: link-glitch 0.2s infinite;
}

/* --- DESKTOP & TASKBAR ELEMENTS --- */
#desktop-icons {
    position: absolute;
    top: 50px;
    left: 30px;
    display: flex;
    flex-direction: column;
    gap: 20px;
    z-index: 1;
}
.desktop-shortcut-item {
    width: 90px;
    text-align: center;
    color: #fff;
    text-shadow: 1px 1px 2px #000;
}
.desktop-shortcut-item span {
    display: block;
    margin-top: 5px;
}

#taskbar {
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 35px;
    background-color: #c0c0c0;
    border-top: 2px solid #dfdfdf;
    z-index: 9999;
    display: flex;
    align-items: center;
    padding: 0 5px;
    gap: 5px;
}

.taskbar-tab {
    height: 28px;
    max-width: 250px;
    flex-shrink: 1;
    flex-grow: 0;
    padding: 0 10px;
    background-color: #c0c0c0;
    border: 2px solid;
    border-color: #dfdfdf #000 #000 #dfdfdf;
    box-shadow: inset 1px 1px #fff;
    display: flex;
    align-items: center;
    color: #000;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    transition: background-color 0.2s, opacity 0.2s;
}

.taskbar-tab.active {
    background-color: #a0a0a0;
    border-color: #000 #dfdfdf #dfdfdf #000;
}

.taskbar-tab.minimized {
    font-weight: bold;
}

.taskbar-tab.dragging {
    opacity: 0.5;
}


.hidden {
    display: none !important;
}

/* --- GENERAL SETUP --- */
#matrix-canvas {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
}

/* --- WINDOW CONTAINER & TITLE BAR --- */
.window-container {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 80vw;
    max-width: 900px;
    height: 90vh;
    border: 2px solid;
    border-color: #dfdfdf #000 #000 #dfdfdf;
    background-color: #c0c0c0;
    box-shadow: 2px 2px 0px #000, inset 1px 1px #fff;
    display: flex;
    flex-direction: column;
    z-index: 10;
    transition: all 0.2s ease-in-out;
}
.window-container.is-dragging {
    transition: none;
}
.window-container.minimized {
    transform: translate(-50%, -50%) scale(0);
    opacity: 0;
    pointer-events: none;
}
.window-container.maximized {
    top: 0 !important;
    left: 0 !important;
    width: 100vw !important;
    height: 100vh !important;
    transform: none !important;
    max-width: none;
    max-height: none;
    border-radius: 0;
    border: none;
}

.title-bar {
    background: linear-gradient(to right, #000080, #1e90ff);
    padding: 4px 5px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    user-select: none;
    cursor: move;
}
.title-bar-text {
    color: #fff;
    font-weight: bold;
    letter-spacing: 1px;
}
.title-bar-controls {
    display: flex;
}
.button-control {
    width: 18px;
    height: 18px;
    background-color: #c0c0c0;
    border: 1px solid;
    border-color: #dfdfdf #000 #000 #dfdfdf;
    box-shadow: inset 1px 1px #fff;
    margin-left: 3px;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 12px;
    font-weight: bold;
    color: #000;
}
.button-control:active {
    border-color: #000 #dfdfdf #dfdfdf #000;
}

.title-bar-status-left, .title-bar-status-right {
    display: none;
}


/* --- WINDOW CONTENT & SCROLLBAR --- */
.window-content {
    flex-grow: 1;
    padding: 10px;
    border-top: 2px solid #000;
    background-color: #00001a;
    overflow-y: auto;
    overflow-x: hidden;
    display: flex;
    flex-direction: column;
    position: relative;
}
.window-content::-webkit-scrollbar { width: 16px; }
.window-content::-webkit-scrollbar-track { background: #c0c0c0; border-left: 2px solid #000; }
.window-content::-webkit-scrollbar-thumb { background: #c0c0c0; border: 2px solid; border-color: #dfdfdf #000 #000 #dfdfdf; box-shadow: inset 1px 1px #fff; }
.window-content::-webkit-scrollbar-thumb:hover { background: #a0a0a0; }

/* --- HEADER & NAVIGATION --- */
header {
    text-align: center;
    border-bottom: 2px solid #00FF00;
    margin-bottom: 15px;
    padding-bottom: 10px;
}
.ascii-art {
    color: #00FF00;
    text-shadow: 0 0 5px #00FF00;
    font-size: 0.8em;
    margin: 0 auto;
    line-height: 1.1;
    font-weight: bold;
    white-space: pre;
}
nav {
    margin-top: 10px;
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 10px;
}
.nav-button {
    background-color: transparent;
    border: 1px solid #00FF00;
    color: #00FF00;
    padding: 5px 15px;
    text-decoration: none;
    transition: all 0.2s ease;
    text-shadow: 0 0 3px #00FF00;
}
.nav-button:hover, .nav-button.active {
    background-color: #00FF00;
    color: #000;
    box-shadow: 0 0 10px #00FF00;
}

/* --- MAIN CONTENT & BOXES --- */
main { flex-grow: 1; }
.content-box, #project-view-container, #opm-project-view-container {
    border: 1px dashed #333;
    padding: 15px;
    margin-bottom: 15px;
    background-color: rgba(0, 255, 0, 0.03);
}
#project-view-container.hidden, #opm-project-view-container.hidden {
    display: none;
}

h2 {
    color: #ff00ff;
    text-shadow: 0 0 5px #ff00ff;
    border-bottom: 1px solid #ff00ff;
    padding-bottom: 5px;
    margin-top: 0;
}
h3 {
    color: #00BFFF;
    margin-top: 20px;
    margin-bottom: 5px;
}
p, li { line-height: 1.6; }
p.comment {
    color: #888;
    font-style: italic;
    font-size: 0.9em;
}
.decorative-gif {
    display: block;
    margin: 20px auto;
    width: 120px;
    height: 120px;
    background-color: #00001a;
    border: 2px solid #00BFFF;
    border-radius: 50%;
    object-fit: scale-down;
    filter: drop-shadow(0 0 10px #00BFFF);
}
ul { list-style-type: ':: '; padding-left: 20px; }
a { color: #00BFFF; text-decoration: none; transition: color 0.2s ease, text-shadow 0.2s ease; }

/* --- PROJECT VIEW STYLES --- */
.back-button {
    display: inline-block;
    border: 1px solid #00FF00;
    color: #00FF00;
    padding: 5px 15px;
    margin-bottom: 20px;
    text-shadow: 0 0 3px #00FF00;
}
.back-button:hover {
    background-color: #00FF00;
    color: #000;
    animation: none;
}
.project-image {
    display: block;
    max-width: 50%;
    margin: 20px auto;
    border: 2px solid #00BFFF;
    box-shadow: 0 0 15px #00BFFF;
}


/* --- Certifications --- */
.cert-grid {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 25px;
    margin-top: 20px;
}
.cert-item-container {
    position: relative;
    width: 90%;
    max-width: 450px;
    background-color: rgba(0,0,0,0.3);
    border: 1px solid #00BFFF;
}
.cert-item-container::before {
    content: '';
    display: block;
    padding-bottom: 60%; 
}
.cert-item-container iframe,
.cert-item-container a {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border: 0;
}
.cert-item-container a {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 10px;
}
.cert-item-container img {
    max-width: 100%;
    max-height: 100%;
    width: auto;
    height: auto;
}

/* --- FOOTER & STATUS BAR --- */
footer { border-top: 2px solid; border-color: #000 #dfdfdf; margin-top: auto; }
.status-bar { display: flex; flex-wrap: wrap; justify-content: space-between; padding: 3px 5px; font-size: 14px; }
.status-field { border: 1px inset #888; padding: 0 10px; }
.status-field.right { display: flex; align-items: center; }
.status-field img { vertical-align: middle; }

#visitor-counter-wrapper {
    display: inline-block;
    transform: scale(0.8);
    transform-origin: left center;
    vertical-align: middle;
    margin-left: 4px;
}


/* --- ANIMATIONS & EFFECTS --- */
.glitch { position: relative; color: #ff00ff; }
.glitch::before, .glitch::after { content: attr(data-text); position: absolute; top: 0; left: 0; width: 100%; height: 100%; background: #00001a; overflow: hidden; }
.glitch::before { left: 2px; text-shadow: -2px 0 #00BFFF; animation: glitch-anim-1 2s infinite linear alternate-reverse; }
.glitch::after { left: -2px; text-shadow: -2px 0 #00FF00, 2px 2px #ff00ff; animation: glitch-anim-2 2s infinite linear alternate-reverse; }
@keyframes glitch-anim-1 { 0%, 100% { clip-path: inset(30% 0 60% 0); } 25% { clip-path: inset(10% 0 85% 0); } 50% { clip-path: inset(70% 0 5% 0); } 75% { clip-path: inset(40% 0 40% 0); } }
@keyframes glitch-anim-2 { 0%, 100% { clip-path: inset(80% 0 10% 0); } 25% { clip-path: inset(2% 0 50% 0); } 50% { clip-path: inset(33% 0 33% 0); } 75% { clip-path: inset(90% 0 5% 0); } }


/******************************************/
/* --- OLD PERSON MODE STYLES           --- */
/******************************************/

.old-person-mode {
    background-color: #D3D3D3;
    color: #000;
    font-family: "Times New Roman", Times, serif;
    font-size: 20px;
    cursor: default;
}
.old-person-mode .window-content {
    background-color: #D3D3D3;
    color: #000;
    overflow-y: scroll;
}
.old-person-mode .window-content::-webkit-scrollbar { all: unset; }
.old-person-mode .window-content::-webkit-scrollbar-track { all: unset; }
.old-person-mode .window-content::-webkit-scrollbar-thumb { all: unset; }

.old-person-mode header {
    border-bottom: 2px solid #000;
    text-align: center;
}
.old-person-mode h1 {
    font-size: 2.5em;
    color: #000;
    text-shadow: none;
    border-bottom: none;
    margin: 0;
}
.old-person-mode nav {
    margin-top: 15px;
    gap: 20px;
}
.old-person-mode .nav-button {
    background: none;
    border: none;
    color: blue;
    padding: 0;
    text-decoration: underline;
    text-shadow: none;
    font-size: 1.1em;
}
.old-person-mode .nav-button:hover,
.old-person-mode .nav-button.active {
    background: none;
    color: #551A8B;
    box-shadow: none;
    animation: none;
}
.old-person-mode .content-box, .old-person-mode #opm-project-view-container {
    border: none;
    padding: 10px 0;
    margin-bottom: 15px;
    background: none;
    border-top: 1px solid #888;
}
.old-person-mode .content-box:first-child { border-top: none; }
.old-person-mode h2 {
    font-size: 1.8em;
    color: #000;
    text-shadow: none;
    border-bottom: 1px solid #000;
    padding-bottom: 5px;
    margin-top: 0;
    font-weight: bold;
}
.old-person-mode .glitch::before, .old-person-mode .glitch::after { display: none; }
.old-person-mode .glitch { color: inherit; }
.old-person-mode h3 { font-size: 1.4em; color: #000; font-weight: bold; }
.old-person-mode p, .old-person-mode li { line-height: 1.5; }
.old-person-mode .comment { color: #555; font-style: normal; }
.old-person-mode ul { list-style-type: disc; padding-left: 40px; }
.old-person-mode a, .old-person-mode a:visited { color: blue; text-decoration: underline; animation: none; cursor: pointer; }
.old-person-mode a:hover { color: #551A8B; }
.old-person-mode .decorative-gif { display: none; }
.old-person-mode .cert-grid { display: block; }
.old-person-mode .cert-item-container { all: unset; }
.old-person-mode footer { border-top: 2px solid #000; text-align: center; padding: 10px; margin-top: auto;}
.old-person-mode .status-bar { display: none; }
.old-person-mode .back-button {
    text-decoration: underline;
    color: blue;
    border: none;
    padding: 0;
    margin-bottom: 20px;
    text-shadow: none;
}
.old-person-mode .back-button:hover {
    color: #551A8B;
    background: none;
}


/******************************************/
/* --- MOBILE SMARTPHONE STYLES --- */
/******************************************/
@media only screen and (max-width: 800px) {
    
    #desktop-icons, #taskbar, #draggable-window > footer {
        display: none !important;
    }

    body { overflow: hidden; }

    .window-container {
        position: fixed !important; top: 0 !important; left: 0 !important;
        width: 100% !important; height: 100% !important;
        transform: none !important; max-width: none !important; max-height: none !important;
        border: 10px solid #1a1a1a; border-radius: 40px; background: transparent;
        box-shadow: none !important; padding: 0;
        overflow: hidden;
    }
    
    .title-bar {
        height: 25px; background: #000; padding: 0 15px; cursor: default;
        color: #fff; z-index: 20; flex-shrink: 0; display: flex;
        justify-content: space-between; align-items: center;
    }
    .title-bar-text, .title-bar-controls { display: none; }
    .title-bar-status-left, .title-bar-status-right {
        display: block; font-size: 16px; font-weight: normal; color: #fff;
    }

    .window-content {
        padding: 10px; padding-bottom: 60px; border: none; border-radius: 0;
        background-color: #00001a;
        height: 100%;
        position: relative;
    }

    #matrix-canvas {
        position: absolute;
        top: 0;
        left: 0;
        z-index: -1;
    }
    
    #home-screen-container .window-content {
        background: transparent;
        border: 1px solid rgba(0, 255, 0, 0.2);
        padding: 0;
    }
    
    header { border-bottom: none; margin-bottom: 0; padding-bottom: 5px; }
    header nav { display: none; }
    .ascii-art {
        font-size: 1.2vw; line-height: 1.1; text-shadow: 0 0 2px #00FF00;
        margin: -10px auto 0 auto; width: 100%; overflow: hidden;
    }
    .content-box, #project-view-container, #opm-project-view-container {
        padding: 10px; border-style: solid; border-color: #333; background: none;
    }

    body, a, button, .button-control, .nav-button, .desktop-shortcut-item { cursor: default; }
    a, #mobile-system-nav button, .mobile-app, .mobile-app-link { cursor: pointer; }
    
    .project-image {
        max-width: 90%;
    }
    .back-button {
        padding: 10px 15px;
    }
    
    #mobile-system-nav {
        display: flex !important;
        position: fixed;
        bottom: 0;
        left: 0;
        width: 100%;
        height: 60px;
        background: rgba(0,0,0,0.8);
        backdrop-filter: blur(5px);
        z-index: 1000;
        align-items: center;
        justify-content: space-around;
        border-top: 1px solid #333;
    }
    .sys-nav-btn {
        background: none;
        border: none;
        padding: 5px;
        opacity: 0.7;
        transition: opacity 0.2s ease;
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        color: #00FF00;
        flex-grow: 1;
        height: 100%;
    }
    .sys-nav-btn:active {
        opacity: 1;
        background: rgba(0, 255, 0, 0.2);
        border-radius: 15px;
    }
    .sys-nav-btn svg {
        fill: #00FF00;
        width: 24px;
        height: 24px;
    }

    .sys-nav-label {
        font-size: 12px;
        margin-bottom: 2px;
        display: block;
    }
    
    #home-screen-scroller {
        display: flex;
        overflow-x: auto;
        width: 100%;
        height: 100%;
        scroll-snap-type: x mandatory;
        -webkit-overflow-scrolling: touch;
    }
    #home-screen-scroller::-webkit-scrollbar { display: none; }
    #home-screen-scroller { scrollbar-width: none; }

    .home-screen-page {
        flex: 0 0 100%;
        width: 100%;
        height: 100%;
        scroll-snap-align: start;
        display: grid;
        grid-template-columns: repeat(3, 1fr);
        grid-template-rows: repeat(4, 1fr);
        place-items: center;
        padding: 20px 10px;
        gap: 10px;
    }

    .mobile-app {
        width: 90px;
        text-align: center;
        color: #fff;
        text-shadow: 1px 1px 2px #000;
    }
    .mobile-app span {
        display: block;
        margin-top: 5px;
        font-size: 16px;
    }

    .mobile-menu-overlay, #mobile-app-list-overlay {
        position: fixed; top: 0; left: 0; width: 100%; height: 100%;
        background: rgba(0,0,0,0.8); backdrop-filter: blur(5px); z-index: 1500;
        display: flex; align-items: center; justify-content: center;
    }
    .mobile-menu-content {
        display: flex; flex-direction: column; gap: 15px; width: 80%;
        max-width: 300px; padding: 20px; border: 1px solid #00FF00; background: #00001a;
    }
    .mobile-menu-content h3 {
        margin: 0 0 10px 0; text-align: center; border-bottom: 1px solid #00FF00; padding-bottom: 10px;
    }
    .mobile-menu-content .nav-button { width: 100%; text-align: center; }
    .mobile-app-link {
        color: #00FF00; border: 1px solid #00BFFF; padding: 10px; text-align: center;
        transition: all 0.2s ease;
    }
    .mobile-app-link:hover { background: #00BFFF; color: #000; }

    /* --- Old Person Mode Mobile Styles --- */
    .old-person-mode .title-bar { background: #ccc; border-bottom: 1px solid #888; }
    .old-person-mode .title-bar-status-left,
    .old-person-mode .title-bar-status-right { color: #000; }
    .old-person-mode .window-content {
        background: #fff; color: #000; padding-bottom: 60px;
        font-family: Arial, Helvetica, sans-serif; font-size: 18px;
    }
    .old-person-mode header { border-bottom: 1px solid #aaa; padding-bottom: 5px; }
    .old-person-mode h1 { font-size: 24px; }
    .old-person-mode header nav { display: none; }
    .old-person-mode .content-box, .old-person-mode #opm-project-view-container { 
        border-top: 1px solid #ddd; 
        padding: 15px 0;
    }
    .old-person-mode h2 { font-size: 22px; font-weight: bold; border-bottom: none; }
    .old-person-mode h3 { font-size: 20px; font-weight: bold; }
    .old-person-mode a { color: #0000EE; }
    .old-person-mode a:visited { color: #551A8B; }
    .old-person-mode .cert-grid a { display: block; padding: 10px 0; }
    
    #mobile-system-nav.opm-active .sys-nav-btn { color: #333; }
    #mobile-system-nav.opm-active .sys-nav-btn svg { fill: #333; }
    #mobile-system-nav.opm-active { background: rgba(230, 230, 230, 0.8); border-top: 1px solid #aaa; }

    /* MODIFIED: Selector updated from #opm- to #om- */
    #om-mobile-menu-overlay .mobile-menu-content {
        background-color: #fff;
        border-color: #000;
        font-family: Arial, Helvetica, sans-serif;
    }
    #om-mobile-menu-overlay .mobile-menu-content h3 {
        color: #000;
        border-bottom-color: #000;
    }
    #om-mobile-menu-overlay .nav-button {
        font-family: Arial, Helvetica, sans-serif;
        background: #fff;
        border: 1px solid #aaa;
        color: blue;
        text-decoration: none;
        text-shadow: none;
        animation: none;
    }
    #om-mobile-menu-overlay .nav-button.active,
    #om-mobile-menu-overlay .nav-button:hover {
        background: #eee;
        color: #551A8B;
    }
}