/* Lenis Smooth Scroll Essential Styles */
html.lenis {
    height: auto;
}
.lenis.lenis-smooth {
    scroll-behavior: auto;
}
.lenis.lenis-smooth [data-lenis-prevent] {
    overscroll-behavior: contain;
}
.lenis.lenis-stopped {
    overflow: hidden;
}
.lenis.lenis-scrolling iframe {
    pointer-events: none;
}

/* Header Sync Styles (WP Maker Style) */
.header--float {
    position: fixed !important;
    top: 0;
    width: 100%;
    z-index: 9999;
}

.header--locked {
    position: absolute !important;
    width: 100%;
    z-index: 9999;
}

/* Responsive Visibility Utilities */
@media (min-width: 1025px) {
    .hide-desktop { display: none !important; }
}
@media (min-width: 768px) and (max-width: 1024px) {
    .hide-tablet { display: none !important; }
}
@media (max-width: 767px) {
    .hide-mobile { display: none !important; }
}

/* Video Optimization */
.animation-video {
    min-height: 100vh;
    object-position: top center; /* Default for desktop */
}

@media (max-width: 921px) {
    .animation-video {
        object-position: center center;
    }
}

/* Smooth Navigation Support */
html {
    scroll-behavior: smooth;
}

/* --- Pro Visual Effects Overlays --- */
.fx-vignette {
    position: absolute;
    top: 0; left: 0; width: 100%; height: 100%;
    pointer-events: none;
    background: radial-gradient(circle, rgba(0,0,0,0) 40%, rgba(0,0,0,1) 100%);
    z-index: 5;
    opacity: 0.5; /* Controlling via JS data-attr */
}

.fx-grain {
    position: absolute;
    top: -50%; left: -50%; width: 200%; height: 200%;
    pointer-events: none;
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noiseFilter'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.65' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noiseFilter)'/%3E%3C/svg%3E");
    opacity: 0.05;
    z-index: 6;
    animation: grain-dance 8s steps(10) infinite;
    display: none;
}
.fx-grain.is-active { display: block; }

@keyframes grain-dance {
    0%, 100% { transform:translate(0, 0) }
    10% { transform:translate(-5%, -10%) }
    20% { transform:translate(-15%, 5%) }
    30% { transform:translate(7%, -25%) }
    40% { transform:translate(-5%, 25%) }
    50% { transform:translate(-15%, 10%) }
    60% { transform:translate(15%, 0) }
    70% { transform:translate(0, 15%) }
    80% { transform:translate(3%, 35%) }
    90% { transform:translate(-10%, 10%) }
}

.fx-glitch {
    position: absolute;
    top: 0; left: 0; width: 100%; height: 100%;
    pointer-events: none;
    z-index: 7;
    background: rgba(255,255,255,0);
}
.fx-glitch.is-triggered {
    background: rgba(255,255,255,0.05);
    backdrop-filter: hue-rotate(90deg) contrast(150%) brightness(120%);
    clip-path: polygon(0 20%, 100% 20%, 100% 25%, 0 25%, 0 60%, 100% 60%, 100% 65%, 0 65%);
}

.fx-chromatic {
    position: absolute;
    top: 0; left: 0; width: 100%; height: 100%;
    pointer-events: none;
    z-index: 4;
    mix-blend-mode: screen;
    opacity: 0;
}

.fx-bloom {
    position: absolute;
    top: 0; left: 0; width: 100%; height: 100%;
    pointer-events: none;
    z-index: 8;
    -webkit-backdrop-filter: blur(10px) brightness(1.2);
    backdrop-filter: blur(10px) brightness(1.2);
    -webkit-mask-image: radial-gradient(circle, black, transparent);
    mask-image: radial-gradient(circle, black, transparent);
    opacity: 0.2;
}

/* --- Improved Mouse Indicator --- */
.scroll-indicator {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    z-index: 100;
    transition: all 0.5s cubic-bezier(0.19, 1, 0.22, 1);
    text-shadow: 0 0 10px rgba(0,0,0,0.5);
}

.scroll-indicator .mouse {
    width: 28px;
    height: 48px;
    border: 2px solid rgba(255,255,255,0.6);
    border-radius: 20px;
    position: relative;
    backdrop-filter: blur(4px);
    background: rgba(255,255,255,0.05);
}

