/* =============================================================================
   SCROLL REVEAL — site-wide section fade-in for assets/js/reveal.js

   Nothing here hides anything on its own. reveal.js marks a target
   [data-reveal-pending] only when it starts BELOW the first viewport, so:

     - the hero and anything else above the fold is never touched, and the LCP
       element is never painted at opacity 0 (hiding it would delay LCP to the
       moment the fade finishes)
     - anything that does get hidden is off-screen at the time, so there is no
       flash to see, and no inline head script is needed to prevent one
     - with JS off, no attribute is ever set and everything renders normally

   Duration: this effect is NOT in the Figma file - get_motion_context returns
   zero keyframe animations for it - so --dur-base (300ms) has no authority
   here and reads as a flinch on a scroll reveal. Declared locally rather than
   in the token files, because it is a build decision, not a design value.
   ============================================================================= */

:root {
	--dur-reveal: 940ms;
	--reveal-shift: 28px;

	/* Per-item stagger. Items entering together are released one after another
	   at this interval; reveal.js caps how far the tail can run so a 32-card
	   grid does not finish arriving several seconds after it came into view. */
	--reveal-step: 110ms;
	--reveal-item-shift: 18px;
}

[data-reveal-pending] {
	opacity: 0;
	/* Compositor-only properties. Never animate height/margin here: a section
	   that changes box size on reveal moves everything below it and turns a
	   decorative effect into cumulative layout shift. */
	transform: translate3d(0, var(--reveal-shift), 0);
}

/* Cards and accordion rows travel a shorter distance than a whole section -
   at full section throw a grid reads as sliding rather than settling. */
[data-reveal-item][data-reveal-pending] {
	transform: translate3d(0, var(--reveal-item-shift), 0);
}

[data-reveal-pending],
[data-revealed] {
	transition:
		opacity var(--dur-reveal) ease-out,
		transform var(--dur-reveal) ease-out;
}

[data-revealed] {
	opacity: 1;
	transform: none;
}

/* Reduced motion: reveal.js bails before marking anything, so this is only a
   backstop for a section already marked when the preference changes mid-visit. */
@media (prefers-reduced-motion: reduce) {
	[data-reveal-pending],
	[data-revealed] {
		opacity: 1;
		transform: none;
		transition: none;
		transition-delay: 0s;
	}
}

/* A print job should never lose a section that had not scrolled into view. */
@media print {
	[data-reveal-pending] {
		opacity: 1;
		transform: none;
	}
}
