:root {
    --bg: #ffffff;
    --paper: rgba(255, 255, 255, 0.85);
    --ink: #1f1d1a;
    --muted: #5d5951;
    --line: #3b3b3b;
    --lightline: #888888;
    --lighterline: #b0b0b0;
    --max: 1100px;
    --radius: 18px;
    --shadow: 0 16px 40px rgba(31, 29, 26, 0.1);
}

* {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    margin: 0;
    padding: 1rem 0;
    min-height: 100vh;
    color: var(--ink);
    position: relative;
    background-color: var(--bg);
    font-family: "Segoe UI", sans-serif;
    line-height: 1.6;
}

#bg-layer {
    position: fixed;
    inset: 0;
    overflow: hidden;
    pointer-events: none;
    z-index: 0;
}

#bg-content {
    position: absolute;
    inset: 0;
    will-change: transform;
}

@property --bg-wipe {
    syntax: "<percentage>";
    inherits: false;
    initial-value: -12%;
}

.tm-bg {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
    pointer-events: none;
    opacity: 0.98;
    --bg-wipe: -12%;
    --bg-feather: 7%;
    -webkit-mask-image: linear-gradient(to bottom,
            #000 0%,
            #000 calc(var(--bg-wipe) - var(--bg-feather)),
            rgba(0, 0, 0, 0.45) var(--bg-wipe),
            transparent calc(var(--bg-wipe) + var(--bg-feather)),
            transparent 100%);
    mask-image: linear-gradient(to bottom,
            #000 0%,
            #000 calc(var(--bg-wipe) - var(--bg-feather)),
            rgba(0, 0, 0, 0.45) var(--bg-wipe),
            transparent calc(var(--bg-wipe) + var(--bg-feather)),
            transparent 100%);
    -webkit-mask-repeat: no-repeat;
    mask-repeat: no-repeat;
    animation: bgRevealFromTop 2000ms ease-out forwards;
}

a {
    color: inherit;
}

a:hover {
    color: inherit;
}

.panel a {
    color: #1f7a1f;
}

.panel a:hover {
    color: #39a339;
}

.site {
    position: relative;
    z-index: 1;
    width: min(100% - 2rem, var(--max));
    margin-inline: auto;
}

main {
    padding: 0 1rem;
}

h1 {
    margin-block-start: 0.5rem;
}

.topbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 1rem 1rem 1.5rem;
    position: sticky;
    top: 1rem;
    /* backdrop-filter: blur(10px); */
    z-index: 10;
    border: 2px solid var(--line);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    background: rgba(255, 255, 255);
}

.brand {
    text-decoration: none;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    font-size: 1.4rem;
}

.nav {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
}

.nav a {
    text-decoration: none;
    padding: 0.4rem 0.75rem;
    border: 2px solid transparent;
    border-radius: 999px;
    font-size: 0.9rem;
    transition: border-color 200ms ease, transform 200ms ease;
}

.nav a:hover {
    border-color: var(--lighterline);
    transform: translateY(-2px);
}

.nav a.is-active {
    border-color: var(--lightline);
    background: rgba(255, 255, 255, 0.65);
}

.page[hidden] {
    display: none;
}

.panel {
    background: var(--paper);
    border: 2px solid var(--line);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 1.2rem 1.8rem;
    display: grid;
    gap: 0.8rem;
    align-content: start;
}

.panel p {
    margin: 0;
    color: var(--ink);
    font-size: 1.2rem;
    line-height: 1.45;
}

.section {
    margin: 1.6rem 0;
}

.section-title {
    margin-bottom: 0.7rem;
    font-size: clamp(1.4rem, 2.8vw, 2rem);
    font-weight: 600;
    line-height: 1.15;
}

.intro-grid {
    display: grid;
    grid-template-columns: 1.45fr 0.85fr;
    gap: 1rem;
    align-items: stretch;
}

.photo-card {
    border: 2px solid var(--line);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    overflow: hidden;
    min-height: 280px;
}

.photo-card img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.games-grid {
    display: grid;
    gap: 1rem;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
}

.game-card {
    text-decoration: none;
    color: inherit;
    height: 100%;
    min-height: 430px;
    gap: 0.7rem;
}

.game-thumb {
    min-height: 0;
    aspect-ratio: 1 / 1;
}

.game-thumb-link {
    text-decoration: none;
    transition: transform 200ms ease;
}

.game-thumb-link:hover {
    transform: scale(1.03);
}

.game-title {
    margin: 0.5rem 0 0 0;
    font-size: 1.2rem;
    line-height: 1.2;
}

.game-description {
    margin: 0;
    font-size: 1rem;
    line-height: 1.35;
}

footer {
    padding: 2rem 0 2.5rem;
    color: var(--muted);
    font-size: 0.9rem;
}

.reveal {
    opacity: 0;
    transform: translateY(12px);
    animation: rise 650ms ease forwards;
}

.delay-1 {
    animation-delay: 100ms;
}

.delay-2 {
    animation-delay: 180ms;
}

@keyframes rise {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes bgRevealFromTop {
    0% {
        opacity: 0.98;
        --bg-wipe: -12%;
    }

    100% {
        opacity: 1;
        --bg-wipe: 110%;
    }
}

@media (prefers-reduced-motion: reduce) {
    .tm-bg {
        animation: none;
        opacity: 1;
        -webkit-mask-image: none;
        mask-image: none;
    }
}

@media (max-width: 900px) {
    .intro-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 620px) {
    .topbar {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.55rem;
    }
}