html, body{
margin:0;
padding:0;
height:100%;
background:url(images/background.jpg) no-repeat center center fixed;
-webkit-backround-size: cover;
-moz-background-size: cover;
-o-background-size: cover;
background-size: cover;
}

.gallery{
margin:0 auto;
width:800px;
height:600px;
background:#333;
box-shadow:0px 0px 15px 1px #333;
-webkit-box-shadow:0px 0px 15px 1px #333;
-moz-box-shadow:0px 0px 15px 1px #333;
position:relative;
}

.gallery
a{
float:left;
width:25%;
height:25%;
position:relative;
border:1px solid #333;
-moz-box-sizing:border-box;
-webkit-box-sizing:border-box;
box-sizing:border-box;
}

.gallery
a img{
display:block;
width:100%;
height:100%;
-webkit-transition-property:width, height;
-webkit-transition-duration:300ms;
-moz-transition-property:width, height;
-moz-transition-duration:300ms;
-o-transition-property:width, height;
-o-transition-duration:300ms;
position:absolute;
z-index:1;
opacity:0.6;
cursor:pointer;
}

.gallery
a:after {
display:block;
position:absolute;
width:100%;
height:100%;
color:#eaeaea;
font-family: "Trebuchet MS";
font-size:16px;
opacity:0.9;
}

.closed{
position:absolute;
top:10px;
right:-50px;
display:none;
text-align:center;
font-weight:bold;
font-size:70px;
color:#fff;
width:20px;
height:20px;
-webkit-text-shadow:0px 0px 5px #222;
-moz-text-shadow:0px 0px 5px #222;
text-shadow:0px 0px 5px #222;
-moz-transform:rotate(45deg);
-o-transform:rotate(45deg);
-webkit-transform:rotate(45deg);
cursor:pointer;
z-index:3;
}

.gallery
a:focus~.closed{
display:block;
}

.gallery
a:focus img{
width:250%;
height:250%;
position:absolute;
opacity:1;
z-index:2;
box-shadow:0 0 15px 2px #000;
-moz-box-shadow:0 0 15px 2px #000;
-webkit-box-shadow:0 0 15px 2px #000;
-webkit-transition-property:width, height;
-webkit-transition-duration:2s;
-webkit-transition-delay:0.3s;
-moz-transition-property:width, height;
-moz-transition-duration:2s;
-moz-transition-delay:0.3s;
-o-transition-property:width, height;
-o-transition-duration:2s;
-o-transition-delay:0.3s;
cursor:default;
}

.gallery
a:nth-child(5n+5) img, a:nth-child(5n+3) img{
right:0;
}

.gallery
a:nth-child(n+13) img{
bottom:0;
}

img {
    pointer-events: none;
}