@keyframes scrollBg {
    from { background-position: 0 0; }
    to { background-position: 768px 768px; }
}

@keyframes scrollBgM {
    from { background-position: 0 94px; }
    to { background-position: 768px 862px; }
}

@keyframes scaleIn {
    0% { transform: scale(0); }
    50% { transform: scale(1.05); }
    100% { transform: scale(1); }
}

@keyframes upAndDown {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-15px); }
}

@keyframes slideLeft {
    0% {
        transform: translateX(-300%);
    }
    50% {
        transform: translateX(2%);
    }
    100% {
        transform: translateX(0%);
    }
}

@keyframes slideDown {
    0% {
        transform: translateY(-300%);
    }
    50% {
        transform: translateY(2%);
    }
    100% {
        transform: translateY(0%);
    }
}

:root {
    --yellow: #ffff00;
    --black-trans: rgba(0, 0, 0, 0.6);
    --waves: url('https://files.catbox.moe/rff0tn.png');
    --gradient: url('https://files.catbox.moe/f3a7yl.png');
}

@font-face {
    font-family: 'Ad Lib';
    font-style: normal;
    font-weight: normal;
    src: local('Ad Lib'), url('assets/fonts/adlib.woff') format('woff');
}

*, *::before, *::after {
    box-sizing: border-box;
}

html, body { 
    margin: 0; 
    padding: 0;
    overflow-x: hidden;
    background-color: black;
    color: white;
    font-family:'Ad Lib';
    text-shadow: 2px 2px 0px #000;
    image-rendering: pixelated;
}

a {
    color: white;
    text-decoration: none;
    transition: 0.2s;
}

a:hover {
    color: var(--yellow);
}

.wrapper {
    position: relative;
    width: 100%;

    padding: 64px 20px 256px;
    margin-top: -96px;
    display: flex;
    justify-content: center;
    background-repeat: repeat;
    animation: scrollBg 70s linear infinite;

    overflow: visible; 
}

.wrapper::before {
    content: '';
    position: absolute;
    top: 0; 
    left: 0; 
    width: 100%; 
    height: 96px;
    background: inherit;

    mask-image: var(--waves);
    -webkit-mask-image: var(--waves);
    mask-size: auto 96px; 
    mask-repeat: repeat-x;

    background-position: 0 164px;

    transform: translateY(-94px); 
    z-index: 2;
    animation: scrollBgM 70s linear infinite;
}

.content-grid img {
    max-width: 100%;
    height: auto;
    object-fit: contain;
}

.wrapper:first-of-type {
    margin-top: 0;
    padding-top: 100px;
}
.wrapper:first-of-type::before {
    display: none;
}

.container {
    max-width: 1100px;
    width: 100%;
    z-index: 3;
}

.content-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 40px;
    align-items: center;
}

.devlog-container {
    position: relative;
    padding: 24px 16px;
    max-width: 650px;
    margin: 24px auto;
    flex-shrink: 0;
    color: #fff;
    z-index: 2;
    overflow: hidden;
    font-size: 1.25rem;
}

.devlog-thumbnail {
    width: 100%;
    height: auto;
    border-radius: 16px;
    transition: transform 0.2s ease;
}

.devlog-list {
    display: grid;
    grid-template-columns: repeat(1, 1fr);
    gap: 16px;
    
    list-style: none;
    padding: 0;
    margin: 0;
    text-align: center;
}

.ttext {
    background-color: var(--black-trans);
    padding: 30px;
    border-radius: 16px;
    border: 4px solid transparent;
}

.headline-text {
    font-size: clamp(2rem, 5vw, 3.2rem);
    font-weight: bold;
    font-style: italic;
    color: var(--yellow);
    margin: 0 0 1rem 0;
}

.normal-text {
    font-size: 1.2rem; line-height: 1.6;
}
.quote-text {
    font-size: 1.8rem; color: #ccc;
}

.about-section {
    background-image: url('assets/img/background/storybackground.png');
}

.story-section {
    background-image: url('assets/img/background/aboutbackground.png');
}

.team-section {
    background-image: url('assets/img/background/teambackground.png');
}

.faq-section {
    background-image: url('assets/img/background/faqbackground.png');
}

.lib-section {
    background-image: url('assets/img/background/libbackground.png');
}

.cover-section {
    background-image: url('assets/img/background/coverbackground.png');
}

.about-section::before, .faq-section::before, .footer-section::before, .lib-section::before {
    mask-image: var(--gradient);
    -webkit-mask-image: var(--gradient);
}

.story-section::before, .team-section::before {
    mask-size: auto 192px;
}

.footer-section {
    background-color: #000;
    padding: 120px 20px 120px;
    position: relative;
    z-index: 10;
}

.footer-section::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 96px;

    background-color: #000 !important; 
    background-image: none !important; 

    mask-size: auto 96px;
    mask-repeat: repeat-x;

    transform: translateY(-96px);
    animation: none !important; 
    z-index: 2;
}

