/* atmosphere.css
   Weather around the page: ash grain, rust blooms, vignette,
   scanlines, and the cursor glow. The grain image is generated
   by js/texture.js. These layers never take clicks.
*/

.atmo {
  position: fixed;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  overflow: hidden;
}

.atmo__rust,
.atmo__grain,
.atmo__vignette,
.scanlines,
#dust {
  position: absolute;
  inset: 0;
}

.atmo__rust {
  background:
    radial-gradient(ellipse at 0% 100%, rgba(140, 48, 22, 0.55), transparent 46%),
    radial-gradient(ellipse at 100% 0%, rgba(28, 70, 48, 0.28), transparent 42%),
    radial-gradient(ellipse at 110% 80%, rgba(90, 42, 24, 0.4), transparent 40%),
    radial-gradient(ellipse at 20% 0%, rgba(88, 48, 24, 0.28), transparent 36%);
}

.atmo__grain {
  opacity: 0.45;
  background-size: 160px 160px;
  mix-blend-mode: screen;
}

.atmo__vignette {
  background: radial-gradient(ellipse at center, transparent 40%, rgba(0, 0, 0, 0.55) 100%);
}

#dust {
  width: 100%;
  height: 100%;
}

.scanlines {
  background: repeating-linear-gradient(
    to bottom,
    rgba(0, 0, 0, 0.28) 0px,
    rgba(0, 0, 0, 0.28) 1px,
    transparent 1px,
    transparent 4px
  );
  opacity: 0.18;
  mix-blend-mode: multiply;
}

.cursor-glow {
  position: absolute;
  left: 0;
  top: 0;
  width: 280px;
  height: 280px;
  margin: -140px 0 0 -140px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(232, 168, 106, 0.2), rgba(141, 255, 192, 0.05) 36%, transparent 68%);
  opacity: 0;
  will-change: transform;
  mix-blend-mode: screen;
}

body {
  background-color: var(--bg);
  background-image:
    linear-gradient(rgba(231, 165, 106, 0.045) 1px, transparent 1px),
    linear-gradient(90deg, rgba(231, 165, 106, 0.045) 1px, transparent 1px);
  background-size: 28px 28px;
  background-attachment: fixed;
}

@media (max-width: 700px) {
  .scanlines {
    opacity: 0.1;
  }

  .cursor-glow {
    width: 180px;
    height: 180px;
    margin: -90px 0 0 -90px;
  }
}
