/* TE24 Frost – blaue CTA-Buttons gefrieren beim Hover: Eis kriecht von den Rändern herein, Dampf zieht im Button
   und quillt etwas über den Rand. Ebenen liegen hinter der Schrift (isolation am Button, z-index -1). */

@property --te-frost {
	syntax: '<percentage>';
	inherits: true;
	initial-value: 100%;
}

.te-frost-ziel { position: relative; isolation: isolate; }

.te-frost {
	position: absolute; inset: -14px; z-index: -1; pointer-events: none;
	--te-frost: 100%;
	transition: --te-frost 1.1s cubic-bezier(.2, .7, .2, 1);
}

/* Eis: Textur + Raureif-Rand, über eine Maske von außen nach innen aufgedeckt */
.te-frost__eis {
	position: absolute; inset: 14px; border-radius: var(--te-frost-radius, 999px); overflow: hidden;
	opacity: 0; transition: opacity .45s ease;
	background:
		url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='180' height='180'%3E%3Cfilter id='k'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='3' seed='7'/%3E%3CfeColorMatrix values='0 0 0 0 1 0 0 0 0 1 0 0 0 0 1 0 0 0 1.8 -1.05'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23k)'/%3E%3C/svg%3E"),
		url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='260' height='120'%3E%3Cfilter id='s'%3E%3CfeTurbulence type='turbulence' baseFrequency='.012 .11' numOctaves='4' seed='3'/%3E%3CfeColorMatrix values='0 0 0 0 1 0 0 0 0 1 0 0 0 0 1 0 0 0 1.7 -.75'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23s)'/%3E%3C/svg%3E"),
		linear-gradient(165deg, rgba(255, 255, 255, .42), rgba(205, 228, 255, .16) 55%, rgba(255, 255, 255, .3));
	background-size: 180px 180px, 260px 120px, 100% 100%;
	box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .55), inset 0 0 16px rgba(232, 243, 255, .85), inset 0 -6px 14px rgba(255, 255, 255, .35);
	-webkit-mask-image: radial-gradient(ellipse 62% 95% at 50% 50%, transparent var(--te-frost), #000 calc(var(--te-frost) + 38%));
	mask-image: radial-gradient(ellipse 62% 95% at 50% 50%, transparent var(--te-frost), #000 calc(var(--te-frost) + 38%));
}

/* Dampf: dezent, an den Enden und am Rand – die Mitte mit der Schrift bleibt frei (Maske mit Loch in der Mitte),
   nach außen über den Rand weich ausgeblendet. */
.te-frost__dampf {
	position: absolute; inset: 0; overflow: hidden; opacity: 0; transition: opacity .6s ease .15s;
	-webkit-mask-image: radial-gradient(farthest-side at 50% 50%, #000 70%, transparent 100%), radial-gradient(ellipse 36% 46% at 50% 50%, transparent 55%, #000 100%);
	-webkit-mask-composite: source-in;
	mask-image: radial-gradient(farthest-side at 50% 50%, #000 70%, transparent 100%), radial-gradient(ellipse 36% 46% at 50% 50%, transparent 55%, #000 100%);
	mask-composite: intersect;
}
.te-frost__dampf i {
	position: absolute; width: 40%; height: 72%; border-radius: 50%;
	background: radial-gradient(closest-side, rgba(246, 250, 255, .85), rgba(200, 218, 242, .42) 55%, rgba(200, 218, 242, 0));
	filter: blur(6px); opacity: 0;
	animation: te-dampf 3.6s ease-in-out infinite; animation-play-state: paused;
}
.te-frost__dampf i:nth-child(1) { left: -4%; top: 22%; --dx: -35%; animation-duration: 3.4s; animation-delay: -.3s; }
.te-frost__dampf i:nth-child(2) { left: 70%; top: 26%; --dx: 35%;  animation-duration: 3.9s; animation-delay: -1.6s; }
.te-frost__dampf i:nth-child(3) { left: 8%;  top: -8%; --dx: -20%; animation-duration: 4.2s; animation-delay: -2.4s; }
.te-frost__dampf i:nth-child(4) { left: 60%; top: -10%; --dx: 20%; animation-duration: 3.7s; animation-delay: -.9s; }
.te-frost__dampf i:nth-child(5) { left: 26%; top: 62%; --dx: -25%; animation-duration: 4.4s; animation-delay: -3.1s; }
.te-frost__dampf i:nth-child(6) { left: 82%; top: 52%; --dx: 30%;  animation-duration: 3.5s; animation-delay: -2s; }

@keyframes te-dampf {
	0%   { transform: translate(0, 25%) scale(.7); opacity: 0; }
	30%  { opacity: .75; }
	70%  { opacity: .45; }
	100% { transform: translate(var(--dx, 25%), -55%) scale(1.25); opacity: 0; }
}

/* Auf das Kartenelement gelegt (gestreckte Links wie „Zum Produkt“): Lage/Größe setzt das Skript, liegt über dem
   Button; die Mitte mit der Schrift bleibt durch die Masken frei. */
.te-frost.te-frost--aufgelegt { inset: auto; z-index: 2; }

/* Gefroren (Klasse am Button bzw. an der aufgelegten Ebene) */
.te-frost-an .te-frost, .te-frost.te-frost-an { --te-frost: 30%; }
.te-frost-an .te-frost__eis, .te-frost.te-frost-an .te-frost__eis { opacity: 1; }
.te-frost-an .te-frost__dampf, .te-frost.te-frost-an .te-frost__dampf { opacity: 1; }
.te-frost-an .te-frost__dampf i, .te-frost.te-frost-an .te-frost__dampf i { animation-play-state: running; }
.te-frost-an:is(.te-frost-ziel, .te-product__link) { text-shadow: 0 1px 3px rgba(14, 34, 88, .55); }

@media (prefers-reduced-motion: reduce) {
	.te-frost { transition: none; }
	.te-frost__dampf { display: none; }
}
