/* ==================================================
   FONTS
================================================== */

@import url("https://fonts.googleapis.com/css2?family=Cormorant+SC:wght@400;500;600&display=swap");

@font-face {
    font-family: "Anastacia Script";
    src: url("anastasia-script.ttf") format("truetype");
    font-style: normal;
    font-weight: 400;
    font-display: swap;
}

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

html,
body {
    width: 100%;
    min-height: 100%;
}

html {
    background: #cfc5b5;
}

body {
    min-height: 100vh;
    min-height: 100svh;
    overflow: hidden;
    background: #cfc5b5;
    color: #ffffff;
    font-family: "Cormorant SC", Georgia, serif;
}

.landing-page {
    position: relative;
    isolation: isolate;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    min-height: 100vh;
    min-height: 100svh;
    overflow: hidden;
    background-image: url("invitation-background.png");
    background-position: center center;
    background-repeat: no-repeat;
    background-size: cover;
}

.landing-page::before {
    content: "";
    position: absolute;
    inset: -18px;
    z-index: -2;
    background-image: url("invitation-background.png");
    background-position: center center;
    background-repeat: no-repeat;
    background-size: cover;
    animation:
        backgroundFadeIn 1s ease both,
        backgroundSlowZoom 18s ease-in-out infinite alternate;
    pointer-events: none;
}

.background-overlay {
    position: absolute;
    inset: 0;
    z-index: -1;
    background: linear-gradient(to bottom, rgba(25,22,18,.01) 0%, rgba(25,22,18,.01) 58%, rgba(20,18,14,.11) 100%);
    pointer-events: none;
}

.invitation-content {
    position: relative;
    z-index: 2;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: min(96vw, 900px);
    min-height: 100vh;
    min-height: 100svh;
    padding: max(18px, env(safe-area-inset-top)) 16px max(18px, env(safe-area-inset-bottom));
    text-align: center;
}

.invitation-heading {
    position: relative;
    z-index: 4;
    margin-bottom: 0px;
}

.small-heading {
    margin-bottom: 45px;
    color: #ffffff;
    font-family: "Cormorant SC", Georgia, serif;
    font-size: clamp(16px, 1.35vw, 20px);
    font-weight: 500;
    line-height: 1;
    letter-spacing: 0;
    text-transform: none;
    white-space: nowrap;
    text-shadow: 0 2px 7px rgba(0,0,0,.22);
    opacity: 0;
    transform: translateY(-12px);
    animation: headingFadeDown .95s ease .12s forwards;
}

.couple-name {
    color: #ffffff;
    font-family: "Anastacia Script", "Edwardian Script ITC", cursive;
    font-size: clamp(92px, 8vw, 128px);
    font-weight: 400;
    line-height: .82;
    letter-spacing: -.015em;
    margin-bottom: 50px;
    white-space: nowrap;
    text-shadow: 0 3px 10px rgba(0,0,0,.16);
    opacity: 0;
    transform: translateY(9px) scale(.98);
    animation: nameReveal 1.15s cubic-bezier(.22,1,.36,1) .3s forwards;
}

.envelope-wrapper {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    width: min(70vw, 780px);
    margin-top: 0px;
    margin-bottom: 5px;
    opacity: 0;
    transform: translateY(30px) scale(.97);
    animation: envelopeReveal 1.18s cubic-bezier(.22,1,.36,1) .58s forwards;
}

.envelope-image {
    display: block;
    width: 100%;
    height: auto;
    object-fit: contain;
    user-select: none;
    -webkit-user-drag: none;
    filter: drop-shadow(0 14px 11px rgba(0,0,0,.26));
}

.open-invitation-button {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 250px;
    padding: 5px 12px;
    border: 0;
    outline: 0;
    border-radius: 0;
    background: transparent;
    color: #ffffff;
    font-family: "Cormorant SC", Georgia, serif;
    font-size: clamp(17px, 1.4vw, 21px);
    font-weight: 500;
    line-height: 1;
    letter-spacing: 0;
    text-transform: none;
    text-shadow: 0 2px 7px rgba(0,0,0,.34);
    cursor: pointer;
    opacity: 0;
    transform: translateY(12px);
    animation: openButtonReveal .85s ease 1s forwards;
    transition: opacity .2s ease, transform .2s ease, text-shadow .2s ease;
}

