html {
  scroll-padding-top: calc(100px + 5px);
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  scroll-behavior: smooth;
  scrollbar-width: none;
  -ms-overflow-style: none;
}

::-webkit-scrollbar {
  display: none;
}

body {
  position: relative;
  width: 100vw;
  min-height: 100vh;
  overflow-x: hidden;
}

mark {
  background-color: rgb(255, 219, 148);
}

#gotop {
  position: fixed;
  bottom: min(30px, 5vw);
  right: min(50px, 4vw);
  width: fit-content;
  height: min(140px, 10vw);
  transition: height .5s;
}

#gotop img {
  height: 100%;
  object-fit: contain;
  object-position: center;
}

#gotop .text-wrap * {
  word-wrap: nowrap;
}

#gotop:hover .text-wrap {
  opacity: 1;
}

.main {
  display: flex;
  max-width: 100vw;
  margin: 50px 0;
  margin-bottom: 150px;
  padding: 0 70px;
  justify-content: center;
}

.main .menubg {
  position: relative;
  flex: none;
  width: 280px;
  border-radius: 20px;
  margin: 50px 0;
  overflow: hidden;
  transition: width .5s;
}

.main .menubg #menu {
  position: sticky;
  padding: 30px 20px;
  width: 100%;
  transition: width .5s;
}

.main .menubg #menu .t1 {
  position: relative;
  text-transform: capitalize;
  padding: 5px;
  font-size: 15px;
  transition: .5s;
}

.main .menubg #menu .t1::before {
  opacity: .3;
  position: absolute;
  content: "";
  display: block;
  width: 18px;
  height: 20px;
  left: -2px;
  top: 8px;
  transform: translateX(-100%);
  transition: .5s;
  background-image: url(https://static.igem.wiki/teams/4628/wiki/menuicon.svg);
  background-size: contain;
  background-repeat: no-repeat;
}

.main .menubg #menu .t1:hover::before {
  opacity: 1;
}

.main .menubg #menu .t1.unfold::before {
  top: 10px;
}

.main .menubg #menu .t1.unfold {
  font-size: 20px;
}

.main .menubg #menu .t1.unfold + .h2-sec {
  grid-template-rows: 1fr;
  opacity: 1;
  font-size: 10px;
}

.main .menubg #menu .t1.unfold + .h2-sec .t2 {
  text-transform: capitalize;
  padding: 3px 15px;
  border-radius: 5px;
}

.main .menubg #menu .h2-sec {
  overflow: hidden;
  display: grid;
  grid-template-rows: 0fr;
  transition: grid .5s, opacity .8s;
  opacity: 0;
  font-size: 0;
}

.main .menubg #menu .h2-sec .t2 {
  transition: .8s;
  min-height: 0;
}

.main .menubg #menu .divide {
  opacity: 0;
  height: 0;
  width: fit-content;
  position: relative;
  margin-top: 0;
  left: 15px;
  transition: .8s;
}

.main .menubg #menu .t1.unfold + .h2-sec .divide {
  height: 20px;
  margin-top: 5px;
  opacity: 1;
}

.main .menubg #menu .divide img {
  height: 100%;
  object-fit: contain;
  object-position: center;
}

.main .menubg #menu.fixed {
  position: fixed;
  top: 80px;
  width: 280px;
}

.main #content {
  position: relative;
  flex: 1;
  max-width: min(60vw, calc(100% - 280px));
  padding: 30px 80px;
  border-radius: 20px;
  transition: width .5s;
}

.main #content::before {
  content: "";
  display: block;
  position: absolute;
  z-index: -1;
  width: 100%;
  height: 100%;
  border-radius: 20px;
  top: 20px;
  left: 15px;
}

.main #content .s1 {
  margin: 30px 0;
  width: 100%;
}

.main #content .s1.ref p {
  text-indent: 0;
  font-size: .8em;
  text-align: left;
}

.main #content .s2 {
  margin: 20px 0;
  width: 100%;
}

