:root {
    --base-size: 2vmin;
    --color-n-0: #373737;
    --color-n-1: #607D8B;
    --color-n-2: #3F51B5;
}

* {
    box-sizing: border-box;
    scrollbar-width: thin;
    -webkit-tap-highlight-color: transparent;
}

body {
    margin: 0;
    font-size: var(--base-size);
    box-sizing: border-box;
    overflow-y: scroll;
    font-family: Roboto, Oxygen, Ubuntu, Cantarell, 'Open Sans', 'Helvetica Neue', sans-serif;
    background-color: #8a4c5c;
    scroll-behavior: smooth;
    will-change: scroll-position;
}

a {
    color: #1151b1;
    text-decoration: none;
}

a:hover {
    text-decoration: underline;
}

#win {
    transition: opacity 1s;
}

/* mouse, touch pad */

@media (hover: hover) and (pointer: fine) {
    *::-webkit-scrollbar-thumb, *::-webkit-scrollbar {
        background: transparent;
        width: 5px;
        height: 5px;
        padding: 3px;
    }
    *::-webkit-scrollbar-thumb {
        background: rgba(200, 200, 200, 0.5);
    }
    *::-webkit-scrollbar-thumb:horizontal {
        border-radius: 2em 2em 0 0;
    }
    *::-webkit-scrollbar-thumb:vertical {
        border-radius: 2em 0 0 2em;
    }
    *::-webkit-scrollbar-track {
        display: none;
    }
}

@font-face {
    font-family: "FluentSystemIcons-Regular";
    src: url("./FluentSystemIcons-Regular.woff2") format("woff2"), url("./FluentSystemIcons-Regular.ttf") format("truetype");
}

.icon {
    font-family: "FluentSystemIcons-Regular";
    font-weight: normal;
    font-style: normal;
    font-size: inherit;
    line-height: 1;
    letter-spacing: normal;
    text-transform: none;
    display: inline-block;
    white-space: nowrap;
    word-wrap: normal;
    direction: ltr;
    -webkit-font-smoothing: antialiased;
    -moz-user-select: none;
    -webkit-user-select: none;
    -ms-user-select: none;
    user-select: none;
}

.icon.info-icon:before {
    content: '\ffa0';
    vertical-align: middle;
    opacity: 0.5;
    cursor: pointer;
}

#bg {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    background-color: #000000;
    background: url("bg.jpg") no-repeat center center;
    background-size: cover;
}

#content {
    width: 100%;
    margin: auto;
    margin-top: 10em;
    overflow: hidden;
    box-shadow: 0 -1em 3em 1em rgba(0, 0, 0, .3);
    /*background-size: 100%;
    background-attachment: fixed;
    background-image: url("bg-blur.jpg");*/
    will-change: scroll;
}

#upper {
    background: rgba(255, 255, 255, .7);
    display: flex;
    height: 15em;
    position: relative;
    /*backdrop-filter: blur(2em);*/
}

#main {
    position: relative;
    background: rgba(255, 255, 255, .85);
    /*backdrop-filter: blur(1em);*/
    box-shadow: 0 .5em 1em 1em rgba(0, 0, 0, .1);
    overflow: hidden;
    will-change: contents;
}

section {
    display: grid;
    grid-template-columns: repeat(2, 50%);
}

@media (min-width: 1001px) {
    :root {
        --base-size: 1vw;
    }
    #content {
        max-width: 70%;
        border-radius: .3em;
        margin-bottom: 2em;
    }
}

#avatar {
    height: 100%;
    padding: 3% 4%;
}

#avatar img {
    height: 100%;
    border-radius: 50%;
}

#upper-side {
    display: flex;
    flex-direction: column;
    width: 100%;
    padding: 1em;
    padding-left: 0;
}

#nav {
    display: flex;
    flex-grow: 1;
}

#header {
    flex-grow: 2;
    display: flex;
    flex-direction: column;
    justify-content: center;
    margin-left: 1em;
}

#header .title {
    font-size: 3.4em;
    line-height: 1;
}

#header .subtitle {
    line-height: 1;
    margin-top: 5px;
}

#nav a.nav-tab.card {
    flex-grow: 1;
    display: flex;
    text-decoration: none;
    color: inherit;
    margin: .2em;
    border-radius: .2em;
    justify-content: center;
    transition: all .2s;
    will-change: contents;
}

#nav a.nav-tab.card.active {
    box-shadow: inset 0 0.2em 0.3em rgba(71, 48, 48, 0.13), 0 0 0 rgba(0, 0, 0, .13);
    background: rgba(0, 0, 0, .1);
}