.scroll-indicator .mouse::before {
    content: '';
    position: absolute;
    top: 8px;
    left: 50%;
    transform: translateX(-50%);
    width: 6px;
    height: 6px;
    background: #fff;
    border-radius: 50%;
    animation: mouse-scroll 2s ease-in-out infinite;
    box-shadow: 0 0 8px #fff;
}

@keyframes mouse-scroll {
    0% { opacity: 0; top: 8px; }
    20% { opacity: 1; }
    80% { opacity: 0; top: 32px; }
    100% { opacity: 0; top: 32px; }
}

/* --- Hero Teaser --- */
.hero-teaser-video {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    z-index: 100;
    pointer-events: none;
    transition: opacity 0.5s ease-out;
}

.animation-canvas, 
.animation-video {
    z-index: 5;
}

/* --- Text Shimmer Animation --- */
.fx-shimmer h2 {
    background: linear-gradient(
        90deg, 
        rgba(255,255,255,0) 0%, 
        rgba(255,255,255,0.8) 50%, 
        rgba(255,255,255,0) 100%
    );
    background-size: 200% 100%;
    -webkit-background-clip: text;
    background-clip: text;
    animation: shimmer-swipe 3s infinite linear;
}

@keyframes shimmer-swipe {
    to { background-position: -200% 0; }
}

/* Standard Elementor & Flex Container Support */
.scrollytelling-container,
.elementor-widget-mouse_scrollytelling,
.elementor-widget-mouse_scrollytelling .elementor-widget-container,
.elementor-widget-mouse_scrollytelling .elementor-widget-container > div,
.e-con.e-con-parent > .elementor-widget-mouse_scrollytelling,
.e-con.e-con-inner > .elementor-widget-mouse_scrollytelling {
    width: 100% !important;
    max-width: none !important;
    margin: 0 !important;
    padding: 0 !important;
    overflow: visible !important; /* Critical for position:sticky */
}

/* Force Parents to allow sticky child if using JS fix isn't enough */
.elementor-section.elementor-section-height-default,
.elementor-section > .elementor-container {
    overflow: visible !important;
}

.scrollytelling-container {
    position: relative;
    background: #050505;
    display: block;
    clear: both;
}

/* Section Isolation & Calibration */
.mouse-scrollytelling-wrapper {
    display: flow-root;
    position: relative;
    width: 100%;
    background: #000;
}


/* Gradient & Styling Support */
.has-gradient h2 {
    display: table;
    margin-left: auto;
    margin-right: auto;
    background-size: 100%;
}

.sticky-container {
    position: -webkit-sticky;
    position: sticky;
    top: var(--theme-header-height, 0);
    width: 100%;
    height: 100vh;
    height: 100dvh;
    display: -webkit-box;
    display: -ms-flexbox;
    display: flex;
    -webkit-box-pack: center;
    -ms-flex-pack: center;
    justify-content: center;
    -webkit-box-align: center;
    -ms-flex-align: center;
    align-items: center;
    overflow: hidden;
    margin: 0;
    padding: 0;
    z-index: 5;
    overflow: visible !important;
    -webkit-perspective: 1000px;
    perspective: 1000px;
    -webkit-transform: translate3d(0, 0, 0);
    transform: translate3d(0, 0, 0); /* Force GPU */
}

.animation-canvas,
.animation-video,
.hero-teaser-video {
    display: block;
    width: 100vw !important;
    height: 100vh !important;
    height: 100dvh !important;
    object-fit: cover;
    -o-object-fit: cover;
    object-position: center center;
    -o-object-position: center center;
    will-change: transform, opacity;
    background: #000;
}

.hero-teaser-video {
    position: absolute;
    top: 50%;
    left: 50%;
    -webkit-transform: translate(-50%, -50%);
    -ms-transform: translate(-50%, -50%);
    transform: translate(-50%, -50%);
    z-index: 15;
    pointer-events: none;
}

.animation-video::-webkit-media-controls {
    display: none !important;
}

.content-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 10;
    will-change: transform, opacity;
}

.step-text {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 90%;
    max-width: 800px;
    opacity: 0;
    pointer-events: none;
    text-align: center;
    z-index: 20;
}

