body {
    background-color: #030303;
    color: #ffffff;
    overflow-x: hidden;
}

/* Fix for flickering in Hero Section */
.hero-text-line,
.cube-wrap,
.parallax-layer div {
    /* Tells browser to promote these to their own layer */
    will-change: transform, opacity;
    /* prevents sub-pixel rendering issues */
    backface-visibility: hidden;
    -webkit-font-smoothing: antialiased;
}

/* Stabilize the mix-blend-mode elements */
.mix-blend-screen {
    isolation: isolate; /* Creates a new stacking context */
}

/* HERO & CUBE FIXES */
.perspective-container {
    perspective: 1200px;
    position: relative;
    z-index: 1;
}

.cube-wrap {
    /* Smaller on mobile, normal on desktop */
    width: 140px; 
    height: 140px;
    
    /* Desktop Override */
    @media (min-width: 768px) {
        width: 200px;
        height: 200px;
    }
    
    transform-style: preserve-3d;
    position: absolute;
    top: 50%;
    left: 50%;
    /* Recalculate margins based on size */
    margin-top: -70px;  /* Half of 140 */
    margin-left: -70px;
    
    @media (min-width: 768px) {
        margin-top: -100px; /* Half of 200 */
        margin-left: -100px;
    }
    
    pointer-events: auto !important;
    cursor: pointer;
    z-index: 50;
    will-change: transform;
}

/* Cube Faces */
.cube-face {
    position: absolute;
    width: 200px;
    height: 200px;
    border: 1px solid rgba(0, 243, 255, 0.3);
    background: rgba(0, 243, 255, 0.02);
    box-shadow: 0 0 15px rgba(0, 243, 255, 0.1) inset;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: "Space Grotesk", sans-serif;
    font-size: 10px;
    color: rgba(0, 243, 255, 0.5);
    letter-spacing: 2px;
    backface-visibility: visible; /* Ensure we see it from all angles */
}

/* Positioning */
.face-front {
    transform: rotateY(0deg) translateZ(100px);
}
.face-back {
    transform: rotateY(180deg) translateZ(100px);
}
.face-right {
    transform: rotateY(90deg) translateZ(100px);
}
.face-left {
    transform: rotateY(-90deg) translateZ(100px);
}
.face-top {
    transform: rotateX(90deg) translateZ(100px);
}
.face-bottom {
    transform: rotateX(-90deg) translateZ(100px);
}

/* Custom Scrollbar */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: #030303;
}

::-webkit-scrollbar-thumb {
    background: #333;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: #00f3ff;
}

/* Utilities */
.text-glow {
    text-shadow: 0 0 10px rgba(255, 255, 255, 0.3);
}

.clip-diagonal {
    clip-path: polygon(0 0, 100% 0, 100% 85%, 0 100%);
}

.perspective-container {
    perspective: 1200px;
    /* Depth of field */
}

/* Update this specific class in your Hero Section CSS */
.cube-wrap {
    transform-style: preserve-3d;
    width: 200px;
    height: 200px;
    position: absolute;
    top: 50%;
    left: 50%;
    margin-top: -100px;
    margin-left: -100px;

    /* CHANGED: Allow interaction so we can hover it */
    pointer-events: auto;
    cursor: pointer;

    z-index: 0;
    transition: all 0.3s ease;
    /* Smooth CSS transition fallback */
}

/* Cube Faces */
.cube-face {
    position: absolute;
    width: 200px;
    height: 200px;
    border: 1px solid rgba(0, 243, 255, 0.3);
    /* Neon Cyan Border */
    background: rgba(0, 243, 255, 0.02);
    box-shadow: 0 0 15px rgba(0, 243, 255, 0.1) inset;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: "Space Grotesk", sans-serif;
    font-size: 10px;
    color: rgba(0, 243, 255, 0.5);
    letter-spacing: 2px;
    backface-visibility: visible;
}

/* Positioning Faces */
.face-front {
    transform: rotateY(0deg) translateZ(100px);
}

.face-back {
    transform: rotateY(180deg) translateZ(100px);
}

.face-right {
    transform: rotateY(90deg) translateZ(100px);
}

.face-left {
    transform: rotateY(-90deg) translateZ(100px);
}

.face-top {
    transform: rotateX(90deg) translateZ(100px);
}

.face-bottom {
    transform: rotateX(-90deg) translateZ(100px);
}

/* Moving Grid Floor */
.cyber-grid {
    background-image: linear-gradient(
            rgba(45, 90, 245, 0.2) 1px,
            transparent 1px
        ),
        linear-gradient(90deg, rgba(45, 90, 245, 0.2) 1px, transparent 1px);
    background-size: 40px 40px;
    transform: perspective(500px) rotateX(60deg) scale(2);
    transform-origin: center top;
    mask-image: linear-gradient(
        to bottom,
        transparent 0%,
        black 40%,
        transparent 90%
    );
}

.perspective-1000 {
    perspective: 1000px;
}

