@import url('https://fonts.googleapis.com/css2?family=JetBrains+Mono:ital,wght@0,100;0,200;0,300;0,400;0,500;0,600;0,700;0,800;1,100;1,200;1,300;1,400;1,500;1,600;1,700;1,800&display=swap');

:root {
    --theme-color: 0, 0, 0;
    --rev-theme-color: 255, 255, 255;
    --accent-color: 54, 128, 255;
    --scaling-factor: 1;
}

* {
    color: rgba(var(--rev-theme-color), 1);
    font-family: 'JetBrains Mono', consolas, monospace;
    margin: 0;
    padding: 0;
    scroll-behavior: smooth;
    transition: all 0.125s ease-out;
    line-height: 1em;
    text-decoration: none;
    box-sizing: border-box;
}

*::selection {
    background: rgba(var(--rev-theme-color), 1);
    color: rgba(var(--theme-color), 1);
    text-shadow: none;
}

*::-webkit-scrollbar {
    width: calc(8px * var(--scaling-factor));
    height: calc(8px * var(--scaling-factor));
}
*::-webkit-scrollbar-track {
    background: rgba(var(--theme-color), 0); 
}
*::-webkit-scrollbar-thumb {
    background: rgba(var(--rev-theme-color), 0.25);
    border-radius: calc(4px * var(--scaling-factor));
}
*::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.25); 
}

html {
    margin: 0;
    padding: 0;
    overflow-x: hidden;
    background: black;
}

body {
    margin: 0;
    padding: 0;
    height: 100vh;
    width: 100vw;
    perspective: 1px;
    position: relative;
    overflow-x: hidden;
    overflow-y: auto;
    background: black;
}

.background {
    background: url('../../src/img/bg.png');
    background-size: 100% auto;
    background-position: center center;
    position: absolute;
    width: 100vw;
    height: 100vh;
    top: 0;
    left: 50%;
    transform: translateX(-50%) translateZ(-1px) scale(2);
    z-index: -16;
}

.background::before {
    content: '';
    width: 100%;
    height: 100%;
    position: absolute;
    background: rgba(var(--theme-color), 0.25);
    /* backdrop-filter: blur(0.1vw); */
}

header {
    height: calc(4rem * var(--scaling-factor));
    width: 100vw;
    background: rgba(var(--theme-color), 0.5);
    padding: calc(1rem * var(--scaling-factor)) calc(10vw * var(--scaling-factor));
    position: sticky;
    top: 0;
    left: 0;
    display: flex;
    flex-direction: row;
    justify-content: space-between;
    align-items: center;
    z-index: 16;
    gap: calc(2rem * var(--scaling-factor));
}

header > svg {
    height: 100%;
    width: fit-content;
}

#menu-button {
    display: none;
    cursor: pointer;
}

header > div {
    display: flex;
    flex-direction: row;
    gap: calc(2rem * var(--scaling-factor));
    height: 100%;
    align-items: center;
    justify-content: space-between;
}

header > div[hidden] {
    display: flex;
    opacity: 1;
    pointer-events: all;
}

header > div > a {
    font-weight: 500;
    text-decoration: none;
    font-size: calc(1.2rem * var(--scaling-factor));
    cursor: pointer;
    line-height: 1;
    padding: calc(1.4rem * var(--scaling-factor)) 0;
}

a, button {
    cursor: pointer;
}

header > div > a:hover {
    text-decoration: underline;
}

header > svg * {
    fill: rgba(var(--rev-theme-color), 1);
}

main {
    position: relative;
    top: calc(-4rem * var(--scaling-factor));
    left: 0;
    width: 100vw;
    height: auto;
    transform: translateZ(0);
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: calc(4rem * var(--scaling-factor));
}

section {
    margin: 0;
    padding: calc(2rem * var(--scaling-factor)) calc(10vw * var(--scaling-factor));
    display: flex;
    background: rgba(var(--theme-color), 0.5);
    gap: calc(2rem * var(--scaling-factor));
}

section#home {
    flex-direction: row;
    min-height: 100vh;
    justify-content: center;
    align-items: center;
    padding-top: calc(6rem * var(--scaling-factor));
}

