/* ============================================
   Background Beautification System
   Shared across all R1d3rZzz pages
   ============================================ */

/* Dot grid pattern — subtle depth layer */
.bg-grid {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  background-image: radial-gradient(circle, rgba(0, 255, 136, 0.04) 1px, transparent 1px);
  background-size: 32px 32px;
  opacity: 0.5;
}

/* Horizontal scan line — slow sweep across the page */
.bg-scanline {
  position: fixed;
  left: 0;
  right: 0;
  height: 1px;
  pointer-events: none;
  z-index: 2;
  background: linear-gradient(90deg, transparent 0%, rgba(0, 255, 136, 0.08) 20%, rgba(0, 255, 136, 0.15) 50%, rgba(0, 255, 136, 0.08) 80%, transparent 100%);
  box-shadow: 0 0 20px rgba(0, 255, 136, 0.06), 0 0 60px rgba(0, 255, 136, 0.03);
  animation: scanSweep 8s linear infinite;
  opacity: 0.6;
}

@keyframes scanSweep {
  0% { top: -2px; }
  100% { top: 100%; }
}

/* Ambient glow orbs — large soft blurred circles */
.bg-glow {
  position: fixed;
  border-radius: 50%;
  pointer-events: none;
  z-index: 0;
  filter: blur(100px);
  will-change: transform;
}

.bg-glow--1 {
  width: 700px;
  height: 700px;
  top: -15%;
  right: -8%;
  background: radial-gradient(circle, rgba(0, 255, 136, 0.04) 0%, rgba(0, 200, 120, 0.015) 40%, transparent 70%);
  animation: glowDrift1 25s ease-in-out infinite alternate;
}

.bg-glow--2 {
  width: 600px;
  height: 600px;
  bottom: 5%;
  left: -12%;
  background: radial-gradient(circle, rgba(0, 120, 255, 0.025) 0%, rgba(0, 255, 136, 0.01) 40%, transparent 70%);
  animation: glowDrift2 30s ease-in-out infinite alternate;
}

.bg-glow--3 {
  width: 500px;
  height: 500px;
  top: 35%;
  left: 25%;
  background: radial-gradient(circle, rgba(0, 255, 136, 0.02) 0%, transparent 60%);
  animation: glowDrift3 20s ease-in-out infinite alternate;
}

/* Extra depth glow — lower center, slow pulse */
.bg-glow--4 {
  width: 800px;
  height: 300px;
  bottom: -5%;
  left: 10%;
  background: radial-gradient(ellipse, rgba(0, 255, 136, 0.015) 0%, transparent 70%);
  animation: glowDrift4 35s ease-in-out infinite alternate;
  filter: blur(120px);
}

@keyframes glowDrift1 {
  0% { transform: translate(0, 0) scale(1); }
  33% { transform: translate(-80px, 50px) scale(1.12); }
  66% { transform: translate(40px, -40px) scale(0.92); }
  100% { transform: translate(-20px, 30px) scale(1.05); }
}

@keyframes glowDrift2 {
  0% { transform: translate(0, 0) scale(1); }
  33% { transform: translate(60px, -60px) scale(1.18); }
  66% { transform: translate(-40px, 30px) scale(0.88); }
  100% { transform: translate(20px, -20px) scale(1.1); }
}

@keyframes glowDrift3 {
  0% { transform: translate(0, 0) scale(1); }
  50% { transform: translate(-40px, -50px) scale(1.08); }
  100% { transform: translate(50px, 40px) scale(1.15); }
}

@keyframes glowDrift4 {
  0% { transform: translate(0, 0) scale(1); opacity: 0.5; }
  50% { transform: translate(60px, -20px) scale(1.1); opacity: 0.8; }
  100% { transform: translate(-30px, 10px) scale(0.95); opacity: 0.6; }
}

/* Vignette — dark edges for focus */
.bg-vignette {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 1;
  background: radial-gradient(
    ellipse 80% 70% at 50% 50%,
    transparent 0%,
    transparent 45%,
    rgba(5, 5, 10, 0.5) 100%
  );
}

/* Corner decorations — subtle geometric accents */
.bg-corner {
  position: fixed;
  pointer-events: none;
  z-index: 0;
  opacity: 0.2;
}

.bg-corner--tl {
  top: 0;
  left: 0;
  width: 300px;
  height: 300px;
  background: linear-gradient(135deg, rgba(0, 255, 136, 0.06) 0%, transparent 50%);
}

