@import url('https://fonts.googleapis.com/css2?family=Roboto+Mono:wght@300..700&display=swap');
@import url('https://fonts.googleapis.com/css2?family=Work+Sans:wght@300..700&display=swap');

:root {
    --grain: url("data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHZlcnNpb249IjEuMSIgeG1sbnM6eGxpbms9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkveGxpbmsiIHhtbG5zOnN2Z2pzPSJodHRwOi8vc3ZnanMuZGV2L3N2Z2pzIiB2aWV3Qm94PSIwIDAgNzAwIDcwMCIgd2lkdGg9IjcwMCIgaGVpZ2h0PSI3MDAiPjxkZWZzPjxmaWx0ZXIgaWQ9Im5ubm9pc2UtZmlsdGVyIiB4PSItMjAlIiB5PSItMjAlIiB3aWR0aD0iMTQwJSIgaGVpZ2h0PSIxNDAlIiBmaWx0ZXJVbml0cz0ib2JqZWN0Qm91bmRpbmdCb3giIHByaW1pdGl2ZVVuaXRzPSJ1c2VyU3BhY2VPblVzZSIgY29sb3ItaW50ZXJwb2xhdGlvbi1maWx0ZXJzPSJsaW5lYXJSR0IiPgoJPGZlVHVyYnVsZW5jZSB0eXBlPSJmcmFjdGFsTm9pc2UiIGJhc2VGcmVxdWVuY3k9IjAuMDUiIG51bU9jdGF2ZXM9IjQiIHNlZWQ9IjE1IiBzdGl0Y2hUaWxlcz0ic3RpdGNoIiB4PSIwJSIgeT0iMCUiIHdpZHRoPSIxMDAlIiBoZWlnaHQ9IjEwMCUiIHJlc3VsdD0idHVyYnVsZW5jZSI+PC9mZVR1cmJ1bGVuY2U+Cgk8ZmVTcGVjdWxhckxpZ2h0aW5nIHN1cmZhY2VTY2FsZT0iMTYiIHNwZWN1bGFyQ29uc3RhbnQ9IjAuNzUiIHNwZWN1bGFyRXhwb25lbnQ9IjIwIiBsaWdodGluZy1jb2xvcj0iIzU1NSIgeD0iMCUiIHk9IjAlIiB3aWR0aD0iMTAwJSIgaGVpZ2h0PSIxMDAlIiBpbj0idHVyYnVsZW5jZSIgcmVzdWx0PSJzcGVjdWxhckxpZ2h0aW5nIj4KICAgIAkJPGZlRGlzdGFudExpZ2h0IGF6aW11dGg9IjMiIGVsZXZhdGlvbj0iMTAwIj48L2ZlRGlzdGFudExpZ2h0PgogIAk8L2ZlU3BlY3VsYXJMaWdodGluZz4KICAKPC9maWx0ZXI+PC9kZWZzPjxyZWN0IHdpZHRoPSI3MDAiIGhlaWdodD0iNzAwIiBmaWxsPSJ0cmFuc3BhcmVudCI+PC9yZWN0PjxyZWN0IHdpZHRoPSI3MDAiIGhlaWdodD0iNzAwIiBmaWxsPSIjNTU1NTU1IiBmaWx0ZXI9InVybCgjbm5ub2lzZS1maWx0ZXIpIj48L3JlY3Q+PC9zdmc+");
    --primary: #ed4245;
    --bg: #111;
    color-scheme: dark;
}

html, body {
    width: 100%;
    height: 100%;
    margin: 0;
    background-color: var(--bg);
    color: #efefef;
    font-family: 'Roboto Mono', Arial, sans-serif;
}
h1 {
    font-size: 32px;
    font-family: 'Work Sans', Arial, sans-serif;
}
a {
    color: var(--primary);
    text-decoration: none;
    font-weight: bold;
}

