.nml-hd {
    padding: 128px 0 80px;
    background-color: var(--color-primary);
    background-position: bottom center;
    background-size: cover;
    background-repeat: no-repeat;
}

.nml-hd__hero {
    margin-bottom: 48px;
    text-align: center;
}

.nml-hd__inner {
    max-width: 894px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.nml-hd__heading {
    color: var(--color-text-white);
    margin: 0;
    font-size: 56px;
    line-height: 64px;
    font-weight: 700;
    margin-bottom: 20px;
}

.nml-hd__subhead {
    margin: 0 0 32px;
    font-size: 18px;
    line-height: 26px;
    font-weight: 500;
    display: flex;
    align-items: center;
    text-align: center;
    color: var(--color-text-white);
}

/* ── Buttons row ── */
.nml-hd__btns {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
    gap: 12px;
}

.nml-hd__demo-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 12px 24px;
    background: #FFFFFF;
    border: 1px solid var(--color-line);
    border-radius: 8px;
    cursor: pointer;
    font-size: 16px;
    line-height: 24px;
    font-weight: 700;
    color: var(--color-primary);
    transition: background 0.2s, border-color 0.2s;
    height: 48px;
    justify-content: center;
    text-decoration: none;
}

.nml-hd__demo-btn svg {
    flex-shrink: 0;
}

.nml-hd__demo-btn:hover {
    background: #FFFFFF80;
}

/* ── Ratings ── */
.nml-hd__ratings {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
    gap: 32px;
    margin-top: 32px;
}

.nml-hd__rating-item {
    display: flex;
    align-items: center;
    gap: 12px;
}

.nml-hd__rating-icon--container {
    width: 24px;
    height: 24px;
    background: #fff;
    box-shadow: 0 2px 2px rgba(0, 0, 0, 0.08);
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.nml-hd__rating-item img {
    width: 16px;
    height: 16px;
}

.nml-hd__rating-text {
    display: flex;
    flex-direction: column;
}

.nml-hd__rating-label {
    font-size: 16px;
    line-height: 24px;
    font-weight: 600;
    color: var(--color-text-white);
}

.nml-hd__rating-sublabel {
    font-size: 12px;
    line-height: 16px;
    font-weight: 500;
    color: var(--color-text-white);
    text-align: left;
}

/* ── Embed (arcade / iframe) ── */
.nml-hd__embed-wrap {
    max-width: 880px;
    margin: 0 auto;
}

.nml-hd__embed {
    border: 10px solid rgba(255, 255, 255, 0.2);
    filter: drop-shadow(0px 4px 12px rgba(23, 76, 183, 0.2));
    border-radius: 18px;
    box-shadow: 0px 4px 12px 0px #174CB733;
    overflow: hidden;
}

.nml-hd__embed div{
    padding-bottom: calc(57.844879% + 0px)!important;
}

.nml-hd__embed iframe {
    display: block;
}

/* ── Demo popup ── */
.nml-hd__modal {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 1100;
    align-items: center;
    justify-content: center;
    padding: 20px;
    /* Высота окна: dvh там, где поддерживается (мобильные адресные строки). */
    --nml-hd-vh: 100vh;
    /* Всё, что занимает высоту вокруг видео: отступы модалки (40) + рамка
       диалога (2) + его padding (80) + заголовок (48+24) + отступ под видео (24)
       + футер (42). */
    --nml-hd-chrome: 260px;
    --nml-hd-avail: calc(var(--nml-hd-vh) - var(--nml-hd-chrome));
}

@supports (height: 100dvh) {
    .nml-hd__modal {
        --nml-hd-vh: 100dvh;
    }
}

.nml-hd__modal.is-open {
    display: flex;
}

.nml-hd__modal-overlay {
    position: absolute;
    inset: 0;
    background: rgba(6, 8, 11, 0.72);
    -webkit-backdrop-filter: blur(4px);
    backdrop-filter: blur(4px);
}

.nml-hd__modal-dialog {
    position: relative;
    width: 100%;
    max-width: 1208px;
    max-height: 100%;
    overflow-y: auto;
    overscroll-behavior: contain;
    padding: 40px;
    background: #fff;
    border-radius: 16px;
    box-shadow: 0px 6px 12px 0px #0D0D0D33;
    border: 1px solid var(--color-line);
}

.nml-hd__modal-close {
    position: absolute;
    top: 16px;
    right: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    padding: 0;
    background: none;
    border: none;
    color: #303D60;
    cursor: pointer;
    z-index: 2;
}

.nml-hd__modal-title {
    margin: 0 0 24px;
    text-align: center;
    font-size: 40px;
    line-height: 48px;
    font-weight: 700;
    color: var(--color-text-primary);
}

.nml-hd__modal-video {
    position: relative;
    /* Ширина = меньшее из «во всю ширину диалога» и «сколько влезает по высоте
       окна при 16:9». Пропорция сохраняется, попап не выходит за экран и
       никогда не становится больше, чем сейчас. */
    width: min(100%, max(160px, calc(var(--nml-hd-avail) * 16 / 9)));
    margin-left: auto;
    margin-right: auto;
    aspect-ratio: 16 / 9;
    border-radius: 12px;
    overflow: hidden;
    background: #F5F6FA;
    border: 1px solid var(--color-line);
    margin-bottom: 24px;
}

.nml-hd__modal-video iframe {
    position: absolute;
    inset: 0;
    display: block;
    width: 100%;
    height: 100%;
    border: 0;
}

.nml-hd__modal-foot {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
    gap: 24px;
}

.nml-hd__modal-text {
    margin: 0;
    font-size: 18px;
    line-height: 26px;
    font-weight: 700;
    color: var(--color-text-secondary);
}

.nml-hd__modal-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 10px 24px;
    background: var(--color-primary);
    border: 1px solid var(--color-primary-dark);
    border-radius: 8px;
    font-size: 14px;
    line-height: 20px;
    font-weight: 700;
    color: var(--color-text-white);
    text-decoration: none;
    transition: background 0.2s;
}

