html,
button,
input,
select,
textarea {
  background: #333;
  color: #fff;
}

html {
  font-size: 1em;
  line-height: 1.4;
}
audio,
canvas,
img,
video {
  vertical-align: middle;
}
p a {
  color: #d14747;
}
button {
  outline: none;
}

.header {
  background: #000;
  text-align: center;
  padding: 10px 0;
}
.header p {
  margin: 0;
  height: 22px;
  line-height: 22px;
  vertical-align: middle;
}
.header img {
  margin: -3px 3px 0 0;
}

.container {
  width: 800px;
  margin: 0 auto 40px;
}
.nav {
  margin-top: 10px;
}
.nav-link {
  display: inline-block;
  width: 148px;
  padding: 0 10px 10px 0;
  opacity: 0.4;
  border-bottom: 0px;
  /* -webkit-transition: opacity 0.5s;
  transition: opacity 0.5s; */
}
.nav-link:nth-child(5n+1) {
  padding-right: 0;
}
.nav-link:hover {
  opacity: 0.9;
}
.nav-link.active {
  opacity: 1;
}
.nav img {
  width: 100%;
  height: auto;
  border-bottom: 0px;
  /* -webkit-transition: border-bottom 0.5s, -webkit-transform 0.5s;
  transition: border-bottom 0.5s, transform 0.5s; */
}
.nav-link:hover img {
  /* transform: translateX(4px);
  -webkit-transform: translateX(4px); */
}
.nav-link.active img {
  border-bottom: 4px solid #d14747;
}
.content {
  position: relative;
  width: 100%;
  height: 542px;
}
.image-container {
  width: 100%;
  height: 100%;
  position: absolute;
  overflow: hidden;
  top: 0;
  left: 0;
  z-index: 0;
  opacity: 0;
  /* -webkit-transition: opacity 0.5s;
  transition: opacity 0.5s; */
}
.image-container.active {
  z-index: 10;
  opacity: 1;
}
.mask-mode .image-container,
.mask-mode .image-container.active {
  opacity: 1;
  z-index: 10;
}
.mask-mode .image-container.active ~ .image-container {
  z-index: 0;
  opacity: 0;
}
.image-container .image,
.image-container .canvas {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
}
.mask-mode .image-container .canvas {
  cursor: crosshair;
}
.drawing-board {
  display: none;
  width: 100%;
  height: 100%;
  position: absolute;
  top: 0;
  left: 0;
  z-index: 10;
  cursor: crosshair;
}
.drawing-board .shape {
  background: #d14747;
  opacity: 0.3;
  position: absolute;
}
.drawing-board.active {
  display: block;
}
.image-label {
  position: absolute;
  top: 10px;
  left: 10px;
  font-size: 1.2em;
  color: #fff;
  text-shadow: 2px 2px 2px rgba(0,0,0,0.5);
  text-transform: uppercase;
}
.image-section-matrix {
  position: absolute;
  width: 500px;
  height: 342px;
  top: 0;
  left: 0;
  background: #fff;
  opacity: 0.4;
  box-sizing:border-box;
  -moz-box-sizing:border-box;
  transform: translate(150px, 100px);
  -webkit-transform: translate(150px, 100px);
  -moz-transform: translate(150px, 100px);
  -o-transform: translate(150px, 100px); 
  transform-origin: 0 0;
  -webkit-transform-origin: 0 0;
  -moz-transform-origin: 0 0;
  -o-transform-origin: 0 0;
}
.handle {
  position: absolute;
  width: 20px;
  height: 20px;
  background: #ef7575;
  border-radius: 5px;
  cursor: move;
}
.handle:hover {
  background: #f2aeae;
}
.handle.tl {
  top: 95px;
  left: 145px;
}
.handle.tr {
  top: 95px;
  right: 145px;
}
.handle.bl {
  bottom: 95px;
  left: 145px;
}
.handle.br {
  bottom: 95px;
  right: 145px;
}

.controls {
  width: 100%;
  margin: 20px 0;
  text-align: right;
}
.controls .switch {
  width: 420px;
  float: right;
  margin-left: 20px;
}
.controls button {
  float: right;
  background: #d14747;
  background-image: -webkit-linear-gradient(top, rgba(255, 255, 255, 0.2), rgba(0, 0, 0, 0));
  background-image: linear-gradient(to bottom, rgba(255, 255, 255, 0.2), rgba(0, 0, 0, 0));
  box-shadow: 0 1px 1px rgba(0, 0, 0, 0.2), inset 0 1px 1px rgba(255, 255, 255, 0.45);
  border: none;
  margin-left: 20px;
  font-size: 1em;
  height: 30px;
  line-height: 30px;
  padding: 0 30px;
  border-radius: 3px;
  vertical-align: middle;
  font-weight: bold;
  -webkit-transition: background-color 0.5s;
  transition: background-color 0.5s;
}
.controls button:hover {
  background-color: #dd5858;
}
.switch-light input:focus ~ a, .switch-light input:focus + label,
.switch-toggle input:focus ~ a, .switch-toggle input:focus + label {
  outline: none;
}
.switch-candy a {
  background-color: #d14747;
}
.switch-candy input:checked + label {
  color: #fff;
  text-shadow: none;
}

.invisible {
  opacity: 0;
}
.hide {
  display: none;
}
.clearfix:before,
.clearfix:after {
  content: " ";
  display: table;
}
.clearfix:after {
  clear: both;
}
.clearfix {
  *zoom: 1;
}
