/* Locomotive Scroll Fixes */

/* Base styles for smooth scrolling */
html.has-scroll-smooth {
    overflow: visible !important;
    position: relative !important;
}

/* Override for loader - prevent scrolling during load */
html.loader-active.has-scroll-smooth,
body.loader-active.has-scroll-smooth {
    overflow: hidden !important;
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    right: 0 !important;
    bottom: 0 !important;
    width: 100% !important;
    height: 100% !important;
}

html.has-scroll-dragging {
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    user-select: none;
}

html.has-scroll-smooth body {
    overflow: visible !important;
    position: relative !important;
}

/* Override for loader - prevent scrolling during load */
html.loader-active.has-scroll-smooth body,
body.loader-active.has-scroll-smooth {
    overflow: hidden !important;
    position: fixed !important;
}

.has-scroll-smooth [data-scroll-container] {
    min-height: 100vh;
    position: relative !important;
    z-index: var(--z-project-links);
    opacity: 1 !important;
    visibility: visible !important;
    transform: none !important;
}

/* Main content container */
.main-content {
    position: relative;
    width: 100%;
    min-height: 100vh;
    overflow: visible;
    transform: none !important;
    will-change: transform;
    opacity: 1 !important;
    visibility: visible !important;
}

/* Scroll container */
[data-scroll-container] {
    perspective: 1px;
    transform-style: preserve-3d;
    overflow: hidden;
}

/* Live2D Widget - Exclude from Locomotive Scroll transforms */
/* CRITICAL: Prevent Locomotive Scroll from applying transforms to sticky widget */
#live2d-widget,
#live2d-widget[data-scroll],
#live2d-widget[data-scroll-speed] {
    position: sticky !important;
    transform: translateZ(0) !important;
    will-change: auto !important;
}

/* Scrollbar styling */
.c-scrollbar {
    position: fixed;
    right: 0;
    top: 0;
    width: 11px;
    height: 100vh;
    transform-origin: center right;
    transition: transform 0.3s, opacity 0.3s;
    opacity: 0;
    z-index: 9999;
    display: none !important;
}

.c-scrollbar:hover {
    transform: scaleX(1.45);
    opacity: 1;
}

.c-scrollbar_thumb {
    position: absolute;
    top: 0;
    right: 0;
    background-color: rgba(0, 0, 0, 0.5);
    width: 7px;
    border-radius: 10px;
    margin: 2px;
    cursor: -webkit-grab;
    cursor: grab;
    transition: background-color 0.3s;
}

.c-scrollbar_thumb:hover {
    background-color: rgba(0, 0, 0, 0.7);
}

/* Dragging state */
.has-scroll-dragging .c-scrollbar_thumb {
    cursor: -webkit-grabbing;
    cursor: grabbing;
}

/* Mobile optimizations */
@media (max-width: 768px) {
    .main-content {
        overflow: hidden;
    }
    
    .c-scrollbar {
        display: none;
    }
    
    [data-scroll-container] {
        perspective: none;
    }
    
    .hero {
        height: 80vh;
    }
    
    body:not(.page-404) .hero img {
        transform: none !important;
    }
}

/* Tablet optimizations */
@media (min-width: 769px) and (max-width: 1024px) {
    .main-content {
        overflow: hidden;
    }
    
    .c-scrollbar {
        width: 8px;
    }
    
    .c-scrollbar_thumb {
        width: 6px;
    }
    
    .hero {
        height: 90vh;
    }
}

/* Desktop optimizations */
@media (min-width: 1025px) {
    .main-content {
        overflow: hidden;
    }
    
    .c-scrollbar {
        opacity: 0.5;
    }
    
    .c-scrollbar:hover {
        opacity: 1;
    }
    
    .hero {
        height: 100vh;
    }
}

/* Fix for iOS Safari */
@supports (-webkit-touch-callout: none) {
    .scroll-content,
    [data-scroll-container],
    main {
        min-height: -webkit-fill-available;
        opacity: 1 !important;
        visibility: visible !important;
    }
}

/* Hero Section Parallax */
.hero {
    position: relative;
    width: 100%;
    height: 100vh;
    overflow: visible !important;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 1 !important;
    visibility: visible !important;
}

.hero-content {
    position: relative;
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 2;
    opacity: 1 !important;
    visibility: visible !important;
}

.hero-images {
    position: absolute;
    width: 100%;
    height: 100%;
    top: 0;
    left: 0;
    z-index: 1;
    opacity: 1 !important;
    visibility: visible !important;
}

.hero-images img {
    position: absolute;
    width: 100%;
    height: 100%;
    object-fit: cover;
    opacity: 0;
    transition: opacity 0.5s ease;
    will-change: opacity;
}

.hero-images img[data-scroll] {
    position: absolute;
    width: 100%;
    height: 100%;
    object-fit: cover;
    opacity: 1;
    visibility: visible;
    will-change: transform;
    z-index: 1;
    pointer-events: none;
}

/* Navigation Sticky */
nav[data-scroll-sticky] {
    position: fixed;
    height: 123px;
    top: 0;
    left: 0;
    width: 100%;
    z-index: 1000;
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(10px);
}

nav[data-scroll-sticky].page-404,
body.page-404 {
    background: rgba(0, 0, 0, 0.9);
    backdrop-filter: blur(10px);
}
nav[data-scroll-sticky].page-404 a.hoverLinks {
    color: #FF66CC;
}
#main.page-404, .lain404bump {
    background: rgba(0, 0, 0, 0.9);
}
#main.page-404 .hero {
    background: rgba(0, 0, 0, 0.9);
}
#main.page-404 .about.fourohfourcontent {
    background: rgba(0, 0, 0, 0.9);
}
#main.page-404 .about.fourohfourcontent h2 {
    color: #FF66CC;
}
#main.page-404 .about.fourohfourcontent p {
    color: #ffffff;
}
footer.page-404 {
    background: rgba(0, 0, 0, 0.9);
}
#footerContainer.page-404 {
    background-color: #000000;
}
footer.page-404 .footer-title {
    color: #ffffff;
}
footer.page-404 .footer-text {
    color: #ffffff;
}
/* Scrollbar Styling */
.has-scroll-smooth::-webkit-scrollbar {
    width: 8px;
}

.has-scroll-smooth::-webkit-scrollbar-track {
    background: transparent;
}

.has-scroll-smooth::-webkit-scrollbar-thumb {
    background: rgba(0, 0, 0, 0.2);
    border-radius: 4px;
}

.has-scroll-smooth::-webkit-scrollbar-thumb:hover {
    background: rgba(0, 0, 0, 0.3);
}

/* Scroll sections */
[data-scroll-section] {
    position: relative;
    opacity: 1 !important;
    visibility: visible !important;
    will-change: transform;
}

/* Individual scroll elements */
[data-scroll] {
    opacity: 1 !important;
    visibility: visible !important;
    will-change: transform;
}

/* Ensure scroll content is visible */
.scroll-content {
    position: relative;
    width: 100%;
    min-height: 100vh;
    opacity: 1 !important;
    visibility: visible !important;
    will-change: transform;
} 