* {
    -webkit-box-sizing: border-box;
    box-sizing: border-box;
}

body {
    font-family: "Montserrat", sans-serif;
    padding-bottom: 100px;
}

.credits a {
    text-decoration: none;
}

[data-theme=light],
:root:not([data-theme=dark]),
:host(:not([data-theme=dark])) {
    .dark-mode-only {
        display: none;
    }

    .light-mode-only {
        display: block;
    }
}

@media only screen and (prefers-color-scheme: dark) {

    :root:not([data-theme]),
    :host(:not([data-theme])) {
        .dark-mode-only {
            display: block;
        }

        .light-mode-only {
            display: none;
        }
    }
}

nav,
a#brand {
    display: -webkit-box;
    display: -ms-flexbox;
    display: flex;
    -webkit-box-align: center;
    -ms-flex-align: center;
    align-items: center;
}

nav {
    margin: 0 auto;
    width: 1200px;
    max-width: 100%;
    -webkit-box-pack: justify;
    -ms-flex-pack: justify;
    justify-content: space-between;
}

nav a {
    text-decoration: none;
    color: var(--pico-h1-color);
    font-size: 18px;
    font-weight: 800;
}

a#brand span {
    font-size: 40px;
    font-weight: 900;
}

nav img {
    width: 100px;
    margin-right: 25px;
}

nav a {
    padding: 25px;
}

a#menu {
    display: -webkit-box;
    display: -ms-flexbox;
    display: flex;
    -webkit-box-orient: vertical;
    -webkit-box-direction: normal;
    -ms-flex-direction: column;
    flex-direction: column;
    -webkit-box-pack: center;
    -ms-flex-pack: center;
    justify-content: center;
    -webkit-box-align: center;
    -ms-flex-align: center;
    align-items: center;
    z-index: 2;
}

a#menu .bar {
    margin: 2px;
    width: 30px;
    height: 4px;
    background: var(--pico-h1-color);
    border-radius: 2px;
    -webkit-transition: margin 0.2s, -webkit-transform 0.2s;
    transition: margin 0.2s, -webkit-transform 0.2s;
    -o-transition: margin 0.2s, transform 0.2s;
    transition: margin 0.2s, transform 0.2s;
    transition: margin 0.2s, transform 0.2s, -webkit-transform 0.2s;
}

a#menu:not(.close):hover .bar {
    margin: 3px 2px;
}

a#menu.close .bar:first-child {
    -webkit-transform: translateY(8px) rotate(45deg);
    -ms-transform: translateY(8px) rotate(45deg);
    transform: translateY(8px) rotate(45deg);
}

a#menu.close .bar:nth-child(2) {
    opacity: 0;
}

a#menu.close .bar:last-child {
    -webkit-transform: translateY(-8px) rotate(-45deg);
    -ms-transform: translateY(-8px) rotate(-45deg);
    transform: translateY(-8px) rotate(-45deg);
}

#nav-links.hidden-mobile {
    -webkit-transform: translateX(100%);
    -ms-transform: translateX(100%);
    transform: translateX(100%);
    opacity: 0;
}

#nav-links:not(.hidden-mobile) {
    opacity: 100%;
}

#nav-links {
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    right: 0;
    margin-left: 0;
    display: -webkit-box;
    display: -ms-flexbox;
    display: flex;
    -webkit-box-orient: vertical;
    -webkit-box-direction: normal;
    -ms-flex-direction: column;
    flex-direction: column;
    -webkit-box-pack: center;
    -ms-flex-pack: center;
    justify-content: center;
    -webkit-box-align: center;
    -ms-flex-align: center;
    align-items: center;
    background: var(--pico-secondary-background) / 75%;
    opacity: 0.75;
    -webkit-backdrop-filter: blur(20px);
    backdrop-filter: blur(20px);
    z-index: 1;
    -webkit-transform: translateX(0px);
    -ms-transform: translateX(0px);
    transform: translateX(0px);
    -webkit-transition: -webkit-transform .3s;
    transition: -webkit-transform .3s;
    -o-transition: transform .3s;
    transition: transform .3s;
    transition: transform .3s, -webkit-transform .3s;
}

#nav-links a {
    font-size: 30px;
    -webkit-transition: font-size .2s;
    -o-transition: font-size .2s;
    transition: font-size .2s;
}

#nav-links a:hover {
    font-size: 40px;
}

.page {
    margin: 0 auto;
    padding: 0 25px;
    width: 1200px;
    max-width: 100%;
    display: -webkit-box;
    display: -ms-flexbox;
    display: flex;
    -webkit-box-orient: vertical;
    -webkit-box-direction: normal;
    -ms-flex-direction: column;
    flex-direction: column;
    -webkit-box-pack: justify;
    -ms-flex-pack: justify;
    justify-content: space-between;
}

svg.illustration {
    display: block;
    margin: 32px auto;
    width: max(256px, 35%);
    max-width: 100%;
}

main {
    flex-grow: 1;
    text-align: justify;
}

.tbx-u-enable .tbx-u {
    text-decoration: underline;
}

.tbx-s-disable .tbx-s-show {
    display: none;
}

.tbx-s-enable .tbx-s-hide {
    display: none;
}

ul {
    padding-left: 1.5rem;
}

.grid-enigmes {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
}

.grid-enigmes .item {
    flex: 0 0 calc(50% - 16px);
    background-color: var(--pico-code-background-color);
    border-radius: 12px;
    text-align: center;
    padding: 12px;
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    aspect-ratio: 1 / 1;
    text-decoration: none;
    color: var(--pico-h2-color);
}

li ul {
    margin-top: 5px;
}

.grid-enigmes .item svg {
    height: 60%;
}

fieldset label {
    display: flex;
    align-items: center;
    font-size: 0.85em;
}

[type="checkbox"][role="switch"] {
    margin-top: 0;
}

@media (min-width: 600px) {
    .grid-enigmes .item {
        flex: 0 0 calc(33.333% - 16px);
    }
}

@media (min-width: 900px) {
    .grid-enigmes .item {
        flex: 0 0 calc(25% - 16px);
    }
}

@media (min-width: 1200px) {
    .grid-enigmes .item {
        flex: 0 0 calc(20% - 16px);
    }
}

@media (min-width: 800px) {
    a#menu {
        display: none;
    }

    #nav-links {
        position: initial;
        display: initial;
        background: none;
        -webkit-backdrop-filter: none;
        backdrop-filter: none;
        /*transition: none;*/
    }

    #nav-links.hidden-mobile {
        -webkit-transform: initial;
        -ms-transform: initial;
        transform: initial;
        opacity: 100%;
    }

    #nav-links a,
    #nav-links a:hover {
        font-size: 20px;
        -webkit-transition: none;
        -o-transition: none;
        transition: none;
    }
}

@media (min-width: 980px) {
    .page {
        -webkit-box-orient: horizontal;
        -webkit-box-direction: normal;
        -ms-flex-direction: row;
        flex-direction: row;
        flex-wrap: wrap;
    }

    article,
    .credits,
    main {
        width: calc(100% - 400px);
    }

    .sidebar {
        width: 375px;
        padding-left: 25px;
    }
}