/* Video Overlay Styles */
.video-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 99999;
    display: none;
    pointer-events: none;
    mix-blend-mode: multiply;
    /* Apply blending to the entire overlay for transparency */
}

.video-overlay.active {
    display: block;
    pointer-events: auto;
}

/* Wrapper for Fixed Size Centered Video */
/* User requested consistent size across devices */
.video-center-wrapper {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 640px;
    /* Fixed width */
    height: 360px;
    /* Fixed height (16:9) */
    max-width: 100%;
    /* Prevent overflow on very small screens */
    /* Ensure videos are contained */
    overflow: visible;
}

/* Full video for initial seamless state */
.video-full {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    overflow: hidden;
    z-index: 2;
}

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

/* --- Shared Layer Styles (Clip-path approach) --- */
.video-half,
.video-half-vertical,
.video-quarter {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    overflow: hidden;
    z-index: 1;
    transition: transform 1.5s cubic-bezier(0.25, 1, 0.5, 1), opacity 1.5s ease-in-out;
}

.video-half video,
.video-half-vertical video,
.video-quarter video {
    width: 100%;
    height: 100%;
    object-fit: cover;
    position: absolute;
    top: 0;
    left: 0;
}

/* --- Horizontal Split (GALLERY & MAP) --- */
.video-half.left {
    clip-path: inset(0 50% 0 0);
}

.video-half.right {
    clip-path: inset(0 0 0 50%);
}

/* --- Vertical Split (About & CORP) --- */
.video-half-vertical.top {
    clip-path: inset(0 0 50% 0);
}

.video-half-vertical.bottom {
    clip-path: inset(50% 0 0 0);
}

/* --- 4-Way Split (Home) --- */
.video-quarter.top-left {
    clip-path: inset(0 50% 50% 0);
}

.video-quarter.top-right {
    clip-path: inset(0 0 50% 50%);
}

.video-quarter.bottom-left {
    clip-path: inset(50% 50% 0 0);
}

.video-quarter.bottom-right {
    clip-path: inset(50% 0 0 50%);
}


/* --- Animations --- */

.video-overlay.split .video-full {
    display: none;
}

/* Home: 4-way Split (Outwards) */
.home-anim.split .top-left {
    transform: translate(-50%, -50%);
    opacity: 0;
}

.home-anim.split .top-right {
    transform: translate(50%, -50%);
    opacity: 0;
}

.home-anim.split .bottom-left {
    transform: translate(-50%, 50%);
    opacity: 0;
}

.home-anim.split .bottom-right {
    transform: translate(50%, 50%);
    opacity: 0;
}

/* About: Vertical Split (Outwards) - Wide Spread */
.about-anim.split .top {
    transform: translateY(-100%);
    opacity: 0;
}

.about-anim.split .bottom {
    transform: translateY(100%);
    opacity: 0;
}

/* GALLERY: Horizontal Split (Outwards) - Wide Spread */
.gallery-anim.split .left {
    transform: translateX(-100%);
    opacity: 0;
}

.gallery-anim.split .right {
    transform: translateX(100%);
    opacity: 0;
}

/* CORP.: Vertical Split (Reverse/Cross) - Wide Spread */
.corp-anim.split .top {
    transform: translateY(100%);
    opacity: 0;
}

.corp-anim.split .bottom {
    transform: translateY(-100%);
    opacity: 0;
}

/* MAP: Horizontal Split (Reverse/Cross) - Wide Spread */
.map-anim.split .left {
    transform: translateX(100%);
    opacity: 0;
}

.map-anim.split .right {
    transform: translateX(-100%);
    opacity: 0;
}

/* --- Content Animations --- */
.section-anim-base {
    /* Use a punchy cubic-bezier for a "bold" effect */
    transition: opacity 0.8s ease-out, transform 0.8s cubic-bezier(0.165, 0.84, 0.44, 1);
    opacity: 0;
}

/* Zoom Out Effect: Start larger (1.2) and snap to normal (1.0) */
.anim-zoom-out {
    transform: scale(1.2);
}

.section-visible {
    opacity: 1;
    transform: scale(1);
    /* Reset to normal size */
}

/* Improve transparency for Home and About videos by pushing near-whites to pure white */
#video-overlay-home video,
#video-overlay-about video {
    filter: brightness(1.08) contrast(1.08);
}