@import url(https://fonts.googleapis.com/css?family=Nunito);

html {
    height: 100%;
    overflow: hidden;
}

body { 
    margin: 0;
    padding: 0;
    perspective: 1px;
    transform-style: preserve-3d;
    height: 100%;
    overflow-y: scroll;
    overflow-x: hidden;
    font-family: Nunito;
}

h1 {
    font-size: 250%;
    margin: 0 0 1rem 0;
}

p {
    font-size: 140%;
    line-height: 150%;
    color: #333;
    margin: 0;
}

.slide {
    position: relative;
    padding: 25vh 10%;
    min-height: 100vh;
    width: 100vw;
    box-sizing: border-box;
    box-shadow: 0 -1px 10px rgba(0, 0, 0, .7);
    transform-style: inherit;
    display: flex;
    align-items: center;
    justify-content: center;
}

.content-wrapper {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    max-width: 1200px;
    gap: 3rem;
    flex-wrap: wrap;
}

.title {
    flex: 1;
    min-width: 350px;
    padding: 5%;
    border-radius: 5px;
    background: rgba(240, 230, 220, .85);
    box-shadow: 0 0 8px rgba(0, 0, 0, .7);
}

.image-link-container {
    flex: 0 0 auto;
    display: flex;
    align-items: center;
    justify-content: center;
}

.image-link {
    position: relative;
    display: block;
    text-decoration: none;
    transition: all 0.3s ease;
}

.image-link:hover {
    transform: translateY(-10px);
}

.image-link img {
    width: 320px;
    height: 240px;
    transform: translateZ(.25px) scale(.75) rotate(2deg);
    padding: 10px;
    border-radius: 5px;
    background: rgba(240, 230, 220, .7);
    box-shadow: 0 0 8px rgba(0, 0, 0, .7);
    transition: all 0.3s ease;
}

.image-link:hover img {
    box-shadow: 0 15px 30px rgba(0, 0, 0, .4);
}

.link-overlay {
    display: none;
}

.slide:before {
    content: "";
    position: absolute;
    top: 0;
    bottom: 0;
    left: 0;
    right: 0;
    box-shadow: 0 0 8px 1px rgba(0, 0, 0, .7);
}

.slide:nth-child(2n) .content-wrapper {
    flex-direction: row-reverse;
}

.slide, .slide:before {
    background: 50% 50% / cover;  
}

.header {
    text-align: center;
    font-size: 175%;
    color: #fff;
    text-shadow: 0 2px 2px #000;
}

#title {
    background-image: url("images/1.png");
    z-index: 2;
}

#title h1 {
    transform: translateZ(.25px) scale(.75);
    transform-origin: 125% 200%;
}

#slide1:before {
    background-image: url("images/2.png");
    transform: translateZ(-1px) scale(2);
}

#slide2 {
    background-image: url("images/3.png");
    z-index: 2;
}

#slide3:before {
    background-image: url("images/4.png");
    transform: translateZ(-1px) scale(2);
}

#slide4 {
    background: #222;
}

@media (max-width: 1024px) {
    .slide {
        padding: 20vh 5%;
    }
    
    .content-wrapper {
        gap: 2rem;
    }
    
    .title {
        min-width: 300px;
        padding: 2rem;
    }
    
    .image-link img {
        width: 280px;
        height: 210px;
    }
    
    h1 {
        font-size: 220%;
    }
    
    p {
        font-size: 130%;
    }
}

@media (max-width: 768px) {
    body {
        perspective: none;
        transform-style: flat;
    }
    
    .slide {
        padding: 10vh 4%;
        transform-style: flat;
        min-height: auto;
    }
    
    .content-wrapper {
        flex-direction: column !important;
        text-align: center;
        gap: 2rem;
        align-items: center;
    }
    
    .title {
        min-width: auto;
        width: 100%;
        max-width: 500px;
        padding: 2rem;
        order: 1;
    }
    
    .image-link-container {
        order: 2;
        width: auto;
    }
    
    .image-link img {
        width: 280px;
        height: 210px;
        transform: none;
    }
    
    .image-link:hover {
        transform: translateY(-5px);
    }
    
    .slide:before {
        transform: none !important;
    }
    
    #title h1 {
        transform: none;
    }
    
    h1 {
        font-size: 200%;
    }
    
    p {
        font-size: 120%;
        line-height: 140%;
    }
}

@media (max-width: 480px) {
    .slide {
        padding: 8vh 3%;
    }
    
    .title {
        padding: 1.5rem;
        max-width: none;
    }
    
    .image-link img {
        width: 240px;
        height: 180px;
    }
    
    h1 {
        font-size: 180%;
    }
    
    p {
        font-size: 110%;
        line-height: 130%;
    }
    
    .content-wrapper {
        gap: 1.5rem;
    }
}

@media (max-width: 360px) {
    .slide {
        padding: 5vh 2%;
    }
    
    .title {
        padding: 1rem;
    }
    
    .image-link img {
        width: 200px;
        height: 150px;
    }
    
    h1 {
        font-size: 160%;
    }
    
    p {
        font-size: 100%;
    }
}

@media (prefers-reduced-motion: reduce) {
    .slide, .image-link, .image-link img {
        transition: none;
    }
    
    body {
        perspective: none;
        transform-style: flat;
    }
    
    .slide:before {
        transform: none !important;
    }
    
    #title h1 {
        transform: none;
    }
}