/* -------------------------------- 

Primary style

-------------------------------- */
*, *::after, *::before {
  -webkit-box-sizing: border-box;
  -moz-box-sizing: border-box;
  box-sizing: border-box;
}

html {
  font-size: 62.5%;
}

body {
  font-size: 1.6rem;
  font-family: "PT Sans", sans-serif;
  color: #333;
  background-color: rgba(240, 240, 240, 1);
  height:100%;
}

/* -------------------------------- 

Main Components 

-------------------------------- */
.projects-container {
  height: calc(100vh - 50px);
  width: 100vw;
  position: relative;
  overflow-x: hidden;
  -webkit-overflow-scrolling: touch;
}
@media only screen and (min-width: 1024px) {
	.projects-container{
		height: calc(100vh - 80px);
	}
}

.projects-container::before {
  /* never visible - this is used in jQuery to check the current MQ */
  content: 'mobile';
  display: none;
}
.projects-container .single-project {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 33.33%;
  overflow: hidden;
  cursor: pointer;
  -webkit-transition: -webkit-transform 0.4s;
  -moz-transition: -moz-transform 0.4s;
  transition: transform 0.4s;
  /* on mobile -  move items outside the viewport */
  -webkit-transform: translateX(-100%);
  -moz-transform: translateX(-100%);
  -ms-transform: translateX(-100%);
  -o-transform: translateX(-100%);
  transform: translateX(-100%);
}
.projects-container .single-project::after {
  /* background image */
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  height: 33.33vh;
  width: 100%;
  background-image: url("../img/img-1-small.jpg");
  background-repeat: no-repeat;
  background-position: center center;
  background-size: cover;
  -webkit-transition: opacity 0.5s, height 0.4s;
  -moz-transition: opacity 0.5s, height 0.4s;
  transition: opacity 0.5s, height 0.4s;
}
.projects-container .single-project::before {
  /* never visible - this is used in jQuery to detect if the background image has been loaded  */
  content: 'img/img-1-small.jpg';
  display: none;
}
.projects-container .single-project:nth-of-type(2) {
	top: calc(33.33vh - 17px);
}

.projects-container .single-project:nth-of-type(2)::after {
  background-image: url("../img/img-2-small.jpg");
}
.projects-container .single-project:nth-of-type(2)::before {
  content: 'img/img-2-small.jpg';
}
.projects-container .single-project:nth-of-type(3) {
	top: calc(66.66vh - 35px);
}
.projects-container .single-project:nth-of-type(3)::after {
  background-image: url("../img/img-3-small.jpg");
}
.projects-container .single-project:nth-of-type(3)::before {
  content: 'img/img-3-small.jpg';
}
.projects-container .single-project.is-loaded {
  /* move items in the viewport when background images have been loaded */
  -webkit-transform: translateX(0);
  -moz-transform: translateX(0);
  -ms-transform: translateX(0);
  -o-transform: translateX(0);
  transform: translateX(0);
}
.projects-container .single-project.is-full-width {
  /* selected item */
  top: 0;
  height: auto;
  z-index: 1;
  cursor: auto;
  -webkit-transition: z-index 0s 0s, top 0.4s 0s;
  -moz-transition: z-index 0s 0s, top 0.4s 0s;
  transition: z-index 0s 0s, top 0.4s 0s;
}
.projects-container .single-project.is-full-width::after {
	height: 100vh;
}
@media only screen and (min-width: 1024px) {
	.projects-container::before {
		/* never visible - this is used in jQuery to check the current MQ */
		content: 'desktop';
	}
	.projects-container .single-project {
		width: 33.4vw; /* ok to overlap on width */
		height: 100%;
		opacity: 0;
		-webkit-transform: translateX(0);
		-moz-transform: translateX(0);
		-ms-transform: translateX(0);
		-o-transform: translateX(0);
		transform: translateX(0);
		-webkit-transition: width 0s;
		-moz-transition: width 0s;
		transition: width 0s;
	}
	.projects-container .single-project:first-of-type::before {
		content: 'img/img-1-large.jpg';
	}
	.projects-container .single-project:first-of-type::after {
		background-image: url("../img/img-1-large.jpg");
	}
	.projects-container .single-project:nth-of-type(2) {
		top: 0;
		left: 33.33vw;
	}
	.projects-container .single-project:nth-of-type(2)::before {
		content: 'img/img-2-large.jpg';
	}
	.projects-container .single-project:nth-of-type(2)::after {
		background-image: url("../img/img-2-large.jpg");
	}
	.projects-container .single-project:nth-of-type(3) {
		top: 0;
		left: 66.66vw;
	}
	.projects-container .single-project:nth-of-type(3)::before {
		content: 'img/img-3-large.jpg';
	}
	.projects-container .single-project:nth-of-type(3)::after {
		background-image: url("../img/img-3-large.jpg");
	}
	.projects-container .single-project::after {
		height: 100vh;
		width: 100%;
		opacity: 0;
	}
	.projects-container .single-project.is-loaded {
	/* show items when background images have been loaded */
		opacity: 1;
	}
	.projects-container .single-project.is-loaded::after {
		opacity: 1;
	}
	.projects-container .single-project.is-full-width {
		/* selected item */
		left: 0;
		width: 100vw;
		-webkit-transition: width 0.4s 0s, z-index 0s 0s, left 0.4s 0s;
		-moz-transition: width 0.4s 0s, z-index 0s 0s, left 0.4s 0s;
		transition: width 0.4s 0s, z-index 0s 0s, left 0.4s 0s;
	}
}
@media only screen and (min-width: 1170px) {
	.projects-container .single-project::after {
		background-attachment: fixed;
		-webkit-transform: scale(1.1);
		-moz-transform: scale(1.1);
		-ms-transform: scale(1.1);
		-o-transform: scale(1.1);
		transform: scale(1.1);
		-webkit-transition: -webkit-transform 0.8s, opacity 0.5s;
		-moz-transition: -moz-transform 0.8s, opacity 0.5s;
		transition: transform 0.8s, opacity 0.5s;
	}
	.projects-container .single-project.is-loaded::after {
		opacity: 0;
	}
	.no-touch .projects-container .single-project:hover::after, .projects-container .single-project.is-full-width.is-loaded::after {
		opacity: 1;
		-webkit-transform: scale(1);
		-moz-transform: scale(1);
		-ms-transform: scale(1);
		-o-transform: scale(1);
		transform: scale(1);
	}
}
.cd-title img {
	height: auto;
	display: block;
	margin: 0 auto;
	width: 100%;
	max-width: 206px;
}

