@import url(https://fonts.bunny.net/css?family=roboto:400,500,700);

:root,
.custom-color {
    --deg: 260deg;

    /* from darkest to lightest */
    --foreground-1: hsl(var(--deg) 40% 20%);
    --foreground-2: hsl(var(--deg) 30% 35%);
    --foreground-3: hsl(var(--deg) 25% 50%);
    --foreground-4: hsl(var(--deg) 20% 60%);

    /* from lightest to darkest */
    --background-1: hsl(var(--deg) 20% 95%);
    --background-2: hsl(var(--deg) 25% 90%);
    --background-3: hsl(var(--deg) 30% 85%);
    --background-4: hsl(var(--deg) 35% 80%);
    --background-5: hsl(var(--deg) 40% 75%);

    accent-color: hsl(var(--deg) 40% 70%);
}

body {
    display: flex;
    flex-direction: row;
    justify-content: center;
    gap: 24px;
    margin: 0.75em;

    background-color: var(--background-3);
    color: var(--foreground-1);

    font-family: 'Roboto', sans-serif;
    font-size: 1.05em;
    line-height: 1.7;
}

*::selection {
    background-color: var(--foreground-4);
    color: var(--background-1);
}

#the-centerer {
    width: 200px;
}

nav {
    display: flex;
    flex-direction: column;

    min-width: 200px;
}

nav > * {
    display: flex;
    align-items: center;
    gap: 12px;

    padding: 16px 28px;
    border-radius: 64px;

    cursor: pointer;

    transition: background-color 0.2s;
}

nav > a {
    color: inherit;
    text-decoration: none;
}

nav > *[data-checked="false"]:hover,
nav > a:hover {
    background-color: var(--background-4);
}

nav > *[data-checked="true"] {
    background-color: var(--background-5);
}

nav > *[data-checked="true"] > .material-icons-outlined {
    font-family: "Material Icons";
}

input[type='radio'][name='nav'] {
    display: none;
}

input[type='radio'][name='nav']:not(:checked) + main {
    display: none;
}

main {
    display: flex;
    flex-direction: column;
    gap: 0.75em;
    max-width: 100%;
}

section {
    min-width: 35em;
    max-width: 35em;

    background-color: var(--background-1);

    padding: 24px 32px;
    border-radius: 16px;
}

section > *:first-child {
    margin-top: 0;
    padding-top: 0;
}

section > *:last-child {
    margin-bottom: 0;
    padding-bottom: 0;
}

section.title {
    background-color: transparent;
    text-align: center;
}

section.title h1 {
    font-size: 2em;
}

h1,
h2,
h3 {
    font-weight: normal;
}

p {
    overflow-wrap: break-word;
}

main a,
section label {
    color: var(--foreground-3);
    transition: color 0.1s;
    text-decoration: underline;
    cursor: pointer;
}

main a:hover,
section label:hover {
    color: var(--foreground-2);
}

.badge {
    display: inline-flex;
    flex-direction: row;
    align-items: center;
    gap: 0.5em;
    width: fit-content;

    padding: 0.5em 1em;

    border: 2px solid var(--foreground-4);
    border-radius: 0.5em;

    color: var(--foreground-1);
    font-weight: bold;
    font-size: 1rem;
}

a.badge {
    text-decoration: none;
    user-select: none;

    transition: background-color 0.1s;
}

a.badge:hover {
    background-color: var(--background-4);
}

.theme-button {
    all: unset;

    width: 3em;
    height: 3em;
    color: transparent;
    user-select: none;

    border: 0.25em solid #0001;
    border-radius: 1em;
    background-clip: border-box;

    cursor: pointer;

    transition: transform 0.1s;
}

.theme-button:hover {
    transform: scale(110%);
}

/* stops the icons going haywire if the font hasnt loaded */
.material-icons,
.material-icons-outlined {
    max-width: 1em;
}

@media (prefers-color-scheme: dark) {

    :root,
    .custom-color {
        /* from lightest to darkest */
        --foreground-1: hsl(var(--deg) 10% 90%);
        --foreground-2: hsl(var(--deg) 20% 80%);
        --foreground-3: hsl(var(--deg) 30% 70%);
        --foreground-4: hsl(var(--deg) 40% 60%);

        /* from darkest to lightest */
        --background-1: hsl(var(--deg) 20% 15%);
        --background-2: hsl(var(--deg) 25% 25%);
        --background-3: hsl(var(--deg) 30% 30%);
        --background-4: hsl(var(--deg) 32% 35%);
        --background-5: hsl(var(--deg) 35% 45%);

        accent-color: hsl(var(--deg) 15% 25%);
    }

    body {
        background-color: var(--background-1);
    }

    section {
        background-color: var(--background-2);
    }

    nav > *[data-checked="false"]:hover,
    nav > a:hover {
        background-color: var(--background-3);
    }

    a.badge:hover {
        background-color: var(--background-2);
        color: var(--foreground-1);
    }
}

@media (max-width: 480px) {
    body {
        margin-bottom: 5em;
    }

    main {
        width: 100%;
    }

    section {
        min-width: unset;
    }

    nav {
        flex-direction: row;
        justify-content: space-around;
        gap: 1.2em;

        box-sizing: border-box;
        padding: 0.4em 1.2em;
        overflow-x: scroll;
        z-index: 100;

        position: fixed;
        bottom: 0;
        left: 0;
        min-width: 100%;

        background-color: var(--background-2);
        font-size: 0.9em;
    }

    nav > * {
        width: fit-content;
        padding: 0;

        background-color: transparent !important;

        flex-direction: column;
        align-items: center;
        gap: 0.15em;
        flex: 1 1 0;
    }

    nav .material-icons-outlined {
        padding: 0.15em 0;
        font-size: 1.8em;
        border-radius: 1.8em;

        transition: background-color 0.2s, padding 0.2s;
    }

    nav > *[data-checked="true"] > .material-icons-outlined {
        background-color: var(--background-4);
        padding-left: 0.75em;
        padding-right: 0.75em;
    }

    #the-centerer {
        display: none;
    }

    @media (prefers-color-scheme: dark) {
        nav {
            background-color: var(--background-3);
        }

        nav > *[data-checked="true"] > .material-icons-outlined {
            background-color: var(--background-5);
        }
    }
}