* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    scroll-behavior: smooth;
}

body {
    min-height: 100vh;
    font-family: "Segoe UI", sans-serif;
    color: rgb(243, 242, 227);
    background-image: url("background.svg");
    background-size: cover;
    background-repeat: no-repeat;
    background-position: center;
    background-attachment: fixed;
    animation: panBackground 180s ease-in-out infinite alternate;
}
@keyframes panBackground {
    0% {
        background-position: 0% 0%;
    }

    25% {
        background-position: 0% 75%;
    }

    50% {
        background-position: 0% 25%;
    }

    75% {
        background-position: 0% 100%;
    }

    100% {
        background-position: 0% 0%;
    }
}   
main {
    width: min(1150px, calc(100% - 2rem));
    margin: 0 auto;
    padding: 4rem 0;
}

/* Shared card styling */

section {
    margin-bottom: 4rem;
    padding: 3rem;
    background-color: rgba(0, 0, 0, 0.35);
    border: 1px solid rgba(243, 242, 227, 0.25);
    border-radius: 30px;
    backdrop-filter: blur(8px);
}

a {
    text-decoration: underline;
    color: rgba(243, 242, 227, 0.85);
}

/* About Me */

.about-card {
    min-height: 40vh;
    display: grid;
    place-items: center;
    text-align: center;
}

.about-content {
    max-width: 850px;
}

    .about-content h1 {
        font-size: clamp(3rem, 8vw, 6rem);
        line-height: 1;
        margin-bottom: 1rem;
    }

    .about-content h2 {
        font-size: clamp(1.25rem, 3vw, 2rem);
        font-weight: 500;
        margin-bottom: 2rem;
        color: rgba(243, 242, 227, 0.85);
    }

    .about-content p {
        font-size: clamp(1.05rem, 2vw, 1.35rem);
        line-height: 1.7;
        margin-bottom: 1.25rem;
        text-align: justify;
        text-align-last: center;
    }

/* Project cards */

.project-card {
    display: grid;
    gap: 2.5rem;
    align-items: center;
    min-height: 40vh;
}

.project-card--image-right {
    grid-template-columns: 2fr 1fr;
}

.project-card--image-left {
    grid-template-columns: 1fr 2fr;
}

.project-card--stacked {
    grid-template-columns: 1fr;
}

.project-content {
    display: flex;
    flex-direction: column;
    justify-content: center;
}

    .project-content h2 {
        font-size: clamp(2rem, 5vw, 4rem);
        line-height: 1.1;
        margin-bottom: 1.5rem;
    }

    .project-content p {
        font-size: clamp(1rem, 2vw, 1.35rem);
        line-height: 1.7;
        margin-bottom: 1rem;
        color: rgba(243, 242, 227, 0.9);
    }

.project-media {
    width: 100%;
    height: 100%;
}

    .project-media img,
    .project-media video {
        width: 100%;
        height: 100%;
        min-height: 260px;
        display: block;
        object-fit: cover;
        border-radius: 24px;
        border: 1px solid rgba(243, 242, 227, 0.25);
        box-shadow: 0 14px 40px rgba(0, 0, 0, 0.35);
    }

.project-media--wide img,
.project-media--wide video {
    max-height: 800px;
}
#othello .project-media {
    display: flex;
    justify-content: center;
    align-items: center;
}

    #othello .project-media video {
        width: auto;
        max-width: 100%;
        height: auto;
        object-fit: contain;
    }

#game_engine .project-media {
    display: flex;
    justify-content: center;
    align-items: center;
}

    #game_engine .project-media video {
        width: auto;
        max-width: 100%;
        height: auto;
        object-fit: contain;
    }

#othello_bottom {
    grid-column: 1 / -1;
}

#project_bottom {
    grid-column: 1 / -1;
}

/* Mobile layout */

@media (max-width: 800px) {
    main {
        width: min(100% - 1rem, 1150px);
        padding: 1rem 0;
    }

    section {
        padding: 2rem;
        margin-bottom: 2rem;
        border-radius: 24px;
    }

    .about-card {
        min-height: 40vh;
    }

    .project-card,
    .project-card--image-right,
    .project-card--image-left,
    .project-card--stacked {
        grid-template-columns: 1fr;
    }

        .project-card--image-left .project-media {
            order: 2;
        }

        .project-card--image-left .project-content {
            order: 1;
        }

    .project-media img,
    .project-media video {
        min-height: 220px;
    }
}