@media screen and (min-width: 568px){
	.cd-title img {
		max-width: 180px;
	}
}
@media screen and (min-width: 768px){
	.cd-title img {
		max-width: 368px;
	}
}
@media screen and (min-width: 1024px){
	.cd-title img {
	  	max-width: 500px;
	}
}

.cd-title {
  position: absolute;
  z-index: 4;
  left: 0;
  top: 15vh;
  -webkit-transform: translateY(-50%);
  -moz-transform: translateY(-50%);
  -ms-transform: translateY(-50%);
  -o-transform: translateY(-50%);
  transform: translateY(-50%);
  width: 100%;
  text-align: center;
}

.is-full-width .cd-title {
  top: 45vh;
  -webkit-transition: opacity 0s, top 0.4s;
  -moz-transition: opacity 0s, top 0.4s;
  transition: opacity 0s, top 0.4s;
}

.cd-title > * {
	text-shadow: 0 1px 4px rgba(0, 0, 0, 0.2);
	-webkit-font-smoothing: antialiased;
	-moz-osx-font-smoothing: grayscale;
}

@media only screen and (min-width: 1024px) {
  .cd-title {
    top: 45vh;
    width: 33.33vw;
    opacity: 0;
    -webkit-transform: translateY(-50%) translateX(-20px);
    -moz-transform: translateY(-50%) translateX(-20px);
    -ms-transform: translateY(-50%) translateX(-20px);
    -o-transform: translateY(-50%) translateX(-20px);
    transform: translateY(-50%) translateX(-20px);
  }
  .is-loaded .cd-title {
    opacity: 1;
    -webkit-transform: translateY(-50%);
    -moz-transform: translateY(-50%);
    -ms-transform: translateY(-50%);
    -o-transform: translateY(-50%);
    transform: translateY(-50%);
    -webkit-transition: -webkit-transform 0.6s, opacity 0.6s, left 0.4s;
    -moz-transition: -moz-transform 0.6s, opacity 0.6s, left 0.4s;
    transition: transform 0.6s, opacity 0.6s, left 0.4s;
  }
  .is-loaded.is-full-width .cd-title {
    left: 33.33vw;
    -webkit-transition: -webkit-transform 0.6s, opacity 0s, left 0.4s;
    -moz-transition: -moz-transform 0.6s, opacity 0s, left 0.4s;
    transition: transform 0.6s, opacity 0s, left 0.4s;
  }
}


.project-info {
  clear: both;
  visibility: hidden;
  opacity: 0;
  margin-top: calc(100vh - 50px);
  padding: 4em 0;
  cursor: auto;
  background-color: #ffffff;
  color: #333333;
  -webkit-transition: opacity 0.4s 0s, visibility 0s 0.4s;
  -moz-transition: opacity 0.4s 0s, visibility 0s 0.4s;
  transition: opacity 0.4s 0s, visibility 0s 0.4s;
}
@media only screen and (min-width: 1024px) {
  .project-info {
    position: relative;
    z-index: 1;
  }
}
.is-full-width .project-info {
  visibility: visible;
  opacity: 1;
}
.project-info p {
  width: 90%;
  margin: 0 auto;
}

.projects-container .cd-close,
.projects-container .cd-scroll {
  display: block;
  z-index: 1;
  width: 44px;
  height: 44px;
  /* image replacement */
  overflow: hidden;
  text-indent: 100%;
  white-space: nowrap;
  visibility: hidden;
  -webkit-border-radius: 5px;
  border-radius: 5px;
  background-clip: padding-box;
  -webkit-transition: -webkit-transform 1s 0s, visibility 0s 1s;
  -moz-transition: -moz-transform 1s 0s, visibility 0s 1s;
  transition: transform 1s 0s, visibility 0s 1s;
}

