* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    /* user-select: none; */
    scrollbar-color: rgb(155, 155, 155) transparent;
}

*::selection {
    background: var(--border-color);
    color: var(--card-bg);
}

:root {
    --primary-color: #1a1a1a;
    --secondary-color: #4a4a4a;
    --light-bg: #e8e4df;
    --card-bg: #f5f3f0;
    --text-color: #1a1a1a;
    --text-secondary: #6a6a6a;
    --accent: #2d9a5f;
    --border-color: #d4d0cb;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Helvetica Neue', Arial, sans-serif;
    background: var(--light-bg);
    color: var(--text-color);
    line-height: 1.6;
    min-height: 100vh;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* Navbar */
.navbar {
    background: transparent;
    padding: 1.5rem 0;
    position: sticky;
    top: 0;
    z-index: 100;
    backdrop-filter: blur(10px);
}

.navbar .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    color: var(--text-color);
    font-size: 1.2rem;
    font-weight: 600;
    letter-spacing: -0.5px;
}

.nav-links {
    display: flex;
    list-style: none;
    gap: 2.5rem;
}

.nav-links a {
    color: var(--text-secondary);
    text-decoration: none;
    transition: color 0.3s;
    font-weight: 400;
    font-size: 0.95rem;
    letter-spacing: 0.3px;
}

.nav-links a:hover {
    color: var(--text-color);
}

.nav-links a.active {
    color: var(--text-color);
    position: relative;
    font-weight: 500;
}

.nav-links a.active::after {
    content: '';
    position: absolute;
    bottom: -6px;
    left: 0;
    width: 100%;
    height: 1px;
    background: var(--text-color);
}

/* Main Content */
main {
    padding: 2rem 0 4rem;
}

.section {
    margin-bottom: 4rem;
}

.wip-notice {
    margin: 0 0 2rem;
    padding: 0.9rem 1.1rem;
    border-radius: 10px;
    border: 1px solid var(--border-color);
    background: linear-gradient(90deg, #efe9e3 0%, #f5f3f0 100%);
}

.wip-notice p {
    margin: 0;
    color: var(--text-secondary);
    font-size: 0.95rem;
    letter-spacing: 0.2px;
}

.games-update-note {
    display: block;
    width: fit-content;
    margin: 2rem auto 0;
}

/* Hero Section with Collage */
.hero-collage {
    text-align: center;
    padding: 4rem 2rem 6rem;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 3rem;
}

.collage-container {
    position: relative;
    max-width: 900px;
    width: 100%;
    margin: 0 auto;
}

.collage-images {
    display: grid;
    grid-template-columns: repeat(8, 1fr);
    grid-template-rows: repeat(2, 200px);
    gap: 0.5rem;
    margin-bottom: 2rem;
}

.collage-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    filter: grayscale(20%);
    transition: filter 0.3s, transform 0.3s;
}

.collage-img:hover {
    filter: grayscale(0%);
    transform: scale(1.05);
    z-index: 10;
}

.collage-img-1 {
    grid-column: 1 / 3;
    grid-row: 1 / 2;
}

.collage-img-2 {
    grid-column: 3 / 4;
    grid-row: 1 / 2;
}

.collage-img-3 {
    grid-column: 4 / 6;
    grid-row: 1 / 3;
}

.collage-img-4 {
    grid-column: 6 / 7;
    grid-row: 1 / 2;
}

.collage-img-5 {
    grid-column: 7 / 9;
    grid-row: 1 / 2;
}

.collage-img-6 {
    grid-column: 1 / 2;
    grid-row: 2 / 3;
}

.collage-img-7 {
    grid-column: 2 / 4;
    grid-row: 2 / 3;
}

.collage-img-8 {
    grid-column: 6 / 9;
    grid-row: 2 / 3;
}

.collage-text {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 20;
    pointer-events: none;
}

.collage-title {
    font-size: 9rem;
    font-weight: 800;
    letter-spacing: -5px;
    line-height: 0.9;
    /* Semi-transparent text effect */
    color: rgba(0, 0, 0, 0.822);
    /* Slight white shadow for glow */
    text-shadow: 0 6px 57px rgba(255, 255, 255, 0.32);
    mix-blend-mode: multiply;
}

.hero-content {
    max-width: 700px;
    margin: 2rem auto;
}