.step-text h2 {
    margin: 0 0 1rem 0;
    line-height: 1.1;
    /* Fluid typography: min 2.5rem, scale with viewport, max 5rem */
    font-size: clamp(2.5rem, 8vw, 5rem); 
    font-weight: 800;
    letter-spacing: -2px;
}

.step-text p {
    line-height: 1.5;
    /* Fluid typography: min 1rem, max 1.5rem */
    font-size: clamp(1rem, 2.5vw, 1.5rem);
    margin: 0;
}

/* Scroll Indicator */
.scroll-indicator {
    position: absolute;
    bottom: 2rem;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    opacity: 0.8;
    z-index: 30; /* Ensure it stays above content-overlay */
    color: #fff;
    text-decoration: none; /* For links */
    cursor: pointer;
}

.scroll-indicator:hover {
    opacity: 1;
}

.custom-indicator-icon {
    font-size: 24px;
    line-height: 1;
    margin-bottom: 5px;
}

.custom-indicator-icon i,
.custom-indicator-icon svg {
    width: 24px;
    height: 24px;
    fill: currentColor;
}

.scroll-text {
    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: 2px;
}

@keyframes scroll_anim {
    0% { opacity: 1; transform: translateX(-50%) translateY(0); }
    100% { opacity: 0; transform: translateX(-50%) translateY(10px); }
}

/* Modern Scroll Indicator Design */
.mouse {
    width: 20px;
    height: 35px;
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 20px;
    background: rgba(255, 255, 255, 0.05);
    backdrop-filter: blur(5px);
    position: relative;
}

.mouse::after {
    content: '';
    width: 2px;
    height: 5px;
    background: #fff;
    border-radius: 2px;
    position: absolute;
    top: 6px;
    left: 50%;
    transform: translateX(-50%);
    animation: scroll_anim 2s infinite;
}

/* Intro & Outro Sections */
.intro-section,
.outro-section {
    position: relative;
    width: 100%;
    height: 100vh;
    height: 100dvh;
    background: #000;
    display: flex;
    justify-content: center;
    align-items: center;
    text-align: center;
    z-index: 5;
    transform: translate3d(0, 0, 0);
}

/* Only force full-width if NOT boxed */
.mouse-scrollytelling-wrapper:not(.is-boxed) .intro-section,
.mouse-scrollytelling-wrapper:not(.is-boxed) .outro-section {
    width: 100vw;
    left: 50%;
    right: 50%;
    margin-left: -50vw;
    margin-right: -50vw;
}

.intro-content,
.outro-content {
    max-width: 900px;
    padding: 0 20px;
}

.intro-title {
    font-size: 5rem;
    font-weight: 800;
    letter-spacing: -2px;
    margin-bottom: 1rem;
    line-height: 1;
}

.intro-subtitle {
    color: rgba(255, 255, 255, 0.5);
    font-size: 1.2rem;
}

.outro-title {
    font-size: clamp(2.5rem, 8vw, 4.5rem);
    font-weight: 800;
    margin-bottom: 2rem;
}

.outro-button {
    display: inline-block;
    padding: 1.2rem 3.5rem;
    font-size: 1.1rem;
    font-weight: 700;
    background: #fff;
    color: #000;
    text-decoration: none;
    border-radius: 50px;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.outro-button:hover {
    transform: scale(1.05);
    box-shadow: 0 10px 30px rgba(255, 255, 255, 0.2);
}

/* Fix for Elementor Editor Sticky behavior */
.elementor-editor-active .sticky-container {
    position: relative;
    height: 100vh;
}

/* Footer Styling Safety */
.site-footer, #colophon, .elementor-location-footer {
    position: relative;
    z-index: 10;
    background: #000;
}

/* Ensure no overlap with Admin Bar */
.admin-bar .sticky-container {
    top: calc(var(--theme-header-height, 0) + 32px);
    height: calc(100vh - var(--theme-header-height, 0) - 32px);
    height: calc(100dvh - var(--theme-header-height, 0) - 32px);
}
@media screen and (max-width: 782px) {
    .admin-bar .sticky-container {
        top: calc(var(--theme-header-height, 0) + 46px);
        height: calc(100vh - var(--theme-header-height, 0) - 46px);
        height: calc(100dvh - var(--theme-header-height, 0) - 46px);
    }
}
/* Video Visual Effects (Pro) */
.fx-overlay, .fx-vignette, .fx-grain {
    position: absolute;
    inset: 0;
    pointer-events: none;
    z-index: 150;
}

