*,
*::after,
*::before {
	box-sizing: border-box;
}

body {
	/* Grid gap */
	--gap: 20px;
	/* Color scheme */
	--body-text: #191919;
	--body-bg: #1c1c1c;
	--link-text: #F20080;
	--link-text-hover: #191919;
    --grid-name-text: #F20080;
    --grid-title-text: #7f65f5;
    --grid-nav-text: #fff;
    --grid-nav-text-hover: #000;
    --grid-nav-bg: #7f65f5; /**/
    --grid-nav-bg-hover: #acc7fe;
    --grid-text: #fff;
	min-height: 600px;
	color: #191919;
	color: var(--body-text);
	background: #1c1c1c;
	background: var(--body-bg);
}

.hidden {
	position: absolute;
	overflow: hidden;
	width: 0;
	height: 0;
	pointer-events: none;
}

/* Icons */
.icon {
	display: block;
	width: 3em;
	height: 3em;
	margin: 0 auto;
	fill: currentColor;
}

/* Page Loader */
.js .loading::before {
	content: '';
	position: fixed;
	z-index: 10000;
	top: 0;
	left: 0;
	width: 100%;
	height: 100%;
	background: #ccd8e4;
	background: var(--body-bg);
}

.js .loading::after {
	content: '';
	position: fixed;
	z-index: 10000;
	top: 50%;
	left: 50%;
	width: 80px;
	height: 80px;
	margin: -40px 0 0 -40px;
	pointer-events: none;
	background: #333;
	background: var(--body-text);
	transform-origin: 0% 50%;
	animation: loaderAnim 1.5s linear infinite alternate forwards;
}

@keyframes loaderAnim {
	0% {
		transform: scale3d(0,1,1);
		transform-origin: 0% 50%;
	}
	50% {
		transform: scale3d(1,1,1);
		transform-origin: 0% 50%;
	}
	51% {
		transform: scale3d(1,1,1);
		transform-origin: 100% 50%;
	}
	100% {
		transform: scale3d(0,1,1);
		transform-origin: 100% 50%;
	}
}

.message {
	background: #333;
	background: var(--body-text);
	color: #ccd8e4;
	color: var(--body-bg);
	text-align: center;
	padding: 1em;
	display: none;
}

/* Demos */
.demos {
	grid-area: demos;
	align-self: end;
	justify-self: end;
	display: block;
	text-align: center;
}

.demo {
	margin: 0 0 0 1em;
}


/* Grid */
.grid {
	display: grid;
	width: calc(100% - 6em);
	height: calc(100vh - 6em);
	grid-auto-rows: calc((calc(100vh - 6em) / 30) - var(--gap));
	grid-auto-columns: calc((calc(100% - 6em) / 30) - var(--gap));
	justify-content: center;
	align-content: center;
	grid-gap: var(--gap);
	pointer-events: none;
}

.no-js .grid {
	margin: 0 0 15vh;
}

.js .grid {
	position: absolute;
	top: 3em;
	left: 3em;
	opacity: 0;
}

.js .grid--current {
	opacity: 1;
	pointer-events: auto;
}

.grid__item {
	position: relative;
	padding: 1em;
	background-repeat: no-repeat;
	background-position: 50% 50%;
	background-size: cover;
	/*-webkit-filter: grayscale(100%);
	filter: grayscale(100%);*/
	transition: transform 0.2s ease-out;
}

.grid__item--name,
.grid__item--title,
.grid__item--text {
	pointer-events: none;
	padding: 0;
	margin: 0;
}

.grid__item--name,
.grid__item--title {
	font-weight: 800;
	line-height: 0.7;
}
.grid__item--name {
	font-size: 6vw;
	color: #7f65f5;
	color: var(--grid-name-text);
}
.grid__item--name:before {
	content: '';
	position: absolute;
	z-index: 1;
	top: -100%;
	bottom: -100%;
	left: -100%;
	right: -100%;
/*	background: -webkit-radial-gradient(40% 40%, circle cover, rgba(49, 116, 162, 0.2) 0%, rgba(49, 116, 162, 0.1) 10%, rgba(49, 116, 163, 0) 50%);
    background: radial-gradient(circle at 40% 40%, rgba(49, 116, 162, 0.2) 0%, rgba(49, 116, 162, 0.1) 10%, rgba(49, 116, 163, 0) 50%);*/
	background: -webkit-radial-gradient(40% 40%, circle cover, rgba(0, 0, 0, 0.3) 0%, rgba(0, 0, 0, 0.15) 10%, rgba(0, 0, 0, 0) 50%);
    background: radial-gradient(circle at 40% 40%, rgba(0, 0, 0, 0.3) 0%, rgba(0, 0, 0, 0.15) 10%, rgba(0, 0, 0, 0) 50%);
}
.grid__item--name > div {
	position: relative;
	z-index: 2;
}
.grid__item--name big {
	font-size: 8vw;
	margin-left: -7px;
}
.grid__item--name span {
	display: inline-block;
	max-width: 80%;
	margin-top: 2rem;
	font-size: 3vw;
	font-weight: 700;
	line-height: 0.9;
	color: #fff;
}

