/* ==========================================
   WHY SECTION
   ========================================== */

/* Layout */
.why-inner {
    max-width: 1344px;
    margin: 0 auto;
}

/* Heading */
.why-heading {
    font-size: 64px;
    font-weight: 800;
    color: var(--dark-text);
    letter-spacing: -0.03em;
    line-height: 1;
    text-align: center;
    max-width: 1059px;
    margin: 0 auto 84px;
}

.why-heading-word-rotator {
    position: relative;
    display: inline-block;
    vertical-align: top;
    min-width: 285px;
    height: 1.05em;
    overflow: hidden;
}

.why-heading-word {
    position: absolute;
    left: 0;
    top: 0;
    width: 100%;
    text-align: left;
    opacity: 0;
    transform: translateY(-105%);
    animation: whyWordDrop 12s ease-in-out infinite;
}

.why-heading-word:nth-child(2) {
    animation-delay: 4s;
}

.why-heading-word:nth-child(3) {
    animation-delay: 8s;
}

.why-heading-word.is-visible {
    opacity: 1;
}

@keyframes whyWordDrop {
    0% {
        opacity: 0;
        transform: translateY(-105%);
    }

    8%,
    28% {
        opacity: 1;
        transform: translateY(0);
    }

    36%,
    100% {
        opacity: 0;
        transform: translateY(105%);
    }
}

/* Blocks */
.why-block {
    display: grid;
    grid-template-columns: 1fr 706px;
    gap: 0 48px;
    align-items: center;
    margin-bottom: 115px;
    min-height: 492px;
}

.why-text h3 {
    font-size: 48px;
    font-weight: 800;
    color: var(--dark-text);
    letter-spacing: -0.03em;
    line-height: 1;
    margin-bottom: 30px;
}

.why-text p {
    font-size: 24px;
    font-weight: 500;
    color: var(--grey-60);
    line-height: 1.15;
    letter-spacing: -0.03em;
}

.why-text--narrow {
    display: none;
}

.why-img-wrap {
    border-radius: 30px;
    overflow: hidden;
    height: 492px;
    position: relative;
    background: var(--grey-bg);
}

.why-img-wrap--savings,
.why-img-wrap--support {
    overflow: visible;
}

.why-img-wrap > img.main-bg {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 30px;
}

/* Block 1 */
.why-block--1 {
    padding: 8px 12px;
    min-height: 500px;
    margin-bottom: 190px;
}

.why-block--1__phone {
    position: absolute;
    left: 25px;
    bottom: -54px;
    width: 167px;
    height: 342px;
    z-index: 3;
}

.why-block--1__phone-screen {
    position: absolute;
    left: 9px;
    top: 8px;
    width: 149px;
    height: 325px;
    background: #eee6ff;
    border-radius: 20px;
    overflow: hidden;
    z-index: 2;
}

.why-block--1__phone-icon {
    position: absolute;
    top: 70px;
    left: 50%;
    transform: translateX(-50%);
    width: 88px;
    height: 88px;
    object-fit: cover;
    opacity: 0.78;
}

.why-block--1__phone-title {
    position: absolute;
    top: 163px;
    left: 50%;
    transform: translateX(-50%);
    font-size: 9.7px;
    font-weight: 800;
    color: var(--dark-text);
    text-align: center;
    white-space: nowrap;
    letter-spacing: -0.29px;
}

.why-block--1__phone-text {
    position: absolute;
    top: 180px;
    left: 50%;
    transform: translateX(-50%);
    font-size: 7.3px;
    white-space: nowrap;
    font-weight: 500;
    color: rgba(159, 143, 191, 0.9);
    text-align: center;
    width: 97px;
    line-height: 1.3;
}

.why-block--1__phone-btn {
    position: absolute;
    top: 212px;
    left: 50%;
    transform: translateX(-50%);
    background: var(--purple);
    color: #fff;
    font-size: 5.7px;
    font-weight: 800;
    padding: 7px 11px;
    border-radius: 100px;
    white-space: nowrap;
    text-decoration: none;
    display: block;
    text-align: center;
}

.why-block--1__phone-frame {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    opacity: 0.5;
    z-index: 3;
}

.why-block--1__piggy {
    position: absolute;
    right: -120px;
    top: -20px;
    width: 300px;
    height: 280px;
    transform: rotate(-6.27deg);
    z-index: 1;
}

.why-block--1__piggy img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    object-position: bottom;
}