.hero-tagline {
    font-size: 1.15rem;
    color: var(--text-color);
    margin-bottom: 1.5rem;
    font-weight: 500;
}

.hero-description {
    font-size: 1rem;
    color: var(--text-secondary);
    line-height: 1.8;
    font-weight: 300;
}

/* scroll indicator removed */

.hero-buttons {
    display: flex;
    gap: 1.5rem;
    flex-wrap: wrap;
    justify-content: center;
    margin-top: 2rem;
}

.hero-button {
    padding: 1rem 2.5rem;
    background: var(--text-color);
    color: var(--light-bg);
    text-decoration: none;
    border-radius: 50px;
    font-weight: 500;
    font-size: 0.95rem;
    transition: transform 0.3s, opacity 0.3s;
    letter-spacing: 0.3px;
}

.hero-button:hover {
    transform: translateY(-2px);
    opacity: 0.85;
}

/* Standard Hero for other pages */
.hero {
    text-align: center;
    padding: 8rem 2rem 6rem;
    min-height: 70vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
}

.hero-title {
    font-size: 7rem;
    margin-bottom: 2rem;
    font-weight: 700;
    letter-spacing: -3px;
    color: var(--text-color);
    line-height: 0.95;
}

.section-title {
    font-size: 4rem;
    margin-bottom: 3rem;
    color: var(--text-color);
    font-weight: 700;
    letter-spacing: -2px;
}

/* Profile Section */
.profile-card {
    background: var(--card-bg);
    border-radius: 12px;
    padding: 3rem;
    display: flex;
    gap: 3rem;
    align-items: center;
    box-shadow: 0 2px 20px rgba(0, 0, 0, 0.05);
    border: 1px solid var(--border-color);
}

.profile-image {
    width: 220px;
    height: 220px;
    border-radius: 8px;
    object-fit: cover;
    border: none;
}

.profile-info h3 {
    font-size: 2.5rem;
    margin-bottom: 1.5rem;
    color: var(--text-color);
    font-weight: 700;
    letter-spacing: -1px;
}

.profile-info p {
    color: var(--text-secondary);
    margin-bottom: 2rem;
    line-height: 1.8;
    font-size: 1.05rem;
}

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

.social-link {
    display: inline-block;
    padding: 0.75rem 1.5rem;
    background: var(--text-color);
    color: var(--light-bg);
    text-decoration: none;
    border-radius: 50px;
    transition: transform 0.3s, opacity 0.3s;
    font-size: 0.9rem;
    font-weight: 500;
}

.social-link:hover {
    transform: translateY(-2px);
    opacity: 0.85;
}

/* Grid Layout */
.grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 2rem;
}

/* Music grid interactions */
.music-grid .music-card {
    display: block;
    aspect-ratio: 3 / 2;
    background: transparent;
    border: none;
    box-shadow: none;
    transition: transform 0.3s ease, box-shadow 0.3s ease, filter 0.3s ease;
    scrollbar-color: transparent transparent;
}

.music-grid:hover .music-card,
.music-grid:focus-within .music-card {
    filter: grayscale(38%) brightness(0.84);
}

.music-grid:hover .music-card:hover,
.music-grid:focus-within .music-card:focus {
    transform: translateY(-10px) scale(1.03);
    filter: none;
    z-index: 2;
    box-shadow: none;
}

.music-preview {
    height: 100%;
    background: transparent;
    line-height: 0;
    border-radius: 12px;
}

.music-preview iframe {
    border-radius: 12px;
    width: 100%;
    height: 100%;
    border: 0;
    display: block;
}

.music-pagination {
    margin-top: 1.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.9rem;
}

.music-pagination-button {
    border: 1px solid var(--border-color);
    background: var(--card-bg);
    color: var(--text-color);
    border-radius: 999px;
    padding: 0.45rem 0.95rem;
    font: inherit;
    cursor: pointer;
    transition: transform 0.2s ease, opacity 0.2s ease;
}

.music-pagination-button:hover:not(:disabled),
.music-pagination-button:focus-visible:not(:disabled) {
    transform: translateY(-1px);
}

.music-pagination-button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.music-pagination-status {
    color: var(--text-secondary);
    font-weight: 500;
}

