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

:root {
    --black: #0a0a0a;
    --white: #f5f5f5;
    --gray-dark: #1a1a1a;
    --gray-mid: #333;
    --gray-light: #666;
    --transition: 0.3s ease;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    background: var(--black);
    color: var(--white);
    line-height: 1.6;
    overflow-x: hidden;
}

/* Navigation */
.nav {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    display: flex;
    justify-content: flex-end;
    align-items: center;
    padding: 1.5rem 3rem;
    background: rgba(10, 10, 10, 0.9);
    backdrop-filter: blur(10px);
}

.nav-logo {
    font-weight: 500;
    font-size: 0.875rem;
    letter-spacing: 0.2em;
}

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

.nav-links a {
    color: var(--white);
    text-decoration: none;
    font-size: 0.875rem;
    font-weight: 400;
    letter-spacing: 0.05em;
    opacity: 0.7;
    transition: opacity var(--transition);
}

.nav-links a:hover {
    opacity: 1;
}

.nav-toggle {
    display: none;
    flex-direction: column;
    gap: 5px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 5px;
}

.nav-toggle span {
    width: 24px;
    height: 2px;
    background: var(--white);
    transition: var(--transition);
}

/* Hero Section */
.hero {
    height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
}

.hero-grid {
    position: absolute;
    inset: 0;
    display: grid;
    grid-template-columns: repeat(var(--cols, 12), 1fr);
    grid-template-rows: repeat(var(--rows, 8), 1fr);
    gap: 2px;
    opacity: 0.4;
}

.hero-grid .cell {
    background: var(--white);
    transition: opacity 0.5s ease;
}

.hero-grid .cell.off {
    opacity: 0;
}

.hero-grid .cell.logo-cell {
    background: #000;
    opacity: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    overflow: hidden;
}

.hero-grid .cell.logo-cell .logo-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center center;
    filter: invert(1);
}

/* Sections */
.section {
    padding: 8rem 3rem;
    max-width: 1400px;
    margin: 0 auto;
}

.section-title {
    font-size: 0.75rem;
    font-weight: 500;
    letter-spacing: 0.3em;
    text-transform: uppercase;
    margin-bottom: 4rem;
    opacity: 0.5;
}

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

.film-card {
    position: relative;
    cursor: pointer;
    transition: transform var(--transition);
}

.film-card:hover {
    transform: translateY(-4px);
}

.film-poster {
    aspect-ratio: 2/3;
    overflow: hidden;
    background: var(--gray-dark);
    margin-bottom: 1rem;
}

.film-poster img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    filter: grayscale(100%);
    transition: filter var(--transition);
}

.film-info h3 {
    font-size: 1rem;
    font-weight: 500;
    margin-bottom: 0.25rem;
}

.film-year {
    font-size: 0.875rem;
    opacity: 0.5;
}

.film-note {
    font-size: 0.75rem;
    opacity: 0.4;
    margin-left: 0.5rem;
}

/* Games Section */
.games-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 2rem;
}

.game-card {
    position: relative;
    cursor: pointer;
    transition: transform var(--transition);
}

.game-card:hover {
    transform: translateY(-4px);
}

.game-poster {
    aspect-ratio: 16/9;
    overflow: hidden;
    background: var(--gray-dark);
    margin-bottom: 1rem;
}

.game-poster img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    filter: grayscale(100%);
    transition: filter var(--transition);
}

.game-card:hover .game-poster img {
    filter: grayscale(0%);
}

.game-info h3 {
    font-size: 1rem;
    font-weight: 500;
    margin-bottom: 0.25rem;
}

.game-role {
    font-size: 0.875rem;
    opacity: 0.5;
    display: block;
}

.game-status {
    font-size: 0.75rem;
    opacity: 0.4;
    display: block;
    margin-top: 0.25rem;
}

/* Solo Section */
.solo-projects-row {
    display: flex;
    gap: 4rem;
}

.solo-project {
    flex: 0 0 auto;
}

.solo-subsection {
    margin-bottom: 6rem;
}

.solo-subsection:last-child {
    margin-bottom: 0;
}

