
/* ----------------------------- Hero ------------------------------ */
.hero {
    color: var(--color-bg-white);
    padding: 0 24px 24px;
    margin: 0 auto;
}

@media (min-width: 1440px) and (max-width: 1919px) {
    .hero {
        max-width: 1440px;
    }

    .hero__title {
        font-size: 70px;
    }
}

@media (min-width: 1920px) {
    .hero {
        max-width: 1920px;
    }
}

.hero__grid {
    display: grid;
    grid-template-columns: minmax(0, 1.07fr) minmax(0, 1fr);
    gap: var(--gap);
    align-items: stretch;
}

.hero__intro {
    position: relative;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 16px 80px;
    background: var(--color-primary);
    border-radius: var(--radius-lg);
}

.hero__intro-video {
    position: absolute;
    inset: 0;
    z-index: 0;
    width: 100%;
    height: 100%;
    object-fit: fill;
    pointer-events: none;
}

.hero__intro-content {
    position: relative;
    z-index: 2;
    max-width: 690px;
}

.hero__title {
    color: var(--color-bg-white);
}

.hero__title-accent {
    color: var(--color-primary);
}

.hero__subtitle {
    margin: 18px 0 0;
    max-width: 610px;
    font-size: 24px;
    font-weight: 500;
    line-height: 1.5;
    color: color-mix(in srgb, var(--color-bg-white) 90%, transparent);
}

.hero__actions {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
    margin-top: 44px;
}

.hero__cta {
    padding: 22px 28px;
    font-weight: 700;
}

/* --- Bento card grid (desktop) --- */
.hero__cards {
    display: flex;
    flex-wrap: wrap;
    gap: var(--gap);
}

.hero__card {
    position: relative;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    padding: 32px;
    border-radius: var(--radius);
    overflow: hidden;
    background: var(--color-bg-darkest);
    color: var(--color-bg-white);
    text-decoration: none;
    height: 249px;
}

.hero__card--dvir {
    flex: 0 0 273px;
    max-width: 273px;
    background: var(--color-primary);
}

/* --- DVIR+ card: driver photo + grid pattern + hover reveal --- */
/* Decorative line-grid pattern, rotated and kept inside the card. */
.hero__card--dvir-photo {
    position: absolute;
    z-index: 1;
    right: 0;
    bottom: 0;
    height: 100%;
    width: auto;
    transform-origin: bottom right;
    transition: transform 0.4s ease;
    pointer-events: none;
    transform: scale(1.2);
}

.hero__card--dvir:hover .hero__card--dvir-photo {
    transform: scale(1);
}

