@import url(scrollbar.css);

/* OUTER PAGES */

/*
    GENERAL
*/
body {
    overflow: hidden;
}

/*
        BUTTON
*/
button.classic {
    background-color: var(--color-tertiary-dark);
    border-image-source: var(--border-image-button-idle);
    filter: drop-shadow(0 6px 0 var(--color-tertiary-light));
}

button.classic:active:not(:disabled) {
    border-image-source: var(--border-image-button-active);
    filter: none;
}

/*
        BACKGROUND
*/
#background {
    position: relative;
}

#background::before {
    content: "";
    display: block;
    width: 100%;
    height: 100%;
    background-image: url("../images/wallpaper.png");
    background-size: cover;
}

#background::after {
    content: "";
    display: block;
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: url("../images/logo_padded_big.png");
    background-size: 75vw;
    background-repeat: no-repeat;
    background-position: center;
}

@keyframes appear {
    to {
        opacity: 1;
    }
}

#background #backgroundTop {
    position: absolute;
    top: 100%;
    left: 0;
    opacity: 0;
}

body.animateOut #backgroundContainer #backgroundTop {
    animation: appear 1s ease calc(var(--vanish-duration) + 1s) forwards;
}

@media (prefers-reduced-motion: no-preference) {
    @keyframes magnify {
        to {
            transform: scale(15);
        }
    }

    @keyframes circleAnimation {
        to {
            mask-size: max(150vw, 150vh);
        }
    }

    #background {
        transform: translateY(-100%);
        transition: transform var(--logo-vanish-duration) ease;
    }

    body.animateIn #background {
        transform: translateY(0%);
    }

    body.animateOut #backgroundContainer {
        transform-origin: center 65%;
        animation: magnify 4.5s ease-in calc(var(--vanish-duration) + 1s) forwards;
    }

    body.animateIn #backgroundContainer {
        mask-image: url(../images/mask.png);
        mask-repeat: no-repeat;
        mask-position: center;
        mask-size: max(0vw, 0vh);
        animation: circleAnimation 2s ease forwards;
    }

}

@media (prefers-reduced-motion: reduce) {
    @keyframes magnify {
        to {
            opacity: 0;
        }
    }

    @keyframes translateBackground {
        0% {
            opacity: 100%;
            transform: translateY(0%);
        }

        50% {
            opacity: 0%;
            transform: translateY(0%);
        }

        55% {
            opacity: 0%;
            transform: translateY(-100%);
        }

        100% {
            opacity: 100%;
            transform: translateY(-100%);
        }
    }

    #background {
        animation: translateBackground var(--logo-vanish-duration) ease forwards;
    }

    body.animateIn #background {
        transform: translateY(0%);
        animation: none;
    }

    body.animateOut #backgroundContainer {
        animation: magnify 4.5s ease-in calc(var(--vanish-duration) + 1s) forwards;
    }
}

/*
        CURRENT PAGE
*/
.currentPage {
    display: inline-block;
    text-align: center;
    min-width: 5.5rem;
    margin: 15px;
}

#primaryHeader .currentPage::after {
    content: "<";
    margin: 0 0.25rem;
    font-weight: bold;
    margin-left: auto;
    margin-right: 0.5rem;
}

/*
        LAYOUT FRONT
*/
#layoutFront {
    display: flex;
    flex-direction: row;
    align-items: flex-start;
    transform: translateY(0);

    transition: transform var(--vanish-duration) var(--vanish-timing-function),
        opacity var(--vanish-duration) var(--vanish-timing-function);
}

@media (prefers-reduced-motion: no-preference) {
    body.animateOut #layoutFront,
    body.animateIn #layoutFront {
        transform: translateY(100vh);
    }
}

@media (prefers-reduced-motion: reduce) {
    body.animateOut #layoutFront,
    body.animateIn #layoutFront {
        opacity: 0;
    }
}

/*
        HEADER
*/
#primaryHeader {
    height: 100vh;
    padding: 1rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    width: var(--primary-header-width);
    /*border-image-source: var(--border-image-secondary-dark);
    background-color: var(--color-secondary-light);*/
    border-image-source: var(--border-image-secondary);
    background-color: var(--color-secondary);
}

#primaryHeader a {
    padding: 0.2rem 0.4rem;
    /*border: 3px solid transparent;
    border-image-source: var(--border-image-white);
    border-image-slice: 1;
    border-image-repeat: stretch;
    background-color: var(--color-white);
    background-clip: padding-box;*/
    border: 3px solid transparent;
    border-image-source: var(--border-image-secondary-dark);
    border-image-slice: 1;
    border-image-repeat: stretch;
    background-color: var(--color-secondary-dark);
    box-sizing: border-box;
    outline-offset: 4px;
    background-clip: padding-box;
    color: var(--color-white);
    text-decoration: none;
}

#primaryHeader a:hover {
    border-image-source: var(--border-image-secondary-light);
}

