body {
    display: flex;
    flex-direction: column;
    padding-top: 2rem;
    padding-bottom: 2rem;
    gap: 3rem;
}

header {
    display: grid;
    grid-template-columns: repeat(3, auto);
    grid-template-rows: 1fr;

    padding: 0 3rem;

    @media screen and (max-width: 992px) {
        grid-template-columns: repeat(2, auto);
        grid-template-rows: repeat(2, auto);
        padding: 2rem 3rem 1rem;
    }

    #header__home {
        grid-area: 1 / 1 / 2 / 2;
        width: 7.5rem;

        @media screen and (max-width: 992px) {
            grid-area: 2 / 1 / 3 / 2;
            justify-self: center;
        }

        svg {
            fill: var(--background-color);
            filter: drop-shadow(0px 6px 3px var(--shadow-color));
            transition: fill 0.3s ease-in-out;
        }

        &:hover {
            svg {
                fill: var(--accent-color);
            }
        }
    }

    #header__title {
        grid-area: 1 / 1 / 2 / 4;

        align-self: center;
        text-align: center;

        @media screen and (max-width: 992px) {
            grid-area: 1 / 1 / 2 / 3;
        }
    }

    #header__toggle {
        grid-area: 1 / 3 / 2 / 4;
        align-self: center;
        justify-self: flex-end;
        height: 5rem;
        aspect-ratio: 1;
        box-shadow: 0 6px 10px 0 var(--shadow-color);

        @media screen and (max-width: 992px) {
            grid-area: 2 / 2 / 3 / 3;
            justify-self: center;
        }
    }

    label.theme-toggle {
        display: grid;
        align-items: center;
        grid-template-areas: "toggle";

        cursor: pointer;
        border-radius: 50%;
        background-color: var(--background-color);
        fill: var(--text-color);
        padding: 1rem;

        input {
            position: absolute;
            display: none;
        }

        svg {
            grid-area: toggle;
            transition: opacity 1s ease-in-out;
        }

        .theme-toggle--dark {
            visibility: hidden;
            opacity: 0;
        }

        .theme-toggle--light {
            visibility: visible;
            opacity: 1;
        }

        &:has(input:checked) {
            .theme-toggle--dark {
                visibility: visible;
                opacity: 1;
            }

            .theme-toggle--light {
                visibility: hidden;
                opacity: 0;
            }
        }
    }
}

header, section, footer {
    border-radius: 30px;
    box-shadow: 0 6px 10px 0 rgba(0, 0, 0, 0.5);
    padding: 0 3rem;

    color: var(--background-color);
    background-color: var(--text-color);
}

#accueil {
    display: flex;
    flex-direction: column;
    gap: 20px;
    padding: 0;

    @media screen and (min-width: 992px) {
        display: grid;
        grid-template-columns: repeat(5, 1fr);
        grid-template-rows: repeat(4, auto);
    }

    section {
        display: flex;
        flex-direction: column;
        position: relative;
        /*grid-template-rows: min-content 1fr min-content;*/
        color: var(--text-color);
        background-color: var(--primary-color);
        padding: 1.25rem;
        overflow: clip;

        h2 {
            margin-bottom: 1rem;
            padding: 1rem;
        }

        > a {
            align-self: flex-end;
        }

        > div {
            flex: 1;

            > p:not(:last-child) {
                margin-bottom: 2rem;
            }
        }

        * {
            z-index: 1;
        }

        &::before {
            content: "";
            position: absolute;
            width: 100%;
            height: 100%;
            top: 0;
            left: 0;
            opacity: 0.15;
            background-repeat: no-repeat;
            background-size: cover;
            background-position: center;
        }
    }

    #about {
        background-color: var(--accent-color);

        &::before {
            background-image: url(../../assets/background/cubes.svg);
        }
    }

    #projects {
        background-color: var(--secondary-color);

        &::before {
            opacity: .6;
            background-image: url(../../assets/background/triangles.svg);
        }
    }

    #creations {
        background-color: var(--background-color);

        &::before {
            background-image: url(../../assets/background/sparkles.svg);
        }
    }

    #cv {
        background-color: var(--primary-color);

        &::before {
            background-image: url(../../assets/background/waves.svg);
        }
    }

    #contact {
        color: var(--background-color);
        background-color: var(--text-color);

        &::before {
            opacity: 1;
            background-image: url(../background/squares.svg);
            background-position: center;
        }
    }

    @media screen and (min-width: 992px) {
        #about {
            grid-area: 1 / 1 / 3 / 4;
        }

        #projects {
            grid-area: 1 / 4 / 4 / 6;
        }

        #creations {
            grid-area: 3 / 1 / 5 / 3;
        }

        #cv {
            grid-area: 3 / 3 / 5 / 4;
        }

        #contact {
            grid-area: 4 / 4 / 5 / 6;
        }
    }

    #contact {
        grid-area: 4 / 4 / 5 / 6;

        div {
            margin: 0 auto;
            display: flex;
            justify-content: space-between;
            gap: 20px;
        }
    }
}

[data-theme="dark"] #accueil {
    #about {
        background-color: lch(from var(--accent-color) calc(l - 20) c h);;

        &::before {
        }
    }

    #projects {
        &::before {
            filter: brightness(0.7);
        }
    }

    #creations {
        border: 1px solid var(--text-color);

        &::before {
            opacity: .6;
        }
    }

    #cv {
        &::before {
            filter: invert();
        }
    }

    #contact {
        &::before {
            opacity: 1;
        }
    }
}

footer {
    padding: 1rem 3rem;
}