/**
 * Chaya Suite — site backdrop: soft shadows of leaves in sunlight, drifting
 * slowly over every page, with a faint warm glow and a vignette.
 *
 * One fixed layer that never takes clicks and sits under the header,
 * menus and pop-ups. Only transform and opacity animate, so it stays on
 * the GPU. Still for visitors who prefer less motion; hidden in print.
 */

.chaya-backdrop {
	position: fixed;
	inset: 0;
	z-index: 9;
	pointer-events: none;
	overflow: hidden;
	contain: strict;
	opacity: .75;
	animation: chaya-backdrop-in 2.4s ease-out both;
}

.chaya-backdrop--subtle { opacity: .5; }
.chaya-backdrop--rich   { opacity: 1; }

.chaya-backdrop__glow,
.chaya-backdrop__dapple {
	position: absolute;
	inset: -12%;
	will-change: transform;
	backface-visibility: hidden;
}

/* Warm light from the top right, a cool vignette at the edges. */
.chaya-backdrop__glow {
	inset: 0;
	background:
		radial-gradient(60% 50% at 88% 6%, rgba(244, 214, 170, .16), transparent 70%),
		radial-gradient(48% 40% at 6% 96%, rgba(213, 102, 136, .05), transparent 72%),
		radial-gradient(130% 110% at 50% 45%, transparent 62%, rgba(0, 70, 67, .07) 100%);
	animation: chaya-backdrop-breathe 18s ease-in-out infinite alternate;
}

/* Far canopy: large, very soft leaf shadows. */
.chaya-backdrop__dapple {
	background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 1600 1000' preserveAspectRatio='xMidYMid slice'%3E%3Cdefs%3E%3Cfilter id='b' x='-20%25' y='-20%25' width='140%25' height='140%25'%3E%3CfeGaussianBlur stdDeviation='26'/%3E%3C/filter%3E%3C/defs%3E%3Cg fill='%230b3a35' fill-opacity='.075' filter='url(%23b)'%3E%3Cellipse cx='1340' cy='90' rx='190' ry='54' transform='rotate(-24 1340 90)'/%3E%3Cellipse cx='1480' cy='230' rx='150' ry='44' transform='rotate(38 1480 230)'/%3E%3Cellipse cx='1210' cy='260' rx='120' ry='36' transform='rotate(-58 1210 260)'/%3E%3Cellipse cx='1420' cy='420' rx='170' ry='48' transform='rotate(12 1420 420)'/%3E%3Cellipse cx='120' cy='160' rx='160' ry='46' transform='rotate(32 120 160)'/%3E%3Cellipse cx='260' cy='60' rx='120' ry='34' transform='rotate(-12 260 60)'/%3E%3Cellipse cx='80' cy='420' rx='140' ry='40' transform='rotate(-40 80 420)'/%3E%3Cellipse cx='1500' cy='820' rx='180' ry='52' transform='rotate(-30 1500 820)'/%3E%3Cellipse cx='1300' cy='940' rx='140' ry='40' transform='rotate(18 1300 940)'/%3E%3Cellipse cx='140' cy='860' rx='170' ry='50' transform='rotate(24 140 860)'/%3E%3Cellipse cx='360' cy='960' rx='130' ry='38' transform='rotate(-36 360 960)'/%3E%3Cellipse cx='800' cy='-10' rx='160' ry='40' transform='rotate(6 800 -10)'/%3E%3C/g%3E%3C/svg%3E") center / cover no-repeat;
	animation: chaya-backdrop-sway 46s ease-in-out infinite alternate;
}

/* Near leaves: smaller, a touch crisper, moving at a different pace. */
.chaya-backdrop__dapple--near {
	inset: -8%;
	background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 1600 1000' preserveAspectRatio='xMidYMid slice'%3E%3Cdefs%3E%3Cfilter id='b' x='-30%25' y='-30%25' width='160%25' height='160%25'%3E%3CfeGaussianBlur stdDeviation='13'/%3E%3C/filter%3E%3C/defs%3E%3Cg fill='%230b3a35' fill-opacity='.055' filter='url(%23b)'%3E%3Cpath d='M1390 150c60-50 140-40 170 0-40 30-120 50-170 0z'/%3E%3Cpath d='M1250 120c40-60 110-70 150-40-30 40-100 70-150 40z'/%3E%3Cpath d='M1500 320c30-60 100-80 140-50-30 50-90 80-140 50z'/%3E%3Cpath d='M1330 330c50-40 120-30 150 10-40 25-110 35-150-10z'/%3E%3Cpath d='M60 260c50-50 130-50 160-10-40 30-120 45-160 10z'/%3E%3Cpath d='M180 120c40-55 110-65 150-35-30 40-100 65-150 35z'/%3E%3Cpath d='M1420 900c50-45 125-40 155 0-40 28-115 40-155 0z'/%3E%3Cpath d='M90 760c45-50 120-55 155-20-35 35-110 55-155 20z'/%3E%3C/g%3E%3C/svg%3E");
	animation: chaya-backdrop-flutter 23s ease-in-out infinite alternate;
	animation-delay: -7s;
}

@keyframes chaya-backdrop-in {
	from { opacity: 0; }
}

@keyframes chaya-backdrop-sway {
	0%   { transform: translate3d(-1.2%, -.8%, 0) rotate(-.4deg) scale(1.02); }
	50%  { transform: translate3d(.8%, .6%, 0) rotate(.3deg) scale(1.05); }
	100% { transform: translate3d(1.4%, -.4%, 0) rotate(.6deg) scale(1.03); }
}

@keyframes chaya-backdrop-flutter {
	0%   { transform: translate3d(.6%, .4%, 0) rotate(.5deg); }
	35%  { transform: translate3d(-.8%, -.2%, 0) rotate(-.4deg); }
	70%  { transform: translate3d(.3%, -.9%, 0) rotate(.2deg); }
	100% { transform: translate3d(-.4%, .7%, 0) rotate(-.6deg); }
}

@keyframes chaya-backdrop-breathe {
	from { opacity: .7; }
	to   { opacity: 1; }
}

/* Calmer where people read and type. */
.woocommerce-cart .chaya-backdrop,
.woocommerce-checkout .chaya-backdrop,
.woocommerce-account .chaya-backdrop {
	opacity: .4;
}

/* The home page hero already has living leaves. */
body:has(.chaya-foliage__canvas) .chaya-backdrop {
	opacity: .45;
}

/* Small screens: lighter, and the near leaves are left out. */
@media (max-width: 767px) {
	.chaya-backdrop__dapple--near { display: none; }
	.chaya-backdrop__dapple { inset: -18%; }
}

@media (prefers-reduced-motion: reduce) {
	.chaya-backdrop,
	.chaya-backdrop__glow,
	.chaya-backdrop__dapple {
		animation: none;
	}
}

@media print {
	.chaya-backdrop { display: none; }
}
