.dialog {
	-webkit-align-items: flex-end;
  	align-items: flex-end;
}

.dialog.dialog--open .dialog__content,
.dialog.dialog--close .dialog__content {
	opacity: 1;
	-webkit-animation-duration: 0.3s;
	animation-duration: 0.3s;
	-webkit-animation-fill-mode: forwards;
	animation-fill-mode: forwards;
	-webkit-transform-origin: 50% 100%;
	transform-origin: 50% 100%;
	-webkit-animation-timing-function: ease-in-out;
	animation-timing-function: ease-in-out;
}

.dialog.dialog--open .dialog__content {
	-webkit-animation-name: anim-open;
	animation-name: anim-open;
}

.dialog.dialog--close .dialog__content {
	-webkit-animation-name: anim-close;
	animation-name: anim-close;
}

.dialog.dialog--open h2,
.dialog.dialog--open button {
	-webkit-animation: anim-elem 0.3s both;
	animation: anim-elem 0.3s both;
}

.dialog.dialog--open h2 {
	-webkit-animation-delay: 0.15s;
	animation-delay: 0.15s;
}

.dialog.dialog--open button {
	-webkit-animation-delay: 0.2s;
	animation-delay: 0.2s;
}

@-webkit-keyframes anim-open {
	0% { -webkit-transform: perspective(1000px) rotate3d(1,0,0,90deg); }
	100% { -webkit-transform: perspective(1000px) rotate3d(1,0,0,0deg); }
}

@keyframes anim-open {
	0% { -webkit-transform: perspective(1000px) rotate3d(1,0,0,90deg); transform: perspective(1000px) rotate3d(1,0,0,90deg); }
	100% { -webkit-transform: perspective(1000px) rotate3d(1,0,0,0deg); transform: perspective(1000px) rotate3d(1,0,0,0deg); }
}

@-webkit-keyframes anim-close {
	0% { -webkit-transform: perspective(1000px) rotate3d(1,0,0,0deg); }
	100% { -webkit-transform: perspective(1000px) rotate3d(1,0,0,90deg); }
}

@keyframes anim-close {
	0% { -webkit-transform: perspective(1000px) rotate3d(1,0,0,0deg); transform: perspective(1000px) rotate3d(1,0,0,0deg); }
	100% { -webkit-transform: perspective(1000px) rotate3d(1,0,0,90deg); transform: perspective(1000px) rotate3d(1,0,0,90deg); }
}

/* Inner elements animations */

@-webkit-keyframes anim-elem {
	0% { opacity: 0; -webkit-transform: translate3d(0, 100px, 0); }
	100% { opacity: 1; -webkit-transform: translate3d(0, 0, 0); }
}

@keyframes anim-elem {
	0% { opacity: 0; -webkit-transform: translate3d(0, 100px, 0); transform: translate3d(0, 100px, 0); }
	100% { opacity: 1; -webkit-transform: translate3d(0, 0, 0); transform: translate3d(0, 0, 0); }
}