/* PRELOADER STYLES */
#loader {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgb(242, 241, 232); /* Matches body background */
    z-index: 9999;
    display: flex;
    justify-content: center;
    align-items: center;
    transition: opacity 0.8s ease-in-out, visibility 0.8s ease-in-out;
    will-change: opacity;
}

.loader-text {
    font-family: "Helvetica Neue", Arial, sans-serif;
    font-size: 50px;
    
    color: rgb(33, 22, 13);
    
    animation: fade-up 2s cubic-bezier(0.25, 1, 0.5, 1) forwards;
}

@keyframes fade-up {
    0% {
        opacity: 0;
        transform: translateY(20px); /* Starts slightly lower */
    }
    100% {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Hidden State */
#loader.hidden {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}
body, html {
    margin: 0;
    padding: 0;
    height: 100%;
    width: 100%;
    background-color: rgb(242, 241, 232);
    font-size: 18px;
    color: rgb(33, 22, 13);
    font-family: "Helvetica Neue", Arial, sans-serif; 
    touch-action: none;
    cursor: move;
    overflow: hidden;
}

#pan-zoom-container {
    position: relative;
    width: 100vw;
    height: 100vh;
    height: 100dvh;
    will-change: transform;
	transition: transform 0.5s cubic-bezier(0.25, 1, 0.5, 1);
	display: flex;
    align-items: center;
    justify-content: center;
}

#grid {
    position: relative;
    width: 100%;
    height: 100%;
    display: block;
}

.grid-item {
    will-change: transform;
    position: absolute;
    display: flex;
    align-items: center;
    justify-content: center;
    transform: translateX(-50%) translateY(-50%);
    cursor: cell;
}

.grid-item a {
	cursor: cell;
    display: block;
}

.grid-item img, .grid-item video {
    width: 17vw;
    height: auto;
    background-color: none;
    object-fit: contain;
    pointer-events: auto;
}

#title, #description, #copyright, #take-me-home {
    position: fixed;
    white-space: normal;
    hyphens: auto;
    word-wrap: break-word;
    pointer-events: none;
    visibility: hidden;
    background-color: rgba(255, 255, 245, 0.5);
    padding: 1em 1em 1em 1em;
    border-radius: 1.5em;
    -webkit-backdrop-filter: blur(13px);
	backdrop-filter: blur(13px);
    border: 0.1em solid rgba(175, 175, 175, 0.3);
    box-shadow: 0em 0em 1em 1em rgba(190, 190, 190, 0.1);
    box-sizing: border-box;
}

#title {
	top: 10px;
    left: 10px;
    width: fit-content;
    padding: 0.7em 1em 0.7em 1em;
}

#description {
    line-height: 1.2;
	top: 10px;
    right: 10px;
    max-width: 33vw;
    max-height: calc(100vh - 45px);
    overflow-y: auto;
	pointer-events: auto;
	scrollbar-width: none;
	isolation: isolate;
	transform: translateZ(0);
    -webkit-transform: translateZ(0);
    will-change: transform, opacity;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior-y: contain; 
}

#copyright {
	bottom: 10px;
    left: 10px;
    font-size: 10px;
    visibility: visible;
}

#description a, #take-me-home {
    color: rgb(138, 134, 129);
    text-decoration: none;
    cursor: cell;
    transition: color 0.5s ease;
}

#description a:hover, #take-me-home:hover {
    color: rgb(33, 22, 13);
}

#take-me-home {
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    opacity: 0;
    pointer-events: auto;
}

#take-me-home.visible {
    visibility: visible;
    opacity: 1;
}

#description .description-image, #description .description-video {
    display: block; 
    width: 100%;    
    height: auto;   
    border-radius: calc(1.5em - 1em);
    touch-action: none;
    pointer-events: none; 
    -webkit-user-drag: none;
    user-select: none;
    -webkit-user-select: none;
    touch-action: none;
    margin-top: 1em;
    margin-bottom: 1em;
}

#description .description-text {
    margin-top: 0em;
    margin-bottom: 0em;
    margin-block-start: 0;
    margin-block-end: 0;
}

#description > :last-child {
    margin-bottom: 0 !important;
}

@media (max-width: 800px) {
	#grid {
		height: 55vh;  
    }
    .grid-item img, .grid-item video {
        width: 25vw; 
        height: auto; 
    }
	body, html { 
    	font-size: 16px;
    }
	#description{    
    	top: auto;
    	bottom: 10px;
    	left: 10px;
     	max-width: none;
     	max-height: 33vh;
     	overflow: hidden;
    }
	#title { 
		left: 50%;
		text-align: center;
		transform: translateX(-50%);
		white-space: nowrap;
    }
	#copyright {
		left: 50%;
		text-align: center;
		transform: translateX(-50%);
		max-width: none;
		white-space: nowrap;	
	}
	.project-view-active #copyright {
		visibility: hidden;
	}
	#description.scrollable {
    	overflow-y: auto;
    }
}

/* ME */
.grid-item:nth-child(1) {
    top: 50%; 
    left: 50%; 
}

/* ASVO */
.grid-item:nth-child(2) {
    top: -9%;
    left: -5%;
}

/* CLIP */
.grid-item:nth-child(3) {
    top: 10%; 
    left: 75%;
}

/* PAKKO */
.grid-item:nth-child(4) {
    top: 150%; 
    left: 75%;
}

/* SHAREKIT */
.grid-item:nth-child(5) {
    top: 55%; 
    left: 13%;
}

/* FINGERZ */
.grid-item:nth-child(6) {
    top: 3%; 
    left: 28%;
}

/* IOMA */
.grid-item:nth-child(7) {
    top: 103%; 
    left: 42%;
}

/* COLLINT */
.grid-item:nth-child(8) {
    top: 115%; 
    left: -5%;
}


/* OMNIVIA */
.grid-item:nth-child(9) {
    top: 1000%; 
    left: -1000%;
}

/* EMO */
.grid-item:nth-child(10) {
    top: 80%; 
    left: 130%;
}

/* MINE */
.grid-item:nth-child(11) {
    top: 120%; 
    left: 105%;
}

/* OVA */
.grid-item:nth-child(12) {
    top: 45%; 
    left: 110%;
}

/* TATABLE */
.grid-item:nth-child(13) {
    top: -50%; 
    left: 24%;
}

/* VIDEM */
.grid-item:nth-child(14) {
    top: 60%; 
    left: -20%;
}

/* AFFE */
.grid-item:nth-child(15) {
    top: -20%; 
    left: 103%;
}

/* YOB */
.grid-item:nth-child(16) {
   top: 160%; 
    left: 25%;
}

/* PM - IRROR */
.grid-item:nth-child(17) {
    top: 85%; 
    left: 80%;
}

/* OGO */
.grid-item:nth-child(18) {
    top: -53%; 
    left: 63%;
}