/**
 * ScrollEffects runtime CSS (static, plain CSS by design; the webpack module
 * build copies it verbatim to build/behaviors/scrolleffects/style.css).
 *
 * House rule: every structural rule is :where()-wrapped (zero specificity)
 * so per-instance engine rules (0,1,0) always win. The reveal HIDDEN state
 * only ever hangs off `.lumitra-reveal-pending`, a class added by HYDRATION
 * (view.ts), never by the server: with JavaScript disabled nothing is hidden
 * (behaviors spec 8.2 "content must never REQUIRE scroll effects").
 *
 * Reduced motion (spec 2.3): 1ms transitions (not 0) so transitionend-based
 * state machines elsewhere never hang; parallax transforms are additionally
 * force-cleared as defense in depth (the view module already stops writing
 * them).
 */

/* ---------------------------------------------------------------------------
 * Sticky ("else contract" path for blocks WITHOUT core position support;
 * blocks with core position.sticky use the core Position panel instead).
 * ------------------------------------------------------------------------ */

:where(.lumitra-scroll-sticky) {
	position: sticky;
	top: var(--lumitra-sticky-top, 0px);
}

/* ---------------------------------------------------------------------------
 * Reveal: hidden state = .lumitra-reveal-pending:not(.is-inview).
 * Un-staggered reveals animate the root; staggered reveals animate the
 * DIRECT children with a per-child delay from the server-stamped
 * --lumitra-stagger-i index and the root's --lumitra-stagger-ms.
 * ------------------------------------------------------------------------ */

:where(.lumitra-reveal-pending:not(.lumitra-reveal-stagger)) {
	transition:
		opacity var(--lumitra-dur-slow, 400ms) var(--lumitra-ease, cubic-bezier(0.4, 0, 0.2, 1)),
		transform var(--lumitra-dur-slow, 400ms) var(--lumitra-ease, cubic-bezier(0.4, 0, 0.2, 1));
}

:where(.lumitra-reveal-pending:not(.is-inview):not(.lumitra-reveal-stagger)) {
	opacity: 0;
}

:where(.lumitra-reveal-pending.lumitra-reveal-slide-up:not(.is-inview):not(.lumitra-reveal-stagger)) {
	transform: translateY(24px);
}

:where(.lumitra-reveal-pending.lumitra-reveal-slide-down:not(.is-inview):not(.lumitra-reveal-stagger)) {
	transform: translateY(-24px);
}

:where(.lumitra-reveal-pending.lumitra-reveal-scale:not(.is-inview):not(.lumitra-reveal-stagger)) {
	transform: scale(0.94);
}

/* Staggered variant: children carry the hidden state and the delay. */

:where(.lumitra-reveal-pending.lumitra-reveal-stagger) > * {
	transition:
		opacity var(--lumitra-dur-slow, 400ms) var(--lumitra-ease, cubic-bezier(0.4, 0, 0.2, 1)),
		transform var(--lumitra-dur-slow, 400ms) var(--lumitra-ease, cubic-bezier(0.4, 0, 0.2, 1));
	transition-delay: calc(var(--lumitra-stagger-i, 0) * var(--lumitra-stagger-ms, 80ms));
}

:where(.lumitra-reveal-pending.lumitra-reveal-stagger:not(.is-inview)) > * {
	opacity: 0;
}

:where(.lumitra-reveal-pending.lumitra-reveal-stagger.lumitra-reveal-slide-up:not(.is-inview)) > * {
	transform: translateY(24px);
}

:where(.lumitra-reveal-pending.lumitra-reveal-stagger.lumitra-reveal-slide-down:not(.is-inview)) > * {
	transform: translateY(-24px);
}

:where(.lumitra-reveal-pending.lumitra-reveal-stagger.lumitra-reveal-scale:not(.is-inview)) > * {
	transform: scale(0.94);
}

/* ---------------------------------------------------------------------------
 * Parallax: compositor hint only while the manager is live (hydrated).
 * ------------------------------------------------------------------------ */

:where(.lumitra-parallax.lumitra-hydrated) {
	will-change: transform;
}

/* ---------------------------------------------------------------------------
 * Reduced motion (spec 2.3): 1ms + zero delay; parallax force-neutral.
 * The !important on transform is an accessibility guard mirroring the shared
 * behaviors CSS convention, not a styling shortcut.
 * ------------------------------------------------------------------------ */

@media (prefers-reduced-motion: reduce) {
	:where(.lumitra-reveal-pending),
	:where(.lumitra-reveal-pending.lumitra-reveal-stagger) > * {
		transition-duration: 1ms !important;
		transition-delay: 0ms !important;
	}

	:where(.lumitra-parallax) {
		transform: none !important;
	}
}