.subsection-title {
    font-size: 1.5rem;
    font-weight: 400;
    margin-bottom: 1rem;
}

.subsection-desc {
    font-size: 1rem;
    opacity: 0.6;
    max-width: 600px;
    margin-bottom: 2rem;
}

.embla-photo {
    margin-bottom: 2rem;
    width: 280px;
    cursor: pointer;
}

.embla-photo img {
    width: 100%;
    height: auto;
    object-fit: contain;
    filter: grayscale(100%);
    transition: filter var(--transition);
}

.embla-photo.playing img {
    filter: grayscale(0%);
}

.athos-ost-photo {
    margin-bottom: 2rem;
    width: 280px;
    cursor: pointer;
}

.athos-ost-photo img {
    width: 100%;
    height: auto;
    object-fit: contain;
    filter: grayscale(100%);
    transition: filter var(--transition);
}

.athos-ost-photo.playing img {
    filter: grayscale(0%);
}

.stone-birds-photo {
    margin-bottom: 2rem;
    width: 280px;
    cursor: pointer;
}

.stone-birds-photo img {
    width: 100%;
    height: auto;
    object-fit: contain;
    filter: grayscale(100%);
    transition: filter var(--transition);
}

.stone-birds-photo.playing img {
    filter: grayscale(0%);
}

.video-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(400px, 1fr));
    gap: 1.5rem;
}

.video-placeholder {
    aspect-ratio: 16/9;
    background: var(--gray-dark);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0.3;
    font-size: 0.875rem;
}

.video-embed {
    aspect-ratio: 16/9;
    width: 100%;
}

.video-embed iframe {
    width: 100%;
    height: 100%;
    border: none;
}

/* About Section */
.about-content {
    max-width: 600px;
}

.about-content p {
    font-size: 1.125rem;
    line-height: 1.8;
    margin-bottom: 1.5rem;
    opacity: 0.8;
}

.about-links {
    display: flex;
    gap: 2rem;
    margin-top: 2rem;
}

.about-links a {
    color: var(--white);
    text-decoration: none;
    font-size: 0.875rem;
    letter-spacing: 0.1em;
    opacity: 0.5;
    transition: opacity var(--transition);
}

.about-links a:hover {
    opacity: 1;
}

/* Contact Section */
.contact-content {
    text-align: center;
    padding: 4rem 0;
}

.contact-content p {
    font-size: 1rem;
    opacity: 0.6;
    margin-bottom: 1.5rem;
}

.contact-email {
    font-size: 1.5rem;
    color: var(--white);
    text-decoration: none;
    font-weight: 400;
    transition: opacity var(--transition);
}

.contact-email:hover {
    opacity: 0.7;
}

/* Footer */
.footer {
    padding: 2rem 3rem;
    text-align: center;
    font-size: 0.75rem;
    opacity: 0.3;
}

/* Mobile */
@media (max-width: 768px) {
    .nav {
        padding: 1rem 1.5rem;
    }

    .nav-links {
        display: none;
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        flex-direction: column;
        background: var(--black);
        padding: 2rem;
        gap: 1.5rem;
    }

    .nav-links.active {
        display: flex;
    }

    .nav-toggle {
        display: flex;
    }

    .section {
        padding: 4rem 1.5rem;
    }

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

    .video-grid {
        grid-template-columns: 1fr;
    }

    .hero-grid {
        --cols: 6;
        --rows: 10;
    }

    .solo-projects-row {
        flex-direction: column;
        gap: 3rem;
    }
}

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

/* Audio Player */
.audio-player {
    position: fixed;
    bottom: 20px;
    right: 20px;
    width: 360px;
    background: var(--gray-dark);
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.5);
    z-index: 999;
    display: none;
    transform: translateY(20px);
    opacity: 0;
    transition: transform 0.3s ease, opacity 0.3s ease;
}

.audio-player.active {
    display: block;
    transform: translateY(0);
    opacity: 1;
}

.audio-player-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 16px;
    background: var(--black);
    border-bottom: 1px solid var(--gray-mid);
}