.footer-section .container {
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.team-grid {
    display: flex;
    flex-direction: column;
    gap: 30px;
    margin-top: 40px;
    width: 100%;
    align-items: center;
    justify-content: center;
}

.team-member {
    display: flex;
    gap: 30px;
    background: var(--black-trans);
    padding: 30px;
    border-radius: 16px;
    width: 100%;
    max-width: 800px;
    margin: 0 auto;
    align-items: center;
    transform: scale(0);
}

.team-member.is-onscreen {
    animation: scaleIn 0.5s ease forwards;
}

.team-member a img:hover{
    transform: scale(1.05);
    transition: 0.075s;
}

.dev-grid {
    display: flex;
    flex-direction: column;
    gap: 30px;
    margin-top: 40px;
    width: 100%;
    align-items: center;
    justify-content: center;
}

.dev-info {
    display: flex;
    flex-direction: column;
    gap: 30px;
    background: var(--black-trans);
    padding: 30px;
    border-radius: 16px;
    width: 100%;
    max-width: 800px;
    margin: 0 auto;
    text-align: center;
    align-items: center;
}

.dev-info img:hover{
    transform: scale(1.05);
    transition: 0.075s;
}

.mario-float {
    max-width: 100%;
    height: auto;
    transform: scale(0);
}

.mario-float.is-onscreen {
    animation: scaleIn 0.5s ease forwards, upAndDown 4s infinite ease-in-out reverse 0.5s;
}

.logo {
    margin-top: -10%;
    padding-bottom: 0%;
    margin-left: -35%;
    z-index: 5;
}

.logo.is-onscreen {
    animation: slideDown 0.75s ease forwards;
}

.cover-scene {
    position: relative;
    width: 100%;
    min-height: 450px; 
    margin: 0 auto;
}

.mario-cover {
    position: absolute;
    bottom: -25%;
    left: -20%;
    max-width: 608px;
    height: auto;
}

.mario-cover.is-onscreen {
    animation: slideLeft 0.75s ease forwards;
}

.stella-cover {
    position: absolute;
    bottom: 10%;
    left: -40%;
    max-width: 448px;
    height: auto;
}

.stella-cover.is-onscreen {
    animation: slideLeft 0.75s ease forwards, upAndDown 8s infinite ease-in-out 0.75s;
}

.evil-cover {
    position: absolute;
    bottom: 0%;
    left: 50%;
    max-width: 1120px;
    height: auto;
    z-index: -2;
}

.evil-cover.is-onscreen {
    animation: slideLeft 0.75s ease forwards, upAndDown 8s infinite ease-in-out 0.75s;
}

.island-cover {
    position: absolute;
    bottom: 70%;
    left: -40%;
    max-width: 768px;
    height: auto;
    z-index: -2;
    animation: upAndDown 8s infinite ease-in-out;
}

.island-coverB {
    position: absolute;
    bottom: 0%;
    left: -15%;
    max-width: 768px;
    height: auto;
    z-index: -2;
    animation: upAndDown 8s infinite ease-in-out;
}

.lang-controls {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 1000;
    display: flex;
    gap: 12px;
    padding: 8px;
    border-radius: 8px;
    background: rgba(0, 0, 0, 0.3);
}

.lang-button {
    background: var(--black-trans);
    color: white;
    border: 3px solid var(--yellow);
    padding: 8px 16px;
    font-family: 'Ad Lib', sans-serif;
    font-size: 1.1rem;
    text-transform: uppercase;
    cursor: pointer;
    image-rendering: pixelated;
    
    box-shadow: 4px 4px 0px #000; 
    transition: all 0.15s ease;
}

.lang-button:hover {
    background: var(--yellow);
    color: black;
    transform: translateY(-2px) scale(1.05);
    box-shadow: 6px 6px 0px #000;
}

.lang-button:active {
    transform: translateY(4px) scale(1);
    box-shadow: 0px 0px 0px #000; 
}

.lang-button.active {
    background: var(--yellow);
    color: black;
    transform: translateY(4px);
    box-shadow: inset 4px 4px 0px var(--black-trans);
    cursor: default;
    border-color: #cca300;
}

.lang-button:focus-visible {
    outline: 3px dashed var(--yellow);
    outline-offset: 4px;
}

@media (max-width: 600px) {
    .logo {
        margin-left: 0;
        margin-top: -100px;
        width: 100%;
        margin-right: auto;
    }

    .mario-cover {
        width: 100%;
    }

    .stella-cover {
        width: 75%;
    }

    .evil-cover {
        max-width: 0px;
    }

    .island-cover {
        top: -50%;
        width: 125%;
    }

    .island-coverB {
        width: 100%;
    }

    .lang-controls {
        top: 10px;
        right: 10px;
        gap: 6px;
    }
    
    .lang-button {
        padding: 4px 8px;
        font-size: 0.8rem;
    }
}