/* Block 2 */
.why-block--2 {
    padding: 0 26px;
    margin-bottom: 110px;
}

.why-block--2 h3 {
    max-width: 400px;
}

.why-block--2__gear {
    position: absolute;
    left: 35%;
    top: 5%;
    width: 85%;
    height: 90%;
    filter: blur(8.5px);
    opacity: 0.74;
    object-fit: contain;
    pointer-events: none;
    z-index: 0;
}

.why-block--2__screen {
    position: absolute;
    left: -292px;
    bottom: -43px;
    width: 879px;
    height: 470px;
    z-index: 1;
}

.why-block--2__screen img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    object-position: bottom;
    opacity: 0.93;
}

.why-block--2__error {
    position: absolute;
    right: -70px;
    top: -70px;
    width: 480px;
    height: 250px;
    opacity: 0.88;
    z-index: 3;
}

.why-block--2__error img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    object-position: top right;
}

/* Block 3 */
.why-block--3__character {
    position: absolute;
    right: -120px;
    top: 180px;
    bottom: 0;
    width: 192px;
    height: 240px;
    z-index: 1;
}

.why-block--3__character img {
    width: 80%;
    height: 80%;
    object-fit: cover;
}

.notif-card {
    position: absolute;
    background: #fff;
    border: 1px solid var(--grey-border);
    border-radius: 20px;
    width: 370px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.08);
    left: -108px;
    bottom: -89px;
    overflow: hidden;
    padding: 40px 45px 16px;
    text-align: center;
    z-index: 3;
}

.notif-close {
    position: absolute;
    top: 15px;
    right: 14px;
    width: 28px;
    height: 28px;
    background: var(--grey-bg);
    border-radius: 50%;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}

.notif-close img {
    width: 16px;
    height: 16px;
}

.notif-title {
    font-size: 24px;
    font-weight: 800;
    color: var(--dark-text);
    letter-spacing: -0.03em;
    margin-bottom: 12px;
}

.notif-sub {
    font-size: 18px;
    font-weight: 600;
    color: var(--grey-75);
    letter-spacing: -0.03em;
    margin-bottom: -17px;
    line-height: 100%;
}

.notif-img {
    display: block;
    width: 100%;
    height: 145px;
    object-fit: contain;
    object-position: bottom;
}

@media (max-width: 1344px) {
    /* Layout */
    .why-inner {
        padding: 0 12px;
    }

    /* Heading */
    .why-heading {
        font-size: 52px;
        margin-bottom: 28px;
    }

    .why-heading-word-rotator {
        font-size: 52px;
        min-width: 0;
        width: 6.2ch;
        line-height: 100%;
        margin: auto;
    }

    .why-heading-word {
        animation: none;
        opacity: 0;
        transform: none;
    }

    .why-heading-word:first-child {
        opacity: 1;
        position: relative;
    }

    .why-heading-word:not(:first-child) {
        display: none;
    }

    /* Blocks */
    .why-block {
        grid-template-columns: 1fr;
        padding: 24px 0;
        min-height: auto;
        margin-bottom: 55px;
    }

    .why-text h3 br {
        display: none;
    }

    .why-text h3 {
        font-size: 28px;
        text-align: center;
        margin-bottom: 16px;
    }

    .why-text p {
        font-size: 20px;
        line-height: 115%;
        text-align: center;
        margin-bottom: 32px;
    }

    .why-block--1 .why-text p:not(.why-text--narrow),
    .why-block--2 .why-text p:not(.why-text--narrow) {
        display: none;
    }

    .why-text--narrow {
        display: block;
    }

    .why-img-wrap {
        height: 335px;
        border-radius: 16px;
        overflow: visible;
    }

    .why-img-wrap > img.main-bg {
        border-radius: 16px;
    }

    .why-img-wrap::before,
    .why-img-wrap::after {
        content: "";
        position: absolute;
        pointer-events: none;
        z-index: 4;
        background-size: contain;
        background-repeat: no-repeat;
        background-position: center;
    }

    .why-img-wrap--savings > div,
    .why-block--2 .why-img-wrap--support > div,
    .why-block--3 .why-img-wrap--support > div:not(.notif-card) {
        display: none;
    }

    /* Block 1 */
    .why-block--1 {
        margin-bottom: 4px;
    }

    .why-img-wrap--savings > img.main-bg {
        object-position: center calc(50% + 45px);
    }

    .why-img-wrap--savings::before {
        width: 155px;
        height: 155px;
        right: -6px;
        top: -77px;
        background-image: url("../assets/images/piggy-bank.png");
        transform: rotate(6deg);
    }

    .why-img-wrap--savings::after {
        width: 129px;
        height: 264px;
        left: 10px;
        top: 104px;
        background-image: url("../assets/images/hero-person-mob.png");
    }

    /* Block 2 */
    .why-block--2 {
        margin-bottom: 4px;
    }

    .why-block--2 h3 {
        max-width: 100%;
    }

    .why-block--2 p {
        max-width: 587px;
        margin: 0 auto;
    }

    .why-img-wrap--support > img.main-bg {
        object-position: center calc(50% + 28px);
    }

    .why-block--2 .why-img-wrap--support::before {
        width: 254px;
        height: 185px;
        right: 19px;
        top: -49px;
        background-image: url("../assets/images/error-404.png");
    }

    .why-block--2 .why-img-wrap--support::after {
        width: 268px;
        height: 322px;
        left: 10px;
        top: 84px;
        background-image: url("../assets/images/screen-illustration.png");
    }

    /* Block 3 */
    .why-block--3 .why-img-wrap--support::after {
        width: 174px;
        height: 218px;
        right: -7px;
        top: -42px;
        background-image: url("../assets/images/team-character.png");
    }

    .why-block--3 .notif-card {
        display: block;
        left: 16px;
        bottom: -94px;
        z-index: 5;
        width: 247px;
        transform-origin: left bottom;
        padding: 32px 30px 10px;
    }

    .why-block--3 .notif-title {
        font-size: 16px;
        line-height: 100%;
    }

    .why-block--3 .notif-sub {
        font-size: 12px;
    }

    .why-block--3 .notif-img {
        width: 184px;
        height: 135px;
    }

    .why-block--3 .notif-card .notif-close {
        right: 8px;
        top: 8px;
    }
}

