/* ============================================
   SITE MOTION — shared interaction feedback
   --------------------------------------------
   Small shared motion primitives. The rules here today are touch
   press feedback and reduced-motion guards.

   Markup hook: add .site-pressable to a card/link element — every
   consumer today is an <article> card or an <a> tile, so the
   selector is :is(article, a).site-pressable. Specificity is the
   reason for the element in :is(): (0,2,1) outranks the page-level
   .card:active (0,2,0) and the homepage's .photo-fade.photo-visible
   (0,2,0) even though the page sheets load after this one — a bare
   .site-pressable:active would tie (0,2,0) and lose the cascade.
   ============================================ */

/* Coarse pointers get no hover lift, so a gentle inward scale while
   pressed gives tappable cards a physical response instead. The
   :hover rules themselves are gated to (hover: hover) in the page
   sheets, so nothing sticky conflicts with this. */
@media (hover: none), (pointer: coarse) {
	:is(article, a).site-pressable:active {
		transform: scale(0.985);
		transition: transform 120ms ease-out;
	}
}

/* Native cross-document page transitions — a quiet root crossfade
   between navigations. Opt-in only for users without a reduced-motion
   preference; browsers that do not support @view-transition simply
   ignore it and navigate normally. No JS interception, no named
   elements — header/footer crossfade with the root. */
@media (prefers-reduced-motion: no-preference) {
	@view-transition {
		navigation: auto;
	}
}

@keyframes site-page-leave {
	from {
		opacity: 1;
	}
	to {
		opacity: 0;
	}
}

@keyframes site-page-enter {
	from {
		opacity: 0;
	}
	to {
		opacity: 1;
	}
}

::view-transition-old(root) {
	mix-blend-mode: normal;
	animation: site-page-leave 120ms ease-out both;
}

::view-transition-new(root) {
	mix-blend-mode: normal;
	animation: site-page-enter 180ms ease-out both;
}

@media (prefers-reduced-motion: reduce) {
	/* Explicitly opt out of navigation transitions too — the
	   declaration above never matches for these users, but belt and
	   suspenders in case a UA enables it by default. */
	@view-transition {
		navigation: none;
	}

	::view-transition-group(*) {
		animation: none;
	}

	/* No press scale at all for reduced-motion users. */
	:is(article, a).site-pressable:active {
		transform: none;
		transition: none;
	}

	/* The desktop hover lift/zoom is not otherwise reduced — suppress
	   it here too so motion-sensitive users get a static page. */
	:is(article, a).site-pressable:hover {
		transform: none;
		transition: none;
	}

	:is(article, a).site-pressable img {
		transform: none;
		transition: none;
	}
}
