:root {
    /* color variables */
    --black: #1D201F;
    --white: #fff;
    --offwhite: #d2d2d2;
    --light-gray: #f2f2f2;
    --dark-gray: #333;
    --gray: #5a5a5a;
    --red: #cd5242;
    --blue: #0000ff;
    --yellow: #ffff00;
    --green: #8eb38e;
    --purple: #915691;

    /* breakpoints */
    --desktop: 1024px;
    --tablet: 768px;
    --mobile: 480px;

    /* easing */
    --ease-in-out: cubic-bezier(0.76, 0, 0.24, 1);
    --ease-out: cubic-bezier(0.25, 1, 0.5, 1);
}

/* basic button animation */

.animated-button {
    transition: 0.4s var(--ease-in-out);
    
}
.animated-button:hover {
    transform: scale(1.05);
}
.animated-button:active {
    transform: scale(0.95);
}

body {
    margin: 0 auto;
    box-sizing: border-box;
    background-color: var(--dark-gray);
    overflow: hidden;
    * {
        font-family: 'Satoshi', sans-serif;
        color: var(--black);
        box-sizing: border-box;
        font-size: 18px;
        @media (max-width: var(--mobile)) {
            font-size: 16px;
        }
    }
}

main {
    height: 100vh;
    width: 100vw;
}

h2 {
    font-size: 40px;
    @media (max-width: var(--tablet)) {
        font-size: 32px;
    }
    @media (max-width: var(--mobile)) {
        font-size: 28px;
    }
}

h3 {
    font-size: 32px;
    @media (max-width: var(--tablet)) {
        font-size: 24px;
    }
    @media (max-width: var(--mobile)) {
        font-size: 20px;
    }
}

/* Loader */

@keyframes show-img {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

@keyframes shrink-img {
    from {
        width: 150px;
        height: 150px;
    }
    to {
        width: 40px;
        height: 40px;
        opacity: 0;
        pointer-events: none;
    }
}

@keyframes move-bg {
    from {
        top: 0;
    }
    to {
        top: -100vh;
        pointer-events: none;
    }
}

@keyframes move-img {
  0% {
    transform: translate(0, 0);
  }
  30% {
    transform: translate(0, -20px) rotate(6deg);
  }
  65% {
    transform: translate(0, 10px) rotate(-3deg);
  }
  100% {
    transform: translate(0, 0)
  }
}

#loader {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 10;
    .loader-bg {
        position: absolute;
        width: 100vw;
        height: 100vh;
        top: 0;
        left: 0;
        background-color: var(--dark-gray);
        animation: move-bg 1s var(--ease-out) 2.8s forwards;
    }
    .loader-image {
        position: absolute;
        left: 50%;
        top: 50%;
        transform: translate(-50%, -50%);
        img {
            width: 150px;
            height: 150px;
            opacity: 0;
            border-radius: 100%;
            background-color: var(--white);
            animation: show-img 0.4s var(--ease-in-out) 0.4s forwards, shrink-img 0.6s var(--ease-in-out) 2s forwards, move-img 1.2s var(--ease-out) 0.5s forwards;
        }
    }
}
#loader.aos-animate {
    pointer-events: none;
}

/* Background Grid */

.grid-bg {
    position: fixed;
    top: 0;
    left: 0;
    width: calc(100vw + 90px);
    height: calc(100vh + 90px);
    display: grid;
    grid-template-columns: repeat(auto-fill, 30px);
    grid-template-rows: repeat(auto-fill, 30px);
    z-index: -1; /* behind all content */
    background-color: var(--light-gray);
}

.grid-bg::before {
    content: "";
    display: contents;
}

.grid-bg > * {
    width: 30px;
    height: 30px;
    border: 1px solid rgba(0, 0, 0, 0.05); /* subtle grid */
    box-sizing: border-box;
}

/* Page Content */

.hero {
    display: flex;
    flex-direction: column;
    align-items: center;
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
}

.title {
    display: flex;
    white-space: nowrap;
    text-align: center;
    font-size: 2.5rem;
    transition: width 0.4s ease;
}
.part {
    opacity: 0;
    transform: translateY(8px);
    transition: 0.6s ease;
    /* font-family: 'Boris', sans-serif !important; */
    font-size: inherit;
}
.part:not(.part1) {
    margin-left: 10px;
}
.part.show {
    transform: translateY(0);
    opacity: 1;
}








