:root {
    /* Tech Patterns - Inline SVGs */
    --tech-pattern-chip: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%2306b6d4' fill-opacity='0.05'%3E%3Cpath d='M36 34v-4h-2v4h-4v2h4v4h2v-4h4v-2h-4zm0-30V0h-2v4h-4v2h4v4h2V6h4V4h-4zM6 34v-4H4v4H0v2h4v4h2v-4h4v-2H6zM6 4V0H4v4H0v2h4v4h2V6h4V4H6z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
    
    --tech-pattern-circuit: url("data:image/svg+xml,%3Csvg width='100' height='100' viewBox='0 0 100 100' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M10 10h10v10h-10z M50 50h10v10h-10z M80 20h10v10h-10z M20 80h10v10h-10z' fill='%238b5cf6' fill-opacity='0.05'/%3E%3Cpath d='M20 15h30v1h-30z M60 55h20v1h-20z M15 20v60h1v-60z M85 30v50h1v-50z' fill='%2306b6d4' fill-opacity='0.05'/%3E%3Ccircle cx='15' cy='15' r='2' fill='%2306b6d4' fill-opacity='0.1'/%3E%3Ccircle cx='55' cy='55' r='2' fill='%238b5cf6' fill-opacity='0.1'/%3E%3C/svg%3E");
    
    --tech-pattern-grid: url("data:image/svg+xml,%3Csvg width='40' height='40' viewBox='0 0 40 40' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M0 0h40v40H0V0zm1 1h38v38H1V1z' fill='%23f43f5e' fill-opacity='0.03'/%3E%3C/svg%3E");

    /* Current Theme (Default: Chip) */
    --current-tech-pattern: var(--tech-pattern-chip);
}

/* Background Effects */
.bg-tech-pattern {
    position: relative;
}

.bg-tech-pattern::before {
    content: '';
    position: absolute;
    top: 0; left: 0; width: 100%; height: 100%;
    background-image: var(--current-tech-pattern);
    background-size: auto;
    opacity: 1;
    z-index: 0;
    pointer-events: none;
    mask-image: radial-gradient(circle at center, black 40%, transparent 90%);
    -webkit-mask-image: radial-gradient(circle at center, black 40%, transparent 90%);
}

/* Theme Classes */
.theme-chip { --current-tech-pattern: var(--tech-pattern-chip); }
.theme-circuit { --current-tech-pattern: var(--tech-pattern-circuit); }
.theme-grid { --current-tech-pattern: var(--tech-pattern-grid); }

/* Hover Effects with Mask */
.btn-tech-hover {
    position: relative;
    overflow: hidden;
}

.btn-tech-hover::after {
    content: '';
    position: absolute;
    top: 0; left: 0; width: 100%; height: 100%;
    background-image: var(--tech-pattern-circuit);
    opacity: 0;
    transition: opacity 0.3s ease;
    mix-blend-mode: overlay;
    pointer-events: none;
}

.btn-tech-hover:hover::after {
    opacity: 0.3;
}

/* Section Specific Overrides */
.section-hero::before {
    mask-image: linear-gradient(to bottom, black 0%, transparent 100%);
    -webkit-mask-image: linear-gradient(to bottom, black 0%, transparent 100%);
}

.section-footer::before {
    mask-image: linear-gradient(to top, black 0%, transparent 100%);
    -webkit-mask-image: linear-gradient(to top, black 0%, transparent 100%);
    opacity: 0.5;
}

/* Reduced Motion */
@media (prefers-reduced-motion: reduce) {
    .bg-tech-pattern::before, .btn-tech-hover::after {
        animation: none !important;
        transition: none !important;
    }
}

/* Animation for Patterns (Subtle Drift) */
@keyframes patternDrift {
    0% { background-position: 0 0; }
    100% { background-position: 100px 100px; }
}

.bg-tech-animated::before {
    animation: patternDrift 60s linear infinite;
}
