:root {
    --bg-color: #f4f4f0; /* Warm off-white */
    --text-color: #111111;
    --font-size: 20px; /* Slightly adjusted for Inter legibility */
}

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

html {
    scroll-behavior: smooth;
    overflow-y: scroll;
}

body {
    background-color: var(--bg-color);
    color: var(--text-color);
    font-family: 'Inter', sans-serif;
    font-size: var(--font-size);
    font-weight: 400;
    line-height: 1.5; /* Inter needs a bit more line-height than Awke */
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* Subtle Frame Gradient */
body::after {
    content: "";
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    box-shadow: inset 0 0 40px rgba(0, 0, 0, 0.35); /* Shorter radius, same opacity */
    pointer-events: none;
    z-index: 1000;
}

/* Top Bar */
.top-bar {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    padding: 2.5rem 3rem; /* Increased padding for better breathing room */
    display: flex;
    justify-content: space-between;
    align-items: center;
    z-index: 100;
    mix-blend-mode: difference;
    color: #ffffff;
}

.name {
    pointer-events: auto;
    transition: filter 0.6s ease;
    text-decoration: none;
    color: #ffffff;
    white-space: nowrap;
}

.name:hover {
    filter: blur(6px);
}

.top-menu {
    display: flex;
    gap: 4rem; /* Fixed, generous gap */
    align-items: center;
}

.top-menu a {
    text-decoration: none;
    color: #ffffff;
    transition: filter 0.6s ease, opacity 0.3s ease;
    opacity: 1; /* Full opacity to ensure sharp contrast with mix-blend-mode */
}

@media (hover: hover) {
    .top-menu a:hover {
        filter: blur(6px);
    }
    
    .name:hover {
        filter: blur(6px);
    }
}

.top-menu a.active {
    filter: blur(2px);
    text-decoration: underline;
}

/* Container & Transition */
.container {
    padding: 150px 3rem 2.5rem 3rem; /* Matched bottom padding to top-bar vertical padding */
    width: 100%;
    margin: 0;
    transition: filter 0.6s ease, opacity 0.6s ease;
}

.container.transitioning {
    filter: blur(20px);
    opacity: 0;
}

.page {
    display: none;
    min-height: calc(100vh - 150px - 2.5rem); /* Exactly fill viewport height minus container padding */
    position: relative;
}

.page.active {
    display: block;
}

/* Bio (Home Section) */
.bio {
    position: absolute; /* Absolute relative to .page avoids filter-breaking-fixed-position bug */
    bottom: 0;
    left: 0;
    display: flex;
    flex-direction: column;
}

.bio a {
    color: var(--text-color);
    text-decoration: none;
    transition: filter 0.6s ease;
}

.bio a:hover {
    filter: blur(6px);
}

/* Galleries */
.gallery {
    display: flex;
    flex-direction: column;
    gap: 8vh;
    padding-bottom: calc(150px - 2.5rem); /* Ensures bottom spacing matches top container padding */
}

.gallery img, .gallery video {
    max-width: 100%;
    max-height: 80vh; /* Ensures item fits vertically on screen */
    width: auto;
    display: block;
    margin: 0 auto;
}

.gallery img {
    filter: grayscale(100%);
    transition: filter 2.4s ease;
}

.gallery video {
    transition: transform 0.8s ease;
}

.gallery img.centered {
    filter: grayscale(0%);
}

/* Cinematic Mode */
html.locked, body.locked {
    overflow: hidden !important;
}

body {
    transition: background-color 0.8s ease;
}

body.cinematic-mode {
    background-color: #000000 !important;
}

body.cinematic-mode .top-bar,
body.cinematic-mode .bio,
body.cinematic-mode .gallery img,
body.cinematic-mode .gallery video:not(.video-playing) {
    opacity: 0 !important;
    pointer-events: none !important;
}

.top-bar, .bio, .gallery img, .gallery video {
    transition: opacity 0.8s ease, filter 0.8s ease, transform 0.8s ease;
}

.gallery video.video-playing {
    transform: scale(1.05);
    z-index: 10;
}

/* Mobile Optimizations */
@media (max-width: 768px) {
    :root {
        --font-size: 16px;
    }

    html, body {
        overflow-x: hidden; /* Prevent horizontal scroll */
    }

    .top-bar {
        padding: 0;
        display: block;
    }

    .name {
        position: fixed;
        bottom: 1.5rem;
        left: 1.5rem;
        z-index: 100;
    }

    .top-menu {
        position: fixed;
        top: 1.5rem;
        right: 1.5rem;
        z-index: 100;
        display: flex;
        flex-direction: row;
        align-items: center;
        gap: 15px;
    }

    .top-menu a.active {
        text-decoration: underline;
    }

    .container {
        padding: 0; /* Remove top padding since menu is fixed */
    }

    .page {
        padding: 0;
        width: 100%;
    }

    #home.page {
        padding: 0;
        height: 100vh; /* Full viewport height */
        position: relative;
    }

    .gallery {
        padding: 15vh 0 35vh 0; 
        gap: 12vh;
        width: 100%;
        display: flex;
        flex-direction: column;
        align-items: center;
    }

    .gallery img, .gallery video {
        max-height: 70vh;
        width: 100%;
        max-width: 100%;
        object-fit: contain;
        margin: 0;
    }

    .bio {
        position: absolute;
        top: 50%;
        left: 1.5rem;
        transform: translateY(-50%);
        bottom: auto;
        max-width: calc(100% - 3rem);
        margin: 0;
    }
}