.button-wrapper {
    display: flex;
    gap: 1rem;
    justify-content: center;
    align-items: center;
    margin-top: 60px;
    .btn {
        display: flex;
        flex-direction: column;
        align-items: center;
        gap: 8px;
        cursor: pointer;
        border: unset;
        background-color: unset;
        span {
            font-size: 18px;
        }
        img {
            width: 60px;
            height: 60px;
        }
    }
}



.window {
    display: flex;
    flex-direction: column;
    position: absolute;
    /* top and left are centered by having them centered with 50% minus half the width and height */
    top: calc(50% - 300px);
    left: calc(50% - 425px);
    resize: auto;
    width: 850px;
    height: 600px;
    min-width: 650px;
    min-height: 500px;
    max-width: 100vw;
    max-height: 100vh;
    background: var(--light-gray);
    border: 2px solid var(--black);
    box-shadow: 0 4px 20px rgba(0,0,0,0.2);
    border-radius: 6px;
    overflow: hidden;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s ease, scale 0.2s ease;
    scale: 0.7;
    .window-header {
        background: var(--black);
        position: relative;
        display: flex;
        align-items: center;
        justify-content: space-between;
        padding: 10px;
        span {
            color: var(--white);
            font-size: 22px;
        }
        .close-button {
            color: var(--light-gray);
            background: var(--red);
            height: 25px;
            display: flex;
            align-items: center;
            justify-content: center;
            padding: unset;
            font-size: 24px;
            aspect-ratio: 1;
            border: unset;
            border-radius: 100%;
            cursor: pointer;
            padding-bottom: 2px;
            transition: 0.3s var(--ease-in-out);
        }
        .close-button:hover {
            background: var(--red);
        }
    }
    .window-inner {
        width: 100%;
        overflow-y: scroll;
        padding: 8% 10% 5%;
        height: calc(100% - 45px) !important;
    }
    .window-content {
        height: 100%;
        max-width: 1140px;
        margin: auto;
        h3 {
            margin-bottom: unset;
        }
        .content {
            padding-bottom: 5%;
        }
    }
}

.window-inner::-webkit-scrollbar {
    width: 8px;
}

.window-inner::-webkit-scrollbar-thumb {
    background: var(--black);
    transition: 0.4s var(--ease-in-out);
    border-radius: 120px;
}

.window-inner::-webkit-scrollbar-thumb:hover {
    background: var(--gray);
}

.window.active {
    opacity: 1;
    scale: 1;
    pointer-events: auto;
}

@media (max-width: 768px) {
    .window {
        top: auto;
        left: 0;
        bottom: 0;
        width: 100vw;
        height: 90svh;
        min-width: unset;
        min-height: unset;
        border-radius: 16px 16px 0 0;
        resize: none;
        opacity: 1;

        /* start off-screen */
        transform: translateY(100%);
        scale: 1;
        transition: transform 0.6s var(--ease-out);
    }

    .window.active {
        transform: translateY(0);
    }
}


#about-window .window-content {
    .top {
        display: flex;
        gap: 40px;
        align-items: center;
        @media (max-width: 768px) {
            flex-direction: column;
        }
        img {
            width: 20%;
            max-width: 140px;
            min-width: 100px;
            border-radius: 100%;
            border: 1px solid var(--black);
            background-color: var(--green);
        }
        .text {
            * {
                margin: unset;
            }
            h2 {
                margin-bottom: 12px;
            }
        }
    }
    .divider {
        background: var(--light-gray);
        display: block;
        width: 100%;
        height: 1px;
        margin-block: 40px;
    }
}

