:root {
    --main: #ffb500;
    --white: #ffffff;
    --black: #1a1a1a;
    /**/
    --body-font-family: 'Open Sans', sans-serif;
    --title-font-family: 'Heritage-Display', sans-serif;
}

:root {
    --background: var(--black);

    --scrollbar-color-thumb: var(--main);
    --scrollbar-color-background: var(--black);

    --inner-gap: 2rem;
    --border-radius: 2rem;
    --border-gap: 1.5rem;

    --feed-width: 800px;
}

html {
    scroll-behavior: smooth;
    background: var(--background);
}

body {
    margin: 0;
    padding: 0;
    max-width: 100vw;
    min-height: 100lvh;
    color: var(--white);
    font-size: 1rem;
    font-family: var(--body-font-family);
    font-weight: 600;
    text-rendering: optimizeLegibility !important;
    -webkit-font-smoothing: antialiased !important;
}

*,
*::before,
*::after {
    box-sizing: border-box;
    scrollbar-width: thin;
    scrollbar-color: var(--scrollbar-color-thumb) var(--scrollbar-color-background);
    overscroll-behavior: contain;
}

img {
    line-height: 0;
}

p {
    margin: 0;
    line-height: 1.3;
    font-variation-settings: "wght" 450;
    font-size: 1rem;
}

a {
    color: inherit;
    text-decoration: none;
}

/* MAIN */

main {
    container: main/inline-size;
    --margin-section: 5rem;
}

.user-avatar {
    height: 12rem;
    aspect-ratio: 1/1;
    border-radius: 50%;
    user-select: none;
    overflow: hidden;

    img {
        height: 100%;
        width: 100%;
    }
}

/* PROFIL CONTAINER */

.profil {
    margin-top: var(--margin-section);
    margin-inline: var(--margin-section);

    & .username {
        font-size: 4rem;
        font-family: var(--title-font-family);
        color: color-mix(in srgb, var(--white) 100%, var(--black) 0%);
        letter-spacing: 2%;
        line-height: 6rem;
    }

    & .description {
        font-size: 1.125rem;
        color: color-mix(in srgb, var(--white) 100%, var(--black) 50%);
        letter-spacing: 2%;
    }
}

.profil-wrapper {
    position: fixed;
    top: (var(--margin-section));
    width: calc(100vw - var(--feed-width) - (var(--margin-section))*3);
}

.feed {
    margin: var(--margin-section);
    display: flex;
    justify-content: end;
}

.feed-wrapper {
    max-width: var(--feed-width);
    width: 100%;
    container-type: inline-size;
}

