:root {
    interpolate-size: allow-keywords;
    --purpose-color: #a4c4b7;
    --purpose-accent: #74a491;
    --curiosity-color: #f2bc71;
    --curiosity-accent: #ec9a2c;
    --creativity-color: #e26d5a;
    --creativity-accent: #db4b33;
    --empathy-color: #4ca1af;
    --empathy-accent: #3c818c;
    --french-vanilla-color: #ede0be;
    --light-background: #ffffeb;
    --dark-background: #412f30;
    --featured-web-tech-color: #f16529;
    --angle: 45deg;
    --opacity: 0.5;
}

html {
    height: 100%;
    -webkit-text-size-adjust: 100%;
    text-size-adjust: 100%;
}

body {
    display: grid;
    grid-template-rows: 0.5fr 7fr 0.5fr;
    grid-template-rows: auto 7fr auto;
    width: 100vw;
    max-width: 100vw;
    overflow: hidden;
    height: 100vh;
    height: calc(var(--vh, 1vh) * 100);
    font-family: seitu-variable, sans-serif;
    font-size: 16px;
    background-color: var(--light-background);

    &.loading {
        opacity: 0;
        transition: opacity 1s ease;
    }

    &:not(.loading) {
        opacity: 1;
        transition: opacity 1s ease;
    }

    & > * {
        user-select: none;
    }

    & > header,
    & > footer {
        container-type: inline-size;
        container-name: footer;
        grid-column: 1 / 6;
        z-index: 100;
        height: 100%;

        & > nav {
            width: 100%;
            height: 100%;
            padding-left: clamp(1em, 2cqi, 3em);
            padding-right: clamp(1em, 2cqi, 3em);

            & > ul {
                display: flex;
                flex-flow: row nowrap;
                justify-content: space-between;
                align-items: center;
                height: 100%;

                & li {
                    display: flex;
                    justify-content: center;
                    align-items: stretch;
                    width: 10ch;
                    margin: 0.25em 0;
                    font-size: clamp(1rem, 2cqw, 2rem);
                    text-transform: lowercase;
                    white-space: nowrap;

                    &.current-section {
                        color: var(--light-background);
                        background-color: var(--creativity-color);
                        border: 0.125em solid #db4b33;
                        border-radius: 9999px;
                        pointer-events: none;
                        transition: background-color 0.5s ease, color 0.5s ease;

                        & > a {
                            padding-top: 0.3rem;
                            color: var(--light-background);

                            &[href="#resume"] {
                                & span {
                                    & img[src$="download_resume_color.svg"] {
                                        display: none;
                                    }

                                    & img[src$="download_resume.svg"] {
                                        display: inline;
                                    }
                                }
                            }
                        }

                        &:has(a[href="#resume"]) {
                            & > a {
                                &::before,
                                &::after {
                                    height: 0;
                                }

                                & > span:first-child {
                                    border-right-color: var(--light-background);
                                }

                                & > span:last-child {
                                    pointer-events: auto;
                                }
                            }
                        }
                    }

                    & a {
                        display: inline-block;
                        position: relative;
                        height: 100%;
                        padding: 0.5rem 0;
                        font-weight: 500;
                        font-variation-settings: "wght" 500;
                        text-align: center;
                        text-decoration: none;
                        transition: border 0.2s ease;

                        &::before,
                        &::after {
                            content: "";
                            position: absolute;
                            top: 5px;
                            left: 0;
                            width: 100%;
                            height: 0.125em;
                            transform-origin: left;
                            transform: scaleX(0);
                            transition: transform 0.4s ease;
                        }

                        &::after {
                            top: auto;
                            bottom: 0;
                        }

                        &:hover::before,
                        &:hover::after {
                            transform: scaleX(1);
                        }

                        &[href="#resume"] {
                            display: flex;
                            align-items: center;

                            & span {
                                &:first-child {
                                    display: inline-block;
                                    height: 100%;
                                    padding-right: 0.35em;
                                    border-right: 2px solid var(--creativity-color);
                                }

                                &:last-child {
                                    padding-left: 0.35em;
                                }

                                & img {
                                    width: clamp(1.5rem, 2cqmin, 2.25rem);
                                    height: auto;
                                    padding-top: 0.2em;

                                    &[src$="download_resume.svg"] {
                                        display: none;
                                    }
                                }
                            }
                        }
                    }
                }
            }
        }
    }

    & > header {
        grid-row: 1;
        border-bottom: 1cqh solid var(--empathy-color);

        & nav {
            & ul {
                & li a {
                    color: var(--creativity-color);

                    &::before,
                    &::after {
                        background-color: var(--creativity-color);
                    }
                }
            }
        }
    }

    & > footer {
        grid-row: 3;
        border-top: 1cqh solid var(--curiosity-color);
        border-bottom-left-radius: 2.5% 40%;
        border-bottom-right-radius: 2.5% 40%;

        & nav {
            padding-top: clamp(0.25cqb, 0.5cqb, 0.75cqb);

            & ul li a {
                color: var(--creativity-color);

                &::before,
                &::after {
                    background-color: var(--creativity-color);
                }
            }
        }
    }

    & div.sidebar {
        position: fixed;
        height: 100vh;

        &:last-of-type {
            right: 0;
        }

        & svg {
            display: none;
            position: fixed;
            z-index: 1000;
            height: auto;
            fill: var(--curiosity-color);
            background-color: var(--creativity-color);
            border-radius: 50%;
            cursor: pointer;
        }
    }

    & > main {
        grid-row: 2;
        grid-column: 1 / 6;
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: flex-start;
        height: 100%;
        overflow: visible auto;
        scroll-snap-type: y mandatory;
        scroll-behavior: smooth;
        scrollbar-width: none;
        -ms-overflow-style: none;
        background-color: var(--dark-background);

        &::-webkit-scrollbar {
            display: none;
        }

        & > section {
            flex: 0 0 100%;
            width: 80%;
            max-height: 100%;
            display: flex;
            flex-direction: column;
            justify-content: center;
            overflow-x: visible;
            scroll-snap-align: start;
        }
    }
}

