@media (max-width: 768px) {
  /* Base structure */

  .wrapper {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    overflow: hidden;
    /* Prevent wrapper from scrolling directly */
  }

  /* Main content area */
  .main-content {
    order: 1;
    flex: 1;
    width: 100vw;
    padding: 1rem;
    overflow-y: auto;
    margin: 0;
  }

  /* Bottom menubar */
  .menubar {
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100vw;
    max-width: 100%;
    min-width: 100%;
    height: auto;
    padding: 3%;
    background: linear-gradient(to top, rgb(0, 0, 0) 0%,
     rgb(0, 0, 0) 30%,
      rgba(0, 0, 0, 0.06) 100%);
    z-index: 100;
    display: flex;
    justify-content: center;
    overflow: hidden;
  }

  /* Navigation links */
  .nav-links {
    align-items: center;
    padding: 0 1rem;
    flex-direction: row;
    gap: 0;
    align-self: center;
  }

  .nav-links a {
    display: flex;
    flex-direction: column;
  }

  .nav-links a span {
    display: none;
  }

  .nav-links img.icon {
    width: 75%;
    height: auto;
    margin-bottom: 0.2rem;
    margin-right: 0;
    transition: transform 0.2s ease-out, filter 0.3s ease-out;
  }

  /* Define the active state for the icon when its parent link is active */
  .nav-links a.active img.icon {
    transform: translateY(-20%);
    /* Move icon upwards */
    filter: brightness(1.5) drop-shadow(0 0 5px white);
    /* Apply glow effect */
  }

  /* ========  MOBILE SOME LINKS HEADER ======= */

  .mobile-somelinks {
    order: 0;
    width: inherit;
    padding: 1rem;
    background: rgba(0, 0, 0, 0.8);
    z-index: 99;
    display: flex;
    flex-shrink: 0;
  }

  /* Container for social icons */
  .mobile-some-icons {
    display: flex;
    justify-content: space-around;
    align-items: center;
    width: 100%;
    max-width: inherit;
  }

  .mobile-some-icons img {
    width: 2.75rem;
    height: auto;
    object-fit: contain;
    will-change: filter;
  }

  .mobile-some-icons .mobile-icon-link img:active {
    filter: brightness(120%) drop-shadow(0 0 20px rgba(255, 255, 255, 0.7));
    transform: scale(1.15);
  }

  /* ====================== GENERAL CONTENT ==================== */
  .grid-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 0.5rem;
    width: 100%;
    padding-inline: 0rem;
    box-sizing: border-box;
    max-width: 1600px;
    justify-content: center;
    margin-bottom: 15vh;
  }
  

  /* ========== Hide desktop-only elements ========== */
  .logo.desktop-only,
  .some-icons:not(.footer-icons) {
    display: none;
  }
  .member-flag-logo {
    display: none;
  }

.home-video {
  width: auto; /* Or try 100% */
  height: 100vh; /* Or try auto, or a fixed value */
  object-fit: cover; /* <--- Change this value */
  position: relative;
  top: 0;
  left: inherit;
  z-index: 0;
  animation: fade-in 0.5s ease-in-out;
  filter: brightness(1) contrast(0.97);
}

  /* ============ GLOBAL PAGE SPECIFIC STYLES =========== */
  .page-title {
    font-size: 1.3em;
    line-height: inherit;
    margin-bottom: 0;
    padding: 0;

    h2 {
      font-size: 1.5rem;
      line-height: 1.1em;
      margin-block: 0.4em;
    }
  }

  p {
    font-size: 0.7em;
  }

  /* ================= 
    PAGE SPECIFIC STYLES  
    ================== */

  /* =========== GAME PAGE =========== */

  /* Specific margin for the grid container in the last page-content within #game */
  #game .page-content:last-child .grid-container {
    margin-bottom: 15vh;
  }


  .game-item ul {
    font-size: 1rem;
    line-height: 1em;
    padding-left: 0;
  }

  .game-item ul li {
    margin-bottom: 0.8em;
  }

  /* ======= PROGRESS PAGE ========== */
