:root {
    --bg: #050505;
    --accent: #ff3333;
    --secondary: #333;
    --text-muted: #888;
}

/* Abstract Background (Wrapper) */
.abstract-bg {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
    pointer-events: none;
}

/* Sticky Inner Background */
.bg-sticky {
    position: sticky;
    top: 0;
    width: 100%;
    height: 100vh;
    overflow: hidden;
}

.bg-sticky video {
    width: 100%;
    height: 100%;
    object-fit: cover;
    position: absolute;
    top: 0;
    left: 0;
    z-index: -1;
}

/* Overlay to darken the background image for text readability */
.bg-sticky::after {
    content: '';
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.7);
    z-index: 0;
}

.gradient-orb {
    position: absolute;
    border-radius: 50%;
    filter: blur(100px);
    opacity: 0.2;
    animation: floatOrb 20s ease-in-out infinite;
}

.orb-1 {
    width: 50vw;
    height: 50vw;
    background: radial-gradient(circle, var(--accent), transparent);
    top: -20%;
    right: -20%;
}

.orb-2 {
    width: 40vw;
    height: 40vw;
    background: radial-gradient(circle, #500000, transparent);
    bottom: -10%;
    left: -10%;
    animation-delay: -5s;
}

@keyframes floatOrb {

    0%,
    100% {
        transform: translate(0, 0) scale(1);
    }

    50% {
        transform: translate(30px, -30px) scale(1.1);
    }
}

/* Main Layout */
.services-layout {
    display: flex;
    min-height: 100vh;
    position: relative;
    z-index: 1;
}

/* Left Side - 3D Canvas */
.canvas-side {
    width: 50%;
    height: 100vh;
    position: sticky;
    top: 0;
    left: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    perspective: 1000px;
}

#three-canvas {
    width: 100%;
    height: 100%;
    outline: none;
}

/* Right Side - Scrollable Content */
.content-side {
    width: 50%;
    /* Margin left no longer needed with sticky/flex layout if flex is used correctly, 
       but if canvas is sticky/relative, flex handles it. 
       If canvas is sticky, it takes space. 
    */
    /* margin-left: 50%; removed because flexbox handles placement */
    position: relative;
    z-index: 2;
}

/* Service Block */
.service-block {
    min-height: 100vh;
    display: flex;
    align-items: center;
    padding: 100px 80px;
    position: relative;
}

.service-content {
    max-width: 600px;
    position: relative;
}

.service-number {
    font-size: 0.9rem;
    color: var(--accent);
    font-weight: 700;
    letter-spacing: 3px;
    margin-bottom: 20px;
    text-transform: uppercase;
    opacity: 0;
    transform: translateX(-30px);
    transition: all 0.8s cubic-bezier(0.4, 0, 0.2, 1);
}

.service-title {
    font-size: 3.5rem;
    font-weight: 800;
    line-height: 1.1;
    margin-bottom: 30px;
    background: linear-gradient(135deg, #fff 0%, #aaa 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    opacity: 0;
    transform: translateY(30px);
    transition: all 0.8s cubic-bezier(0.4, 0, 0.2, 1) 0.1s;
}

.service-description {
    font-size: 1.1rem;
    color: var(--text-muted);
    line-height: 1.8;
    margin-bottom: 40px;
    opacity: 0;
    transform: translateY(20px);
    transition: all 0.8s cubic-bezier(0.4, 0, 0.2, 1) 0.2s;
}

.service-features {
    list-style: none;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

.feature-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 20px;
    background: rgba(255, 255, 255, 0.03);
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.05);
    opacity: 0;
    transform: translateY(20px);
    transition: all 0.5s ease;
    position: relative;
    overflow: hidden;
}

.feature-item::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 3px;
    height: 100%;
    background: var(--accent);
    transform: scaleY(0);
    transform-origin: bottom;
    transition: transform 0.3s ease;
}

.feature-item:hover::before {
    transform: scaleY(1);
}

.feature-item:hover {
    background: rgba(255, 255, 255, 0.06);
    transform: translateY(-5px) !important;
    box-shadow: 0 10px 30px -10px rgba(0, 0, 0, 0.5);
}

.feature-icon {
    font-size: 1.5rem;
    filter: grayscale(1);
    transition: filter 0.3s;
}

.feature-item:hover .feature-icon {
    filter: grayscale(0);
}

.feature-text {
    font-size: 0.95rem;
    color: #ddd;
    font-weight: 500;
}

/* Staggered Animations */
.service-block.active .service-number,
.service-block.active .service-title,
.service-block.active .service-description {
    opacity: 1;
    transform: translate(0, 0);
}

.service-block.active .feature-item {
    opacity: 1;
    transform: translateY(0);
}

.service-block.active .feature-item:nth-child(1) {
    transition-delay: 0.3s;
}

.service-block.active .feature-item:nth-child(2) {
    transition-delay: 0.4s;
}

.service-block.active .feature-item:nth-child(3) {
    transition-delay: 0.5s;
}

.service-block.active .feature-item:nth-child(4) {
    transition-delay: 0.6s;
}

/* Scroll Progress */
.scroll-progress {
    position: sticky;
    right: 30px;
    top: 50vh;
    transform: translateY(-50%);
    z-index: 100;
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.progress-line {
    width: 2px;
    height: 40px;
    background: rgba(255, 255, 255, 0.1);
    position: relative;
    border-radius: 2px;
    transition: all 0.3s;
}

.progress-line.active {
    background: var(--accent);
    height: 60px;
    box-shadow: 0 0 15px var(--accent);
}

/* Responsive */
@media (max-width: 1024px) {
    .services-layout {
        flex-direction: column;
    }

    .canvas-side {
        width: 100%;
        height: 45vh;
        position: relative;
        top: 0;
    }

    .content-side {
        width: 100%;
        margin-left: 0;
    }

    .service-block {
        padding: 60px 30px;
        min-height: auto;
        border-left: none;
        border-top: 1px solid rgba(255, 255, 255, 0.1);
    }

    .service-title {
        font-size: 2.5rem;
    }

    .service-features {
        grid-template-columns: 1fr;
    }

    .scroll-progress {
        display: none;
    }
}