/* Original homages to pre-OS X Macintosh screensavers: one-bit geometry,
   platinum chrome, restrained System 7 color, and slow After Dark motion. */
html[data-bg-dynamic="rm-toasters"] #bg-dynamic [data-mh="rm-toasters"],
html[data-bg-dynamic="rm-starflight"] #bg-dynamic [data-mh="rm-starflight"],
html[data-bg-dynamic="rm-aquarium"] #bg-dynamic [data-mh="rm-aquarium"],
html[data-bg-dynamic="rm-pipes"] #bg-dynamic [data-mh="rm-pipes"],
html[data-bg-dynamic="rm-clocks"] #bg-dynamic [data-mh="rm-clocks"],
html[data-bg-dynamic="rm-maze"] #bg-dynamic [data-mh="rm-maze"],
html[data-bg-dynamic="rm-confetti"] #bg-dynamic [data-mh="rm-confetti"],
html[data-bg-dynamic="rm-marquee"] #bg-dynamic [data-mh="rm-marquee"],
html[data-bg-dynamic="rm-fireflies"] #bg-dynamic [data-mh="rm-fireflies"],
html[data-bg-dynamic="rm-rain"] #bg-dynamic [data-mh="rm-rain"],
html[data-bg-dynamic="rm-pixels"] #bg-dynamic [data-mh="rm-pixels"],
html[data-bg-dynamic="rm-moire"] #bg-dynamic [data-mh="rm-moire"]{display:block;}

