body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, sans-serif;
  background: white;
  overflow-x: hidden;
}
body.no-scroll { overflow: hidden; }
.hidden { display: none !important; }
.clickable { cursor: pointer; }
.stealth-link { text-decoration: none; color: inherit; }

nav {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  padding: 2rem;
  position: fixed;
  top: 0; width: 100%;
  box-sizing: border-box;
  z-index: 10;
}
nav div:nth-child(2) { text-align: center; }
nav div:last-child { text-align: right; }

#single-view {
  height: 100vh;
  display: flex;
  justify-content: center;
  align-items: center;
  position: relative;
}

#click-left {
  position: absolute; left: 0; top: 0; width: 50%; height: 100%; z-index: 5;
  cursor: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="40" height="20" style="font-family:sans-serif;font-size:12px;"><text y="15">back</text></svg>') 0 10, auto;
}
#click-right {
  position: absolute; right: 0; top: 0; width: 50%; height: 100%; z-index: 5;
  cursor: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="40" height="20" style="font-family:sans-serif;font-size:12px;"><text y="15">next</text></svg>') 0 10, auto;
}

figure {
  margin: 0;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  z-index: 1;
}

#main-img-container {
  position: relative;
  background-color: var(--bg-color);
  --max-w: 80vw;
  --max-h: 70vh;
  view-transition-name: active-box;
}

#main-img-container.limit-w { width: var(--max-w); height: auto; }
#main-img-container.limit-h { height: var(--max-h); width: auto; }

#main-img {
  display: block; 
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0;
  transition: opacity 0.3s ease;
  view-transition-name: active-image;
}
#main-img.loaded { opacity: 1; }

figcaption {
  margin-top: 0.5rem;
  font-family: "Georgia", serif;
  font-style: italic;
  font-size: 0.75rem;
}

#overview-view { padding: 6rem 2rem 2rem; }
.grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4rem;
}

.grid-item {
  aspect-ratio: 4 / 5;
  background: white; 
  display: flex;
  justify-content: center;
  align-items: center;
  cursor: pointer;
  width: 100%;
}

.img-wrapper {
  position: relative;
  background-color: var(--bg-color);
  --max-p: 60%;
}
.img-wrapper.limit-w { width: var(--max-p); height: auto; }
.img-wrapper.limit-h { height: var(--max-p); width: auto; }

.img-wrapper img {
  display: block; 
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0;
  transition: opacity 0.3s ease;
}
.img-wrapper img.loaded { opacity: 1; }

#about-overlay {
  position: fixed; top: 0; left: 0; width: 100%; height: 100%;
  background: rgba(255, 255, 255, 0.9);
  z-index: 20;
  display: flex; justify-content: center; align-items: center;
  text-align: center;
  cursor: pointer;
}
.about-content { max-width: 600px; padding: 2rem; }
.about-content a { color: black; }

@media (max-width: 768px) {
  nav { padding: 1.5rem; }
  #overview-view { padding: 5rem 1rem 1rem; }
  .grid { gap: 1rem; }
  .img-wrapper { --max-p: 90%; }
  #main-img-container { --max-w: 85vw; --max-h: 55vh; }
}

/* Custom View Transition Morphing */
::view-transition-group(active-box),
::view-transition-group(active-image) {
  animation-duration: 0.8s; 
  animation-timing-function: cubic-bezier(0.25, 1, 0.5, 1); 
}

::view-transition-old(active-image),
::view-transition-new(active-image) {
  height: 100%;
  width: 100%;
  object-fit: cover; 
}