/* ==========================================================================
   ASI CONSTRUCT - Visual Overlays (Grid, Noise, Scanlines)
   Brutalist Editorial Style
   ========================================================================== */

/* Grid Overlay - 40px cells, 1px stroke at 5% opacity */
.grid-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    pointer-events: none;
    z-index: var(--z-overlay);
    background-image:
        linear-gradient(to right, var(--color-grid-line) 1px, transparent 1px),
        linear-gradient(to bottom, var(--color-grid-line) 1px, transparent 1px);
    background-size: 40px 40px;
    transition: background-image 0.2s ease;
}

/* Dark theme grid (explicit for clarity) */
[data-theme="dark"] .grid-overlay {
    background-image:
        linear-gradient(to right, rgba(255, 255, 255, 0.05) 1px, transparent 1px),
        linear-gradient(to bottom, rgba(255, 255, 255, 0.05) 1px, transparent 1px);
}

/* Light theme grid */
[data-theme="light"] .grid-overlay {
    background-image:
        linear-gradient(to right, rgba(0, 0, 0, 0.05) 1px, transparent 1px),
        linear-gradient(to bottom, rgba(0, 0, 0, 0.05) 1px, transparent 1px);
}

/* Noise Overlay - Film Grain Texture at 5% */
.noise-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    pointer-events: none;
    z-index: var(--z-overlay);
    opacity: var(--color-overlay-noise);
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noiseFilter'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noiseFilter)'/%3E%3C/svg%3E");
    transition: opacity 0.2s ease;
}

/* Acid Scanline - Vertical sweep animation */
.scanline-acid {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    pointer-events: none;
    z-index: var(--z-overlay);
    background: linear-gradient(
        to bottom,
        transparent 0%,
        rgba(0, 71, 171, 0.03) 50%,
        transparent 100%
    );
    animation: scanline-sweep 8s linear infinite;
}

@keyframes scanline-sweep {
    0% {
        transform: translateY(-100%);
    }
    100% {
        transform: translateY(100%);
    }
}

/* Horizontal Scanlines - CRT Effect */
.scanline-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    pointer-events: none;
    z-index: var(--z-overlay);
    background: repeating-linear-gradient(
        0deg,
        transparent,
        transparent 2px,
        rgba(0, 0, 0, 0.03) 2px,
        rgba(0, 0, 0, 0.03) 4px
    );
}

/* Concentric Circles Background - For CTA Section */
.circles-bg {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 150%;
    height: 150%;
    pointer-events: none;
    opacity: 0.15;
    background-image: repeating-radial-gradient(
        circle at center,
        transparent 0px,
        transparent 60px,
        rgba(255, 255, 255, 0.3) 60px,
        rgba(255, 255, 255, 0.3) 61px
    );
}

[data-theme="light"] .circles-bg {
    background-image: repeating-radial-gradient(
        circle at center,
        transparent 0px,
        transparent 60px,
        rgba(0, 0, 0, 0.15) 60px,
        rgba(0, 0, 0, 0.15) 61px
    );
}

/* Acid Accent Circles */
.circles-bg-acid {
    background-image: repeating-radial-gradient(
        circle at center,
        transparent 0px,
        transparent 80px,
        rgba(0, 71, 171, 0.2) 80px,
        rgba(0, 71, 171, 0.2) 81px
    );
}

/* Diagonal Lines Background */
.diagonal-lines-bg {
    background-image: repeating-linear-gradient(
        45deg,
        transparent,
        transparent 20px,
        rgba(255, 255, 255, 0.02) 20px,
        rgba(255, 255, 255, 0.02) 21px
    );
}

[data-theme="light"] .diagonal-lines-bg {
    background-image: repeating-linear-gradient(
        45deg,
        transparent,
        transparent 20px,
        rgba(0, 0, 0, 0.02) 20px,
        rgba(0, 0, 0, 0.02) 21px
    );
}

/* Dotted Grid Background */
.dots-bg {
    background-image: radial-gradient(
        circle,
        rgba(255, 255, 255, 0.1) 1px,
        transparent 1px
    );
    background-size: 24px 24px;
}

[data-theme="light"] .dots-bg {
    background-image: radial-gradient(
        circle,
        rgba(0, 0, 0, 0.1) 1px,
        transparent 1px
    );
}

/* Section-level overlays (relative to parent) */
.section-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    pointer-events: none;
    overflow: hidden;
}

/* Hide heavy overlays on mobile for performance */
@media (max-width: 768px) {
    .scanline-acid {
        display: none;
    }

    .grid-overlay {
        opacity: 0.5;
    }
}
