:root {
    --color-primary: rgb(140, 108, 255);
    --color-secondary: rgb(176, 16, 86);
    --color-text: #ece8d5;
}

body, main {
    height: 100vh;
    width: 100vw;
    margin: 0;
    overflow: hidden;
    background: black;
}

div::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}

div::-webkit-scrollbar-track {
    background: transparent;
}

div::-webkit-scrollbar-thumb {
    background: #3f3f3f;
    border-radius: 10px;
}

main {
    position: relative;
    transition: transform 0.5s cubic-bezier(.13, .53, .38, .97);
    z-index: 2;
}

h3 {
    font-family: 'Montserrat', 'Rubik', sans-serif;
    font-size: max(3.5vw, 20px);
    line-height: max(3.5vw, 20px);
    font-weight: 900;
    color: #ffffff;
    margin: 0;
    text-transform: uppercase;
}

@font-face {
    font-family: 'Montserrat', 'Rubik';
    font-display: swap;
}

main > article {
    position: relative;
    height: 100%;
    display: none;
}

main[data-page="home"] > #home {
    display: block;
}

.dg.ac {
    display: none;
}

canvas {
    width: 100%;
    height: 100%;
}

.line-drawing {
    position: absolute;
    width: 100%;
    height: 100%;
    top: 0;
    left: 0;
}

.line-drawing > svg {
    position: absolute;
    width: 80%;
    height: 80%;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
}

.lines {
    stroke: var(--nth-child);
    stroke-width: 30px;
    fill: none;
    fill-rule: evenodd;
}

.lines:nth-child(1) { --nth-child: rgb(108, 115, 225); }
.lines:nth-child(2) { --nth-child: rgb(130, 103, 212); }
.lines:nth-child(3) { --nth-child: rgb(147, 91, 196); }
.lines:nth-child(4) { --nth-child: rgb(160, 79, 179); }
.lines:nth-child(5) { --nth-child: rgb(160, 79, 179); }
.lines:nth-child(6) { --nth-child: rgb(169, 66, 162); }
.lines:nth-child(7) { --nth-child: rgb(175, 53, 143); }
.lines:nth-child(8) { --nth-child: rgb(178, 40, 124); }
.lines:nth-child(9) { --nth-child: rgb(178, 28, 105); }

main[data-page="work"] > #work {
    display: block;
}

.carousel {
    height: 100vh;
    width: 100vw;
    margin: 0 auto;
}

.carousel-cell {
    height: 100vh;
    width: 100vw;
    margin-right: 10px;
    background: transparent;
}

.carousel-cell:before {
    display: block;
    content: "";
}

.carousel-cell > div {
    position: relative;
    display: grid;
    justify-content: center;
    height: 80%;
    width: 80%;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    grid-template-columns: 2fr 1fr;
    grid-template-rows: 2fr 1fr;
    grid-gap: 20px;
}

.carousel-cell > div > div {
    min-width: 0;
    min-height: 0;
    border-radius: 20px;
}

@media only screen and (max-width: 1000px) {
    .carousel-cell > div {
        grid-template-columns: 2fr 2fr;
    }
}

@media only screen and (max-width: 600px) {
    .carousel-cell > div {
        grid-template-columns: none;
        grid-template-rows: 1fr 3fr 7fr;
        gap: 40px;
    }

    .carousel-cell > div > .project-header {
        grid-row: 1 ;
    }

    .carousel-cell > div > .project-image {
        grid-row: 2;
    }

    .carousel-cell > div > .project-description {
        grid-row: 3;
        margin-bottom: 80px;
    }

    .carousel-cell > div > .project-description > p {
        font-size: 1rem;
    }

    .carousel-cell > div > .project-code {
        display: none;
    }

    .carousel-cell > .website > .project-image > img {
        margin-left: auto;
    }
}

@media only screen and (max-width: 600px) and (max-height: 700px){
    .carousel-cell > div > .project-description {
        margin-bottom: 100px;
    }
}

.project-image {
    display: flex;
    overflow: hidden;
}

.nynjtc > .project-image {
    background: url("../images/forest.webp") center;
    background-size: cover;
}

.tp > .project-image {
    background: #21437F;
    background-size: cover;
}

.bots > .project-image {
    background: #0f276a;
    background-size: cover;
}

.bchacks > .project-image {
    background: white;
    background-size: cover;
}

