.cosmic-hero {
	position: relative;
	isolation: isolate;
	display: grid;
	place-items: center;
	min-height: max(46rem, 100svh);
	margin-block: 0;
	padding: clamp(7rem, 15vh, 12rem) clamp(1.25rem, 5vw, 5rem);
	overflow: clip;
	color: #fff;
	background: #080b19 url("../images/cosmos-background.webp") center / cover no-repeat;
}

.cosmic-hero::before,
.cosmic-hero::after {
	content: "";
	position: absolute;
	inset: 0;
	pointer-events: none;
}

.cosmic-hero::before {
	z-index: 1;
	/* background: linear-gradient(180deg, rgba(2, 3, 9, .12), transparent 28%, transparent 70%, rgba(2, 3, 9, .42)); */
	background:
		radial-gradient(
			ellipse at center,
			rgba(5, 7, 18, .58) 0%,
			rgba(5, 7, 18, .25) 38%,
			transparent 68%
		);
}

.cosmic-hero::after {
	z-index: 2;
	box-shadow: inset 0 0 9rem 2rem rgba(0, 0, 0, .42);
}

.cosmic-hero__scene {
	position: absolute;
	z-index: 0;
	inset: -4%;
	pointer-events: none;
	contain: paint;
	width: auto !important;
	max-width: none !important;
	margin: 0 !important;
}

/* Keep the old markup compatible with heroes already inserted into pages. */
.cosmic-hero__nebula,
.cosmic-hero__stars--near,
.cosmic-hero__mist--two {
	display: none;
}

.cosmic-hero__stars--far,
.cosmic-hero__mist--one {
	position: absolute;
	inset: 0;
	background-position: center;
	background-repeat: no-repeat;
	background-size: cover;
	pointer-events: none;
	will-change: transform;
}

.cosmic-hero__stars--far {
	opacity: .76;
	background-image: url("../images/cosmos-stars.svg");
	transform: translate3d(0, 0, 0) scale(1.03);
}

.cosmic-hero__mist--one {
	opacity: .32;
	background-image: url("../images/cosmos-mist.webp");
	transform: translate3d(0, 0, 0) scale(1.12);
}

.cosmic-hero__content {
	position: relative;
	z-index: 3;
	width: min(100%, 70rem);
	margin: 0 auto;
	text-align: center;
	text-shadow: 0 3px 26px rgba(0, 0, 0, .75);
	will-change: opacity, transform;
}

.cosmic-hero__title {
	max-width: 11ch;
	margin: 0 auto;
	color: #fff;
	font-size: clamp(4rem, 9vw, 9.5rem);
	font-weight: 400;
	line-height: .82;
	letter-spacing: -1px;
	text-wrap: balance;
	text-transform: none;
}

.cosmic-hero__title em {
	display: block;
	padding-inline-end: .2em;
	color: #f2d7d3;
	font-style: italic;
	font-weight: 400;
	text-transform: none;
	margin-top: .06em;
	font-size: .62em;
}

.cosmic-hero__tagline {
	max-width: 39rem;
	margin: clamp(2rem, 4vw, 3.5rem) auto 0;
	color: rgba(255, 255, 255, .88);
	font-family: Raleway, Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
	font-size: clamp(.9rem, 1.1vw, 1.12rem);
	font-weight: 400;
	line-height: 1.65;
	letter-spacing: .12em;
	text-transform: uppercase;
	text-wrap: balance;
}

/* Hide the scroll cue retained in pages inserted with plugin versions 1.0–1.1. */
.cosmic-hero__scroll { display: none; }

/* Overlay Ollie's front-page header on the hero. */
body.home header.wp-block-template-part {
	position: fixed;
	z-index: 1000;
	top: 0;
	left: 0;
	width: 100%;
	color: #fff8ef;
	background-color: transparent !important;
	box-shadow: none;
	transition:
		background-color .35s ease,
		box-shadow .35s ease,
		color .35s ease;
}

