/* Over ons: "painted by hand" (see about.js). Everything here only applies once the script
   has added .pd-about-anim, so without it (or with reduced motion) the page shows as is. */

/* --- the portrait ------------------------------------------------------- */

.pd-about-anim .pd-maker-photo {
	position: relative;
	isolation: isolate;
	cursor: pointer;
	-webkit-tap-highlight-color: transparent;
}

.pd-about-anim .pd-maker-photo > img {
	position: relative;
	z-index: 2;
	background: var(--pd-papier);
}

/* Hidden only until it's on screen; the pop then plays from there. If an animation never runs,
   the photo still simply shows (no fill that could keep it invisible). */
.pd-about-anim .pd-maker-photo:not(.is-in) > img {
	opacity: 0;
}

.pd-about-anim .pd-maker-photo.is-in > img {
	animation: pd-about-pop 0.75s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes pd-about-pop {
	from {
		transform: scale(0.78) rotate(-8deg);
	}
	60% {
		transform: scale(1.03) rotate(1.5deg);
	}
	to {
		transform: none;
	}
}

/* The brush ring, painted around the photo. */
.pd-about-ring {
	position: absolute;
	z-index: 3;
	left: 50%;
	top: 50%;
	width: calc(100% + 30px);
	height: auto;
	aspect-ratio: 1;
	transform: translate(-50%, -50%) rotate(-6deg);
	overflow: visible;
	pointer-events: none;
}

.pd-about-ring path {
	fill: none;
	stroke: var(--pd-koraal);
	stroke-width: 4.5;
	stroke-linecap: round;
	stroke-linejoin: round;
	stroke-dasharray: 1;
	stroke-dashoffset: 1;
}

.pd-maker-photo.is-in .pd-about-ring path {
	transition: stroke-dashoffset 0.95s cubic-bezier(0.65, 0, 0.35, 1) 0.35s;
	stroke-dashoffset: 0;
}

/* The little doll behind the photo: peeks out at the right and waves (not before the photo is there). */
.pd-maker-photo:not(.is-painted) .pd-about-doll {
	visibility: hidden;
}

.pd-about-doll {
	position: absolute;
	z-index: 1;
	right: 4px;
	bottom: 4px;
	width: 50px;
	transform-origin: 50% 100%;
	transform: translateX(-40px) rotate(0deg);
	pointer-events: none;
}

.pd-about-doll img {
	display: block;
	width: 100%;
	height: auto;
	filter: drop-shadow(0 4px 6px rgb(8 30 36 / 0.18));
}

.pd-maker-photo.is-peeking .pd-about-doll {
	animation: pd-about-peek 2.2s cubic-bezier(0.34, 1.2, 0.64, 1) both;
}

@keyframes pd-about-peek {
	0% {
		transform: translateX(-40px) rotate(0deg);
	}
	22% {
		transform: translateX(44px) rotate(18deg);
	}
	34% {
		transform: translateX(44px) rotate(5deg);
	}
	46% {
		transform: translateX(44px) rotate(20deg);
	}
	58% {
		transform: translateX(44px) rotate(7deg);
	}
	78% {
		transform: translateX(44px) rotate(15deg);
	}
	100% {
		transform: translateX(-40px) rotate(0deg);
	}
}

/* --- Contact: cards land one by one ------------------------------------------ */

.pd-about-anim .pd-contact {
	position: relative;
}

.pd-about-anim .pd-contact > div {
	z-index: 1;
}

.pd-about-anim .pd-contact:not(.is-in) > div {
	opacity: 0;
}

.pd-about-anim .pd-contact.is-in > div {
	animation: pd-about-card 0.6s cubic-bezier(0.16, 1, 0.3, 1) calc(var(--i, 0) * 0.11s) backwards;
}

@keyframes pd-about-card {
	from {
		transform: translateY(22px) rotate(-2deg);
	}
	to {
		transform: none;
	}
}

/* …then a doll pops up behind "Op maat" and waves (again on hover). */
.pd-about-doll--up {
	position: absolute;
	z-index: 0;
	right: auto;
	bottom: auto;
	width: 50px;
	transform: translateY(70px);
	transform-origin: 50% 100%;
}

.pd-contact:not(.is-painted) .pd-about-doll--up {
	visibility: hidden;
}


.pd-contact .pd-about-doll--up.is-peeking {
	animation: pd-about-peek-up 2s cubic-bezier(0.34, 1.2, 0.64, 1) both;
}

@keyframes pd-about-peek-up {
	0% {
		transform: translateY(70px) rotate(0deg);
	}
	22% {
		transform: translateY(0) rotate(-12deg);
	}
	36% {
		transform: translateY(0) rotate(8deg);
	}
	50% {
		transform: translateY(0) rotate(-10deg);
	}
	64% {
		transform: translateY(0) rotate(6deg);
	}
	80% {
		transform: translateY(0) rotate(-4deg);
	}
	100% {
		transform: translateY(70px) rotate(0deg);
	}
}

.pd-about-anim .pd-contact.is-stacked > .pd-about-custom {
	margin-top: 52px !important;
}

/* --- Easter egg: the cheetah behind the footer's torn edge ------------------ */

.pd-about-egg-host {
	position: relative;
}

.pd-about-egg-host .pd-footer {
	z-index: 1;
}

.pd-about-doll--egg {
	position: absolute;
	z-index: 0;
	top: 6px;
	right: auto;
	bottom: auto;
	width: 52px;
	transform: translateY(0);
	transform-origin: 50% 100%;
	cursor: pointer;
	-webkit-tap-highlight-color: transparent;
}

.pd-about-doll--egg.is-peeking {
	animation: pd-about-egg 2.4s cubic-bezier(0.34, 1.2, 0.64, 1) both;
}

@keyframes pd-about-egg {
	0% {
		transform: translateY(0) rotate(0deg);
	}
	18% {
		transform: translateY(-62%) rotate(-10deg);
	}
	32% {
		transform: translateY(-62%) rotate(8deg);
	}
	46% {
		transform: translateY(-62%) rotate(-9deg);
	}
	60% {
		transform: translateY(-62%) rotate(6deg);
	}
	76% {
		transform: translateY(-62%) rotate(0deg);
	}
	100% {
		transform: translateY(0) rotate(0deg);
	}
}
