@import 'https://fonts.googleapis.com/css?family=Karla|Slackey|Sriracha';

body {
    background: radial-gradient(ellipse at center, #7db9e8 0%, #005da6 100%);
    user-select: none;
    perspective: 1000px;
    margin: 0;
    height: 100vh;
    overflow: hidden;
    transform: scale(0.5);
}

* {
    outline: none;
}

.invitation {
    width: 500px;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
}

.envelope {
    background: #ff3c41;
    width: 100%;
    height: calc(500px / 1.625);
    position: relative;
    z-index: 1;
}

.envelope.is-open:before,
.envelope.is-open:after {
    z-index: -2;
}

.envelope:before,
.envelope:after {
    content: "";
    position: absolute;
    bottom: 0;
}

.envelope:before {
    right: 0;
    border-bottom: 0px solid transparent;
    border-top: calc(500px / 1.625) solid transparent;
    border-right: 500px solid #e63636;
    z-index: 1;
}

.envelope:after {
    left: 0;
    border-bottom: 0px solid transparent;
    border-top: calc(500px / 1.625) solid transparent;
    border-left: 500px solid #cc3030;
    z-index: 1;
}

.flap {
    border-right: calc(500px / 2) solid transparent;
    border-top: calc((500px / 2) / 1.625) solid #a82a2a;
    border-left: calc(500px / 2) solid transparent;
    position: absolute;
    left: 0;
    top: 0;
    transform-origin: 50% 0%;
    z-index: 2;
}

.mask {
    box-sizing: border-box;
    clip-path: inset(0 0 50% 0);
    overflow: hidden;
    position: relative;
    width: calc(500px * 0.96);
    height: calc((500px * 1.34) * 3);
    z-index: 0;
    margin: auto;
    top: 50%;
    transform: translate(0, -50%);
    perspective: 1200px;
}

.card {
    position: relative;
    width: calc(500px * 0.96);
    height: calc(500px * 1.34);
    margin: auto;
    transform-style: preserve-3d;
    transform-origin: 50% 10%;
    transform: translate(0, 128%) rotateY(0deg);
}

.face {
    top: 0;
    right: 0;
    bottom: 0;
    left: 0;
    position: absolute;
    background: transparent 50% 100%/auto 100% no-repeat;
    box-shadow: 0 3px 6px rgba(0, 0, 0, 0.3);
}

.face:last-of-type {
    transform: translateZ(-3px) rotateY(180deg);
    background-size: 130% auto;
}

.front {
    background-image: url(https://s3-us-west-2.amazonaws.com/s.cdpn.io/39132/poke-bg.gif);
    /* background-image: url(./hirsch.png); */

}

.front h1 {
    position: relative;
    font: normal 3em/0.9 'Slackey', sans-serif;
    letter-spacing: -2px;
    color: #ffce00;
    padding: 30px 0 0;
    margin: 0;
    -webkit-font-smoothing: subpixel-antialiased;
}

.front h1 img {
    width: 90%;
    display: block;
    margin: auto;
}

.front h1 span {
    display: block;
    text-align: center;
    margin-top: 40px;
    padding: 0 20%;
    margin: auto;
    line-height: 1.3;
}

.front h1 .extrude {
    text-shadow:
        0 1px 0 #e6b800,
        0 2px 0 #cc9900,
        0 3px 0 #b38600,
        0 4px 0 #996600,
        0 5px 0 #804d00,
        0 6px 1px rgba(0, 0, 0, 0.0980392),
        0 0 5px rgba(0, 0, 0, 0.0980392),
        0 1px 3px rgba(0, 0, 0, 0.298039),
        0 3px 5px rgba(0, 0, 0, 0.2),
        0 5px 10px rgba(0, 0, 0, 0.247059);
}

.face.back {
    background-image: url(https://s3-us-west-2.amazonaws.com/s.cdpn.io/39132/poke-bg.jpg);
    color: #000;
    overflow: hidden;
}

.face.back img {
    position: absolute;
    top: 60px;
    display: inline-block;
    width: 90%;
    left: 50%;
    transform: translate(-50%, 0);
}

button {
    font: normal 1.25em 'Karla', sans-serif;
    padding: 15px 30px;
    border-radius: 30px;
    background: #ffce00;
    color: #ff3c41;
    border: none;
    position: absolute;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
    left: 50%;
    top: 170px;
    transform: translate(-50%, -50%);
    transform-origin: 50% 50%;
    z-index: 1;
    cursor: pointer;
    transition: background 0.3s ease-out, color 0.3s ease-out;
}

button.invert {
    color: #ffce00;
    background: #a82a2a;
}