@container header (max-height: 59px) {
    body > header > h1 > span {
        font-size: clamp(2rem, 4cqw, 3.5rem);
    }
}

#admin-trigger {
    position: fixed;
    right: 0;
    bottom: 0;
    z-index: 1000;
    padding: 0 0.25rem 0.25rem 0;

    & img {
        width: calc(1.5vw + 2vh);
        height: auto;
        opacity: 0;
        transition: opacity 0.3s ease;

        &.visible {
            opacity: 1;
        }
    }
}

#debug-device-types {
    align-self: flex-start;
    display: flex;
    position: absolute;
    bottom: 0;
    left: 0;
    margin: 0 0 10px 10px;
    transform: rotate(45deg);

    & > div {
        display: none;
        display: none;
        justify-content: center;
        align-items: center;
        width: clamp(24px, 1.5cqw, 64px);
        height: clamp(24px, 1.5cqw, 64px);
        color: white;
        border: 2px solid white;

        & > span {
            transform: rotate(-45deg);
        }

        &.current-device {
            display: flex;
        }
    }

    &:has(> div#phone.current-device) {
        background-color: red;
        border: 2px solid red;
    }
    &:has(> div#tablet.current-device) {
        background-color: orange;
        border: 2px solid orange;
    }
    &:has(> div#laptop.current-device) {
        background-color: blue;
        border: 2px solid blue;
    }
    &:has(> div#desktop.current-device) {
        background-color: green;
        border: 2px solid green;
    }
}

#debug-media-queries {
    position: absolute;
    bottom: 0;
    right: 0;
    align-self: flex-end;
    display: flex;
    margin-left: auto;

    & > * {
        display: none;
        justify-content: center;
        align-items: center;
        width: clamp(24px, 2.5cqw, 64px);
        height: clamp(24px, 2.5cqw, 64px);
        font-size: clamp(12px, 1.5cqw, 16px);
        border-radius: 50%;
    }
}
