/* ───────────────────────────────────────────────
   Ambient Effects — Time-based atmosphere
   Firm D (Spatial Studios) v3.7
   ─────────────────────────────────────────────── */

/* Ambient glow overlay (changes based on time of day) */
.ambient-overlay {
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 1;
    opacity: 0.15;
    mix-blend-mode: screen;
    transition: background 4s ease;
}

/* Morning (5am-10am): Warm golden glow */
body[data-time-period="morning"] .ambient-overlay {
    background: radial-gradient(
        ellipse at 30% 20%,
        rgba(251, 191, 36, 0.2) 0%,
        rgba(251, 146, 60, 0.12) 25%,
        transparent 60%
    );
}

/* Day (10am-5pm): Bright cyan-blue */
body[data-time-period="day"] .ambient-overlay {
    background: radial-gradient(
        ellipse at 50% 30%,
        rgba(76, 170, 255, 0.18) 0%,
        rgba(6, 182, 212, 0.1) 30%,
        transparent 65%
    );
}

/* Evening (5pm-9pm): Purple-pink sunset */
body[data-time-period="evening"] .ambient-overlay {
    background: radial-gradient(
        ellipse at 70% 40%,
        rgba(167, 139, 250, 0.16) 0%,
        rgba(236, 72, 153, 0.1) 30%,
        transparent 60%
    );
}

/* Night (9pm-5am): Deep indigo */
body[data-time-period="night"] .ambient-overlay {
    background: radial-gradient(
        ellipse at 50% 60%,
        rgba(99, 102, 241, 0.12) 0%,
        rgba(67, 56, 202, 0.08) 35%,
        transparent 70%
    );
}

/* Depth fog — creates atmospheric depth */
.depth-fog {
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 0;
    background: radial-gradient(
        ellipse at center,
        transparent 0%,
        rgba(0, 0, 0, 0.05) 50%,
        rgba(0, 0, 0, 0.18) 100%
    );
}

/* Subtle vignette for depth of field */
.vignette {
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 2;
    background: radial-gradient(
        ellipse at center,
        transparent 40%,
        rgba(0, 0, 0, 0.25) 100%
    );
    opacity: 0.6;
}

/* Light leak effect (random colored gradients) */
.light-leak {
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 1;
    opacity: 0.08;
    mix-blend-mode: overlay;
    animation: lightLeakShift 20s ease-in-out infinite alternate;
}

@keyframes lightLeakShift {
    0% {
        background: linear-gradient(
            135deg,
            rgba(76, 170, 255, 0.15) 0%,
            transparent 40%,
            transparent 60%,
            rgba(139, 92, 246, 0.12) 100%
        );
    }
    50% {
        background: linear-gradient(
            225deg,
            rgba(52, 211, 153, 0.12) 0%,
            transparent 45%,
            transparent 55%,
            rgba(6, 182, 212, 0.15) 100%
        );
    }
    100% {
        background: linear-gradient(
            315deg,
            rgba(251, 191, 36, 0.1) 0%,
            transparent 50%,
            rgba(236, 72, 153, 0.12) 100%
        );
    }
}

/* Floating particles glow enhancement */
.particle-glow {
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 1;
    background: radial-gradient(
        circle at var(--particle-x, 50%) var(--particle-y, 50%),
        rgba(76, 170, 255, 0.04) 0%,
        transparent 30%
    );
    opacity: 0;
    transition: opacity 0.6s ease;
}

body:hover .particle-glow {
    opacity: 1;
}

/* Chromatic aberration on glass panels (subtle) */
.glass-panel::before {
    content: '';
    position: absolute;
    inset: -2px;
    background: inherit;
    filter: blur(1px);
    opacity: 0.3;
    z-index: -1;
    border-radius: inherit;
    transform: translateX(1px);
}

/* Depth-based focus blur */
.spatial-grid .glass-panel[data-depth="1"] {
    filter: blur(0px);
}
.spatial-grid .glass-panel[data-depth="2"] {
    filter: blur(0.15px);
}
.spatial-grid .glass-panel[data-depth="3"] {
    filter: blur(0.3px);
}

/* Floating windows get sharper with higher depth (foreground focus) */
.floating-window[data-depth="7"],
.floating-window[data-depth="8"],
.floating-window[data-depth="9"] {
    filter: blur(0px) brightness(1.05);
}
