:root {
    --controlcolor: hsl(168, 62.4%, 58.2%);
    --controlbackgroundcolor: rgb(26, 65, 83);
    --backgroundcolor: rgba(12, 18, 32, 0.8);
    --solidbackgroundcolor: rgba(12, 18, 32);
    --bodycolor: rgb(204, 217, 204);

    -ms-overflow-style: none !important;
}

*::-webkit-scrollbar {
    display: none;
}

#background {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: -1;

    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;

    background-color: var(--backgroundcolor);
    background-blend-mode: overlay;

    margin: 0;
    padding: 0;
    transform: translateZ(0); /* Force hardware acceleration */
    -webkit-backface-visibility: hidden; /* Fix for Safari */
}

html {
    font-family: -apple-system, BlinkMacSystemFont, avenir next, avenir, segoe ui, helvetica neue, Cantarell, Ubuntu, roboto, noto, helvetica, arial, sans-serif;


    h1 {
        text-align: center;
        font-size: 160%;
    }

    h1,
    h2,
    h3 {
        color: inherit;
        font-family: Iowan Old Style, Apple Garamond, Baskerville, Times New Roman, Droid Serif, Times, Source Serif Pro, serif, Apple Color Emoji, Segoe UI Emoji, Segoe UI Symbol;
    }

    table {
        width: 100%;
        border-collapse: collapse;
        table-layout: auto;
    }

}

body {
    overflow: hidden;
    display: flex;
    flex-direction: column;
    min-width: none;
    height: 100svh;
    max-height: 100vh;
    color: var(--bodycolor);
    animation: fadeInUp 0.2s;
    scrollbar-width: none !important;
    margin: 0;
}

#app {
    width: min(100vw, 47rem);
    margin: 0 auto;
    overflow-y: auto;
    overflow-x: auto;
    scrollbar-width: none;

    /* Grid layout */
    display: grid;
    grid-template-areas:
        "navigation-top"
        "main-content"
        "navigation-bottom";
    grid-template-rows: auto 1fr auto;
    height: 100vh;
}

main {
    grid-area: main-content;
    flex: 1;
    overflow: auto;
    scrollbar-width: none;
    font-size: clamp(1rem, 0.5vw + 0.9rem, 1.25rem);
    position: relative;
}



#modal {
    box-sizing: border-box;
    display: flex;
    justify-content: center;
    align-items: center;
    overflow-y: auto;
    z-index: 3;
    padding: 3em;

    .content {
        margin: 0.5em;
        max-height: 100%;
        max-width: 40em;
        margin: auto;
        background-color: var(--solidbackgroundcolor);
        border: 1px solid;
        border-radius: 0.5em;
        box-shadow: 0 0 1.5em 1em var(--controlcolor);
        padding: 1em;
    }
}

#modal ~ * {
    display: none;
}



nav {
    grid-area: navigation-top;
    padding: 0.5em;
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    color: var(--controlcolor);
    width: 100%;
    margin: 0;
    padding: 0;

    a {
        color: inherit;
        text-decoration: none;
    }

    :link>linktext {
        color: inherit;
    }

    button {
        padding: 0;
        margin: 0;
        font: inherit;
        color: inherit;
        text-decoration: inherit;
        cursor: pointer;
        text-align: inherit;
        line-height: inherit;
        outline: none;
        display: inline;
        border-radius: 0;

    }
}

nav.controls {
    display: flex;
    padding: 0.3em;
    padding: 0.5em 0 1em;

}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(10px) scale(0.95);
    }

    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

/* -----------------------------
 Icons
 */
.label {
    display: inline-flex;
    align-items: center;
    color: var(--controlcolor);
    padding: 1em;
    transition: all 0.2s ease;
    width: fit-content;
}

.label svg {
    height: 1.5em;
    width: 1.5em;
    fill: currentColor;
}

.label .text {
    margin-left: 0.5em;
    font-size: 1rem;
    font-weight: 500;
}

.label:hover,
.label:focus {
    background-color: var(--controlcolor);
    color: var(--controlbackgroundcolor);
    appearance: none;
    outline: none;
}


@keyframes pulse {
    0% {
        transforme: scale(1);
    }

    50% {
        transform: scale(0.7);
    }

    100% {
        transform: scale(1);
    }
}

@keyframes breathe {
    0% {
        transforme: scale(1);
    }

    20% {
        transform: scale(1.05);
    }

    70% {
        transform: scale(0.9);
    }

    100% {
        transform: scale(1);
    }
}


.label:active {
    animation: pulse 0.4s ease;
    background-color: var(--controlcolor);
    color: var(--controlbackgroundcolor);
}


@media (max-width: 768px) {

    nav {
        grid-area: navigation-bottom;
        background-color: var(--solidbackgroundcolor);
    }

    main {
        height: 100%;
        overflow-y: auto;
    }

    .label {
        flex-direction: column;
        align-items: center;
        text-align: center;
        font-size: 2vw;

        .text {
            margin-left: 0;
            margin-top: 0.25em;
            font-size: 8pt;
            font-weight: 400;
            letter-spacing: 0.05em;
        }

    }

    .label svg {
        height: 2rem;
        width: 2rem;
    }
}


/* ----------------------------
  Controls
*/

button {
    background: none;
    border: none;
}

textarea {
    font-family: 'iA Writer Quattro', Menlo, Consolas, Monaco, Liberation Mono, Lucida Console, monospace;
    color: inherit;
    background-color: inherit;
    min-height: 12em;
    padding: 1em 0.7em;
    box-sizing: border-box;

    border: 1px solid;
    border-radius: 0.5em;
    line-height: 1.3;

    transition: border-color 0.3s, box-shadow 0.3s;

    width: 100%;
    background-color: var(--backgroundcolor);
}

textarea:focus {
    outline: none;
    border-color: var(--controlcolor);
}

select {
    background: var(--backgroundcolor);
    color: inherit;
    outline: none;
    border: 1px solid;
    border-radius: 0.2em;
    padding: 0.5em;
}

form {
    display: flex;
    flex-direction: column;
    align-content: baseline;
    border-radius: 1em;
    outline: none;
    border: none;

    fieldset {
        display: flex;
        flex-direction: column;
        border: none;
    }

    label {
        margin-top: 1em;
    }
}

.indicator {
    display: flex;
    flex-direction: row;
    align-items: center;

    img {
        padding: 0 0.5em;
    }
}