@import url('https://fonts.googleapis.com/css2?family=DM+Sans:ital,opsz,wght@0,9..40,100..1000;1,9..40,100..1000&display=swap');

/* ===== custom properties ===== */
:root {
    --bg: #080808;
    --surface: #111111;
    --surface-alt: #161616;
    --border: #2a2a2a;
    --border-hover: #505050;
    --text: #c8c8c8;
    --text-dim: #707070;
    --text-bright: #f0f0f0;
    --accent: #ffffff;
    --transition-fast: 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    --transition-med: 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    --transition-slow: 0.7s cubic-bezier(0.22, 1, 0.36, 1);
}

/* ===== reset ===== */
*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    width: 100%;
    overflow-x: hidden;
    scroll-behavior: smooth;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body {
    background-color: var(--bg);
    color: var(--text);
    font-family: "DM Sans", sans-serif;
    font-size: 16px;
    line-height: 1.6;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 80px 60px;
    position: relative;
}

/* ===== background ===== */
#bg-img {
    position: fixed;
    inset: 0;
    z-index: -1;
    pointer-events: none;
    opacity: 0.25;
    background-image: url("assets/img/bg.gif");
    background-position: center;
    background-size: cover;
    filter: saturate(0.3) brightness(0.5) url(#wave-filter);
}

/* ===== page enter animation ===== */
@keyframes pageIn {
    from {
        opacity: 0;
        transform: translateY(24px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(40px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes slideInLeft {
    from {
        opacity: 0;
        transform: translateX(-30px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes revealLine {
    from { transform: scaleX(0); }
    to { transform: scaleX(1); }
}

@keyframes glowPulse {
    0%, 100% { opacity: 0.25; }
    50% { opacity: 0.4; }
}

body > *:not(#bg-img) {
    animation: pageIn 0.6s var(--transition-slow) backwards;
}

body > *:nth-child(2) { animation-delay: 0.1s; }
body > *:nth-child(3) { animation-delay: 0.2s; }
body > *:nth-child(4) { animation-delay: 0.3s; }
body > *:nth-child(5) { animation-delay: 0.4s; }
body > *:nth-child(6) { animation-delay: 0.5s; }
body > *:nth-child(7) { animation-delay: 0.6s; }

/* ===== typography ===== */
#intro {
    text-align: center;
    font-size: 18px;
    color: var(--text-dim);
    letter-spacing: 4px;
    text-transform: uppercase;
    font-weight: 400;
    margin-bottom: 8px;
    animation: fadeIn 1s ease backwards;
    animation-delay: 0.3s;
}

#main-title {
    text-align: center;
    font-size: 80px;
    font-weight: 900;
    letter-spacing: -3px;
    color: var(--text-bright);
    margin-bottom: 12px;
    transition: letter-spacing var(--transition-slow), color var(--transition-fast);
    position: relative;
}

#main-title::after {
    content: '';
    display: block;
    width: 60px;
    height: 2px;
    background: var(--border-hover);
    margin: 16px auto 0;
    animation: revealLine 0.8s var(--transition-slow) backwards;
    animation-delay: 0.5s;
    transform-origin: left;
}

#main-title:hover {
    letter-spacing: 6px;
    color: var(--accent);
}

strong {
    color: var(--accent);
    font-weight: 700;
    background: none;
    padding: 0;
}

a {
    color: var(--text);
    text-decoration: none;
    transition: color var(--transition-fast);
    border: none;
    width: auto;
    height: auto;
    font-size: inherit;
    display: inline;
    padding: 0;
    margin: 0;
}

a:hover {
    color: var(--accent);
    background: none;
}

/* ===== navigation ===== */
nav {
    width: 100%;
    display: flex;
    justify-content: center;
    margin-top: 32px;
    margin-bottom: 40px;
    z-index: 10;
}

ul {
    display: flex;
    justify-content: center;
    gap: 2px;
    padding: 0;
    list-style: none;
}

.nav-button {
    text-decoration: none;
    background: var(--surface);
    color: var(--text-dim);
    font-family: "DM Sans", sans-serif;
    font-size: 14px;
    font-weight: 500;
    letter-spacing: 1px;
    text-transform: uppercase;
    padding: 12px 28px;
    border: 1px solid var(--border);
    border-radius: 0;
    cursor: pointer;
    transition: all var(--transition-fast);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
}

.nav-button::before {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 2px;
    background: var(--accent);
    transform: scaleX(0);
    transform-origin: left;
    transition: transform var(--transition-med);
}

.nav-button:hover {
    background: var(--surface-alt);
    color: var(--text-bright);
    border-color: var(--border-hover);
}

.nav-button:hover::before {
    transform: scaleX(1);
}

.nav-button.active {
    background: var(--surface-alt);
    color: var(--accent);
    border-color: var(--border-hover);
}

.nav-button.active::before {
    transform: scaleX(1);
}

/* ===== info containers ===== */
.info-container {
    width: 100%;
    max-width: 900px;
    margin: 0 auto 32px;
    padding: 28px 32px;
    border: 1px solid var(--border);
    border-radius: 0;
    background: var(--surface);
    animation: slideUp 0.6s var(--transition-slow) backwards;
    animation-delay: 0.4s;
}

#about {
    font-size: 16px;
    line-height: 1.8;
    color: var(--text);
}

/* ===== socials ===== */
#socials {
    list-style: none;
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 8px;
}

#socials li {
    list-style: none;
}

#socials a {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 10px 24px;
    font-size: 14px;
    font-weight: 500;
    letter-spacing: 1px;
    text-transform: uppercase;
    color: var(--text-dim);
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 0;
    transition: all var(--transition-fast);
}