.grid__item--title {
	position: relative;
	z-index: 3;
	/*font-family: 'Roboto Slab';*/
	font-family: 'IBM Plex Serif';
	font-weight: 300;
	letter-spacing: 0.1em;
	font-size: 3.5vh;
	text-transform: uppercase;	
	-webkit-writing-mode: vertical-lr;
	writing-mode: vertical-lr;
	text-align: right;
	display: flex;
	justify-content: flex-end;
	color: #7f65f5;
	color: var(--grid-title-text);
	pointer-events: auto;
}
.grid__item--title a {
	color: #7f65f5;
	color: var(--grid-title-text);
}
.grid__item--title a:hover {
	color: #5adbf3;
	color: var(--grid-nav-bg-hover);
}

.grid__item--text {
	/*max-width: 200px;*/
	font-size: 1.1em;
	font-weight: 300;
	line-height: 1.5;
	display: flex;
	color: inherit;
	color: var(--grid-text);
}

.grid__item--nav {
	background: #7f65f5;
	background: var(--grid-nav-bg);
	color: #fff;
	color: var(--grid-nav-text);
	display: flex;
	align-items: center;
	cursor: pointer;
	transition: background 0.3s;
}

.grid__item--nav:hover {
	background: #1f1f1f;
	background: var(--grid-nav-bg-hover);
	color: #fff;
	color: var(--grid-nav-text-hover);
}

.grid__item--nav-next .icon--nav-arrow {
	margin: 0 0 0 auto;
}

.grid__item--nav-prev .icon--nav-arrow {
	transform: rotate(180deg);
	margin: 0;
}

.no-js .grid__item--nav {
	display: none;
}

.grid__item--animateOut {
	animation: animateOut 0.8s cubic-bezier(0.7,0,0.3,1) forwards;
}

@keyframes animateOut {
	to {
		opacity: 0;
	}
}

.grid__item--animateIn {
	animation: animateIn 0.8s cubic-bezier(0.7,0,0.3,1) forwards;
}

@keyframes animateIn {
	from {
		opacity: 0;
	}
	to {
		opacity: 1;
	}
}

 /* Layout 1 */