.main #content .s2 p {
  padding-left: calc(40px + 2em);
}

.main #content .math {
  width: 100%;
  overflow-x: auto;
  overflow-y: hidden;
  padding-left: 40px;
}

.main #content .h1-wrap {
  width: -moz-fit-content;
  width: fit-content;
  position: relative;
  margin: 40px 0;
}

.main #content .h1-wrap h1 {
  padding: 2px;
  letter-spacing: .02em;
}

.main #content h2 {
  margin: 30px 20px;
}

.main #content p {
  width: 100%;
  margin: 10px 0;
  text-indent: 2em;
  line-height: 1.5em;
}

.main #content p.no-indent {
  text-indent: 0;
}

.main #content img,
.main #content video {
  vertical-align: bottom;
  max-width: 100%;
  -o-object-fit: cover;
  object-fit: cover;
  -o-object-position: center;
  object-position: center;
}

.main #content .img-wrap {
  width: 100%;
  display: flex;
  margin: 15px 0;
  padding-left: 40px;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 10px;
}

.main #content .img-wrap img {
  object-fit: contain;
}

.main #content .img-wrap .border {
  position: relative;
  width: -moz-fit-content;
  width: fit-content;
  height: -moz-fit-content;
  height: fit-content;
  border: 1px solid var(--y);
  box-shadow: 5px 6px var(--y);
  overflow: hidden;
  background-color: #fff;
}

.main #content .img-wrap .disc {
  font-size: .8em;
}

.main #content .o-o {
  display: flex;
  gap: 20px;
}

@media all and (max-width: 920px) {
  .main .menubg {
    width: 0;
    margin: 0;
  }

  .main .menubg #menu,
  .main .menubg #menu.fixed {
    width: 0;
    opacity: 0;
    pointer-events: none;
  }

  .main #content {
    min-width: calc(100vw - 100px);
  }

  .poster {
    position: relative;
    width: 100%;
    max-width: 100%; /* Prevents the image from exceeding the screen width */
    height: auto; /* Allows the image height to scale with the width */
    margin-bottom: 20px; 
  }

  .poster .title {
    font-size: min(60px, 10vw);
    left: 50%;
    transform: translate(-50%, -50%);
  }

  #gotop {
    height: max(30px, 15vw);
  }
}

@media all and (max-width: 700px), all and (max-aspect-ratio: 2/3) {
  .main {
    gap: 0;
    background-color: #fffdf7 !important;
    margin-bottom: 0;
    padding: 0 !important;
  }

  .main #content {
    flex: -1;
    flex-grow: -1;
    flex-shrink: -1;
    width: 100vw !important;
    max-width: 100vw;
    margin: 0;
    padding: 0 20px;
    background-color: #fffdf7;
  }

  .main #content.mem {
    background-color: var(--bg) !important;
  }

  .main #content::before {
    display: none;
  }

  #gotop {
    height: 25vw;
    display: none;
  }

  .main #content h2,
  .main #content h3,
  .main #content p {
    max-width: 100%;
    padding-left: 0 !important;
    margin-left: 0 !important;
    text-align: left !important;
  }

  .main #content p.quote {
    padding-left: 20px !important;
  }

  .main #content .img-wrap {
    padding-left: 0 !important;
  }

  .main #content .img-wrap img {
    height: 200px;
  }
}

#gotop {
  position: fixed;
  bottom: min(30px, 5vw);
  right: min(50px, 4vw);
  width: fit-content;
  height: min(140px, 10vw);
  transition: transform 0.3s ease, height 0.5s;
}

#gotop:hover {
  transform: scale(1.1); /* Slightly increase the size */
}

#gotop img {
  height: 100%;
  object-fit: contain;
  object-position: center;
}

#gotop .text-wrap * {
  word-wrap: nowrap;
}

#gotop:hover .text-wrap {
  opacity: 1;
}

.poster {
  width: 100vw;
  max-width: 1200px;
  aspect-ratio: 4;
  left: 50%;
  left: 0;
  right: 0;
  margin: 10px auto;
  position: relative;
}

