@font-face {
    font-family: 'EBGaramond8';
    src: url('fonts/EBGaramond08-Regular.woff') format('woff');
    font-weight: normal;
    font-style: normal;
}

@font-face {
    font-family: 'EBGaramond8';
    src: url('fonts/EBGaramond08-Italic.woff') format('woff');
    font-weight: normal;
    font-style: italic;
}

body,
html {
    margin: 0;
    padding: 0;
    height: 100%;
    background: linear-gradient(to bottom, #ffcccb, #ffebee);
    background-image: url("back2.jpg");
    background-size: cover;
    background-repeat: repeat-y;
    background-position: center center;
    background-attachment: fixed;
}

h1, h2, h3, h4, h5, h6 {
    font-family: 'EBGaramond8', serif;
}

body {
    font-family: 'EBGaramond8', serif;
}

.container {
    display: flex;
    justify-content: center;
    align-items: center;
    height: 100vh;
    width: 100%;
    position: relative;
    z-index: 10;
}

.petals-container {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    overflow: hidden;
}

.petal {
    position: absolute;
    width: 30px;
    height: 30px;
    background: url('petal.png') no-repeat;
    background-size: contain;
    animation: fall linear infinite;
}

.invitation-window {
    width: 100%;
    max-width: 1000px;
    padding: 20px;
    box-sizing: border-box;
    margin-top: 10px;
    max-height: 90vh
}

.torn-paper {
    /*background: #f5f5f5;*/
    background: #ffeff6;
    padding: 30px;
    border-radius: 10px;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2);
    position: relative;
    text-align: center;
    font-family: 'Georgia', serif;
    font-size: 24px;
    color: #333;
}

.torn-paper::before,
.torn-paper::after {
    content: '';
    position: absolute;
    width: 100%;
    height: 40px;
    background: #ffeff6;
    left: 0;
    z-index: -1;
}

.torn-paper::before {
    top: -10px;
    transform: skewY(-2deg);
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.torn-paper::after {
    bottom: -10px;
    transform: skewY(2deg);
    box-shadow: 0 -4px 6px rgba(0, 0, 0, 0.1);
}

.torn-paper p, .torn-paper small{
    margin: 0;
    font-style: italic;
    letter-spacing: 1px;
}

.torn-paper h1, .torn-paper h2 {
    margin: 0;
    font-style: italic;
    letter-spacing: 1px;
}

.reg {
    font-style: normal;
}

.focus {
    border: 2px solid black; 
    border-radius: 5px;
    display: inline-block;
    padding: 10px 40px 10px 40px;
    text-align: center;
    margin: 20px 0;
    background-image: url('paper.png');
}

.shadow {
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.5);
    font-size: 1.2em;
    margin-top: 20px;
}

.title {
    font-size: 2.5em;
}

.image-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
    margin-top: 20px;
}

.image-item {
    position: relative;
    background-color: rgba(245, 245, 245, 0.5);
    border: 1px solid #ccc;
    border-radius: 5px;
    overflow: hidden;
    cursor: pointer;
    transition: transform 0.3s ease;
}

.image-item::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(255, 182, 193, 0.5);
    transition: background-color 0.5s ease;
    z-index: 1;
}

.image-item img {
    width: 100%;
    height: 100%;
    display: block;
    opacity: 1;
    transition: opacity 0.3s ease;
}

.image-item:hover {
    transform: scale(1.25);
    z-index: 100;
}

.image-item:hover::before {
    background: none; 
}

.image-item.enlarged img {
    width: 100%;
    height: auto;
}

@media only screen and (max-width: 600px) {
    .image-grid {
        grid-template-columns: 1fr;
    }

    .image-item::before {
        background: none; 
    }

    .image-item.enlarged {
        width: 90%;
    }
}

@keyframes fall {
    0% {
        transform: translateY(-10%) rotate(0deg);
        opacity: 1;
    }

    100% {
        transform: translateY(150vh) rotate(360deg);
        opacity: 0;
    }
}

.petal:nth-child(1) {
    animation-duration: 12s;
    animation-delay: 0s;
    left: 5%;
}

.petal:nth-child(2) {
    animation-duration: 14s;
    animation-delay: 2s;
    left: 15%;
}

.petal:nth-child(3) {
    animation-duration: 16s;
    animation-delay: 4s;
    left: 25%;
}

.petal:nth-child(4) {
    animation-duration: 13s;
    animation-delay: 1s;
    left: 35%;
}

.petal:nth-child(5) {
    animation-duration: 15s;
    animation-delay: 3s;
    left: 45%;
}

.petal:nth-child(6) {
    animation-duration: 11s;
    animation-delay: 0s;
    left: 55%;
}

.petal:nth-child(7) {
    animation-duration: 14s;
    animation-delay: 2s;
    left: 65%;
}

.petal:nth-child(8) {
    animation-duration: 12s;
    animation-delay: 1s;
    left: 75%;
}

.petal:nth-child(9) {
    animation-duration: 16s;
    animation-delay: 3s;
    left: 85%;
}

.petal:nth-child(10) {
    animation-duration: 13s;
    animation-delay: 0s;
    left: 95%;
}

.petal:nth-child(11) {
    animation-duration: 11s;
    animation-delay: 1s;
    left: 10%;
}

.petal:nth-child(12) {
    animation-duration: 13s;
    animation-delay: 2s;
    left: 20%;
}

.petal:nth-child(13) {
    animation-duration: 15s;
    animation-delay: 3s;
    left: 30%;
}

.petal:nth-child(14) {
    animation-duration: 12s;
    animation-delay: 0s;
    left: 40%;
}

.petal:nth-child(15) {
    animation-duration: 14s;
    animation-delay: 1s;
    left: 50%;
}

.petal:nth-child(16) {
    animation-duration: 16s;
    animation-delay: 2s;
    left: 60%;
}

.petal:nth-child(17) {
    animation-duration: 13s;
    animation-delay: 3s;
    left: 70%;
}

.petal:nth-child(18) {
    animation-duration: 11s;
    animation-delay: 0s;
    left: 80%;
}

.petal:nth-child(19) {
    animation-duration: 14s;
    animation-delay: 1s;
    left: 90%;
}

.petal:nth-child(20) {
    animation-duration: 12s;
    animation-delay: 2s;
    left: 100%;
}

@media only screen and (max-width: 1100px) {
    .invitation-window {
        width: 80%;
    }
}

@media only screen and (max-width: 600px) {
    .invitation-window {
        width: 100%;
        padding: 10px;
    }

    .torn-paper {
        background: rgba(255, 239, 246, 0.8);
        box-shadow: none;
        padding: 20px;
    }

    .torn-paper::before,
    .torn-paper::after {
        background: rgba(255, 239, 246, 0.8);
        box-shadow: none;
    }

    .torn-paper p, .torn-paper small, .torn-paper h1, .torn-paper h2 {
        color: #333;
    }

    .torn-paper h1 {
        font-size: 2.0em;
    }

    .torn-paper .focus h1 {
        font-size: 1.5em;
    }

    .torn-paper h2 {
        font-size: 1.4em;
    }

    .torn-paper p {
        font-size: 1em;
    }

    .torn-paper small {
        font-size: 0.8em;
    }

    .focus {
        border-color: #333;
        padding: 10px 20px;
        margin: 10px 0;
    }

    .shadow {
        font-size: 1em;
    }
}