@import url('https://fonts.googleapis.com/css2?family=Roboto+Mono:wght@400&display=swap');

:root {
    --gap-size: 2.5vmin;
    --margin-size: 2.0vmin;
}

::selection {
    background-color: black; 
    color: white;           
}

::-moz-selection {
    background-color: black;
    color: white;
}

body {
    font-family: 'Roboto Mono', monospace;
    color: #000;
    background-color: #f1f1f1;
    width: 100vw;
    height: 100vh;
    margin: 0;
    padding: 0;
    overflow: hidden;
    display: flex;
    justify-content: center;
    align-items: center;
    user-select: none;
}

/* --- Typography & Logo --- */
.logo {
    position: fixed;
    top: -189px;
    left: 50%;
    transform: translateX(-50%);
    width: 200px;
    z-index: 50; 
    user-select: none;
    cursor: pointer; 
    pointer-events: auto;
    -webkit-user-select: none; 
    -moz-user-select: none;    
    -ms-user-select: none;    
    user-select: none;
}

.logo-svg path{
    width: 100%;
    fill: none;
    stroke: #000;       
    stroke-width: 1.0px !important;  
    opacity: 70%;

    vector-effect: non-scaling-stroke;
    transition: stroke-width 0.0s ease;
}

h1 img {
    max-width: 100%;
    height: auto;
    display: block; 
}

/* --- Info Bar --- */
.contact-bar {
    position: fixed;
    display: flex;       
    bottom: 12px;
    left: 0;
    /*transform: translateX(-50%);*/
    font-size: 9px;
    text-align: center;
    justify-content: center;
    color: #474747;
    background: transparent;
    white-space: nowrap;
    pointer-events: auto;
    z-index: 50;
    user-select: none;
    gap: 60px;
    width: 100%;

}


.contact-bar a { text-decoration: none; color: #474747; }
.contact-bar a:hover { text-decoration: underline; }


/* --- Grid Layout --- */
#image-grid-container {
    width: calc(100vw - 2 * var(--margin-size)); 
    height: calc(100vh - 2 * var(--margin-size));
    padding: var(--margin-size);
    box-sizing: border-box;
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    grid-template-rows: repeat(5, 1fr);
    gap: var(--gap-size); 
    z-index: 0; 
    position: relative; 
    transform: translateZ(0); 
    opacity: 1;
    filter: blur(0px);
    transition: opacity 0.0s ease-out, filter 0.0s ease-out; 
}

#image-grid-container.grid-blurred {
    filter: blur(20px);
    opacity: 0;
    transition: opacity 0s, filter 0s; 
    pointer-events: none; 
}

.grid-item {
    width: 100%;
    height: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
    overflow: hidden; 
    user-select: none;
}

.grid-item img {
    max-width: 100%;
    max-height: 100%;
    opacity: 0; 
    width: auto; 
    height: auto; 
    display: block;
    object-fit: contain;
    -webkit-user-select: none; 
    -moz-user-select: none;    
    -ms-user-select: none;    
    user-select: none;
}

/* --- CANVAS STYLES --- */

/* Grid Canvas: Sits above grid (z:10), transitions identical to grid container */
#gridCanvas {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: 10; 
    cursor: default; 
    pointer-events: none; 
    opacity: 1;
    filter: blur(0px);
    transition: opacity 0.0s ease-out, filter 0.0s ease-out; 
    -webkit-user-select: none; 
    -moz-user-select: none;    
    -ms-user-select: none;    
    user-select: none;
}

/* Helper class to hide grid canvas smoothly with the grid */
#gridCanvas.canvas-hidden {
    opacity: 0;
    filter: blur(20px);
    transition: opacity 0s, filter 0s; 
}

/* Modal Canvas: Sits above modal image (z:55) but below nav (z:60) */
#modalCanvas {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: 55; 
    cursor: default; 
    pointer-events: none; 
    -webkit-user-select: none; 
    -moz-user-select: none;    
    -ms-user-select: none;    
    user-select: none;
}


/* --- Descriptions --- */
#image-description {
    pointer-events: none; 
    transform: translateX(-50%);
    opacity: 1;
    color: #474747;
    font-size: 12px;
    z-index: 999; 
    white-space: nowrap;
    position: fixed;
    bottom: 35px;
    left: 50%;
}

#modal-description {
    position: fixed;
    bottom: 35px;
    left: 50%;
    transform: translateX(-50%);
    font-size: 12px;
    text-align: center;
    color: #474747;
    background: transparent;
    white-space: nowrap;
    pointer-events: auto;
    z-index: 999;
    user-select: none;
}

.description-link {
    text-decoration: underline; 
    transition: border-bottom-color 0.0s ease;
    color: #474747 !important;
}

.description-link:hover {
    text-decoration: none; 
}

/* --- Modal & Navigation --- */
#modal-container {
    position: fixed;
    z-index: 15;
    background-color: transparent; 
}

#modal-image {
    max-width: 70vw;
    max-height: 70vh; 
    width: auto;
    height: auto;
    user-select: none;
    object-fit: contain; 
    opacity: 0;
    filter: blur(20px);
    transition: opacity 0s, filter 0s;
    transform: translateZ(0);
    -webkit-user-select: none; 
    -moz-user-select: none;    
    -ms-user-select: none;    
    user-select: none;
}

#modal-image.modal-active {
    opacity: 1;
    filter: blur(0px);
    transition: opacity 0.0s ease-out, filter 0.0s ease-out;
}

/* GLOBAL NAV BUTTONS */
.nav-btn {
    position: fixed !important; 
    top: 0 !important;
    bottom: 0 !important;
    height: 100vh !important;
    width: 50vw !important;
    z-index: 60; 
    display: flex;
    align-items: center;
    cursor: pointer;
    background: transparent; 
}
.nav-btn.left-0 { left: 0; justify-content: flex-start; padding-left: 20px; }
.nav-btn.right-0 { right: 0; justify-content: flex-end; padding-right: 20px; }


#close {
    position: fixed !important; 
    top: 5px;
    right: 5px;  
    z-index: 100; 
    cursor: pointer;
    padding: 10px;
    display: none; 
    opacity: 80%;
    -webkit-user-select: none; 
    -moz-user-select: none;    
    -ms-user-select: none;    
    user-select: none;
}

#close img{
    width: 40px;
}


#close:hover { opacity: 100%; }

.hidden { display: none !important; }

/* ===========================================
   MOBILE OVERRIDES
   =========================================== */
@media (max-width: 768px) {
    #image-grid-container { display: none !important; }
    /* Also hide grid canvas on mobile since grid is gone */
    #gridCanvas { display: none !important; }
    
    #modal-container { display: block; }
    .logo { pointer-events: none; }
    #close { display: none !important; }
    .nav-btn svg { display: none !important; }
    
    .contact-bar {
        width: 100%;
        left: 0;
        transform: none;
        bottom: 15px;
        white-space: nowrap; 
        display: flex;       
        justify-content: center;
        align-items: center;
        font-size: 2.2vw;    
        gap: 5.5vw;
    }
    .contact-bar .gap { margin-right: 0; }

    #modal-description {
        bottom: 60px; 
        font-size: 12px;
        width: 90%; 
        line-height: 1.4; 
    }
    
    #modal-image {
        height: auto;
        max-height: 65vh;
        object-fit: contain;
    }
}