/**
 * Home hero section.
 *
 * @package ALW
 * @since   1.0.0
 */

@keyframes alw-hero-drift {
	0%,
	100% {
		transform: translate(0, 0);
	}

	50% {
		transform: translate(3%, 2%);
	}
}

@keyframes alw-hero-robot-float {
	0%,
	100% {
		transform: translateY(0);
	}

	50% {
		transform: translateY(-14px);
	}
}

@keyframes alw-hero-robot-float-flipped {
	0%,
	100% {
		transform: scaleX(-1) translateY(0);
	}

	50% {
		transform: scaleX(-1) translateY(-14px);
	}
}

@keyframes alw-hero-scroll-wheel {
	0% {
		opacity: 0;
	}

	10% {
		opacity: 1;
		transform: translateY(0);
	}

	100% {
		opacity: 0;
		transform: translateY(15px);
	}
}

@keyframes alw-hero-map-stroke-draw {
	0% {
		stroke-dashoffset: var(--alw-ksa-path-length, 6000);
	}

	100% {
		stroke-dashoffset: 0;
	}
}

@keyframes alw-hero-map-stroke-pulse {
	0%,
	100% {
		opacity: 0.55;
		filter: drop-shadow(0 0 2px rgb(255 255 255 / 0.35));
	}

	50% {
		opacity: 1;
		filter: drop-shadow(0 0 10px rgb(255 255 255 / 0.75));
	}
}

@keyframes alw-hero-flag-float {
	0%,
	100% {
		transform: translate(0, 0) rotate(var(--alw-flag-rotate, 0deg));
	}

	50% {
		transform: translate(0, -5px) rotate(var(--alw-flag-rotate, 0deg));
	}
}

@keyframes alw-hero-flag-from-tl {
	from {
		opacity: 0;
		transform: translate(-130%, -130%) scale(0.35) rotate(-14deg);
	}

	to {
		opacity: 1;
		transform: translate(0, 0) scale(1) rotate(var(--alw-flag-rotate, -6deg));
	}
}

@keyframes alw-hero-flag-from-br {
	from {
		opacity: 0;
		transform: translate(130%, 130%) scale(0.35) rotate(14deg);
	}

	to {
		opacity: 1;
		transform: translate(0, 0) scale(1) rotate(var(--alw-flag-rotate, 6deg));
	}
}

@keyframes alw-hero-flag-from-tr {
	from {
		opacity: 0;
		transform: translate(130%, -130%) scale(0.35) rotate(10deg);
	}

	to {
		opacity: 1;
		transform: translate(0, 0) scale(1) rotate(var(--alw-flag-rotate, 4deg));
	}
}

@keyframes alw-hero-flag-from-bl {
	from {
		opacity: 0;
		transform: translate(-130%, 130%) scale(0.35) rotate(-10deg);
	}

	to {
		opacity: 1;
		transform: translate(0, 0) scale(1) rotate(var(--alw-flag-rotate, -4deg));
	}
}

@keyframes alw-hero-logo-ring-spin {
	to {
		transform: rotate(360deg);
	}
}

@keyframes alw-hero-logo-ring-spin-reverse {
	to {
		transform: rotate(-360deg);
	}
}

@keyframes alw-hero-logo-ring-dash {
	to {
		stroke-dashoffset: -24;
	}
}

@keyframes alw-hero-logo-badge-glow {
	0%,
	100% {
		box-shadow:
			0 0 0 1px rgb(255 255 255 / 0.28),
			0 0 0 3px var(--alw-primary-glow-40),
			0 10px 28px rgb(0 0 0 / 0.28),
			0 0 28px var(--alw-hero-glow-teal);
	}

	50% {
		box-shadow:
			0 0 0 1px rgb(255 255 255 / 0.42),
			0 0 0 4px var(--alw-gold-30),
			0 14px 36px rgb(0 0 0 / 0.32),
			0 0 44px var(--alw-hero-glow-gold);
	}
}

@keyframes alw-hero-logo-orbit-glow {
	0%,
	100% {
		opacity: 0.45;
		transform: scale(0.96);
	}

	50% {
		opacity: 0.85;
		transform: scale(1.04);
	}
}

.hero-home {
	position: relative;
	isolation: isolate;
	overflow: hidden;
	background-color: var(--alw-primary);
	color: var(--alw-primary-foreground);
}