#nav a.nav-tab.card:hover {
    box-shadow: inset 0 0 0 rgba(0, 0, 0, .13), 0 0.2em 0.3em rgba(0, 0, 0, .13);
    background: rgba(255, 255, 255, .1);
}

#nav a.nav-tab.card .icon-container {
    display: flex;
    justify-content: center;
    align-items: center;
    margin: 0 .4em;
    font-size: 2.2em;
}

#nav a.nav-tab.card .text {
    display: flex;
    flex-direction: column;
    justify-content: center;
    margin-right: .5em;
    line-height: 1;
}

#nav a.nav-tab.card .bav-tab-subtext {
    font-size: .7em;
    opacity: .6;
}

main a.card {
    display: flex;
    height: 8em;
    margin: .8em;
    text-decoration: none;
    color: inherit;
}

main a.card img {
    height: 100%;
    border-radius: .3em;
    box-shadow: inset 0 0 0 rgba(0, 0, 0, .2), 0 0 0 rgba(0, 0, 0, .2);
    transition: box-shadow .1s;
}

main a.card:hover img, main a.card:focus img {
    height: 100%;
    border-radius: .3em;
    box-shadow: inset 0 0 0 rgba(0, 0, 0, .2), 0 .15em .3em rgba(0, 0, 0, .2);
}

main a.card .content {
    box-shadow: inset 0 .15em .3em rgba(0, 0, 0, .2), 0 0 0 rgba(0, 0, 0, .2), 0 0 0 0 rgba(0, 0, 0, 0);
    border-radius: .3em;
    width: 100%;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    transition: box-shadow .1s;
}

main a.card:hover .content, main a.card:focus .content {
    box-shadow: inset 0 0 0 rgba(0, 0, 0, .2), 0 .15em .3em rgba(0, 0, 0, .2), 0 0 0 .1em rgba(0, 0, 0, .15);
}

main a.card img+.content {
    margin-left: 1em;
}

main a.card .content .title {
    display: flex;
    background: rgba(113, 113, 113, 0.22);
    height: 3em;
    align-items: center;
    line-height: 1;
}

main a.card .content .title .text, main a.card .content .title .state {
    /* margin-top: -.15em; */
}

main a.card .content .title .icon {
    margin: 0 .35em 0 .5em;
    font-size: 1.5em;
}

main a.card .content .title .state {
    margin-left: auto;
    opacity: .5;
    margin-right: 1em;
}

main a.card .content .info {
    background: rgba(138, 138, 138, 0.15);
    flex-grow: 1;
    padding: 1em;
}

@media (min-width: 751px) and (max-width: 999px) {
    :root {
        --base-size: 1.4vmin;
    }
    #avatar img {
        height: 20vh;
        width: unset;
    }
}

#main:empty {
    display: none;
}

section {
    padding: 1em;
}

section:empty {
    display: none;
    padding: 0;
    margin: 0;
}

section:not(.active) {
    display: none;
}

section.active {
    animation: .4s cubic-bezier(0.02, 0.69, 0.13, 1.04) 0s 1 normal forwards running appear;
}

section.disappearing {
    display: grid;
    position: absolute;
    animation: .3s ease-in-out normal forwards running fade;
    width: 100%;
}

@keyframes appear {
    0% {
        display: none;
        transform: translateY(100%);
        opacity: 0;
    }
    50% {
        display: grid;
        opacity: 0;
    }
    100% {
        display: grid;
        transform: translateY(0);
        opacity: 1;
    }
}

@keyframes fade {
    0% {
        transform: translateY(0);
        opacity: 1;
    }
    50% {
        opacity: 0;
        transform: translateY(-10vh);
    }
    100% {
        opacity: 0;
        transform: translateY(-10vh);
    }
}

#overlays {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    background: transparent;
    transition: all .2s ease-out;
    z-index: -1;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
}

#overlays:not(:empty) {
    background: rgba(0, 0, 0, .3);
    pointer-events: all;
    z-index: 2;
}

.popup {
    width: 65%;
    box-shadow: 0 0.5em 1em 1em rgba(0, 0, 0, .1);
    border-radius: .3em;
    overflow: hidden;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    position: relative;
    max-height: 100%;
    cursor: initial;
}

.popup>.head {
    --header-size: 12vmax;
    background: rgba(255, 255, 255, .7);
    display: flex;
    height: var(--header-size);
    align-items: center;
    transition: background .5s, backdrop-filter .5s, -webkit-backdrop-filter .5s;
}

.popup>.body {
    background: rgba(255, 255, 255, .85);
    backdrop-filter: blur(2.5em);
    -webkit-backdrop-filter: blur(2.5em);
    margin-top: -.1em;
}

