/* Xmas Effects – front-end styles. Every effect ignores clicks (pointer-events: none). */

.xmas-snow-canvas {
	position: fixed;
	inset: 0;
	width: 100vw;
	height: 100vh;
	pointer-events: none;
	z-index: 99998;
}

/* ---------- Fairy string lights ---------- */
.xmas-fairy {
	position: fixed;
	top: 0;
	pointer-events: none;
	z-index: 100000;
}
.xmas-fairy--top   { left: 0; }
.xmas-fairy--left  { left: 0; }
.xmas-fairy--right { right: 0; }

/* ---------- Wreath with star ---------- */
.xmas-wreath {
	position: fixed;
	top: 0;
	pointer-events: none;
	z-index: 9990; /* below sticky headers/menus, above page content */
	transform-origin: 50% 0;
	animation: xmas-wreath-sway 6s ease-in-out infinite;
	filter: drop-shadow(0 6px 8px rgba(0, 0, 0, .25));
}
.xmas-wreath--top-center { left: 50%; margin-left: calc(var(--xw-w, 0px) * -.5); }
.xmas-wreath svg { display: block; width: 100%; height: auto; overflow: visible; }

.xmas-wreath .xw-light {
	animation: xmas-wreath-twinkle 1.8s ease-in-out infinite alternate;
}
.xmas-wreath .xw-star {
	transform-box: view-box;
	transform-origin: 120px 80px;
	animation: xmas-star-swing 3.4s ease-in-out infinite;
}
.xmas-wreath .xw-halo {
	transform-box: fill-box;
	transform-origin: center;
	animation: xmas-star-glow 2.2s ease-in-out infinite;
}
.xmas-wreath .xw-spark {
	transform-box: fill-box;
	transform-origin: center;
	animation: xmas-sparkle 1.6s ease-in-out infinite;
}
.xmas-wreath .xw-spark--2 { animation-delay: .8s; }

@keyframes xmas-wreath-sway {
	0%, 100% { transform: rotate(-1.5deg); }
	50%      { transform: rotate(1.5deg); }
}
@keyframes xmas-wreath-twinkle {
	0%   { opacity: .35; }
	100% { opacity: 1; }
}
@keyframes xmas-star-swing {
	0%, 100% { transform: rotate(-6deg); }
	50%      { transform: rotate(6deg); }
}
@keyframes xmas-star-glow {
	0%, 100% { opacity: .55; transform: scale(.85); }
	50%      { opacity: 1;   transform: scale(1.12); }
}
@keyframes xmas-sparkle {
	0%, 100% { opacity: 0; transform: scale(.3) rotate(0deg); }
	50%      { opacity: 1; transform: scale(1.2) rotate(45deg); }
}

/* ---------- Santa hat on the logo ---------- */
.xmas-hat {
	position: absolute;
	display: block;
	pointer-events: none;
	z-index: 5;
	transform: rotate(-18deg);
	transform-origin: 30% 90%;
	filter: drop-shadow(0 2px 2px rgba(0, 0, 0, .25));
	line-height: 0;
}
.xmas-hat svg { display: block; width: 100%; height: auto; }

