/* --- THE STRICT FOUNDATION --- */
:root {
    --font-size: 10pt;
    --font-family: 'Courier New', Courier, monospace;
    --bg-color: #ffffff;
    --text-color: #000000;
}

body, html {
    margin: 0;
    padding: 0;
    width: 100%;
    height: 100%;
    background-color: var(--bg-color);
    color: var(--text-color);
    font-family: var(--font-family);
    font-size: var(--font-size);
    overflow-x: hidden; /* Hide scrollbars, but we will bounce off edges */
    overflow-y: scroll; /* Allow vertical scrolling */
}

a {
    color: var(--text-color);
    text-decoration: none;
    cursor: pointer;
    display: inline-block;
    position: relative;
    white-space: nowrap; /* Prevent text wrapping during movement */
}

a:hover {
    text-decoration: underline;
}

/* --- LAYOUTS --- */

/* 1. THE SHELL (Reset) */
#app {
    width: 100%;
    margin: 0;
    padding: 0;
}

/* 2. HOME PAGE (The Menu) - Kept Tight & Centered */
#list-view {
    max-width: 800px;      /* Restores the "Menu" width constraint */
    margin: 15vh auto 0;   /* Centers it vertically (15vh down) and horizontally (auto) */
    padding-left: 5vw;     /* Adds a little breathing room on the left */
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    position: relative;    /* Context for absolute physics items */
    min-height: 80vh;      /* Ensure it takes up space even if empty */
}

/* 3. PROJECT PAGE (The Canvas) - Full Width */
#detail-view {
    width: 100vw;           /* Full screen width */
    max-width: 100vw;       /* Remove limits */
    padding-top: 100px;    /* Space for the "Close" button */
    padding-bottom: 100px;
    padding-left: 10vw;
    padding-right: 25vw;
    box-sizing: border-box;
    display: none;         /* Hidden by default */
    /* No side padding here to avoid "Sidebar Clipping" */
}

/* 4. CONTENT CENTERING (The Anti-Clipping Fix) */
/* This centers the text so it has room to drift left/right without hitting the edge */
#detail-view h1,
.bio-text {
    max-width: 600px;
    margin: 0 0 3rem 0;   /* Remove auto-centering */
    padding: 0px;
    display: block;
    position: relative;
}

#detail-view h1 {
    text-align: left;       /* Optional: Centers the title text */
    margin-bottom: 2rem;
    font-size: 3rem;          /* Make the title big */
}

/* 5. MEDIA CONTAINER (Images/Video Layout) */
.media-container {
    width: 100%;
    display: flex;
    flex-wrap: wrap;          /* Allows items to wrap to next line */
    justify-content: center;  /* Centers images in the middle of screen */
    gap: 4rem;                /* Space between images */
    padding: 0 2vw;           /* Slight gutter so images don't touch browser edge */
    box-sizing: border-box;
}

/* Grid layout for media */
.media-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    grid-template-rows: 1fr;
    gap: 2vw;
    width: 100%;
    max-width: 60vw;
    margin: 2rem 0 0 0; /* Remove auto-centering, add top margin only */
}

.media-grid img,
.media-grid video,
.media-grid iframe {
    width: 100%;
    height: auto;         /* Maintain natural aspect ratio */
    object-fit: contain;  /* Show full image/video, no cropping */
    display: block;
    border-radius: 8px;
    background: #eee;     /* Optional: background for letterboxing */
}

/* Make single media item span both columns */
.media-grid:has(> :only-child) {
    grid-template-columns: 1fr;
}

/* --- PHYSICS ITEMS --- */

.entropy-element {
    position: relative; /* Keeps layout intact */
    will-change: transform;
    z-index: 1; /* Images default */
}

/* Drift Classes */
.drift-text, .drift-media {
    display: block;
    margin-bottom: 2rem;
}

.drift-text {
    z-index: 2; /* Text always above images */
}

/* --- UI ELEMENTS --- */

/* The Close Button */
.back-btn {
    position: fixed;
    top: 40px;
    left: 40px;          /* Adjusted to sit nicely in the corner */
    z-index: 1000;       /* Always on top */
    background: transparent;
    border: none;
    font-family: var(--font-family);
    font-size: var(--font-size);
    cursor: pointer;
    mix-blend-mode: exclusion; /* Makes it visible on black or white images */
    color: white; /* Exclusion mode will invert this to black on white backgrounds */
}

.back-btn:hover {
    text-decoration: underline;
}

/* The Hover Reveal Image */
#hover-reveal {
    position: fixed;
    pointer-events: none;
    width: 300px;
    height: auto;
    z-index: 50;
    opacity: 0;
    transform: translate(-50%, -50%);
    transition: opacity 0.2s ease;
    mix-blend-mode: multiply;
    filter: grayscale(100%);
}

/* Ghost Echoes (Visual Effect) */
.ghost-echo {
    position: absolute;
    pointer-events: none; 
    z-index: -1;          
    opacity: 0.6;         
    color: #aaaaaa;       
    transition: all 5s ease-out; 
    filter: blur(0px);
    mix-blend-mode: multiply;
    white-space: nowrap;
}

.ghost-echo.fading {
    opacity: 0;
    filter: blur(4px);    
    transform: scale(1.1); 
}

/* Wild items (Crazy physics) */
.wild {
    z-index: 1000;
    color: blue; /* Visual cue */
}

.project-block {
    max-width: 50vw;
    margin: 0 auto 2rem auto;
    /* Optionally add padding if you want a gutter from the edge of the screen */
}

.project-content {
    width: 40vw;
    max-width: none;
    margin: 0 0 2rem 0; /* Remove auto-centering */
    padding: 0;
}

.yt-embed {
    width: 100%;
    aspect-ratio: 16/9;
    max-width: 100%;
    border: none;
    display: block;
    margin: 2rem 0;
}

/* Responsive for mobile */
@media (max-width: 700px) {
    .project-content {
        width: 90vw;
        min-width: unset;
        max-width: 98vw;
    }
}