:root {
    --offset: 6px;
}

body {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
}

h2.main {
    width: 980px;
    font-size: 100px;
    font-family: Helvetica;
    font-weight: bold;
    line-height: 1.06;
    letter-spacing: -0.02em;
    color: #1d1d1f;
}

.mask {
    height: 106px;
    position: relative;
    overflow: hidden;
    margin-top: var(--offset);
}

.mask span {
    display: block;
    box-sizing: border-box;
    position: absolute;
    top: 100px;
    padding-bottom: var(--offset);
    background-size: 100% 100%;
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    background-repeat: no-repeat;
}

.mask span[data-show] {
    transform: translateY(-100%);
    transition: 0.5s transform ease-in-out;
}

.mask span[data-up] {
    transform: translateY(-200%);
    transition: 0.5s transform ease-in-out;
}

.mask span:nth-child(1) {
    background-image: linear-gradient(45deg, #0ecffe 50%, #07a6f1);
}

.mask span:nth-child(2) {
    background-image: linear-gradient(45deg, #18e198 50%, #0ec15d);
}

.mask span:nth-child(3) {
    background-image: linear-gradient(45deg, #8a7cfb 50%, #633e9c);
}

.mask span:nth-child(4) {
    background-image: linear-gradient(45deg, #fa7671 50%, #f45f7f);
}

@media (max-width: 575.98px) {
    h2.main {
        width: 480px;
        font-size: 50px;
        line-height: 1.06;
    }
    .mask {
        height: 49px;
        margin-top: 10px;
    }
    .mask span {
        top: 110px;
        padding-bottom: 5px;
    }
}

@media (max-width: 767.98px) {
    h2.main {
        width: 480px;
        font-size: 50px;
        line-height: 1.06;
    }
    .mask {
        height: 49px;
        margin-top: 10px;
    }
    .mask span {
        top: 110px;
        padding-bottom: 5px;
    }
}

@media (max-width: 991.98px) {
    h2.main {
        width: 480px;
        font-size: 50px;
        line-height: 1.06;
    }
    .mask {
        height: 49px;
        margin-top: 10px;
    }
    .mask span {
        top: 110px;
        padding-bottom: 5px;
    }
}