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

body {
    background: linear-gradient(135deg, #d4e4ed 0%, #b8d4e6 50%, #c9dce8 100%);
    overflow-x: hidden;
    font-family: 'Georgia', serif;
    position: relative;
}

body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: 
        radial-gradient(circle at 20% 30%, rgba(255, 255, 255, 0.15) 0%, transparent 50%),
        radial-gradient(circle at 80% 70%, rgba(176, 206, 224, 0.2) 0%, transparent 50%),
        radial-gradient(circle at 40% 80%, rgba(255, 255, 255, 0.1) 0%, transparent 40%);
    pointer-events: none;
    z-index: 0;
}

#loading {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100vh;
    background: linear-gradient(135deg, #d4e4ed 0%, #c9dce8 50%, #b8d4e6 100%);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    transition: opacity 1.2s ease-out;
    padding: 250px 20px 50px;
}

#loading::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: 
        radial-gradient(circle at 25% 25%, rgba(255, 255, 255, 0.2) 0%, transparent 50%),
        radial-gradient(circle at 75% 75%, rgba(176, 206, 224, 0.15) 0%, transparent 50%);
    pointer-events: none;
}

#loading.fade-out {
    opacity: 0;
    pointer-events: none;
}

.envelope-container {
    position: relative;
    width: 380px;
    height: 260px;
    cursor: pointer;
    z-index: 10;
}

.wrapper {
    height: 260px;
    width: 380px;
    background-color: #f8fafc;
    position: absolute;
    top: 0;
    left: 0;
    display: flex;
    justify-content: center;
    z-index: 0;
    transition: transform 0.3s ease;
    box-shadow: 0 10px 40px rgba(107, 142, 168, 0.25);
}

.envelope-container:hover .wrapper:not(.opened) {
    transform: scale(1.02);
}

.wrapper.opened {
    cursor: default;
}

.wrapper.opened:hover {
    transform: scale(1);
}

.lid {
    position: absolute;
    height: 100%;
    width: 100%;
    top: 0;
    left: 0;
    border-right: 190px solid transparent;
    border-bottom: 130px solid transparent;
    border-left: 190px solid transparent;
    transform-origin: top;
    transition: transform 0.4s ease;
    pointer-events: none;
}

.lid.one {
    border-top: 130px solid #d4e4ed;
    transform: rotateX(0deg);
    z-index: 3;
    transition-delay: 0s;
}

.lid.two {
    border-top: 130px solid #e8f1f7;
    transform: rotateX(90deg);
    z-index: 1;
    transition-delay: 0s;
}

.envelope {
    position: absolute;
    height: 100%;
    width: 100%;
    top: 0;
    left: 0;
    border-top: 130px solid transparent;
    border-right: 190px solid #f8fafc;
    border-bottom: 130px solid #f8fafc;
    border-left: 190px solid #e8f1f7;
    z-index: 3;
    pointer-events: none;
}

