/**
 * Nocturne Call To Action - scoped styles.
 */

.np-cta {
	--np-cta-bg: var(--np-token-panel, #19191e);
	--np-cta-ink: var(--np-token-ink, #f6f3ee);
	--np-cta-muted: var(--np-token-muted, #b3aec0);
	--np-cta-accent: var(--np-token-accent, #bd793b);
	--np-cta-accent-strong: var(--np-token-accent-strong, var(--np-cta-accent));
	--np-cta-line: var(--np-token-line, color-mix(in srgb, var(--np-cta-ink) 14%, transparent));
	--np-cta-alpha: 1;
	--np-cta-size-desktop: 300px;
	--np-cta-size-mobile: 270px;
	--np-cta-offset-x: 18px;
	--np-cta-offset-y: 18px;
	--np-cta-display: var(--np-token-font-display, "Akira Expanded", "Archivo Black", "Arial Black", system-ui, sans-serif);
	--np-cta-body: var(--np-token-font-body, "Avenir", "Avenir Next", "Segoe UI", system-ui, -apple-system, sans-serif);

	position: fixed;
	z-index: 9998;
	width: min(var(--np-cta-size-desktop, 300px), calc(100vw - 24px));
	container-type: inline-size;
	color: var(--np-cta-ink);
	font-family: var(--np-cta-body);
	font-size: var(--np-token-base-size, 16px);
	opacity: 0;
	visibility: hidden;
	transform: translateY(18px) scale(0.98);
	transition:
		opacity calc(var(--np-token-motion-duration, 0.45s) * 0.78) ease,
		transform var(--np-token-motion-duration, 0.45s) var(--np-token-motion-ease, cubic-bezier(0.22, 1, 0.36, 1)),
		visibility 0s linear var(--np-token-motion-duration, 0.45s);
}

.np-cta.is-visible {
	opacity: 1;
	visibility: visible;
	transform: translateY(0) scale(1);
	transition:
		opacity 0.35s ease,
		transform 0.55s cubic-bezier(0.22, 1, 0.36, 1),
		visibility 0s;
}

.np-cta--bottom-right {
	right: max(var(--np-cta-offset-x, 18px), env(safe-area-inset-right));
	bottom: max(var(--np-cta-offset-y, 18px), env(safe-area-inset-bottom));
}

.np-cta--bottom-left {
	left: max(var(--np-cta-offset-x, 18px), env(safe-area-inset-left));
	bottom: max(var(--np-cta-offset-y, 18px), env(safe-area-inset-bottom));
}

.np-cta--top-right {
	right: max(var(--np-cta-offset-x, 18px), env(safe-area-inset-right));
	top: max(var(--np-cta-offset-y, 18px), env(safe-area-inset-top));
}

.np-cta--top-left {
	left: max(var(--np-cta-offset-x, 18px), env(safe-area-inset-left));
	top: max(var(--np-cta-offset-y, 18px), env(safe-area-inset-top));
}

.np-cta--shape-rounded .np-cta__link {
	border-radius: calc(var(--np-token-radius, 4px) + 6px);
}

.np-cta--shape-sharp .np-cta__link {
	border-radius: 0;
}

.np-cta--shape-circle {
	width: min(var(--np-cta-size-desktop, 190px), calc(100vw - 24px));
}

.np-cta--shape-circle .np-cta__link {
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	width: 100%;
	height: auto;
	aspect-ratio: 1;
	padding: 22px 18px;
	border: 1px solid color-mix(in srgb, var(--np-cta-accent) 55%, transparent);
	border-radius: 50%;
	text-align: center;
}

.np-cta--shape-circle .np-cta__logo {
	width: 100px;
	margin: 0 auto 9px;
}

.np-cta--shape-circle .np-cta__body {
	display: flex;
	flex-direction: column;
	align-items: center;
}

.np-cta--shape-circle .np-cta__title {
	justify-content: center;
	font-size: 0.9rem;
}

.np-cta--shape-circle .np-cta__text {
	max-width: 130px;
	font-size: 0.68rem;
	text-align: center;
}

.np-cta--shape-circle .np-cta__close {
	top: 8px;
	right: 8px;
}

.np-cta__link {
	position: relative;
	display: block;
	/* Reserve the top-right corner for the close button and its 44px hit area. */
	padding: 16px 42px 16px 18px;
	border: 1px solid var(--np-cta-line);
	border-top: 2px solid var(--np-cta-accent);
	border-radius: calc(var(--np-token-radius, 4px) + 6px);
	background: var(--np-cta-bg);
	background: color-mix(in srgb, var(--np-cta-bg) calc(var(--np-cta-alpha, 1) * 100%), transparent);
	box-shadow: 0 18px 44px rgba(0, 0, 0, 0.38);
	color: var(--np-cta-ink);
	text-decoration: none;
	transition:
		transform 0.2s ease,
		border-color 0.2s ease,
		box-shadow 0.2s ease;
}

.np-cta__logo {
	opacity: 0;
	transform: translateY(10px);
	transition:
		opacity 0.4s ease,
		transform 0.5s cubic-bezier(0.22, 1, 0.36, 1);
}

.np-cta__body {
	opacity: 0;
	transform: translateY(12px);
	transition:
		opacity 0.4s ease 0.12s,
		transform 0.5s cubic-bezier(0.22, 1, 0.36, 1) 0.12s;
}

.np-cta.is-visible .np-cta__logo,
.np-cta.is-visible .np-cta__body {
	opacity: 1;
	transform: translateY(0);
}

.np-cta.is-visible .np-cta__logo {
	opacity: var(--np-cta-logo-opacity, 1);
}

.np-cta:not(.is-visible) .np-cta__logo,
.np-cta:not(.is-visible) .np-cta__body {
	transition-delay: 0s;
	transition-duration: 0.2s;
}

.np-cta__body {
	display: block;
	min-width: 0;
}

.np-cta__link:hover {
	transform: translateY(-2px);
	border-color: color-mix(in srgb, var(--np-cta-accent) 55%, transparent);
	box-shadow: 0 22px 50px rgba(0, 0, 0, 0.45);
}

.np-cta__logo {
	display: block;
	width: var(--np-cta-logo-width, 150px);
	max-width: 100%;
	height: auto;
	max-height: 60px;
	margin-bottom: 12px;
	object-fit: contain;
}

.np-cta__title {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 8px;
	color: var(--np-cta-ink);
	font-family: var(--np-cta-display);
	font-size: 1.02rem;
	font-weight: 400;
	letter-spacing: 0.03em;
	line-height: 1.1;
	text-transform: uppercase;
}

.np-cta__title-text {
	min-width: 0;
}

.np-cta__icon {
	display: inline-flex;
	flex: 0 0 24px;
	align-items: center;
	justify-content: center;
	width: 24px;
	height: 24px;
	border-radius: 50%;
	background: var(--np-cta-accent);
	color: #19191e;
	line-height: 1;
	transition: transform 0.2s ease, background-color 0.2s ease;
}

.np-cta__icon svg {
	display: block;
	width: 14px;
	height: 14px;
}

.np-cta__icon--standalone {
	margin-bottom: 6px;
}

.np-cta__link:hover .np-cta__icon {
	background: var(--np-cta-accent-strong);
	transform: translate(2px, -2px);
}

.np-cta__text {
	display: block;
	margin-top: 5px;
	color: var(--np-cta-muted);
	font-size: 0.78rem;
	font-weight: 300;
	line-height: 1.5;
}

.np-cta--title-size-sm .np-cta__title {
	font-size: 0.87rem;
}

.np-cta--title-size-md .np-cta__title {
	font-size: 1.02rem;
}

.np-cta--title-size-lg .np-cta__title {
	font-size: 1.17rem;
}

.np-cta--title-size-xl .np-cta__title {
	font-size: 1.33rem;
}

.np-cta--text-size-sm .np-cta__text {
	font-size: 0.66rem;
}

.np-cta--text-size-md .np-cta__text {
	font-size: 0.78rem;
}

.np-cta--text-size-lg .np-cta__text {
	font-size: 0.9rem;
}

.np-cta--text-size-xl .np-cta__text {
	font-size: 1.01rem;
}

.np-cta--align-left .np-cta__body {
	text-align: left;
}

.np-cta--align-center .np-cta__body {
	text-align: center;
}

.np-cta--align-right .np-cta__body {
	text-align: right;
}

.np-cta--align-left .np-cta__title {
	justify-content: space-between;
}

.np-cta--align-center .np-cta__title {
	justify-content: center;
}

.np-cta--align-right .np-cta__title {
	justify-content: flex-end;
}

.np-cta--align-left .np-cta__logo {
	margin-left: 0;
	margin-right: 0;
}

.np-cta--align-center .np-cta__logo {
	margin-left: auto;
	margin-right: auto;
}

.np-cta--align-right .np-cta__logo {
	margin-left: auto;
	margin-right: 0;
}

.np-cta--shape-circle.np-cta--align-left .np-cta__body {
	align-items: flex-start;
}

.np-cta--shape-circle.np-cta--align-center .np-cta__body {
	align-items: center;
}

.np-cta--shape-circle.np-cta--align-right .np-cta__body {
	align-items: flex-end;
}

.np-cta .np-cta__close {
	position: absolute;
	top: 5px;
	right: 5px;
	z-index: 2;
	display: grid;
	width: 28px;
	height: 28px;
	padding: 0;
	place-items: center;
	border: 0 !important;
	border-radius: 50% !important;
	background: transparent !important;
	box-shadow: none !important;
	color: var(--np-cta-muted) !important;
	font-family: system-ui, sans-serif;
	font-size: 18px;
	line-height: 1;
	cursor: pointer;
	touch-action: manipulation;
	opacity: 0;
	transition:
		color 0.2s ease,
		background-color 0.2s ease,
		opacity 0.25s ease 0.2s;
}

.np-cta .np-cta__close::before {
	content: "";
	position: absolute;
	inset: -8px;
	border-radius: 50%;
}

.np-cta.is-visible .np-cta__close {
	opacity: 1;
}

.np-cta:not(.is-visible) .np-cta__close {
	transition:
		color 0.2s ease,
		background-color 0.2s ease,
		opacity 0.15s ease;
}

.np-cta .np-cta__close:hover {
	background: color-mix(in srgb, var(--np-cta-accent) 16%, transparent) !important;
	color: var(--np-cta-accent) !important;
}

.np-cta .np-cta__link:focus-visible,
.np-cta .np-cta__close:focus-visible {
	outline: 2px solid var(--np-cta-accent) !important;
	outline-offset: 3px !important;
}

@media (max-width: 640px) {
	.np-cta {
		width: min(var(--np-cta-size-mobile, 270px), calc(100vw - 24px));
	}

	.np-cta--shape-circle {
		width: min(var(--np-cta-size-mobile, 170px), calc(100vw - 24px));
	}

	.np-cta:not(.np-cta--shape-circle) .np-cta__link {
		display: block;
		padding: 14px 42px 14px 14px;
	}

	.np-cta:not(.np-cta--shape-circle) .np-cta__logo {
		width: 140px;
		max-height: 40px;
		margin: 0 0 8px;
	}

	.np-cta:not(.np-cta--shape-circle) .np-cta__body {
		display: block;
	}

	.np-cta__title {
		gap: 6px;
		font-size: 0.9rem;
	}

	.np-cta__text {
		margin-top: 2px;
		font-size: 0.7rem;
	}

	.np-cta .np-cta__close {
		top: 4px;
		right: 4px;
	}

	.np-cta--shape-circle .np-cta__link {
		width: 100%;
		height: auto;
		aspect-ratio: 1;
		padding: 18px 14px;
	}

	.np-cta--shape-circle .np-cta__text {
		max-width: 120px;
	}
}

@container (max-width: 240px) {
	.np-cta:not(.np-cta--shape-circle) .np-cta__link {
		display: block;
		padding: 12px 42px 12px 14px;
	}

	.np-cta:not(.np-cta--shape-circle) .np-cta__logo {
		width: 100px;
		max-height: 30px;
		margin: 0 0 8px;
	}

	.np-cta:not(.np-cta--shape-circle) .np-cta__body {
		display: block;
	}
}

@media (prefers-reduced-motion: reduce) {
	.np-cta,
	.np-cta__link,
	.np-cta__icon,
	.np-cta__logo,
	.np-cta__body,
	.np-cta__close {
		transition: none !important;
	}
}

@media print {
	.np-cta {
		display: none !important;
	}
}

/* Global motion tokens */
.np-cta__link,
.np-cta__logo,
.np-cta__body,
.np-cta .np-cta__icon {
	transition-duration: var(--np-token-motion-duration, 0.2s);
	transition-timing-function: var(--np-token-motion-ease, ease);
}

