:root {
    --primary-color: #ffffff;
    --secondary-color: #2b2b2b;
    --background-color: black;
    --font-family: 'Courier New', Courier, monospace;
    --font-size-large: clamp(1.2rem, 3vw, 1.5rem);
    --font-size-medium: clamp(1rem, 2.5vw, 1.3rem);
    --font-size-small: clamp(0.75rem, 2vw, 0.875rem);
    --transition-duration: 0.3s;
}

body,
html {
    margin: 0;
    padding: 0;
    width: 100%;
    min-height: 100vh;
    scroll-behavior: smooth;
    font-family: var(--font-family);
    color: var(--primary-color);
    overflow-x: hidden; /* Prevent horizontal scroll */
}

* {
    box-sizing: border-box;
    color: #ffffff;
    font-family: var(--font-family); /* Use root font-family */
}

#particles-js {
    position: fixed;
    width: 100%;
    height: 100%;
    top: 0;
    left: 0;
    z-index: -1;
    background-color: var(--background-color);
}

/* NAVBAR START */
nav {
    width: 100%;
    padding: clamp(0.5rem, 2vw, 0.625rem);
    background-color: rgba(0, 0, 0, 0.5);
    text-align: right;
    font-size: var(--font-size-medium);
}

nav ul {
    margin: 0;
    padding: 0;
    list-style-type: none;
    display: flex;
    justify-content: flex-end;
    flex-wrap: wrap; /* Allow wrapping for small screens */
}

nav li {
    margin: clamp(0.5rem, 2vw, 0.9375rem);
}

nav li a {
    color: var(--primary-color);
    text-decoration: none;
    padding: clamp(0.4rem, 1.5vw, 0.625rem);
    display: block;
    position: relative;
}

nav li a::after {
    content: '';
    position: absolute;
    width: 0;
    height: 0.125rem;
    display: block;
    margin-top: 0.3125rem;
    right: 0;
    background: var(--primary-color);
    transition: width var(--transition-duration) ease;
}

nav li a:hover::after {
    width: 100%;
    left: 0;
    background: var(--primary-color);
}

/* NAVBAR END */

/* CONTENT START */
.index-content {
    margin-top: clamp(8rem, 20vw, 14rem);
    z-index: 1;
}

.mytext {
    margin: clamp(2rem, 10vw, 10rem);
}

.socials {
    display: flex;
    flex-wrap: wrap; /* Allow wrapping for small screens */
    gap: 0.5rem;
    position: relative;
}

.socials img {
    width: clamp(2rem, 8vw, 3rem);
}

.github-container,
.linkedin-container,
.thm-container,
.gitlab-container {
    margin-right: 0.5rem;
}

.github-container img,
.linkedin-container img,
.thm-container img,
.gitlab-container img {
    border-radius: 5px;
}

/* BANNER START */
.banner {
    display: flex;
    flex-direction: column; /* Mobile-first */
    align-items: center;
    text-align: center;
    justify-content: center;
    color: var(--primary-color);
    margin: clamp(2rem, 10vw, 6.25rem) clamp(1rem, 5vw, 6.25rem) clamp(6rem, 20vw, 22rem);
}

.code-window {
    width: 100%; /* Full width on mobile */
    max-width: 35rem; /* Cap width on larger screens */
    height: auto;
    min-height: 15rem;
    background-color: var(--secondary-color);
    color: #cfcfcf;
    padding: clamp(0.8rem, 3vw, 1.25rem);
    border-radius: 0.5rem;
    box-shadow: 0 0.25rem 0.5rem rgba(0, 0, 0, 0.1);
}

.code-animation {
    margin: 0;
    white-space: pre-wrap;
    font-family: var(--font-family);
    font-size: var(--font-size-small);
    overflow: hidden;
    max-height: 25rem;
    overflow-y: auto;
}

/* BANNER END */

/* ABOUT START */
.about {
    font-size: var(--font-size-medium);
    margin: clamp(2rem, 10vw, 10.25rem);
}

.about-container {
    margin: clamp(2vh, 5vw, 10vh);
    display: flex;
    flex-direction: column; /* Mobile-first */
    justify-content: center;
    align-items: center;
    gap: 2rem;
}

.resume,
.profile {
    flex: 1;
    margin: 0;
}

/* ABOUT END */

/* SKILLS START */
.skills {
    padding: clamp(1rem, 5vw, 20px);
}