#work-window .window-content {
    .content {
        display: flex;
        flex-direction: column;
        gap: 60px;
        max-width: 750px;
        margin-inline: auto;
        .project {
            display: flex;
            align-items: center;
            gap: 40px;
            @media (max-width: 768px) {
                flex-direction: column;
            }
            .project-image {
                width: 45%;
                height: 250px;
                @media (max-width: 768px) {
                    width: 100%;
                }
                img {
                    width: 100%;
                    height: 100%;
                    object-fit: cover;
                    border: 2px solid var(--black);
                    border-radius: 16px;
                }
            }
            .project-info {
                width: calc(55% - 40px);
                @media (max-width: 768px) {
                    width: 100%;
                }
                .tags {
                    list-style: none;
                    margin: unset;
                    padding: unset;
                    display: flex;
                    gap: 6px 0px;
                    flex-wrap: wrap;
                    li {
                        color: var(--white);
                        background: var(--black);
                        border-radius: 18px 4px 4px 18px;
                        padding: 4px 10px;
                        font-size: 12px;
                        position: relative;
                        border: 2px solid var(--light-gray);
                        &:not(:first-of-type) {
                            margin-left: -10px;
                        }
                        &:not(:last-of-type) {
                            padding-right: 14px;
                        }
                    }
                    li[data-value="Design"] {
                        background: #915691;
                    }
                    li[data-value="Branding"] {
                        background: #b9467f;
                    }
                    li[data-value="UI/UX"] {
                        background: #569189;
                    }
                    li[data-value="Figma"] {
                        background: #ff7237;
                    }
                    li[data-value="Development"] {
                        background: #cf7c17;
                    }
                    li[data-value="Full-Stack"] {
                        background: #b13939;
                    }
                    li[data-value="WordPress"] {
                        background: #2d63d8;
                    }
                    li[data-value="Django"] {
                        background: #2f8b2f;
                    }
                    /* li::after {
                        content: '';
                        position: absolute;
                        right: -14px;
                        top: 50%;
                        transform: translateY(-50%);
                        height: calc(100% + 0px);
                        width: 20px;
                        background: var(--light-gray);
                        border-radius: 20px 0 0 20px;
                        z-index: 0;
                    } */
                    li:last-of-type {
                        border-radius: 18px;
                    }
                    li:last-of-type::after {
                        display: none;
                    }
                }
                .project-link {
                    text-decoration: none;
                    position: relative;
                    overflow: hidden;
                    display: block;
                    width: fit-content;
                    span {
                        display: block;
                        transition: 0.4s var(--ease-in-out);
                        border-radius: 200px;
                    }
                    span::before {
                        content: '→';
                        position: absolute;
                        top: 50%;
                        transform: translateY(-50%);
                        left: -20px;
                    }
                }
                .project-link::after {
                    content: '';
                    width: 0;
                    height: 1px;
                    background-color: var(--black);
                    display: block;
                    transition: 0.4s var(--ease-in-out);
                }
                .project-link:hover {
                    span {
                        transform: translateX(20px);
                    }
                }
                .project-link:hover::after {
                    width: 100%;
                }
            }
        }
    }
}

#contact-window {
    .window-inner {
        display: flex;
        flex-direction: column;
        text-align: center;
        align-items: center;
        justify-content: center;

    }
    h3 {
        margin-top: unset;
    }
    @media (min-width: 769px) {
        min-height: fit-content;
        .window-inner {
            min-height: fit-content;
        }
    }
    .gif {
        height: 220px;
        @media (max-width: 1024px) {
            height: 200px;
        }
        @media (max-width: 768px) {
            height: 180px;
        }
    }
    .email-wrapper {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        gap: 4px;
    }
    .image-wrapper {
        display: flex;
        flex-direction: column;
        align-items: center;
        height: 24px;
        overflow: hidden;
    }
    .copy-email, .copy-email-check {
        width: 24px;
        transition: 0.4s var(--ease-in-out);
        cursor: pointer;
        &.shift-up {
            transform: translateY(-24px);
        }
    }
    .social-wrapper {
        display: flex;
        align-items: center;
        justify-content: center;
        gap: 8px;
        img {
            width: 30px;
            transition: 0.4s var(--ease-in-out);
            &:hover {
                transform: translateY(-2px);
            }
        }
    }
    .toast {
        position: fixed;
        bottom: 24px;
        left: 50%;
        transform: translateX(-50%) translateY(20px);
        background: var(--black);
        color: var(--white);
        padding: 10px 14px;
        border-radius: 8px;
        font-size: 14px;
        opacity: 0;
        pointer-events: none;
        transition: all 0.25s ease;
    }

    .toast.show {
        opacity: 1;
        transform: translateX(-50%) translateY(0);
    }

}

footer {
    display: flex;
    flex-direction: column;
    align-items: center;
    position: absolute;
    left: 0;
    bottom: 0;
    width: 100%;
    gap: 12px;
    padding-bottom: 8px;
    .social-wrapper {
        display: flex;
        gap: 8px;
        img {
            width: 32px;
        }
    }
}