.nml-hd__modal-btn:hover {
    background: var(--color-primary-dark);
}

@media (max-width: 768px) {
    .nml-hd {
        padding: 104px 0 40px;
    }

    .nml-hd__heading {
        font-size: 40px;
        line-height: 48px;
        margin-bottom: 16px;
    }

    .nml-hd__subhead {
        margin: 0 0 24px;
        font-size: 16px;
        line-height: 24px;
    }

    .nml-hd__btns {
        flex-direction: column;
        width: 100%;
        gap: 8px;
    }

    .nml-hd__btns .btn-primary-black{
        height: 44px;
        font-size: 14px;
        line-height: 20px;
        width: 100%;
    }

    .nml-hd__demo-btn {
        height: 44px;
        font-size: 14px;
        line-height: 20px;
        width: 100%;
    }

    .nml-hd__ratings {
        gap: 12px 32px;
    }

    .nml-hd__rating-item img {
        width: 20px;
        height: 20px;
    }

    .nml-hd__rating-label {
        font-size: 14px;
        line-height: 20px;
    }

    .nml-hd__hero {
        margin-bottom: 40px;
    }

    .nml-hd__embed {
        border: 6px solid rgba(255, 255, 255, 0.2);
        border-radius: 4px;
    }

    .nml-hd__modal {
        /* 40 (отступы модалки) + 2 (рамка) + 40 (padding диалога)
           + 52 (заголовок 32+20) + 20 (отступ под видео) + ~74 (футер колонкой). */
        --nml-hd-chrome: 230px;
    }

    .nml-hd__modal-dialog {
        padding: 20px;
        border-radius: 12px;
    }

    .nml-hd__modal-video {
        border-radius: 8px;
        margin-bottom: 20px;
    }

    .nml-hd__modal-title {
        font-size: 24px;
        line-height: 32px;
        margin: 0 0 20px;
    }

    .nml-hd__modal-text {
        font-size: 16px;
        line-height: 24px;
    }

    .nml-hd__modal-foot {
        flex-direction: column;
        gap: 8px;
    }

    .nml-hd__modal-btn {
        width: auto;
    }
}