.poster::after,
.poster::before {
  content: "";
  display: block;
  position: absolute;
  height: 100%;
  width: 100%;
}

.poster::after {
  z-index: -1;
  top: 18%;
  background-color: rgba(255, 197, 112, .3);
}

.poster::before {
  z-index: -2;
  top: 35%;
  background-color: rgba(109, 150, 107, .1);
}

.poster .bg {
  position: relative;
  top: 10px;
  left: 0;
  height: 100%;
  width: 100%;
  background-color: var(--mg);
  /* Removed border-radius to make it rectangular */
}

.poster .img::after {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.3); /* Slight black tint */
  z-index: 1; /* Ensure it is on top of the image */
}

.poster .img {
  position: absolute;
  vertical-align: bottom;
  top: 0;
  left: 0;
  width: 100%;
  aspect-ratio: 4;
  overflow: hidden;
  /* Removed border-radius to make it rectangular */
  background-color: var(--bg);
}

.poster .img img {
  width: 100%;
  height: 100%;
  vertical-align: bottom;
  object-fit: cover;
  object-position: center;
  border: none;
  background-color: transparent;
}

.poster .title {
  position: absolute;
  left: 50%; /* Start from the center horizontally */
  top: 50%; /* Start from the center vertically */
  transform: translate(-50%, -50%); /* Center the title both horizontally and vertically */

  color: rgb(255, 255, 255);
  font-size: 60px;
  transition: left .5s, font-size .5s;
  z-index: 100;
  font-weight: bold;
  font-family: 'DM Sans', sans-serif;
}


.s1-container {
  display: flex;
  gap: 20px; 
  width: fit-content;
}

.s1 {
  flex: 1;
}

.quote-box p {
  text-align: left; /* Align text to the left for better readability */
  line-height: 1.6; /* Adjust line height for better spacing between lines */
  font-family: Montserrat-Reg,sans-serif; /* Ensure a clean, readable font */
  font-size: 1em; /* Set a consistent font size */
  margin: 0; /* Remove any extra margin */
  word-break: break-word; /* Handle long words by breaking them */
  text-indent: 0 !important;
}

.spacing {
  margin-top: 50px;
}

.row.info-boxes.spacer {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  padding: 20px;
}

.center {
  text-align: center;
  width: 100%;
}

.quote-box {
  width: 45%; /* Ensure boxes are consistent in size */
  background-color: #ffffff;
  box-shadow: rgba(0, 0, 0, 0.24) 0px 3px 8px;
  border-radius: 10px;
  padding: 20px;
  margin: 10px 0;
  box-sizing: border-box;
  transition: transform 0.3s ease; /* Add a transition for hover effect */
}

.quote-box:hover {
  transform: scale(1.05); /* Slightly enlarge on hover for effect */
}

.info-boxes {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); /* 2 columns by default, but responsive */
  gap: 10px; /* Space between grid items */
}

.statistic-box {
  background-color: #ffffff;
  box-shadow: rgba(0, 0, 0, 0.24) 0px 3px 8px;
  border-radius: 10px;
  padding: 20px;
  box-sizing: border-box;
  text-align: center; /* Center text within the box */
}

.statistic-box h4 {
  font-size: 3rem;
  margin: 0; /* Remove default margin for consistency */
}

.statistic-box p {
  font-weight: bold;
  margin: 0; /* Remove default margin for consistency */
  text-indent: 0 !important;
}

.statistic-box:nth-child(1) h4 {
  color: #cc8cf7;
}

.statistic-box:nth-child(2) h4 {
  color: #ec7278;
}

.statistic-box:nth-child(3) h4 {
  color: #59a378;
}

.statistic-box:nth-child(4) h4 {
  color: #f5b561;
}

@media (max-width: 768px) {
  .info-boxes {
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); /* Adjust for smaller screens */
  }
}

@media (max-width: 480px) {
  .info-boxes {
    grid-template-columns: 1fr; /* Single column for very small screens */
  }
}
