@media screen and (max-width: 768px) {
  body {
    overflow-y: auto;
  }

  #content {
    position: static;
    transform: none;
    width: 90vw;
    margin: 2rem auto;
    text-align: center;
  }

  h1 {
    font-size: 2.5rem;
    white-space: normal;
  }

  #social-icons {
    justify-content: center;
  }

  #about-me {
    font-size: 1rem;
    max-width: 100%;
  }

  #image-track {
    flex-direction: column;
    position: static;
    transform: none;
    gap: 2rem;
    padding: 2rem 0;
  }

  .image-container {
    width: 90vw;
    margin: 0 auto;
  }

  #image-track > .image-container > .image {
    width: 100%;
    height: auto;
    aspect-ratio: 16 / 9;
  }

  #page-number {
    display: none;
  }

  #mode-toggle-container {
    top: 10px;
    right: 10px;
  }

  #enlarged-view img {
    max-width: 90%;
    max-height: 60%;
  }

  #enlarged-view .text-container {
    max-width: 90%;
    max-height: 60vh;
  }

  .close-button {
    font-size: 2rem;
    top: 0.5rem;
    right: 1rem;
  }
}

body {
  height: 100vh;
  width: 100vw;
  background: #000000;
  margin: 0;
  overflow: hidden;
  font-family: "Roboto Mono", sans-serif;
  color: #e9e4f0;
  user-select: none;
  -webkit-user-select: none;
  -moz-user-select: none;
  -ms-user-select: none;
  /* transition: background 1s ease-in, color 1s ease-in; */
  cursor: crosshair;
}

body.light-mode {
  background: linear-gradient(
    to right,
    #e9e4f0,
    #e9e4f0
  ); /* W3C, IE 10+/ Edge, Firefox 16+, Chrome 26+, Opera 12+, Safari 7+ */
  color: black;
  /* transition: background 1s ease-in, color 1s ease-in; */
}

#content {
  position: fixed;
  left: 5vw;
  top: 50%;
  transform: translateY(-50%);
  z-index: 1000;
  width: 30vw;
  /* transition: color 1s ease-in; Added opacity transition */
  opacity: 1;
}

#image-track {
  display: flex;
  gap: 3vmin;
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(0%, -50%);
}

.image-container {
  position: relative;
  display: inline-block;
}

h1 {
  font-size: 3rem;
  margin-bottom: 1rem;
  white-space: nowrap;
}

#social-icons {
  border-radius: 50%;
  display: flex;
  gap: 1rem;
  margin-bottom: 1rem;
  /* transition: opacity 1s ease-in; */
}

#social-icons img {
  width: 2rem;
  height: 2rem;
  /* transition: opacity 1s ease-in; */
}

#social-icons img.instant-disappear {
  transition: none; /* Override the existing transition */
}

#about-me {
  font-size: 1.1rem;
  max-width: 28vw;
  /* transition: color 2s ease; */
}

#about-me span {
  color: #3498db;
}

body.light-mode #about-me span {
  color: #c950b3;
}

#image-track > .image-container > .image {
  width: 40vmin;
  height: 56vmin;
  object-fit: cover;
  object-position: 100% 50%;
  cursor: crosshair;
  /* transition: object-position 0.6s ease; */
}

#page-number {
  position: fixed;
  bottom: 2rem;
  left: 50%;
  transform: translateX(-50%);
  font-size: 1.5rem;
  z-index: 1000;
  /* transition: color 1.2s ease-in; */
}

#page-number .current {
  font-weight: bold;
}

#enlarged-view {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.8);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity 0.5s ease;
  z-index: 1002;
}

#enlarged-view img {
  max-width: 80%;
  max-height: 80%;
  transition: transform 0.5s ease, filter 0.5s ease;
}

#enlarged-view .text-container {
  color: white;
  opacity: 0;
  transition: opacity 0.5s ease;
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  text-align: left;
  max-width: 80%;
  max-height: 80vh;
  overflow-y: auto;
  padding: 20px;
  border-radius: 10px;
}

#enlarged-view .text-container h2 {
  font-size: 2rem;
  margin-bottom: 1rem;
  text-align: right;
}

#enlarged-view .text-container .highlight {
  background-color: rgba(195, 255, 0, 0.3);
  padding: 2px 5px;
  border-radius: 3px;
}

#enlarged-view .text-container .tech {
  color: #4caf50;
  font-weight: bold;
}

#enlarged-view .text-container .nokia {
  color: #41a4e6;
  font-weight: bold;
}

#enlarged-view .text-container .crux {
  color: #e6c241;
  font-weight: bold;
}

#enlarged-view .text-container .math {
  color: #e87b41;
  font-weight: bold;
}

#enlarged-view .text-container .live {
  color: #e84141;
  font-weight: bold;
}

#enlarged-view .text-container .hcfr {
  color: #985aee;
  font-weight: bold;
}

#enlarged-view .text-container ul {
  list-style-type: disc;
  margin-left: 20px;
}

#enlarged-view .text-container a {
  color: #3498db;
  text-decoration: none;
}

#enlarged-view .text-container a:hover {
  text-decoration: underline;
}
#enlarged-view .text-container p {
  font-size: 1.2rem;
}

#enlarged-view .close-button {
  position: absolute;
  top: 1vw;
  right: 4vh;
  font-size: 3rem;
  color: #d3cce3;
  cursor: pointer;
}

.see-more {
  position: absolute;
  bottom: 10px;
  left: 10px;
  background-color: #3498db;
  color: #e9e4f0;
  border: none;
  padding: 0.5rem 1rem;
  cursor: pointer;
  font-family: "Roboto Mono", monospace;
}

body.light-mode .see-more {
  position: absolute;
  bottom: 10px;
  left: 10px;
  background-color: #c950b3;
  color: black;
  border: none;
  padding: 0.5rem 1rem;
  cursor: pointer;
  font-family: "Roboto Mono", monospace;
}

#mode-toggle-container {
  position: fixed;
  top: 20px;
  right: 20px;
  display: flex;
  align-items: center;
  z-index: 1001;
}

#mode-text {
  font-size: 1rem;
  margin-right: 10px;
  color: #e9e4f0;
}

body.light-mode #mode-text {
  color: black;
}

#dark-mode-toggle {
  font-size: 1.5rem;
  cursor: pointer;
  /* transition: opacity 1s ease-in; */
}

.text-fade-out {
  color: transparent !important;
}

.text-fade-in {
  color: black !important;
}

.icon-hidden {
  opacity: 0;
}

* {
  user-select: none;
  -webkit-user-select: none;
  -moz-user-select: none;
  -ms-user-select: none;
}
