@import url('https://fonts.googleapis.com/css2?family=DM+Sans:wght@400;500;600;700;800&family=Playfair+Display:wght@400;500;600;700&display=swap');

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    min-height: 100vh;
    background:
        radial-gradient(circle at 20% 20%, #54213f 0%, transparent 35%),
        radial-gradient(circle at 80% 80%, #38152f 0%, transparent 35%),
        #180d19;
    color: #fff;
    font-family: 'DM Sans', sans-serif;
    overflow-x: hidden;
}

#particles {
    position: fixed;
    inset: 0;
    overflow: hidden;
    pointer-events: none;
    z-index: 0;
}

.particle {
    position: absolute;
    bottom: -40px;
    color: #ff9fc8;
    opacity: 0;
    animation: floatUp linear infinite;
}

@keyframes floatUp {
    0% {
        transform: translateY(0) rotate(0deg);
        opacity: 0;
    }
    15% {
        opacity: .55;
    }
    85% {
        opacity: .35;
    }
    100% {
        transform: translateY(-110vh) rotate(180deg);
        opacity: 0;
    }
}

#app {
    position: relative;
    z-index: 1;
    min-height: 100vh;
    width: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 25px 16px;
}

.welcome-screen {
    width: 100%;
    max-width: 560px;
    padding: 45px 30px;
    text-align: center;
    background: rgba(255, 255, 255, .055);
    border: 1px solid rgba(255, 255, 255, .12);
    border-radius: 28px;
    backdrop-filter: blur(18px);
    -webkit-backdrop-filter: blur(18px);
    box-shadow: 0 25px 80px rgba(0, 0, 0, .25);
    animation: appear .8s ease both;
}

@keyframes appear {
    from {
        opacity: 0;
        transform: translateY(22px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.floating-heart {
    font-size: 55px;
    color: #ff8fba;
    margin-bottom: 22px;
    animation: heartbeat 1.8s infinite;
}

@keyframes heartbeat {
    0%, 100% { transform: scale(1); }
    15% { transform: scale(1.13); }
    30% { transform: scale(1); }
    45% { transform: scale(1.1); }
}

.eyebrow {
    color: #f5a7c8;
    font-size: 11px;
    font-weight: 800;
    letter-spacing: 3px;
    margin-bottom: 18px;
}

h1 {
    font-family: 'Playfair Display', serif;
    font-size: clamp(32px, 8vw, 48px);
    line-height: 1.2;
    font-weight: 600;
    margin-bottom: 20px;
}

h1 span {
    color: #ff9fc8;
}

.intro {
    color: #d8c7d2;
    font-size: 15px;
    line-height: 1.9;
    max-width: 410px;
    margin: 0 auto 30px;
}

button {
    border: none;
    cursor: pointer;
    font-family: inherit;
    font-size: 14px;
    font-weight: 700;
    padding: 16px 27px;
    border-radius: 50px;
    color: #351426;
    background: linear-gradient(135deg, #ffc2dc, #f28ab7);
    box-shadow: 0 8px 28px rgba(242, 138, 183, .2);
    transition: transform .25s, box-shadow .25s;
}

button:hover {
    transform: translateY(-3px);
    box-shadow: 0 12px 35px rgba(242, 138, 183, .35);
}

button:active {
    transform: scale(.97);
}

button span {
    margin-left: 8px;
}

.no-button {
    display: block;
    margin: 13px auto 0;
    color: #fff;
    background: rgba(255, 255, 255, .09);
    border: 1px solid rgba(255, 255, 255, .15);
    box-shadow: none;
}

.signature {
    color: #b99aaa;
    font-family: 'Playfair Display', serif;
    font-style: italic;
    font-size: 14px;
    margin-top: 30px;
}

/* ENVELOPE */

.envelope {
    position: relative;
    width: 210px;
    height: 140px;
    margin: 35px auto 25px;
    cursor: pointer;
    perspective: 800px;
}

.envelope-back {
    position: absolute;
    inset: 0;
    background: #d77c9e;
    border-radius: 8px;
}

.envelope-paper {
    position: absolute;
    z-index: 1;
    width: 88%;
    height: 90%;
    left: 6%;
    top: 5%;
    background: #fff3f7;
    color: #b54c78;
    font-size: 42px;
    display: grid;
    place-items: center;
    border-radius: 5px;
    transition: transform .7s ease;
}

.envelope-flap {
    position: absolute;
    z-index: 3;
    inset: 0;
    background: #f1a0bd;
    clip-path: polygon(0 0, 100% 0, 50% 60%);
    transform-origin: top;
    transition: transform .7s ease;
}

.envelope-heart {
    position: absolute;
    z-index: 4;
    top: 52px;
    left: 50%;
    transform: translateX(-50%);
    color: #8c3158;
    font-size: 25px;
}

.envelope.opened .envelope-flap {
    transform: rotateX(180deg);
}

.envelope.opened .envelope-paper {
    transform: translateY(-85px);
}

/* CARTA */

.letter-content {
    display: none;
    width: 100%;
    margin-top: 30px;
    animation: appear .8s ease both;
}

.letter-content.visible {
    display: block;
}

.letter-inner {
    background: #fff8fa;
    color: #563344;
    padding: 30px 25px;
    border-radius: 15px;
    text-align: left;
    box-shadow: 0 15px 45px rgba(0, 0, 0, .2);
}

.letter-decoration {
    text-align: center;
    color: #d76b99;
    font-size: 28px;
    margin-bottom: 15px;
}

.letter-date {
    color: #bd7392;
    font-size: 10px;
    font-weight: 800;
    letter-spacing: 2px;
    text-align: center;
    margin-bottom: 20px;
}

.letter-inner h2 {
    font-family: 'Playfair Display', serif;
    font-size: 27px;
    margin-bottom: 20px;
}

.letter-inner p:not(.letter-date) {
    font-size: 14px;
    line-height: 1.9;
    margin-bottom: 17px;
}

.letter-ending {
    margin-top: 28px;
    font-family: 'Playfair Display', serif;
    font-style: italic;
    line-height: 1.8;
}

.letter-ending strong {
    display: block;
    color: #bd4d7c;
    font-size: 22px;
    font-style: normal;
}

.finish-button {
    margin-top: 25px;
    width: 100%;
}

/* TELA FINAL */

.final-screen {
    overflow: hidden;
}

.final-heart {
    font-size: 70px;
    color: #ff9fc8;
    margin-bottom: 25px;
    animation: heartbeat 1.5s infinite;
}

.final-message {
    color: #f1d9e5;
    font-family: 'Playfair Display', serif;
    font-size: 18px;
    line-height: 1.9;
    margin: 20px auto 28px;
    max-width: 400px;
}

.final-signature {
    color: #ffb5d2;
    font-family: 'Playfair Display', serif;
    font-size: 24px;
    font-style: italic;
    margin-top: 25px;
}

@media (max-width: 500px) {
    #app {
        padding: 18px 12px;
        align-items: flex-start;
    }

    .welcome-screen {
        padding: 38px 20px;
        margin: auto 0;
        border-radius: 23px;
    }

    .letter-inner {
        padding: 25px 20px;
    }

    .letter-inner p:not(.letter-date) {
        font-size: 13px;
    }

    .envelope {
        transform: scale(.92);
    }
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: .01ms !important;
        animation-iteration-count: 1 !important;
        scroll-behavior: auto !important;
    }
}