@font-face {
    font-family: Apercu;
    src: url(fonts/Apercu\ Regular.ttf);
}

body {
    margin: 0;
    font-family: Apercu, sans-serif;
    background-color: #121830;
}

.scene {
    width: 100vw;
    height: 100dvh;
    overflow: hidden;
    position: fixed;
    background-image: url(images/L3_Scene.png), url(images/L2_Snow.png), url(images/L1_Skybox.png);
    background-position: center;
    background-size: cover, auto, cover;
    background-repeat: no-repeat, repeat, no-repeat;
    --scroll-speed: 10s;
    --scroll-distance: 428px;  /* should match image's rendered height */
    animation: infiniteScroll var(--scroll-speed) linear infinite;
    -webkit-animation: infiniteScroll var(--scroll-speed) linear infinite;
}

@keyframes infiniteScroll {
    from {background-position: center, 50% 0, center;}
    to {background-position: center, 50% var(--scroll-distance), center;}
}

.projector-screen {
    position: relative;
    top: 0px;
    left: 50%;
    transform: translate(-50%, -100%);  /* hidden above the viewport */
    height: 47%;
    min-height: 47%;
    background-image: url(images/L4_Screen.png);
    background-size: auto 100%;
    background-repeat: no-repeat;
    background-position: top;
    color: #fff;
}

.projector-screen.animate {
    animation: pullDownScreen 3s ease-in-out forwards;
    -webkit-animation: pullDownScreen 3s ease-in-out forwards;
}

@keyframes pullDownScreen {
    from {transform: translate(-50%, -100%);}
    to {transform: translate(-50%, 0%);}
}

.projector-screen .slide {
    position: absolute;
    /* width: 100%; */
    height: 100%;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    display: none;
    opacity: 0;
    transition-property: display, opacity;
    transition-duration: 1s;
    transition-delay: 0.5s;
    transition-behavior: allow-discrete;
}

.projector-screen .slide.active {
    display: block;
    opacity: 1;

    @starting-style {
        opacity: 0;
    }
}

.projector-screen .slide img {
    display: block;
    margin: auto;
    height: 100%;
}

.aspect-ratio-16-9 {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    overflow: hidden;
    z-index: -99;
}

.fireplace {
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    bottom: 30.7%;
    width: 7%;
}

@media screen and (max-aspect-ratio: 16/9) {
    .aspect-ratio-16-9 {
        width: 177.78vh;
        height: 100dvh;
    }
}

@media screen and (min-aspect-ratio: 16/9) {
    .aspect-ratio-16-9 {
        width: 100vw;
        height: 56.25vw;
    }
}

.reel {
    display: none;
    opacity: 0;
    position: fixed;
    bottom: 0%;
    left: 50%;
    --rotate: 0deg;
    transform: translate(-50%, 50%) rotate(var(--rotate));
    transition-property: transform, display, opacity;
    transition-duration: 0.5s, 1s;
    transition-timing-function: ease-in-out, ease-in;
    transition-behavior: allow-discrete;
    width: 40vw;
    height: 40vw;
    min-width: 350px;
    min-height: 350px;
    max-width: 75vh;
    max-height: 75vh;
}

.reel.ready {
    display: block;
    opacity: 1;

    @starting-style {
        opacity: 0;
    }
}

.reel .controls {
    position: absolute;
    display: grid;
    width: 100%;
    height: 100%;
    --angle-per-image: 1turn / 14;   /* any way to not hardcode numOfSlides here? */
    --offset: var(--angle-per-image) / -2;
    --radius: 275%;
}

.reel .controls button {
    --calculated-angle: calc(var(--i)*var(--angle-per-image));
    width: 10%;
    height: 11.4%;
    background-color: transparent;
    outline: solid #4d74cf;
    transition: outline 0.2s ease-in;
    border-radius: 20%;
    border: 0;
    cursor: pointer;
    grid-area: 1 / 1;
    place-self: center;
    transform:
        rotate(calc(var(--calculated-angle) - var(--offset)))
        translateY(calc(var(--radius) * -1));
}

.reel .controls button:hover {
    outline: solid #ffc973;
    transition: outline 0.2s ease-in;
}

.reel img {
    width: 100%;
}

@media only screen and (max-width: 600px) {
    .reel {
        width: 98vw;
        height: 98vw;
        min-width: auto;
        min-height: auto;
    }
}

.intro {
    position: fixed;
    top: 0;
    width: 100vw;
    height: 100dvh;
    overflow: hidden;
    background-color: #52000080;
    z-index: 99;
    transition-property: display, opacity;
    transition-duration: 1s;
    transition-behavior: allow-discrete;
  }

  .intro .poem {
    position: relative;
    top: 50%;
    transform: translateY(-50%);
    margin: auto;
    width: fit-content;
    padding: 5vh;
    text-align: center;
    color: #ece5dd;
    background-color: #270000;
    outline: solid #b7a8a8 1px;
    box-shadow: 0px 0px 100px #ff9500a5;
}

.intro .poem p {
    font-size: 2.8vh;
    line-height: 1.4em;
    margin: 0 0 20px;
}

.intro .poem button {
    font-family: Apercu;
    font-size: 2.4vh;
    color: #fff;
    padding: 0.4em 1.2em;
    border-radius: 4em;
    outline: solid #e3dcdc 1px;
    background-color: #3c0000;
    box-shadow: 0px 0px 10px #ff9500a5;
    cursor: pointer;
    transition-property: background-color, box-shadow;
    transition-duration: 0.2s;
    transition-timing-function: ease-in;
}

.intro .poem button:hover {
    background-color: #611515;
    box-shadow: 0px 0px 18px #ff9500a5;
}