/*
 * Motion — calm, editorial movement that matches the brand.
 * Reveal styles only apply under html.mt-motion (set in <head> when the
 * visitor allows motion and we're not inside the Elementor editor).
 */

/* ---------- Hover & micro-interactions (always on, cheap) ---------- */

/* Outline button fills from the right (RTL start) — the fill itself is defined in components.css. */
.mt-btn--outline {
	transition: background-size 0.45s var(--mt-ease), color 0.3s var(--mt-ease), border-color 0.3s var(--mt-ease);
}

.mt-btn--primary,
.mt-btn--light {
	transition: background-color 0.3s var(--mt-ease), color 0.3s var(--mt-ease), transform 0.3s var(--mt-ease), box-shadow 0.3s var(--mt-ease);
}

.mt-btn--primary:hover,
.mt-btn--light:hover {
	transform: translateY(-2px);
	box-shadow: 0 10px 24px -12px rgba(22, 22, 22, 0.45);
}

/* Nav underline grows from the center instead of blinking in. */
.mt-nav a::after {
	opacity: 1;
	transform: scaleX(0);
	transition: transform 0.35s var(--mt-ease);
}

.mt-nav .current-menu-item > a::after,
.mt-nav .current-menu-ancestor > a::after,
.mt-nav .current_page_parent > a::after,
.mt-nav a:hover::after {
	transform: scaleX(1);
}

/* Cards lift. */
.mt-card-service,
.mt-card-blog,
.mt-feature--boxed,
.mt-testimonial {
	transition: transform 0.45s var(--mt-ease), box-shadow 0.45s var(--mt-ease), border-color 0.3s var(--mt-ease);
}

.mt-card-service:hover,
.mt-card-blog:hover,
.mt-feature--boxed:hover {
	transform: translateY(-6px);
	box-shadow: 0 24px 48px -28px rgba(22, 22, 22, 0.35);
}

.mt-testimonial:hover {
	border-color: var(--mt-border-strong);
}

/* Icon boxes warm up on hover. */
.mt-icon-box,
.mt-step__icon {
	transition: border-color 0.3s var(--mt-ease), background-color 0.3s var(--mt-ease), color 0.3s var(--mt-ease);
}

.mt-feature:hover .mt-icon-box,
.mt-step:hover .mt-step__icon {
	border-color: var(--mt-border-strong);
}

.mt-feature:hover .mt-icon-box .mt-icon,
.mt-step:hover .mt-step__icon .mt-icon {
	animation: mt-wiggle 0.6s var(--mt-ease);
}

@keyframes mt-wiggle {
	30% { transform: rotate(-8deg) scale(1.06); }
	60% { transform: rotate(5deg); }
}

/* Project card: text rises a little, gradient deepens. */
.mt-card-project::after {
	transition: opacity 0.5s var(--mt-ease);
}

.mt-card-project__info {
	transition: transform 0.5s var(--mt-ease);
}

.mt-card-project:hover .mt-card-project__info {
	transform: translateY(-8px);
}

.mt-card-project__info::after {
	content: "";
	display: block;
	width: 0;
	height: 1px;
	margin-top: 12px;
	background: var(--mt-text-on-dark);
	transition: width 0.5s var(--mt-ease);
}

.mt-card-project:hover .mt-card-project__info::after {
	width: 48px;
}

/* Floating buttons: gentle pulse ring on WhatsApp. */
.mt-fab--whatsapp {
	position: relative;
}

.mt-fab--whatsapp::before {
	content: "";
	position: absolute;
	inset: 0;
	border-radius: 50%;
	background: var(--mt-green-wa);
	animation: mt-pulse 2.6s ease-out infinite;
	z-index: -1;
}

@keyframes mt-pulse {
	0% { transform: scale(1); opacity: 0.5; }
	70%, 100% { transform: scale(1.6); opacity: 0; }
}

/* CTA band watermark drifts slowly. */
.mt-cta-band__pattern {
	animation: mt-drift 14s ease-in-out infinite alternate;
}

@keyframes mt-drift {
	from { transform: translateY(0) rotate(0deg); }
	to { transform: translateY(24px) rotate(4deg); }
}

/* Mobile menu items cascade in. */
.mt-mobile-menu nav > ul > li,
.mt-mobile-menu__bottom {
	opacity: 0;
	transform: translateY(16px);
	transition: opacity 0.5s var(--mt-ease), transform 0.5s var(--mt-ease);
}

.mt-mobile-menu.is-open nav > ul > li,
.mt-mobile-menu.is-open .mt-mobile-menu__bottom {
	opacity: 1;
	transform: none;
}

.mt-mobile-menu.is-open nav > ul > li:nth-child(1) { transition-delay: 0.08s; }
.mt-mobile-menu.is-open nav > ul > li:nth-child(2) { transition-delay: 0.13s; }
.mt-mobile-menu.is-open nav > ul > li:nth-child(3) { transition-delay: 0.18s; }
.mt-mobile-menu.is-open nav > ul > li:nth-child(4) { transition-delay: 0.23s; }
.mt-mobile-menu.is-open nav > ul > li:nth-child(5) { transition-delay: 0.28s; }
.mt-mobile-menu.is-open nav > ul > li:nth-child(6) { transition-delay: 0.33s; }
.mt-mobile-menu.is-open nav > ul > li:nth-child(n+7) { transition-delay: 0.38s; }
.mt-mobile-menu.is-open .mt-mobile-menu__bottom { transition-delay: 0.42s; }