.open-invitation-button:hover {
    transform: translateY(-1px);
    text-shadow: 0 3px 10px rgba(0,0,0,.45);
}

.open-invitation-button:active {
    transform: scale(.97);
}

.open-invitation-button:focus-visible {
    outline: 1px solid rgba(255,255,255,.8);
    outline-offset: 5px;
}

.open-invitation-button:disabled {
    cursor: wait;
    opacity: .82;
}

.button-spinner {
    display: none;
    width: 14px;
    height: 14px;
    margin-left: 9px;
    border: 2px solid rgba(255,255,255,.4);
    border-top-color: #fff;
    border-radius: 50%;
    animation: spinnerRotate .7s linear infinite;
}

.open-invitation-button.opening .button-spinner {
    display: inline-block;
}

.status-message {
    display: none;
    width: min(90vw, 470px);
    margin-top: 13px;
    padding: 10px 14px;
    border: 1px solid rgba(255,255,255,.3);
    border-radius: 9px;
    background: rgba(24,21,17,.65);
    color: #fff;
    font-family: Arial, sans-serif;
    font-size: 12px;
    line-height: 1.5;
    text-align: center;
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
}

.status-message.show { display: block; }

.music-button {
    position: fixed;
    right: max(16px, env(safe-area-inset-right));
    bottom: max(16px, env(safe-area-inset-bottom));
    z-index: 100;
    display: none;
    align-items: center;
    justify-content: center;
    width: 48px;
    height: 48px;
    padding: 0;
    border: 1px solid rgba(255,255,255,.45);
    border-radius: 50%;
    background: rgba(77,64,53,.82);
    color: #fff;
    font-size: 21px;
    line-height: 1;
    cursor: pointer;
    box-shadow: 0 6px 20px rgba(0,0,0,.25);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
}

.music-button.show { display: flex; }

@keyframes backgroundFadeIn { from {opacity:0;} to {opacity:1;} }
@keyframes backgroundSlowZoom { from {transform:scale(1);} to {transform:scale(1.035);} }
@keyframes headingFadeDown { from {opacity:0; transform:translateY(-12px);} to {opacity:1; transform:translateY(0);} }
@keyframes nameReveal { from {opacity:0; transform:translateY(9px) scale(.98);} to {opacity:1; transform:translateY(0) scale(1);} }
@keyframes envelopeReveal { from {opacity:0; transform:translateY(30px) scale(.97);} to {opacity:1; transform:translateY(0) scale(1);} }
@keyframes openButtonReveal { from {opacity:0; transform:translateY(12px);} to {opacity:1; transform:translateY(0);} }
@keyframes spinnerRotate { to {transform:rotate(360deg);} }

@media (max-width: 900px) {
    .invitation-heading { margin-bottom: 17px; }
    .couple-name { font-size: clamp(72px, 10vw, 100px); }
    .envelope-wrapper { width: min(58vw, 480px); margin-bottom: 25px; }
}

@media (max-width: 600px) {@media (max-width: 600px) {
    .invitation-content {
        width: 100%;
        padding-left: 12px;
        padding-right: 12px;
    }

    .invitation-heading {
        margin-bottom: 40px;
    }

    .small-heading {
        margin-bottom: 4px;
        font-size: clamp(14px, 4vw, 17px);
    }

    .couple-name {
        font-size: clamp(65px, 17.5vw, 84px);
        line-height: .82;
        letter-spacing: -.018em;
    }

    .envelope-wrapper {
        width: min(82vw, 430px);
        margin-top: 0;
        margin-bottom: 55px;
    }

    .open-invitation-button {
        min-width: 220px;
        padding: 5px 10px;
        font-size: clamp(17px, 4.8vw, 20px);
    }

    .music-button {
        width: 45px;
        height: 45px;
        font-size: 19px;
    }

}

@media (max-height: 700px) {
    .invitation-content { padding-top: 9px; padding-bottom: 9px; }
    .invitation-heading { margin-bottom: 10px; }
    .small-heading { margin-bottom: 2px; font-size: 14px; }
    .couple-name { font-size: clamp(57px, 11vh, 80px); }
    .envelope-wrapper { width: min(45vh, 420px); margin-bottom: 15px; }
    .open-invitation-button { font-size: 17px; }
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        scroll-behavior: auto !important;
        animation-duration: .01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: .01ms !important;
    }
}
