* { margin: 0; padding: 0; box-sizing: border-box; }
:root {
    --black: #111111; --dark-gray: #333333; --medium-gray: #555555;
    --light-gray: #777777; --lighter-gray: #eeeeee; --white: #ffffff;
    --burgundy: #800020; --burgundy-light: #a83232; --burgundy-dark: #600018;
    --vk-blue: #0077FF; --vk-blue-dark: #0055B3;
}
body { font-family: 'Montserrat', sans-serif; color: var(--dark-gray); background-color: var(--white); overflow-x: hidden; line-height: 1.6; position: relative; }
body.no-scroll { overflow: hidden; }
body.scroll-enabled { overflow: auto; }


h1, h2, h3, h4,
.couple-names,
.personal-greeting,
.wedding-date-top,
.wedding-year-bottom,
.countdown-value,
.footer-love,
.date-number,
.and-symbol {
    font-family: 'Spectral', serif;
    font-weight: 500;
}

.container { width: 90%; max-width: 800px; margin: 0 auto; padding: 0 15px; }


.desktop-message { display: none; position: fixed; top: 0; left: 0; width: 100%; height: 100%; background-color: rgba(255, 255, 255, 0.98); z-index: 9999; justify-content: center; align-items: center; text-align: center; padding: 20px; }
.desktop-message-content { max-width: 600px; padding: 40px; background-color: var(--white); border-radius: 12px; box-shadow: 0 10px 40px rgba(0, 0, 0, 0.15); border: 2px solid var(--burgundy-light); }
.desktop-message-content i { font-size: 80px; color: var(--burgundy); margin-bottom: 25px; }
.desktop-message-content h2 { font-size: 28px; color: var(--black); margin-bottom: 20px; }
.desktop-message-content p { font-size: 18px; color: var(--medium-gray); margin-bottom: 30px; }
.desktop-qr { margin: 30px 0; padding: 20px; background-color: var(--lighter-gray); border-radius: 10px; display: inline-block; }
.qr-placeholder { display: flex; flex-direction: column; align-items: center; gap: 15px; }
.qr-code-img { width: 160px; height: 160px; border-radius: 8px; box-shadow: 0 4px 15px rgba(128, 0, 32, 0.2); display: block; }

.site-background { position: fixed; top: 0; left: 0; width: 100%; height: 100%; z-index: -1; }
.bg-image { width: 100%; height: 100%; object-fit: cover; filter: grayscale(100%) brightness(0.95); opacity: 0.2; }
.section-divider-small { width: 100%; height: 1px; background-color: var(--black); margin: clamp(20px, 5vh, 40px) auto; max-width: 80px; }


.first-screen { height: 100vh; width: 100%; position: relative; overflow: hidden; display: flex; justify-content: center; align-items: center; }
.couple-container { width: 100%; height: 100%; position: relative; display: flex; justify-content: center; align-items: center; }
.couple-main-photo { width: 100%; height: 100%; object-fit: cover; filter: grayscale(100%) contrast(110%); }
.names-overlay { position: absolute; top: clamp(10%, 15%, 20%); left: 50%; transform: translateX(-50%); z-index: 2; text-align: center; color: var(--white); width: 100%; max-width: 1200px; padding: 0 20px; text-shadow: 3px 3px 6px rgba(0, 0, 0, 0.7); }
.couple-names { font-size: clamp(2.2rem, 10vw, 3.8rem); margin-bottom: 0.8rem; letter-spacing: 2px; font-weight: 500; }
.ampersand { color: var(--burgundy); margin: 0 clamp(5px, 2vw, 15px); }


.wedding-date-overlay { display: none; }


.envelope-section {
    position: absolute;
    bottom: clamp(5%, 10%, 15%);
    left: 50%;
    transform: translateX(-50%);
    z-index: 3;
    width: 70%;
    max-width: 320px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}
.envelope-on-photo { width: 100%; position: relative; cursor: pointer; }
.envelope-wrapper {
    position: relative;
    width: 100%;
    aspect-ratio: 536 / 386;
    transition: aspect-ratio 0.6s ease-in-out;
    filter: drop-shadow(0px 15px 20px rgba(0, 0, 0, 0.4));
}
.envelope-on-photo.opened .envelope-wrapper {
    aspect-ratio: 537 / 668;
}
.envelope-closed, .envelope-opened {
    width: 100%;
    height: 100%;
    position: absolute;
    top: 0;
    left: 0;
    border-radius: 8px;
    transition: opacity 0.6s ease;
}
.envelope-closed img, .envelope-opened img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    border-radius: 8px;
}
.envelope-opened { opacity: 0; z-index: 1; }
.envelope-closed { opacity: 1; z-index: 2; }
.envelope-on-photo.opened .envelope-closed { opacity: 0; z-index: 1; }
.envelope-on-photo.opened .envelope-opened { opacity: 1; z-index: 2; }
.envelope-instruction-bottom {
    text-align: center;
    color: var(--white);
    font-size: clamp(0.9rem, 4vw, 1.2rem);
    animation: pulse 2s infinite;
    text-shadow: 1px 1px 3px rgba(0, 0, 0, 0.7);
    width: 100%;
    padding-top: clamp(10px, 3vh, 20px);
    transition: opacity 0.4s ease, visibility 0.4s ease;
}
.envelope-on-photo.opened + .envelope-instruction-bottom {
    opacity: 0;
    visibility: hidden;
}
.envelope-instruction-bottom i { font-size: clamp(1.4rem, 6vw, 2rem); margin-top: 8px; display: block; color: var(--burgundy); }
@keyframes pulse { 0% { opacity: 0.7; } 50% { opacity: 1; } 100% { opacity: 0.7; } }


