/* The moving background of the homepage and the FAQ, in its own file so both
   load the same one. */
/* --- The background ---
   A mesh of three radial lights over grain (after mshr.app/mesh/1732201859857),
   in the logo's colours: red and orange moving into amber and yellow over a
   deep wine ground. Each light's colour, place and spread
   are registered custom properties, so the keyframes can move them and the
   browser interpolates the gradients themselves. */
@property --s-start-0 { syntax: '<percentage>'; inherits: false; initial-value: 9%; }
@property --s-end-0 { syntax: '<percentage>'; inherits: false; initial-value: 58.89%; }
@property --c-0 { syntax: '<color>'; inherits: false; initial-value: hsla(6, 74%, 40%, 1); }
@property --y-0 { syntax: '<percentage>'; inherits: false; initial-value: 16%; }
@property --x-0 { syntax: '<percentage>'; inherits: false; initial-value: 13%; }
@property --c-1 { syntax: '<color>'; inherits: false; initial-value: hsla(350, 75%, 32%, 0.91); }
@property --x-1 { syntax: '<percentage>'; inherits: false; initial-value: 14%; }
@property --s-start-1 { syntax: '<percentage>'; inherits: false; initial-value: 9%; }
@property --s-end-1 { syntax: '<percentage>'; inherits: false; initial-value: 58.89%; }
@property --y-1 { syntax: '<percentage>'; inherits: false; initial-value: 89%; }
@property --y-2 { syntax: '<percentage>'; inherits: false; initial-value: 23%; }
@property --c-2 { syntax: '<color>'; inherits: false; initial-value: hsla(345, 50%, 4%, 1); }
@property --x-2 { syntax: '<percentage>'; inherits: false; initial-value: 23%; }
@property --s-start-2 { syntax: '<percentage>'; inherits: false; initial-value: 2%; }
@property --s-end-2 { syntax: '<percentage>'; inherits: false; initial-value: 60%; }

@keyframes mesh-bg {
    0% {
        --s-start-0: 9%; --s-end-0: 58.89%; --c-0: hsla(6, 74%, 40%, 1); --x-0: 13%; --y-0: 16%;
        --s-start-1: 9%; --s-end-1: 58.89%; --c-1: hsla(350, 75%, 32%, 0.91); --x-1: 14%; --y-1: 89%;
        --s-start-2: 2%; --s-end-2: 60%; --c-2: hsla(345, 50%, 4%, 1); --x-2: 23%; --y-2: 23%;
    }
    100% {
        --s-start-0: 4%; --s-end-0: 60%; --c-0: hsla(18, 80%, 38%, 1); --x-0: 95%; --y-0: 18%;
        --s-start-1: 4.6%; --s-end-1: 60%; --c-1: hsla(34, 84%, 43%, 1); --x-1: 97%; --y-1: 47%;
        --s-start-2: 4%; --s-end-2: 73%; --c-2: hsla(44, 88%, 45%, 1); --x-2: 92%; --y-2: 91%;
    }
}

.mesh-bg {
    position: fixed;
    inset: 0;
    z-index: -3;
    pointer-events: none;
    background-color: hsla(348, 48%, 9%, 1);
    background-image:
        url("data:image/svg+xml,%3Csvg viewBox='0 0 1288 1288' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noiseFilter'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.65' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noiseFilter)'/%3E%3C/svg%3E"),
        radial-gradient(circle at var(--x-0) var(--y-0), var(--c-0) var(--s-start-0), transparent var(--s-end-0)),
        radial-gradient(circle at var(--x-1) var(--y-1), var(--c-1) var(--s-start-1), transparent var(--s-end-1)),
        radial-gradient(circle at var(--x-2) var(--y-2), var(--c-2) var(--s-start-2), transparent var(--s-end-2));
    background-blend-mode: overlay, overlay, normal, normal;
    animation: mesh-bg 2s linear infinite alternate;
    will-change: transform, opacity;
    contain: paint;
}

@media (prefers-reduced-motion: reduce) {
    .mesh-bg { animation: none; }
}