section#home > div {
    width: 100%;
    height: fit-content;
    display: flex;
    flex-direction: column;
    gap: calc(0.75rem * var(--scaling-factor));
    justify-content: center;
}

section#home > div:first-child {
    align-items: start;
}

section#home > div:last-child {
    width: auto;
    align-items: end;
}

section#home > div:last-child > img {
    aspect-ratio: 2 / 3;
    object-fit: cover;
    height: calc(24rem * var(--scaling-factor));
    border: calc(0.25rem * var(--scaling-factor)) solid rgba(var(--rev-theme-color), 1);
    border-radius: calc(0.5rem * var(--scaling-factor));
}

h1{font-size: calc(3rem * var(--scaling-factor));}
h2{font-size: calc(2rem * var(--scaling-factor));}
h3{font-size: calc(1.5rem * var(--scaling-factor));}
p{font-size: calc(1rem * var(--scaling-factor)); line-height: 1.25em;}

section#home > div:first-child > h3 {
    line-height: 1.2em;
}

section#home > div:first-child > h1 {
    font-weight: 800;
    line-height: 1.2em;
}

section#home > div:first-child > h1:hover {
    font-size: calc(3.5rem * var(--scaling-factor));
    letter-spacing: calc(1px * var(--scaling-factor));
    line-height: 1.2em;
}

section#home > div:first-child > h2 {
    display: inline-block;
    width: 100%;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    line-height: 1.2em;
}

section#home > div:first-child > h2 > span#typed {
    font-weight: 400;
    text-decoration: underline;
}

section#home > div:first-child > h2 .typed-cursor {
    font-weight: 100;
    text-decoration: none;
    display: inline-flex;
    width: 0;
    overflow-x: visible;
    text-align: center;
    flex-direction: row;
    justify-content: center;
    align-items: end;
}

section#home > div:first-child > div {
    display: flex;
    flex-direction: row;
    width: 100%;
    height: fit-content;
    margin: calc(1rem * var(--scaling-factor)) 0.25em;
    gap: calc(0.5rem * var(--scaling-factor));
}

section#home > div:first-child > div > a {
    flex-shrink: 0;
    width: calc(3rem * var(--scaling-factor));
    height: calc(3rem * var(--scaling-factor));
    padding: calc(0.5rem * var(--scaling-factor));
    border-radius: calc(0.5rem * var(--scaling-factor));
    text-decoration: none;
    outline: 0.125em solid rgba(var(--rev-theme-color), 0);
    outline-offset: -0.125em;
}

section#home > div:first-child > div > a > svg {
    fill: rgba(var(--rev-theme-color), 1);
}

section#home > div:first-child > div > a:hover {
    background: rgba(var(--rev-theme-color), 1);
    outline-offset: 0.125em;
    outline-color: rgba(var(--rev-theme-color), 1);
}

section#home > div:first-child > div > a:hover > svg {
    fill: rgba(var(--theme-color), 1);
}

section#home > div:first-child > a {
    padding: calc(0.5rem * var(--scaling-factor));
    font-size: calc(1.5rem * var(--scaling-factor));
    font-weight: 500;
    border: 0.125em solid rgba(var(--rev-theme-color), 1);
    border-radius: calc(0.5rem * var(--scaling-factor));
    outline: 0.125em solid rgba(var(--rev-theme-color), 0);
    outline-offset: -0.125em;
    cursor: pointer;
    margin: 0.25em;
}

section#home > div:first-child > a:hover {
    text-decoration: underline;
    background: rgba(var(--rev-theme-color), 1);
    color: rgba(var(--theme-color), 1);
    outline-offset: 0.125em;
    outline-color: rgba(var(--rev-theme-color), 1);
}

section#about {
    flex-direction: row-reverse;
    justify-content: center;
    align-items: center;
}

section#about > div {
    width: 100%;
    height: fit-content;
    display: flex;
    flex-direction: column;
    gap: calc(0.75rem * var(--scaling-factor));
    justify-content: center;
}

section#about > div:first-child {
    align-items: start;
}

section#about > div:last-child {
    width: auto;
    align-items: end;
}

