/* #region Base */
@font-face {
    font-family: "UnifrakturMaguntia";
    src: url("/fonts/UnifrakturMaguntia-Regular.ttf");
}

:root {
    --white: #FFFFFF;
    --header-margin-top: 2rem;
    --header-margin-side: 2rem;
    --rotate: 0deg;
    --offsetX: 0deg;
    --offsetY: 0deg;
    --burger-menu-size: 35px;
}

body,
html {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    overflow-x: hidden;

    font-family: "Manrope", sans-serif;
    font-optical-sizing: auto;
    font-weight: normal;
    font-style: normal;
    font-variation-settings:
        "wdth" 100;
    height: 100vh;
    color: rgb(11, 11, 11);
}

p,
h1,
h2,
h3,
h4,
h5,
h6 {
    margin: 0;
}

a {
    color: rgb(11, 11, 11);
}

body {
    transition: background-color 300ms ease 300ms;
    background-color: var(--white);
}

#center {
    position: fixed;
    width: 90vw;
    height: 86vh;
    top: 8vh;
    left: 5vw;

    @media screen and (max-width: 768px) {
        width: 92vw;
        left: 4vw;
        height: 86vh;
        top: 8vh;
    }
}

.container {
    width: 100vw;
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
    position: relative;
}

/* #endregion */

/* #region Projects */

.project {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
    transform-origin: center center;

    /* perspective: 3000px; */
    opacity: 0;
    pointer-events: none;

    &.active {
        animation: fadeIn 500ms ease forwards 300ms;
        pointer-events: all;

        &#about {
            animation: none;
            opacity: 1;

            #about-wrapper>div {
                opacity: 1;
                transform: translateY(0%);
                transition: opacity 0.4s ease, transform 0.5s ease;

                transition-delay: calc(100ms + (sibling-index() * 250ms)), calc(100ms + (sibling-index() * 250ms));
            }
        }
    }
}

.perspective {
    height: 100%;
    width: 100%;
    display: grid;
    grid-template-rows: 60% 40%;
    align-items: center;
    justify-content: center;

    transform-style: preserve-3d;
    transform-origin: center center;
    transform: rotateX(var(--rotate-y)) rotateY(var(--rotate-x));
    will-change: transform;

    >div {
        backface-visibility: inherit;
    }
}

#project-1 .project-image {
    max-width: 600px;

    @media screen and (max-width: 768px) {
        max-width: 210px;
    }
}

#project-2 .project-image {
    aspect-ratio: 15/9;
    max-width: 900px;
    width: 90vw;
}

#project-3 .project-image {
    aspect-ratio: 9/19;
    max-width: 210px;
    width: 31%;
    --offset-pixels: 21%;

    /* @media screen and (max-width: 768px) {
        max-width: 111px;
    } */
}

#project-4 .project-image {
    aspect-ratio: 1/1;
    max-width: 250px;
    --offset-pixels: 21%;
}

.project-image {
    --rotate: 20deg;
    --offset-pixels: 9%;
    --depth-pixels: -35px;
    width: 80vw;
    aspect-ratio: 16/13;
    max-width: 900px;
    overflow: visible;
    position: relative;
    transform-style: preserve-3d;
    transform: translateZ(0px);
    perspective: 3000px;

    &.stacked-images {
        transform: translateX(-50%);
        position: relative;
        left: 50%;

        img,
        video {
            filter: drop-shadow(0px 0px 7px rgba(0, 0, 0, 0.5));
            position: absolute;
            width: 100%;
            left: 50%;
            top: 50%;
            border-radius: 11px;
            transform-style: preserve-3d;
            cursor: pointer;
            /* z-index: calc(sibling-count() - sibling-index()); */
            transition: transform 0.3s ease;

            &:nth-child(odd) {
                transform: translateY(-50%) translateX(-50%) translateX(calc((var(--sib-index) - 1) * var(--offset-pixels))) translateZ(calc(((var(--sib-index) - 1) * var(--depth-pixels))));
            }

            &:nth-child(even) {
                transform: translateY(-50%) translateX(-50%) translateX(calc((var(--sib-index)) * var(--offset-pixels) * -1)) translateZ(calc(((var(--sib-index)) * var(--depth-pixels))));
            }

            &:nth-child(1) {
                --sib-index: 1;
            }

            &:nth-child(2) {
                --sib-index: 2;
            }

            &:nth-child(3) {
                --sib-index: 3;
            }

            &:nth-child(4) {
                --sib-index: 4;
            }

            &:nth-child(5) {
                --sib-index: 5;
            }

            &:nth-child(6) {
                --sib-index: 6;
            }

            &:nth-child(7) {
                --sib-index: 7;
            }

            &.focused {
                transform: translateY(-50%) translateX(-50%) translateX(0) translateZ(35px) !important;
            }
        }

    }

    @media screen and (max-width: 768px) {
        width: 70vw;
    }
}

