.portfolio-header {
	position: sticky;
	top: 0;
	z-index: 30;
	border-bottom: var(--wp--custom--border--hairline) solid var(--wp--custom--color--on-night-line);
	background: var(--wp--preset--color--night);
	color: var(--wp--preset--color--white);
	line-height: var(--wp--custom--line-height--base);
}

.portfolio-header__inner {
	display: flex;
	gap: var(--wp--preset--spacing--24);
	align-items: center;
	box-sizing: content-box;
	max-width: var(--wp--style--global--wide-size);
	height: var(--wp--custom--size--header);
	margin-inline: auto;
	padding-inline: var(--wp--preset--spacing--gutter);
}

/* Edited alone, the header part lacks its `.portfolio-header` fill. */
.editor-styles-wrapper .portfolio-header__inner {
	background: var(--wp--preset--color--night);
}

.portfolio-brand {
	display: inline-flex;
	width: fit-content;
	color: var(--wp--preset--color--white);
}

.portfolio-brand__mark {
	display: block;
	width: var(--wp--custom--size--brand);
	height: auto;
	overflow: visible;
}

.portfolio-brand__mark path {
	stroke-dasharray: 1 2;
	stroke-dashoffset: 1.02;
	animation: portfolio-mark-draw 1.4s var(--wp--custom--easing--out) 0.2s both;
}

.portfolio-brand__mark .portfolio-brand__head {
	transform-box: view-box;
	transform-origin: 50% 95%;
	animation: portfolio-mark-bob 0.42s ease-in-out 1.7s 8 alternate;
}

.portfolio-brand__mark .portfolio-brand__note {
	opacity: 0;
	color: var(--wp--preset--color--blue);
	transform-box: fill-box;
	transform-origin: center;
	animation: portfolio-mark-note 2.2s var(--wp--custom--easing--out) 1.8s 2;
}

.portfolio-brand__mark .portfolio-brand__note--second {
	animation-delay: 2.5s;
}

.portfolio-brand__mark .portfolio-brand__note path {
	stroke-dasharray: none;
	stroke-dashoffset: 0;
	animation: none;
}

.portfolio-brand__mark .portfolio-brand__note ellipse {
	fill: currentcolor;
	stroke: none;
}

@media (hover: hover) and (pointer: fine) {

	.portfolio-brand:hover .portfolio-brand__mark .portfolio-brand__head {
		animation: portfolio-mark-bob 0.38s ease-in-out infinite alternate;
	}

	.portfolio-brand:hover .portfolio-brand__mark .portfolio-brand__note {
		animation: portfolio-mark-note 1.6s var(--wp--custom--easing--out) infinite;
	}

	.portfolio-brand:hover .portfolio-brand__mark .portfolio-brand__note--second {
		animation-delay: 0.6s;
	}
}

/*
 * The 1.02 offset leaves no dash edge on the path before drawing starts, and
 * flat caps avoid the dot a round cap draws on an empty dash.
 */
@keyframes portfolio-mark-draw {

	from {
		stroke-dashoffset: 1.02;
		stroke-linecap: butt;
	}

	90% {
		stroke-linecap: butt;
	}

	to {
		stroke-dashoffset: 0;
		stroke-linecap: round;
	}
}

@keyframes portfolio-mark-bob {

	from {
		transform: rotate(0);
	}

	to {
		transform: rotate(6deg) translateY(-0.8px);
	}
}

@keyframes portfolio-mark-note {

	0% {
		opacity: 0;
		translate: 2px 4px;
		scale: 0.5;
	}

	20% {
		opacity: 1;
	}

	100% {
		opacity: 0;
		translate: -3px -9px;
		rotate: -18deg;
		scale: 1;
	}
}

@media (prefers-reduced-motion: reduce) {

	.portfolio-brand__mark path {
		stroke-dashoffset: 0;
		animation: none;
	}

	.portfolio-brand__mark .portfolio-brand__head,
	.portfolio-brand__mark .portfolio-brand__note,
	.portfolio-brand:hover .portfolio-brand__mark .portfolio-brand__head,
	.portfolio-brand:hover .portfolio-brand__mark .portfolio-brand__note {
		animation: none;
	}
}
