@font-face {
    font-family: 'Mona Sans';
    font-style: normal;
    font-display: swap;
    font-weight: 200 900;
    src: url('https://cdn.jsdelivr.net/fontsource/fonts/mona-sans:vf@latest/latin-wght-normal.woff2') format('woff2-variations');
}

*, *::before, *::after { box-sizing: border-box; }
* { margin: 0; padding: 0; }

html, body {
    height: 100%;
    font-family: 'Mona Sans', sans-serif;
    background: #FFD8D9;
}

img { max-width: 100%; vertical-align: middle; }

.ss-page {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 32px;

    min-height: 100vh;
    padding: 48px 24px 64px;
}

.ss-header {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    text-align: center;
}

.ss-header h1 {
    font-weight: 700;
    font-size: 36px;
    line-height: 44px;
    letter-spacing: -0.5px;
    color: #351913;
}

.ss-header p {
    max-width: 320px;
    font-size: 16px;
    line-height: 24px;
    letter-spacing: -0.5px;
    color: #7D7A78;
}

/* Stage =================================================================== */

.ss-stage {
    position: relative;
    width: 100%;
    max-width: 360px;
    aspect-ratio: 4 / 5;
}

.ss-backdrop {
    position: absolute;
    inset: -24px;
    z-index: 0;

    background-position: center;
    background-size: cover;

    filter: blur(28px) saturate(1.2) brightness(0.75);
    opacity: 0;
    transition: opacity 1.2s ease, background-image 0s;
    border-radius: 32px;
}

.ss-backdrop.is-visible { opacity: 0.65; }

.ss-frame {
    position: absolute;
    inset: 0;
    z-index: 1;

    display: flex;
    align-items: center;
    justify-content: center;

    overflow: hidden;
    border-radius: 24px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.28);
    background: transparent;
}

.ss-status {
    padding: 24px;
    font-size: 16px;
    line-height: 24px;
    text-align: center;
    color: #7D7A78;
}

/* Slides ================================================================== */

.ss-slide {
    position: absolute;
    inset: 0;
    z-index: 2;

    opacity: 0;
    transform: translateX(14%) scale(1.08) rotate(2deg);
    transition: transform 1.2s cubic-bezier(0.22, 0.61, 0.36, 1),
                opacity 0.9s ease,
                filter 1.2s ease;
    will-change: transform, opacity, filter;
}

.ss-slide.is-active {
    opacity: 1;
    transform: translateX(0) scale(1) rotate(0deg);
    filter: blur(0);
}

.ss-slide.is-leaving {
    opacity: 0;
    transform: translateX(-14%) scale(0.94) rotate(-2deg);
    filter: blur(6px);
}

.ss-slide img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    display: block;
}

/* Ken Burns drift while the slide is on screen */
.ss-slide.is-active img {
    animation: ss-kenburns var(--ss-duration, 6000ms) ease-out forwards;
}

@keyframes ss-kenburns {
    from { transform: scale(1); }
    to   { transform: scale(1.06); }
}

.ss-slide figcaption {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 3;

    padding: 40px 16px 16px;

    font-family: 'Caveat', sans-serif;
    font-weight: 700;
    font-size: 22px;
    text-align: center;
    color: #ffffff;

    background: linear-gradient(180deg, rgba(0,0,0,0) 0%, rgba(0,0,0,0.55) 100%);

    opacity: 0;
    transform: translateY(8px);
    transition: opacity 0.6s ease 0.4s, transform 0.6s ease 0.4s;
}

.ss-slide.is-active figcaption {
    opacity: 1;
    transform: translateY(0);
}

/* Progress bar ============================================================ */

.ss-progress {
    width: 100%;
    max-width: 360px;
    height: 4px;
    border-radius: 4px;
    overflow: hidden;
    background: #ffb2b7;
}

.ss-progress span {
    display: block;
    width: 0%;
    height: 100%;
    background: #E05856;
}

.ss-progress span.is-running {
    width: 100%;
    transition: width var(--ss-duration, 6000ms) linear;
}

/* Misc ==================================================================== */

.ss-skip {
    background: #E05856;
    color: #ffffff;
    border: 0;
    border-radius: 999px;
    padding: 10px 20px;
    font-family: inherit;
    font-weight: 600;
    font-size: 16px;
    cursor: pointer;
}

.ss-skip:active { transform: scale(0.96); }

.ss-back-link {
    font-weight: 600;
    font-size: 16px;
    text-decoration: none;
    color: #7D7A78;
}

/* Scale up for TVs, projectors and laptops at the party. */
@media (min-width: 768px) {
    .ss-page {
        justify-content: center;
        gap: 40px;
        padding: 56px 24px;
    }

    .ss-header h1 { font-size: 52px; line-height: 60px; }
    .ss-header p { max-width: 480px; font-size: 18px; }

    .ss-stage {
        max-width: none;
        aspect-ratio: auto;
        width: min(92vw, 1280px);
        height: min(80vh, 860px);
    }

    .ss-progress { max-width: min(92vw, 1280px); }

    .ss-slide figcaption { font-size: 30px; }

    .ss-skip { font-size: 18px; padding: 12px 26px; }
}