.hero-home__pattern {
	pointer-events: none;
	position: absolute;
	inset: 0;
	z-index: 0;
	opacity: 0.9;
	background-size: 160px 160px;
	mask-image: radial-gradient(ellipse at center, #000 30%, transparent 85%);
	-webkit-mask-image: radial-gradient(ellipse at center, #000 30%, transparent 85%);
}

.hero-home__glows {
	pointer-events: none;
	position: absolute;
	inset: 0;
	z-index: 0;
	overflow: hidden;
}

.hero-home__glow {
	position: absolute;
	border-radius: 50%;
	filter: blur(40px);
	animation: alw-hero-drift 28s ease-in-out infinite;
}

.hero-home__glow--one {
	top: -33%;
	left: -25%;
	width: 80vmax;
	height: 80vmax;
	opacity: 0.6;
	background: radial-gradient(circle at 30% 30%, var(--alw-hero-glow-teal), transparent 60%);
}

.hero-home__glow--two {
	right: -25%;
	bottom: -33%;
	width: 70vmax;
	height: 70vmax;
	opacity: 0.5;
	animation-direction: reverse;
	animation-duration: 32s;
	background: radial-gradient(circle at 60% 60%, var(--alw-hero-glow-gold), transparent 60%);
}

.hero-home__defs {
	position: absolute;
	width: 0;
	height: 0;
}

.hero-home__container {
	position: relative;
	z-index: 1;
	display: flex;
	min-height: 100svh;
	align-items: center;
	justify-content: center;
	max-width: var(--alw-header-max-width);
	margin-inline: auto;
	padding: 112px 16px 128px;
}

@media (min-width: 768px) {
	.hero-home__container {
		padding: 128px 32px;
	}
}

.hero-home__layout {
	display: grid;
	width: 100%;
	align-items: center;
	gap: 28px;
}

@media (min-width: 768px) {
	.hero-home__layout {
		grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
		gap: clamp(24px, 4vw, 64px);
	}
}

.hero-home__content {
	position: relative;
	z-index: 2;
}

.hero-home__content-inner {
	max-width: 560px;
	text-align: start;
	color: var(--alw-white);
	filter: drop-shadow(0 4px 24px rgb(0 0 0 / 0.5));
}

.hero-home__title {
	margin-top: 24px;
}

@media (min-width: 768px) {
	.hero-home__title {
		font-size: 60px;
		line-height: 1.2;
	}
}

.hero-home__subtitle {
	max-width: 36em;
	margin: 20px 0 0;
}

.hero-home__actions {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	justify-content: flex-start;
	gap: 12px;
	margin-top: 32px;
}

.hero-home__media {
	position: relative;
	z-index: 1;
	width: 100%;
}

.hero-home__map-wrap {
	position: relative;
	width: 100%;
	max-width: min(100%, calc(78svh * 1.214));
	margin-inline: auto;
}

@media (min-width: 768px) {
	.hero-home__map-wrap {
		max-width: 100%;
		margin-inline: 0;
	}
}

.hero-home__map {
	position: relative;
	width: 100%;
	aspect-ratio: 1753 / 1444;
	overflow: hidden;
}

.hero-home__video:not(iframe) {
	position: absolute;
	inset: 0;
	width: 100%;
	height: 100%;
	object-fit: cover;
	clip-path: url(#alw-ksa-clip);
	-webkit-clip-path: url(#alw-ksa-clip);
	filter: saturate(1.05) contrast(1.02);
}

.hero-home__youtube,
.hero-home__video--youtube iframe,
iframe#alw-hero-youtube-player {
	position: absolute;
	top: 50%;
	left: 50%;
	width: 360%;
	height: 360%;
	max-width: none;
	border: 0;
	transform: translate(-50%, -56%);
	pointer-events: none;
	clip-path: url(#alw-ksa-clip);
	-webkit-clip-path: url(#alw-ksa-clip);
	filter: saturate(1.05) contrast(1.02);
}

.hero-home__video--youtube {
	overflow: hidden;
	pointer-events: none;
}

.hero-home__video--youtube #alw-hero-youtube-player:not(iframe) {
	position: absolute;
	inset: 0;
	width: 100%;
	height: 100%;
}

.hero-home__video-poster,
.hero-home__video-veil {
	position: absolute;
	inset: 0;
	z-index: 6;
	width: 100%;
	height: 100%;
	clip-path: url(#alw-ksa-clip);
	-webkit-clip-path: url(#alw-ksa-clip);
	pointer-events: none;
}

.hero-home__video-poster {
	object-fit: cover;
	filter: saturate(1.05) contrast(1.02);
	opacity: 1;
	transition: opacity 0.8s ease, visibility 0s linear 0.8s;
}

.hero-home__video-veil {
	background: var(--alw-primary);
	opacity: 1;
	transition: opacity 0.8s ease, visibility 0s linear 0.8s;
}

.hero-home__map-logo {
	position: absolute;
	inset: 0;
	z-index: 6;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 12%;
	clip-path: url(#alw-ksa-clip);
	-webkit-clip-path: url(#alw-ksa-clip);
	pointer-events: none;
	opacity: 1;
	transition: opacity 0.8s ease, visibility 0s linear 0.8s;
}

.hero-home__map-logo-stage {
	position: relative;
	display: flex;
	width: min(220px, 48vw);
	aspect-ratio: 1;
	align-items: center;
	justify-content: center;
}

.hero-home__map-logo-stage::before {
	content: "";
	position: absolute;
	inset: 4%;
	border-radius: 50%;
	background: radial-gradient(circle, var(--alw-primary-glow-40) 0%, rgb(255 255 255 / 0.08) 42%, transparent 72%);
	animation: alw-hero-logo-orbit-glow 3.6s ease-in-out infinite;
}

.hero-home__map-logo-ring {
	position: absolute;
	inset: 0;
	width: 100%;
	height: 100%;
	overflow: visible;
}

.hero-home__map-logo-ring circle {
	transform-box: fill-box;
	transform-origin: center;
}

.hero-home__map-logo-ring--outer {
	animation: alw-hero-logo-ring-spin 20s linear infinite;
}

.hero-home__map-logo-ring--outer circle {
	animation: alw-hero-logo-ring-dash 2.8s linear infinite;
}

.hero-home__map-logo-ring--inner {
	animation: alw-hero-logo-ring-spin-reverse 15s linear infinite;
}

.hero-home__map-logo-ring--inner circle {
	animation: alw-hero-logo-ring-dash 2.1s linear infinite reverse;
}

.hero-home__map-logo-badge {
	position: relative;
	z-index: 1;
	padding: 14px 18px;
	border-radius: 16px;
	background: var(--alw-gradient-card);
	box-shadow:
		0 0 0 1px rgb(255 255 255 / 0.28),
		0 0 0 3px var(--alw-primary-glow-40),
		0 10px 28px rgb(0 0 0 / 0.28),
		0 0 28px var(--alw-hero-glow-teal);
	animation: alw-hero-logo-badge-glow 3.6s ease-in-out infinite;
}

.hero-home__map-logo-badge::before {
	content: "";
	position: absolute;
	inset: 0;
	border-radius: inherit;
	padding: 1px;
	background: linear-gradient(135deg, rgb(255 255 255 / 0.85), var(--alw-gold) 48%, var(--alw-primary-glow) 100%);
	-webkit-mask:
		linear-gradient(#fff 0 0) content-box,
		linear-gradient(#fff 0 0);
	mask:
		linear-gradient(#fff 0 0) content-box,
		linear-gradient(#fff 0 0);
	-webkit-mask-composite: xor;
	mask-composite: exclude;
	pointer-events: none;
}

.hero-home__map-logo-img {
	display: block;
	position: relative;
	z-index: 1;
	width: min(140px, 30vw);
	height: auto;
	object-fit: contain;
	filter: drop-shadow(0 2px 8px rgb(0 0 0 / 0.12));
}

.hero-home__map--video-ready .hero-home__map-logo {
	opacity: 0;
	visibility: hidden;
}

.hero-home__map--video-masked .hero-home__video-poster,
.hero-home__map--video-buffering .hero-home__video-poster {
	opacity: 0;
	visibility: hidden;
}

.hero-home__map--video-masked .hero-home__video-veil,
.hero-home__map--video-buffering .hero-home__video-veil {
	opacity: 1;
	visibility: visible;
	background: var(--alw-primary);
}

.hero-home__map--video-masked .hero-home__video--youtube,
.hero-home__map--video-masked .hero-home__video--youtube iframe,
.hero-home__map--video-masked iframe#alw-hero-youtube-player {
	opacity: 0 !important;
	visibility: hidden !important;
	clip-path: circle(0 at 50% 50%) !important;
	-webkit-clip-path: circle(0 at 50% 50%) !important;
}

.hero-home__map--video-buffering .hero-home__video--youtube,
.hero-home__map--video-buffering .hero-home__video--youtube iframe,
.hero-home__map--video-buffering iframe#alw-hero-youtube-player {
	opacity: 1;
	visibility: visible;
	clip-path: url(#alw-ksa-clip);
	-webkit-clip-path: url(#alw-ksa-clip);
}

.hero-home__map--video-buffering .hero-home__video-poster,
.hero-home__map--video-buffering .hero-home__video-veil {
	opacity: 1;
	visibility: visible;
}

.hero-home__map--video-ready .hero-home__video-poster,
.hero-home__map--video-ready .hero-home__video-veil {
	opacity: 0;
	visibility: hidden;
}

.hero-home__map--video-ready .hero-home__video--youtube,
.hero-home__map--video-ready .hero-home__video--youtube iframe,
.hero-home__map--video-ready iframe#alw-hero-youtube-player {
	opacity: 1;
	visibility: visible;
	transition: opacity 0.8s ease;
}

.hero-home__video--youtube {
	z-index: 1;
}

.hero-home__video--youtube.hero-home__video--loading {
	opacity: 0;
}

.hero-home__video--youtube.hero-home__video--playing {
	opacity: 1;
}

.hero-home__video::-webkit-media-controls,
.hero-home__video::-webkit-media-controls-enclosure,
.hero-home__video::-webkit-media-controls-overlay-play-button,
.hero-home__video::-webkit-media-controls-start-playback-button {
	display: none !important;
	-webkit-appearance: none;
}

.hero-home__map-shade {
	position: absolute;
	inset: 0;
	z-index: 3;
	clip-path: url(#alw-ksa-clip);
	-webkit-clip-path: url(#alw-ksa-clip);
	background: linear-gradient(180deg, var(--alw-hero-shade-top) 0%, var(--alw-hero-shade-bottom) 100%);
}

.hero-home__map--video-masked .hero-home__map-shade,
.hero-home__map--video-buffering .hero-home__map-shade {
	z-index: 5;
}

.hero-home__map-outline {
	position: absolute;
	inset: 0;
	z-index: 7;
	width: 100%;
	height: 100%;
	pointer-events: none;
}

.hero-home__map-stroke--animate {
	stroke-dasharray: var(--alw-ksa-path-length, 6000);
	stroke-dashoffset: var(--alw-ksa-path-length, 6000);
	animation:
		alw-hero-map-stroke-draw 2.8s cubic-bezier(0.45, 0, 0.2, 1) forwards,
		alw-hero-map-stroke-pulse 3.6s ease-in-out 2.8s infinite;
}

.hero-home__map-flags {
	pointer-events: none;
	position: absolute;
	inset: 0;
	z-index: 8;
}

.hero-home__flag {
	position: absolute;
	display: block;
	opacity: 0;
	transform: scale(0.35);
	filter: drop-shadow(0 6px 14px rgb(0 0 0 / 0.35));
	will-change: transform, opacity;
}

.hero-home__flag img {
	display: block;
	width: clamp(38px, 5vw, 54px);
	height: auto;
	border-radius: 2px;
}

.hero-home__flag--tl {
	top: 14%;
	left: 16%;
	--alw-flag-rotate: -6deg;
}

.hero-home__flag--br {
	right: 12%;
	bottom: 16%;
	--alw-flag-rotate: 6deg;
}

.hero-home__flag--tr {
	top: 18%;
	right: 14%;
	--alw-flag-rotate: 4deg;
}

.hero-home__flag--bl {
	bottom: 12%;
	left: 12%;
	--alw-flag-rotate: -4deg;
}

.hero-home__flag--tl.hero-home__flag--visible {
	animation:
		alw-hero-flag-from-tl 0.85s cubic-bezier(0.22, 1, 0.36, 1) forwards,
		alw-hero-flag-float 3.2s ease-in-out 0.85s infinite;
}

.hero-home__flag--br.hero-home__flag--visible {
	animation:
		alw-hero-flag-from-br 0.85s cubic-bezier(0.22, 1, 0.36, 1) forwards,
		alw-hero-flag-float 3.2s ease-in-out 0.85s infinite;
}

.hero-home__flag--tr.hero-home__flag--visible {
	animation:
		alw-hero-flag-from-tr 0.85s cubic-bezier(0.22, 1, 0.36, 1) forwards,
		alw-hero-flag-float 3.2s ease-in-out 0.85s infinite;
}

.hero-home__flag--bl.hero-home__flag--visible {
	animation:
		alw-hero-flag-from-bl 0.85s cubic-bezier(0.22, 1, 0.36, 1) forwards,
		alw-hero-flag-float 3.2s ease-in-out 0.85s infinite;
}

.hero-home__robot {
	position: absolute;
	bottom: 128px;
	z-index: 3;
	width: clamp(120px, 14vw, 220px);
	height: auto;
	pointer-events: none;
	user-select: none;
	filter: drop-shadow(0 12px 28px rgb(0 0 0 / 0.35));
	transform-origin: center bottom;
	animation: alw-hero-robot-float 3.5s ease-in-out infinite;
}

@media (min-width: 1200px) {
	.hero-home__robot {
		width: clamp(180px, 16vw, 260px);
	}
}

@media (min-width: 768px) and (max-width: 1199px) {
	.hero-home__robot {
		width: clamp(100px, 12vw, 160px);
		bottom: 100px;
	}
}

@media (max-width: 767px) {
	.hero-home__robot {
		display: none;
	}
}

@media (prefers-reduced-motion: reduce) {
	.hero-home__robot {
		animation: none;
	}

	.hero-home__map-logo-ring--outer,
	.hero-home__map-logo-ring--inner,
	.hero-home__map-logo-ring circle,
	.hero-home__map-logo-badge,
	.hero-home__map-logo-stage::before {
		animation: none;
	}

	.hero-home__map-stroke--animate {
		stroke-dasharray: none;
		stroke-dashoffset: 0;
		animation: none;
		opacity: 0.85;
	}

	.hero-home__flag {
		opacity: 1;
		transform: none;
	}

	.hero-home__flag img {
		width: 42px;
	}
}

/* English / LTR: robot on the right, flipped toward content. */
.hero-home__robot--end {
	inset-inline-start: auto;
	inset-inline-end: 0;
	left: auto;
	right: 0;
	animation: alw-hero-robot-float-flipped 3.5s ease-in-out infinite;
}

/* Arabic / RTL: robot on the left, facing content. */
.hero-home__robot--start {
	inset-inline-start: 0;
	inset-inline-end: auto;
	left: 0;
	right: auto;
}

@media (prefers-reduced-motion: reduce) {
	.hero-home__robot--end {
		transform: scaleX(-1);
	}

	.hero-home__robot--start {
		transform: none;
	}
}

.hero-home__scroll {
	position: absolute;
	bottom: 60px;
	left: 50%;
	z-index: 4;
	display: flex;
	width: 34px;
	height: 55px;
	align-items: flex-start;
	justify-content: center;
	color: var(--alw-white);
	text-decoration: none;
	opacity: 0.85;
	transform: translateX(-50%);
	transition:
		opacity 0.55s cubic-bezier(0.4, 0, 0.2, 1),
		transform 0.55s cubic-bezier(0.4, 0, 0.2, 1),
		visibility 0s linear 0.55s;
}

.hero-home__scroll--hidden {
	opacity: 0;
	pointer-events: none;
	transform: translateX(-50%) translateY(12px) scale(0.92);
	visibility: hidden;
}

.hero-home__scroll:not(.hero-home__scroll--hidden):hover,
.hero-home__scroll:not(.hero-home__scroll--hidden):focus-visible {
	opacity: 1;
}

.hero-home__scroll:focus-visible {
	outline: 2px solid var(--alw-white);
	outline-offset: 4px;
	border-radius: 999px;
}

.hero-home__scroll-mouse {
	display: flex;
	width: 3px;
	height: 35px;
	align-items: flex-start;
	justify-content: center;
	padding: 10px 15px;
	border: 2px solid currentColor;
	border-radius: 25px;
	opacity: 0.75;
	box-sizing: content-box;
}

.hero-home__scroll-wheel {
	display: block;
	width: 3px;
	height: 10px;
	border-radius: 25%;
	background-color: currentColor;
	animation: alw-hero-scroll-wheel 2.2s cubic-bezier(0.15, 0.41, 0.69, 0.94) infinite;
}

@media (min-width: 768px) {
	.hero-home__scroll {
		bottom: 68px;
	}
}

@media (prefers-reduced-motion: reduce) {
	.hero-home__scroll {
		transition: opacity 0.35s ease, visibility 0s linear 0.35s;
	}

	.hero-home__scroll--hidden {
		transform: translateX(-50%);
	}

	.hero-home__scroll-wheel {
		animation: none;
		opacity: 1;
	}
}
