:root {
    color-scheme: dark;
    --blue: #24487e;
    --blue-light: #315f9f;
    --rail-width: 106px;
    --page-gutter: 42px;
    --content-width: 1480px;
}

@font-face {
    font-family: "Super Mellow";
    src: url("fonts/Super%20Mellow.ttf") format("truetype");
    font-style: normal;
    font-weight: 400;
    font-display: swap;
}

* {
    box-sizing: border-box;
}

html {
    min-width: 320px;
    scroll-behavior: smooth;
    background: #050505;
}

body {
    min-height: 100vh;
    margin: 0;
    overflow-x: hidden;
    color: white;
    font-family: Impact, Haettenschweiler, "Arial Narrow Bold", sans-serif;
    background:
        radial-gradient(circle at 50% 112%, rgb(37 72 126 / 0.18), transparent 35rem),
        #050505;
}

a {
    color: inherit;
}

img {
    display: block;
    max-width: 100%;
}

.screen-reader-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

.social-rail {
    position: fixed;
    z-index: 10;
    top: 18px;
    bottom: 18px;
    left: 18px;
    display: flex;
    width: var(--rail-width);
    padding: 16px 13px 22px;
    border-radius: 53px;
    flex-direction: column;
    align-items: center;
    background:
        url("assets/sidebar.webp") center / 100% 100% no-repeat,
        linear-gradient(#34485a, #999);
    filter: drop-shadow(0 13px 24px rgb(0 0 0 / 0.42));
}

.profile-link {
    display: block;
    width: 76px;
    height: 76px;
    flex: 0 0 auto;
    overflow: hidden;
    border: 3px solid rgb(255 255 255 / 0.42);
    border-radius: 50%;
    background: #cfd7e2;
    box-shadow: 0 5px 12px rgb(0 0 0 / 0.34);
    transition: transform 150ms ease;
}

.profile-link img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.social-rail nav {
    display: flex;
    min-height: 0;
    margin-top: 18px;
    flex: 0 0 auto;
    flex-direction: column;
    gap: 10px;
}

.social-rail nav a,
.game-links a {
    position: relative;
    display: grid;
    place-items: center;
    text-decoration: none;
}

.social-rail nav a {
    width: 70px;
    height: 66px;
}

.social-rail nav img,
.game-links img {
    transition: transform 150ms ease, filter 150ms ease;
}

.social-rail nav img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    image-rendering: pixelated;
}

.social-rail nav span,
.game-links span {
    position: absolute;
    z-index: 20;
    padding: 6px 9px;
    border: 1px solid rgb(255 255 255 / 0.22);
    border-radius: 7px;
    color: white;
    font-family: Arial, sans-serif;
    font-size: 0.76rem;
    font-weight: 700;
    line-height: 1;
    white-space: nowrap;
    background: rgb(6 13 26 / 0.94);
    box-shadow: 0 5px 14px rgb(0 0 0 / 0.35);
    opacity: 0;
    pointer-events: none;
    transition: opacity 120ms ease, transform 120ms ease;
}

.social-rail nav span {
    top: 50%;
    left: calc(100% + 13px);
    transform: translate(-5px, -50%);
}

.social-rail nav a:hover,
.social-rail nav a:focus-visible,
.game-links a:hover,
.game-links a:focus-visible {
    z-index: 5;
}

.profile-link:hover,
.profile-link:focus-visible,
.social-rail nav a:hover img,
.social-rail nav a:focus-visible img,
.game-links a:hover img,
.game-links a:focus-visible img {
    filter: brightness(1.12);
    transform: translateY(-3px) scale(1.06);
}

.social-rail nav a:hover span,
.social-rail nav a:focus-visible span,
.game-links a:hover span,
.game-links a:focus-visible span {
    opacity: 1;
}

.social-rail a:focus-visible,
.game-art:focus-visible,
.game-links a:focus-visible {
    border-radius: 12px;
    outline: 3px solid white;
    outline-offset: 3px;
}

.site-banner {
    position: relative;
    display: grid;
    min-height: 390px;
    margin: 0;
    padding: 52px max(var(--page-gutter), calc((100vw - var(--content-width)) / 2));
    padding-left: max(calc(var(--rail-width) + 70px), calc((100vw - var(--content-width)) / 2));
    place-items: center;
    overflow: hidden;
    background: url("assets/header.png") center / 100% 100% no-repeat var(--blue);
    box-shadow: inset 0 -9px 30px rgb(0 0 0 / 0.22);
}

.site-banner img {
    position: relative;
    z-index: 1;
    width: min(82vw, 1180px);
    max-height: 280px;
    object-fit: contain;
    filter: drop-shadow(0 9px 2px rgb(0 0 0 / 0.24));
}

