html {
	box-sizing: border-box;
}
body {
	margin: 0;
}
*, *:before, *:after {
	box-sizing: inherit;
}

.panels {
	min-height: 100vh;
	overflow: hidden;
	display: flex;
}
.panel {
	background: #6B0F9C;
	background-size: cover;
	background-position: center;
	box-shadow: inset 0 0 0 5px rgba(255,255,255,0.1);
	color: white;
	font-size: 1.2rem;
	text-align: center;
	display: flex;
	align-items: center;	
	justify-content: center;
	flex: 1;
	flex-direction: column;
	/* Safari transitionend event.propertyName === flex */
	/* Chrome + FF transitionend event.propertyName === flex-grow */
	transition:
		font-size 0.5s cubic-bezier(0.61,-0.19, 0.7,-0.11),
		flex 0.5s cubic-bezier(0.61,-0.19, 0.7,-0.11),
		background 0.2s;
}

.panel1 {
	background-image:url(https://source.unsplash.com/E7PlRr9ZfoM/1500x1500);
}
.panel2 {
	background-image:url(https://source.unsplash.com/kiI9wQPFw8E/1500x1500);
}
.panel3 {
	background-image:url(https://source.unsplash.com/E0AHdsENmDg/1500x1500);
}
.panel4 {
	background-image:url(https://source.unsplash.com/kR1Aer8c_WI/1500x1500);
}
.panel5 {
	background-image:url(https://source.unsplash.com/Ib2e4-Qy9mQ/1500x1500);
}

/* Flex Children */
.panel > * {
	margin: 0;
	width: 100%;
	display: flex;
	align-items: center;
	justify-content: center;
	flex: 1 0 auto;
	transition: transform 0.25s;
}

.panel > *:first-child { transform: translateY(-100%); }
.panel.open-active > *:first-child { transform: translateY(0); }
.panel > *:last-child { transform: translateY(100%); }
.panel.open-active > *:last-child { transform: translateY(0); }

.panel p {
	font-family: 'Amatic SC', cursive;
	font-size: 2em;
	text-transform: uppercase;
	text-shadow: 0 0 4px rgba(0, 0, 0, 0.72), 0 0 14px rgba(0, 0, 0, 0.45);
}
.panel p:nth-child(2) {
	font-size: 4em;
}

.panel.open {
	font-size: 2.4rem;
	flex: 5;
}