.letter {
    position: absolute;
    top: 8%;
    width: 88%;
    height: 80%;
    background: linear-gradient(135deg, #ffffff 0%, #f8fafc 100%);
    border-radius: 8px;
    z-index: 2;
    transition: transform 0.6s ease;
    box-shadow: 0 4px 20px rgba(107, 142, 168, 0.15);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: 24px 20px;
    pointer-events: none;
}

.letter-content {
    text-align: center;
    color: #4a6b82;
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.ornament {
    font-size: 16px;
    color: #7a9cb5;
    margin-bottom: 6px;
    opacity: 0.6;
}

.invitation-text {
    font-size: 7px;
    letter-spacing: 2.2px;
    margin-bottom: 8px;
    color: #6b8aa3;
    font-weight: 400;
    text-transform: uppercase;
}

.names {
    font-size: 32px;
    font-family: 'Brush Script MT', 'Lucida Handwriting', cursive;
    color: #4a6b82;
    margin: 3px 0;
    font-weight: normal;
    line-height: 1;
}

.ampersand {
    font-size: 18px;
    color: #7a9cb5;
    margin: 2px 0;
    font-style: italic;
}

.date-info {
    margin-top: 10px;
    text-align: center;
}

.date {
    font-size: 9px;
    letter-spacing: 1.8px;
    color: #4a6b82;
    font-weight: 500;
    margin-bottom: 2px;
}

.year {
    font-size: 8.5px;
    letter-spacing: 1.3px;
    color: #7a9cb5;
    font-weight: 300;
}

.bottom-ornament {
    margin-top: 8px;
    font-size: 14px;
    color: #7a9cb5;
    opacity: 0.6;
}

.divider {
    width: 45px;
    height: 1px;
    background: #b8d4e6;
    margin: 6px auto;
}

.wax-seal {
    position: absolute;
    bottom: 35%;
    left: 50%;
    transform: translateX(-50%);
    width: 54px;
    height: 54px;
    background: linear-gradient(135deg, #e8f1f7 0%, #d4e4ed 100%);
    border: 2.5px solid #b0cee0;
    border-radius: 50%;
    z-index: 4;
    display: flex;
    justify-content: center;
    align-items: center;
    box-shadow: 0 4px 16px rgba(107, 142, 168, 0.25), inset 0 1px 3px rgba(255,255,255,0.6);
    transition: all 0.4s ease, opacity 0.3s ease;
    pointer-events: none;
    overflow: hidden;
    animation: sealPulse 3s ease-in-out infinite;
}

.wax-seal::before {
    content: '';
    position: absolute;
    top: -2px;
    left: -2px;
    right: -2px;
    bottom: -2px;
    background: linear-gradient(45deg, transparent, rgba(255,255,255,0.4), transparent);
    border-radius: 50%;
    animation: sealShine 4s linear infinite;
}

@keyframes sealPulse {
    0%, 100% {
        transform: translateX(-50%) scale(1);
        box-shadow: 0 4px 16px rgba(107, 142, 168, 0.25), inset 0 1px 3px rgba(255,255,255,0.6);
    }
    50% {
        transform: translateX(-50%) scale(1.05);
        box-shadow: 0 6px 20px rgba(107, 142, 168, 0.35), inset 0 1px 3px rgba(255,255,255,0.6);
    }
}

@keyframes sealShine {
    0% {
        transform: rotate(0deg);
        opacity: 0;
    }
    50% {
        opacity: 1;
    }
    100% {
        transform: rotate(360deg);
        opacity: 0;
    }
}

.wax-seal-inner {
    width: 68%;
    height: 68%;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    z-index: 2;
}

.wax-seal img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    display: block;
    filter: drop-shadow(0 1px 2px rgba(107, 142, 168, 0.2));
}

.wrapper.opened .lid.one {
    transform: rotateX(90deg);
    transition-delay: 0s;
}

.wrapper.opened .lid.two {
    transform: rotateX(180deg);
    transition-delay: 0.35s;
}

.wrapper.opened .letter {
    transform: translateY(-155px);
    transition-delay: 0.6s;
}

.wrapper.opened .wax-seal {
    transform: translateX(-50%) scale(0);
    opacity: 0;
    transition-delay: 0s;
}

.click-text {
    position: absolute;
    bottom: -60px;
    left: 0;
    width: 100%;
    text-align: center;
    color: #6b8aa3;
    font-size: 10px;
    opacity: 0.8;
    letter-spacing: 2.5px;
    text-transform: uppercase;
    animation: textPulse 2.5s ease-in-out infinite;
    pointer-events: none;
    font-weight: 400;
    z-index: 100;
    font-family: 'Libre Baskerville', serif;
}

.click-text::before {
    content: '✦ ';
    opacity: 0.6;
    font-size: 8px;
}

.click-text::after {
    content: ' ✦';
    opacity: 0.6;
    font-size: 8px;
}

.envelope-container.opened .click-text {
    display: none;
}

@keyframes textPulse {
    0%, 100% { 
        opacity: 0.8;
        transform: translateY(0);
    }
    50% { 
        opacity: 0.5;
        transform: translateY(-3px);
    }
}

.sparkles {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 50;
}

.sparkle {
    position: absolute;
    font-size: 14px;
    opacity: 0;
    color: #b0cee0;
    animation: sparkleFloat 2.5s ease-out forwards;
}

@keyframes sparkleFloat {
    0% {
        transform: translateY(0) scale(0) rotate(0deg);
        opacity: 0.8;
    }
    100% {
        transform: translateY(-150px) scale(1.3) rotate(180deg);
        opacity: 0;
    }
}

.subtitle {
    margin-top: 220px;
    margin-bottom: 50px;
    font-family: 'Cormorant Garamond', serif;
    font-size: 20px;
    font-style: italic;
    color: #5a7a94;
    opacity: 0;
    animation: fadeInUp 1s ease-out 0.5s forwards;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

#pdfLoadingText {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-family: 'Cormorant Garamond', serif;
    font-size: 28px;
    font-style: italic;
    color: #5a7a94;
    z-index: 1;
    opacity: 1;
    transition: opacity 1s ease-out;
    pointer-events: none;
    text-align: center;
}

#pdfLoadingText.fade-out {
    opacity: 0;
}

#pdfContainer {
    width: 100%;
    max-width: 100%;
    background: transparent;
    position: relative;
    z-index: 1;
    opacity: 0;
    transition: opacity 1.6s ease-in;
    padding-top: 0.5px;
}