.popup>.head>div:nth-child(1) {
    display: flex;
    height: 100%;
    align-items: center;
}

.popup>.head>div:nth-child(2) {
    margin: 0 calc(.165 * var(--header-size));
    margin-left: auto;
    display: flex;
}

.popup>.head>div:nth-child(1)>img {
    height: calc(100% / 3 * 2);
    border-radius: .3em;
    box-shadow: 0 .15em .3em rgba(0, 0, 0, .2);
    margin: 0 calc(.165 * var(--header-size));
}

.popup>.head>div:nth-child(1)>div:first-child {
    margin: 0 calc(.165 * var(--header-size));
}

.popup>.head>div:nth-child(1)>div {
    margin-right: 1em;
}

.popup>.head>div:nth-child(1)>div>div:nth-child(1) {
    font-size: 3em;
    line-height: 1;
}

.popup>.head>div:nth-child(1)>div>div:nth-child(2) {
    opacity: .7;
}

.fluent-button {
    padding: .6em 1.2em;
    display: flex;
    color: white;
    align-items: center;
    line-height: 1;
    border-radius: .3em;
    font-size: 1.5em;
    cursor: pointer;
    box-shadow: inset 0 0 0 rgba(0, 0, 0, .15), 0 0.2em 0.3em rgba(0, 0, 0, .15);
    transition: box-shadow .3s, filter .3s;
}

.fluent-button:hover {
    box-shadow: inset 0 0.2em 0.3em rgba(0, 0, 0, .15), 0 0 0 rgba(0, 0, 0, .15);
    filter: brightness(.9);
}

.fluent-button+.fluent-button {
    margin-left: .4em;
}

.fluent-button>.icon {
    margin-right: .2em;
    font-size: 1.5em;
    line-height: .5;
}

.icon.gh>img {
    height: 1.1em;
}

/* .fluent-button>.sign {
    margin-top: -.15em;
} */

/*.icon:empty {
//    display: none;
}*/

.fluent-button.notext {
    width: 2.4em;
    height: 2.4em;
    align-items: center;
    padding: 0;
    justify-content: center;
}

.fluent-button.notext>.icon {
    margin: 0;
    font-size: 1.3em;
}

.fluent-button:not(.notext) .icon.gh>img {
    margin-right: .3em;
    font-size: .75em;
}

.popup>.body p {
    font-size: 1.5em;
    display: block;
    margin: 1em;
}

#content-bg {
    max-width: 70%;
    width: 100%;
    position: fixed;
    left: 50%;
    transform: translateX(-50%);
    border-radius: .3em;
    background-image: url(/assets/bg-blur.jpg);
    background-size: 80vw 100vh;
    max-height: 100vh;
    will-change: top, bottom, height, background-position;
}

@media (max-width: 1000px) {
    :root {
        --base-size: 2.5vmin;
    }
    #content {
        margin: 2em 0;
    }
    #upper {
        height: unset;
        flex-direction: column;
    }
    #nav {
        flex-direction: column;
    }
    #avatar img {
        width: 50vmin;
        height: inherit;
    }
    #avatar {
        display: flex;
        justify-content: center;
    }
    #header {
        text-align: center;
        margin-bottom: 1em;
        font-size: 1.7em;
    }
    #nav {
        font-size: 1.7em;
    }
    #nav a.nav-tab.card {
        justify-content: unset;
        padding: .5em;
    }
    #upper-side {
        padding: 0;
    }
    #main {
        font-size: 1.2em;
    }
    section {
        grid-template-columns: repeat(1, 100%);
    }
    .popup {
        width: 95%;
    }
    .popup>.head>div:nth-child(1)>div>div:nth-child(1) {
        font-size: 1.5em;
    }
    #content {
        background-image: none;
    }
    #content-bg {
        display: none;
    }
    #bg {
        background-image: url(/assets/bg-blur.jpg);
    }
}

@media (prefers-color-scheme: dark) {
    #bg-p, #bg, #content-bg {
        filter: brightness(0.4);
    }
    
    #content {
        color: #ffffff;
    }
    
    #upper {
        background: rgba(0, 0, 0, .7);
    }
    
    #main {
        background: rgba(0, 0, 0, .85);
    }
    
    .popup {
        color: white;
    }
    
    .popup>.head {
        background: rgba(0, 0, 0, .7);
    }
    
    .popup>.body {
        background: rgba(0, 0, 0, .85);
    }
    
    #nav a.nav-tab.card.active:not(:hover) {
        background: rgba(255, 255, 255, .07);
    }
}