body.home header.wp-block-template-part > .wp-block-group {
	background: transparent !important;
}

/* Header links while over the hero */
body.home header.wp-block-template-part a,
body.home header.wp-block-template-part .wp-block-site-title,
body.home header.wp-block-template-part .wp-block-navigation-item__content {
	color: #fff8ef !important;
	transition: color .35s ease;
}

/* Header after scrolling */
body.home header.wp-block-template-part.is-scrolled {
	color: #090b19;
	background-color: rgba(255, 255, 255, .97) !important;
	box-shadow: 0 1px 18px rgba(5, 7, 18, .12);
}

body.home header.wp-block-template-part.is-scrolled a,
body.home header.wp-block-template-part.is-scrolled .wp-block-site-title,
body.home header.wp-block-template-part.is-scrolled .wp-block-navigation-item__content {
	color: #090b19 !important;
}

/* Logged-in WordPress toolbar */
body.admin-bar.home header.wp-block-template-part {
	top: 32px;
}

@media (max-width: 782px) {
	body.admin-bar.home header.wp-block-template-part {
		top: 46px;
	}
}

@media (prefers-reduced-motion: reduce) {
	body.home header.wp-block-template-part,
	body.home header.wp-block-template-part a {
		transition: none;
	}

	.cosmic-hero__content {
		opacity: 1 !important;
		transform: none !important;
	}
}

/* Cosmic Hero – mobil animáció */
@media (max-width: 782px) {

	.mobile-hero-motion .cosmic-hero__stars--far {
		animation: cosmic-mobile-stars 12s ease-in-out infinite alternate;
	}

	.mobile-hero-motion .cosmic-hero__mist--one {
		opacity: .4;
		background-size: 190% auto;
		background-position: center 58%;
		transform-origin: center;

		-webkit-mask-image: linear-gradient(
			to bottom,
			transparent 5%,
			#000 25%,
			#000 65%,
			transparent 90%
		);
		mask-image: linear-gradient(
			to bottom,
			transparent 5%,
			#000 25%,
			#000 50%,
			transparent 80%
		);

		animation: cosmic-mobile-mist-pulse 8s ease-in-out infinite;
	}

	.mobile-hero-motion .cosmic-hero__title {
		animation: cosmic-mobile-title 1.2s cubic-bezier(.22, 1, .36, 1) both;
	}

	.mobile-hero-motion .cosmic-hero__tagline {
		animation: cosmic-mobile-text 1s .3s cubic-bezier(.22, 1, .36, 1) both;
	}
}

@keyframes cosmic-mobile-stars {
	from {
		transform: translate3d(-10px, -8px, 0) scale(1.04);
	}

	to {
		transform: translate3d(18px, 14px, 0) scale(1.09);
	}
}

@keyframes cosmic-mobile-mist-pulse {
	0%,
	100% {
		opacity: .3;
		transform: translate3d(-10px, 8px, 0) scale(1.04);
	}

	50% {
		opacity: .68;
		transform: translate3d(12px, -6px, 0) scale(1.13);
	}
}

@keyframes cosmic-mobile-title {
	from {
		opacity: 0;
		transform: translateY(24px) scale(.98);
		filter: blur(5px);
	}

	to {
		opacity: 1;
		transform: translateY(0) scale(1);
		filter: blur(0);
	}
}

@keyframes cosmic-mobile-text {
	from {
		opacity: 0;
		transform: translateY(16px);
	}

	to {
		opacity: 1;
		transform: translateY(0);
	}
}

/* Akadálymentesség */
@media (prefers-reduced-motion: reduce) {

	.mobile-hero-motion .cosmic-hero__stars--far,
	.mobile-hero-motion .cosmic-hero__mist--one,
	.mobile-hero-motion .cosmic-hero__title,
	.mobile-hero-motion .cosmic-hero__tagline {
		animation: none !important;
	}
}