/* Albrau hero: compozitia cu doze + scena cu munti. Totul se activeaza din hero.js;
   fara JS pagina ramane exact ca inainte. */

/* ---------- Scena cu munti (antet + hero) ---------- */
.am-on {
	background-image: none !important;
	background-color: #fdfefd;
}
.am-scene {
	position: absolute;
	inset: 0;
	overflow: hidden;
	pointer-events: none;
	color: #c8cabf;
	opacity: 0;
	transition: opacity 1.4s ease;
}
.am-scene.am-ready {
	opacity: 1;
}
.am-layer {
	position: absolute;
	left: -3%;
	top: -5%;
	width: 106%;
	height: 110%;
	will-change: transform;
}
/* mobil/tableta: fundalul original e la marime naturala, din coltul stanga-sus */
.am-scene.am-nat .am-layer {
	left: -24px;
	top: -12px;
	width: 1968px;
	height: 922px;
}
.am-layer svg {
	display: block;
	width: 100%;
	height: 100%;
	overflow: visible;
}
.am-ready .am-layer--mountains svg {
	animation: am-rise 1.8s cubic-bezier(.2, .7, .2, 1) both;
}
.am-ready .am-layer--field svg {
	animation: am-rise-far 2.1s cubic-bezier(.2, .7, .2, 1) both;
}
.am-ready .am-layer--cloudsA svg {
	animation: am-drift-a 26s ease-in-out infinite alternate;
}
.am-ready .am-layer--cloudsB svg {
	animation: am-drift-b 37s ease-in-out infinite alternate;
}
@keyframes am-rise {
	from { opacity: 0; transform: translate3d(0, 22px, 0); }
	to { opacity: 1; transform: none; }
}
@keyframes am-rise-far {
	from { opacity: 0; transform: translate3d(0, 38px, 0); }
	to { opacity: 1; transform: none; }
}
@keyframes am-drift-a {
	from { transform: translate3d(-4%, 0, 0); }
	to { transform: translate3d(4%, 0, 0); }
}
@keyframes am-drift-b {
	from { transform: translate3d(3.4%, 0, 0); }
	to { transform: translate3d(-3.4%, 0, 0); }
}

/* ---------- Compozitia cu doze ---------- */
.ah-stage {
	position: relative;
	display: block;
	perspective: 1100px;
	will-change: transform;
}
.ah-tilt {
	position: relative;
	display: block;
	transform-style: preserve-3d;
	will-change: transform;
}
.ah-float {
	position: relative;
	display: block;
	animation: ah-bob 7.5s ease-in-out infinite;
	will-change: transform;
}
.ah-float > img.ah-main {
	display: block;
	width: 100%;
	height: auto;
	-webkit-mask-size: 100% 100%;
	mask-size: 100% 100%;
	-webkit-mask-repeat: no-repeat;
	mask-repeat: no-repeat;
}
.ah-in .ah-float > img.ah-main {
	animation: ah-pop 1.1s cubic-bezier(.2, .8, .2, 1) both;
}
@keyframes ah-bob {
	0%, 100% { transform: translate3d(0, 5px, 0) rotate(.35deg); }
	50% { transform: translate3d(0, -9px, 0) rotate(-.45deg); }
}
@keyframes ah-pop {
	from { opacity: 0; transform: scale(.93) translate3d(0, 18px, 0); }
	to { opacity: 1; transform: none; }
}

/* elementele desprinse: hamei, frunze, boabe */
.ah-isl {
	position: absolute;
	display: block;
	pointer-events: none;
	will-change: transform;
}
.ah-isl img {
	display: block;
	width: 100%;
	height: auto;
	opacity: 0;
}
.ah-in .ah-isl img {
	animation:
		ah-isl-in .9s cubic-bezier(.2, .9, .3, 1.25) both,
		ah-drift 6s ease-in-out infinite;
	animation-delay: calc(.35s + var(--i) * .09s), calc(1.3s + var(--i) * .09s);
	animation-duration: .9s, calc(5.2s + var(--i) * .7s);
}
@keyframes ah-isl-in {
	from { opacity: 0; transform: translate3d(var(--fx), var(--fy), 0) scale(.3) rotate(-40deg); }
	to { opacity: 1; transform: none; }
}
@keyframes ah-drift {
	0%, 100% { opacity: 1; transform: translate3d(0, 0, 0) rotate(0deg); }
	33% { opacity: 1; transform: translate3d(var(--dx), calc(var(--dy) * -1), 0) rotate(var(--r)); }
	66% { opacity: 1; transform: translate3d(calc(var(--dx) * -.6), var(--dy), 0) rotate(calc(var(--r) * -.7)); }
}

/* reflexie de lumina care trece peste compozitie */
.ah-sheen {
	position: absolute;
	inset: 0;
	pointer-events: none;
	-webkit-mask-size: 100% 100%;
	mask-size: 100% 100%;
	-webkit-mask-repeat: no-repeat;
	mask-repeat: no-repeat;
	background: linear-gradient(104deg, rgba(255, 255, 255, 0) 42%, rgba(255, 255, 255, .5) 50%, rgba(255, 255, 255, 0) 58%) no-repeat;
	background-size: 260% 100%;
	background-position: 135% 0;
	opacity: 0;
}
.ah-in .ah-sheen {
	animation: ah-sheen 9s ease-in-out 2.2s infinite;
}
@keyframes ah-sheen {
	0% { background-position: 135% 0; opacity: 0; }
	4% { opacity: 1; }
	20% { background-position: -35% 0; opacity: 1; }
	22%, 100% { background-position: -35% 0; opacity: 0; }
}

/* imaginea de pe mobil: doar o plutire usoara */
.ah-lite {
	animation: ah-bob 7.5s ease-in-out infinite;
}

@media (prefers-reduced-motion: reduce) {
	.ah-float,
	.ah-lite,
	.ah-in .ah-float > img.ah-main,
	.ah-in .ah-isl img,
	.ah-in .ah-sheen,
	.am-ready .am-layer svg {
		animation: none !important;
	}
	.ah-isl img {
		opacity: 1;
	}
	.am-scene {
		transition: none;
	}
}
