html {
    height: 100%;
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

*,
*::before,
*::after {
    box-sizing: inherit;
}

body {
    margin: 0;
    padding: 0;
    height: 100vh;
    overflow: hidden;
    font-family: Arial, sans-serif;
    background-color: rgb(26, 26, 26);
    color: gray;
    line-height: 1.6;
}

/* ======== Canvas Background ======== */
canvas#Canvas3D {
    display: block;
    width: 100%;
    height: 100%;
    position: fixed;
    top: 0;
    left: 0;
    z-index: 0;
}

/* ======== Main Button (Terminal Toggle) ======== */
#MainButton {
    height: 7.5vh;
    padding: 0 2vh;
    position: fixed;
    left: 50%;
    bottom: 2.5vh;
    transform: translateX(-50%);
    color: white;
    text-align: center;
    background-color: black;
    border: 1px solid rgb(100, 100, 100);
    border-radius: 3.75vh;
    transition: transform 0.25s ease, background-color 0.25s ease;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.3);
}

#MainButton:hover {
    background-color: rgb(30, 30, 30);
    transform: translateX(-50%) scale(1.05);
}

#ButtonText {
    font-size: 2vh;
    margin-right: 1vh;
    transition: font-size 0.15s ease;
    white-space: nowrap;
}

#ButtonArrow {
    font-size: 3.5vh;
    display: inline-block;
    transition: font-size 0.15s ease, transform 0.25s ease;
}

#MainButton:hover #ButtonText {
    font-size: 2.2vh;
}

#MainButton:hover #ButtonArrow {
    font-size: 3.8vh;
}

/* ======== Main Content Area (Modern View) - Desktop ======== */
#MainDiv {
    width: 100vw;
    height: 100vh;

    position: fixed;
    top: 0;
    left: 0;
    overflow: hidden;

    background-color: rgb(26, 26, 26);
    transition: transform 0.5s ease-in-out;
    transform: translateY(0%);
}

#MainDiv.hidden {
    transform: translateY(100%);
}

/* ======== Panels - Desktop Styles (Original Absolute Positioning) ======== */
#LeftPanel {
    width: calc(50vw - 20vh);
    height: 100%;
    left: 20vh;
    position: absolute;
    top: 0;
    margin-top: 10vh;
    pointer-events: auto;
    box-sizing: border-box;
    z-index: 102;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
}

#RightPanel {
    width: auto;
    height: 100%;
    position: absolute;
    left: 50vw;
    right: 0;
    top: 0;
    padding: 10vh 20vh 0 2vh;
    overflow-y: scroll;
    overflow-x: hidden;
    -ms-overflow-style: none;
    scrollbar-width: none;
    box-sizing: border-box;
    z-index: 101;
}

#RightPanel::-webkit-scrollbar {
    display: none;
}

/* ======== Mouse Glow Effect (User's Fix) ======== */
#MouseGlow {
    width: 30vmax;
    height: 30vmax;

    position: absolute;
    left: 50%;
    top: 50%;
    translate: -50% -50%;

    background-color: rgba(255, 167, 25, 0.25);
    border-radius: 50%;
}

#MouseGlowBlur {
    width: 100%;
    height: 100%;

    position: absolute;
    backdrop-filter: blur(12vmax);
}

/* ======== Typography ======== */
h1 {
    font-size: 7.0vh;
    margin: 0 0 1vh 0;
    color: white;
    font-weight: bold;
    pointer-events: auto;
}

h2 {
    font-size: 2.8vh;
    margin: 0 0 1.5vh 0;
    color: white;
    font-weight: normal;
    pointer-events: auto;
}

p {
    font-size: 2.0vh;
    margin: 0 0 1vh 0;
    color: rgb(160, 160, 160);
    line-height: 1.7;
    pointer-events: auto;
}

m {
    font-weight: bold;
    color: rgb(200, 200, 200);
}

.link {
    color: inherit;
}

/* ======== Navigation (Scrollspy) ======== */
.NavContainer {
    position: absolute;
    top: 50%;
    transform: translateY(-65%);
    pointer-events: auto;
}

.NavItem {
    display: flex;
    align-items: center;
    margin: 20px 0;
    cursor: pointer;
    pointer-events: auto;
}

.NavItemDot {
    width: 1.1vh;
    height: 1.1vh;
    border-radius: 50%;
    background-color: gray;
    transition: all 0.3s ease;
    margin-right: 1.1vh;
}

.NavItemText {
    font-size: 2.0vh;
    color: gray;
    transition: color 0.3s ease, font-weight 0.3s ease;
}

.NavItem.Active .NavItemDot {
    background-color: white;
    transform: scale(1.5);
}

.NavItem.Active .NavItemText {
    color: white;
    font-weight: bold;
}

/* ======== Sections in Right Panel ======== */
.Section {
    margin-bottom: 10vh;
}

/* ======== Social Icons ======== */
#SocialsContainer {
    position: absolute;
    top: 90vh;
    transform: translateY(-170%);
    display: flex;
    justify-content: flex-start;
    gap: 2.5vh;
    pointer-events: auto;
}

#SocialsContainer a {
    display: inline-block;
    transform: scale(1);
    filter: invert(100%) brightness(50%);
    transition: all 0.1s ease;
}