.hero__card--app::before {
    content: '';
    position: absolute;
    inset: 0;
    z-index: 2;
    background: linear-gradient(180deg, rgba(17, 42, 212, 0) 0%, #112AD4 100%);
    opacity: 0;
    transition: opacity 0.4s ease;
    pointer-events: none;
}

.hero__card--app:hover::before {
    opacity: 1;
}

.hero__card--app:hover {
    .hero__card--app-photo {
        position: absolute;
        z-index: 1;
        right: 0;
        bottom: 0;
        height: 100%;
        width: auto;
        transform-origin: bottom;
        pointer-events: none;
        transform: translateY(30%) scale(1.3) translateX(-3px);
        transition: all .4s ease;
    }
}

.hero__card-content {
    position: relative;
    z-index: 3;
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.hero__card-mobile-link {
    display: none;
}

.hero__card-subtitle {
    margin: 8px 0 0;
    max-width: 60%;
    font-size: 14px;
    font-weight: 500;
    line-height: 1.35;
    color: rgba(255, 255, 255, 0.85);
    opacity: 0;
    transform: translateY(6px);
    pointer-events: none;
    transition: opacity 0.35s ease, transform 0.35s ease;
}

.hero__card--dvir .button-outlined-cta--small,
.hero__card--app .button-outlined-cta--small {
    align-self: flex-start;
    display: inline-flex;
    align-items: center;
    text-decoration: none;
    opacity: 0;
    transform: translateY(6px);
    pointer-events: none;
    transition: opacity 0.35s ease, transform 0.35s ease;
}

.hero__card--dvir:hover .hero__card-subtitle,
.hero__card--dvir:hover .button-outlined-cta--small,
.hero__card--app:hover .hero__card-subtitle,
.hero__card--app:hover .button-outlined-cta--small {
    opacity: 1;
    transform: translateY(0);
    pointer-events: auto;
}

.hero__card--dash {
    flex: 1 1 0;
    min-width: 0;
    background-image: url("../../../../assets/images/hero/ai-dashcam-desktop.webp");
    background-size: cover;
    background-position: center;
}

.hero__card--dash::before {
    content: '';
    position: absolute;
    inset: 0;
    z-index: 2;
    background: linear-gradient(
        180deg,
        transparent 25.11%,
        color-mix(in srgb, var(--color-black) 60%, transparent) 102.11%
    );
    pointer-events: none;
}

.hero__card-dash-video {
    position: absolute;
    inset: 0;
    z-index: 1;
    width: 100%;
    height: 100%;
    object-fit: cover;
    opacity: 0;
    transition: opacity 0.4s ease;
    pointer-events: none;
}

.hero__card--dash:hover .hero__card-dash-video {
    opacity: 1;
}

.hero__card-dash-content {
    align-items: flex-end;
    justify-content: space-between;
    flex-direction: row;
    gap: 16px;
}

.hero__card-dash-subtitle {
    margin: 0;
    max-width: 260px;
    max-height: 0;
    overflow: hidden;
    font-size: 14px;
    font-weight: 500;
    line-height: 1.35;
    color: color-mix(in srgb, var(--color-bg-white) 85%, transparent);
    opacity: 0;
    transform: translateY(16px);
    pointer-events: none;
    transition: max-height 0.35s ease, margin-top 0.35s ease, opacity 0.35s ease, transform 0.35s ease;
}

.hero__card-dash-btn {
    flex-shrink: 0;
    opacity: 0;
    transform: translateY(16px);
    pointer-events: none;
    transition: opacity 0.35s ease, transform 0.35s ease, background-color 0.15s ease;
}

.hero__card--dash:hover .hero__card-dash-subtitle {
    margin-top: 8px;
    max-height: 60px;
    opacity: 1;
    transform: translateY(0);
    pointer-events: auto;
}

.hero__card--dash:hover .hero__card-dash-btn {
    opacity: 1;
    transform: translateY(0);
    pointer-events: auto;
}

.hero__card--safe {
    flex: 1 1 100%;
    background-image: url("../../../../assets/images/hero/safe-fleet-desktop.webp");
    background-size: cover;
    background-position: center;

    .hero__card-label {
        font-size: 36px;
    }
}

.hero__card--safe::after {
    content: '';
    position: absolute;
    inset: 0;
    z-index: 2;
    background: linear-gradient(180deg, rgba(17, 42, 212, 0) 0%, #112AD4 81.47%);
    opacity: 0;
    transition: opacity 0.4s ease;
    pointer-events: none;
}

.hero__card--safe:hover::after {
    opacity: .5;
    top: 54px;
}

.hero__card--safe .hero__card-pill,
.hero__card--safe .hero__card-label {
    position: relative;
    z-index: 3;
}

.hero__card-safe-top {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.hero__card-safe-expand {
    display: flex;
    flex-direction: column;
    gap: 8px;
    max-height: 0;
    margin-top: 0;
    overflow: hidden;
    opacity: 0;
    pointer-events: none;
    transition: max-height 0.35s ease, margin-top 0.35s ease, opacity 0.35s ease;
}

.hero__card--safe:hover .hero__card-safe-expand {
    max-height: 140px;
    margin-top: 12px;
    opacity: 1;
    pointer-events: auto;
}

.hero__card-safe-subtitle {
    margin: 0;
    max-width: 70%;
    font-size: 14px;
    font-weight: 500;
    line-height: 1.35;
    color: rgba(255, 255, 255, 0.85);
}

.hero__card-safe-btn {
    align-self: flex-start;
    flex-shrink: 0;
}

.hero__card-safe-video {
    position: absolute;
    inset: 0;
    z-index: 1;
    width: 100%;
    height: 100%;
    object-fit: cover;
    opacity: 0;
    transition: opacity 0.4s ease;
    pointer-events: none;
}

.hero__card--safe:hover .hero__card-safe-video {
    opacity: 1;
}

.hero__card--track {
    flex: 1 1 0;
    min-width: 0;
    background-image: url("../../../../assets/images/hero/tracking-desktop.webp");
    background-size: cover;
    background-position: center;
}

.hero__card--track::before {
    content: '';
    position: absolute;
    inset: 0;
    z-index: 2;
    background: linear-gradient(
        180deg,
        transparent 25.11%,
        color-mix(in srgb, var(--color-black) 60%, transparent) 102.11%
    );
    pointer-events: none;
}

.hero__card-track-video {
    position: absolute;
    inset: 0;
    z-index: 1;
    width: 100%;
    height: 100%;
    object-fit: cover;
    opacity: 0;
    transition: opacity 0.4s ease;
    pointer-events: none;
}

.hero__card--track:hover .hero__card-track-video {
    opacity: 1;
}

.hero__card-track-content {
    align-items: flex-end;
    justify-content: space-between;
    flex-direction: row;
    gap: 16px;
}

.hero__card-track-subtitle {
    margin: 0;
    max-width: 260px;
    max-height: 0;
    overflow: hidden;
    font-size: 14px;
    font-weight: 500;
    line-height: 1.35;
    color: color-mix(in srgb, var(--color-bg-white) 85%, transparent);
    opacity: 0;
    transform: translateY(16px);
    pointer-events: none;
    transition: max-height 0.35s ease, margin-top 0.35s ease, opacity 0.35s ease, transform 0.35s ease;
}

.hero__card-track-btn {
    flex-shrink: 0;
    opacity: 0;
    transform: translateY(16px);
    pointer-events: none;
    transition: opacity 0.35s ease, transform 0.35s ease, background-color 0.15s ease;
}

.hero__card--track:hover .hero__card-track-subtitle {
    margin-top: 8px;
    max-height: 60px;
    opacity: 1;
    transform: translateY(0);
    pointer-events: auto;
}

.hero__card--track:hover .hero__card-track-btn {
    opacity: 1;
    transform: translateY(0);
    pointer-events: auto;
}

.hero__card--app {
    position: relative;
    flex: 0 0 273px;
    max-width: 273px;
    background-color: var(--color-primary);

    .hero__card--app-photo {
        position: absolute;
        z-index: 1;
        right: 0;
        bottom: 0;
        height: 100%;
        width: auto;
        transform-origin: bottom;
        pointer-events: none;
        transition: all .4s ease;
    }
    
    .hero__card-content {
        .hero__card-subtitle {
            max-width: 100%;
            margin-top: 4px;
        }
        .button-outlined-cta--small {
            background-color: var(--color-bg-white);
            color: var(--color-dark-graphite);
            align-self: center;
            img {
                filter: invert(1);
                width: 11px;
                height: 11px;
            }
        }
    }
}

.hero__card-label {
    font-size: 32px;
    font-weight: 700;
    line-height: 1.25;
}

.hero__card-pill {
    align-self: flex-start;
    padding: 6px 12px;
    border-radius: 999px;
    background: var(--color-bg-darkest);
    color: var(--color-primary-light);
    font-size: 12px;
    font-weight: 700;
    text-wrap: nowrap;
}

/* --------------------------- Custom Styles --------------------------- */
.white-color-hero-text-gradient {
    background-image: linear-gradient(111.29deg, #F0F5FA 58.5%, #DCE3F3 86.86%);
    color: transparent;
    background-clip: text;
}

@media (min-width: 1441px) and (max-width: 1919px) {
    .hero__intro {
        padding: 48px;
    }
}

@media (max-width: 1440px) {
    .hero {
        padding: 0 16px 24px;

        .hero__grid {
            grid-template-columns: minmax(0, 1.24fr) minmax(0, 1fr);

            .hero__intro {
                border-radius: 28px;

                .hero__intro-content {
                    max-width: 610px;
                }
            }

            .hero__cards {
                .hero__card {
                    height: 223px;
                }

                .hero__card--dvir,
                .hero__card--app {
                    flex-basis: 244px;
                    max-width: 244px;
                }

                .hero__card--dash {
                    background-image: url("../../../../assets/images/hero/ai-dashcam-desktop-sm.webp");
                }
            }
        }


    }
}

@media (max-width: 1439px) {

    .hero__title {
        font-size: 56px;
        line-height: 114%;
        letter-spacing: -1%;
    }

    .hero__subtitle {
        font-size: 18px;
        margin-top: 20px;
    }
}

@media (max-width: 1024px) {
    .hero {
        padding: 8px 0 24px;

        .hero__grid {
            grid-template-columns: 1fr;

            .hero__intro {
                padding-inline: 60px;
                padding-block: 120px;
                margin-inline: 8px;
            }

            /* Bento grid becomes a horizontal scroll-snap row. */
            .hero__cards {
                display: flex;
                flex-wrap: nowrap;
                gap: 8px;
                overflow-x: auto;
                scroll-snap-type: x mandatory;
                -webkit-overflow-scrolling: touch;
                margin-left: 8px;

                .hero__card {
                    flex: 0 0 25.6%;
                    padding: 20px;
                    height: 280px;
                    scroll-snap-align: start;

                    .hero__card-label {
                        font-size: 22px;
                    }
                }

                .hero__card--dvir {
                    order: 1;
                }

                .hero__card--dash {
                    order: 2;
                }

                .hero__card--app {
                    order: 3;
                }

                .hero__card--track {
                    order: 4;
                }

                .hero__card--safe {
                    order: 5;
                }

                .hero__card--dvir,
                .hero__card--app {
                    max-width: none;

                    .hero__card-mobile-link {
                        display: block;
                        position: absolute;
                        inset: 0;
                        z-index: 4;
                    }

                    .hero__card-subtitle,
                    .button-outlined-cta--small {
                        display: none;
                    }
                }

                .hero__card--app {
                    margin-right: 8px;
                }

                .hero__card--dvir-photo,
                .hero__card--app-photo {
                    right: auto;
                    left: 50%;
                    transform: translateX(-50%);
                }

                .hero__card--dvir,
                .hero__card--dvir *,
                .hero__card--app,
                .hero__card--app * {
                    transition: none !important;
                }

                .hero__card--track {
                    background-image: url("../../../../assets/images/hero/tracking-mobile.webp");
                    background-size: cover;
                    background-position: center;
                }

                .hero__card--safe {
                    background-image: url("../../../../assets/images/hero/safe-fleet-block-mobile.webp");
                    background-size: cover;
                    background-position: center;

                    .hero__card-mobile-link {
                        display: block;
                        position: absolute;
                        inset: 0;
                        z-index: 4;
                    }

                    .hero__card-safe-subtitle {
                        display: none;
                    }

                    .hero__card-content {
                        .hero__card-safe-top {
                            align-items: center;

                            .hero__card-pill {
                                align-self: center;
                                font-size: 10px;
                            }
                        }
                    }
                }

                .hero__card--dash {
                    background-image: url("../../../../assets/images/hero/ai-dashcam-mobile.webp");
                    background-size: cover;
                    background-position: center;

                    .hero__card-mobile-link {
                        display: block;
                        position: absolute;
                        inset: 0;
                        z-index: 4;
                    }
                }

                .hero__card-track-video {
                    display: none;
                }

                .hero__card-safe-video {
                    display: none;
                }

                .hero__card-safe-expand {
                    display: none;
                }

                .hero__card-track-subtitle,
                .hero__card-track-btn {
                    display: none;
                }

                .hero__card-dash-video {
                    display: none;
                }

                .hero__card-dash-subtitle,
                .hero__card-dash-btn {
                    display: none;
                }
            }
        }
    }

    .hero__actions {
        margin-top: 60px;
    }
}

@media (max-width: 576px) {
    .hero {
        .hero__grid {
            gap: 8px;

            .hero__intro {
                padding: 48px 30px;
                margin-inline: 8px;

                .hero__title {
                    font-size: 36px;
                }

                .hero__subtitle {
                    font-size: 14px;
                    margin-top: 12px;
                }
            }

            .hero__cards {
                margin-left: 8px;

                .hero__card {
                    height: 216px;
                    flex-basis: 42%;

                    .hero__card-label {
                        font-size: 20px;
                    }
                }

                .hero__card--dash::before {
                    background: linear-gradient(180deg, rgba(0, 0, 0, 0) 25.11%, rgba(0, 0, 0, 0.5) 102.11%);
                }
            }
        }

    }

    .hero__cta {
        width: 100%;
        padding-block: 13px;
    }

    .hero__actions {
        flex-direction: column;
        align-items: stretch;
        margin-top: 32px;
    }
}