.grid--layout-1 .grid__item:first-child { grid-area: 11 / 1 / 17 / 5; background-image: url(../img/slide-1/gs/03.jpg); }
.grid--layout-1 .grid__item:nth-child(2) { grid-area: 22 / 6 / 28 / 10; background-image: url(../img/slide-1/gs/02.jpg); }
.grid--layout-1 .grid__item:nth-child(3) { grid-area: 8 / 5 / 22 / 15; background-image: url(../img/slide-1/gs/01.jpg); }
.grid--layout-1 .grid__item:nth-child(4) { grid-area: 22 / 10 / 29 / 15; background-image: url(../img/slide-1/gs/04.jpg); }
.grid--layout-1 .grid__item:nth-child(5) { grid-area: 1 / 11 / 8 / 15; background-image: url(../img/slide-1/gs/05.jpg); }
.grid--layout-1 .grid__item:nth-child(6) { grid-area: 17 / 15 / 24 / 20; background-image: url(../img/slide-1/gs/06.jpg); }
.grid--layout-1 .grid__item:nth-child(7) { grid-area: 9 / 15 / 17 / 23; background-image: url(../img/slide-1/gs/09.jpg); }
.grid--layout-1 .grid__item:nth-child(8) { grid-area: 2 / 18 / 9 / 23; background-image: url(../img/slide-1/gs/08.jpg); }
.grid--layout-1 .grid__item:nth-child(9) { grid-area: 17 / 20 / 22 / 26; background-image: url(../img/slide-1/gs/07.jpg); }
.grid--layout-1 .grid__item:nth-child(10) { grid-area: 22 / 20 / 28 / 23; background-image: url(../img/slide-1/gs/10.jpg); }
.grid--layout-1 .grid__item:nth-child(11) { grid-area: 4 / 23 / 11 / 27; background-image: url(../img/slide-1/gs/11.jpg); }
.grid--layout-1 .grid__item:nth-child(12) { grid-area: 11 / 23 / 17	/ 30; background-image: url(../img/slide-1/gs/12.jpg); }
.grid--layout-1 .grid__item:nth-child(13) { grid-area: 17 / 26 / 22 / 28; background-image: url(../img/slide-1/gs/13.jpg); }
.grid--layout-1 .grid__item--name { grid-area: 5 / 12 / 30 / 25; }
.grid--layout-1 .grid__item--title { grid-area: 1 / 27 / 10 / 29; }
.grid--layout-1 .grid__item--text { grid-area: 22 / 23 / 30 / 29; }
.grid--layout-1 .grid__item--nav-prev { grid-area: 3 / 6 / 8 / 11; }
.grid--layout-1 .grid__item--nav-next { grid-area: 24 / 15 / 29 / 20; }

 
/* Layout 2 */
.grid--layout-2 .grid__item:first-child { grid-area: 17 / 1 / 24 / 5; background-image: url(../img/slide-3/gs/01.jpg); }
.grid--layout-2 .grid__item:nth-child(2) { grid-area: 22 / 6 / 28 / 10; background-image: url(../img/slide-3/gs/07.jpg); }
.grid--layout-2 .grid__item:nth-child(3) { grid-area: 14 / 5 / 22 / 10; background-image: url(../img/slide-3/gs/03.jpg); }
.grid--layout-2 .grid__item:nth-child(4) { grid-area: 17 / 10 / 26 / 15; background-image: url(../img/slide-3/gs/10.jpg); }
.grid--layout-2 .grid__item:nth-child(5) { grid-area: 1 / 10 / 17 / 15; background-image: url(../img/slide-3/gs/05.jpg); }
.grid--layout-2 .grid__item:nth-child(6) { grid-area: 11 / 15 / 24 / 20; background-image: url(../img/slide-3/gs/06.jpg); }
.grid--layout-2 .grid__item:nth-child(7) { grid-area: 5 / 15 / 11 / 18; background-image: url(../img/slide-3/gs/02.jpg); }
.grid--layout-2 .grid__item:nth-child(8) { grid-area: 1 / 18 / 11 / 23; background-image: url(../img/slide-3/gs/08.jpg); }
.grid--layout-2 .grid__item:nth-child(9) { grid-area: 20 / 20 / 27 / 24; background-image: url(../img/slide-3/gs/09.jpg); }
.grid--layout-2 .grid__item:nth-child(10) { grid-area: 24 / 15 / 29 / 20; background-image: url(../img/slide-3/gs/04.jpg); }
.grid--layout-2 .grid__item:nth-child(11) { grid-area: 4 / 23 / 11 / 27; background-image: url(../img/slide-3/gs/11.jpg); }
.grid--layout-2 .grid__item:nth-child(12) { grid-area: 11 / 20 / 20	/ 30; background-image: url(../img/slide-3/gs/12.jpg); }
.grid--layout-2 .grid__item:nth-child(13) { grid-area: 25 / 24 / 29 / 28; background-image: url(../img/slide-3/gs/13.jpg); }
.grid--layout-2 .grid__item--name { grid-area: 12 / 10 / 30 / 24; }
.grid--layout-2 .grid__item--title { grid-area: 1 / 27 / 11 / 29; }
.grid--layout-2 .grid__item--text { grid-area: 1 / 4 / 9 / 10; align-items: flex-end; text-align: right;}
.grid--layout-2 .grid__item--nav-prev { grid-area: 9 / 5 / 14 / 10; }
.grid--layout-2 .grid__item--nav-next { grid-area: 20 / 24 / 25 / 30; }

