@import url("./common.css");

:root {
    --block-shadow: oklab(42% 0.03 0.09);
    --further-explore-bg: hsl(65deg 100% 85% / 20%);
    --further-explore-header-hover: hsl(240deg 80% 50%);
    --further-explore-header-active: hsl(240deg 40% 50%);
    --further-explore-headerimg-hover: brightness(0.75);
    --hover-alt-page-filter: brightness(0.75);
    --hover-highlighted-section-filter: brightness(0.5);
}

@media screen and (prefers-color-scheme: dark) {
    :root {
        --block-shadow: hsl(260deg 40% 40%);
        --further-explore-bg: hsl(180deg 45% 30% / 20%);
        --further-explore-header-hover: hsl(240deg 60% 65%);
        --further-explore-header-active: hsl(240deg 30% 65%);
        --further-explore-headerimg-hover: invert(1);
        --hover-alt-page-filter: brightness(1.25);
        --hover-highlighted-section-filter: brightness(2);
    }
}

body {
    padding-top: 0;
    background-color: var(--void-bg);
}

main, footer {
    background-color: var(--main-color-bg);
    max-width: 1216px;

    @media screen and (width > 1216px) {
        /* Portion of the empty space */
        margin-left: calc(0.2 * calc(100% - 1216px));
        box-shadow:  6px 0 6px -6px rgb(0 0 0 / 50%) inset,
                    -6px 0 6px -6px rgb(0 0 0 / 50%) inset;

    }
}

#showcase-buttons {
    margin-top: 2em;
    margin-bottom: 2em;
}

hero {
    display: block;
    margin: 0;
    width: 100%;
    overflow: hidden;
    aspect-ratio: 2;
    font-size: 5vw;
    background-size: 120%;
    background-repeat: no-repeat;
    background-position-y: 8%;
    background-position-x: left;
    box-shadow: inset 11em 0 1em 0 hsl(0deg 0% 0% / 50%);

    & p {
        color: transparent;
        background: radial-gradient(circle, hsl(193deg 100% 74%) 0%, hsl(55deg 100% 54%) 100%);
        -webkit-background-clip: text;
        background-clip: text;
        text-shadow: none;
        padding-left: 0.5em;
    }

    & p:last-of-type {
        margin-bottom: 0;
    }

    & .nag-arrow {
        width: fit-content;
        position: relative;
        z-index: 0;

        &.bounce {
            animation: bouncing 500ms infinite 1s ease;

            &::after {
                content: '';
                display: block;
                position: absolute;
                top: 0;
                left: 3em;
                z-index: 1;
                width: 0;
                height: 0;
                border-style: solid;
                border-width: 0.25em 0.35em 0;
                border-color: white transparent transparent;
            }
        }
    }
}