.fx-vignette {
    background: radial-gradient(circle, transparent 30%, rgba(0,0,0,0.8) 100%);
}

.fx-grain {
    opacity: 0.05;
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noiseFilter'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.65' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noiseFilter)'/%3E%3C/svg%3E");
    animation: grain_move 1s steps(5) infinite;
}

@keyframes grain_move {
    0%, 100% { transform: translate(0, 0); }
    10% { transform: translate(-1%, -1%); }
    20% { transform: translate(1%, 1%); }
    30% { transform: translate(-2%, 2%); }
    40% { transform: translate(2%, -2%); }
}

.fx-scanlines {
    background: linear-gradient(rgba(0,0,0,0) 50%, rgba(0,0,0,0.1) 50%);
    background-size: 100% 4px;
}

.fx-noise {
    opacity: 0.08;
    background-image: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADIAAAAyBAMAAADsEZWCAAAAGFBMVEUAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAs697FAAAACHRSTlMA9p7v5u/m75U6X9YAAAAJcEhZcwAADsMAAA7DAcdvqGQAAAA0SURBVDjLY2AYBaNgFIyCUUAGAQMDQwgDizCIsAiECAshCzEIBYtFIsQYhIDFIhFiDEIsGAVAAMQYBsG9N0oMAAAAAElFTkSuQmCC");
}

/* Filter Effects (Applied to Main Elements) */
.apply-fx-hue { animation: fx_hue_rotate 8s linear infinite !important; }
@keyframes fx_hue_rotate { from { filter: hue-rotate(0deg); } to { filter: hue-rotate(360deg); } }

.apply-fx-sepia { filter: sepia(0.8) contrast(1.1) brightness(0.9) !important; }
.apply-fx-invert { filter: invert(0.9) hue-rotate(180deg) !important; }
.apply-fx-bloom { filter: saturate(1.5) brightness(1.2) blur(0px); box-shadow: 0 0 40px rgba(255,255,255,0.2); }

.fx-glitch-active { animation: fx_glitch_anim 0.2s infinite; }
@keyframes fx_glitch_anim {
    0% { transform: translate(0); }
    20% { transform: translate(-2px, 2px); filter: hue-rotate(90deg); }
    40% { transform: translate(-2px, -2px); }
    60% { transform: translate(2px, 2px); filter: hue-rotate(-90deg); }
    80% { transform: translate(2px, -2px); }
    100% { transform: translate(0); }

/* --- Boxed / Container Mode Support --- */
.mouse-scrollytelling-wrapper.is-boxed {
    max-width: 100%;
    width: 100%;
    left: 0 !important;
    right: 0 !important;
    margin-left: 0 !important;
    margin-right: 0 !important;
    overflow: hidden;
    position: relative;
}

.mouse-scrollytelling-wrapper.is-boxed .sticky-container {
    width: 100% !important;
    left: 0 !important;
    right: 0 !important;
    margin: 0 !important;
    position: sticky;
}

.mouse-scrollytelling-wrapper.is-boxed .intro-section,
.mouse-scrollytelling-wrapper.is-boxed .outro-section {
    width: 100% !important;
    left: 0 !important;
    right: 0 !important;
    margin: 0 !important;
}

.mouse-scrollytelling-wrapper.is-boxed #scrollytelling-section {
    width: 100% !important;
    left: 0 !important;
    margin: 0 !important;
}

/* --- Hotspots --- */
.ms-hotspots-container {
    position: absolute;
    top: 0; left: 0;
    width: 100%; height: 100%;
    pointer-events: none;
    z-index: 20;
}

.ms-hotspot {
    position: absolute;
    pointer-events: all;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.4s ease, visibility 0.4s ease, transform 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    transform: scale(0.5);
}

.ms-hotspot.is-visible {
    opacity: 1;
    visibility: visible;
    transform: scale(1);
}

