/**
 * Bakery / dessert textures & atmospheric layers
 */

/* Soft flour grain over the whole site */
body.dreem-theme::before {
	content: "";
	position: fixed;
	inset: 0;
	pointer-events: none;
	z-index: 9998;
	opacity: 0.035;
	mix-blend-mode: multiply;
	background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
	background-size: 180px 180px;
}

/* Sugar-dust sprinkle pattern */
.dreem-texture-sugar {
	position: relative;
	isolation: isolate;
}

.dreem-texture-sugar::before {
	content: "";
	position: absolute;
	inset: 0;
	pointer-events: none;
	z-index: 0;
	opacity: 0.45;
	background-image:
		radial-gradient(circle at 12% 18%, rgba(232, 93, 59, 0.12) 0 2px, transparent 2.5px),
		radial-gradient(circle at 78% 22%, rgba(26, 26, 26, 0.07) 0 1.5px, transparent 2px),
		radial-gradient(circle at 34% 72%, rgba(232, 93, 59, 0.1) 0 2px, transparent 2.5px),
		radial-gradient(circle at 88% 68%, rgba(26, 26, 26, 0.06) 0 1.5px, transparent 2px),
		radial-gradient(circle at 52% 40%, rgba(248, 215, 208, 0.7) 0 3px, transparent 3.5px),
		radial-gradient(circle at 20% 88%, rgba(232, 93, 59, 0.08) 0 2px, transparent 2.5px);
	background-size: 220px 180px;
	animation: dreem-dust-drift 28s linear infinite;
}

.dreem-texture-sugar > * {
	position: relative;
	z-index: 1;
}

/* Warm parchment / bakery paper */
.dreem-texture-parchment {
	position: relative;
	background-color: var(--dreem-soft);
	background-image:
		linear-gradient(180deg, rgba(253, 240, 236, 0.55), rgba(250, 247, 245, 0.9)),
		url("data:image/svg+xml,%3Csvg viewBox='0 0 160 160' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='p'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.65' numOctaves='3' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 0.92 0 0 0 0 0.86 0 0 0 0 0.8 0 0 0 0.18 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23p)'/%3E%3C/svg%3E");
	background-size: auto, 240px 240px;
}

/* Cocoa swirl motif — soft decorative rings */
.dreem-texture-swirl {
	position: relative;
	overflow: hidden;
}

.dreem-texture-swirl::after {
	content: "";
	position: absolute;
	width: min(420px, 55vw);
	aspect-ratio: 1;
	border-radius: 50%;
	border: 1px solid rgba(232, 93, 59, 0.12);
	box-shadow:
		inset 0 0 0 28px rgba(248, 215, 208, 0.15),
		inset 0 0 0 56px rgba(255, 255, 255, 0.35);
	top: -12%;
	inset-inline-end: -8%;
	pointer-events: none;
	animation: dreem-swirl-spin 40s linear infinite;
}

/* Soft cream waves under sections */
.dreem-texture-cream {
	position: relative;
}

.dreem-texture-cream::before {
	content: "";
	position: absolute;
	left: 0;
	right: 0;
	bottom: -1px;
	height: 48px;
	pointer-events: none;
	background:
		radial-gradient(120% 80% at 10% 100%, var(--dreem-blush-soft) 0 35%, transparent 36%),
		radial-gradient(100% 80% at 50% 100%, #fff 0 38%, transparent 39%),
		radial-gradient(120% 80% at 90% 100%, var(--dreem-blush-soft) 0 35%, transparent 36%);
	opacity: 0.9;
}

/* Floating crumbs / flour flecks */
.dreem-crumbs {
	position: absolute;
	inset: 0;
	pointer-events: none;
	overflow: hidden;
	z-index: 0;
}

.dreem-crumbs span {
	position: absolute;
	display: block;
	border-radius: 50%;
	background: rgba(232, 93, 59, 0.18);
	animation: dreem-crumb-float 12s ease-in-out infinite;
}

.dreem-crumbs span:nth-child(1) { width: 7px; height: 7px; top: 18%; left: 8%; animation-delay: 0s; }
.dreem-crumbs span:nth-child(2) { width: 5px; height: 5px; top: 42%; left: 18%; background: rgba(26,26,26,0.08); animation-delay: 1.2s; }
.dreem-crumbs span:nth-child(3) { width: 9px; height: 9px; top: 28%; right: 14%; animation-delay: 2s; }
.dreem-crumbs span:nth-child(4) { width: 4px; height: 4px; top: 68%; right: 22%; background: rgba(248,215,208,0.9); animation-delay: 0.6s; }
.dreem-crumbs span:nth-child(5) { width: 6px; height: 6px; bottom: 16%; left: 28%; animation-delay: 2.8s; }
.dreem-crumbs span:nth-child(6) { width: 5px; height: 5px; top: 12%; right: 32%; background: rgba(26,26,26,0.06); animation-delay: 1.8s; }

@keyframes dreem-dust-drift {
	0% { background-position: 0 0, 40px 20px, 0 0, 80px 60px, 20px 40px, 60px 10px; }
	100% { background-position: 220px 180px, 260px 200px, 220px 180px, 300px 240px, 240px 220px, 280px 190px; }
}

@keyframes dreem-swirl-spin {
	from { transform: rotate(0deg); }
	to { transform: rotate(360deg); }
}

@keyframes dreem-crumb-float {
	0%, 100% { transform: translateY(0) translateX(0); opacity: 0.55; }
	50% { transform: translateY(-18px) translateX(8px); opacity: 1; }
}

@media (prefers-reduced-motion: reduce) {
	.dreem-texture-sugar::before,
	.dreem-texture-swirl::after,
	.dreem-crumbs span {
		animation: none !important;
	}
}