.project-image > img {
    height: auto;
    object-fit: cover;
    margin: auto;
}


.nynjtc > .project-image > img {
    width: min(80%, 540px);
    filter: brightness(0);
}

.tp > .project-image > img {
    width: min(100%, 800px);
    scale: 1.3;
}

.website > .project-image > img {
    margin-left: 0;
    width: min(80%, 800px);
}

.modding > .project-image > img {
    width: min(100%, 800px);
    border-radius: 20px;
}

.bots > .project-image > img {
    width: min(100%, 1600px);
}

.bchacks > .project-image > img {
    width: min(70%, 1600px);

}

.project-description {
    display: flex;
    padding: 20px;
    overflow-y: auto;
    overflow-x: hidden;
    background: #0b0b0b;
}

.project-description > p {
    font-family: 'Rubik', sans-serif;
    font-size: 1.5rem;
    color: #727272;
}

.project-description > p > a {
    display: inline-block;
    position: relative;
    text-decoration: none;
    color: #a2a2a2;
}

@media (hover: hover) and (pointer: fine) {
    .project-description > p > a:after {
        content: '';
        position: absolute;
        width: 100%;
        transform: scaleX(0);
        height: 2px;
        bottom: 0;
        left: 0;
        background-color:#a2a2a2;
        transform-origin: top;
        transition: transform 0.25s ease-out;
    }

    .project-description > p > a:hover:after {
        transform: scaleX(1);
        transform-origin: top;
    }
}

.project-code {
    display: flex;
    justify-content: center;
}

.project-code > svg {
    stroke-width: 10px;
    fill-rule: evenodd;
    fill: none;
    stroke: #b0b0b0;
    width: 30%;
    height: 30%;
}
main[data-page="about"] > #about {
    display: block;
}

#about > .carousel-cell > div {
    grid-template-columns: 3fr 2fr;
    grid-template-rows: 1fr 3fr;
    transform: translate(-50%, -57%);
    height: 71%;
    width: 85%;
}

.about > .project-image {
    background: url("../images/me.webp") center;
    background-size: cover;
}

.about > .project-code {
    column-gap: 20px;
}

.about > .project-code > svg {
    width: 40%;
    height: 40%;
}

.about > .project-description {
    flex-direction: column;
}

.about > .project-header > h3 {
    font-size: max(4vw, 40px);
}

@media only screen and (max-width:600px) {
    #about > .carousel-cell > div {
        grid-template-columns: none;
        grid-template-rows: 1fr 1fr 5fr 5fr;
        gap: 40px;
    }

    #about > .carousel-cell > div > .project-header {
        grid-row: 1 ;
    }

    #about > .carousel-cell > div > .project-image {
        grid-row: 3;
    }

    #about > .carousel-cell > div > .project-description {
        grid-row: 4;
        margin-bottom: 0;
    }

    #about > .carousel-cell > div > .project-code {
        grid-row: 2;
        display: flex;
    }

    #about > .carousel-cell > div > .project-code > svg {
        width: 100%;
        height: 100%;
    }

    #about > .carousel-cell > .about > .project-image > img {
        margin-left: auto;
    }
}

@media only screen and (max-width: 420px) and (max-height: 600px){
    #about > .carousel-cell > div > .project-description {
        margin-bottom: 20px;
    }
}

main[data-page="contact"] > #contact {
    display: flex;
    justify-content: center;
}

.contact {
    padding: 40px;
    display: flex;
    flex-direction: column;
    place-items: center;
    height: 80%;
    width: 80%;
    box-sizing: border-box;
}

.contact-grid {
    margin: 40px;
    display: grid;
    grid-template-columns: 1fr 1fr;
    grid-template-rows: 1fr 1fr;
    gap: 40px;
    height: 100%;
    place-items: center;
}

.card {
    background-color: #0b0b0b;
    border-radius: 10px;
    height: 28vh;
    position: relative;
    width: 25vw;
}

@media only screen and (max-height: 600px){
    .card {
        height: 22vh;
    }
}

.card:before {
    background: linear-gradient(
        45deg,
        transparent 5%,
        var(--color-primary) 50%,
        transparent 95%
    );
    border-radius: inherit;
    content: "";
    inset: 0;
    opacity: 0;
    position: absolute;
    z-index: 0;
    transition: opacity 0.5s cubic-bezier(0.2, 0.4, 0.9, 1);
}

