:root {
    --line-thickness: 2px;
}

html, body {
    min-width: 100%;
    min-height: 100%;
}
body {
    background: linear-gradient(to bottom, #00230E 0%, #001207 50%, black 100%);
    color: white;
    font: 2rem Copenhagen, serif;

    margin: 0;
    text-align: center;
    overflow: auto;
}

img {
    background: transparent;
}

nav {
    width: 100%;
    height: 100%;
    background: #0008;
    font-size: 2rem;

    display: flex;
    flex-direction: row;
    justify-content: space-evenly;
    gap: 2rem;
    align-items: flex-end;
    box-sizing: border-box;

    border-bottom: var(--line-thickness) solid currentColor;

    a {
        padding: 2rem 0;
        display: grid;
    }
}

@media only screen and (max-width: 30rem) {
    nav {
        flex-direction: column;
        align-items: center;
        gap: 1rem;
    }
}

a:not(.nostyle) {
    color: white;
    text-decoration: none;
    display: inline-grid;
    grid-template-rows: 1fr max-content;

    &::after {
        content: "";

        width: 0%;
        height: var(--line-thickness);
        margin-top: 0.3rem;

        position: relative;
        left: 50%;

        background: #fff;
        transition: width 0.2s ease-out, left 0.2s ease-out;
    }

    &:hover::after {
        width: 60%;
        left: 20%;
    }

    &.current::after {
        width: 100%;
        left: 0%;
    }

    &.rightline {
        &::after {
            left: 100%;
        }
    
        &:hover::after {
            left: 0%;
            width: 100%;
        }
    }
}

section, article {
    &:not(:last-child) {
        border-bottom: var(--line-thickness) solid currentColor;
    }
}

ul.nobullets {
    padding: 0;
    list-style: none;

    li {
        padding-right: 10%;
    }
}

.external-link {
    border: var(--line-thickness) solid #fff;
    padding: 0.1rem 0.5rem;
    border-radius: 1em;
    background: #000;
    box-sizing: border-box;
    color: inherit;
    text-decoration: none;

    overflow: hidden;

    &::after {
        margin: 0;
    }

    &:hover::after {
        width: 100%;
        left: 0%;
    }
}

#copied-popup {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;

    z-index: 2;

    display: flex;
    justify-content: center;

    &:not(.show) {
        pointer-events: none;
    }

    & > div {
        position: relative;
        top: -10rem;
        padding: 0.5rem 2rem;
        background: #000;
        box-shadow: 0 0.5rem 1rem #000;

        border: var(--line-thickness) solid currentColor;
        border-radius: 1em;
    
        transition: top 0.5s ease;
    }

    &.show {
        & > div {
            top: 1rem;
        }
    }
}

@media only screen and (min-width: 30rem) {
    .page[data-name="404"] > section > div {
        grid-template-columns: minmax(auto, 48rem) minmax(auto, 24rem);
        img {
            width: 100%;
        }
    }
}

@media only screen and (max-width: 30rem) {
    .page[data-name="404"] > section > div {
        grid-template-rows: minmax(auto, 48rem) minmax(auto, 24rem);
        img {
            display: none;
        }
    }
}

.cardview {
    display: flex;
    flex-direction: row;
    flex-wrap: wrap;

    .card {
        width: 16rem;
        height: 12rem;
        border: var(--line-thickness) solid #fff;
    }
}

.with-background {
    display: grid;
    & > .background {
        grid-area: 1/1/2/2;
        width: 100%;
    }
    & > .content {
        grid-area: 1/1/2/2;
        z-index: 1;
    }
}

dfn, abbr {
    &:hover {
        cursor: help;
    }
}

dfn {
    text-decoration: underline dotted;
}

[data-name="projects"] {
    article {
        .content {
            margin: 4rem 0;
        }
    }
}

[data-name="gallery"] {
    .content {
        display: flex;
        flex-direction: row;
        flex-wrap: wrap;
        justify-content: space-evenly;
        gap: 1rem;
        padding: 1rem;
        box-sizing: border-box;

        .gallery-image {
            position: relative;
            flex-grow: 1;
            min-width: max(30vw, 360px);
            max-width: max(1000px, 50vw);

            cursor: pointer;
            user-select: none;

            display: grid;

            .contain {
                outline: var(--line-thickness) solid currentColor;

                display: flex;
                flex-direction: column;
                align-items: center;

                img {
                    width: 100%;
                }
            }
            .description-box {
                position: absolute;
                width: 100%;
                height: 100%;
                
                pointer-events: none;

                display: flex;
                flex-direction: column;
                justify-content: end;
                font-size: 1.5rem;
                bottom: 0;
                padding-bottom: 0.5rem;

                text-wrap: balance;
                
                transition: background 0.5s ease-out;

                p {
                    transition: opacity 0.1s ease-out;
                    margin: 0;
                    bottom: 0;
                    text-shadow: 0 0 0.75rem #000, 0 0 0.5rem #000, 0 0 0.25rem #000;
                }
            }

            &:hover, &:focus {
                .description-box {
                    background: linear-gradient(to top, #000 0, transparent 100%);

                    p {
                        opacity: 1;
                    }
                    p.minor {
                        opacity: 0.5;
                    }
                }
            }
            &:not(:hover):not(:focus) {
                .description-box {
                    background: linear-gradient(to top, transparent 0, transparent 100%);

                    p {
                        opacity: 0;
                    }
                }
            }
        }
        .load-more {
            width: 100%;

            button {
                font: inherit;
                font-size: 4rem;
                background: #00230E;
                color: inherit;

                padding: 0 2rem;
                border: var(--line-thickness) solid currentColor;

                cursor: pointer;
            }
        }
    }
}

#replacedbackground {
    width: 100%;
    height: 100%;
    background: linear-gradient(to right, transparent 50%, #0004 50%), linear-gradient(to bottom, #0002 50%, #0000);
    background-size: 1rem 100%;
}

#home-links {
    display: flex;
    justify-content: center;
    flex-direction: row;
    flex-wrap: wrap;
    gap: 0.5rem;

    width: 100%;

    & > div {

        img, iframe {
            height: 4rem;
        }
    }
}