.rm-scene{overflow:hidden;background:#101014;color:#f4f4ef;container-type:size;}
.rm-scene *{position:absolute;box-sizing:border-box;}
.rm-scene::before,.rm-scene::after,.rm-scene *::before,.rm-scene *::after{position:absolute;box-sizing:border-box;}

/* Toast Patrol */
.rm-toasters{background:radial-gradient(ellipse at 50% 35%,#292932,#09090c 72%);}
.rm-toasters>i{
  left:-18cqw;top:var(--y);width:11cqw;height:7cqw;border:clamp(1px,.35cqw,4px) solid #111;
  border-radius:1.2cqw;background:linear-gradient(145deg,#fafaf6 0 24%,#aaa 26% 42%,#eee 45% 72%,#777);
  box-shadow:inset -.7cqw -.7cqw #555,inset .5cqw .5cqw #fff,0 1cqw 2cqw #0008;
  animation:rm-fly 15s linear var(--d) infinite;
}
.rm-toasters>i::before{
  content:"";left:-8cqw;top:-2.4cqw;width:9cqw;height:6cqw;background:#f8f8f3;
  clip-path:polygon(100% 48%,8% 0,0 16%,68% 52%,4% 80%,16% 100%);
  filter:drop-shadow(.4cqw .5cqw #222);transform-origin:100% 50%;
  animation:rm-flap .48s steps(2) var(--d) infinite;
}
.rm-toasters>i::after{
  content:"";right:1.2cqw;top:-2.4cqw;width:3.7cqw;height:4.5cqw;border:.45cqw solid #6a3d22;
  border-radius:1.8cqw 1.8cqw .5cqw .5cqw;background:#d9a25f;box-shadow:inset 0 0 0 .5cqw #f3cf91;
}
@keyframes rm-fly{from{transform:scale(var(--s))}to{transform:translate3d(130cqw,-18cqh,0) scale(var(--s));}}
@keyframes rm-flap{50%{transform:scaleY(.28) rotate(-8deg);}}

/* Starflight */
.rm-starflight{background:radial-gradient(circle at 50% 50%,#17171d,#000 46%);}
.rm-stars{inset:0;}
.rm-stars i{
  left:50%;top:50%;width:42cqw;height:max(1px,.25cqh);transform-origin:0 50%;
  background:linear-gradient(90deg,#fff,transparent);opacity:0;
  animation:rm-warp 2s linear var(--d) infinite;
}
@keyframes rm-warp{
  0%{transform:rotate(var(--a)) translateX(1cqw) scaleX(.02);opacity:0}
  20%{opacity:.9}100%{transform:rotate(var(--a)) translateX(8cqw) scaleX(1.25);opacity:0}
}

/* Night Aquarium */
.rm-aquarium{background:linear-gradient(#0b2e3a,#071922 62%,#09120f);}
.rm-water{inset:0;background:repeating-linear-gradient(174deg,transparent 0 9cqh,#8ed5d00d 10cqh 11cqh);animation:rm-water 8s ease-in-out infinite;}
.rm-fish{
  left:-16cqw;top:var(--y);width:10cqw;height:5cqw;border:clamp(1px,.25cqw,3px) solid #d7e5df;
  border-radius:55% 48% 48% 55%;background:linear-gradient(110deg,#93a9a5,#d7d8c7 50%,#66777c);
  filter:drop-shadow(0 .7cqw .7cqw #0008);animation:rm-swim 17s linear var(--d) infinite;
}
.rm-fish::before{content:"";right:-4.2cqw;top:.25cqw;border:2.3cqw solid transparent;border-right:0;border-left:4.5cqw solid #8fa3a1;}
.rm-fish::after{content:"";left:2cqw;top:1.1cqw;width:.7cqw;height:.7cqw;border-radius:50%;background:#071014;box-shadow:4.5cqw 1cqw 0 -.15cqw #f4f0c8;}
.rm-fish.rev{animation-name:rm-swim-rev;}
.rm-bubbles{inset:0}.rm-bubbles i{bottom:-3cqh;width:1.2cqw;height:1.2cqw;border:1px solid #b9efefaa;border-radius:50%;animation:rm-bubble 8s linear infinite;}
.rm-bubbles i:nth-child(1){left:12%;animation-delay:-1s}.rm-bubbles i:nth-child(2){left:27%;animation-delay:-5s;scale:.6}.rm-bubbles i:nth-child(3){left:44%;animation-delay:-3s;scale:1.4}
.rm-bubbles i:nth-child(4){left:61%;animation-delay:-7s;scale:.8}.rm-bubbles i:nth-child(5){left:78%;animation-delay:-2s}.rm-bubbles i:nth-child(6){left:91%;animation-delay:-6s;scale:.5}
@keyframes rm-swim{from{transform:scale(var(--s))}to{transform:translateX(132cqw) scale(var(--s));}}@keyframes rm-swim-rev{from{transform:translateX(132cqw) scaleX(-1) scale(var(--s));}to{transform:translateX(-5cqw) scaleX(-1) scale(var(--s));}}
@keyframes rm-bubble{to{transform:translate(4cqw,-108cqh);opacity:0}}@keyframes rm-water{50%{transform:translateY(2cqh)}}

/* Platinum Pipes */
.rm-pipes{background:radial-gradient(circle at 45% 42%,#323842,#0c0d10 76%);}
.rm-pipes>i{
  left:var(--x);top:var(--y);width:var(--w);height:var(--h);border-left:clamp(5px,1.4cqw,16px) ridge #b9c7ca;
  border-bottom:clamp(5px,1.4cqw,16px) ridge #819da1;border-radius:0 0 0 3cqw;
  box-shadow:-.6cqw .5cqw 1.2cqw #0009;animation:rm-pipe 10s ease-in-out var(--d) infinite;
}
.rm-pipes>i:nth-child(even){filter:hue-rotate(48deg)}.rm-pipes>i:nth-child(3n){transform:scaleX(-1)}
@keyframes rm-pipe{0%,12%{clip-path:inset(0 100% 100% 0)}48%,82%{clip-path:inset(0)}100%{clip-path:inset(100% 0 0 100%)}}

/* Clock Drift */
.rm-clocks{background:linear-gradient(145deg,#08090b,#24242a);}
.rm-clocks>i{
  left:-16cqw;top:var(--y);width:10cqw;height:10cqw;border:.65cqw solid #e6e6df;border-radius:50%;
  background:radial-gradient(circle,#ddd 0 5%,transparent 6%),repeating-conic-gradient(#777 0 1deg,transparent 1deg 30deg),#f5f5ef;
  box-shadow:inset 0 0 0 .35cqw #333,0 1cqw 2cqw #0008;animation:rm-clock-fly 19s linear var(--d) infinite;
}
.rm-clocks>i::before,.rm-clocks>i::after{content:"";left:50%;top:50%;width:.35cqw;background:#111;transform-origin:50% 0;}
.rm-clocks>i::before{height:3.2cqw;transform:rotate(205deg)}.rm-clocks>i::after{height:4cqw;transform:rotate(302deg)}
@keyframes rm-clock-fly{from{transform:scale(var(--s))}to{transform:translateX(132cqw) rotate(1turn) scale(var(--s));}}

/* Infinite Maze */
.rm-maze{background:#deded9;}
.rm-maze-grid{inset:-8%;background-color:#deded9;background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 64 64'%3E%3Cpath d='M0 8h24v16h16V8h24M8 0v16h8M32 0v16M56 0v24h-8v16h16M0 40h16v-8h16v24h16v-8h16M8 64V48h16M40 64v-8M0 24h8' fill='none' stroke='%23191919' stroke-width='4' stroke-linecap='square'/%3E%3C/svg%3E");background-size:12cqw 12cqw;animation:rm-maze-pan 18s linear infinite;}
.rm-maze>i{left:12%;top:14%;width:2.3cqw;height:2.3cqw;background:#fff;border:.45cqw solid #111;box-shadow:0 0 0 .3cqw #fff;animation:rm-maze-dot 12s steps(8) infinite;}
@keyframes rm-maze-pan{to{background-position:14cqw 7cqw,7cqw 14cqw}}@keyframes rm-maze-dot{25%{transform:translate(50cqw,0)}50%{transform:translate(50cqw,56cqh)}75%{transform:translate(16cqw,56cqh)}}

/* Desktop Confetti */
.rm-confetti{background:linear-gradient(145deg,#ededeb,#bdbdb8);}
.rm-confetti>i{top:-12cqh;left:calc((var(--n,1) * 5.1%) - 4%);width:2.5cqw;height:2.5cqw;background:#315f8b;border:1px solid #222;animation:rm-confetti 9s linear calc(var(--n,1) * -.47s) infinite;}
.rm-confetti>i:nth-child(4n+1){background:#9b3f52}.rm-confetti>i:nth-child(4n+2){background:#d0a742}.rm-confetti>i:nth-child(4n+3){background:#52816e}.rm-confetti>i:nth-child(4n){background:#6a5f8e}
.rm-confetti>i:nth-child(3n){animation-duration:11s}.rm-confetti>i:nth-child(5n){animation-duration:7.2s}.rm-confetti>i:nth-child(7n){animation-delay:-6.4s}
@keyframes rm-confetti{to{transform:translate(12cqw,120cqh) rotate(540deg)}}

/* Midnight Marquee */
.rm-marquee{background:radial-gradient(ellipse,#17191e,#020303 75%);}
.rm-message{left:50%;top:48%;transform:translate(-50%,-50%);font:700 clamp(16px,7cqw,92px)/1 "Courier New",monospace;letter-spacing:.12em;white-space:nowrap;color:#ecece6;text-shadow:.35cqw .35cqw #555;animation:rm-message 5s steps(2) infinite;}
.rm-marquee>i{left:var(--x);top:var(--y);width:15cqw;height:10cqw;border:.5cqw solid #111;background:#d9d9d4;box-shadow:.8cqw .8cqw #000;animation:rm-window 7s ease-in-out var(--d) infinite;}
.rm-marquee>i::before{content:"";inset:0 0 auto;height:2.5cqw;border-bottom:.35cqw solid #111;background:repeating-linear-gradient(#555 0 1px,#eee 1px 3px);}
@keyframes rm-window{50%{transform:translate(2cqw,-3cqh)}}@keyframes rm-message{50%{opacity:.68}}

/* Firefly Field */
.rm-fireflies{background:radial-gradient(ellipse at 50% 70%,#193027,#030706 70%);}
.rm-hills{inset:52% -10% -10%;background:#07140d;clip-path:polygon(0 45%,18% 12%,36% 48%,58% 2%,78% 38%,100% 10%,100% 100%,0 100%);}
.rm-fireflies>i{width:1cqw;height:1cqw;border-radius:50%;background:#dafa8a;box-shadow:0 0 2cqw 1cqw #a6df5c88;animation:rm-firefly 6s ease-in-out infinite;}
.rm-fireflies>i:nth-of-type(4n+1){left:12%;top:26%;animation-delay:-1s}.rm-fireflies>i:nth-of-type(4n+2){left:38%;top:62%;animation-delay:-3s}.rm-fireflies>i:nth-of-type(4n+3){left:68%;top:34%;animation-delay:-5s}.rm-fireflies>i:nth-of-type(4n){left:88%;top:70%;animation-delay:-2s}
.rm-fireflies>i:nth-of-type(n+5){translate:11cqw -9cqh;scale:.65}.rm-fireflies>i:nth-of-type(n+9){translate:-18cqw 18cqh;scale:1.2}.rm-fireflies>i:nth-of-type(n+13){translate:25cqw 6cqh;scale:.45}
@keyframes rm-firefly{0%,100%{transform:translate(0,0);opacity:.3}35%{transform:translate(5cqw,-7cqh);opacity:1}70%{transform:translate(-3cqw,4cqh);opacity:.55}}

/* Rainy Desktop */
.rm-rain{background:linear-gradient(#303943,#11171d);}
.rm-rain::after{content:"";inset:0;background:linear-gradient(90deg,transparent 49.7%,#aab5bd30 50%,transparent 50.3%),linear-gradient(transparent 49.7%,#aab5bd24 50%,transparent 50.3%);background-size:25% 50%;box-shadow:inset 0 0 8cqw #000b;}
.rm-rain-city{left:0;right:0;bottom:0;height:38%;background:linear-gradient(90deg,#090c10 7%,transparent 7% 10%,#0b0e12 10% 22%,transparent 22% 25%,#080b0f 25% 44%,transparent 44% 49%,#0b0e12 49% 65%,transparent 65% 70%,#080b0f 70% 91%,transparent 91%),repeating-linear-gradient(90deg,#dfbd6e44 0 1cqw,transparent 1cqw 3cqw);}
.rm-rain>i{top:-18cqh;left:calc(var(--x)*1%);width:.6cqw;height:12cqh;border-radius:99px;background:linear-gradient(transparent,#d9ebf0b8);animation:rm-rain 2.4s linear calc(var(--x)*-.09s) infinite;}
.rm-rain>i:nth-of-type(1){--x:4}.rm-rain>i:nth-of-type(2){--x:11}.rm-rain>i:nth-of-type(3){--x:18}.rm-rain>i:nth-of-type(4){--x:26}.rm-rain>i:nth-of-type(5){--x:34}.rm-rain>i:nth-of-type(6){--x:42}.rm-rain>i:nth-of-type(7){--x:49}.rm-rain>i:nth-of-type(8){--x:57}.rm-rain>i:nth-of-type(9){--x:64}.rm-rain>i:nth-of-type(10){--x:71}.rm-rain>i:nth-of-type(11){--x:77}.rm-rain>i:nth-of-type(12){--x:83}.rm-rain>i:nth-of-type(13){--x:89}.rm-rain>i:nth-of-type(14){--x:94}.rm-rain>i:nth-of-type(15){--x:23}.rm-rain>i:nth-of-type(16){--x:54}
@keyframes rm-rain{to{transform:translate(-5cqw,125cqh)}}

/* Pixel Companions */
.rm-pixels{background:repeating-linear-gradient(0deg,#111 0 2px,#18181b 2px 4px);}
.rm-pixels>i{left:-14cqw;top:var(--y);width:8cqw;height:9cqw;border:.65cqw solid #eee;border-radius:.8cqw;background:#bababa;box-shadow:inset 0 -2cqw #777,.7cqw .7cqw #000;animation:rm-pixel-walk 18s steps(24) var(--d) infinite;}
.rm-pixels>i::before{content:"";left:1cqw;top:1cqw;width:5cqw;height:4cqw;background:#eee;border:.45cqw solid #111;box-shadow:1cqw 1cqw 0 -.7cqw #111,3.2cqw 1cqw 0 -.7cqw #111,2cqw 2.4cqw 0 -.65cqw #111;}
.rm-pixels>i::after{content:"";left:1.5cqw;bottom:-1.5cqw;width:1.5cqw;height:1.3cqw;background:#eee;box-shadow:3.5cqw 0 #eee;}
@keyframes rm-pixel-walk{from{transform:scale(var(--s))}to{transform:translateX(128cqw) scale(var(--s));}}

/* Moiré Studio */
.rm-moire{background:#e7e7e2;filter:contrast(1.1);}
.rm-moire>i,.rm-moire>b{inset:-35%;border-radius:50%;background:repeating-radial-gradient(circle,#111 0 .25cqw,transparent .3cqw 1.15cqw);mix-blend-mode:multiply;}
.rm-moire>i{animation:rm-moire-a 14s ease-in-out infinite}.rm-moire>b{left:-15%;right:-55%;animation:rm-moire-b 17s ease-in-out infinite;}
@keyframes rm-moire-a{50%{transform:translate(16cqw,9cqh) scale(.78)}}@keyframes rm-moire-b{50%{transform:translate(-18cqw,-6cqh) scale(1.2)}}

html.bg-paused .rm-scene *,html.bg-paused .bg-presets-retromac .mh-thumb *{animation-play-state:paused!important;}
@media (prefers-reduced-motion:reduce){.rm-scene *,.bg-presets-retromac .mh-thumb *{animation:none!important;}}