#SocialsContainer a:hover {
    transform: scale(1.1);
    filter: invert(100%) brightness(100%);
}

#SocialsContainer img {
    width: 3vh;
    height: 3vh;
    max-width: 30px;
    max-height: 30px;
}

/* ======== Project List Styling ======== */
.Project {
    margin-bottom: 0.5vh;
    padding: 0.75vh;
    border-radius: 0.75vh;
    display: flex;
    justify-content: space-between;
    align-items: center;
    text-decoration: none;
    transition: background-color 0.2s ease;
}

.Project:hover {
    background-color: rgba(255, 255, 255, 0.05);
}

.Project p {
    user-select: none;
    font-size: 1.8vh;
    color: gray;
    margin-bottom: 0;
}

.Project p[data-value*=" "][style*="color: white"] {
    color: white !important;
    font-weight: bold;
    white-space: pre;
    margin-right: 1em;
}

.Separator {
    flex-grow: 1;
    border-bottom: 1px solid gray;
    margin: 0 0.75vh;
    align-self: center;
    height: 1px;
}

.Experience {
    color: inherit;
    text-decoration: none;
}

/* ======== Responsive Adjustments START ======== */

/* === Medium Screens (e.g., Smaller Desktops, Larger Tablets landscape ~1200px) === */
@media (max-width: 1200px) {
    #LeftPanel {
        width: calc(50vw - 15vh);
        left: 15vh;
        padding-right: 3vw;
    }

    #RightPanel {
        left: calc(35vw + 3vw);
        width: calc(100vw - (35vw + 3vw) - 10vw);
        padding: 10vh 10vw 0 3vw;
    }

    h1 {
        font-size: 6.5vh;
    }

    h2 {
        font-size: 2.6vh;
    }

    p {
        font-size: 1.9vh;
        line-height: 2.9vh;
    }

    .NavItemText {
        font-size: 1.9vh;
    }
}


/* ======== Tablet & Mobile Devices (Stacking layout, e.g., <= 992px) ======== */
@media (max-width: 992px) {
    body {
        overflow-y: auto;
        height: auto;
    }

    #MainButton {
        display: none;
    }

    #MainDiv {
        position: static;
        height: auto;
        display: flex;
        flex-direction: column;
        overflow-y: visible;
    }

    #LeftPanel,
    #RightPanel {
        position: static;
        width: 100%;
        height: auto;
        left: auto;
        right: auto;
        top: auto;
        margin-top: 0;
        padding: 5vh 5vw;
        overflow-y: visible;
        pointer-events: auto;
    }

    #LeftPanel {
        order: 1;
        text-align: center;
        padding-bottom: 3vh;
        display: flex;
        flex-direction: column;
        align-items: center;
    }

    #RightPanel {
        order: 2;
        padding-top: 3vh;
        padding-bottom: 5vh;
    }

    h1 {
        font-size: clamp(4.5vh, 8vw, 6vh);
        margin-bottom: 2vh;
    }

    h2 {
        font-size: clamp(2.4vh, 5vw, 2.8vh);
    }

    p {
        font-size: clamp(1.8vh, 3.5vw, 2vh);
        line-height: 1.65;
        margin-bottom: 1.5vh;
    }

    .NavContainer {
        display: none;
    }

    #SocialsContainer {
        position: static;
        transform: none;
        margin-top: 4vh;
        padding-bottom: 3vh;
        justify-content: center;
        width: 100%;
    }

    .Project {
        flex-direction: column;
        align-items: center;
        text-align: center;
        padding: 1.5vh 1vh;
    }

    .Project .Separator {
        width: 80%;
        margin: 1vh auto;
    }

    .Project p {
        width: 100%;
        margin-bottom: 0.5vh;
    }

    #RightPanel>p[style*="padding-bottom: 95.0vh"] {
        padding-bottom: 5vh !important;
        font-size: 1.5vh !important;
    }

    @media (hover: hover) and (pointer: fine) {

        #MouseGlow,
        #MouseGlowBlur {
            display: block;
        }
    }

    @media (hover: none) and (pointer: coarse) {

        #MouseGlow,
        #MouseGlowBlur {
            display: none;
        }
    }
}

/* ======== Mobile Devices (Screens <= 480px) ======== */
@media (max-width: 480px) {

    #LeftPanel,
    #RightPanel {
        padding: 4vh 4vw;
    }

    h1 {
        font-size: clamp(4vh, 9vw, 5vh);
    }

    h2 {
        font-size: clamp(2.2vh, 5.5vw, 2.4vh);
    }

    p {
        font-size: clamp(1.7vh, 4vw, 1.9vh);
        line-height: 1.6;
    }

    .NavItemText {
        font-size: clamp(1.7vh, 3.5vw, 1.9vh);
    }

    .NavItemDot {
        width: 0.9vh;
        height: 0.9vh;
    }


    .Section {
        margin-bottom: 5vh;
    }

    #SocialsContainer img {
        width: 2vh;
        height: 2vh;
        max-width: 40px;
        max-height: 40px;
    }

    #RightPanel>p[style*="padding-bottom: 95.0vh"] {
        padding-bottom: 5vh !important;
        font-size: 1.4vh !important;
    }
}