#socials a:hover {
    color: var(--accent);
    border-color: var(--border-hover);
    background: var(--surface-alt);
}

/* ===== projects nav ===== */
#projects-nav {
    margin: 0 0 24px;
    width: 100%;
}

#projects-nav ul {
    flex-wrap: wrap;
    gap: 2px;
}

/* ===== projects sections ===== */
#projects-sections {
    position: relative;
    width: 100%;
    max-width: 1100px;
    min-height: 400px;
    margin: 0 auto;
    border: 1px solid var(--border);
    background: var(--surface);
    overflow: hidden;
}

#projects-sections > div {
    position: absolute;
    inset: 0;
    width: 100%;
    padding: 32px;
    opacity: 0;
    transform: translateY(20px);
    transition: opacity var(--transition-med), transform var(--transition-med);
    pointer-events: none;
    overflow-y: auto;
}

#projects-sections > div.section-active {
    opacity: 1;
    transform: translateY(0);
    pointer-events: auto;
    position: relative;
}

#projects-sections #main-title {
    font-size: 36px;
    letter-spacing: -1px;
    margin-bottom: 16px;
}

#projects-sections #main-title::after {
    width: 40px;
    margin-top: 12px;
}

#projects-sections .info-container {
    border-color: var(--border);
    background: var(--surface-alt);
    margin-bottom: 24px;
    animation: none;
}

/* ===== animations section ===== */
#anims-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 16px;
}

#animsFrame {
    border: 1px solid var(--border);
    border-radius: 0;
}

/* ===== game list ===== */
.games-container {
    width: 100%;
}

#game-list {
    display: flex;
    flex-direction: column;
    width: 100%;
    gap: 4px;
}

.game-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    padding: 14px 20px;
    font-size: 16px;
    font-weight: 500;
    color: var(--text);
    background: var(--surface-alt);
    border: 1px solid var(--border);
    border-radius: 0;
    text-decoration: none;
    transition: all var(--transition-fast);
    position: relative;
    overflow: hidden;
}

.game-item::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    width: 2px;
    height: 100%;
    background: var(--accent);
    transform: scaleY(0);
    transition: transform var(--transition-med);
}

.game-item:hover {
    color: var(--accent);
    border-color: var(--border-hover);
    background: #1c1c1c;
    padding-left: 28px;
}

.game-item:hover::before {
    transform: scaleY(1);
}

.game-date {
    color: var(--text-dim);
    font-size: 13px;
    font-weight: 400;
    letter-spacing: 0.5px;
}

/* ===== wallpaper grid ===== */
.wallpaper-grid {
    width: 100%;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 4px;
    margin: 24px 0;
}

.wallpaper-item {
    position: relative;
    overflow: hidden;
    border: 1px solid var(--border);
    border-radius: 0;
    background: var(--surface-alt);
    display: block;
    aspect-ratio: 16 / 10;
    cursor: pointer;
    text-decoration: none;
    transition: border-color var(--transition-fast);
}

.wallpaper-item::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(to top, rgba(8,8,8,0.6) 0%, transparent 50%);
    opacity: 0;
    transition: opacity var(--transition-fast);
    pointer-events: none;
}

.wallpaper-item:hover {
    border-color: var(--border-hover);
    background: var(--surface-alt);
    filter: none;
}

.wallpaper-item:hover::after {
    opacity: 1;
}

.wallpaper-item:hover .wallpaper-thumb {
    transform: scale(1.05);
}

.wallpaper-thumb {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    border: none;
    border-radius: 0;
    background: var(--surface);
    transition: transform var(--transition-med);
}

.wallpaper-title {
    font-size: 14px;
    color: var(--text-dim);
    text-align: center;
    font-weight: 500;
    width: 100%;
    background: none;
    padding: 8px;
}

/* ===== scroll reveal for elements ===== */
.reveal {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.6s ease, transform 0.6s ease;
}

.reveal.visible {
    opacity: 1;
    transform: translateY(0);
}

/* ===== responsive ===== */
@media (max-width: 1024px) {
    body {
        padding: 48px 32px;
    }

    #main-title {
        font-size: 56px;
    }

    .nav-button {
        font-size: 13px;
        padding: 10px 20px;
    }
}

@media (max-width: 768px) {
    body {
        padding: 24px 16px;
    }

    #main-title {
        font-size: 40px;
        letter-spacing: -2px;
    }

    #main-title:hover {
        letter-spacing: 2px;
    }

    #intro {
        font-size: 13px;
        letter-spacing: 2px;
    }

    nav ul {
        flex-wrap: wrap;
        gap: 4px;
    }

    .nav-button {
        font-size: 12px;
        padding: 10px 16px;
        flex: 1;
        min-width: 0;
    }

    #projects-sections {
        width: 100%;
    }

    #projects-sections > div {
        padding: 20px 16px;
    }

    #projects-sections > div,
    #projects-sections > div.section-active {
        position: relative;
    }

    .wallpaper-grid {
        grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
        gap: 3px;
    }

    .game-item {
        font-size: 14px;
        flex-direction: column;
        align-items: flex-start;
        gap: 4px;
        padding: 12px 16px;
    }

    #animsFrame {
        width: 100%;
        height: auto;
        aspect-ratio: 16 / 9;
    }

    .info-container {
        padding: 20px 16px;
    }

    #about {
        font-size: 14px;
    }
}

@media (max-width: 420px) {
    body {
        padding: 16px 12px;
    }

    #main-title {
        font-size: 32px;
    }

    .nav-button {
        font-size: 11px;
        padding: 8px 12px;
    }

    .wallpaper-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 2px;
    }

    #projects-sections > div {
        padding: 16px 12px;
    }
}