.main-content { opacity: 0; visibility: hidden; height: 0; overflow: hidden; transition: opacity 0.8s ease, visibility 0.8s ease; background-color: rgba(255, 255, 255, 0.7); padding-top: clamp(20px, 6vh, 60px); position: relative; z-index: 1; }
.main-content.visible { opacity: 1; visibility: visible; height: auto; overflow: visible; }


.personal-greeting-section { padding: clamp(30px, 8vh, 60px) 0 clamp(20px, 5vh, 40px); background-color: transparent; text-align: center; }
.personal-greeting-card { background: transparent; padding: 20px; max-width: 800px; margin: 0 auto; }
.personal-greeting { font-size: clamp(1.8rem, 9vw, 3rem); margin-bottom: 15px; font-weight: 600; color: var(--burgundy); }
.personal-message { font-size: clamp(1.1rem, 5.5vw, 1.8rem); color: var(--dark-gray); margin-top: 10px; max-width: 600px; margin-left: auto; margin-right: auto; }


.names-section { padding: clamp(20px, 5vh, 40px) 0; text-align: center; }
.names-wrapper { display: flex; flex-direction: column; align-items: center; margin-bottom: 20px; }
.bride-name, .groom-name { font-size: clamp(2rem, 10vw, 3.2rem); color: var(--black); margin-bottom: 0; letter-spacing: 1px; font-weight: 500; }
.and-symbol { font-size: clamp(1.2rem, 6vw, 1.8rem); color: var(--burgundy); margin: 5px 0; }
.date { display: flex; align-items: center; justify-content: center; margin: 15px 0; }
.wedding-date-line { width: clamp(20px, 8vw, 40px); height: 1px; background-color: var(--burgundy); margin: 0 12px; }
.wedding-date { font-size: clamp(1.1rem, 5vw, 1.5rem); color: var(--black); font-weight: 500; }
.wedding-subtitle { font-size: clamp(0.9rem, 4vw, 1.2rem); color: var(--medium-gray); max-width: 500px; margin: 0 auto; font-style: italic; padding: 0 10px; }


.invitation-text-plain { padding: clamp(20px, 5vh, 40px) 0; text-align: center; }
.invitation-text-plain h2 { margin-bottom: clamp(15px, 4vh, 30px); color: var(--black); font-size: clamp(1.4rem, 7vw, 2rem); }
.invitation-text-plain h2 i { margin-right: 8px; color: var(--burgundy); }
.invitation-text-content { max-width: 600px; margin: 0 auto; padding: 0 15px; }
.invitation-text-content p { margin-bottom: 18px; font-size: clamp(1rem, 4.5vw, 1.3rem); line-height: 1.7; color: var(--dark-gray); }
.invitation-greeting { font-size: clamp(1.6rem, 8vw, 2.8rem); font-weight: 500; color: var(--black); text-align: center; margin: 10px 0 25px; }
.signature { text-align: right; font-style: italic; color: var(--burgundy); font-weight: 500; margin-top: 25px; border-top: 1px solid var(--lighter-gray); padding-top: 12px; font-size: clamp(1rem, 4.5vw, 1.3rem); }


.photo-section-full { padding: 20px 0; }
.full-width-photo { width: 100%; aspect-ratio: 4 / 3; max-height: 500px; overflow: hidden; margin: 0 auto; }
.couple-full-photo { width: 100%; height: 100%; object-fit: cover; filter: grayscale(100%) contrast(110%); }


.calendar-section { padding: clamp(30px, 6vh, 60px) 0; }
.calendar-section h2 { text-align: center; margin-bottom: 25px; color: var(--black); font-size: clamp(1.4rem, 7vw, 2rem); }
.wedding-date-display-new { margin-bottom: 30px; text-align: center; }
.wedding-date-top { font-size: clamp(2.2rem, 12vw, 3.5rem); font-weight: 700; color: var(--burgundy); line-height: 1; }
.wedding-year-bottom { font-size: clamp(1.2rem, 6vw, 1.8rem); color: var(--dark-gray); }
.calendar-with-days { width: 100%; max-width: 400px; margin: 0 auto; background-color: rgba(255, 255, 255, 0.9); border-radius: 8px; padding: clamp(10px, 4vw, 25px); box-shadow: 0 5px 15px rgba(0, 0, 0, 0.05); }
.calendar-grid { display: grid; grid-template-columns: repeat(7, 1fr); grid-gap: clamp(4px, 1.5vw, 10px); }
.calendar-day { padding: clamp(8px, 2vw, 12px) 2px; font-size: clamp(0.9rem, 4vw, 1.1rem); }
.calendar-day.wedding-day { background-color: var(--burgundy); color: var(--white); font-weight: bold; border-radius: 50%; width: clamp(30px, 9vw, 45px); height: clamp(30px, 9vw, 45px); display: flex; align-items: center; justify-content: center; margin: 0 auto; }


