/*
**
**
**
**
**
** Pointer
** =================================
**
** The assistant pointing at something on the page (TL.Pointer, scripts/pointer.js). A soft
** glow in his colors rings the thing, and a note in a small glass bubble can sit beside it. Both
** are placed over the app's frame from the shell, and follow it as it scrolls. He floats over
** beside it from the nav (navigation.css, .nav-mascot[data-visiting]).
*/

#TL-Pointer-Glow,
#TL-Pointer-Note {
	position: fixed;
	top: 0;
	left: 0;
	z-index: 45;
}
#TL-Pointer-Glow[hidden],
#TL-Pointer-Note[hidden] {
	display: none;
}

/* The glow: a ring a little outside the thing, and color breathing softly around it */
#TL-Pointer-Glow {
	pointer-events: none;
	animation: TL-Pointer-In 420ms cubic-bezier(0.42, 0.12, 0, 1.38) backwards;
	transition: opacity 260ms ease;
}
#TL-Pointer-Glow::before {
	content: "";
	position: absolute;
	inset: -6px;
	border-radius: 14px;
	box-shadow:
		0 0 0 2px rgba(115, 80, 255, 0.55),
		0 0 0 6px rgba(115, 80, 255, 0.12),
		-12px -8px 32px -10px rgba(10, 132, 255, 0.45),
		12px 10px 34px -10px rgba(224, 79, 214, 0.4);
	animation: TL-Pointer-Breathe 1600ms ease-in-out infinite alternate;
}
#TL-Pointer-Glow[data-leave] {
	opacity: 0;
}

/* The note: a few words in a small glass bubble, gone when tapped */
#TL-Pointer-Note {
	display: flex;
	align-items: center;
	gap: 8px;
	max-width: 240px;
	padding: 8px 14px 8px 8px;
	background-color: rgba(255, 255, 255, 0.92);
	border: none;
	border-radius: 18px;
	box-shadow:
		0 12px 30px -14px rgba(40, 30, 90, 0.4),
		0 2px 6px rgba(20, 20, 22, 0.08),
		inset 0 0 0 1px rgba(255, 255, 255, 0.7);
	-webkit-backdrop-filter: blur(16px) saturate(1.4);
	backdrop-filter: blur(16px) saturate(1.4);
	font-family: inherit;
	font-size: 13px;
	font-weight: 600;
	line-height: 1.3;
	text-align: left;
	color: #1d1d1f;
	cursor: pointer;
	animation: TL-Pointer-Note-In 460ms cubic-bezier(0.42, 0.12, 0, 1.38) 160ms backwards;
	transition: opacity 260ms ease;
}
#TL-Pointer-Note[data-leave] {
	opacity: 0;
}
#TL-Pointer-Note > .orb {
	flex-shrink: 0;
	width: 18px;
	height: 18px;
	border-radius: 50%;
	background:
		radial-gradient(circle at 34% 28%, rgba(255, 255, 255, 0.95), rgba(255, 255, 255, 0) 38%),
		radial-gradient(circle at 70% 78%, rgba(255, 143, 208, 0.55), rgba(255, 143, 208, 0) 60%),
		radial-gradient(circle at 50% 50%, rgba(169, 147, 255, 0.5), rgba(169, 147, 255, 0.22) 70%);
	box-shadow: 0 4px 10px -4px rgba(120, 90, 220, 0.55);
}

@keyframes TL-Pointer-In {
	from {
		opacity: 0;
	}
}
@keyframes TL-Pointer-Breathe {
	to {
		box-shadow:
			0 0 0 2px rgba(115, 80, 255, 0.7),
			0 0 0 9px rgba(115, 80, 255, 0.08),
			-14px -10px 38px -10px rgba(10, 132, 255, 0.5),
			14px 12px 40px -10px rgba(224, 79, 214, 0.45);
	}
}
@keyframes TL-Pointer-Note-In {
	from {
		opacity: 0;
		scale: 0.8;
	}
}

/* Dark, with the rest of the system */
body[data-theme="dark"] #TL-Pointer-Note {
	background-color: rgba(44, 44, 48, 0.9);
	color: #f5f5f7;
	box-shadow:
		0 12px 30px -14px rgba(0, 0, 0, 0.6),
		inset 0 0 0 1px rgba(255, 255, 255, 0.08);
}

/* Less motion: it only fades in and out, and doesn't breathe */
@media (prefers-reduced-motion: reduce) {
	#TL-Pointer-Glow::before {
		animation: none;
	}
	#TL-Pointer-Note {
		animation-name: TL-Pointer-In;
	}
}
