* { 
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
font-family: "IBM Plex Sans", sans-serif;
font-weight: 700;
font-variation-settings: "wdth" 75;
display: flex;
flex-direction: column;
height: 100vh; /* Fallback */
height: 100dvh;
overflow: hidden;
background: #f9f9f9;
}

/* TOP GALLERY (desktop + mobile) */
#gallery {
  flex: 8;
  display: flex;
  gap: 1rem;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  background: #fff;
  padding: 1rem;
  align-items: center;
}
#gallery::-webkit-scrollbar { 
  height: 8px; 
}
#gallery::-webkit-scrollbar-thumb { 
  background: #aaa; border-radius: 4px; 
}
.artwork {
  flex: 0 0 auto;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  scroll-snap-align: start;
  background: #000;
  /* opacity: 0; */
  /* transition: opacity 0.8s ease-in; */
}
.artwork img {
  height: 100%;
  width: auto;
  object-fit: contain;
  display: block;
}

/* ABOUT PAGE */
  #biography {
    flex: 8;
    overflow-y: auto;
    padding: 4rem;
    background: #fff;
    font-size: 4vh;  
    line-height: 1.6;
    color: #111;
    font-weight: 400;
    opacity: 0;
    transition: opacity 1s ease;
    max-width: 100vw;    /* Ensure it never exceeds the screen width */
    overflow-x: hidden;  /* Extra safety for the text container */
  }
    #biography.loaded {
      opacity: 1;
    }

/* DESKTOP NAV */
#nav {
  flex: 2;
  display: flex;
  color: white;
  padding: 1rem;
  border-top: 4px solid #000;
  background: #f9f9f9;
}
#nav-left {
  flex: 1;
  display: flex;
  border-right: 1px solid rgba(0,0,0,0.2);
}
.logo {
  height: 100%;
  width: auto;
  display: block;
}
#nav-links {
  flex: 2;
  display: flex;
  flex-direction: column;
  height: 100%;
}
#nav-links a {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: left;
  color: #000;
  text-decoration: none;
  transition: background-color 0.5s ease;
  width: 100%;
  font-size: calc(20vh / 4);
  line-height: 1;
}
#nav-links a:hover {
  background-color: var(--hover-color, #555);
  color: white;
}

/* DESKTOP COLLECTION BUTTONS */
#nav-right {
  flex: 1;
  display: flex;
  flex-wrap: wrap;
  align-content: flex-start;
  gap: 0.5rem;
  padding-left: 1rem;
  overflow-y: auto;
}
.collection-btn {
  background: #D9D9D9;
  border: none;
  color: white;
  padding: 0.4rem 0.8rem;
  cursor: pointer;
  transition: background 0.3s;
  font-size: 1rem;
  font-weight: 700;
  font-variation-settings: "wdth" 75;
}
.collection-btn:hover {
  background-color: var(--hover-color, #666);
}
.active { background: #007bff !important; }

/* Hide mobile menu */
#mobile-menu {
  visibility: hidden;
  height: 0px;
}

.cv-link {
  color: #000;
  text-decoration: none;
  border-bottom: 2px solid #000;
  font-weight: 700;
  font-size: 2rem;
  transition: all 0.3s ease;
}

.cv-link:hover {
  background-color: var(--hover-color, #007bff);
  color: white;
  border-color: transparent;
}

#bio-text, #cv-text {
  word-break: break-word;
  overflow-wrap: break-word;
}

/* Ensure the artwork wrapper can contain the absolute-positioned icon */
.artwork {
  position: relative; /* Crucial for positioning the 'i' icon */
  flex: 0 0 auto;
  height: 100%;
}

/* THE "i" ICON */
.info-icon {
  position: absolute;
  bottom: 20px;
  right: 20px;
  width: 30px;
  height: 30px;
  background: rgba(255, 255, 255, 0.8);
  border: 1px solid #000;
  border-radius: 50%;
  cursor: pointer;
  font-family: "IBM Plex Sans", serif;
  font-weight: 700;
  font-style: italic;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
  z-index: 10;
}

.info-icon:hover {
  background: #000;
  color: #fff;
  transform: scale(1.1);
}

/* THE MODAL (POPUP) */
.modal {
  display: none;
  position: fixed;
  z-index: 2000; /* Above everything else */
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.5); /* Dimmed background */
  align-items: center;
  justify-content: center;
  backdrop-filter: blur(4px);
}

#modal-text {
  white-space: pre-wrap; /* This keeps your paragraphs and line breaks intact */
  word-wrap: break-word;
}

.modal-content {
  background-color: #fff;
  padding: 2.5rem;
  border: 4px solid #000;
  width: 80%;
  max-width: 500px;
  position: relative;
  font-weight: 400;
  font-size: 1.2rem;
  line-height: 1.5;
}

.close-modal {
  position: absolute;
  top: 10px;
  right: 15px;
  color: #000;
  font-size: 2rem;
  font-weight: bold;
  cursor: pointer;
}

.close-modal:hover {
  color: #555;
}

@media (max-width: 900px) {
  .modal-content {
    width: 90%;
    font-size: 1rem;
    padding: 1.5rem;
  }
}

/**************************************
MOBILE LAYOUT
**************************************/
@media (max-width: 900px) {

  #biography {
    padding: 2rem;
    font-size: 1.6rem;  
  }

  /* Remove desktop hover-colour behaviour */
  #nav-links a:hover,
  .collection-btn:hover {
    background-color: #D9D9D9 !important;
  }

  /* Move collection buttons to a horizontal bar */
  #nav-right {
    display: none; /* hides desktop location */
  }
  #mobile-collections {
    display: flex;
    overflow-x: auto;
    white-space: nowrap;
    gap: 0.5rem;
    padding: 0.5rem;
    background: #eee;
    border-bottom: 2px solid #000;
  }
  #mobile-collections .collection-btn {
    flex: 0 0 auto;
  }
  #mobile-collections .collection-btn.active {
    background: #007bff !important;
  }

  /* Bottom nav becomes logo + hamburger */
  #nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
  }
  #nav-left {
    flex: none;
    width: 50%;
    border: none;
  }
  #nav-links {
    display: none;
  }
  .logo {
    height: 100%;
    max-height: 100%;
  }
  #hamburger {
    width: 50%;
    text-align: right;
    font-size: 3rem;
    background: none;
    border: none;
    cursor: pointer;
    color: #000;
  }

  /* Fullscreen mobile menu */
#mobile-menu {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100dvh; /* Use dynamic height here too */
  background: #fff;
  display: none;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  z-index: 999;
  visibility: visible;
}
  #mobile-menu a {
    font-size: 3rem;
    margin: 1rem 0;
    color: #000;
    text-decoration: none;
  }
}
