body {
  margin: 0;
  padding: 0;
  background: rgb(0, 0, 0);
  height: 100vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

@font-face {
  font-family: texts;
  src: url('/fonts/UniversBold.ttf') format('truetype');
}

nav {
  display: none;
}


.text {
  font-family: texts, serif;
  /* margin: auto; */
  padding: 0.5rem;
  max-width: 100vw;
  /* height: 73vh; */
  display: flex;
  position: relative;
  z-index: 5;
  justify-content: center;
  transition: opacity 1s ease, z-index 0s linear 0.5s;
  max-height: 40vh;
}

.text-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 30px;
  grid-auto-rows: min-content;
  box-sizing: border-box;
  
}

.text-home {
  grid-column: 1/ span 1;
  font-size: 1rem;
  color: #a2a2a2;
  cursor: pointer;
}

.text-list {
  text-align: left;
  grid-column: 1/ span 1;
  font-size: 1rem;
  color: #4e4e4e;
}

.text-body {
  text-align: left;
  grid-column: 2/ span 1;
  font-size: 1rem;
  color: #4e4e4e;
}

.text-body-currently {
  text-align: left;
  grid-column: 3/ span 4;
  font-size: 1rem;
  color: #4e4e4e;
}

.text-currently {
  text-align: left;
  grid-column: 3/ span 2;
  font-size: 1rem;
  color: #a2a2a2;
}

.text-contact {
  text-align: right;
  grid-column: 7/ span 1;
  font-size: 1rem;
  color: #a2a2a2;
}

.text-index {
  text-align: right;
  grid-column: 3/ span 2;
  font-size: 1rem;
  color: #4e4e4e;
}

.text.hidden {
  opacity: 0;
  transition: opacity 1s ease;
}

a:link, a:visited {
  color: #4e4e4e;
  text-decoration: none;
  display: inline-block;
}

a:hover, a:active {
  color: #282828;
}

.main-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-end;
  overflow-y: auto;
  height: 100vh;
  transition: transform 2s ease;
  position: relative;
  z-index: 11;
}


.main-content.slide-down {
  transition: transform 2s ease;
  transform: translateY(560px);
}

.grid-container {
  display: flex;
  /* flex-wrap: wrap; */
  overflow-x: auto;
  /* padding: 0.5rem; */
  box-sizing: border-box;
  width: 100%;
  max-width: 100vw;
  scroll-snap-type: x mandatory;
  align-items: flex-end;
  z-index: 11;
  height: 100%;
}

.grid-item {
  position: relative;
  flex: 0 0 auto;
  width: 205px;
  height: auto;
  transition: height 1s ease, width 2s ease;
  overflow-y: hidden;
  overflow-x: auto;
  transition: transform 0.6s ease-in-out;
  transform-style: preserve-3d;
  perspective: 800px; /* optional, if you want to influence child 3D transforms */
}

/* 👇 When a project is selected, scale the item down */


.grid-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.grid-item:hover {
  transform: translateY(-10px) rotatey(15deg);
}

.hover-container {
  font-family: texts, serif;
  /* padding: 0.5rem; */
  margin: 0;
  position: fixed;
  top: -100%;
  justify-content: center;
  align-items: flex-start;
  width: 100vw;
  /* max-width: 100vw; */
  max-height: 100vh;
  height: 100vh;
  opacity: 0;
  transition: opacity 1s ease, z-index 0s linear 1s, top 1s ease;
  z-index: -1; /* Set to -1 when not visible */
  overflow-y: auto;
  overflow-x: hidden;
  /* pointer-events: none; */
  box-sizing: border-box; /* add this */
}

.hover-grid{
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  gap: 20px;
  box-sizing: border-box;
  padding: 0.5rem; /* optional */
  width: 100%;
  max-width: 100vw;
}

.hover-container.visible {
  opacity: 1;
  z-index: 10;
  transition: opacity 1s ease, z-index 0s, top 1s ease;
  pointer-events: auto;
  top: 0;
}

.hover-number {
  grid-column: 1/ span 1;
  font-size: 0.9rem;
  color: #b6b6b6;
}

.hover-image-block {
  grid-column: 3 / span 8;
  display: flex;
  position: relative;
  justify-content: center;
  height: 100%; 
  /* scrollbar-width: thin; */
}

.hover-image-column {
  display: flex;
  flex-direction: column;
  gap: 0px;
  width: 100vw;
}

.hover-image {
  height: 100vh;
  max-height: 100vh;
  height: auto;
  width: auto;
  object-fit: contain;
}

.hover-text-block {
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  grid-column: 1/ span 11;
  position: relative;
  gap: 10px;
  justify-content: flex-start;
  color: #b6b6b6;
}

.hover-title {
  grid-column: 1/ span 2;
  font-size: 0.9rem;

}

.hover-description {
  font-size: 0.9rem;
  color: #b6b6b6;
  grid-column: 3/ span 9;
}



/* Shrink the grid container when a project is open */
.grid-container.grid-shrink {
  /* height: 135px; */
  transition: height 1s ease;
  overflow-y: hidden;
}

/* Adjust hover container for click mode */
.hover-container {
  pointer-events: auto;
}

/* Close button */
.close-button {
  grid-column: 12 / span 1 ;
  /* display: flex; */
  /* position: relative; */
  position: fixed;
  right: 0.5rem;
  cursor: pointer;
  font-size: 0.9rem;
  color: #b6b6b6;
  text-align: right;
  z-index: 9999;
  
}

.close-button:hover {
  color: #000;
  
}

@media screen and (max-width: 768px) {

  body{
    height: 100svh;
  }
  .text-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
  }

  .text-home {
    grid-column: 1 / 2;
    grid-row: 1;
    text-align: left;
  }

  .text-contact {
    grid-column: 2 / 3;
    grid-row: 1;
    text-align: right;
  }

  .text-body-currently {
    grid-column: 1 / 3;
    grid-row: 2;
    text-align: left;
  }

  .text-currently {
    grid-column: 1 / 3;
    grid-row: 3;
    text-align: left;
  }

  .text-list {
    grid-column: 1 / 3;
    grid-row: 4;
    text-align: left;
  }

  .text-body {
    grid-column: 1 / 3;
    grid-row: 6; /* Ensure it comes last */
    text-align: left;
  }

  .main-content {
    height: 120vh;
  }

  .grid-container {
    height: 700px;
  }

  .grid-item {
    width: 30vw !important; /* override inline width */
    height: auto;
  }

  .grid-item img {
    height: auto;
    max-height: 100%;
    object-fit: cover;
  }



  .hover-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1rem;
    padding: 0.5rem;
  }

  .hover-text-block {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    grid-column: 1 / 1;
    color: #b6b6b6;
  }

  .hover-title {
    font-size: 1rem;
  }

  .hover-description {
    font-size: 0.9rem;
    color: #b6b6b6;
  }

  .hover-image-block {
    grid-column: 1 / -1;
    max-height: 60vh;
    /* overflow: hidden; */
  }

  .hover-image {
    width: 100%;
    max-height: 60vh;
    object-fit: contain;
  }

}