#logo {
    text-indent: -999rem;
    background-image: url("../images/logo_padded.png");
    background-size: 95%;
    background-repeat: no-repeat;
    width: 12.5rem;
    height: 5.5rem;
    margin: 0.3rem;
    margin-bottom: 1.5rem;
    background-position: center;
}

#toggleMenu {
    margin-left: auto;
    margin-right: 1rem;
    background-image: url("../images/open_hamburger.png");
}

#toggleMenu[aria-expanded="true"] {
    background-image: url("../images/close.png");
}

#primaryMenu {
    overflow-y: auto;
    width: 100%;
}

#primaryMenu ul {
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 100%;
}

#primaryMenu ul li {
    margin: 0.4rem;
    list-style-type: none;
    width: 100%;
}

#primaryMenu ul li > * {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    padding: 0.2rem 0.4rem 0.2rem 0;
    margin: 5px;
}

#primaryMenu ul li > .currentPage {
    /*border-image-source: var(--border-image-secondary-dark);*/
    border-image-source: var(--border-image-primary-light);
    background-color: var(--color-primary-light);
}

.iconLink::before {
    content: "";
    display: block;
    width: 2.5rem;
    height: 2.5rem;
    background-repeat: no-repeat;
    background-position: center;
    background-size: contain;
    margin-right: 0.5rem;
}

.homeLink::before {
    background-image: url("../icons/home.png");
}

.playLink::before {
    background-image: url("../icons/joystick.png");
}

.aboutLink::before {
    background-image: url("../icons/about.png");
}

/*
        BREADCRUMBS
*/
#breadcrumbs {
    margin-top: 1.8rem;
}

#breadcrumbs a,
#breadcrumbs .currentPage {
    margin: 0 0.6rem;
    min-width: 0;
}

#breadcrumbs ol {
    list-style: none;
    display: flex;
    flex-direction: row;
    flex-wrap: wrap;
}

#breadcrumbs ol li {
    display: flex;
    flex-direction: row;
    align-items: center;
    height: 1.8rem;
}

#breadcrumbs ol li:not(:last-child)::after {
    content: ">";
}

/*
        MAIN
*/
#main {
    height: 100vh;
    overflow: auto;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    background-color: var(--color-primary-light);
    border-image-source: var(--border-image-primary-light);
    padding: 0.5rem 1.5rem;
}

#primaryContent {
    padding: 0 1rem;
}

#primaryContent {
    display: flex;
    flex-direction: column;
    justify-content: center;
}

/*
    PAGES
*/

/*
        INDEX
*/
#indexTitle {
    width: 100%;
    /*max-width: 35rem;*/
    min-height: 20rem;
    margin: 0 auto/* 1rem auto*/;
    display: flex;
    flex-direction: column;
}

#indexTitle::before {
    content: "";
    display: block;
    width: 100%;
    height: 100%;
    background-image: url("../images/img_cover_personas.png");
    background-repeat: no-repeat;
    background-size: contain;
    background-position: bottom center;
}

#indexTitle hgroup {
    text-align: center;
    border-image-source: var(--border-image-primary);
    background-color: var(--color-primary);
}

#indexTitle hgroup h1 {
    font-size: 1.65rem;
}

#indexDescr {
    margin: 0.2rem 0.35rem;
}

#indexDescr p {
    margin-left: 0.2rem;
    margin-right: 0.2rem;
}

#linkList {
    list-style: none;
    display: flex;
    flex-direction: row;
    justify-content: center;
    width: 100%;
}

#linkList li {
    margin: 0.5rem 1.5rem;
}

#linkList .iconLink {
    display: flex;
    flex-direction: row;
    align-items: center;
    min-width: 10rem;
}

/*
        ABOUT
*/
.personaHeader .spriteContainer {
    position: relative;
    width: 9rem;
    height: auto;
    background-color: var(--color-primary);
    border-image-source: var(--border-image-primary);
    margin-right: 0.25rem;
    flex-shrink: 0;
}

.personaHeader .spriteContainer .stillSprite {
    position: absolute;
    object-fit: contain;
    height: 11.1rem;
    bottom: -1.85rem;
}

.personaHeader hgroup {
    background-color: var(--color-primary);
    border-image-source: var(--border-image-primary);
}

/*
        404
*/
.errorPage {
    display: flex;
    flex-direction: column;
    align-items: center;
    min-height: 85vh;
    justify-content: center;
}

.errorPage #logo {
    width: 18rem;
    height: 10rem;
}

.errorPage main {
    display: grid;
    grid-template-areas: "a b" "a c";
    justify-items: start;
    align-items: center;
}

.errorPage main::before {
    grid-area: a;
    content: "";
    display: block;
    width: 20rem;
    height: 20rem;
    background-position: center;
    background-repeat: no-repeat;
    background-size: contain;
    margin: 0 1.5rem;
}

#page404 main::before {
    background-image: url("../images/cover_index.png");
}

#page400 main::before {
    width: 22rem;
    background-image: url("../images/wrong_match.png");
}