.ms-hotspot-dot {
    width: 20px;
    height: 20px;
    background: #fff;
    border-radius: 50%;
    cursor: pointer;
    box-shadow: 0 0 15px rgba(255,255,255,0.8);
    position: relative;
}

.ms-hotspot-dot::after {
    content: '';
    position: absolute;
    top: -10px; left: -10px; right: -10px; bottom: -10px;
    border: 2px solid #fff;
    border-radius: 50%;
    animation: hs-pulse 2s infinite;
}

@keyframes hs-pulse {
    0% { transform: scale(0.5); opacity: 1; }
    100% { transform: scale(1.5); opacity: 0; }
}

.ms-hotspot-content {
    position: absolute;
    bottom: calc(100% + 15px);
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0,0,0,0.8);
    backdrop-filter: blur(10px);
    padding: 10px 20px;
    border-radius: 8px;
    color: #fff;
    white-space: nowrap;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.ms-hotspot:hover .ms-hotspot-content {
    opacity: 1;
    visibility: visible;
    bottom: calc(100% + 20px);
}

/* --- PRO FEATURES CSS --- */

/* 1. Custom Cursor */
.ms-custom-cursor {
    position: fixed;
    top: 0; left: 0;
    width: 80px; height: 80px;
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(4px);
    border: 1px solid rgba(255, 255, 255, 0.5);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    pointer-events: none;
    z-index: 99999;
    transform: translate(-50%, -50%) scale(0.1);
    opacity: 0;
    visibility: hidden;
}

.ms-cursor-text {
    color: #fff;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 1px;
    text-transform: uppercase;
}

/* 2. Minimap (Timeline Dots) */
.ms-minimap {
    position: absolute;
    right: 20px;
    top: 50%;
    transform: translateY(-50%);
    display: flex;
    flex-direction: column;
    gap: 12px;
    z-index: 50;
}

.ms-minimap-dot {
    width: 8px;
    height: 8px;
    background: rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    cursor: pointer;
    transition: all 0.3s ease;
}

.ms-minimap-dot:hover,
.ms-minimap-dot.is-active {
    background: #fff;
    transform: scale(1.5);
    box-shadow: 0 0 10px rgba(255, 255, 255, 0.8);
}

/* 3. Mask Reveal */
.has-mask-reveal {
    -webkit-mask-image: var(--mask-img);
    mask-image: var(--mask-img);
    -webkit-mask-position: center;
    mask-position: center;
    -webkit-mask-repeat: no-repeat;
    mask-repeat: no-repeat;
    -webkit-mask-size: var(--mask-size, 50%);
    mask-size: var(--mask-size, 50%);
}

/* 4. Ambilight Canvas */
.ms-ambilight-canvas {
    position: absolute;
    inset: -10%;
    width: 120%;
    height: 120%;
    filter: blur(80px) saturate(200%);
    opacity: 0.7;
    z-index: 1;
    pointer-events: none;
    will-change: filter;
}

/* 5. Audio Mute Button */
/* --- Ultra Performance: Mobile Disabled State --- */
.msa-mobile-disabled .sticky-container {
    position: relative !important;
    height: auto !important;
    min-height: auto !important;
    overflow: visible !important;
}

.msa-mobile-disabled .animation-canvas,
.msa-mobile-disabled .animation-video,
.msa-mobile-disabled .hero-teaser-video,
.msa-mobile-disabled .fx-vignette,
.msa-mobile-disabled .fx-grain,
.msa-mobile-disabled .ms-minimap,
.msa-mobile-disabled .scroll-indicator {
    display: none !important;
}

.msa-mobile-disabled .step-text {
    position: relative !important;
    top: auto !important;
    left: auto !important;
    transform: none !important;
    opacity: 1 !important;
    margin: 40px 20px !important;
    padding: 0 !important;
    max-width: 100% !important;
}

.msa-mobile-disabled .scrollytelling-container {
    height: auto !important;
    min-height: auto !important;
}

.ms-mute-btn {
    position: absolute;
    bottom: 30px;
    right: 30px;
    width: 48px;
    height: 48px;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(8px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    cursor: pointer;
    z-index: 999;
    transition: all 0.3s ease;
}

.ms-mute-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    transform: scale(1.1);
}

.ms-mute-btn.is-muted {
    color: #ff4757;
}