/* Layout 3 */
.grid--layout-3 .grid__item:first-child { grid-area: 6 / 1 / 14 / 5; background-image: url(../img/slide-2/gs/01.jpg); }
.grid--layout-3 .grid__item:nth-child(2) { grid-area: 3 / 5 / 14 / 10; background-image: url(../img/slide-2/gs/02.jpg); }
.grid--layout-3 .grid__item:nth-child(3) { grid-area: 14 / 1 / 21 / 5; background-image: url(../img/slide-2/gs/03.jpg); }
.grid--layout-3 .grid__item:nth-child(4) { grid-area: 19 / 10 / 28 / 20; background-image: url(../img/slide-2/gs/04.jpg); }
.grid--layout-3 .grid__item:nth-child(5) { grid-area: 1 / 10 / 11 / 18; background-image: url(../img/slide-2/gs/05.jpg); }
.grid--layout-3 .grid__item:nth-child(6) { grid-area: 11 / 10 / 19 / 15; background-image: url(../img/slide-2/gs/06.jpg); }
.grid--layout-3 .grid__item:nth-child(7) { grid-area: 11 / 15 / 19 / 20; background-image: url(../img/slide-2/gs/07.jpg); }
.grid--layout-3 .grid__item:nth-child(8) { grid-area: 1 / 18 / 6 / 23; background-image: url(../img/slide-2/gs/08.jpg); }
.grid--layout-3 .grid__item:nth-child(9) { grid-area: 20 / 20 / 27 / 24; background-image: url(../img/slide-2/gs/10.jpg); }
.grid--layout-3 .grid__item:nth-child(10) { grid-area: 20 / 28 / 25 / 30; background-image: url(../img/slide-2/gs/12.jpg); }
.grid--layout-3 .grid__item:nth-child(11) { grid-area: 4 / 23 / 11 / 27; background-image: url(../img/slide-2/gs/11.jpg); }
.grid--layout-3 .grid__item:nth-child(12) { grid-area: 11 / 20 / 20	/ 30; background-image: url(../img/slide-2/gs/09.jpg); }
.grid--layout-3 .grid__item:nth-child(13) { grid-area: 20 / 24 / 26 / 28; background-image: url(../img/slide-2/gs/13.jpg); }
.grid--layout-3 .grid__item--name { grid-area: 15 / 13 / 30 / 30; }
.grid--layout-3 .grid__item--title { grid-area: 1 / 27 / 11 / 29; }
.grid--layout-3 .grid__item--text { grid-area: 19 / 5 / 30 / 10; text-align: right;}
.grid--layout-3 .grid__item--nav-prev { grid-area: 14 / 5 / 19 / 10; }
.grid--layout-3 .grid__item--nav-next { grid-area: 6 / 18 / 11 / 23; }

/* Demo themes */

.demo-3 div.grid__item:not(.grid__item--nav)::after {
	content: '';
	position: absolute;
	width: 100%;
	height: 100%;
	top: 0;
	left: 0;
	background: #acc7fe;
	mix-blend-mode: soft-light; /*soft-light, color, difference, exclusion*/
	opacity: 0;
	pointer-events: none;
	transition: opacity 0.3s;
}

.demo-3 .grid:not(.grid--animating) div.grid__item:not(.grid__item--nav):hover::after {
	opacity: 1;
}

@media screen and (max-width: 60em) {
	.message {
		display: block;
	}
	.frame {
		display: block;
		height: auto;
		position: relative;
		text-align: center;
	}
	.codrops-header {
		flex-direction: column;
	}
	.codrops-header__title {
		padding: 1em 0;
	}
	.github {
		margin: 0 auto;
	}
	.demos {
		padding: 1em 0 0;
	}
	.demo {
		margin: 0 0.5em;
	}
	main .grid {
		height: auto;
		top: auto !important;
		width: 100%;
		left: auto !important;
		padding: 0 2em;
		grid-template-columns: repeat(auto-fill, minmax(50px, 1fr));
		grid-auto-rows: auto !important;
		grid-auto-columns: auto !important;
		grid-gap: 1vw;
	}

	.grid__item {
		min-height: 50px;
		grid-area: auto !important;
	}

	.grid__item br {
		content: '';
		display: none;
	}

	.grid__item--name,
	.grid__item--title,
	.grid__item--text {
		grid-column: 1 / -1 !important;
		justify-content: flex-start;
		min-height: 0;
		padding: 1vh 0;
		text-align: left !important;
	}	

	.grid__item--name {
		grid-row: 1 / -1 !important;
	}

	.grid .grid__item--title {
		-webkit-writing-mode: horizontal-tb;
		writing-mode: horizontal-tb;
	}
}