/* Games stacked cards */
.games-stack {
    --stack-count: 1;
    --stack-peek: 88px;
    --stack-card-height: 440px;
    --stack-hit-step: 90px;
    /* decides the area of interaction when hovering */
    --stack-hit-offset: 18px;
    --stack-width: min(100%, 760px);
    --side-card-height: calc(var(--stack-card-height) + var(--side-card-height-extra));
    --side-card-width: calc(var(--side-card-height) * 2 / 3);
    --side-card-gap: clamp(14px, 2vw, 24px);
    --side-card-top-shift: 10px;
    --side-card-height-extra: 72px;
    position: relative;
    width: var(--stack-width);
    margin: 0 auto;
    min-height: calc(var(--stack-card-height) + (var(--stack-count) - 1) * var(--stack-peek));
}

.games-stack .card {
    position: absolute;
    inset: 0 auto auto 0;
    width: 100%;
    top: calc(var(--stack-index, 0) * var(--stack-peek));
    z-index: calc(10 + var(--stack-index, 0));
    transform-origin: center top;
    transition: transform 0.3s ease, box-shadow 0.3s ease, filter 0.3s ease;
}

.games-stack.has-active-card .card {
    filter: brightness(0.86);
}

.games-stack .card.is-active {
    transform: translateY(-12px) scale(1.035);
    z-index: 999;
    filter: none;
    box-shadow: 0 14px 36px rgba(0, 0, 0, 0.14);
}

.games-stack .card:not(.is-active):hover {
    transform: none;
    box-shadow: 0 2px 15px rgba(0, 0, 0, 0.05);
}

.games-stack:not(.has-active-card) .card {
    transform: none;
}

.game-side-card {
    position: absolute;
    width: var(--side-card-width);
    height: var(--side-card-height);
    aspect-ratio: 2 / 3;
    background: color-mix(in srgb, var(--card-bg) 92%, white 8%);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    box-shadow: 0 12px 28px rgba(0, 0, 0, 0.1);
    padding: 1rem 1rem 1.1rem;
    opacity: 0;
    transition: opacity 0.25s ease;
    pointer-events: none;
    z-index: 1200;
    display: flex;
    flex-direction: column;
}

.game-side-card.is-visible {
    opacity: 1;
}

.game-side-card-left {
    height: calc(var(--stack-card-height) * 0.956);
    width: calc(var(--stack-card-height) * 7 / 10 * 0.96);
    right: calc(100% + var(--side-card-gap));
}

.game-side-card-right {
    height: calc(var(--stack-card-height) * 0.96);
    width: calc(var(--stack-card-height) * 7 / 10 * 0.96);
    left: calc(100% + var(--side-card-gap));
}

.game-side-card-header {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 0.5rem;
    margin-bottom: 0.65rem;
}

.game-side-card h4 {
    font-size: 1rem;
    margin: 0;
    color: var(--text-color);
}

.game-side-card-main-name {
    color: var(--text-secondary);
    font-size: 0.82rem;
    font-weight: 600;
    line-height: 1;
    text-align: right;
}

.game-side-card-images {
    display: grid;
    gap: 0.45rem;
    margin-bottom: 0.7rem;
    flex: 1;
}

.game-side-card-image-block {
    display: grid;
    gap: 0.35rem;
}

.game-side-card-images img {
    width: 100%;
    aspect-ratio: 16 / 9;
    object-fit: cover;
    border-radius: 8px;
    border: 1px solid var(--border-color);
}

.game-side-card-images.is-single .game-side-card-image-block {
    height: 100%;
}

.game-side-card-images.is-single img {
    flex: 1;
    display: block;
    width: 100%;
    min-height: 0;
    height: 100%;
    margin: 0 auto;
    aspect-ratio: auto;
    object-fit: contain;
    object-position: center;
    background: var(--light-bg);
}

.game-side-card ul {
    list-style: disc;
    margin: 0;
    padding-left: 1.1rem;
    display: grid;
    gap: 0.35rem;
}

.game-side-card li {
    color: var(--text-secondary);
    font-size: 0.86rem;
    line-height: 1.35;
}

.game-side-card-empty,
.game-side-card-note {
    color: var(--text-secondary);
    font-size: 0.85rem;
    line-height: 1.5;
}

.game-side-card-note {
    margin-top: 0.75rem;
}

/* Cards */
.card {
    background: var(--card-bg);
    border-radius: 12px;
    overflow: hidden;
    transition: transform 0.3s, box-shadow 0.3s;
    box-shadow: 0 2px 15px rgba(0, 0, 0, 0.05);
    border: 1px solid var(--border-color);
}