.item {
    margin-bottom: clamp(1rem, 3vw, 20px);
}

.progress-bar {
    background-color: var(--secondary-color);
    height: 100%;
    width: 0;
    transition: width var(--transition-duration) ease;
}

.skills .item-text .w-75 {
    width: 75%;
}

/* SKILLS END */

.end {
    width: 100%;
    font-size: clamp(1rem, 3vw, 1.5625rem);
    padding: 0;
    min-height: 18.75rem;
    margin: clamp(2rem, 10vw, 18.75rem) clamp(1rem, 5vw, 5rem);
    text-align: center;
    color: var(--primary-color);
}

/* CONTENT END */

.modal {
    z-index: 1050;
}

.modal-header,
.modal-header .modal-body,
.modal-content p,
.modal-content ul li {
    color: #000;
}

.modal-backdrop {
    z-index: 1040;
}

/* PROJECTS_PAGE.HTML STYLES */
.p-content {
    text-align: center;
    margin-bottom: clamp(2rem, 10vw, 10rem);
}

.hero {
    margin: clamp(2rem, 10vw, 100px);
    text-align: center;
}

.image-container {
    position: relative;
    display: inline-block;
    width: 100%;
    max-width: 600px;
    height: auto;
}

.image {
    width: 100%;
    height: auto;
    object-fit: cover;
    transition: filter var(--transition-duration) ease;
}

.image-container:hover .image {
    filter: blur(10px);
}

.overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    color: var(--primary-color);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity var(--transition-duration) ease;
    text-align: center;
}

.image-container:hover .overlay {
    opacity: 1;
}

.content {
    padding: clamp(1rem, 3vw, 20px);
}

.details {
    margin-bottom: clamp(1rem, 3vw, 20px);
}

.references a img {
    width: clamp(3rem, 10vw, 5rem);
    height: auto;
}

/* footer */
.footer {
    background-color: var(--secondary-color);
    color: var(--primary-color);
    text-align: center;
    height: auto;
    min-height: 10rem;
    padding: clamp(1rem, 5vw, 2rem);
    margin-top: clamp(5rem, 20vw, 20rem);
}

.footer-text {
    margin-top: clamp(1rem, 5vw, 3rem);
}

/* MEDIA QUERIES */
@media (min-width: 768px) {
    .banner {
        flex-direction: row;
        justify-content: space-between;
        text-align: left;
    }

    .code-window {
        width: 35%;
    }

    .about-container {
        flex-direction: row;
        justify-content: space-between;
        align-items: flex-start;
    }

    .resume {
        margin-top: 10vh;
        margin-left: 8vw;
    }
}

@media (max-width: 992px) {
    nav ul {
        justify-content: center;
    }

    nav li {
        margin: 0.625rem;
    }

    .banner,
    .skills,
    .projects,
    .about {
        margin: clamp(1.5rem, 5vw, 3.125rem) clamp(0.5rem, 2vw, 1.25rem);
    }

    .end {
        margin: clamp(1.5rem, 5vw, 3.125rem) auto;
    }
}

@media (max-width: 768px) {
    nav {
        text-align: center;
        padding: clamp(0.5rem, 2vw, 0.625rem) 1.25rem;
    }

    nav ul {
        flex-direction: column;
        align-items: center;
    }

    .s-cards {
        flex-direction: column;
    }

    .code-window {
        min-height: 12rem;
    }
}

@media (max-width: 576px) {
    .mytext h1 {
        font-size: clamp(1.2rem, 5vw, 1.5rem);
    }

    .mytext h4 {
        font-size: clamp(0.9rem, 4vw, 1.125rem);
    }

    .about p,
    .end p {
        font-size: clamp(0.9rem, 4vw, 1.125rem);
    }

    .s-title {
        font-size: clamp(1.2rem, 5vw, 1.5rem);
    }

    .banner,
    .skills,
    .projects,
    .about,
    .end {
        margin: clamp(0.8rem, 3vw, 1.25rem) clamp(0.3rem, 1.5vw, 0.625rem);
    }
}

@media (max-width: 400px) {
    .banner,
    .skills,
    .projects,
    .about,
    .end {
        margin: clamp(0.8rem, 3vw, 1.25rem) clamp(0.2rem, 1vw, 0.3125rem);
    }

    .socials img {
        width: clamp(1.5rem, 6vw, 2rem);
    }
}