: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);
    
    /* Neon Colors */
    --neon-cyan: #06b6d4;
    --neon-purple: #8b5cf6;
    --neon-pink: #f43f5e;
}

/* 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, .tech-float, .glitch-text::before, .glitch-text::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;
}

/* Glitch Text Effect */
.glitch-text {
    position: relative;
}

.glitch-text::before,
.glitch-text::after {
    content: attr(data-text);
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: #0b0f19; /* Match background color */
}

.glitch-text::before {
    left: 2px;
    text-shadow: -1px 0 var(--neon-pink);
    clip: rect(24px, 550px, 90px, 0);
    animation: glitch-anim-2 3s infinite linear alternate-reverse;
}

.glitch-text::after {
    left: -2px;
    text-shadow: -1px 0 var(--neon-cyan);
    clip: rect(85px, 550px, 140px, 0);
    animation: glitch-anim 2.5s infinite linear alternate-reverse;
}

@keyframes glitch-anim {
    0% { clip: rect(27px, 9999px, 86px, 0); }
    20% { clip: rect(53px, 9999px, 15px, 0); }
    40% { clip: rect(20px, 9999px, 60px, 0); }
    60% { clip: rect(78px, 9999px, 32px, 0); }
    80% { clip: rect(10px, 9999px, 95px, 0); }
    100% { clip: rect(44px, 9999px, 67px, 0); }
}

@keyframes glitch-anim-2 {
    0% { clip: rect(85px, 9999px, 20px, 0); }
    20% { clip: rect(12px, 9999px, 78px, 0); }
    40% { clip: rect(65px, 9999px, 30px, 0); }
    60% { clip: rect(34px, 9999px, 90px, 0); }
    80% { clip: rect(98px, 9999px, 10px, 0); }
    100% { clip: rect(50px, 9999px, 45px, 0); }
}

/* Floating Animation */
.tech-float {
    animation: float 6s ease-in-out infinite;
}

@keyframes float {
    0% { transform: translateY(0px); }
    50% { transform: translateY(-20px); }
    100% { transform: translateY(0px); }
}

/* Neon Glow Utilities */
.tech-border-neon {
    box-shadow: 0 0 5px var(--neon-cyan), 0 0 10px var(--neon-cyan);
    border: 1px solid var(--neon-cyan);
}

.tech-text-glow {
    text-shadow: 0 0 5px var(--neon-purple), 0 0 10px var(--neon-purple);
}

/* Glassmorphism Card */
.tech-card-holo {
    background: rgba(255, 255, 255, 0.05);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.37);
    transition: all 0.3s ease;
}

.tech-card-holo:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: var(--neon-cyan);
    box-shadow: 0 0 15px rgba(6, 182, 212, 0.3);
    transform: translateY(-5px);
}

/* Cyberpunk Button */
.btn-cyber {
    position: relative;
    padding: 10px 25px;
    background: transparent;
    color: var(--neon-cyan);
    border: 1px solid var(--neon-cyan);
    text-transform: uppercase;
    letter-spacing: 2px;
    overflow: hidden;
    transition: 0.3s;
    clip-path: polygon(10% 0, 100% 0, 100% 70%, 90% 100%, 0 100%, 0 30%);
}

.btn-cyber:hover {
    background: var(--neon-cyan);
    color: #000;
    box-shadow: 0 0 20px var(--neon-cyan);
}

.btn-cyber::before {
    content: '';
    position: absolute;
    top: 0; left: -100%;
    width: 100%; height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.4), transparent);
    transition: 0.5s;
}

.btn-cyber:hover::before {
    left: 100%;
}

/* Scanline Effect */
.tech-scanline {
    position: relative;
    overflow: hidden;
}

.tech-scanline::after {
    content: " ";
    display: block;
    position: absolute;
    top: 0;
    left: 0;
    bottom: 0;
    right: 0;
    background: linear-gradient(rgba(18, 16, 16, 0) 50%, rgba(0, 0, 0, 0.25) 50%), linear-gradient(90deg, rgba(255, 0, 0, 0.06), rgba(0, 255, 0, 0.02), rgba(0, 0, 255, 0.06));
    z-index: 2;
    background-size: 100% 2px, 3px 100%;
    pointer-events: none;
}
