.video-scrolltext-wrapper {
    position: relative;
    width: 100%;
    height: auto;
    overflow: visible;
    z-index: 1;
}

.video-scrolltext-section {
    position: relative;
    width: 100%;
    height: 982px;      /* fixed height */
    max-height: 100vh;
    overflow: hidden;
    color: #fff;
}

.video-scrolltext-bg {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    z-index: 0;
    filter: brightness(0.65);
    will-change: auto;
    transform: translateZ(0); /* Force hardware acceleration */
}

.videoc-wrapper {
    position: relative;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    z-index: 2;
    overflow: hidden;
}

.video-scrolltext-content {
    max-width: 600px;
    font-family: var(--font-primary);
    font-size: 1.125rem;
    font-weight: 400;
    line-height: 1.5;
    text-align: left;
    padding-top: 2rem; /* top spacing */
    padding-bottom: 2rem; /* bottom spacing */
    will-change: transform, opacity;
    backface-visibility: hidden;
    transform: translateZ(0);
    perspective: 1000px; /* needed for rotationX rendering */
}

/* Enhanced text styling for better readability and smooth animations */
.video-scrolltext-content p,
.video-scrolltext-content h1,
.video-scrolltext-content h2,
.video-scrolltext-content h3,
.video-scrolltext-content h4,
.video-scrolltext-content h5,
.video-scrolltext-content h6 {
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
    margin-bottom: 1rem;
    will-change: transform, opacity;
    backface-visibility: hidden;
    transform: translateZ(0);
    transform-origin: 50% 100%; /* Match JS transform origin */
}

/* Respect user motion preferences */
@media (prefers-reduced-motion: reduce) {
    .video-scrolltext-content {
        transform: none !important;
        opacity: 1 !important;
        will-change: auto;
        perspective: none;
    }

    .video-scrolltext-content p,
    .video-scrolltext-content h1,
    .video-scrolltext-content h2,
    .video-scrolltext-content h3,
    .video-scrolltext-content h4,
    .video-scrolltext-content h5,
    .video-scrolltext-content h6 {
        transform: none !important;
        opacity: 1 !important;
        will-change: auto;
    }
}

.video-content {
    color: var(--bs-black);
    font-family: var(--font-primary);
    font-size: 14px;
    font-style: normal;
    font-weight: 400;
    line-height: 20px;
}

.video-overlay {
    opacity: 0.8;
    background: linear-gradient(
        180deg,
        rgba(7, 8, 13, 0.00) 0%,
        rgba(7, 8, 13, 0.56) 27.38%,
        rgba(7, 8, 13, 0.64) 100%
    );
    z-index: 1;
    pointer-events: none;
}

.videoscroll-wrapper video {
    width: 100%;
    object-fit: cover;
}

.video-scroll-bg {
    height: 220px;
}
