/* ============ SCROLL-SNAP НА РІВНІ СТОРІНКИ ============
   Snap container і scroll container — один елемент (body).
*/
html {
    height: 100%;
    overflow: hidden;
}

body {
    height: 100%;
    overflow-y: scroll;
    scroll-snap-type: y mandatory;
    scroll-behavior: auto;
}

/* ============ БАЗОВА СЕКЦІЯ ============ */
.section {
    position: relative;
    width: 100%;
    height: 100vh;
    scroll-snap-align: start;
    scroll-snap-stop: always;
    overflow: hidden;
}

/* Фон — fixed-стопка на весь екран, відео перемикаються через opacity (кросфейд).
   Спільна чорна підкладка живе на body, щоб прозорий фон не давав затемнення. */
.section__bg {
    position: fixed;
    inset: 0;
    z-index: 0;
    opacity: 0;
    transition: opacity 0.6s ease;
    pointer-events: none;
}

.section__bg.is-active {
    opacity: 1;
}

.section__video {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* ============ ВНУТРІШНЯ РОЗМІТКА СЕКЦІЇ (з Figma 1440×750) ============
   padding-top: 60px, padding-bottom: 90px,
   padding-left: 20px, padding-right: 18px
   title-col: 453px, content-col: 926px, gap: 23px
*/
.section__inner {
    position: relative;
    z-index: 1;
    max-width: 1440px;
    margin: 0 auto;
    height: 100%;
    padding: 60px 18px 90px 20px;
}

.section__inner--split {
    display: flex;
    align-items: flex-start;
    gap: 23px;
}

/* ============ КОЛОНКА ЗАГОЛОВКА (статична всередині секції) ============ */
.section__title-col {
    flex: 0 0 453px;
    display: flex;
    flex-direction: column;
    gap: 40px;
}

.section__title {
    font-family: 'e-Ukraine', sans-serif;
    font-weight: 400;
    font-size: 50px;
    line-height: 60px;
    color: var(--color-white);
}

.section__lead {
    font-family: 'e-Ukraine', sans-serif;
    font-weight: 300;
    font-size: 28px;
    line-height: 36px;
    color: var(--color-grey);
}

/* ============ ПРАВА КОЛОНКА — СКРОЛ КАРТОК ВСЕРЕДИНІ СЕКЦІЇ ============ */
.section__viewport {
    flex: 0 0 926px;
    height: 100%;
    overflow-y: auto;
    overflow-x: hidden;
    display: flex;
    flex-direction: column;
    gap: 20px;
    /* приховуємо скролбар, але скрол лишається активним */
    scrollbar-width: none;
}

/* Desktop: viewport карток заповнює повну вертикаль секції (без верх/низ полів) */
@media (min-width: 769px) {
    .section--pin .section__viewport {
        height: 100vh;
        margin-top: -60px;
        margin-bottom: -90px;
        opacity: 0;
        transition: opacity 0.4s ease;
    }
    .section--pin .section__viewport::before {
        content: '';
        flex: 0 0 60px;
    }
    .section--pin.is-active .section__viewport {
        opacity: 1;
        transition: none;
    }

    .section--pin .section__title-col {
        visibility: hidden;
    }

    .flow-titles {
        position: fixed;
        top: 60px;
        left: max(20px, calc((100vw - 1440px) / 2 + 20px));
        width: 453px;
        z-index: 3;
        pointer-events: none;
    }
    .flow-title {
        position: absolute;
        top: 0;
        left: 0;
        width: 100%;
        display: flex;
        flex-direction: column;
        gap: 40px;
        opacity: 0;
        transition: opacity 0.4s ease;
    }
    .flow-title.is-active {
        opacity: 1;
    }
    .flow-title .section__title {
        font-weight: 400;
        font-size: 50px;
        line-height: 60px;
        color: var(--color-white);
    }
    .flow-title .section__lead {
        font-weight: 300;
        font-size: 28px;
        line-height: 36px;
        color: var(--color-grey);
    }
}

@media (min-width: 769px) and (max-width: 1439px) {
    .flow-titles {
        width: 33%;
        max-width: 453px;
    }
    .flow-title .section__title {
        font-size: clamp(32px, 3.5vw, 50px);
        line-height: 1.2;
    }
    .flow-title .section__lead {
        font-size: clamp(18px, 2vw, 28px);
        line-height: 1.3;
    }
}

@media (max-width: 768px) {
    .flow-titles { display: none; }
}

@media (min-width: 769px) and (max-width: 1439px) {
    .section__title-col {
        flex: 0 0 33%;
    }
    .section__viewport {
        flex: 1 1 auto;
        min-width: 0;
    }
    .section__title {
        font-size: clamp(32px, 3.5vw, 50px);
        line-height: 1.2;
    }
    .section__lead {
        font-size: clamp(18px, 2vw, 28px);
        line-height: 1.3;
    }
}

.section__viewport::-webkit-scrollbar {
    display: none;
}

/* ============ СПЕЦІАЛЬНІ РЯДКИ КАРТОК ============ */
.cards-row--1-1-2 {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) minmax(0, 2fr);
}


