/**
 * TalimZ — Interactive & Animated AI/Tech Background Styles
 * Deep Space, Neural Network, Microcircuits, Science & IT glyphs
 * Supports Dark & Light mode, high contrast, full viewport coverage.
 */

:root {
    --bg-tech-base: #060a14;
    --bg-tech-base-gradient: radial-gradient(circle at 50% 20%, #0d1e44 0%, #080d1a 60%, #04070e 100%);
    --bg-nebula-blue: rgba(22, 104, 232, 0.35);
    --bg-nebula-cyan: rgba(6, 182, 212, 0.28);
    --bg-nebula-purple: rgba(139, 92, 246, 0.30);
    --bg-circuit-stroke: rgba(56, 189, 248, 0.22);
    --bg-circuit-glow: rgba(56, 189, 248, 0.45);
    --bg-overlay-tint: radial-gradient(circle at 50% 30%, rgba(6, 10, 20, 0.15) 0%, rgba(4, 7, 14, 0.75) 80%, #020408 100%);
    --bg-symbol-color: #38bdf8;
    --bg-symbol-opacity: 0.25;
}

/* Light theme overrides for high contrast and readability */
[data-theme="light"] {
    --bg-tech-base: #f0f4f9;
    --bg-tech-base-gradient: radial-gradient(circle at 50% 20%, #e2edfb 0%, #edf3fc 60%, #e6effa 100%);
    --bg-nebula-blue: rgba(37, 99, 235, 0.18);
    --bg-nebula-cyan: rgba(14, 165, 233, 0.15);
    --bg-nebula-purple: rgba(147, 51, 234, 0.14);
    --bg-circuit-stroke: rgba(37, 99, 235, 0.18);
    --bg-circuit-glow: rgba(37, 99, 235, 0.35);
    --bg-overlay-tint: radial-gradient(circle at 50% 30%, rgba(240, 244, 249, 0.05) 0%, rgba(230, 239, 250, 0.6) 80%, #dbeafe 100%);
    --bg-symbol-color: #1d4ed8;
    --bg-symbol-opacity: 0.20;
}

/* Container spanning whole screen behind all elements */
.talimz-bg-container {
    position: fixed;
    inset: 0;
    width: 100vw;
    height: 100vh;
    pointer-events: none;
    z-index: 0;
    overflow: hidden;
    background-color: var(--bg-tech-base);
    background-image: var(--bg-tech-base-gradient);
    transition: background-color 0.4s ease;
}

/* Ambient Nebula Glowing Orbs (Layer 1) */
.talimz-bg-nebula {
    position: absolute;
    border-radius: 50%;
    filter: blur(100px);
    pointer-events: none;
    will-change: transform;
    transition: transform 0.25s cubic-bezier(0.1, 0.8, 0.2, 1);
}

.talimz-bg-nebula.nebula-1 {
    width: 580px;
    height: 580px;
    background: radial-gradient(circle, var(--bg-nebula-blue) 0%, transparent 70%);
    top: -120px;
    left: -80px;
}

.talimz-bg-nebula.nebula-2 {
    width: 620px;
    height: 620px;
    background: radial-gradient(circle, var(--bg-nebula-cyan) 0%, transparent 70%);
    top: 30%;
    right: -160px;
}

.talimz-bg-nebula.nebula-3 {
    width: 520px;
    height: 520px;
    background: radial-gradient(circle, var(--bg-nebula-purple) 0%, transparent 70%);
    bottom: -120px;
    left: 25%;
}

/* Microcircuit & PCB Traces Layer (Layer 2) */
.talimz-bg-circuits {
    position: absolute;
    inset: -60px;
    width: calc(100% + 120px);
    height: calc(100% + 120px);
    pointer-events: none;
    opacity: 0.65;
    will-change: transform;
    transition: transform 0.2s cubic-bezier(0.1, 0.8, 0.2, 1);
}

.talimz-bg-circuits path,
.talimz-bg-circuits line {
    stroke: var(--bg-circuit-stroke);
    stroke-width: 1.25;
    fill: none;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.talimz-bg-circuits circle {
    fill: var(--bg-circuit-stroke);
}

/* Interactive Canvas for Neural Mesh, Particles, and Data Pulses (Layer 3) */
#talimz-bg-canvas {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    display: block;
}

/* Floating IT & Science Glyphs Layer (Layer 4) */
.talimz-bg-symbols {
    position: absolute;
    inset: -60px;
    pointer-events: none;
    will-change: transform;
    z-index: 2;
}

.talimz-bg-glyph {
    position: absolute;
    font-family: 'JetBrains Mono', 'Plus Jakarta Sans', monospace;
    font-weight: 700;
    user-select: none;
    pointer-events: none;
    color: var(--bg-symbol-color);
    opacity: var(--bg-symbol-opacity);
    text-shadow: 0 0 16px var(--bg-circuit-glow);
    transition: transform 0.25s cubic-bezier(0.1, 0.8, 0.2, 1), opacity 0.3s ease;
    will-change: transform;
}

.talimz-bg-glyph.atom {
    font-size: 1.8rem;
    animation: talimz-spin 24s linear infinite;
}

.talimz-bg-glyph.code {
    font-size: 0.82rem;
    letter-spacing: 0.08em;
}

.talimz-bg-glyph.math {
    font-size: 1.05rem;
    font-style: italic;
}

.talimz-bg-glyph.ai-tag {
    font-size: 0.72rem;
    padding: 3px 8px;
    border-radius: 6px;
    border: 1px solid var(--bg-circuit-stroke);
    background: rgba(14, 165, 233, 0.08);
}

/* Subtle Vignette Overlay to ensure razor-sharp foreground contrast */
.talimz-bg-overlay {
    position: absolute;
    inset: 0;
    pointer-events: none;
    background: var(--bg-overlay-tint);
    z-index: 3;
}



@keyframes talimz-spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

@media (prefers-reduced-motion: reduce) {
    .talimz-bg-nebula,
    .talimz-bg-circuits,
    .talimz-bg-glyph {
        transition: none !important;
        animation: none !important;
        transform: none !important;
    }
}