.projects-container .cd-close {
  position: fixed;
  top: 50px;
  right: 5%;
  background: url("../img/cd-icon-close-mobile.svg") rgba(255, 255, 255, 0.50) no-repeat center center;
  -webkit-transform: scale(0);
  -moz-transform: scale(0);
  -ms-transform: scale(0);
  -o-transform: scale(0);
  transform: scale(0);
}
@media only screen and (min-width: 1024px) {
  .projects-container .cd-close {
    top: 80px;
  }
}
@media only screen and (min-width: 1170px) {
  .projects-container .cd-close {
    background-image: url("../img/cd-icon-close-desktop.svg");
  }
}



.projects-container .cd-scroll {
  position: absolute;
  bottom: 0;
  left: 50%;
  -webkit-transform: translateX(-50%) scale(0);
  -moz-transform: translateX(-50%) scale(0);
  -ms-transform: translateX(-50%) scale(0);
  -o-transform: translateX(-50%) scale(0);
  transform: translateX(-50%) scale(0);
  background: url("../img/cd-icon-arrow-mobile.svg") rgba(255, 255, 255, 0.50) no-repeat center center;
}

@media only screen and (min-width: 1170px) {
  .projects-container .cd-scroll {
    background-image: url("../img/cd-icon-arrow-desktop.svg");
  }
}

.project-is-open .cd-close,
.project-is-open .cd-scroll {
  visibility: visible;
  -webkit-transform: scale(1);
  -moz-transform: scale(1);
  -ms-transform: scale(1);
  -o-transform: scale(1);
  transform: scale(1);
  -webkit-transition: -webkit-transform 0.4s 0s, visibility 0s 0s;
  -moz-transition: -moz-transform 0.4s 0s, visibility 0s 0s;
  transition: transform 0.4s 0s, visibility 0s 0s;
}

.project-is-open .cd-scroll {
  -webkit-transform: translateX(-50%) scale(1);
  -moz-transform: translateX(-50%) scale(1);
  -ms-transform: translateX(-50%) scale(1);
  -o-transform: translateX(-50%) scale(1);
  transform: translateX(-50%) scale(1);
  -webkit-animation: cd-translate 1.2s 0.4s;
  -moz-animation: cd-translate 1.2s 0.4s;
  animation: cd-translate 1.2s 0.4s;
  -webkit-animation-iteration-count: 2;
  -moz-animation-iteration-count: 2;
  animation-iteration-count: 2;
}

.no-touch .project-is-open .cd-close:hover {
  -webkit-transform: scale(1.2);
  -moz-transform: scale(1.2);
  -ms-transform: scale(1.2);
  -o-transform: scale(1.2);
  transform: scale(1.2);
  text-decoration: none;
  border: 0px solid rgba(0,0,0,0);
}

.no-touch .project-is-open .cd-scroll:hover {
  -webkit-transform: translateX(-50%) scale(1.2);
  -moz-transform: translateX(-50%) scale(1.2);
  -ms-transform: translateX(-50%) scale(1.2);
  -o-transform: translateX(-50%) scale(1.2);
  transform: translateX(-50%) scale(1.2);
  text-decoration: none;
  border: 0px solid rgba(0,0,0,0);
}

@-webkit-keyframes cd-translate {
  0% {
    -webkit-transform: translateX(-50%) scale(1);
  }
  50% {
    -webkit-transform: translateY(10px) translateX(-50%) scale(1);
  }
  100% {
    -webkit-transform: translateX(-50%) scale(1);
  }
}
@-moz-keyframes cd-translate {
  0% {
    -moz-transform: translateX(-50%) scale(1);
  }
  50% {
    -moz-transform: translateY(10px) translateX(-50%) scale(1);
  }
  100% {
    -moz-transform: translateX(-50%) scale(1);
  }
}
@keyframes cd-translate {
  0% {
    -webkit-transform: translateX(-50%) scale(1);
    -moz-transform: translateX(-50%) scale(1);
    -ms-transform: translateX(-50%) scale(1);
    -o-transform: translateX(-50%) scale(1);
    transform: translateX(-50%) scale(1);
  }
  50% {
    -webkit-transform: translateY(10px) translateX(-50%) scale(1);
    -moz-transform: translateY(10px) translateX(-50%) scale(1);
    -ms-transform: translateY(10px) translateX(-50%) scale(1);
    -o-transform: translateY(10px) translateX(-50%) scale(1);
    transform: translateY(10px) translateX(-50%) scale(1);
  }
  100% {
    -webkit-transform: translateX(-50%) scale(1);
    -moz-transform: translateX(-50%) scale(1);
    -ms-transform: translateX(-50%) scale(1);
    -o-transform: translateX(-50%) scale(1);
    transform: translateX(-50%) scale(1);
  }
}