.project-body {
    max-width: 700px;
    display: flex;
    flex-direction: column;
    align-self: flex-start;
    height: 100%;
    overflow-y: auto;
    /* transform-style: preserve-3d; */

    .project-title {
        align-self: flex-start;
        display: flex;
        flex-direction: column;
        padding: 1rem 0rem;
        gap: 0.5rem;
        font-weight: bold;
        font-size: 4rem;
        margin-top: 1rem;
        transform: translateZ(140px) translateY(-42px);
        text-shadow: 0px 3px 6px rgba(255, 255, 255, 1);

        h2 {
            font-size: 3rem;
            margin: 0;
        }

        h3 {
            font-size: 1.5rem;
            font-weight: semi-bold;
            margin-top: 0rem;
        }

        @media screen and (max-width: 768px) {
            font-size: 0.7rem;
        }
    }

    .project-subtitle {
        align-self: flex-start;
        font-weight: semi-bold;
        font-size: 1rem;
        /* padding-left: 1rem; */
        transform: translateZ(70px) translateY(-49px);
    }
}

#project-list {
    display: flex;
    flex-wrap: nowrap;
    flex-direction: column;
    justify-content: space-around;
    align-items: center;
    height: 100%;
    font-size: clamp(3rem, 12vw, 7rem);
    overflow-y: auto;
    cursor: pointer;
    overflow-y: visible;

    @media screen and (max-width: 768px) {
        justify-content: center;
        gap: 1rem;
    }
}

.name-wrapper {
    display: inline-block;
    opacity: 0;
    transition: transform 0.3s ease, opacity 0.3s ease;
    /* transition: transform 0.3s ease calc((calc(sibling-count() - sibling-index()) * 150ms) + 300ms),
        opacity 0.3s ease calc((calc(sibling-count() - sibling-index()) * 150ms) + 300ms); */
    transform: translateY(70%) scale(0.95);
    transition-delay: calc(-0.1s + 0.2s * var(--name-index)), calc(-0.1s + 0.2s * var(--name-index));

    &:nth-of-type(1) {
        --name-index: 1;
    }

    &:nth-of-type(2) {
        --name-index: 2;
    }

    &:nth-of-type(3) {
        --name-index: 3;
    }

    &:nth-of-type(4) {
        --name-index: 4;
    }

    &:nth-of-type(5) {
        --name-index: 5;
    }

    .project-name {
        text-decoration: none;
        font-weight: bolder;
        text-transform: uppercase;
        text-box: trim-both cap alphabetic;
        letter-spacing: -0.1rem;
        transition: transform 0.3s ease, filter 0.3s ease;
        filter: drop-shadow(0 0 0 rgba(0, 0, 0, 0.4));

        /* text-shadow: 0px 0px 0px rgba(0, 0, 0, 0.4); */
        &:hover {
            transform: scale(1.07);
            /* text-shadow: 0px 4px 3px rgba(0, 0, 0, 0.4); */
            filter: drop-shadow(0 4px 3px rgba(0, 0, 0, 0.4));
        }
    }

}

#project-4 {
    .project-image {
        max-width: 700px;
        aspect-ratio: 16/17;
    }
}

.grid-images {
    width: 70%;
    display: grid;
    grid-template-areas: 'top top' 'mid mid';
    place-items: center;
    gap: 1rem;    
    left: 50%;
    transform: translateX(-50%);

    @media screen and (max-width: 768px) {
        width: 90%;        
    }

    .sub-grid {
        display: flex;
        flex-direction: column;
        gap: 1rem;
        place-self: end;

        &.right {
            place-self: start;
        }
    }

    img {
        width: 100%;
        place-self: start;
        border-radius: 17px;
        box-shadow: 0px 3px 7px rgba(0, 0, 0, 0.5);
        transition: transform 0.3s ease;

        &:hover {
            transform: scale(1.05);
        }

        &.right-img {
            place-self: end;
        }
    }
}

/* #region ETHCC */
#project-5 {
    .project-image {
        width: 84vw;
        max-width: 490px;
        aspect-ratio: 17/13;
        margin: 0 auto;
        margin-top: 4rem;
    }
}

/* #endregion */