.feed-container {
    display: grid;
    grid-template-columns: repeat(8, 1fr);
    gap: var(--inner-gap);
    grid-auto-rows: calc((((100cqw) - 7 * var(--inner-gap)) / 8));

    & .item {
        position: relative;
        overflow: hidden;
        grid-column: var(--col) / span var(--w);
        grid-row: var(--row) / span var(--h);
    }

    & .section-title {
        margin: 0;
        display: flex;
        align-items: end;
        height: 100%;
        padding-left: 2rem;
        padding-bottom: 1rem;
        font-size: 1.25rem;
        letter-spacing: 1%;
        color: color-mix(in srgb, var(--white) 100%, var(--black) 20%);
    }

    & .image {
        display: flex;
        flex-flow: column wrap;
        background: color-mix(in srgb, var(--white) 2%, transparent 0%);
        border: solid 1px color-mix(in srgb, var(--white) 2%, transparent 0%);
        height: 100%;
        width: 100%;
        border-radius: var(--border-radius);
        overflow: hidden;

        &>img {
            height: 100%;
            width: 100%;
            object-fit: cover;
            user-select: none;
        }
    }

    & .video {
        display: flex;
        flex-flow: column wrap;
        background: color-mix(in srgb, var(--white) 2%, transparent 0%);
        border: solid 1px color-mix(in srgb, var(--white) 2%, transparent 0%);
        height: 100%;
        width: 100%;
        border-radius: var(--border-radius);
        overflow: hidden;

        &>video {
            height: 100%;
            width: 100%;
            object-fit: cover;
        }
    }

    & .widget {
        display: flex;
        flex-flow: column nowrap;
        background: color-mix(in srgb, var(--white) 1%, transparent 0%);
        border: solid 1px color-mix(in srgb, var(--white) 5%, transparent 0%);
        height: 100%;
        width: 100%;
        padding: calc(var(--border-gap));
        border-radius: var(--border-radius);
        transition: background .2s;

        &:hover {
            background: color-mix(in srgb, var(--white) 3%, transparent 0%);
        }

        &.behance {
            display: flex;
            justify-content: space-between;
            gap: 1rem;

            & .informations {
                display: flex;
                flex-flow: column wrap;
                gap: .5rem;

                & .container {
                    display: flex;
                    flex-direction: column;
                }

                & .username {
                    font-weight: 900;
                    color: color-mix(in srgb, var(--white) 100%, var(--black) 20%);
                }

                & .description {
                    font-size: .75rem;
                    color: color-mix(in srgb, var(--white) 100%, var(--black) 70%);
                }
            }

            & .projects {
                display: grid;
                grid-template-columns: repeat(3, 1fr);
                gap: 1rem;


                & .projet {
                    flex: 1;
                    aspect-ratio: 1/1;
                    border-radius: 1rem;
                    overflow: hidden;

                    img {
                        height: 100%;
                        width: 100%;
                        object-fit: cover;
                        user-select: none;
                    }
                }
            }
        }

        &.youtube {
            display: flex;
            flex-direction: row;
            justify-content: space-between;
            gap: 1rem;

            & .informations {
                display: flex;
                flex-flow: column nowrap;
                gap: .5rem;
                flex: 1;

                & .container {
                    display: flex;
                    flex-direction: column;
                    min-width: 0;
                }

                & .title {
                    font-weight: 900;
                    color: color-mix(in srgb, var(--white) 100%, var(--black) 20%);

                    line-clamp: 3;
                    display: -webkit-box;
                    -webkit-line-clamp: 3;
                    -webkit-box-orient: vertical;
                    overflow: hidden;
                }

                & .description {
                    font-size: .75rem;
                    color: color-mix(in srgb, var(--white) 100%, var(--black) 70%);
                }
            }

            & .projects {
                display: grid;
                grid-template-columns: repeat(2, 1fr);
                gap: .5rem;
                flex: 1;

                & .projet {
                    border-radius: 1rem;
                    overflow: hidden;

                    img {
                        height: 100%;
                        width: 100%;
                        object-fit: cover;
                        user-select: none;
                    }
                }
            }

            & .featured {
                flex: 1;

                & .picture {
                    height: 100%;
                    width: 100%;
                    border-radius: 1rem;
                    overflow: hidden;

                    img {
                        height: 100%;
                        width: 100%;
                        object-fit: cover;
                        user-select: none;
                    }
                }
            }
        }

        &.instagram {

            & .informations {
                display: flex;
                flex-flow: column wrap;
                gap: .5rem;
                flex: 1;

                & .container {
                    display: flex;
                    flex-direction: column;
                }

                & .title {
                    font-weight: 900;
                    color: color-mix(in srgb, var(--white) 100%, var(--black) 20%);
                    text-overflow: ellipsis;
                    white-space: nowrap;
                    overflow: hidden;
                }

                & .description {
                    font-size: .75rem;
                    color: color-mix(in srgb, var(--white) 100%, var(--black) 70%);
                    text-overflow: ellipsis;
                    white-space: nowrap;
                    overflow: hidden;
                }
            }
        }

    }

    & .link {
        display: flex;
        flex-flow: column wrap;
        background: color-mix(in srgb, var(--white) 1%, transparent 0%);
        border: solid 1px color-mix(in srgb, var(--white) 2%, transparent 0%);
        height: 100%;
        width: 100%;
        padding: 2rem;
        border-radius: var(--border-radius);
    }
}

.legal {
    margin: var(--margin-section);

    position: fixed;
    bottom: 0;
}

@container main (width<=1280px) {

    .user-avatar {
        height: 8rem;
    }
    .profil {
        --margin-section: 2rem;
        display: flex;
        justify-content: center;
    }

    .profil-wrapper {
        position: relative;
        max-width: 22rem;
        width: auto;
    }

    .feed {
        --margin-section: 1.5rem;
        --inner-gap: 1.5rem;
        justify-content: center;
    }

    .feed-wrapper {
        --feed-width: 400px;
        width: var(--feed-width);
        container-type: inline-size;
    }

    .feed-container {
        max-width: calc(var(--feed-width));
        grid-template-columns: repeat(4, 1fr);
        grid-auto-rows: calc(((100cqw) - 3 * var(--inner-gap)) / 4);
        margin-top: 10%;
        margin-bottom: 25%;

        & .item {
            grid-column: span min(var(--w), 4);
            grid-row: span var(--h);
            aspect-ratio: min(var(--w), 4)var(--w)/var(--h);
        }

        & .widget {
            &.youtube {
                & .informations {
                    & .title {
                        line-clamp: 2;
                        -webkit-line-clamp: 2;
                    }
                }
            }
        }
    }

}