.location-section-map { padding: clamp(30px, 6vh, 60px) 0; }
.location-section-map h2 { text-align: center; margin-bottom: 25px; font-size: clamp(1.4rem, 7vw, 2rem); }
.map-container { width: 100%; aspect-ratio: 1 / 1; max-height: 400px; border-radius: 8px; margin-bottom: 25px; box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1); }
#yandex-map { border-radius: 8px; width: 100%; height: 100%; }
.location-address-block { text-align: center; padding: 25px 15px; background: rgba(255,255,255,0.9); border-radius: 8px; }
.location-name { font-size: clamp(1.2rem, 6vw, 1.6rem); font-weight: 500; margin-bottom: 10px; }
.location-address { font-size: clamp(0.9rem, 4.5vw, 1.2rem); margin-bottom: 20px; }
.copy-address-btn { background-color: var(--burgundy); color: var(--white); border: none; border-radius: 50px; padding: 12px clamp(20px, 6vw, 40px); font-size: clamp(0.9rem, 4vw, 1.1rem); cursor: pointer; }


.countdown-section { padding: clamp(30px, 6vh, 60px) 0; text-align: center; }
.countdown-section h2 { margin-bottom: 25px; font-size: clamp(1.4rem, 7vw, 2rem); }
.countdown-simple { display: flex; justify-content: center; gap: clamp(8px, 3vw, 15px); margin-bottom: 25px; }
.countdown-group { display: flex; flex-direction: column; align-items: center; min-width: clamp(60px, 18vw, 90px); }
.countdown-value { font-size: clamp(1.8rem, 10vw, 3rem); font-weight: 700; color: var(--burgundy); }
.countdown-label { font-size: clamp(0.7rem, 3vw, 0.9rem); text-transform: uppercase; letter-spacing: 1px; color: var(--medium-gray); }


.vk-section { padding: clamp(30px, 6vh, 60px) 0; text-align: center; }
.vk-invitation { background: rgba(255,255,255,0.9); border-radius: 12px; padding: clamp(20px, 6vw, 40px) 15px; border: 1px solid var(--lighter-gray); max-width: 600px; margin: 0 auto; }
.vk-icon { font-size: clamp(2.5rem, 12vw, 4rem); color: var(--vk-blue); margin-bottom: 15px; display: block; }
.vk-invitation h3 { font-size: clamp(1.2rem, 6vw, 1.8rem); margin-bottom: 10px; }
.vk-invitation p { font-size: clamp(0.9rem, 4.5vw, 1.1rem); margin-bottom: 25px; }
.vk-link { background: var(--vk-blue); color: #fff; text-decoration: none; padding: 12px clamp(20px, 6vw, 40px); border-radius: 50px; font-size: clamp(1rem, 4.5vw, 1.2rem); display: inline-flex; align-items: center; gap: 10px; }


.footer-simple { padding: 40px 0; text-align: center; border-top: 1px solid var(--lighter-gray); margin-top: 20px; }
.footer-love { color: var(--burgundy); font-size: clamp(1.4rem, 7vw, 2rem) !important; margin-bottom: 15px !important; }
.footer-date { display: flex; align-items: center; justify-content: center; }
.date-number { font-size: clamp(1rem, 4.5vw, 1.3rem); color: var(--burgundy); }


.back-to-top { position: fixed; bottom: 20px; right: 20px; width: 45px; height: 45px; background: var(--burgundy); color: #fff; border-radius: 50%; display: flex; justify-content: center; align-items: center; z-index: 1000; opacity: 0; visibility: hidden; transition: 0.3s; }
.back-to-top.visible { opacity: 1; visibility: visible; }


.weekdays {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    grid-gap: clamp(4px, 1.5vw, 10px);
    text-align: center;
    margin-bottom: 10px;
    padding-bottom: 10px;
    border-bottom: 1px solid var(--lighter-gray);
}
.weekdays div {
    font-size: clamp(0.8rem, 3.5vw, 1rem);
    color: var(--medium-gray);
    font-weight: 500;
}


.copy-success {
    color: var(--burgundy);
    font-weight: 500;
    margin-top: 10px;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    font-size: clamp(0.9rem, 4vw, 1.1rem);
}
.copy-success.show {
    opacity: 1;
    visibility: visible;
}


@media (min-width: 1025px) {
    .desktop-message { display: flex; }
    .site-background, .first-screen, .main-content { display: none; }
}