@media (max-width: 650px) {
    /* Layout */
    .why-inner {
        padding: 0 8px;
    }

    /* Heading */
    .why-heading {
        font-size: 32px;
        margin-bottom: 32px;
    }

    .why-heading-word-rotator {
        font-size: 32px;
    }

    /* Blocks */
    .why-block {
        padding: 0;
        margin-bottom: 77px;
    }

    .why-text h3 {
        font-size: 24px;
        margin-bottom: 14px;
    }

    .why-text p {
        font-size: 14px;
        margin-bottom: 25px;
    }

    .why-img-wrap {
        height: 259px;
    }

    /* Block 1 */
    .why-block--1 .why-img-wrap--savings {
        margin-bottom: 40px;
    }

    .why-block--1 .why-img-wrap--savings > img.main-bg,
    .why-block--2 .why-img-wrap--support > img.main-bg,
    .why-block--3 .why-img-wrap--support > img.main-bg {
        object-position: initial;
    }

    .why-img-wrap--savings::before {
        width: 169px;
        height: 125px;
        right: -36px;
        top: -31px;
        transform: rotate(0deg);
    }

    .why-img-wrap--savings::after {
        width: 77px;
        height: 272px;
        left: 7px;
        top: 67px;
    }

    /* Block 2 */
    .why-block--2 .why-img-wrap--support {
        height: 241px;
        margin-bottom: 82px;
    }

    .why-block--2 .why-img-wrap--support::before {
        width: 156px;
        right: 0;
        top: -61px;
    }

    .why-block--2 .why-img-wrap--support::after {
        height: 248px;
        left: -32px;
        top: 62px;
    }

    /* Block 3 */
    .why-block--3 .why-img-wrap {
        height: 258px;
    }

    .why-block--3 .why-img-wrap--support::after {
        width: 211px;
        height: 134px;
        right: -63px;
        top: -36px;
    }

    .why-block--3 .notif-card {
        left: 21px;
        bottom: -80px;
        width: 182px;
        border-radius: 10px;
        height: 150px;
        padding: 23px 22px 8px;
    }

    .why-block--3 .notif-title {
        font-size: 11.81px;
    }

    .why-block--3 .notif-sub {
        font-size: 8.85px;
    }

    .why-block--3 .notif-img {
        width: 143px;
        height: 110px;
    }

    .why-block--3 .notif-card .notif-close {
        width: 14px;
        height: 14px;
    }
}