.audio-player-project {
    font-size: 0.75rem;
    font-weight: 500;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    opacity: 0.5;
}

.audio-player-close {
    width: 24px;
    height: 24px;
    background: transparent;
    border: none;
    color: var(--white);
    font-size: 20px;
    line-height: 1;
    cursor: pointer;
    opacity: 0.5;
    transition: opacity 0.2s ease;
}

.audio-player-close:hover {
    opacity: 1;
}

.audio-player-track {
    padding: 16px;
}

.audio-player-title {
    font-size: 1rem;
    font-weight: 500;
    margin-bottom: 4px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.audio-player-info {
    font-size: 0.75rem;
    opacity: 0.5;
    margin-bottom: 16px;
}

.audio-player-progress {
    position: relative;
    height: 4px;
    background: var(--gray-mid);
    border-radius: 2px;
    cursor: pointer;
    margin-bottom: 8px;
}

.audio-player-progress-bar {
    height: 100%;
    background: var(--white);
    border-radius: 2px;
    width: 0%;
    transition: width 0.1s linear;
}

.audio-player-progress:hover .audio-player-progress-bar {
    background: #fff;
}

.audio-player-times {
    display: flex;
    justify-content: space-between;
    font-size: 0.625rem;
    opacity: 0.4;
    font-family: monospace;
    margin-bottom: 16px;
}

.audio-player-controls {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 16px;
}

.audio-player-btn {
    background: transparent;
    border: none;
    color: var(--white);
    cursor: pointer;
    padding: 8px;
    opacity: 0.7;
    transition: opacity 0.2s ease;
}

.audio-player-btn:hover {
    opacity: 1;
}

.audio-player-btn svg {
    width: 20px;
    height: 20px;
    fill: currentColor;
}

.audio-player-btn.play-btn svg {
    width: 32px;
    height: 32px;
}

.audio-player-volume {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px solid var(--gray-mid);
}

.audio-player-volume .volume-icon {
    width: 18px;
    height: 18px;
    fill: var(--white);
    opacity: 0.5;
}

.audio-player-volume .volume-slider {
    flex: 1;
    -webkit-appearance: none;
    appearance: none;
    height: 4px;
    background: var(--gray-mid);
    border-radius: 2px;
    cursor: pointer;
}

.audio-player-volume .volume-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 12px;
    height: 12px;
    background: var(--white);
    border-radius: 50%;
    cursor: pointer;
}

.audio-player-volume .volume-slider::-moz-range-thumb {
    width: 12px;
    height: 12px;
    background: var(--white);
    border-radius: 50%;
    border: none;
    cursor: pointer;
}

.audio-player-playlist {
    max-height: 200px;
    overflow-y: auto;
    border-top: 1px solid var(--gray-mid);
}

.audio-player-playlist-item {
    display: flex;
    align-items: center;
    padding: 10px 16px;
    cursor: pointer;
    transition: background 0.2s ease;
    gap: 12px;
}

.audio-player-playlist-item:hover {
    background: rgba(255, 255, 255, 0.05);
}

.audio-player-playlist-item.active {
    background: rgba(255, 255, 255, 0.1);
}

.audio-player-playlist-num {
    font-size: 0.75rem;
    opacity: 0.3;
    width: 20px;
    text-align: center;
}

.audio-player-playlist-item.active .audio-player-playlist-num {
    opacity: 1;
}

.audio-player-playlist-name {
    flex: 1;
    font-size: 0.875rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.audio-player-playlist-duration {
    font-size: 0.75rem;
    opacity: 0.4;
    font-family: monospace;
}

/* Active film card (selected) */
.film-card.playing .film-poster img {
    filter: grayscale(0%);
}

.film-card.playing::after {
    content: '';
    position: absolute;
    inset: 0;
    border: 2px solid var(--white);
    pointer-events: none;
}

@media (max-width: 480px) {
    .audio-player {
        width: calc(100% - 40px);
        left: 20px;
        right: 20px;
    }

    .audio-player-playlist {
        max-height: 150px;
    }
}
