/* =========================================================
   PARENT SECTION & ROW RESETS (Divi 4 & Divi 5)
========================================================= */
.et_pb_section:has(.ethereal-scroll-hero-wrapper),
.et_pb_section.esh-parent-section {
    padding-top: 0 !important;
    padding-bottom: 0 !important;
    margin-top: 0 !important;
    margin-bottom: 0 !important;
    overflow: visible !important;
}

.et_pb_row:has(.ethereal-scroll-hero-wrapper),
.et_pb_row.esh-parent-row {
    padding-top: 0 !important;
    padding-bottom: 0 !important;
    margin-top: 0 !important;
    margin-bottom: 0 !important;
    overflow: visible !important;
}

.et_pb_column:has(.ethereal-scroll-hero-wrapper),
.et_pb_column.esh-parent-col {
    padding-top: 0 !important;
    padding-bottom: 0 !important;
    margin-top: 0 !important;
    margin-bottom: 0 !important;
    overflow: visible !important;
}

/* Ethereal Scroll Hero Wrapper & Base */
.ethereal-scroll-hero-wrapper {
    position: relative;
    width: 100%;
    overflow: visible !important;
}

/* Ensure Divi module background (color, gradient, image) stays pinned to viewport across 400vh scroll */
.et_pb_module.et_pb_ethereal_scroll_hero {
    background-attachment: fixed !important;
    background-size: cover !important;
    background-position: center center !important;
    background-repeat: no-repeat !important;
}

/* Ensure inner scroll containers and canvas are 100% transparent so Divi background is fully visible */
.ethereal-scroll-hero-wrapper .scroll-hero,
.ethereal-scroll-hero-wrapper .hero-sticky-container,
.ethereal-scroll-hero-wrapper .hero-canvas {
    background: transparent !important;
}

.ethereal-scroll-hero-wrapper .scroll-hero {
    position: relative;
    width: 100%;
}

.ethereal-scroll-hero-wrapper .hero-sticky-container {
    position: sticky;
    top: var(--hero-top, 0px);
    height: var(--hero-height, 100dvh);
    width: 100%;
    z-index: 1;
    overflow: hidden;
}

.ethereal-scroll-hero-wrapper .hero-canvas {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%; 
    z-index: 1;
    display: block;
}

.ethereal-scroll-hero-wrapper .ui-sticky-container {
    position: sticky;
    top: var(--hero-top, 0px);
    height: var(--hero-height, 100dvh);
    width: 100%;
    z-index: 20;
    pointer-events: none; /* Allows clicking through to canvas/sections */
    margin-top: calc(var(--hero-height, 100dvh) * -1);
}

/* We need the container to be the height of all sections combined for sticky to work correctly */
.ethereal-scroll-hero-wrapper .sections-container {
    position: relative;
    z-index: 10;
    margin-top: calc(var(--hero-height, 100dvh) * -1); /* Pull sections up over the sticky container */
}

.ethereal-scroll-hero-wrapper .scroll-progress {
    position: absolute; 
    right: 24px;
    top: 50%;
    transform: translateY(-50%);
    width: 2px;
    height: 120px;
    background: rgba(255, 255, 255, 0.12);
    z-index: 20;
    border-radius: 2px;
    overflow: hidden;
}

.ethereal-scroll-hero-wrapper .scroll-progress-bar {
    width: 100%;
    height: 100%;
    background: linear-gradient(#6366f1, #ec4899, #06ffa5);
    transform-origin: top;
    transform: scaleY(0);
}

.ethereal-scroll-hero-wrapper .hero-section {
    position: relative;
    z-index: 10;
    min-height: var(--hero-height, 100dvh);
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 0 6%;
    pointer-events: none;
}

.ethereal-scroll-hero-wrapper .section-content {
    max-width: 900px;
    perspective: 800px;
}

.ethereal-scroll-hero-wrapper .section-headline {
    font-family: Arial, Helvetica, sans-serif;
    font-size: clamp(3.5rem, 11vw, 8rem);
    font-weight: 900;
    line-height: 1;
    letter-spacing: -0.02em;
    color: #fff;
    margin-bottom: 0;
}

.ethereal-scroll-hero-wrapper .section-subheadline {
    font-family: Arial, Helvetica, sans-serif;
    font-size: clamp(1.6rem, 4.5vw, 3.4rem);
    font-weight: 300;
    margin-top: 10px;
    background: linear-gradient(90deg, #6366f1, #8b5cf6 50%, #ec4899);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    margin-bottom: 0;
}

.ethereal-scroll-hero-wrapper .section-body {
    font-family: Arial, Helvetica, sans-serif;
    font-size: clamp(1rem, 1.5vw, 1.2rem);
    margin: 28px auto 0;
    max-width: 600px;
    color: rgba(255, 255, 255, 0.75);
    line-height: 1.6;
}

.ethereal-scroll-hero-wrapper .loading-overlay {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.3);
    backdrop-filter: blur(4px);
    z-index: 100;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: opacity 0.6s ease, visibility 0.6s ease;
}

.ethereal-scroll-hero-wrapper .loading-overlay.loaded {
    opacity: 0 !important;
    visibility: hidden !important;
    pointer-events: none !important;
}

.ethereal-scroll-hero-wrapper .loading-text {
    letter-spacing: 0.5em;
    text-transform: uppercase;
    font-size: 13px;
    color: #fff;
    animation: pulse 1.4s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 0.3; }
    50% { opacity: 1; }
}

@media (max-width: 640px) {
    .ethereal-scroll-hero-wrapper .scroll-progress {
        right: 10px;
    }
}

.et_pb_module.et_pb_ethereal_scroll_hero > .et_pb_section_video_bg,
.et_pb_module.et_pb_ethereal_scroll_hero > .et_pb_parallax,
.et_pb_module.et_pb_ethereal_scroll_hero > .et_pb_background_pattern,
.et_pb_module.et_pb_ethereal_scroll_hero > .et_pb_background_mask {
    position: sticky !important;
    top: var(--hero-top, 0px) !important;
    height: var(--hero-height, 100dvh) !important;
    width: 100% !important;
    margin-bottom: calc(var(--hero-height, 100dvh) * -1) !important;
    z-index: 0 !important;
    pointer-events: none !important;
    overflow: hidden !important;
}

.et_pb_module.et_pb_ethereal_scroll_hero > .et_pb_section_video_bg video {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    min-width: 100%;
    min-height: 100%;
    width: auto;
    height: auto;
    object-fit: cover;
}