/*
 * Ranama front-page welcome screen.
 * The inline display fallback keeps this layer hidden unless JavaScript adds
 * the activation class. The page beneath is never hidden by this component.
 */

.ranama-welcome {
	display: none;
}

html.ranama-welcome-ready .ranama-welcome {
	display: grid !important;
	position: fixed;
	z-index: 2147483000;
	inset: 0;
	overflow: hidden;
	place-items: center;
	min-width: 100%;
	min-height: 100%;
	pointer-events: none;
	color: #ffffff;
	background:
		radial-gradient(circle at 72% 18%, rgba(64, 109, 90, 0.62) 0, rgba(64, 109, 90, 0) 34%),
		linear-gradient(128deg, #223f99 0%, #2b3e5b 68%, #406d5a 135%);
	isolation: isolate;
	animation: ranama-welcome-field 2200ms cubic-bezier(0.76, 0, 0.24, 1) both;
}

.ranama-welcome__surface {
	position: absolute;
	inset: 0;
	overflow: hidden;
}

.ranama-welcome__surface::before {
	position: absolute;
	inset: 0;
	background-image:
		linear-gradient(rgba(237, 241, 244, 0.055) 1px, transparent 1px),
		linear-gradient(90deg, rgba(237, 241, 244, 0.055) 1px, transparent 1px);
	background-position: center;
	background-size: clamp(42px, 5.5vw, 78px) clamp(42px, 5.5vw, 78px);
	content: "";
	mask-image: linear-gradient(to bottom, transparent 0%, #000000 24%, #000000 76%, transparent 100%);
	opacity: 0;
	animation: ranama-welcome-grid 2200ms ease-out both;
}

.ranama-welcome__surface::after {
	position: absolute;
	inset: -25% -10%;
	background: linear-gradient(
		100deg,
		rgba(34, 63, 153, 0) 34%,
		rgba(237, 241, 244, 0.075) 50%,
		rgba(34, 63, 153, 0) 66%
	);
	content: "";
	transform: translate3d(-70%, 0, 0);
	animation: ranama-welcome-scan 2200ms cubic-bezier(0.45, 0, 0.2, 1) both;
}

.ranama-welcome__frame {
	position: absolute;
	inset:
		max(24px, env(safe-area-inset-top))
		max(24px, env(safe-area-inset-right))
		max(24px, env(safe-area-inset-bottom))
		max(24px, env(safe-area-inset-left));
	border: 1px solid rgba(237, 241, 244, 0.22);
	box-shadow: inset 0 0 0 1px rgba(34, 63, 153, 0.12);
	opacity: 0;
	transform: scale(0.988);
	animation: ranama-welcome-frame 2200ms cubic-bezier(0.22, 1, 0.36, 1) both;
}

.ranama-welcome__axis {
	position: absolute;
	top: 0;
	left: 50%;
	width: 1px;
	height: 100%;
	background: rgba(237, 241, 244, 0.15);
	transform: scaleY(0);
	transform-origin: center;
	animation: ranama-welcome-axis 2200ms cubic-bezier(0.65, 0, 0.35, 1) both;
}

.ranama-welcome__stage {
	position: absolute;
	top: 50%;
	left: 50%;
	display: grid;
	width: min(68vw, 680px);
	justify-items: center;
	transform: translate3d(-50%, -50%, 0);
}

.ranama-welcome__eyebrow,
.ranama-welcome__reference {
	font-family: "Noto Sans Mono", ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
	font-size: 0.675rem;
	font-weight: 500;
	line-height: 1;
	letter-spacing: 0.3em;
	text-transform: uppercase;
}

.ranama-welcome__eyebrow {
	margin: 0 0 clamp(22px, 3.2vw, 38px);
	color: #edf1f4;
	opacity: 0;
	transform: translateY(8px);
	animation: ranama-welcome-eyebrow 2200ms cubic-bezier(0.22, 1, 0.36, 1) both;
}

.ranama-welcome__mark-mask {
	width: 100%;
	overflow: hidden;
	clip-path: inset(0 100% 0 0);
	animation: ranama-welcome-mark-mask 2200ms cubic-bezier(0.65, 0, 0.35, 1) both;
}

.ranama-welcome__mark {
	display: grid;
	width: 100%;
	place-items: center;
	opacity: 0;
	transform: translate3d(-3.5%, 0, 0) scale(0.985);
	animation: ranama-welcome-mark 2200ms cubic-bezier(0.22, 1, 0.36, 1) both;
}

.ranama-welcome__mark img {
	display: block;
	width: 100%;
	height: auto;
	margin: 0;
}

.ranama-welcome__wordmark {
	font-family: "Archivo", "Arial Narrow", Arial, sans-serif;
	font-size: clamp(3rem, 10vw, 7.5rem);
	font-weight: 700;
	line-height: 0.9;
	letter-spacing: 0.08em;
	text-transform: uppercase;
}

.ranama-welcome__datum {
	position: relative;
	display: block;
	width: min(48vw, 480px);
	height: 1px;
	margin-top: clamp(24px, 3.8vw, 44px);
	background: rgba(237, 241, 244, 0.34);
	transform: scaleX(0);
	transform-origin: left center;
	animation: ranama-welcome-datum 2200ms cubic-bezier(0.65, 0, 0.35, 1) both;
}

.ranama-welcome__datum::after {
	position: absolute;
	top: 50%;
	left: 0;
	width: clamp(28px, 4vw, 54px);
	height: 3px;
	background: #d99a2b;
	box-shadow: 0 0 18px rgba(217, 154, 43, 0.55);
	content: "";
	transform: translate3d(-100%, -50%, 0);
	animation: ranama-welcome-datum-trace 2200ms cubic-bezier(0.45, 0, 0.2, 1) both;
}

.ranama-welcome__reference {
	position: absolute;
	bottom: max(38px, calc(env(safe-area-inset-bottom) + 14px));
	color: rgba(237, 241, 244, 0.62);
	opacity: 0;
	animation: ranama-welcome-reference 2200ms ease-out both;
}

.ranama-welcome__reference--brand {
	left: max(40px, calc(env(safe-area-inset-left) + 16px));
}

.ranama-welcome__reference--state {
	right: max(40px, calc(env(safe-area-inset-right) + 16px));
}

@keyframes ranama-welcome-field {
	0%, 76% {
		visibility: visible;
		opacity: 1;
		clip-path: inset(0 0 0 0);
	}

	100% {
		visibility: hidden;
		opacity: 1;
		clip-path: inset(0 0 100% 0);
	}
}

@keyframes ranama-welcome-grid {
	0%, 8% {
		opacity: 0;
	}

	28%, 70% {
		opacity: 1;
	}

	82%, 100% {
		opacity: 0;
	}
}

@keyframes ranama-welcome-scan {
	0%, 16% {
		transform: translate3d(-70%, 0, 0);
	}

	66%, 100% {
		transform: translate3d(70%, 0, 0);
	}
}

@keyframes ranama-welcome-frame {
	0%, 7% {
		opacity: 0;
		transform: scale(0.988);
	}

	25%, 70% {
		opacity: 1;
		transform: scale(1);
	}

	81%, 100% {
		opacity: 0;
		transform: scale(1.006);
	}
}

@keyframes ranama-welcome-axis {
	0%, 5% {
		opacity: 0;
		transform: scaleY(0);
	}

	27%, 67% {
		opacity: 1;
		transform: scaleY(1);
	}

	78%, 100% {
		opacity: 0;
		transform: scaleY(1);
	}
}

@keyframes ranama-welcome-eyebrow {
	0%, 12% {
		opacity: 0;
		transform: translateY(8px);
	}

	27%, 65% {
		opacity: 1;
		transform: translateY(0);
	}

	76%, 100% {
		opacity: 0;
		transform: translateY(-5px);
	}
}

@keyframes ranama-welcome-mark-mask {
	0%, 14% {
		clip-path: inset(0 100% 0 0);
	}

	43%, 100% {
		clip-path: inset(0 0 0 0);
	}
}

@keyframes ranama-welcome-mark {
	0%, 14% {
		opacity: 0;
		transform: translate3d(-3.5%, 0, 0) scale(0.985);
	}

	36%, 68% {
		opacity: 1;
		transform: translate3d(0, 0, 0) scale(1);
	}

	78%, 100% {
		opacity: 0;
		transform: translate3d(0, -7px, 0) scale(1.008);
	}
}

@keyframes ranama-welcome-datum {
	0%, 20% {
		opacity: 0;
		transform: scaleX(0);
	}

	46%, 69% {
		opacity: 1;
		transform: scaleX(1);
	}

	78%, 100% {
		opacity: 0;
		transform: scaleX(1);
	}
}

@keyframes ranama-welcome-datum-trace {
	0%, 20% {
		opacity: 0;
		left: 0;
	}

	27% {
		opacity: 1;
	}

	52% {
		opacity: 1;
		left: 100%;
	}

	60%, 100% {
		opacity: 0;
		left: 100%;
	}
}

@keyframes ranama-welcome-reference {
	0%, 24% {
		opacity: 0;
	}

	42%, 68% {
		opacity: 1;
	}

	78%, 100% {
		opacity: 0;
	}
}

@media (max-width: 640px) {
	.ranama-welcome__surface::before {
		background-size: 38px 38px;
	}

	.ranama-welcome__frame {
		inset:
			max(14px, env(safe-area-inset-top))
			max(14px, env(safe-area-inset-right))
			max(14px, env(safe-area-inset-bottom))
			max(14px, env(safe-area-inset-left));
	}

	.ranama-welcome__axis {
		left: max(28px, calc(env(safe-area-inset-left) + 14px));
	}

	.ranama-welcome__stage {
		width: min(78vw, 31rem);
	}

	.ranama-welcome__eyebrow {
		margin-bottom: 24px;
		font-size: 0.625rem;
		letter-spacing: 0.26em;
	}

	.ranama-welcome__datum {
		width: 54vw;
		margin-top: 26px;
	}

	.ranama-welcome__reference {
		bottom: max(27px, calc(env(safe-area-inset-bottom) + 13px));
		font-size: 0.575rem;
		letter-spacing: 0.24em;
	}

	.ranama-welcome__reference--brand {
		left: 50%;
		transform: translateX(-50%);
	}

	.ranama-welcome__reference--state {
		display: none;
	}
}

@media (max-height: 480px) and (orientation: landscape) {
	.ranama-welcome__stage {
		width: min(56vw, 34rem);
	}

	.ranama-welcome__eyebrow {
		margin-bottom: 14px;
	}

	.ranama-welcome__datum {
		margin-top: 16px;
	}

	.ranama-welcome__reference {
		display: none;
	}
}

@media (prefers-reduced-motion: reduce) {
	html.ranama-welcome-ready .ranama-welcome {
		animation: ranama-welcome-reduced 180ms ease-out both;
	}

	.ranama-welcome__surface::before,
	.ranama-welcome__surface::after,
	.ranama-welcome__frame,
	.ranama-welcome__axis,
	.ranama-welcome__eyebrow,
	.ranama-welcome__mark-mask,
	.ranama-welcome__mark,
	.ranama-welcome__datum,
	.ranama-welcome__datum::after,
	.ranama-welcome__reference {
		animation: none;
	}

	.ranama-welcome__surface::before,
	.ranama-welcome__surface::after,
	.ranama-welcome__axis,
	.ranama-welcome__reference,
	.ranama-welcome__datum::after {
		display: none;
	}

	.ranama-welcome__frame,
	.ranama-welcome__eyebrow,
	.ranama-welcome__mark,
	.ranama-welcome__datum {
		opacity: 1;
		transform: none;
	}

	.ranama-welcome__mark-mask {
		clip-path: none;
	}
}

@keyframes ranama-welcome-reduced {
	0%, 42% {
		visibility: visible;
		opacity: 1;
	}

	100% {
		visibility: hidden;
		opacity: 0;
	}
}