main {
    display: flex;
    flex-flow: column;
    flex-wrap: nowrap;
    font-size: 1em;
    padding: 0 2em 3em;

    & p {
        margin-top: 0;
        margin-bottom: 1em;
        line-height: 1.25em;

        &.attach-next {
            margin-bottom: 0.125em;
        }
    }

    & ul {
        margin-top: 0.125em;
    }

    & h2, & h3, & h4 {
        margin-bottom: 1mm;
        margin-top: 0.5em;

        & symbol,
        img.icon {
            margin-right: 0.25em;
        }
    }

    & section {
        margin-left: 1em;

        & h2, & h3, & h4 {
            margin-bottom: 0.5em;

            & symbol,
            img.icon {
                margin-left: -1.6em;
            }
        }
    }


    & h2 + h3, & h3 + h4 {
        margin-top: 2mm;
    }

    & a, & a:any-link, & a:hover {
        text-decoration: none;

        & h2, & h3, & h4, & h5, & h6 {
            color: inherit;
        }
    }

    & h2, & h3, & h4, & h5, & h6 {
        & a, & a:any-link, & a:hover {
            color: inherit;
        }

        & symbol,
        img.icon {
            height: 1em;
            aspect-ratio: 1;
            font-size: 1em;
            text-shadow: none;
        }
    }

    & .external-symbol {
        height: 0.75em;
        vertical-align: middle;
        margin: -0.1em;
    }

    & :hover {
        & > .external-symbol {
            border-style: solid;
            border-width: 0 0 2px 2px;
            border-color: var(--main-a-hover-color);
        }
    }

    & .two-columns {
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 2em;

        @media (width < 640px) {
            grid-template-columns: 1fr;
            gap: 1em;
        }
    }

    & .highlighted-section {
        display: block;
        height: calc(100% - 1.5em);
        margin-top: 0.5em;
        padding: 0 1em 0.5em;
        background-color: var(--further-explore-bg);
        border: 2px solid var(--block-shadow);
        border-radius: 8px;
        transition: filter 300ms ease-out;

        &:hover{
            filter: var(--hover-highlighted-section-filter);
        }

        &, &:link, &:hover, &:focus {
            color: unset;
        }

        &:hover, &:focus {
            & h3 {
                color: var(--further-explore-header-hover);

                & img {
                    filter: var(--further-explore-headerimg-hover);
                }
            }
        }

        &:active {
            border-color: var(--main-a-active-color);

            & h3 {
                color: var(--further-explore-header-active);
            }
        }

        & h3 {
            margin-top: 0.6em;
        }

        & p {
            text-decoration: none;
            color: inherit;
        }
    }

    & > ul {
        list-style: none;
        margin: 0;
        padding: 0;
        display: flex;
        justify-content: space-around;
    }

    & #alt-pages {
        gap: 1em;
        flex-wrap: nowrap;

        @media (width < 640px) {
            flex-wrap: wrap;
        }

        & > * {
            @media (width < 640px) {
                width: 100%;
            }
        }

        & li {
            aspect-ratio: calc(4 / 3);
            height: 16em;
            display: block;
            max-height: 20vw;
            background-size: 100%;
            background-repeat: no-repeat;
            background-position: 25% center;
            border-radius: 8px;
            position: relative;
            overflow: hidden;
            border: 4px solid var(--block-shadow);
            transition: border-bottom-width 300ms ease, margin-top 300ms ease, background-size 500ms ease, filter 300ms ease-out;

            &:hover {
                background-size: 110%;
                filter: var(--hover-alt-page-filter);
            }

            @media (width < 640px) {
                height: 6em;
                max-height: unset;
                aspect-ratio: unset;
                width: 100%;
                border-radius: 0 8px 8px 0;
                border-width: 0;
                background-position-x: right;
                background-position-y: 50%;
                background-size: 55%;

                &:hover {
                    background-size: 60%;
                }
            }

            & h3, p {
                text-align: center;
                background-color: var(--main-color-nav-bg);
                color: var(--main-color-nav-text) !important;

                @media (width < 640px) {
                    width: 50%;
                }
            }

            & h3 {
                margin-top: 0;

                @media (width < 640px) {
                    height: 40%;
                }
            }

            & p {
                position: absolute;
                bottom: -1em;
                left: 0;
                right: 0;
                padding-bottom: 0.5em;

                @media (width < 640px) {
                    height: 60%;
                    padding-bottom: 0.25em;
                }
            }
        }
    }

    & ul.socials {
        list-style: none;
        display: flex;
        flex-flow: row;
        justify-content: space-around;

        & li {
            border: none;

            @media (width < 640px) {
                height: fit-content;
            }

            & a:any-link {
                color: inherit;

                & svg {
                    height: 8em;
                    min-height: 100%;
                    aspect-ratio: calc(4 / 3);
                    color: var(--main-color-text);

                    @media (width < 640px) {
                        height: 4em;
                    }

                    &:hover {
                        color: var(--main-a-hover-color);
                    }
                }
            }
        }

    }
}

footer {
    padding: 2em;
    text-align: center;
}