/* bento */
section.bento {
    width: calc(100% - 40px);
    height: calc(100% - 40px);
    padding: 20px;
}
.bentoInner {
    display: grid;
    width: 100%;
    height: 100%;
    gap: 10px;
    grid-template-columns: minmax(315px, 1fr) 2fr 2fr;
    grid-template-rows: 1fr 2fr 2fr 2fr 1fr;
    max-width: 1500px;
    margin: 0 auto;
}
.bentoInner > * {
    background-color: #292929;
    border-radius: 10px;
    position: relative;
    animation: slideIn 0.5s cubic-bezier(0.075, 0.82, 0.165, 1);
    animation-fill-mode: backwards;
}
@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(100px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}
#title, #intro, #support {
    grid-column: 1 / 2;
}

/* bento > title */
#title {
    grid-row: 1 / 2;
    background-color: #ed4245;
    background-image: linear-gradient(45deg, #ed4245, #ed4245) var(--grain);
}
.borderInner {
    position: absolute;
    left: 8px;
    top: 8px;
    border-radius: 6px;
    box-sizing: border-box;
    width: calc(100% - 16px);
    height: calc(100% - 16px);
    background: #222;
    background-image: var(--grain);
    background-image: var(--grain), linear-gradient(45deg, rgba(0, 0, 0, 0), rgba(90, 90, 90, 0.5));
}
#title > .borderInner {
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 10px;
}
#title h1 {
    font-size: 32px;
    font-weight: bold;
    color: white;
    margin: 0;
}
#title span {
    color: white;
    font-size: 20px;
}

/* bento > intro */
#intro {
    animation-delay: 100ms;
    grid-row: 2 / 5;
}
#intro > .borderInner {
    padding: 10px;
}
#intro h1 {
    margin: 0;
    width: 15ch;
    font-size: 32px;
    transform: rotate(-3deg);
}
#intro img {
    position: absolute;
    bottom: 10px;
    width: 100%;
}

@media screen and (max-height: 900px) {
    #intro img {
        display: none;
    }
}

/* bento > support */
#support {
    animation-delay: 200ms;
    grid-row: 5 / 6;
}
#support > .borderInner {
    display: flex;
    flex-direction: column;
    justify-content: center;
}

/* bento > gallery */
#gallery {
    animation-delay: 150ms;
    grid-column: 2 / 4;
    grid-row: 1 / 4;
    overflow: hidden;
}
#gallery #carousel {
    width: 100%;
    height: 100%;
}
#leftGallery, #rightGallery {
    position: absolute;
    border-radius: 0;
    border: none;
    top: 50%;
    transform: translateY(-50%);
    height: 60px;
    width: 60px;
    border-radius: 100px;
    font-size: 30px;
    cursor: pointer;
    background-color: #333;
    box-shadow: 0 0 5px rgba(0, 0, 0, 0.5);
}
#leftGallery {
    left: 10px;
    z-index: 2;
}
#rightGallery {
    right: 10px;
    z-index: 2;
}
#carousel {
    display: flex;
    gap: 10px;
    transition: transform 0.5s cubic-bezier(0.075, 0.82, 0.165, 1);
}
.carouselItem {
    position: absolute;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;

    display: flex;
    justify-content: center;
    align-items: end;
    gap: 10px;
    color: white;
    background-size: cover;
    background-repeat: no-repeat;
}
.carouselItem .text {
    width: calc(100% - 80px);
    padding: 10px 40px;
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    background: linear-gradient(0deg, rgba(20, 20, 20, 0.9) 10%, rgba(0, 0, 0, 0) 75%);
}
.carouselItem .tag {
    text-transform: uppercase;
    font-size: 1.2em;
    margin: 0;
}
.carouselItem h1 {
    font-size: 48px;
    margin: 0;
}