/* ============ СПИСОК ВСЕРЕДИНІ КАРТКИ ============ */
.card.card--list {
    gap: 60px;
}

.card__items {
    list-style: none;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 40px 20px;
    margin: 0;
    padding: 0;
    width: 100%;
}

.card__items--1col {
    grid-template-columns: 1fr;
}

.card__items--3col {
    grid-template-columns: 1fr 1fr 1fr;
}

.card__items li {
    font-family: 'e-Ukraine', sans-serif;
    font-weight: 200;
    font-size: 22px;
    line-height: 28px;
    color: var(--color-white);
    padding-left: 34px;
    position: relative;
    min-height: 24px;
}

.card__items li::before {
    content: '';
    position: absolute;
    left: 0;
    top: 2px;
    width: 24px;
    height: 24px;
    background: url('../assets/images/check.svg') no-repeat center;
    background-size: contain;
}

/* ============ КАРТКИ ============ */
.cards-row {
    display: grid;
    gap: 20px;
    flex-shrink: 0;
}

.cards-row--2 {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
}

.cards-row--3 {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) minmax(0, 1fr);
}

.card {
    position: relative;
    border-radius: var(--card-radius);
    padding: 30px 30px 80px;
    display: flex;
    flex-direction: column;
    gap: 14px;
    isolation: isolate;
    background:
        linear-gradient(
            to top,
            var(--card-bg-bottom),
            var(--card-bg-top)
        );
    backdrop-filter: blur(var(--card-blur));
    -webkit-backdrop-filter: blur(var(--card-blur));
    box-shadow: var(--card-glow-top), var(--card-glow-bottom);
}

.card__number {
    font-family: 'e-Ukraine', sans-serif;
    font-weight: 400;
    font-size: 50px;
    line-height: 60px;
    color: var(--color-white);
}

.card__number--accent {
    color: var(--color-accent);
}

.card__caption {
    font-family: 'e-Ukraine', sans-serif;
    font-weight: 200;
    font-size: 22px;
    line-height: 28px;
    color: var(--color-white);
}

.card__label {
    font-family: 'e-Ukraine', sans-serif;
    font-weight: 200;
    font-size: 22px;
    line-height: 28px;
    color: var(--color-grey);
}

.card__lead {
    font-family: 'e-Ukraine', sans-serif;
    font-weight: 300;
    font-size: 28px;
    line-height: 36px;
    color: var(--color-white);
}

.card--wide {
    flex-direction: row;
    align-items: flex-start;
    overflow: hidden;
}

.card--wide-reverse {
    flex-direction: row-reverse;
}

.card__lead u,
.card__caption u {
    text-decoration: underline;
    text-decoration-skip-ink: none;
    text-underline-position: from-font;
}

