/*
 * Variable
 */

:root {
    --primary-bg-color: #FFFFFF;
    --primary-color: #000000;

    --app-short-w: 850px;

    --sect-grid-item-wide-w: 415px;
    --sect-grid-item-wide-h: 250px;

    --sect-grid-item-w: 272px;
    --sect-grid-item-h: 272px;

    --sect-grid-item-short-w: 200px;
    --sect-grid-item-short-h: 200px;

    --app-main-gap: 50px;

    --app-inline-pad: 30px;
}

/*
 * Fancy navigation
 */

@keyframes _fancynav_fade_in {
    0% { opacity: 0.5; scale: 1.05; }
    25% {opacity: 0.5; scale: 1.05; }
    100% { opacity: 1; scale: 1.0; }
}
@keyframes _fancynav_fade_out {
    0% { opacity: 1; scale: 1; }
    5% { opacity: 1; scale: 1; }
    50% { opacity: 0; scale: 0.95; }
}

/* Used for reload transition */
@keyframes _fancynav_fade_in_sp {
    0% { opacity: 0.5; scale: 1.02; }
    100% { opacity: 1; scale: 1.0; }
}

@keyframes _fancynav_circle_in {
    0% {
        clip-path: circle(0% at 50dvw 50dvh);
        scale: 1.2;
    }
    10% {
        scale: 1.05;
    }
    99.99% {
        clip-path: circle(100% at 50dvw 50dvh);
        scale: 1;
    }
    100% {
        clip-path: none;
    }
}

@keyframes _fancynav_circle_out {
    0% {
        clip-path: circle(80% at 50dvw 50dvh);
    }
    50% {
        scale: 1;
    }
    100% {
        clip-path: circle(0% at 50dvw 50dvh);
        scale: 1.02;
    }
}

@view-transition {
    navigation: auto;
}

::view-transition {
    background-color: var(--primary-bg-color);
}

:root {
    view-transition-name: none;
}
body {
    view-transition-name: page;
}

::view-transition-group(page) {
    animation-duration: 0.5s;
    animation-timing-function: ease;
}

:root[data-transition="reload"] {
    &::view-transition-old(page) {
        display: none;
    }
    &::view-transition-new(page) {
        animation-name: _fancynav_fade_in_sp;
    }
}

:root[data-transition="push"] {
    &::view-transition-old(page) {
        animation-name: _fancynav_fade_out;
    }
    &::view-transition-new(page) {
        animation-name: _fancynav_circle_in;
    }
}

:root[data-transition="pop"] {
	&::view-transition-old(page) {
		animation-name: _fancynav_circle_out;
		z-index: 1;
        animation-duration: 0.3s;
        animation-timing-function: ease-in-out;
	}
	&::view-transition-new(page) {
		animation-name: _fancynav_fade_in;
	}
}

/* For reduced motion */
@media (prefers-reduced-motion: reduce) {
	::view-transition-group(page) {
		animation-duration: 0s !important;
	}

	.warning[data-reason="prefers-reduced-motion"] {
		display: block;
	}
}

/*
 * Style
 */

body {
    margin: 0;
    height: 100%;

    background-color: var(--primary-bg-color);

    font-family: "Helvetica", Arial, sans-serif;
    font-optical-sizing: auto;
    font-weight: 450;
    font-style: normal;
    font-variation-settings:
        "wdth" 100;
}

.app_main {
    width: 100%;

    display: flex;
    flex-direction: column;

    min-height: 100dvh;

    gap: var(--app-main-gap);
}

.app_center_content_h {
    align-items: center;
}
.app_content_center_v {
    justify-content: center;
}

.app_content_pad_h {
    width: calc(100% - (var(--app-inline-pad) * 2));
    padding-inline: var(--app-inline-pad);
}

.h_hdr {
    width: 100%;
    max-width: var(--app-short-w);

    margin-top: 150px;
    margin-bottom: calc((var(--app-main-gap) * -1) + 100px); /* Kind of a fucked up hack. oh well */ 

    display: flex;
    flex-direction: column;
    gap: 15px;
}

.h_hdr_text {
    font-size: 2.7em;
}

.h_hdr_linkcol {
    width: fit-content;

    display: flex;
    flex-direction: column;

    gap: 5px;

    font-size: 1.25em;
}

.h_hdr_link {
    width: fit-content;
}

.h_sect {
    width: 100%;
    max-width: var(--app-short-w);
}

.h_sect_title {
    font-size: 1.5em;
}

.h_sect_grid {
    display: grid;
    gap: 15px;
    grid-template-columns: repeat(auto-fill, minmax(var(--sect-grid-item-w), 1fr));

    > .h_sect_grid_item > ._h_sect_grid_item_img {
        width: 100%;
        height: var(--sect-grid-item-h);
    }
}

._h_sect_grid_wide {
    grid-template-columns: repeat(auto-fill, minmax(var(--sect-grid-item-wide-w), 1fr));

    > .h_sect_grid_item > ._h_sect_grid_item_img {
        width: 100%;
        height: var(--sect-grid-item-wide-h);
    }
}

._h_sect_grid_short {
    grid-template-columns: repeat(auto-fill, minmax(var(--sect-grid-item-short-w), 1fr));

    > .h_sect_grid_item > ._h_sect_grid_item_img {
        width: 100%;
        height: var(--sect-grid-item-short-h);
    }
}

.h_sect_grid_item {
    width: 100%;
    height: 100%;

    overflow: hidden;

    user-select: none;

    position: relative; /* De-fuck the scroll ! */

    transition: scale 80ms ease;

    cursor: pointer;
}

.h_sect_grid_item:hover {
    scale: 1.02;
}

.h_sect_grid_item:active {
    scale: 0.99;
    transition: scale 0ms ease;

    filter: brightness(0.95);
}

._h_sect_grid_item_a {
    position: absolute;

    color: transparent !important;
    user-select: none;

    width: 100%;
    height: 100%;
}

._h_sect_grid_item_img {
    object-fit: cover;

    border-radius: 5px;
}

._h_sect_grid_item_img_plain {
    margin: none;
    padding: none;

    background: #D9D9D9;
    background: linear-gradient(0deg, rgba(255, 255, 255, 1) 0%, var(--accent-color) 100%);

    overflow: hidden;

    display: flex;
}

._h_sect_grid_item_img_plain_text {
    font-size: 2.3em;

    margin: 0;

    margin-top: auto;
    margin-left: 20px;
    margin-bottom: 15px;

    user-select: none;
}

.app_content_navbar {
    display: flex;
    flex-direction: row;
    justify-content: center;

    gap: 15px;

    width: 100%;
    height: 200px;

    background: #eeeeee;
    background: linear-gradient(180deg, rgb(226 226 226) 0%, rgb(224 224 224 / 10%) 100%);
}

._app_content_navbar_inner {
    display: flex;
    flex-direction: column;

    width: 100%;
    max-width: 1200px;
}

._app_content_navbar_back {
    margin-left: 50px;
    margin-top: 20px;
}

._app_content_navbar_name {
    font-size: 2.7em;

    margin-left: 50px;

    margin-block: auto 0;

    position: relative;
    top: 0.3em;
}