/* Monolith Hover State: Explode Layers */
#monolith:hover div:nth-child(1) {
    transform: translateZ(-80px) !important;
    transition: transform 0.4s ease-out;
}

#monolith:hover div:nth-child(2) {
    transform: translateZ(0px) rotateY(5deg) !important;
    transition: transform 0.4s ease-out;
}

#monolith:hover div:nth-child(3) {
    transform: translateZ(80px) !important;
    transition: transform 0.4s ease-out;
}

@keyframes scan {
    0%,
    100% {
        top: 0%;
        opacity: 0;
    }

    10% {
        opacity: 1;
    }

    90% {
        opacity: 1;
    }

    100% {
        top: 100%;
        opacity: 0;
    }
}

.transform-style-3d {
    transform-style: preserve-3d;
}

.svc_icon_box {
    transform: translateZ(0px);
    transition: transform 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}

/* Hover State: Lift Icon */
.svc_card_unique:hover .svc_icon_box {
    transform: translateZ(40px);
}

@keyframes svc_slide {
    from {
        transform: translateX(0);
    }

    to {
        transform: translateX(-50%);
    }
}

.svc_binary_track {
    width: 200%;
    animation: svc_slide 20s linear infinite;
}

.transform-style-3d {
    transform-style: preserve-3d;
}

.svc_icon_box {
    transform: translateZ(0px);
    transition: transform 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.svc_card_unique:hover .svc_icon_box {
    transform: translateZ(40px);
}

.perspective-1000 {
    perspective: 1000px;
}

.transform-style-3d {
    transform-style: preserve-3d;
}

/* OUTER CUBE FACES (Wireframe) */
.cube-outer .face {
    position: absolute;
    width: 150px;
    height: 150px;
    border: 1px solid rgba(0, 243, 255, 0.5);
    background: rgba(0, 243, 255, 0.02);
    box-shadow: 0 0 10px rgba(0, 243, 255, 0.1) inset;
}

.cube-outer .front {
    transform: rotateY(0deg) translateZ(75px);
}

.cube-outer .back {
    transform: rotateY(180deg) translateZ(75px);
}

.cube-outer .right {
    transform: rotateY(90deg) translateZ(75px);
}

.cube-outer .left {
    transform: rotateY(-90deg) translateZ(75px);
}

.cube-outer .top {
    transform: rotateX(90deg) translateZ(75px);
}

.cube-outer .bottom {
    transform: rotateX(-90deg) translateZ(75px);
}

/* INNER CUBE FACES (Solid) */
.cube-inner .face-in {
    position: absolute;
    width: 60px;
    height: 60px;
    background: rgba(189, 0, 255, 0.8);
    border: 1px solid #bd00ff;
    box-shadow: 0 0 20px #bd00ff;
}

.cube-inner .front-in {
    transform: rotateY(0deg) translateZ(30px);
}

.cube-inner .back-in {
    transform: rotateY(180deg) translateZ(30px);
}

.cube-inner .right-in {
    transform: rotateY(90deg) translateZ(30px);
}

.cube-inner .left-in {
    transform: rotateY(-90deg) translateZ(30px);
}

.cube-inner .top-in {
    transform: rotateX(90deg) translateZ(30px);
}

.cube-inner .bottom-in {
    transform: rotateX(-90deg) translateZ(30px);
}

@keyframes spin3d {
    0% {
        transform: rotateX(0deg) rotateY(0deg) rotateZ(0deg);
    }

    100% {
        transform: rotateX(360deg) rotateY(360deg) rotateZ(360deg);
    }
}

@keyframes shine {
    from {
        transform: translateX(-100%);
    }

    to {
        transform: translateX(100%);
    }
}

.svc_card_hidden {
    opacity: 0;
    transform: translateY(30px);
    visibility: hidden;
}

@keyframes svc_slide {
    from {
        transform: translateX(0);
    }

    to {
        transform: translateX(-50%);
    }
}

.svc_binary_track {
    width: 200%;
    animation: svc_slide 20s linear infinite;
}

@keyframes shine {
    from {
        left: -100%;
    }

    to {
        left: 100%;
    }
}

.perspective-container {
    perspective: 1000px;
}

.shard_card {
    clip-path: polygon(0% 0%, 100% 0%, 100% 90%, 90% 100%, 0% 100%, 0% 10%);
    box-shadow: 0 10px 30px -10px rgba(0, 0, 0, 0.5);
}
.shard_ghost {
    clip-path: polygon(0% 0%, 100% 0%, 100% 90%, 90% 100%, 0% 100%, 0% 10%);
    mix-blend-mode: screen;
}
/* Hide scrollbars just in case */
#testi_wrapper {
    -ms-overflow-style: none;
    scrollbar-width: none;
}
#testi_wrapper::-webkit-scrollbar {
    display: none;
}

#physics_canvas canvas {
    display: block;
    width: 100%;
    height: 100%;
}