.image-slider {
    width: 100%;
    height: 100%;
    position: relative;

    .slider {
        position: absolute;
        top: 0;
        left: 50%;
        height: 100%;
        width: 1px;
        background-color: white;
        z-index: 10;

        .slider-handle {
            position: absolute;
            display: flex;
            align-items: center;
            justify-content: space-around;
            cursor: pointer;
            top: 50%;
            left: 50%;
            width: 35px;
            height: 35px;
            background-color: rgba(255, 255, 255, 0.7);

            border-radius: 50%;
            transform: translate(-50%, -50%);

            &:hover {
                background-color: rgba(255, 255, 255, 1);
            }

            &.focused {
                background-color: rgba(255, 255, 255, 1);
            }

            &::after,
            &::before {
                content: url('/images/icons/arrow.svg');
                width: 17px;
                height: 17px;
            }

            &::before {
                transform: rotate(-90deg);
            }

            &::after {
                transform: rotate(90deg);
            }
        }
    }

    .slider-image-wrapper {
        position: absolute;
        width: 100%;
        height: 100%;
        top: 0;
        left: 0;
        overflow: hidden;

        &.top-image {
            z-index: 4;
            --slider-percentage: 50%;
            clip-path: polygon(var(--slider-percentage) 0,
                    100% 0%,
                    100% 100%,
                    var(--slider-percentage) 100%);
        }

        &.bottom-image {
            z-index: 3;
        }

        img {
            width: 100%;
            border-radius: 21px;
        }
    }


}

/* #endregion */

/* #region About */

#about {
    width: 100%;

    #about-wrapper {
        padding: 7rem 4rem 0rem;
        display: grid;
        height: 100%;
        width: 100%;
        overflow: visible;
        grid-template-areas: 'space title title pic'
            'space sub sub pic'
            'space contact contact pic';
        grid-template-columns: 1fr 2fr 1fr 3fr;
        grid-template-rows: 3fr 1fr 3fr;

        &>div {
            opacity: 0;
            transform: translateY(10%);
            /* animation: animateIn 0.3s ease forwards 0.5s; */
        }

        .about-title {
            grid-area: title;
            font-size: 2.5rem;
            font-weight: bold;
            margin-bottom: 1rem;
            align-self: end;
        }

        .about-subtitle {
            grid-area: sub;
            font-size: 1.2rem;
            margin-bottom: 2rem;
            line-height: 1.5rem;
        }

        .about-contact {
            grid-area: contact;
            font-size: 2.5rem;
            font-family: 'UnifrakturMaguntia';

            a {
                cursor: pointer;
                text-decoration: none;
            }

            span {
                font-size: 1.2rem;
                font-family: 'Manrope';
            }
        }

        .about-pic {
            grid-area: pic;
            place-self: center flex-end;
            position: relative;
            border-radius: 50%;
            transform: translateY(5vh);
            justify-self: center;
            align-self: center;
            width: 100%;
            display: flex;
            align-items: flex-end;
            transform-style: preserve-3d;
            perspective: 1000px;
            bottom: -2rem;
            justify-self: end;

            .perspective {
                transform: rotateY(var(--rotate-y)) rotateX(var(--rotate-x));

                &::after {
                    content: '';
                    pointer-events: none;
                    position: absolute;
                    top: 0;
                    left: 0;
                    width: 100%;
                    aspect-ratio: 9/11;
                    background-color: rgba(0, 0, 0, 0.5);
                    border-radius: 50%;
                    transform: translateZ(-500px) scale(6);
                    background-image: conic-gradient(red, green, blue, purple, red);
                    filter: blur(21px);
                    opacity: 0.1;
                }
            }

            img {
                transform-style: preserve-3d;
                filter: drop-shadow(0px 0px 7px white);
                transform: translateZ(150px);
                width: 100%;
                aspect-ratio: 1/1;
                /* max-width: 350px; */
            }
        }

        @media screen and (max-width: 768px) {
            display: flex;
            flex-direction: column;
            padding: 3rem 1rem 0rem;

            .about-contact {
                font-size: 1.9rem;

                span {
                    font-size: 1.1rem;
                }
            }

            & .about-title {
                font-size: 1.5rem;
            }

            .about-pic img {
                width: 70vw;
            }
        }
    }
}

/* #endregion */

/* #region NAV */

