/**
 * Rajgir Parent Theme
 *
 * Design System — Motion Tokens
 *
 * Canonical path:
 * assets/css/tokens/motion.css
 *
 * Responsibility:
 * - Centralized motion tokens.
 * - Duration tokens.
 * - Easing tokens.
 * - Transition tokens.
 * - Motion intensity tokens.
 * - Reduced-motion foundation.
 *
 * This file does NOT:
 * - define component animations;
 * - define page-specific animation;
 * - contain JavaScript;
 * - contain business logic;
 * - create infinite decorative animation;
 * - block user interaction.
 *
 * @package Rajgir
 */


/* ==========================================================================
   RAJGIR MOTION TOKEN SYSTEM
   ========================================================================== */

:root {

	/* ----------------------------------------------------------------------
	   DURATION
	   ---------------------------------------------------------------------- */

	--rajgir-motion-duration-fast:
		var(--wp--preset--motion--duration-fast, initial);

	--rajgir-motion-duration-normal:
		var(--wp--preset--motion--duration-normal, initial);

	--rajgir-motion-duration-slow:
		var(--wp--preset--motion--duration-slow, initial);


	/* ----------------------------------------------------------------------
	   EASING
	   ---------------------------------------------------------------------- */

	--rajgir-motion-ease-standard:
		var(--wp--preset--motion--ease-standard, initial);

	--rajgir-motion-ease-emphasized:
		var(--wp--preset--motion--ease-emphasized, initial);

	--rajgir-motion-ease-enter:
		var(--wp--preset--motion--ease-enter, initial);

	--rajgir-motion-ease-exit:
		var(--wp--preset--motion--ease-exit, initial);


	/* ----------------------------------------------------------------------
	   TRANSITION
	   ---------------------------------------------------------------------- */

	--rajgir-motion-transition-fast:
		var(
			--wp--preset--motion--transition-fast,
			initial
		);

	--rajgir-motion-transition-standard:
		var(
			--wp--preset--motion--transition-standard,
			initial
		);

	--rajgir-motion-transition-emphasized:
		var(
			--wp--preset--motion--transition-emphasized,
			initial
		);


	/* ----------------------------------------------------------------------
	   MOTION INTENSITY
	   ---------------------------------------------------------------------- */

	--rajgir-motion-intensity-none:
		0;

	--rajgir-motion-intensity-subtle:
		var(
			--wp--preset--motion--intensity-subtle,
			initial
		);

	--rajgir-motion-intensity-medium:
		var(
			--wp--preset--motion--intensity-medium,
			initial
		);


	/* ----------------------------------------------------------------------
	   SEMANTIC MOTION ROLES
	   ---------------------------------------------------------------------- */

	--rajgir-motion-interaction:
		var(--rajgir-motion-transition-fast);

	--rajgir-motion-component:
		var(--rajgir-motion-transition-standard);

	--rajgir-motion-emphasis:
		var(--rajgir-motion-transition-emphasized);

}


/* ==========================================================================
   MOTION PROPERTY GUIDANCE
   ========================================================================== */

/*
 * Where animation is appropriate, compositor-friendly properties such as:
 *
 * - transform
 * - opacity
 *
 * should generally be preferred.
 *
 * Heavy continuous layout-triggering animation should be avoided.
 *
 * Avoid unnecessary animation of:
 *
 * - width
 * - height
 * - top
 * - left
 *
 * when transform/opacity can communicate the same visual change.
 */


/* ==========================================================================
   REDUCED MOTION
   ========================================================================== */

@media (prefers-reduced-motion: reduce) {

	:root {

		/*
		 * Reduced-motion mode is a behavioral accessibility layer.
		 *
		 * The underlying functionality and semantic meaning must remain
		 * available even when visual motion is reduced.
		 */

		--rajgir-motion-duration-fast:
			0ms;

		--rajgir-motion-duration-normal:
			0ms;

		--rajgir-motion-duration-slow:
			0ms;

		--rajgir-motion-transition-fast:
			none;

		--rajgir-motion-transition-standard:
			none;

		--rajgir-motion-transition-emphasized:
			none;

	}

}


/* ==========================================================================
   MOTION USAGE CONTRACT
   ========================================================================== */

/*
 * Correct:
 *
 * transition:
 *     opacity
 *     var(--rajgir-motion-duration-fast)
 *     var(--rajgir-motion-ease-standard);
 *
 *
 * Correct:
 *
 * transform:
 *     translateY(...);
 *
 * opacity:
 *     ...;
 *
 *
 * Incorrect:
 *
 * transition: all;
 *
 * Incorrect:
 *
 * animation: decorative-infinite-animation ...;
 *
 * Incorrect:
 *
 * arbitrary duration/easing values when an approved token exists.
 */


/* ==========================================================================
   PURPOSE RULE
   ========================================================================== */

/*
 * Motion must have a clear UX purpose.
 *
 * Appropriate purposes include:
 *
 * - interaction feedback;
 * - state transition;
 * - continuity;
 * - orientation;
 * - hierarchy.
 *
 * Motion must not distract from content.
 */


/* ==========================================================================
   INFINITE ANIMATION RULE
   ========================================================================== */

/*
 * Infinite decorative animation is NOT a default Rajgir pattern.
 *
 * Avoid:
 *
 * - always spinning;
 * - always floating;
 * - always pulsing;
 * - always moving;
 *
 * unless a separately approved functional requirement exists.
 */


/* ==========================================================================
   LOADING MOTION RULE
   ========================================================================== */

/*
 * Loading animation may communicate genuine loading state.
 *
 * It must not become decorative waiting animation.
 *
 * Skeleton animation is only appropriate in an actual loading context.
 */


/* ==========================================================================
   INTERACTION SAFETY
   ========================================================================== */

/*
 * Motion must not:
 *
 * - block interaction;
 * - artificially delay actions;
 * - hide critical content;
 * - replace semantic success/error/loading states;
 * - create false success;
 * - hijack natural scrolling.
 */


/* ==========================================================================
   MOBILE / TOUCH RULE
   ========================================================================== */

/*
 * Desktop hover motion must not be blindly copied to touch devices.
 *
 * Motion must remain:
 *
 * - touch compatible;
 * - mobile compatible;
 * - performance conscious;
 * - optional where appropriate.
 */


/* ==========================================================================
   PROGRESSIVE ENHANCEMENT
   ========================================================================== */

/*
 * Base experience:
 *
 * HTML
 *  +
 * CSS
 *
 * must remain usable without motion enhancement.
 *
 * Motion is an enhancement, not a functional dependency.
 */


/* ==========================================================================
   MOTION OWNERSHIP
   ========================================================================== */

/*
 * Motion tokens:
 *
 * Design System
 *      ↓
 * Motion Token
 *      ↓
 * Component / Pattern
 *
 * Business decisions remain outside the motion layer.
 *
 * Motion is never:
 *
 * - Business Authority
 * - Security Authority
 * - Booking Authority
 * - Payment Authority
 * - Complaint Authority
 */


/* ==========================================================================
   DESIGN SYSTEM GOVERNANCE
   ========================================================================== */

/*
 * Exact numerical Duration / Easing / Intensity values must come from
 * the approved Rajgir Motion Design System.
 *
 * AI/developers must not invent arbitrary motion contracts where an
 * approved token exists.
 *
 * Material motion changes require regression review.
 */