/* bento > live */
#live {
    animation-delay: 250ms;
    grid-column: 2 / 3;
    grid-row: 4 / 6;
    overflow: hidden;
}
#live .label {
    position: absolute;
    width: 100%;
    bottom: 0;
    left: 0;
    padding: 10px;
    background: linear-gradient(0deg, rgba(0, 0, 0, 1), rgba(0, 0, 0, 0));
}
#live .label h1, #live .label p {
    margin: 0;
}
#live span {
    position: absolute;
    right: 10px;
    top: 10px;
    background-color: #ed4245;
    padding: 5px 10px;
    border-radius: 100px;
    font-weight: bold;
}
#live img, #live video {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* bento > socials */
#socials {
    animation-delay: 350ms;
    grid-column: 3 / 4;
    grid-row: 4 / 6;
    transition: background-color 0.2s ease-in-out;
    text-align: center;
}
#socials p, #socials h1 {
    margin: 0;
}
#socials > .borderInner {
    padding: 0 10px;
    background: var(--grain) rgba(50, 50, 50, 0.5);
    display: flex;
    flex-direction: column;
    justify-content: center;
    overflow: hidden;
}
.socialGrid {
    display: flex;
    width: 100%;
    justify-content: center;
    align-content: center;
    flex-wrap: wrap;
}
.social {
    display: flex;
    gap: 10px;
    align-items: center;
    justify-content: center;
    background-color: white;
    width: calc(100% - 20px);
    max-width: 50px;
    margin: 0 5px;
    aspect-ratio: 1;
    border-radius: 100px;
    padding: min(20px, 1.5vw);
    transition: background-color 0.2s ease-in-out;
}
.social:not(:hover) {
    background-color: transparent !important;
}
.social img {
    width: 100%;
    max-width: 50px;
}
#socials:has(.github:hover), .github:hover {
    background-color: #4078c0;
}
#socials:has(.youtube:hover), .youtube:hover {
    background-color: #FF0000;
}
#socials:has(.twitter:hover), .twitter:hover {
    background-color: #1da1f2;
}
#socials:has(.tumblr:hover), .tumblr:hover {
    background-color: #596c84;
}
#socials:has(.email:hover), .email:hover {
    background-color: #34a853;
}
#socials:has(.portfolioLink:hover) {
    background-color: #555;
}

/* portfolio overrides */
#socials > .borderInner {
    justify-content: flex-start;
    padding-top: 20px;
    min-height: 400px;
}

@media screen and (max-width: 400px) {
    .portfolioLink span {
        display: none;
    }
}


@media screen and (min-width: 540px) {
    #socials > .borderInner {
        min-height: 300px;
    }
}

@media screen and (min-width: 800px) {
    #socials > .borderInner {
        min-height: unset;
    }
    .portfolioLink span {
        display: none;
    }
}

@media screen and (min-width: 1200px) {
    .portfolioLink span {
        display: unset;
    }
}

.portfolioLink {
    position: absolute;
    bottom: 0px;
    right: 0px;
    display: flex;
    justify-content: center;
    gap: 10px;
    padding: 0 10%;
    align-items: center;
    width: 80%;
    color: white;
}
.portfolioLink:hover span {
    color: #fecb6b;
    background-color: #555;
}
.portfolioLink span {
    flex-grow: 1;
    line-height: 1.5;
    background-color: #222;
    padding: 5px 10px;
    border-radius: 10px;
    transition: background-color 0.2s ease-in-out, color 0.2s ease-in-out;
}
.portfolioLink img {
    height: 200px;
}
.portfolioLink #portfolioHover, .portfolioLink:hover img:not(#portfolioHover) {
    display: none;
}
.portfolioLink:hover #portfolioHover {
    display: block;
}

/* projects */
section.projects {
    width: calc(100% - 40px);
    padding: 20px;

    display: flex;
    flex-direction: column;
    max-width: 1500px;
    margin: auto;
}
section.projects > h1 {
    margin: 0;
    margin-bottom: 20px;
}
.projectList {
    column-width: 300px;
    column-count: auto;
}
.projectList h2 {
    margin-top: 0;
}
.projectList .section {
    break-inside: avoid;
}
.project, .source {
    font-weight: unset;
    display: flex;
    break-inside: avoid;
    flex-direction: column;
    border-radius: 10px;
    background: var(--grain) #222;
    padding: 10px;
    margin: 10px 0;
    gap: 5px;
    text-decoration: none;
    transition: background 0.1s ease-in-out, outline 0.1s ease-in-out;
}
.project.clickable {
    cursor: pointer;
}
.project span.tag {
    font-size: 0.75em;
    text-transform: uppercase;
    background-color: var(--primary);
    color: white;
    padding: 0px 0.5em;
    border-radius: 100px;
    white-space: nowrap;
}
.project span.tag.unavailable {
    background-color: transparent;
    border: 2px solid var(--primary);
    color: var(--primary);
    font-size: 0.5em;
    transform: translateY(1em);
}
.project.disabled {
    opacity: 0.5;
}
.project:not(.disabled):hover, .source:hover {
    background: var(--grain) #333;
    outline: 2px solid var(--primary);
    outline-offset: 2px;
}
.project h3, .source h3 {
    margin: 0;
    font-size: 24px;
    overflow-wrap: break-word;
}
.project p, .source p, .research p {
    color: #ccc;
    margin: 0px;
}
.research {
    font-weight: unset;
    break-inside: avoid;
    border-radius: 10px;
    border: 2px dashed #444;
    background: var(--grain);
    padding: 10px;
    margin: 10px 0;
    text-decoration: none;
}
.research h3 {
    margin: 0;
    margin-bottom: 5px;
    font-size: 22px;
    overflow-wrap: break-word;
}