#pdfContainer.visible {
    opacity: 1;
}

.pdf-page {
    width: 100%;
    display: block;
    margin: 0;
    box-shadow: 0 2px 8px rgba(107, 142, 168, 0.15);
}

#error {
    display: none;
    padding: 20px;
    text-align: center;
    color: #c85a54;
    font-family: Arial, sans-serif;
}

#audioControl {
    position: fixed;
    bottom: 20px;
    left: 20px;
    width: 56px;
    height: 56px;
    background: linear-gradient(135deg, #5a7a94 0%, #4a6b82 100%);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 4px 16px rgba(74, 107, 130, 0.3);
    transition: all 0.3s ease;
    z-index: 1000;
    border: none;
}

#audioControl:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(74, 107, 130, 0.4);
    background: linear-gradient(135deg, #6b8aa3 0%, #5a7a94 100%);
}

#audioControl svg {
    width: 24px;
    height: 24px;
    fill: #f8fafc;
}

.audio-icon {
    transition: opacity 0.3s ease;
    position: absolute;
}

.audio-icon.hidden {
    opacity: 0;
    pointer-events: none;
}

#mapsButton {
    position: fixed;
    bottom: 20px;
    right: 20px;
    width: 56px;
    height: 56px;
    background: linear-gradient(135deg, #5a7a94 0%, #4a6b82 100%);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 4px 16px rgba(74, 107, 130, 0.3);
    transition: all 0.3s ease;
    z-index: 1000;
}

#mapsButton:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(74, 107, 130, 0.4);
    background: linear-gradient(135deg, #6b8aa3 0%, #5a7a94 100%);
}

#mapsButton svg {
    width: 24px;
    height: 24px;
    fill: #f8fafc;
}

#dropUpMenu {
    position: fixed;
    bottom: 86px;
    right: 20px;
    background: linear-gradient(135deg, #ffffff 0%, #f8fafc 100%);
    border-radius: 12px;
    box-shadow: 0 8px 32px rgba(74, 107, 130, 0.2);
    opacity: 0;
    visibility: hidden;
    transform: translateY(10px);
    transition: all 0.3s ease;
    z-index: 999;
    overflow: hidden;
    border: 1px solid #d4e4ed;
}

#dropUpMenu.active {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.menu-item {
    padding: 16px 24px;
    display: flex;
    align-items: center;
    gap: 12px;
    cursor: pointer;
    transition: all 0.2s ease;
    border-bottom: 1px solid #e8f1f7;
    min-width: 200px;
}

.menu-item:last-child {
    border-bottom: none;
}

