/*
 * PureCSS.com
 * https://purecss.com/rain-effect/
 * Animated rain streaks using absolutely-positioned elements and staggered @keyframes.
 */

.demo-rain-effect .rain-stage {
		width: 100%;
		position: relative;
		height: 220px;
		overflow: hidden;
		border-radius: var(--radius-lg);
		background: linear-gradient(180deg, #0a0e14 0%, #111c2e 100%);
	}

.demo-rain-effect .rain-text {
		position: absolute;
		bottom: 1.5rem;
		left: 50%;
		transform: translateX(-50%);
		text-align: center;
		color: rgba(255,255,255,.7);
		font-size: 1.1rem;
		font-weight: 600;
		z-index: 1;
		white-space: nowrap;
	}

.demo-rain-effect .drop {
		position: absolute;
		top: -20px;
		width: 1px;
		background: linear-gradient(180deg, transparent, rgba(147, 197, 253, .8));
		animation: rain-fall linear infinite;
		border-radius: 0 0 1px 1px;
	}

:is(.demo-rain-effect .drop):nth-child(1)  { left: 5%;  height: 18px; animation-duration: 1.1s; animation-delay: 0s; }

:is(.demo-rain-effect .drop):nth-child(2)  { left: 9%;  height: 14px; animation-duration: 0.9s; animation-delay: 0.3s; }

:is(.demo-rain-effect .drop):nth-child(3)  { left: 14%; height: 22px; animation-duration: 1.3s; animation-delay: 0.7s; }

:is(.demo-rain-effect .drop):nth-child(4)  { left: 19%; height: 16px; animation-duration: 1.0s; animation-delay: 0.1s; }

:is(.demo-rain-effect .drop):nth-child(5)  { left: 24%; height: 20px; animation-duration: 1.2s; animation-delay: 0.5s; }

:is(.demo-rain-effect .drop):nth-child(6)  { left: 29%; height: 14px; animation-duration: 0.8s; animation-delay: 0.9s; }

:is(.demo-rain-effect .drop):nth-child(7)  { left: 34%; height: 24px; animation-duration: 1.4s; animation-delay: 0.2s; }

:is(.demo-rain-effect .drop):nth-child(8)  { left: 38%; height: 16px; animation-duration: 1.0s; animation-delay: 0.6s; }

:is(.demo-rain-effect .drop):nth-child(9)  { left: 43%; height: 18px; animation-duration: 1.1s; animation-delay: 0.4s; }

:is(.demo-rain-effect .drop):nth-child(10) { left: 48%; height: 12px; animation-duration: 0.9s; animation-delay: 0.8s; }

:is(.demo-rain-effect .drop):nth-child(11) { left: 53%; height: 20px; animation-duration: 1.2s; animation-delay: 0.15s; }

:is(.demo-rain-effect .drop):nth-child(12) { left: 58%; height: 16px; animation-duration: 1.0s; animation-delay: 0.55s; }

:is(.demo-rain-effect .drop):nth-child(13) { left: 63%; height: 22px; animation-duration: 1.3s; animation-delay: 0.35s; }

:is(.demo-rain-effect .drop):nth-child(14) { left: 68%; height: 14px; animation-duration: 0.8s; animation-delay: 0.75s; }

:is(.demo-rain-effect .drop):nth-child(15) { left: 73%; height: 18px; animation-duration: 1.1s; animation-delay: 0.45s; }

:is(.demo-rain-effect .drop):nth-child(16) { left: 78%; height: 20px; animation-duration: 1.2s; animation-delay: 0.05s; }

:is(.demo-rain-effect .drop):nth-child(17) { left: 83%; height: 12px; animation-duration: 0.9s; animation-delay: 0.65s; }

:is(.demo-rain-effect .drop):nth-child(18) { left: 88%; height: 24px; animation-duration: 1.4s; animation-delay: 0.25s; }

:is(.demo-rain-effect .drop):nth-child(19) { left: 93%; height: 16px; animation-duration: 1.0s; animation-delay: 0.85s; }

:is(.demo-rain-effect .drop):nth-child(20) { left: 97%; height: 18px; animation-duration: 1.15s; animation-delay: 0.5s; }

@keyframes rain-fall {
	0% {
		transform: translateY(0) scaleX(1);
		opacity: 0;
	}
	5% { opacity: 1; }
	95% { opacity: .8; }
	100% {
		transform: translateY(240px) scaleX(0.5);
		opacity: 0;
	}
}

/* ── Variant: wind driven rain at an angle ── */

.demo-rain-effect .rain-wind-stage {
		position: relative;
		width: 100%;
		height: 200px;
		overflow: hidden;
		border-radius: var(--radius-lg);
		background: linear-gradient(180deg, #0a0e14 0%, #111c2e 100%);
	}

.demo-rain-effect .rw-drop {
		position: absolute;
		top: -26px;
		width: 1px;
		background: linear-gradient(180deg, transparent, rgba(147, 197, 253, .85));
		animation: rain-gust linear infinite;
	}

:is(.demo-rain-effect .rw-drop):nth-child(1)  { left: 2%;  height: 20px; animation-duration: 1.1s;  animation-delay: 0s; }

:is(.demo-rain-effect .rw-drop):nth-child(2)  { left: 9%;  height: 15px; animation-duration: 0.9s;  animation-delay: .3s; }

:is(.demo-rain-effect .rw-drop):nth-child(3)  { left: 16%; height: 24px; animation-duration: 1.3s;  animation-delay: .6s; }

:is(.demo-rain-effect .rw-drop):nth-child(4)  { left: 23%; height: 17px; animation-duration: 1.0s;  animation-delay: .15s; }

:is(.demo-rain-effect .rw-drop):nth-child(5)  { left: 30%; height: 21px; animation-duration: 1.2s;  animation-delay: .5s; }

:is(.demo-rain-effect .rw-drop):nth-child(6)  { left: 37%; height: 14px; animation-duration: 0.85s; animation-delay: .8s; }

:is(.demo-rain-effect .rw-drop):nth-child(7)  { left: 44%; height: 23px; animation-duration: 1.35s; animation-delay: .25s; }

:is(.demo-rain-effect .rw-drop):nth-child(8)  { left: 51%; height: 16px; animation-duration: 1.0s;  animation-delay: .65s; }

:is(.demo-rain-effect .rw-drop):nth-child(9)  { left: 58%; height: 19px; animation-duration: 1.15s; animation-delay: .4s; }

:is(.demo-rain-effect .rw-drop):nth-child(10) { left: 65%; height: 13px; animation-duration: 0.9s;  animation-delay: .05s; }

:is(.demo-rain-effect .rw-drop):nth-child(11) { left: 72%; height: 22px; animation-duration: 1.25s; animation-delay: .55s; }

:is(.demo-rain-effect .rw-drop):nth-child(12) { left: 79%; height: 15px; animation-duration: 0.95s; animation-delay: .9s; }

:is(.demo-rain-effect .rw-drop):nth-child(13) { left: 86%; height: 20px; animation-duration: 1.1s;  animation-delay: .2s; }

:is(.demo-rain-effect .rw-drop):nth-child(14) { left: 93%; height: 18px; animation-duration: 1.05s; animation-delay: .7s; }

/*
 * The rotation is repeated in both keyframes on purpose. transform is a
 * single property, so a rotate declared elsewhere would be replaced by the
 * translate rather than combined with it. 70px across per 240px down is
 * about 16 degrees off vertical, which is the angle the drop is turned by.
 */
@keyframes rain-gust {
	0% {
		transform: translate(0, 0) rotate(-16deg);
		opacity: 0;
	}
	6%  { opacity: 1; }
	94% { opacity: .8; }
	100% {
		transform: translate(70px, 240px) rotate(-16deg);
		opacity: 0;
	}
}

/* ── Variant: splash rings, synchronised by shared timing ── */

.demo-rain-effect .rain-splash-stage {
		position: relative;
		width: 100%;
		height: 220px;
		overflow: hidden;
		border-radius: var(--radius-lg);
		background: linear-gradient(180deg, #0a0e14 0%, #111c2e 100%);
	}

/*
 * One class per column carries the position and the clock, so a drop and
 * the ring beneath it cannot drift out of sync: they read the same two
 * values from the same rule.
 */
.demo-rain-effect .rs-1 { left: 12%; animation-duration: 1.1s;  animation-delay: 0s; }

.demo-rain-effect .rs-2 { left: 27%; animation-duration: 1.35s; animation-delay: .35s; }

.demo-rain-effect .rs-3 { left: 42%; animation-duration: 0.95s; animation-delay: .7s; }

.demo-rain-effect .rs-4 { left: 57%; animation-duration: 1.25s; animation-delay: .2s; }

.demo-rain-effect .rs-5 { left: 72%; animation-duration: 1.05s; animation-delay: .55s; }

.demo-rain-effect .rs-6 { left: 87%; animation-duration: 1.45s; animation-delay: .85s; }

/* longhands rather than the shorthand, so the duration and delay set by
   the column class above survive */
.demo-rain-effect .rs-drop {
		position: absolute;
		top: -20px;
		width: 1px;
		height: 16px;
		background: linear-gradient(180deg, transparent, rgba(147, 197, 253, .85));
		animation-name: rain-fall;
		animation-timing-function: linear;
		animation-iteration-count: infinite;
	}

.demo-rain-effect .rs-ring {
		position: absolute;
		top: 192px;
		width: 24px;
		height: 11px;
		margin-left: -12px;
		border: 1.5px solid rgba(147, 197, 253, .85);
		border-radius: 50%;
		opacity: 0;
		animation-name: rain-splash;
		animation-timing-function: linear;
		animation-iteration-count: infinite;
	}

.demo-rain-effect .rain-floor {
		position: absolute;
		left: 0;
		right: 0;
		top: 200px;
		height: 1px;
		background: rgba(147, 197, 253, .22);
	}

/* Silent until 85%, which is where a drop falling 240px from top: -20px
   crosses the floor line 200px down. Move the floor and this moves too. */
@keyframes rain-splash {
	0%, 85% { transform: scale(.25); opacity: 0; }
	87%     { transform: scale(.35); opacity: .9; }
	100%    { transform: scale(1); opacity: 0; }
}

/* Fast, dense, repeating motion over a wide area is a stronger trigger
   than slow drift, so the whole thing stops under reduce. */
@media (prefers-reduced-motion: reduce) {
	.demo-rain-effect .rw-drop {
		animation: none;
		opacity: .35;
	}

	.demo-rain-effect .rs-drop {
		animation: none;
	}

	.demo-rain-effect .rs-ring {
		animation: none;
		opacity: 0;
	}
}