#nav-wrapper {
    #logo {
        font-family: "UnifrakturMaguntia", cursive;
        position: fixed;
        font-size: 5rem;
        text-align: left;
        top: var(--header-margin-top);
        left: var(--header-margin-side);
        transform: translateY(-25%);
        /* text-box-trim: trim-both;
        text-box-edge: ex alphabetic; */
        z-index: 11;

        @media screen and (max-width: 768px) {
            font-size: 4rem;
        }
    }

    #burger-menu {
        display: none;
        position: fixed;
        right: var(--header-margin-side);
        top: var(--header-margin-top);
        width: var(--burger-menu-size);
        aspect-ratio: 11/9;
        z-index: 11;
        cursor: pointer;

        .line {
            width: 100%;
            height: 0.2rem;
            position: absolute;
            background-color: black;
            transform-origin: left center;
            transition: transform 0.7s ease;

            &.top-line {
                top: 0%;
            }

            &.middle-line {
                top: 50%;
                transform: scaleX(1) translateY(-50%);
            }

            &.bottom-line {
                bottom: 0%;
            }
        }

        &.open {
            .top-line {
                transform: rotate(45deg);
            }

            .middle-line {
                transform: scaleX(0) translateY(-50%);
            }

            .bottom-line {
                transform: rotate(-45deg);
            }
        }

        @media screen and (max-width: 768px) {
            display: block;
        }
    }

    .side-nav-wrapper {
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        pointer-events: none;
        z-index: 10;

        .side-nav {
            pointer-events: all;
            position: absolute;
            display: flex;
            align-items: center;
            justify-content: center;
            top: 0;
            width: 5%;
            height: 100vh;
        }

        .side-nav-button {
            display: inline-block;
            text-orientation: mixed;
            font-size: 1.5rem;
            text-align: center;
            cursor: pointer;
            transition: transform 0.3s ease;
            padding: 2rem;

            &:hover {
                transform: scale(1.1);
            }
        }

        #left {
            left: 0;

            .side-nav-button {
                writing-mode: sideways-lr;
            }
        }

        #right {
            right: 0;

            .side-nav-button {
                writing-mode: sideways-rl;
            }
        }

        @media screen and (max-width: 768px) {
            --header-margin-top: 1rem;
            --header-margin-side: 1rem;

            transform: translateX(100%);
            transition: transform 0.7s ease;
            background-color: rgba(255, 255, 255, 0.7);
            backdrop-filter: blur(7px);
            display: flex;
            flex-direction: column;
            justify-content: center;
            align-items: center;

            &.open {
                transform: translateX(0);
            }

            .side-nav {
                position: static;
                width: 100%;
                height: unset;
            }

            #left {
                .side-nav-button {
                    writing-mode: unset;
                }
            }

            #right {
                .side-nav-button {
                    writing-mode: unset;
                }
            }
        }
    }
}

.vertical-nav {
    position: fixed;
    padding: 1rem;
    height: 4vh;
    max-height: 49px;
    aspect-ratio: 1/1;
    left: 50%;
    transform: translateX(-50%);
    z-index: 9;

    @media screen and (max-width: 768px) {
        display: none;
    }
}

#top {
    top: 0;

    .v-nav-button img {
        transform: translateY(1rem);
    }
}

#bottom {
    bottom: 0;

    .v-nav-button img {
        transform: rotate(180deg);
    }
}

.v-nav-button {
    display: inline-block;
    font-size: 2rem;
    text-align: center;
    line-height: 5vh;
    cursor: pointer;
    transition: transform 0.3s ease;

    &:hover {
        transform: scale(1.1);
    }

    img {
        width: 3rem;
    }
}


.progress-dots {
    position: fixed;
    left: 50%;
    bottom: 1rem;
    flex-direction: row;
    transform: translateX(-50%);
    display: none;

    @media screen and (max-width: 768px) {
        display: flex;
    }

    .dot {
        transition: 0.3s background-color ease 0.2s;
        margin: 0 0.25rem;
        background-color: rgba(0, 0, 0, 0.5);
        border: solid 1px rgba(0, 0, 0, 0.2);
        height: 11px;
        aspect-ratio: 1/1;
        border-radius: 50%;
        pointer-events: all;
        cursor: pointer;
        mix-blend-mode: exclusion;

        &.active {
            background-color: rgba(255, 255, 255, 0.5);
            box-shadow: 0px 0px 3px black;
        }
    }
}

/* #endregion */

/* #region active */

.active {
    .perspective {
        pointer-events: none;

        * {
            pointer-events: all;
        }
    }

    .name-wrapper {
        opacity: 1;
        transform: translateY(0%) scale(1);
    }

    .project-image {
        pointer-events: all;
    }
}

/* #endregion */

/* #region Animations */
.fade-out {
    animation: fadeOut 300ms ease forwards;
}

.fade-in {
    animation: fadeIn 500ms ease forwards 300ms;
}

.animate-in {
    animation: animateIn 0.3s ease forwards 0.5s;
}

@keyframes animateIn {
    from {
        opacity: 0;
        transform: translateY(70%) scale(0.85);
    }

    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

@keyframes fadeOut {
    from {
        opacity: 1;
    }

    to {
        opacity: 0;
    }
}

@keyframes scaleUp {
    from {
        transform: scale(0.9);
    }

    to {
        transform: scale(1);
    }

}

/* #endregion */