.card__textblock {
    flex: 0 0 394px;
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.card--wide:not(.card--wide-reverse):not(.card--wide-s2) .card__textblock {
    flex: 0 0 516px;
}

.card__image {
    position: absolute;
    right: 34px;
    top: 0;
    bottom: 0;
    width: auto;
}

.card__image img {
    height: 100%;
    width: auto;
    display: block;
}

.card--wide-reverse .card__image {
    right: auto;
    left: 34px;
}

/* ============ СЕКЦІЯ 2 — КАРТКА «ЗАПУСТИЛИ» ============ */
.card--wide-s2 {
    height: 371px;
    min-height: 371px;
    flex-shrink: 0;
    padding-bottom: 30px;
    justify-content: space-between;
}

.card--wide-s2 .card__textblock {
    flex: 0 0 394px;
}

.card--wide-s2 .card__image {
    position: relative;
    inset: auto;
    flex-shrink: 0;
    width: 422px;
    height: 325px;
    align-self: flex-start;
}

.card--wide-s2 .card__image img {
    width: 100%;
    height: 100%;
    display: block;
    object-fit: contain;
}


/* ============ КАРТКА З РІВНИМИ ФЛЕКС-КОЛОНКАМИ (macbook + статистика) ============ */
.card--wide-equal {
    height: 349px;
    padding: 30px;
    gap: 20px;
}

.card--wide-equal .card__textblock {
    flex: 1 0 0;
}

.card--wide-equal .card__image {
    position: relative;
    inset: auto;
    flex: 1 0 0;
    height: 100%;
    overflow: visible;
}

.card--wide-equal .card__image img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.card__image--macbook {
    position: relative;
    overflow: visible;
}

.m8-pic {
    display: none;
}

.m-br {
    display: none;
}

.card--wide-equal::before {
    content: '';
    position: absolute;
    inset: 0;
    pointer-events: none;
    z-index: 1;
    background: radial-gradient(
        ellipse 50% 80% at 25% 50%,
        rgba(160, 160, 190, 0.7) 0%,
        transparent 70%
    );
}

.card__image--macbook img {
    position: relative;
    z-index: 1;
}

.card__image-placeholder {
    width: 100%;
    height: 100%;
    border: 1px dashed rgba(255, 255, 255, 0.2);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--color-grey);
    font-size: 14px;
    text-align: center;
    padding: 12px;
}

.video-card {
    position: relative;
    border-radius: var(--card-radius);
    overflow: hidden;
    height: 518px;
    flex-shrink: 0;
}

.video-card::after {
    content: '';
    position: absolute;
    inset: 0;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: var(--card-radius);
    pointer-events: none;
    z-index: 1;
}

.card__image-placeholder--video {
    min-height: 420px;
}

/* ============ VIDEO PLAYER CONTROLS ============ */
.video-controls {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 2;
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 20px 20px 18px;
    background: linear-gradient(to top, rgba(0,0,0,0.75) 0%, transparent 100%);
    opacity: 0;
    transition: opacity 0.25s ease;
}

/* показуємо тільки при наведенні */
.video-card:hover .video-controls {
    opacity: 1;
}

.video-controls__btn {
    flex-shrink: 0;
    width: 36px;
    height: 36px;
    background: rgba(255,255,255,0.15);
    border: 1px solid rgba(255,255,255,0.3);
    border-radius: 50%;
    color: #fff;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.15s;
}

.video-controls__btn:hover {
    background: rgba(255,255,255,0.3);
}

.video-controls__btn svg {
    width: 16px;
    height: 16px;
}

/* play/pause іконки */
.video-controls__btn .icon-pause { display: none; }
.video-card.is-playing .video-controls__btn#play-section6 .icon-play  { display: none; }
.video-card.is-playing .video-controls__btn#play-section6 .icon-pause { display: block; }

/* sound іконки */
.video-controls__btn .icon-sound  { display: none; }
.video-card.is-sound .video-controls__btn#sound-section6 .icon-muted { display: none; }
.video-card.is-sound .video-controls__btn#sound-section6 .icon-sound  { display: block; }

/* range input — нативний прогрес-бар */
.video-controls__range {
    flex: 1;
    -webkit-appearance: none;
    appearance: none;
    height: 4px;
    background: rgba(255,255,255,0.3);
    border-radius: 2px;
    outline: none;
    cursor: pointer;
    border: none;
}

.video-controls__range::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background: #fff;
    cursor: pointer;
}

.video-controls__range::-moz-range-thumb {
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background: #fff;
    cursor: pointer;
    border: none;
}

.video-controls__range::-webkit-slider-runnable-track {
    background: transparent;
}

.video-controls__range::-moz-range-track {
    background: rgba(255,255,255,0.3);
    height: 4px;
    border-radius: 2px;
}

.card__video {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

/* ============ HERO ============ */
.section--hero .section__inner {
    padding: 40px 20px 20px 20px;
}

.hero {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    height: 100%;
}

.hero__content {
    display: flex;
    flex-direction: column;
    gap: 35px;
}

.hero__title {
    font-family: 'e-Ukraine', sans-serif;
    font-weight: 400;
    font-size: 70px;
    line-height: 85px;
    color: var(--color-white);
}

.hero__subtitle {
    font-family: 'e-Ukraine', sans-serif;
    font-weight: 300;
    font-size: 28px;
    line-height: 36px;
    color: var(--color-grey);
    max-width: 532px;
}

.hero__logos {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
}

.logo-ua {
    height: 103px;
    width: auto;
    display: block;
}

.logo {
    height: 70px;
    width: auto;
    display: block;
}
