.dither-container {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
    pointer-events: none;
    overflow: hidden;
    /* Use transform3d to enable GPU acceleration but avoid will-change unless necessary */
    transform: translateZ(0);
}

.dither-container canvas {
    display: block;
    width: 100%;
    height: 100%;
    /* Optimize rendering */
    image-rendering: -webkit-optimize-contrast;
    image-rendering: crisp-edges;
}

/* Support for rounded containers */
.dither-container.rounded-2xl {
    border-radius: 1rem;
}

.dither-container.rounded-2xl canvas {
    border-radius: 1rem;
}

/* Make sure content appears above the dithered background */
.hero-content {
    position: relative;
    z-index: 1;
}

/* Reduce motion for users who prefer it */
@media (prefers-reduced-motion: reduce) {
    .dither-container {
        opacity: 0.5;
    }
    .dither-container canvas {
        animation: none !important;
    }
}