.card:hover:before {
    opacity: 1;
}

.card-content {
    background-color: #0b0b0b;
    border-radius: inherit;
    inset: 1%;
    position: absolute;
    display: flex;
    place-items: center;
}

.card-content > svg {
    stroke-width: 10px;
    fill-rule: evenodd;
    fill: none;
    stroke: #828282;
    width: 100%;
    height: 100%;
    scale: 0.5;
    transition: stroke 0.5s cubic-bezier(0.2, 0.4, 0.9, 1);
}

.card-content:hover > svg {
    stroke: var(--color-primary);
}

.home-button {
    height: max(5rem, 5vw);
    width: max(5rem, 5vw);
    position: fixed;
    z-index: 3;
    background-color: transparent;
    border: 2px solid var(--color-primary);
    border-radius: 5rem;
    cursor: pointer;
    transition: transform, background-color, border-color;
    transition-timing-function: ease;
    transition-duration: 0.4s;
}

#nav-toggle {
    left: 50%;
    bottom: 3rem;
    transform: translateX(-50%);
}

#nav-toggle:hover {
    transform: translateX(-50%) scale(1.1);
}

#nav-toggle:active {
    transform: translateX(-50%) scale(0.9);
}

#github-button {
    top: 3rem;
    right: 3rem;
    transform: translateX(0);
}

#github-button > i {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1.1);
}

#github-button:hover {
    transform: translateX(0) scale(1.1);
}

#github-button:active {
    transform: translateX(0) scale(0.9);
}

.home-button > i {
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%) scale(0.7);
    color: var(--color-primary);
    font-size: 2rem;
    opacity: 0;
    transition: transform, opacity, color;
    transition-timing-function: ease;
    transition-duration: 0.4s;
}

.home-button:hover {
    border-color: rgb(160, 79, 179);
}

.home-button:hover > i {
    color: rgb(160, 79, 179);
}

body[data-nav="closed"] > #nav-toggle > .open {
    opacity: 1;
}

body[data-nav="open"] > #nav-toggle {
    border: 2px solid var(--color-secondary);
}

body[data-nav="open"] > #nav-toggle > i {
    color: var(--color-secondary);
}

body:not([data-nav="open"]) > #nav-toggle:hover > .open {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1);
}

#github-button:hover > i {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1.5);
}

body[data-nav="open"] > #nav-toggle > .close {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1);
}

body[data-nav="open"] > main {
    transform: translateY(-50%);
}

nav {
    height: 50vh;
    width: 100%;
    position: absolute;
    left: 0;
    bottom: 0;
    z-index: 1;
}

@media only screen and (max-width:420px) {
    body[data-nav="open"] > main {
        transform: translateY(-80%);
    }

    nav {
        bottom: 14vh;
    }
}

@media only screen and (max-height: 600px) {
    body[data-nav="open"] > main {
        transform: translateY(-100%);
    }

    nav {
        bottom: 20vh;
    }
}


#nav-links {
    display: flex;
    gap: clamp(1rem, 2vw, 2rem);
    margin-top: clamp(2rem, 2vw, 3rem);
    padding: 0 clamp(1rem, 2vw, 2rem);
    transform: translateY(70%) scale(0.9);
    transition: transform 0.5s cubic-bezier(.13, .53, .38, .97);
    justify-content: space-between;
    flex-wrap: wrap;
}

body[data-nav="open"] > nav > #nav-links {
    transform: translateY(0) scale(1);
}

#nav-links > .nav-link {
    text-decoration: none;
}

#nav-links > .nav-link[data-selected="true"] > .nav-link-label {
    color: var(--color-secondary);
}

#nav-links > .nav-link > .nav-link-label {
    color: var(--color-text);
    font-size: 1.25rem;
    margin: 0;
    text-transform: uppercase;
}

#nav-links > .nav-link > .nav-link-image {
    width: max(22vw, 120px);
    aspect-ratio: 1.8 / 1;
    border-radius: 0.5rem;
    margin-top: 0.75rem;
    object-fit: cover;
    transition: transform 0.5s cubic-bezier(.13, .53, .38, .97);
}

#nav-links > .nav-link:hover > .nav-link-image {
    transform: scale(1.06);
}

.rubik-font {
    font-family: 'Rubik', sans-serif;
}