.me {
    color: rgba(var(--rev-theme-color), 1);
    fill: rgba(var(--rev-theme-color), 1);
    cursor: pointer;
}

.me:hover {
    color: rgba(var(--rev-theme-color), 0);
    fill: rgba(var(--accent-color), 1);
    -webkit-text-stroke: 1px rgba(var(--accent-color), 1);
}

.me:hover path {
    fill: rgba(var(--accent-color), 1);
}

section#about > div:last-child > img {
    border: none;
    border-radius: 0;
    height: calc(16rem * var(--scaling-factor));
}

section#about > div:last-child > iframe {
    aspect-ratio: 2 / 3;
    height: calc(24rem * var(--scaling-factor));
    border: calc(0.25rem * var(--scaling-factor)) solid rgba(var(--rev-theme-color), 1);
    border-radius: calc(0.5rem * var(--scaling-factor));
}

section#skills {
    flex-direction: column;
    justify-content: space-between;
    align-items: center;
}

section#skills > div {
    width: 100%;
    height: fit-content;
    display: flex;
    flex-direction: column;
    gap: calc(0.5rem * var(--scaling-factor));
    justify-content: center;
}

section#skills > div:first-child {
    align-items: center;
}

section#skills > div:last-child {
    flex-direction: row;
    align-items: center;
    flex-wrap: wrap;
    gap: calc(2rem * var(--scaling-factor));
}

section#skills > div:last-child > div {
    aspect-ratio: 3 / 4;
    width: calc(16rem * var(--scaling-factor));
    border: calc(0.25rem * var(--scaling-factor)) solid rgba(var(--rev-theme-color), 1);
    border-radius: calc(0.5rem * var(--scaling-factor));
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: calc(0.5rem * var(--scaling-factor));
    padding: calc(0.5rem * var(--scaling-factor));
    overflow-y: auto;
}

.hover-container > *, .hover {
    outline: calc(0.25rem * var(--scaling-factor)) solid rgba(var(--rev-theme-color), 0);
    outline-offset: calc(-0.25rem * var(--scaling-factor));
}

.hover-container > *:hover, .hover:hover {
    outline-offset: calc(0.25rem * var(--scaling-factor));
    outline-color: rgba(var(--rev-theme-color), 1);
}

section#skills > div:last-child > div > div:first-child {
    aspect-ratio: 1 / 1;
    width: calc(8rem * var(--scaling-factor));
    display: flex;
    flex-direction: row;
    justify-content: center;
    align-items: center;
}

section#skills > div:last-child > div > div:first-child > svg {
    width: 100%;
    height: 100%;
}

section#skills > div:last-child > div > div:first-child > svg * {
    fill: rgba(var(--rev-theme-color), 1);
}

section#skills > div:last-child > div * {
    text-align: center;
    width: 100%;
}

section#projects {
    flex-direction: column;
    justify-content: space-between;
    align-items: center;
}

section#projects > div {
    width: 100%;
    height: fit-content;
    display: flex;
    flex-direction: column;
    gap: calc(0.5rem * var(--scaling-factor));
    justify-content: center;
}

section#projects > div:first-child {
    align-items: center;
}

section#projects > div:last-child {
    flex-direction: row;
    align-items: center;
    flex-wrap: wrap;
    gap: calc(2rem * var(--scaling-factor));
}

section#projects > div:last-child > div {
    position: relative;
    aspect-ratio: 16 / 9;
    width: calc(20rem * var(--scaling-factor));
    border: calc(0.25rem * var(--scaling-factor)) solid rgba(var(--rev-theme-color), 1);
    border-radius: calc(0.5rem * var(--scaling-factor));
    display: flex;
    flex-direction: column;
    align-items: center;
    overflow: hidden;
}

section#projects > div:last-child > div > * {
    flex-shrink: 0;
    position: absolute;
    top: 0;
    left: 0;
    aspect-ratio: inherit;
    width: 100%;
    transform: translate(-50% -50%);
}

section#projects > div:last-child > div > div:first-child {
    background: #ffffff;
}

