:root {
    --page-max-width: 75rem;
    --color-dark: #252523;
    --color-light: #ffffff;
}

body,
html {
    margin: 0;
    padding: 0;
    color: var(--color-dark);
    min-width: 360px;
    font-family: "Archivo", serif;
    overflow-x: hidden;
}

.site {
    margin: 0 auto;
    max-width: var(--page-max-width);
}

.main-header {
    display: grid;
    grid-template-columns: 100%;
    grid-template-rows: 1fr auto auto 1fr auto;
    aspect-ratio: 1;
    
    h1 {
        grid-area: 5/1/6/2;
        color: transparent;
        margin: 0;
        font-size: 10px;
    }
    
    .title {
        img {
            width: 100%;
        }

        &.right {
            grid-area: 5/1/6/2;
            display: flex;
            transition: filter .3s ease;
        }
        
        &.left {
            display: none;
        }
    }
    
    .photo {
        display: block;
        grid-area: 1/1/6/2;
        aspect-ratio: 1;
        width: 100%;
        transition: filter .3s ease;

        &:hover {
            animation: stutter .075s ease infinite;
            ~ .title.right {
                filter: invert(1);

            }
        }
    }
    
    .fe-dev {
        --duration: 5s;
        --steps: 16;
        grid-area: 2/1/3/2;
        font-size: clamp(36px, 6vw, 72px);
        height: calc(clamp(36px, 6vw, 72px) * 1.2);
    }

    .hobby {
        --duration: 15s;
        --steps: 32;

        grid-area: 3/1/4/2;
        font-size: clamp(32px, 5vw, 64px);
        height: calc(clamp(32px, 5vw, 64px) * 1.2);
        margin-top: min(3.5vw, 75px);
    }
}

.marquee {
    position: relative;
    overflow: hidden;
}

.marquee-container {
    position: absolute;
    color: transparent;
    white-space: nowrap;
}

.marquee-content {
    position: absolute;
    left: 0;
    top: 0;
    color: var(--color-light);
    animation: marque var(--duration) steps(var(--steps), end) infinite;
    
    &:hover {
        --duration: 10s;
        --steps: 48;
    }
    
    &::before,
    &::after {
        position: absolute;
        content: attr(data-title);
        width: 100%;
        position: inline-block;
        
    }
    &::before {
        left: -100%;
    }
}

main {
    display: grid;
    grid-template-columns: 100%;
    justify-items: center;
    gap: -3rem;
    padding: 2rem 0;
}

.group-title {
    --duration: 10s;
    --steps: 16;

    height: 5rem;
    width: 20rem;
    font-family: "Notable", serif;
    font-size: 2rem;
    
    .marquee-content {
        color: var(--color-dark);

    }
}

.project {
    border: 1px solid var(--color-dark);
    display: inline-block;
    padding: .5rem 1rem 1rem;
    max-width: min(80vw, 750px);
    background-color: var(--color-light);

    header {
        font-family: "Notable", serif;
        font-size: 1.25rem;

        h2 {
            margin: 0;
        }
    }

    section {
        font-size: 1rem;
        line-height: 1.5;
    }

    &:nth-of-type(4n + 1) {
        transform: rotate(-2deg);
    }
    &:nth-of-type(4n + 2) {
        transform: rotate(3deg);
    }
    &:nth-of-type(4n + 3) {
        transform: rotate(-1deg);
    }
    &:nth-of-type(4n + 4) {
        transform: rotate(2deg);
    }
}

@media (min-width: 568px) {
    .main-header {
        grid-template-columns: 1fr min(50vw, 500px);
        grid-template-rows: repeat(4, auto) max-content;
        aspect-ratio: unset;
        height: min(50vw, 500px);

        .title {
            overflow: hidden;
            align-items: flex-end;
            overflow: hidden;
            width: 100%;
            display: flex;

            img {
                width: min(100vw, var(--page-max-width));
                flex-shrink: 0;
            }

            &.left {
                grid-area: 5/1/6/2;
                display: flex;
            }

            &.right {
                grid-area: 5/2/6/3;
                justify-content: flex-end;
            }
        }

        .fe-dev {
            width: 80%;
            margin-left: 15%;
        }

        .hobby {
            width: 90%;
        }

        .marquee-content {
            color: var(--color-dark);
        }

        .photo {
            display: block;
            width: 100%;
            grid-area: 1/2/6/3;
            aspect-ratio: 1;
        }
    }

    main {
        gap: 1.5rem;
        padding: 3rem 0;

        .group-title {
            width: 30rem;
            font-size: 1.25rem;
            font-size: 3rem;
        }    

    
        .project {
            padding: .75rem 1.5rem 1.5rem;
    
            header {
                font-size: 1.5rem;
            }
    
            section {
                font-size: 1.5rem;
            }
        }
    
    }
}

@media (min-width: 900px) {
    main {
        gap: 2rem;
        padding: 4rem 0;
    
        .project {
            padding: 1rem 2rem 2rem;
    
            header {
                font-size: 2.25rem;
            }
    
            section {
                font-size: 2rem;
            }
        }

        .group-title {
            width: 40rem;
        }    

    }

    .project {
        &:nth-of-type(1) {
            justify-self: start;
            margin-left: 3rem;
        }
        &:nth-of-type(2) {
            justify-self: end;
        }
        &:nth-of-type(3) {
            justify-self: start;
        }
        &:nth-of-type(4) {
            justify-self: end;
            margin-right: 2rem;
        }
    }

}



@keyframes marque {
  0% {
    left: 100%;
  }
  100% {
    left: 0;
  }
}

@keyframes stutter {
0% {
    transform: rotate(0deg) translate(0,0);
}
25% {
    transform: rotate(2deg) translate(-2px,2px);
}
50% {
    transform: rotate(0deg);
    filter: invert(1);
}
75% {
    transform: rotate(-2deg) translate(2px,-2px);
}
100% {
      transform: rotate(0deg) translate(0,0);
  }
}