:root {
    --indexheadercolor: #7595ff;
    --nfheadercolor: #d0c000;
    --wcheadercolor: #21b9ff;
    --aboutheadercolor: #ff3535;

    --targetheadercolor: #ffffff;
}

* {
    margin: 0;
    padding: 0;
}

@font-face {
    font-family: "Consolas Custom";
    src: url('consola.ttf') format('truetype');
}

body {
    font-family: "Consolas Custom";
    overflow-y: scroll;
}

.background {
    background-image: var(--background);
    background-size: cover;
    background-position: center;
    filter: blur(2px);
    width: 100%;
    height: 100%;
    position: fixed;
    top: 0;
    left: 0;

    opacity: 0;
    animation: main-animation 500ms ease-in-out 300ms;
    animation-fill-mode: forwards;

    z-index: -1;
}

.background.out {
    opacity: 1;
    animation: main-animation-out 500ms ease-in-out;
    animation-fill-mode: forwards;
}

header {
    background-color: var(--headercolor);
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    display: flex;
    justify-content: center;

    z-index: 100;
}

header.out {
    animation: nav-animation-out 500ms ease-in-out;
    animation-fill-mode: forwards;
}

.logo {
    height: 100%;
    position: absolute;
    left: 1em;
}

img {
    width: 100%;
    height: 100%;
}

nav {
    background-color: #FFFFFF77;
    border-radius: 1em;
    margin: 0.5em 0;
    display: flex;
}

nav>div {
    margin: 0.5em;
    border-radius: 0.5em;
}

nav div a {
    display: block;
    padding: 0.5em;
    font-weight: bold;
    font-size: 1.2em;
    text-decoration: none;
    white-space: nowrap;
    color: inherit;
}

nav div.selectedpage {
    background-color: grey;
}

nav>div:not(.selectedpage):hover,
div.dropdown div:not(.selectedpage):hover {
    background-color: #FFFFFF44;
}

div.dropdown-container {
    position: relative;
}

div.dropdown {
    display: none;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, 20%);
    background-color: var(--headercolor);

    box-sizing: border-box;
    border-radius: 0.5em;
    border: 0.2em solid black;

    flex-direction: column;
    align-items: center;
}

div.dropdown div {
    margin: 0.2em;
    border-radius: 0.5em;
}

div.dropdown-container:hover div.dropdown {
    display: flex;
}

main {
    margin: 0 auto;
    margin-top: 7em;
    margin-bottom: 3em;
    width: 80%;
    background-color: var(--maincolor);
    padding: 1em;
    padding-bottom: 0;
    border-radius: 1em;

    opacity: 0;
    animation: main-animation 500ms ease-in-out 500ms;
    animation-fill-mode: forwards;
}

main.out {
    opacity: 1;
    animation: main-animation-out 500ms ease-in-out;
    animation-fill-mode: forwards;
}

.centeredimage {
    margin: auto;
    width: clamp(100px, 300px, 70%);
}

.portrait {
    width: 300px;
    float: right;
}

.portrait img {
    border: 0.2em black solid;
    border-radius: 1em;
}

article {
    background-color: var(--articlecolor);
    border: 0.2em solid black;
    border-radius: 1em;
    padding: 1em;
    overflow: hidden;
}

.space {
    padding: 1em;
}

h1 {
    font-size: 3em;
}

p {
    font-size: 1.2em;
    white-space: pre-line;
}

.contact {
    padding: 0 2em;
    font-size: 1.2em;
}

footer {
    text-align: center;
    font-size: 1.2em;
    padding: 0.5em;
}

@keyframes main-animation {
    0% {
        opacity: 0;
    }

    100% {
        opacity: 1;
    }
}

@keyframes nav-animation-out {
    0% {
        background-color: var(--headercolor)
    }

    100% {
        background-color: var(--targetheadercolor)
    }
}

@keyframes main-animation-out {
    0% {
        opacity: 1;
    }

    100% {
        opacity: 0;
    }
}

@media screen and (max-width: 750px) {

    nav div a,
    div.dropdown div a {
        font-size: 3vw;
    }

    .logo {
        display: none;
    }

    main {
        margin-top: 6em;
        font-size: 3vw;
    }

    .portrait {
        float: none;
        width: 70%;
        margin: 0 auto;
    }
}