/* footer */
footer {
    height: 600px;
    width: calc(100% - 40px);
    padding: 20px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: linear-gradient(to bottom, var(--bg), transparent), url("/assets/footer.png");
    background-position: center -10%;
    background-size: cover;
}
footer > div {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 5px;
    background-color: #222;
    background: url('/beta/assets/bg-pattern.svg') #222;
    padding: 20px 100px;
    border-radius: 1000px;
    margin: 0 auto;
    text-align: center;
}
footer h2, footer p, footer a {
    margin: 0;
}

/* modal */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 100;
    overflow-y: auto;
}

.modalContent {
    margin: 10px auto;
    background-color: #222;
    border-radius: 10px;
    padding: 20px;
    max-width: min(90%, 700px);
    display: flex;
    flex-direction: column;
    gap: 10px;
    animation: slideIn 0.2s cubic-bezier(0.075, 0.82, 0.165, 1);
}
@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(100px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.modalContent h1, .modalContent p {
    margin: 0;
}
.modalContent p {
    color: #ccc;
}
.modalContent h1 {
    font-size: 1.5em;
}
.modalContent button {
    background-color: var(--primary);
    color: white;
    border: none;
    padding: 10px;
    border-radius: 5px;
    cursor: pointer;
    font-family: unset;
}
.modalContent > img {
    background-color: #111;
    margin: auto;
    max-height: 50vh;
    max-width: 700px;
    border-radius: 5px;
}
.btnrow {
    display: flex;
    gap: 10px;
    justify-content: stretch;
}
.source {
    width: 100%;
    flex-direction: row;
    background-color: #111;
    align-items: center;
    gap: 10px;
}
.source img {
    width: 32px;
    height: 32px;
}

@media screen and (max-width: 1245px) {
    #socials h1, #socials p {
        display: none;
    }
}
@media screen and (max-width: 800px) {
    /* different layout for mobile */
    section.bento {
        height: unset;
    }
    .bentoInner {
        display: block;
        height: unset;
        flex-direction: column;
    }
    .bentoInner > * {
        margin-bottom: 10px;
        animation: none;
    }
    #title {
        height: 100px;
    }
    #intro, #socials {
        padding: 10px;
    }
    #intro .borderInner, #socials .borderInner {
        padding: 10px;
        position: unset;
        width: 100%;
        height: 100%;
    }
    #intro .borderInner {
        padding-bottom: 150px;
    }
    #intro img {
        display: block;
        width: 300px;
        right: 10px;
    }
    #gallery {
        height: 500px;
    }
    #leftGallery, #rightGallery {
        height: 200px;
        width: 30px;
        font-size: 20px;
    }
    #leftGallery {
        border-radius: 0 100px 100px 0;
        left: 0px;
    }
    #rightGallery {
        border-radius: 100px 0 0 100px;
        right: 0px;
    }
    #gallery .text {
        padding: 10px;
        width: calc(100% - 20px);
    }
    #gallery h1 {
        font-size: 2.5em;
    }
    #gallery .tag {
        font-size: 1em;
    }
    #socials h1, #socials p {
        display: unset;
        margin: unset;
    }
    .social {
        padding: 15px;
    }
    #support {
        height: 100px;
    }
    footer {
        height: 300px;
    }
    footer div {
        padding: 20px 40px;
    }
}