.card:hover {
    transform: translateY(-8px);
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.1);
}

.card-image {
    width: 100%;
    height: 220px;
    object-fit: cover;
}

.card-content {
    padding: 1.75rem;
}

.card-title {
    font-size: 1.35rem;
    margin-bottom: 0.75rem;
    color: var(--text-color);
    font-weight: 600;
    letter-spacing: -0.5px;
}

.card-description {
    color: var(--text-secondary);
    font-size: 0.9rem;
    margin-bottom: 1.25rem;
    line-height: 1.6;
}

.card-meta {
    display: flex;
    gap: 0.75rem;
    flex-wrap: wrap;
}

.card-tag {
    font-size: 0.8rem;
    padding: 0.4rem 0.9rem;
    background: var(--light-bg);
    color: var(--text-secondary);
    border-radius: 20px;
    border: 1px solid var(--border-color);
    font-weight: 500;
}

/* Footer */
footer {
    background: transparent;
    padding: 3rem 0;
    text-align: center;
    margin-top: 6rem;
    border-top: 1px solid var(--border-color);
}

footer p {
    color: var(--text-secondary);
    font-size: 0.9rem;
    font-weight: 300;
}

footer .footer-timestamp {
    font-size: 0.8rem;
    margin-top: 0.5rem;
    opacity: 0.7;
}

footer .footer-timestamp span {
    font-family: 'Courier New', monospace;
    padding: 0 0.25rem;
}

/* Responsive */
@media (max-width: 768px) {
    .profile-card {
        flex-direction: column;
        text-align: center;
        padding: 2rem;
    }

    .nav-links {
        gap: 1.5rem;
        font-size: 0.85rem;
    }

    .section-title {
        font-size: 2.5rem;
    }

    .grid {
        grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    }

    .music-grid:hover .music-card,
    .music-grid:focus-within .music-card {
        filter: none;
    }

    .music-grid:hover .music-card:hover,
    .music-grid:focus-within .music-card:focus {
        transform: none;
        box-shadow: 0 2px 15px rgba(0, 0, 0, 0.05);
    }

    .games-stack {
        --stack-width: 100%;
        min-height: auto;
        display: grid;
        gap: 1.25rem;
    }

    .games-stack .card {
        position: static;
        width: 100%;
        top: auto;
        transform: none;
    }

    .games-stack .card:hover,
    .games-stack .card:focus-within {
        top: auto;
        transform: none;
    }

    .game-side-card {
        display: none;
    }

    .hero-title {
        font-size: 3.5rem;
        letter-spacing: -2px;
    }

    .hero-description {
        font-size: 1rem;
    }

    .hero-buttons {
        flex-direction: column;
        width: 100%;
        max-width: 300px;
    }

    .hero-button {
        width: 100%;
    }

    .logo {
        font-size: 1rem;
    }

    /* Collage responsive */
    .collage-images {
        grid-template-columns: repeat(4, 1fr);
        grid-template-rows: repeat(4, 150px);
    }

    .collage-img-1 {
        grid-column: 1 / 3;
        grid-row: 1 / 2;
    }

    .collage-img-2 {
        grid-column: 3 / 5;
        grid-row: 1 / 2;
    }

    .collage-img-3 {
        grid-column: 1 / 3;
        grid-row: 2 / 4;
    }

    .collage-img-4 {
        grid-column: 3 / 4;
        grid-row: 2 / 3;
    }

    .collage-img-5 {
        grid-column: 4 / 5;
        grid-row: 2 / 3;
    }

    .collage-img-6 {
        grid-column: 3 / 5;
        grid-row: 3 / 4;
    }

    .collage-img-7 {
        grid-column: 1 / 3;
        grid-row: 4 / 5;
    }

    .collage-img-8 {
        grid-column: 3 / 5;
        grid-row: 4 / 5;
    }

    .collage-title {
        font-size: 4.5rem;
        letter-spacing: -3px;
    }

    .hero-tagline {
        font-size: 1rem;
    }
}

/* Loading State */
.loading {
    text-align: center;
    padding: 2rem;
    color: var(--text-secondary);
    font-weight: 300;
}

/* Error State */
.error {
    background: #fef2f2;
    border: 1px solid #fecaca;
    border-radius: 8px;
    padding: 1rem;
    color: #991b1b;
    margin: 1rem 0;
}