.progress-description {
	width: 90%;
}


  /* ====================== TEAM MEMBER STYLES ==================== */

  /* ------- THUMBNAIL IMAGES -------- */

  .team-member:not(.active-inspection) .member-info::after,
  .team-member:not(.active-inspection) .member-intro::after {

    background: none;

  }

  .team-member {
    width: 100%;
    aspect-ratio: 16/3;
    margin: 0;
    padding: 0.01em;
  }

  .team-member h3 {
    font-size: 1rem;
  }

  .text-container {
    margin: 0;
    gap: 0;
  }

  .current-object p {
    font-size: 1.1rem;
    line-height: 1.1;
    margin: 0 0 1rem 0;
    display: flex;
    text-align: start;
  }

  .member-info {
    padding: 0.3em;
    text-align: end;
    padding-right: 0.6em;

    background: linear-gradient(to bottom,
        rgba(0, 0, 0, 0.59),
        rgba(13, 13, 13, 0));
  }

  .member-info h2 {
    font-size: 1.2rem;
    margin: 0 0 0.5rem 0;
    letter-spacing: 1px;
    color: #fff;
  }

  .member-info h3::after {
    content: "";
    display: block;
    width: 100%;
    height: 2px;
    background: none;
    margin-top: 0.5rem;
  }

  .member-intro {
    display: none;

    h2 {
      font-size: 1.5em;
      margin: 0;
    }

    h3 {
      font-size: 1.1;
      margin: 0;
    }
  }

  #joonatan .member-intro {
    display: flex;
    text-align: end;
    background: linear-gradient(to bottom,
        rgba(0, 0, 0, 0.59),
        rgba(13, 13, 13, 0));
    padding: 0.2em;
    border-radius: 5px;
    min-width: 0;
    font-size: 0.8rem;
    line-height: 1.5;
    font-family: "AITTA Magpie toes", serif;
    flex: 2;
    justify-content: flex-start;
  }

  #talents .member-info {
    text-align: center;
    padding: 0;
    display: flex;
    flex-direction: column;
    justify-content: center;
    height: 100%;

    h2 {
      margin: 0;
    }
  }

  /* ====================== MOBILE INSPECTION STYLES ==================== */

  .inspection-overlay {
    :is(.team-member.active-inspection, .game-item.active-inspection) {
      position: absolute;
      top: 50%;
      left: 50%;
      z-index: 1001;
      opacity: 0;
      transition: opacity 0.2s ease, transform 0.2s ease;
      transform-origin: bottom;
      transform: translate(-50%, -50%) scale(0.9);
      height: 100%;
      max-height: 92vh;
      width: 92%;
      color: #fff;
      display: flex;
      flex-direction: column;
      padding: 0;
      box-sizing: border-box;
      font-size: 1em;
      aspect-ratio: auto;
    }


    .member-flag-logo {
      display: flex;

    }

    .text-container {
      flex-direction: column;
      gap: 1em;
    }

    #game-leif .character-text-box {
      left: 0;
      top: 0;
    }

    #game-osmo .character-text-box {
      left: 0;
      bottom: 20%;

    }

    .game-item.active-inspection {
      background-size: contain;
    }

    /* Add overlay to character-image when active inspection */
    .character-image.active-inspection::before {
      content: "";
      position: absolute;
      top: 0;
      left: 0;
      right: 0;
      bottom: 0;
      background-color: rgba(0, 0, 0, 0.5);

      filter: contrast(80%);
      z-index: 1;
      /* Ensure it's above the background image but below text */
    }

    .character-image.active-inspection {

      background-size: inherit;
      background-position-x: right;

      .character-text-box {
        max-width: 90%;
        padding: 1em;
      }
    }

    /* Show class to animate the element in */
    .team-member.active-inspection.show,
    .game-item.active-inspection.show {
      opacity: 1;
      transform: translate(-50%, -50%) scale(1);
      background-position-y: top;
    }

        .game-item.concept-art.active-inspection.show {
        /* Override background position for mobile */
        background-position: center center !important;
        /* Ensure full visibility */
        justify-content: center;
        align-items: center;
    }
  }

  .inspection-overlay.active .origins-text-box {
    width: 100%;
    font-size: 0.9em;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.4);
    padding-top: 0;
  }

  .inspection-overlay.active #joonatan .text-container>.member-info {
    .traits li {
      font-size: 1.2rem;
    }
  }

  /* When a team member is inspected, remove its direct background */
  .team-member.active-inspection.show {
    background: none !important;
    /* Ensures no direct background on the main inspected element */
  }

  /* Font size adjustments for elements within an active team member inspection */
  .team-member.active-inspection {
    .text-container>.member-info {
      /* Generic background properties for member-info when its parent .team-member is active-inspection */
      /* Specific background-image will be set per member ID below, including .show class */
      background-size: cover;
      background-position: center;
      /* The previous generic background-image for lurppalee.jpg is removed from here */
    }

    .traits li {
      font-size: 1.1em;
      line-height: 0.4em;
    }

    &#lurppa.show .text-container>.member-info {
      background-image: url("images/team/plain/lurppa-plain.jpg");
    }

    &#aino.show .text-container>.member-info {
      background-image: url("images/team/plain/aino-plain.jpg");
    }

    &#puppe.show .text-container>.member-info {
      background-image: url("images/team/plain/puppe-plain.jpg");
    }

    &#dianuli.show .text-container>.member-info {
      background-image: url("images/team/plain/dianuli-plain.jpg");
    }

    &#julia.show .text-container>.member-info {
      background-image: url("images/team/plain/julia-plain.jpg");
    }


    /* Specific override for Julia's member-intro when active and shown on mobile */
    &#julia.show .text-container>.member-intro {
      display: flex;
      justify-content: flex-start;
      /* Override desktop's justify-content: end */
    }

    &#joonatan.show .text-container>.member-info {
      background-image: url("images/team/plain/joonatan-plain.jpg");
      background-size: contain;
      max-height: fit-content;
      text-align: start;
      background-repeat: no-repeat;
      padding: 2em;
      background-position: top;

      .traits {
        margin: auto;
        font-size: 1.5em;
      }
    }

    & h2 {
      font-size: 1.5rem;
    }

    &#talents.show .text-container>.member-info {
      background-image: url("images/team/plain/talents.jpg");
    }



    .text-container>.member-intro {
      display: flex;
      font-size: 1rem;
      min-width: auto;
      min-height: fit-content;
      justify-content: flex-start;
      overflow: hidden;
    }


    .inspection-overlay.active .team-member.active-inspection h3 {
      font-size: 1.2em;
      /* Relative to the .team-member.active-inspection's 1em base */
      line-height: 1.3;
      color: #e0e0e0;
      /* Ensure text color is appropriate */
    }

    .inspection-overlay.active .team-member.active-inspection .traits li {
      font-size: 1.2em;
      line-height: 0.5;
      color: #d0d0d0;
    }

    /* Ensure paragraphs within inspection also have a readable base size if not overridden */
    .inspection-overlay.active .team-member.active-inspection p {
      font-size: 1em;
      /* Or adjust as needed, relative to .team-member.active-inspection */
      line-height: 1.5;
    }
  }

  #lurppa.team-member.active-inspection {
    & .text-container>.member-intro {
      font-size: 0.9rem;
    }
  }

  #joonatan.team-member.active-inspection {
    & .traits li {
      font-size: 1.2rem;
      line-height: inherit;
    }
  }

  #julia.team-member.active-inspection {
    & .traits li {
      font-size: 1.1em;
      line-height: 1.4em;
    }
  }

  #dianuli.team-member.active-inspection,
  #lurppa.team-member.active-inspection {
    & .works li {
      font-size: 1.3rem;
    }
  }

  #puppe.team-member.active-inspection {
    & .text-container>.member-intro {
      font-size: 0.9rem;
    }
  }

  #aino.team-member.active-inspection {
    & .text-container>.member-intro {
      font-size: 0.9rem;
    }
  }

  .team-member.active-inspection.show ul {
    font-size: 1.1em;
    line-height: 1.1em;
  }

  /* ========= MOBILE EFFECTS ======== */

  .inspection-overlay.active .text-container>.member-info::before {
    opacity: 1;
    background: linear-gradient(to bottom, rgba(13, 13, 13, 0.4), rgba(13, 13, 13, 0.1), rgba(13, 13, 13, 0));
  }

  /* Slide to the right animation */
  @keyframes slide-up {
    from {
      transform: translateY(0);
    }

    to {
      transform: translateY(-20%);
    }
  }

  /* Slide back animation */
  @keyframes slide-back {
    from {
      transform: translateY(-20%);
    }

    to {
      transform: translateY(0);
    }
  }

}