html {
  scroll-behavior: smooth;
}

body {
  padding-bottom: 5vh;
}

[id] {
  scroll-margin-top: 5rem; 
}

#return button{
  position: fixed;
  right: 0;
  top: 0;
  margin: 1rem;
  width: 5rem;
  height: 2.5rem;
  font-size: 0.6rem;
  border-radius: 1rem;
  border-width: 0.1rem;
  border-style: none;
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
  box-shadow: inset 0 0 0 0.04rem black; 
  transition: all 0.3s ease-out 0s;
}

#return button:hover{
  font-weight: 900;
  box-shadow: inset 0 0 0 0.1rem black; 
}

section {
  width: 70%;
  margin: auto;
}

a {
  color: inherit;
  text-decoration: none;
  font-weight: bold;
}

h1 {
  font-size: 8rem;
  display: block;
  margin: 5vh 0 0 5vw;
  /*margin-top: 10vh;*/
}

#ProjectList {
  display: flex;
  height: 70vh;
  flex-direction: column;
  align-items: center;
  justify-content: stretch;
  gap: 2vh;
}

.ProjectTab {
  flex: 1;
  color: inherit;
  text-decoration: none;
  display: grid;
  grid-template-columns: 2fr 4fr;
  align-items: center;
  justify-items: center;
  background-color: white;
  width: 60vw;
  border-radius: 99px;
  overflow: hidden;
  box-shadow: 0.3rem 0.3rem 0.9rem -0.4rem;
  transition: transform 0.3s ease-out 0s;
}

picture {
  justify-self: start;
  display: block;
  box-sizing: border-box;
  border-radius: 99px 2rem 2rem 99px;
  border-width: 0.5rem;
  border-style: solid;
  border-color: transparent;
  width: 100%;
  height: 100%;
  overflow: hidden;
}

picture img {
  height: 100%;
  width: 100%;
  padding: 0;
  margin: 0;
  object-fit: cover; 
}

.ProjectTab h2 {
  line-height: 1;
  font-size: 2rem;
}

.ProjectTab:hover {
  transform: scale(1.05);
  z-index: 10;
}

h2 {
  padding: 0;
  margin: 0;
  /*padding-top: 0.4rem;*/
  line-height: 0.9;
  display: block;
  font-size: 4rem;
  text-align: center;
}

.ProjectBanner {
  scroll-margin-top: 4.5rem; 
  display: flex;
  flex-direction: column;
  align-items: center;
  margin: 10vh 0 5vh 0;
  padding: 2vh;
  background-color: white;
  box-shadow: 0rem -0.5rem 1rem -1rem;
  gap: 1rem;
}

.ProjectBanner button {
  width: 10rem;
  height: 2rem;
  border-style: none;
  border-radius: 0.6rem;
  box-sizing: border-box;
  box-shadow: inset 0 0 0 0.05rem black;
  font-size: 0.7rem;
  border-color: black;
  transition: all 0.3s ease-out 0s;
  overflow: hidden;
  line-height: 1rem;
}

.ProjectBanner button:hover {
  box-shadow: inset 0 0 0 0.09rem black;
  transform: scale(1.04);
  font-weight: 900;
}

h3 {
  font-size: 2rem;
  padding: 0;
  margin: 0;
  margin-top: 3rem;
}

.GameTitleImage {
  box-sizing: border-box;
  width: 80%;
  margin: auto;
  box-shadow: 0.3rem 0.3rem 0.9rem -0.4rem;
  border-radius: 1rem;
  aspect-ratio: 3.6/1;
  overflow: hidden;
  margin-bottom: 1.4rem;
}

img {
  margin: 0;
  padding: 0;
  width: 100%;
}

.InfoBlock {
  background-color: lightgrey;
  margin: 1% 0 1% 0;
  padding: 1%;
  border-radius: 1rem;
  border-style: solid;
}

.InfoBlock p {
  margin: 0 0.5rem 0 0.5rem;
  font-size: 1.2rem;
}

.InfoBlock h2 {
  margin: 0 0 0rem 0.4rem;
}

.RoleOnGame {
  width: 100%;
}

ul {
  padding: 0;
  width: 100%;
  list-style: none;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(0, 1fr));
  gap: 2%;
}

li{
  padding: 1%;
  margin: 0;
}

.imageArray {
  display: flex;
  justify-content: center;
  height: 20vh;
  gap: 0.5rem;
  width: 100%; /* ensure it takes full width */
}

.imageArray img {
  height: 100%; /* fill the container height */
  width: auto; /* maintain aspect ratio */
  border-radius: 1rem;
  flex-shrink: 1; /* allow images to shrink if needed */
  min-width: 0; /* allow flexbox to shrink below intrinsic size */
  box-shadow: 0.3rem 0.3rem 0.9rem -0.4rem;
}

@media (max-aspect-ratio: 4/3) {
  .imageArray {
    flex-wrap: wrap;
    height: auto;
  }
  
  .imageArray img {
    height: 10vh; /* smaller fixed height */
    width: auto; /* maintain aspect ratio */
    max-width: 48%; /* 2 images per row with gap */
  }
}

/*——————————————————
  MOBILE HEADER  (≤ 768px)
——————————————————*/
@media (max-width: 768px) {
    h1 {
      font-size: 8rem;
      display: block;
      margin: 8vh 0 0 5vw;
      /*margin-top: 10vh;*/
    }

    #return button{
    position: fixed;
    right: 0;
    top: auto;
    bottom: 0;
    margin: 1rem;
    width: 10rem;
    height: 5rem;
    font-size: 1.3rem;
    border-radius: 2rem;
    border-width: 0.01rem;
    border-style: none;
    -webkit-backdrop-filter: blur(10px);
    backdrop-filter: blur(10px);
    box-shadow: inset 0 0 0 0.04rem black; 
    transition: all 0.3s ease-out 0s;
    z-index: 100;
  }

  p {
    font-size: 1.3rem;
  }

  .ProjectBanner button {
    width: 15rem;
    height: 4rem;
    border-style: none;
    border-radius: 1rem;
    box-sizing: border-box;
    box-shadow: inset 0 0 0 0.05rem black;
    font-size: 1.2rem;
  }

}