main {
    width: min(calc(100% - var(--rail-width) - 100px), var(--content-width));
    min-height: 620px;
    margin: 0 auto;
    padding: 78px 0 64px;
    transform: translateX(calc(var(--rail-width) / 2));
}

.game-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: clamp(28px, 4vw, 64px);
}

.game-card {
    min-width: 0;
    text-align: center;
}

.release-line {
    min-height: 1.4em;
    margin: 0 0 18px;
    font-family: "Super Mellow", Impact, sans-serif;
    font-size: clamp(1.15rem, 2vw, 1.85rem);
    font-weight: 400;
    letter-spacing: 0.01em;
    line-height: 1.2;
    text-wrap: balance;
}

.game-art {
    display: block;
    overflow: hidden;
    border: 8px solid transparent;
    border-radius: 22px;
    background: #efe8dc;
    box-shadow: 0 16px 34px rgb(0 0 0 / 0.5);
    transition: border-color 170ms ease, transform 170ms ease, box-shadow 170ms ease;
}

.game-art:hover {
    border-color: var(--blue-light);
    box-shadow: 0 20px 42px rgb(0 0 0 / 0.62);
    transform: translateY(-5px);
}

.game-art.bean-wizard {
    border-color: #c500c7;
}

.game-art.bean-wizard:hover {
    border-color: #f05af2;
}

.game-art img {
    width: 100%;
    aspect-ratio: 920 / 430;
    object-fit: cover;
}

.game-links {
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    margin-top: 16px;
}

.game-links a {
    width: 70px;
    height: 66px;
}

.game-links img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    image-rendering: pixelated;
}

.game-links span {
    left: 50%;
    bottom: calc(100% + 8px);
    transform: translate(-50%, 4px);
}

.game-links a:hover span,
.game-links a:focus-visible span {
    transform: translate(-50%, 0);
}

@media (max-width: 900px) {
    :root {
        --rail-width: 0px;
        --page-gutter: 18px;
    }

    body {
        padding-bottom: 96px;
    }

    .social-rail {
        top: auto;
        right: 12px;
        bottom: 10px;
        left: 12px;
        width: auto;
        height: 78px;
        padding: 7px 10px;
        border: 1px solid rgb(255 255 255 / 0.22);
        border-radius: 25px;
        flex-direction: row;
        background: linear-gradient(100deg, rgb(50 71 90 / 0.97), rgb(121 121 121 / 0.97));
        backdrop-filter: blur(10px);
    }

    .profile-link {
        width: 58px;
        height: 58px;
    }

    .social-rail nav {
        display: grid;
        margin: 0 0 0 6px;
        flex: 1;
        grid-template-columns: repeat(7, minmax(0, 1fr));
        align-items: center;
    }

    .social-rail nav a {
        width: min(12vw, 58px);
        height: min(12vw, 58px);
    }

    .social-rail nav span {
        top: auto;
        bottom: calc(100% + 8px);
        left: 50%;
        transform: translate(-50%, 5px);
    }

    .social-rail nav a:hover span,
    .social-rail nav a:focus-visible span {
        transform: translate(-50%, 0);
    }

    .site-banner {
        min-height: 245px;
        padding: 35px 24px;
    }

    .site-banner img {
        width: min(94vw, 780px);
    }

    main {
        width: min(calc(100% - 36px), 720px);
        transform: none;
    }

    main {
        padding: 50px 0 42px;
    }

    .game-grid {
        grid-template-columns: 1fr;
        gap: 54px;
    }
}

@media (max-width: 520px) {
    .social-rail {
        right: 6px;
        bottom: 6px;
        left: 6px;
        height: 68px;
        padding: 6px 7px;
        border-radius: 21px;
    }

    .profile-link {
        width: 50px;
        height: 50px;
    }

    .social-rail nav {
        margin-left: 3px;
    }

    .social-rail nav a {
        width: min(10vw, 50px);
        height: min(10vw, 50px);
    }

    .site-banner {
        min-height: 190px;
    }

    main {
        width: calc(100% - 24px);
        padding-top: 38px;
    }

    .release-line {
        margin-bottom: 12px;
        padding-inline: 8px;
        font-size: 1.1rem;
    }

    .game-art {
        border-width: 5px;
        border-radius: 14px;
    }

    .game-card h2 {
        font-size: 1.25rem;
    }

    .game-links {
        justify-content: center;
        margin-top: 12px;
    }

    .game-links a {
        width: 62px;
        height: 58px;
    }
}

@media (prefers-reduced-motion: reduce) {
    html {
        scroll-behavior: auto;
    }

    *,
    *::before,
    *::after {
        transition-duration: 0.01ms !important;
    }
}