section#projects > div:last-child > div > div:first-child > iframe {
    position: absolute;
    --scale: calc(0.25 / var(--scaling-factor));
    top: 0;
    left: 0;
    width: calc(100% / var(--scale));
    height: calc(100% / var(--scale));
    transform-origin: left top;
    transform: scale(var(--scale));
    transform: translate(-50% -50%);
}

section#projects > div:last-child > div > div:first-child > img {
    aspect-ratio: inherit;
    object-fit: cover;
    width: 100%;
    height: auto;
}

section#projects > div:last-child > div > div:first-child:has(> img) {
    border-bottom-width: calc(0.1rem * var(--scaling-factor));
}

section#projects > div:last-child > div * {
    text-align: center;
    width: 100%;
}

section#projects > div:last-child > div > div:last-child {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: calc(0.5rem * var(--scaling-factor));
    padding: calc(0.5rem * var(--scaling-factor));
    background: rgba(var(--theme-color), 0.75);
    backdrop-filter: blur(1px);
}

section#projects > div:last-child > div:hover > div:last-child {
    opacity: 0;
    pointer-events: none;
}

section#projects > div:last-child > div > div:last-child > * {
    text-shadow: 0 0 calc(0.25rem * var(--scaling-factor)) rgba(var(--theme-color), 10);
}

section#projects > div:last-child > div:has(> div:only-child):hover > div:only-child {
    opacity: 1;
    pointer-events: all;
}

@media (min-width: 1200px) {
    :root {
        --scaling-factor: 1.05;
    }
}

@media (max-width: 992px) {
    :root {
        --scaling-factor: 0.95;
    }
}

@media (max-width: 768px) {
    :root {
        --scaling-factor: 0.9;
    }

    header > div {
        position: absolute;
        flex-direction: column;
        background: rgba(var(--theme-color), 0.5);
        height: fit-content;
        width: fit-content;
        align-items: end;
        padding: 0 calc(10vw * var(--scaling-factor)) calc(0.5rem * var(--scaling-factor)) calc(0.5rem * var(--scaling-factor));
        top: 100%;
        right: 0;
        border-radius: 0 0 0 calc(0.5rem * var(--scaling-factor));
        gap: calc(0.5rem * var(--scaling-factor));
    }

    header > div[hidden] {
        right: calc(-4rem * var(--scaling-factor));
        opacity: 0;
        pointer-events: none;
    }

    header > div > a {
        width: 100%;
        border-radius: calc(0.5rem * var(--scaling-factor));
        background: rgba(var(--theme-color), 0.5);
        text-align: right;
        padding: calc(1.25rem * var(--scaling-factor)) calc(0.75rem * var(--scaling-factor));
    }

    #menu-button {
        display: initial;
    }

    section#home, section#about {
        flex-direction: column;
    }

    section#home > div:first-child, section#home > div:last-child, section#about > div:first-child, section#about > div:last-child {
        align-items: center;
    }

    section#home > div:first-child > *, section#about > div:first-child > *, section > div > h2 {
        text-align: center;
    }

    section#home > div:first-child > div {
        justify-content: center;
        flex-wrap: wrap;
    }

    section#home > div:last-child {
        width: 100%;
        align-items: center;
    }

    section#home > div:last-child > img {
        aspect-ratio: 16 / 9;
        height: auto;
        width: calc(30rem * var(--scaling-factor));
    }

    section#about > div:last-child {
        width: 100%;
        align-items: center;
    }

    section#about > div:last-child > iframe {
        aspect-ratio: 16 / 9;
        height: auto;
        width: calc(30rem * var(--scaling-factor));
    }
}

@media (max-width: 576px) {
    :root {
        --scaling-factor: 0.85;
    }

    section#home > div:last-child > img {
        width: 100%;
    }

    section#about > div:last-child > iframe {
        width: 100%;
    }

    section#projects > div:last-child {
        flex-direction: column;
    }

    section#projects > div:last-child > div {
        width: 100%;
    }
}

/* @media (prefers-color-scheme: light) {
    :root {
        --theme-color: 255, 255, 255;
        --rev-theme-color: 0, 0, 0;
    }
} */

@media (prefers-reduced-motion) {
    .background {
        transform: translateX(-50%) translateZ(0) scale(1) !important;
    }
}