body {
    display: flex;
    justify-content: center;
    align-items: center;
    height: 100vh;
    background-color: #ffe6f2;
    font-family: 'Arial', sans-serif;
    overflow-y: hidden;
}

.container {
    position: relative;
}

.valentines {
    position: relative;
    top: 50px;
    cursor: pointer;
    animation: up 3s linear infinite;
}

@keyframes up {
    0%, 100% {
        transform: translateY(0);
    }
    50% {
        transform: translateY(-30px);
    }
}

.envelope {
    position: relative;
    width: 300px;
    height: 200px;
    background-color: #f08080;
    cursor: pointer;
    transition: transform 0.3s;
}

.envelope:before {
    background-color: #f08080;
    content: "";
    position: absolute;
    width: 212px;
    height: 212px;
    transform: rotate(45deg);
    top: -105px;
    left: 44px;
    border-radius: 30px 0 0 0;
}

.card {
    position: absolute;
    background-color: #eae2b7;
    width: 270px;
    height: 170px;
    top: 5px;
    left: 15px;
    box-shadow: -5px -5px 100px rgba(0,0,0,0.4);
}

.card:before {
    content: "";
    position: absolute;
    border: 3px solid #003049;
    border-style: dotted;
    width: 240px;
    height: 140px;
    left: 12px;
    top: 12px;
}

.text {
    position: absolute;
    font-family: 'Brush Script MT', cursive;
    font-size: 28px;
    text-align: center;
    line-height: 25px;
    top: 52px;
    left: 85px;
    color: #003049;
}

.heart {
    background-color: #d62828;
    display: inline-block;
    height: 30px;
    margin: 0 10px;
    position: relative;
    top: 100px;
    left:105px;
    transform: rotate(-45deg);
    width: 30px;
}

.heart:before, .heart:after {
    content: "";
    background-color: #d62828;
    border-radius: 50%;
    height: 30px;
    position: absolute;
    width: 30px;
}

.heart:before {
    top: -15px;
    left: 0;
}

.heart:after {
    left: 15px;
    top: 0;
}

.hearts {
    position: absolute;
    top: 10px;
}

@keyframes heart {
    0%{
        transform: translateY(0) rotate(-45deg) scale(0.3);
        opacity: 1;
    }
    100%{
        transform: translateY(-150px) rotate(-45deg) scale(1.3);
        opacity: 0.5;
    }
}

.one, .two, .three, .four, .five {
    background-color: red;
    display: inline-block;
    height: 10px;
    width: 10px;
    margin: 0 10px;
    position: relative;
    transform: rotate(-45deg);
    top: 50px;
}

.one:before, .one:after, .two:before, .two:after, .three:before, .three:after, .four:before, .four:after, .five:before, .five:after {
    content: "";
    background-color: red;
    border-radius: 50%;
    width: 10px;
    height: 10px;
    position: absolute;
}

.one:before, .two:before, .three:before, .four:before, .five:before {
    top: -5px;
    left: 0;
}

.one:after, .two:after, .three:after, .four:after, .five:after {
    left: 5px;
    top: 0;
}

.one {
    left:10px;
    animation: heart 1s ease-out infinite; 
}

.two {
    left:40px;
    animation: heart 2s ease-out infinite; 
}

.three {
    left:65px;
    animation: heart 1.5s ease-out infinite;
}

.four {
    left:90px;
    animation: heart 2.3s ease-out infinite;
}

.five {
    left:120px;
    animation: heart 1.7s ease-out infinite;
}

.front {
    position: absolute;
    border-right: 180px solid #f4978e;
    border-top: 95px solid transparent;
    border-bottom: 100px solid transparent;
    left: 120px;
    top: 5px;
    width: 0;
    height: 0;
    z-index: 10;
}

.front:before {
    position: absolute;
    content:"";
    border-left: 300px solid #f8ad9d;
    border-top: 195px solid transparent;
    left:-120px;
    top:-95px;
    width:0;
    height:0;
}

.shadow {
    position: absolute;
    width: 330px;
    height: 25px;
    border-radius:50%;
    background-color: rgba(0,0,0,0.1);
    top:265px;
    left:-15px;
    animation: scale 3s linear infinite;
    z-index:-1;
}

@keyframes scale {
    0%, 100% {
        transform: scaleX(1);
    }
    50% {
        transform: scaleX(0.85);
    }
}

.letter-modal {
    position: fixed;
    width: 65%;
    height: 90%;
    background: #fffef5;
    border-radius: 10px;
    box-shadow: 0 0 20px rgba(0,0,0,0.1);
    padding: 30px;
    top: 150%;
    left: 50%;
    transform: translateX(-50%);
    transition: all 1s ease;
    z-index: 4;
    cursor: pointer;
    overflow-y: auto;

    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
}

.letter-modal.active {
    top: 50%;
    transform: translate(-50%, -50%);
}

.close-btn {
    align-self: flex-end;
    cursor: pointer;
    font-size: 24px;
}

.letter-content {
    font-family: 'Special Elite', serif;
    padding-left: 8%;
    padding-right: 8%;
    flex-grow: 1;
    margin-bottom: 3%;
}

.letter-content h1 {
    margin-bottom: 40px;
}

.letter-content p {
    font-size: 1em;
    line-height: 1.4;
}

.photo-gallery {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 20px;
    height: auto;
    width: 100%;    
    height: 100%;
}

.photo {
    position: absolute;
    width: min(50vw, 50vh);
    height: min(50vw, 50vh);
    border-radius: 10px;
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
    transition: transform 0.5s;
    cursor: pointer;
}

.photo:nth-child(1) { z-index: 8; transform: rotate(0deg); }
.photo:nth-child(2) { z-index: 7; transform: rotate(-5deg); }
.photo:nth-child(3) { z-index: 6; transform: rotate(7deg); }
.photo:nth-child(4) { z-index: 5; transform: rotate(-4deg); }
.photo:nth-child(5) { z-index: 4; transform: rotate(9deg); }
.photo:nth-child(6) { z-index: 3; transform: rotate(-10deg); }
.photo:nth-child(7) { z-index: 2; transform: rotate(5deg); }
.photo:nth-child(8) { z-index: 1; transform: rotate(-0deg); }

.photo.active {
    transform: rotate(0deg) scale(1.1);
    z-index: 9;
}