/* ---------- Scroll reveals (only with html.mt-motion) ---------- */

.mt-motion [data-mt-reveal] {
	opacity: 0;
	transform: translate3d(0, 24px, 0);
	transition: opacity 0.6s var(--mt-ease), transform 0.7s var(--mt-ease);
	transition-delay: var(--mt-delay, 0ms);
}

.mt-motion [data-mt-reveal="fade"] {
	transform: none;
}

.mt-motion [data-mt-reveal].is-in {
	opacity: 1;
	transform: none;
}

/* Images uncover from the right (reading start), with a short settle. */
.mt-motion [data-mt-reveal="image"] {
	opacity: 1;
	transform: scale(1.06);
	clip-path: inset(0 0 0 100% round var(--mt-radius-md));
	transition: clip-path 0.75s cubic-bezier(0.65, 0, 0.25, 1), transform 0.9s var(--mt-ease);
	transition-delay: var(--mt-delay, 0ms);
}

.mt-motion [data-mt-reveal="image"].is-in {
	transform: none;
	clip-path: inset(0 round var(--mt-radius-md));
}

/* Project tiles: the photo settles while the tile fades up. */
.mt-motion .mt-proj-tile[data-mt-reveal] img {
	transform: scale(1.1);
}

.mt-motion .mt-proj-tile[data-mt-reveal].is-in img {
	transform: none;
}

.mt-motion .mt-proj-tile[data-mt-reveal].is-in:hover img {
	transform: scale(1.04);
}

/* Operating-system line draws across once its steps appear. */
.mt-motion .mt-opsys__steps::before {
	transform: scaleX(0);
	transform-origin: right;
	transition: transform 1.2s var(--mt-ease) 0.2s;
}

.mt-motion .mt-opsys__steps:has(> .is-in)::before {
	transform: scaleX(1);
}

/* Process line (الفكرة · التصميم · التنفيذ · التسليم) draws in the same way. */
.mt-motion .mt-process[data-mt-reveal]::before {
	transform: scaleX(0);
	transform-origin: right;
	transition: transform 1s var(--mt-ease) 0.25s;
}

.mt-motion .mt-process[data-mt-reveal].is-in::before {
	transform: scaleX(1);
}

/* Amber stat underline grows after the number counts. */
.mt-motion .mt-glass-stats .mt-stat__num::after,
.mt-motion .mt-stat-card .mt-stat__num::after {
	transform: scaleX(0);
	transform-origin: right;
	transition: transform 0.6s var(--mt-ease) 0.9s;
}

.mt-motion .is-counted .mt-stat__num::after {
	transform: scaleX(1);
}

/* Eyebrow line draws in after its heading appears. */
.mt-motion .mt-eyebrow::after {
	transition: width 0.5s var(--mt-ease) 0.2s;
}

.mt-motion [data-mt-reveal]:not(.is-in) .mt-eyebrow::after,
.mt-motion .mt-eyebrow[data-mt-reveal]:not(.is-in)::after {
	width: 0;
}

/* Stat dividers grow downwards (desktop row layout only; the mobile grid keeps static lines). */
@media (min-width: 768px) {
	.mt-motion .mt-stats .mt-stat + .mt-stat {
		border-inline-start-color: transparent;
		background: linear-gradient(var(--mt-border-strong), var(--mt-border-strong)) no-repeat right top / 1px 0%;
		transition: background-size 0.6s var(--mt-ease) 0.2s;
	}

	.mt-motion .mt-stats.is-counted .mt-stat + .mt-stat {
		background-size: 1px 100%;
	}
}

/* Hero / banner image: slow zoom-out on load. Parallax is added by JS via `translate`. */
.mt-motion .mt-hero__bg,
.mt-motion .mt-home-hero__bg {
	animation: mt-kenburns 1.6s cubic-bezier(0.2, 0.7, 0.2, 1) both;
}

@keyframes mt-kenburns {
	from { scale: 1.08; }
	to { scale: 1; }
}

/* Never animate inside the Elementor editor or for reduced-motion users. */
@media (prefers-reduced-motion: reduce) {
	*,
	*::before,
	*::after {
		animation-duration: 0.01ms !important;
		animation-iteration-count: 1 !important;
		transition-duration: 0.01ms !important;
	}
}

/* Below 1024px the operating-system line is vertical: draw it top to bottom. */
@media (max-width: 1024px) {
	.mt-motion .mt-opsys__steps::before {
		transform: scaleY(0);
		transform-origin: top;
	}

	.mt-motion .mt-opsys__steps:has(> .is-in)::before {
		transform: scaleY(1);
	}
}

/* «نبذة مختصرة» photos: a slow zoom on hover (the scroll drift is in motion.js). */
.mt-motion .mt-home-about__media img {
	transition: clip-path 0.75s cubic-bezier(0.65, 0, 0.25, 1), transform 0.9s var(--mt-ease), scale 0.6s var(--mt-ease);
	transition-delay: var(--mt-delay, 0ms), var(--mt-delay, 0ms), 0s;
	will-change: translate;
}

.mt-motion .mt-home-about__media img:hover {
	scale: 1.03;
}