/* ---------- Snow on buttons ---------- */
/* The snow sits above the button's background but behind its text. */
.xmas-snowy { isolation: isolate; }
.xmas-snowy--light-text { text-shadow: 0 0 3px rgba(0, 0, 0, .55), 0 1px 2px rgba(0, 0, 0, .35); }
.xmas-snowcap {
	position: absolute;
	top: 0;
	left: 0;
	right: 0;
	height: 45%;
	pointer-events: none;
	z-index: -1;
	background: linear-gradient(180deg, #ffffff 0%, #f4f8ff 70%, #e6eef9 100%);
	box-shadow: inset 0 -1px 0 rgba(160, 185, 215, .35);
	transform-origin: 50% 0;
}
/* Lumpy, drippy lower edge */
.xmas-snowcap::after {
	content: "";
	position: absolute;
	left: 0;
	right: 0;
	bottom: -7px;
	height: 8px;
	background:
		radial-gradient(circle at 7px 0, #e9f0fa 6px, transparent 6.5px) 0 0 / 22px 8px repeat-x,
		radial-gradient(circle at 4px 0, #eef4fc 4px, transparent 4.5px) 11px 0 / 22px 8px repeat-x;
}
/* Fluffy mound sitting on top of the button */
.xmas-snowcap::before {
	content: "";
	position: absolute;
	left: 4%;
	right: 4%;
	top: -5px;
	height: 8px;
	border-radius: 50% 50% 0 0 / 100% 100% 0 0;
	background: #fff;
}
.xmas-snowcap.is-falling {
	animation: xmas-cap-fall .65s cubic-bezier(.5, 0, .9, .5) forwards;
}
.xmas-snowcap.is-growing {
	animation: xmas-cap-grow 1.6s ease-out both;
}
@keyframes xmas-cap-fall {
	0%   { transform: translateY(0) scaleY(1); opacity: 1; }
	25%  { transform: translateY(-3px) scaleY(1.05); opacity: 1; }
	100% { transform: translateY(170%) scaleY(.6) rotate(3deg); opacity: 0; }
}
@keyframes xmas-cap-grow {
	0%   { transform: scaleY(0); opacity: 0; }
	100% { transform: scaleY(1); opacity: 1; }
}
.xmas-snowbit {
	position: fixed;
	border-radius: 50%;
	background: #fff;
	box-shadow: 0 0 2px rgba(150, 180, 220, .8);
	pointer-events: none;
	z-index: 100002;
}

/* ---------- Santa flight ---------- */
.xmas-santa {
	position: fixed;
	top: 0;
	left: 0;
	pointer-events: none;
	z-index: 99999;
	will-change: transform;
}
.xmas-santa__media {
	display: block;
	width: 100%;
	height: 100%;
	object-fit: contain;
	background: transparent;
	border: 0;
	max-width: none;
	filter: drop-shadow(0 6px 10px rgba(0, 0, 0, .15));
}

/* ---------- Gift boxes (bottom-left) ---------- */
.xmas-gifts {
	position: fixed;
	left: 12px;
	bottom: 4px;
	width: 250px;
	height: 190px;
	pointer-events: none;
	z-index: 99998;
	transform: scale(var(--xg-scale, 1));
	transform-origin: left bottom;
}
.xmas-gifts--on-snow { bottom: 14px; }
.xmas-gift {
	position: absolute;
	transform: rotate(var(--xg-tilt, 0deg));
	filter: drop-shadow(0 4px 4px rgba(0, 0, 0, .25));
	animation: xmas-gift-drop 1.3s cubic-bezier(.45, 0, .8, .6) both;
}
.xmas-gift svg { display: block; width: 100%; height: auto; }

@keyframes xmas-gift-drop {
	0%   { transform: translateY(-110vh) rotate(var(--xg-spin)); opacity: 1; }
	62%  { transform: translateY(0) rotate(var(--xg-tilt)) scaleY(1); animation-timing-function: ease-out; }
	70%  { transform: translateY(0) rotate(var(--xg-tilt)) scale(1.06, .9); }
	80%  { transform: translateY(-18px) rotate(var(--xg-tilt)) scale(.97, 1.04); animation-timing-function: ease-in; }
	90%  { transform: translateY(0) rotate(var(--xg-tilt)) scale(1.02, .97); }
	95%  { transform: translateY(-4px) rotate(var(--xg-tilt)); }
	100% { transform: translateY(0) rotate(var(--xg-tilt)); }
}

/* ---------- Snow pile ---------- */
.xmas-snow-pile {
	position: fixed;
	left: 0;
	bottom: 0;
	width: 100%;
	height: 28px;
	pointer-events: none;
	z-index: 99997;
	background:
		radial-gradient(ellipse 60px 22px at 30px 28px, #fff 98%, transparent 100%) repeat-x;
	background-size: 90px 28px;
	filter: drop-shadow(0 -2px 4px rgba(0, 0, 0, .12));
}

@media (prefers-reduced-motion: reduce) {
	.xmas-gift,
	.xmas-wreath,
	.xmas-wreath .xw-light,
	.xmas-wreath .xw-star,
	.xmas-wreath .xw-halo,
	.xmas-wreath .xw-spark { animation: none; }
	.xmas-snowcap.is-falling { animation: none; opacity: 0; }
	.xmas-snowcap.is-growing { animation: none; }
}