.menu-item:hover {
    background: linear-gradient(135deg, #e8f1f7 0%, #f8fafc 100%);
}

.menu-item svg {
    width: 20px;
    height: 20px;
    fill: #4a6b82;
    flex-shrink: 0;
}

.menu-item span {
    font-family: 'Libre Baskerville', serif;
    font-size: 13px;
    color: #4a6b82;
    font-weight: 400;
}

#overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(74, 107, 130, 0.15);
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    z-index: 998;
}

#overlay.active {
    opacity: 1;
    visibility: visible;
}

#desktopWarning {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100vh;
    background: rgba(74, 107, 130, 0.95);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    padding: 20px;
}

#desktopWarning.show {
    display: flex;
}

.warning-content {
    background: linear-gradient(135deg, #ffffff 0%, #f8fafc 100%);
    border-radius: 16px;
    padding: 40px;
    max-width: 500px;
    text-align: center;
    box-shadow: 0 12px 48px rgba(74, 107, 130, 0.3);
    border: 1px solid #d4e4ed;
}

.warning-icon {
    width: 64px;
    height: 64px;
    margin: 0 auto 24px;
    fill: #7a9cb5;
}

.warning-title {
    font-family: 'Cormorant Garamond', serif;
    font-size: 32px;
    font-weight: 400;
    font-style: italic;
    color: #4a6b82;
    margin-bottom: 16px;
}

.warning-text {
    font-family: 'Libre Baskerville', serif;
    font-size: 14px;
    color: #5a7a94;
    line-height: 1.6;
    margin-bottom: 32px;
}

.warning-buttons {
    display: flex;
    gap: 12px;
    justify-content: center;
}

.warning-btn {
    padding: 14px 32px;
    border: none;
    border-radius: 8px;
    font-family: 'Libre Baskerville', serif;
    font-size: 13px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-weight: 400;
}

.btn-primary {
    background: linear-gradient(135deg, #5a7a94 0%, #4a6b82 100%);
    color: #f8fafc;
    box-shadow: 0 4px 12px rgba(74, 107, 130, 0.25);
}

.btn-primary:hover {
    background: linear-gradient(135deg, #6b8aa3 0%, #5a7a94 100%);
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(74, 107, 130, 0.35);
}

.btn-secondary {
    background: #f8fafc;
    color: #4a6b82;
    border: 1px solid #d4e4ed;
}

.btn-secondary:hover {
    background: #e8f1f7;
}

@media (max-width: 480px) {
    .envelope-container {
        width: 340px;
        height: 240px;
    }

    .wrapper {
        width: 340px;
        height: 240px;
    }

    .lid {
        border-right: 170px solid transparent;
        border-bottom: 120px solid transparent;
        border-left: 170px solid transparent;
    }

    .lid.one {
        border-top: 120px solid #d4e4ed;
    }

    .lid.two {
        border-top: 120px solid #e8f1f7;
    }

    .envelope {
        border-top: 120px solid transparent;
        border-right: 170px solid #f8fafc;
        border-bottom: 120px solid #f8fafc;
        border-left: 170px solid #e8f1f7;
    }

    .letter {
        width: 86%;
        height: 76%;
        padding: 20px 18px;
    }

    .names {
        font-size: 28px;
    }

    .ornament {
        font-size: 14px;
        margin-bottom: 5px;
    }

    .bottom-ornament {
        font-size: 12px;
        margin-top: 6px;
    }

    .invitation-text {
        font-size: 6.5px;
        letter-spacing: 2px;
        margin-bottom: 6px;
    }

    .ampersand {
        font-size: 16px;
    }

    .date {
        font-size: 8px;
        letter-spacing: 1.5px;
    }

    .year {
        font-size: 7.5px;
    }

    .divider {
        width: 40px;
        margin: 5px auto;
    }

    .date-info {
        margin-top: 8px;
    }

    .subtitle {
        margin-top: 260px;
        font-size: 18px;
    }

    #pdfLoadingText {
        font-size: 24px;
    }
}