.menu-box {
    display: none;
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100dvh;
    background: var(--smc-pink);
    overflow: hidden;
    transition: all 0.5s ease;
    z-index: 10;
    opacity: 0;
    transition: opacity 0.4s ease, visibility 0.4s ease;
  }
  
  .menu-box.active {
    display: block;
    opacity: 1;
    visibility: visible;
  }
  
  .menu-box .nav-text.mobile-collapse {
    display: block;
    position: relative;
    width: 100%;
    margin: 0;
    padding-left: 3rem;
    transform: translate(0, -50%);
    top: 50%;
  }
  
  .menu-box .nav-text.mobile-collapse li {
    line-height: 1.5;
  }
  
  .menu-box .nav-text.mobile-collapse a h4 {
    /* Prepare for custom underline */
    position: relative;
    display: inline-block;
    text-decoration: none;
    padding-bottom: 0.2em; /* Add space for the underline */

    opacity: 0;
    transition: all 0.2s ease;
    color: white;
    font-size: 5.5rem;
    font-weight: 700;
  }
  
  /* The custom, rounded underline */
  .menu-box .nav-text.mobile-collapse a h4::after {
    content: '';
    position: absolute;
    bottom: 1rem;
    left: 0;
    width: 100%;
    height: 0.2em;
    background-color: white;
    border-radius: 10%/50%; /* Half of height for a pill shape */
    transform: scaleX(0);
    transform-origin: left; /* Animation grows from the left */
    transition: transform 0.5s cubic-bezier(0.215, 0.61, 0.355, 1);
  }
  .menu-box .nav-text.mobile-collapse a:hover h4::after {
    transform: scaleX(1); /* Animate in on hover */
  }

  .menu-box .nav-text.mobile-collapse h4:active {
    scale: 100%;
  }

  .menu-box.active .nav-text.mobile-collapse li:nth-child(1) h4{
    animation: fadeAndrise 0.5s cubic-bezier(0.215, 0.61, 0.355, 1) forwards; 
  }
  .menu-box.active .nav-text.mobile-collapse li:nth-child(2) h4{
    animation: fadeAndrise 0.5s cubic-bezier(0.215, 0.61, 0.355, 1) forwards; 
    animation-delay: 0.1s;
  }
  .menu-box.active .nav-text.mobile-collapse li:nth-child(3) h4{
    animation: fadeAndrise 0.5s cubic-bezier(0.215, 0.61, 0.355, 1) forwards; 
    animation-delay: 0.2s;
  }
  .menu-box.active .nav-text.mobile-collapse li:nth-child(4) h4{
    animation: fadeAndrise 0.5s cubic-bezier(0.215, 0.61, 0.355, 1) forwards; 
    animation-delay: 0.3s;
  }
  .menu-box.active .nav-text.mobile-collapse li:nth-child(5) h4{
    animation: fadeAndrise 0.5s cubic-bezier(0.215, 0.61, 0.355, 1) forwards; 
    animation-delay: 0.4s;
  }


  @media(max-width:500px) {
    .menu-box .nav-text.mobile-collapse {
        padding-left: 2rem;
      }
    .menu-box .nav-text.mobile-collapse a h4 {
        font-size: 4.5rem;

      }
    .menu-box .nav-text.mobile-collapse li {
        line-height: 2;
      }
    .menu-box .nav-text.mobile-collapse a h4::after {
    bottom: 2rem;
  }
  }
