@import url('https://fonts.googleapis.com/css2?family=Roboto:wght@100;300;400&display=swap');

:root {
    --primary-color: rgb(126, 167, 255);
    --text-shadow: 
        1px 1px 0 rgba(0, 0, 0, 0.5),
        -1px -1px 0 rgba(0, 0, 0, 0.5),
        1px -1px 0 rgba(0, 0, 0, 0.5),
        -1px 1px 0 rgba(0, 0, 0, 0.5);
    --container-padding: 2rem;
}

body {
    margin: 0;
    min-height: 100vh;
    position: relative;
    font-family: 'Roboto', sans-serif;
    background-color: hsla(210, 20%, 15%, 1);
    background-image:
        radial-gradient(at 81% 65%, hsla(220, 20%, 20%, 1) 0px, transparent 50%),
        radial-gradient(at 95% 99%, rgb(31, 46, 43) 0px, transparent 50%),
        radial-gradient(at 48% 26%, hsla(260, 15%, 20%, 1) 0px, transparent 50%),
        radial-gradient(at 75% 26%, hsla(190, 20%, 18%, 1) 0px, transparent 50%);
    background-size: 500% 500%;
    animation: fadeInAnimation 2s ease 1 forwards, gradient 15s ease infinite;
    
    display: flex;
    flex-direction: column;
}

h1 {
    color: var(--primary-color);
    font-size: clamp(2.5rem, 5vw, 5rem);
    text-align: center;
    margin: 0 1%;
    font-weight: 300;
    text-shadow: var(--text-shadow);
}

h2 {
    color: var(--primary-color);
    font-size: clamp(1.2rem, 3vw, 1.5rem);
    text-align: center;
    margin: 0 1%;
    font-weight: 400;
    text-shadow: var(--text-shadow);
}

h3 {
    color: #f5f5f5;
    font-size: clamp(1rem, 2.5vw, 1.25rem);
    text-align: center;
    margin: 0 1%;
    font-weight: 400;
    text-shadow: var(--text-shadow);
}

h3 a{
    color: whitesmoke;
}

.navbar {
    width: 90%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 1rem var(--container-padding);
    display: flex;
    justify-content: flex-end;
    font-size: clamp(1rem, 2.5vw, 1.3rem);
}

.navbar a {
    color: var(--primary-color);
    padding: 0.5rem 1rem;
    text-decoration: none;
    text-shadow: var(--text-shadow);
}

.navbar a:hover {
    background-color: rgba(0, 0, 0, 0.25);
}

.landing {
    display: grid;
    grid-template-columns: repeat(2, auto);
    align-items: center;
    justify-content: center;
    width: 90%;
    max-width: 1200px;
    gap: 10%;
    margin: auto; /* Changed from 0 auto to auto for vertical centering */
    padding: var(--container-padding);
}

.section {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.landing-about {
    display: grid;
    grid-template-columns: 50% 50%; /* Split space evenly between two columns */
    align-items: center;
    justify-content: center;
    position: relative;

    width: 80%;
    gap: 0; /* Remove or reduce the gap to minimize space in the middle */
    margin: 0 auto;
}

img {
    border-radius: 2vh;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
    max-width: 100%;
    height: auto;
    max-height: 50vh;
    object-fit: cover;
    display: block;
    margin: 0 auto;
}

.imgIcon {
    border-radius: 0;
    box-shadow: none;
    width: 40px;
    height: 40px;
    margin: 0 auto;
    display: block;
}

.projectList {
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2rem;
    padding: var(--container-padding) 0;
    height: auto;
    max-height: 60vh; /* Reduced from 60vh */
    overflow-y: auto;
    width: 100%;
}

.projectTitle {
    color: white;
    font-size: clamp(1.5rem, 4vw, 3rem);
    text-align: center;
    font-weight: 300;
    text-shadow: var(--text-shadow);
    text-decoration: none;
    transition: color 0.3s ease;
}

.projectTitle:hover {
    color: var(--primary-color);
}

.previewVideos video{
    max-height: 50vh;
    margin: 0 auto;
}

.previewVideos img {
    max-width: 40vh;
    object-fit: cover;
    margin: 0 auto;
}

/* Mobile Responsiveness */
@media (max-width: 768px) {
    :root {
        --container-padding: 1rem;
    }

    .landing {
        grid-template-columns: 1fr;
        gap: 2rem;
        padding-top: 3rem; 
    }

    .landing-about {
        grid-template-columns: 1fr;
        gap: 1rem;
    }

    .navbar {
        justify-content: center;
        flex-wrap: wrap;
        padding: 0.5rem var(--container-padding);
    }

    .projectList {
        max-height: none;
        height: auto;
        padding: var(--container-padding);
    }

    .previewVideos img, .previewVideos video {
        max-height: 40vh;
    }

    #projects.landing {
        margin: 1rem auto;
        gap: 3rem;
    }

    .projectList {
        max-height: 30vh; /* Smaller on mobile */
        padding: 0.5rem;
    }

    .previewVideos {
        grid-template-columns: 1fr; /* Single column on mobile */
        gap: 1rem;
    }

}

/* Animations */
@keyframes fadeInAnimation {
    0% { opacity: 0; }
    100% { opacity: 1; }
}

@keyframes gradient {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

/* Scrollbar */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background-color: rgba(0, 0, 0, 0.25);
    border-radius: 100vw;
    margin-block: .5rem;
}

::-webkit-scrollbar-thumb {
    background: whitesmoke;
    border-radius: 100vw;
}