.bg-corner--br {
  bottom: 0;
  right: 0;
  width: 300px;
  height: 300px;
  background: linear-gradient(315deg, rgba(0, 255, 136, 0.04) 0%, transparent 50%);
}

/* Hero section glow — positioned under hero content */
.hero-glow {
  position: absolute;
  width: 800px;
  height: 400px;
  top: -100px;
  left: 50%;
  transform: translateX(-50%);
  background: radial-gradient(
    ellipse at center,
    rgba(0, 255, 136, 0.05) 0%,
    rgba(0, 255, 136, 0.02) 35%,
    transparent 70%
  );
  pointer-events: none;
  z-index: 0;
  animation: heroGlowPulse 6s ease-in-out infinite;
}

@keyframes heroGlowPulse {
  0%, 100% { opacity: 0.6; transform: translateX(-50%) scale(1); }
  50% { opacity: 1; transform: translateX(-50%) scale(1.05); }
}

/* Section separator glow — between major sections */
.section-glow {
  position: relative;
  height: 1px;
  margin: 0;
  border: none;
  background: transparent;
}

.section-glow::before {
  content: '';
  position: absolute;
  top: -40px;
  left: 10%;
  right: 10%;
  height: 80px;
  background: radial-gradient(
    ellipse at center,
    rgba(0, 255, 136, 0.04) 0%,
    transparent 70%
  );
  pointer-events: none;
}

/* Page background gradient — subtle scroll-linked shift */
.bg-scroll-gradient {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: -1;
  background: linear-gradient(
    180deg,
    var(--bg) 0%,
    rgba(8, 8, 18, 1) 50%,
    rgba(6, 6, 14, 1) 100%
  );
  opacity: 0;
  transition: opacity 1s;
}

.bg-scroll-gradient.active {
  opacity: 1;
}

/* Page header glow — under page titles on sub-pages */
.page-glow {
  position: absolute;
  width: 600px;
  height: 300px;
  top: -50px;
  left: 50%;
  transform: translateX(-50%);
  background: radial-gradient(
    ellipse at center,
    rgba(0, 255, 136, 0.04) 0%,
    rgba(0, 255, 136, 0.01) 40%,
    transparent 70%
  );
  pointer-events: none;
  z-index: 0;
  animation: heroGlowPulse 8s ease-in-out infinite;
}

/* Content area backlight — behind article lists */
.content-glow {
  position: absolute;
  width: 500px;
  height: 600px;
  top: 10%;
  left: 50%;
  transform: translateX(-50%);
  background: radial-gradient(
    ellipse at center,
    rgba(0, 255, 136, 0.015) 0%,
    transparent 60%
  );
  pointer-events: none;
  z-index: 0;
  filter: blur(60px);
  animation: contentGlowPulse 12s ease-in-out infinite;
}

@keyframes contentGlowPulse {
  0%, 100% { opacity: 0.4; }
  50% { opacity: 0.7; }
}

/* Responsive */
@media (max-width: 768px) {
  .bg-glow--1 { width: 500px; height: 500px; }
  .bg-glow--2 { width: 450px; height: 450px; }
  .bg-glow--3 { width: 350px; height: 350px; }
  .bg-glow--4 { width: 600px; height: 250px; }
  .bg-corner--tl,
  .bg-corner--br { width: 200px; height: 200px; }
  .hero-glow { width: 600px; height: 300px; }
  .page-glow { width: 450px; height: 240px; }
}

@media (max-width: 640px) {
  .bg-glow--1 { width: 300px; height: 300px; opacity: 0.6; }
  .bg-glow--2 { width: 250px; height: 250px; opacity: 0.6; }
  .bg-glow--3 { width: 200px; height: 200px; opacity: 0.5; }
  .bg-glow--4 { width: 350px; height: 180px; opacity: 0.5; }
  .bg-corner--tl,
  .bg-corner--br { width: 120px; height: 120px; opacity: 0.12; }
  .hero-glow { width: 320px; height: 180px; }
  .page-glow { width: 280px; height: 160px; }
  .bg-scanline { opacity: 0.25; }
  .bg-vignette { background: radial-gradient(ellipse 90% 80% at 50% 50%, transparent 0%, transparent 40%, rgba(5,5,10,0.4) 100%); }
}
