

/* Grid */
.grid {
	position: relative;
	display: -webkit-flex;
	display: -ms-flexbox;
	display: flex;
	-webkit-flex-wrap: wrap;
	-ms-flex-wrap: wrap;
	flex-wrap: wrap;
	-webkit-justify-content: center;
	-ms-justify-content: center;
	justify-content: center;
	list-style: none;
	padding: 3em 0 0 0;
	margin: 0 auto;
}

.grid__item {
	width: 100%;
}

.grid--xray .grid__item {
	margin: 0 20px 20px;
	width: 300px;
}

.grid__item-title {
	font-family: 'Playfair Display', Georgia, serif;
	font-size: 1em;
	padding: 1em 0;
	font-weight: bold;
}

.grid__item-title code {
	color: #aaa;
	font-weight: normal;
	font-size: 0.85em;
}

.grid--xray .grid__img {
	width: 300px;
	height: 300px;
}

.grid__img img {
	max-width: 100%;
	display: block;
}

.grid__img--border .tilt__back,
.grid__img--border .tilt__front {
	border: 1px solid #333;
}

.grid__img--border .tilt {
	overflow: visible;
} 

/* Examples custom styles */
.grid--examples {
}

.grid--examples .grid__img {
	position: relative;
	height: 0;
	padding-bottom: 66.714%;
	overflow: hidden;
}

.grid--examples .tilt {
	position: absolute;
	top: 0;
}

.grid__img--example-2::after {
	content: '';
	position: absolute;
	box-shadow: inset 0 0 50px 30px rgba(2,0,37,0.8);
	pointer-events: none;
	width: 100%;
	height: 100%;
	top: 0;
	left: 0;
}

.grid__img--example-3 .tilt {
	-webkit-filter: grayscale(100%) brightness(105%) contrast(120%);
	filter: grayscale(100%) brightness(105%) contrast(120%);
	-webkit-transition: filter 0.5s, -webkit-filter 0.5s;
	transition: filter 0.5s, -webkit-filter 0.5s;
}

.grid__img--example-3 .tilt:hover {
	-webkit-filter: none;
	filter: none;
}

.grid__img--example-4 .tilt {
	width: 120%;
	height: 120%;
	top: -10%;
	left: -10%;
}

/* Definition list */
.def-list {
	max-width: 900px;
	background: #f0f0f0;
	border-radius: 10px;
	margin: 1em auto;
	padding: 3%;
}

.def-list dt {
	font-family: 'Avenir', 'Helvetica', Arial, sans-serif;
}

.def-list dt:not(:first-child) {
	margin-top: 2em;
}

.def-list dd {
	margin: 0;
	font-size: 0.95em;
	line-height: 1.4;
}

/* Related demos */
.content--related {
	text-align: center;
	font-weight: bold;
	padding: 8em 0;
}

.media-item {
	display: inline-block;
	padding: 1em;
	vertical-align: top;
	-webkit-transition: color 0.3s;
	transition: color 0.3s;
}

.media-item__img {
	max-width: 100%;
	opacity: 0.7;
	-webkit-transition: opacity 0.3s;
	transition: opacity 0.3s;
}

.media-item:hover .media-item__img,
.media-item:focus .media-item__img {
	opacity: 1;
}

.media-item__title {
	margin: 0;
	padding: 0.5em;
	font-size: 1em;
}

@media screen and (min-aspect-ratio: 1440/960) {
	.hero__imgwrap .tilt__back,
	.hero__imgwrap .tilt__front,
	.codrops-header {
		background-size: 100vw auto;
	}
	.hero__img {
		width: 100vw;
		height: auto;
	}
}

@media screen and (max-width: 40em){
	.codrops-header h1 {
		font-size: 2.5em;
	}
	.hero {
		left: 20px;
		bottom: 20px;
		right: 20px;
		top: 20px;
	}
	.github-link {
		top: 40px;
		right: 40px;
	}
	.codrops-links {
		top: 35px;
		left: 30px;
	}
	.mobile-note {
		display: block;
	}
}

