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

body {
    font-family: 'Playfair Display', Georgia, serif;
    background: linear-gradient(135deg, #1a2a3a 0%, #0d1b2a 50%, #1a2a3a 100%);
    overflow-x: hidden;
    min-height: 100vh;
}

/* Snowflakes Animation */
.snowflakes {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 1;
    overflow: hidden;
}

.snowflake {
    position: absolute;
    top: -10%;
    width: var(--flake-size, 24px);
    height: var(--flake-size, 24px);
    background-size: cover;
    background-position: center;
    border-radius: 50%;
    opacity: 0.8;
    animation: snowfall linear infinite;
    box-shadow: 0 0 12px rgba(255, 255, 255, 0.35);
}

.snowflake:nth-child(1) { left: 5%; animation-duration: 10s; animation-delay: 0s; --flake-size: 20px; }
.snowflake:nth-child(2) { left: 15%; animation-duration: 12s; animation-delay: 2s; --flake-size: 28px; }
.snowflake:nth-child(3) { left: 25%; animation-duration: 8s; animation-delay: 4s; --flake-size: 18px; }
.snowflake:nth-child(4) { left: 35%; animation-duration: 14s; animation-delay: 1s; --flake-size: 32px; }
.snowflake:nth-child(5) { left: 45%; animation-duration: 9s; animation-delay: 3s; --flake-size: 24px; }
.snowflake:nth-child(6) { left: 55%; animation-duration: 11s; animation-delay: 5s; --flake-size: 26px; }
.snowflake:nth-child(7) { left: 65%; animation-duration: 13s; animation-delay: 0s; --flake-size: 19px; }
.snowflake:nth-child(8) { left: 75%; animation-duration: 10s; animation-delay: 2s; --flake-size: 30px; }
.snowflake:nth-child(9) { left: 85%; animation-duration: 15s; animation-delay: 4s; --flake-size: 22px; }
.snowflake:nth-child(10) { left: 92%; animation-duration: 8s; animation-delay: 1s; --flake-size: 27px; }
.snowflake:nth-child(11) { left: 3%; animation-duration: 11s; animation-delay: 6s; --flake-size: 25px; }
.snowflake:nth-child(12) { left: 50%; animation-duration: 9s; animation-delay: 3s; --flake-size: 21px; }

@keyframes snowfall {
    0% {
        transform: translateY(0) rotate(0deg);
        opacity: 1;
    }
    100% {
        transform: translateY(110vh) rotate(720deg);
        opacity: 0.3;
    }
}

/* Scroll Container */
.scroll-container {
    position: relative;
}

.scroll-spacer {
    height: 300vh;
}

/* Envelope Section */
.envelope-section {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 10;
}

.title {
    font-family: 'Dancing Script', cursive;
    font-size: clamp(2.5rem, 8vw, 4rem);
    color: #fff;
    text-shadow: 0 0 20px rgba(255, 215, 0, 0.5), 0 4px 15px rgba(0, 0, 0, 0.3);
    margin-bottom: 40px;
    animation: glow 2s ease-in-out infinite alternate;
}

@keyframes glow {
    from {
        text-shadow: 0 0 20px rgba(255, 215, 0, 0.5), 0 4px 15px rgba(0, 0, 0, 0.3);
    }
    to {
        text-shadow: 0 0 30px rgba(255, 215, 0, 0.8), 0 0 50px rgba(255, 215, 0, 0.4), 0 4px 15px rgba(0, 0, 0, 0.3);
    }
}

.scroll-hint {
    margin-top: 40px;
    font-size: 1rem;
    color: rgba(255, 255, 255, 0.5);
    font-style: italic;
    animation: bounce 2s ease-in-out infinite;
}

@keyframes bounce {
    0%, 100% {
        transform: translateY(0);
    }
    50% {
        transform: translateY(10px);
    }
}

/* Envelope Wrapper */
.envelope-wrapper {
    position: relative;
    perspective: 1500px;
}

/* Envelope */
.envelope {
    position: relative;
    width: 320px;
    height: 220px;
    overflow: visible;
    clip-path: inset(-450px 0 0 0);
}

/* Envelope body (main red back) */
.envelope-body {
    position: absolute;
    width: 100%;
    height: 100%;
    background: linear-gradient(145deg, #c41e3a 0%, #8b0000 100%);
    border-radius: 5px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
    z-index: 1;
}

/* Letter - starts hidden inside */
.letter {
    position: absolute;
    width: 280px;
    height: 380px;
    background: linear-gradient(180deg, #fffef5 0%, #f8f4e3 100%);
    border-radius: 5px;
    left: 50%;
    top: 80px;
    transform: translateX(-50%);
    z-index: 2;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.2);
    padding: 30px;
    overflow: hidden;
}

.letter::before {
    content: '';
    position: absolute;
    top: 15px;
    left: 15px;
    right: 15px;
    bottom: 15px;
    border: 2px dashed #c41e3a;
    border-radius: 3px;
    pointer-events: none;
}

/* Inner envelope pocket (beige/tan liner) */
.envelope-inner {
    position: absolute;
    width: 100%;
    height: 100%;
    top: 0;
    left: 0;
    z-index: 3;
    overflow: hidden;
    border-radius: 5px;
}

/* Left inner flap */
.front-left {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 0;
    height: 0;
    border-bottom: 220px solid #e8c4a0;
    border-right: 320px solid transparent;
    z-index: 6;
}

/* Right inner flap */
.front-right {
    position: absolute;
    bottom: 0;
    right: 0;
    width: 0;
    height: 0;
    border-bottom: 220px solid #d4a574;
    border-left: 320px solid transparent;
    z-index: 6;
}

/* Bottom flap to seal envelope */
.front-bottom {
    display: none;
}

/* Top flap - folds DOWN to seal envelope (starts closed) */
.flap {
    position: absolute;
    width: 100%;
    height: 0;
    top: 0;
    left: 0;
    border-top: 130px solid #a01530;
    border-left: 160px solid transparent;
    border-right: 160px solid transparent;
    transform-origin: top center;
    transform: rotateX(0deg);
    z-index: 10;
}

/* Flap shadow/depth when closed */
.flap::after {
    content: '';
    position: absolute;
    top: -130px;
    left: -160px;
    width: 320px;
    height: 130px;
    background: linear-gradient(180deg, transparent 0%, rgba(0,0,0,0.1) 100%);
    clip-path: polygon(0 0, 100% 0, 50% 100%);
}

/* Letter content */
.letter-content {
    height: 100%;
    display: flex;
    flex-direction: column;
    opacity: 1;
}

.letter-header {
    margin-bottom: 15px;
    padding-bottom: 10px;
    border-bottom: 1px solid rgba(196, 30, 58, 0.2);
}

.to-label {
    font-size: 0.85rem;
    color: #7f8c8d;
    font-style: italic;
}

.name {
    font-family: 'Dancing Script', cursive;
    font-size: clamp(1.4rem, 3vw, 2rem);
    color: #c41e3a;
    font-weight: 700;
}

.letter-body {
    flex: 1;
    overflow-y: auto;
    font-size: clamp(0.78rem, 0.8vw + 0.55rem, 0.95rem);
    line-height: 1.7;
    color: #2c3e50;
}

.letter-body p {
    margin-bottom: 8px;
    text-align: justify;
    text-indent: 20px;
}

.letter-body p:last-child {
    margin-bottom: 0;
}

.emphasis-pulse {
    font-weight: bold;
    color: #2c3e50;
    display: inline-block;
    animation: pulse-emphasis 8s ease-in-out infinite;
}

@keyframes pulse-emphasis {
    0%, 62.5% {
        transform: scale(1);
        color: #2c3e50;
    }
    81.25% {
        transform: scale(1.2);
        color: #c41e3a;
    }
    100% {
        transform: scale(1);
        color: #2c3e50;
    }
}

.letter-footer {
    margin-top: 20px;
    padding-top: 15px;
    text-align: right;
    border-top: 1px solid rgba(196, 30, 58, 0.2);
}

.closing {
    font-style: italic;
    color: #7f8c8d;
    margin-bottom: 5px;
    font-size: clamp(0.75rem, 1.6vw, 0.9rem);
}

.signature {
    font-family: 'Dancing Script', cursive;
    font-size: clamp(1.3rem, 3vw, 1.8rem);
    color: #c41e3a;
    font-weight: 700;
}

/* Easter egg: heart overlay */
.heart-overlay {
    position: fixed;
    inset: 0;
    display: grid;
    place-items: center;
    pointer-events: none;
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    background: radial-gradient(circle at center, rgba(0, 0, 0, 0.22) 0%, rgba(0, 0, 0, 0) 65%);
}

.heart-overlay-content {
    display: grid;
    place-items: center;
    position: relative;
    text-align: center;
}

.heart-emoji,
.heart-love-message {
    grid-area: 1 / 1;
}

.heart-emoji {
    font-size: min(55vw, 320px);
    line-height: 1;
    filter: drop-shadow(0 18px 30px rgba(0, 0, 0, 0.55));
    transform: translateY(10px) scale(0.7) rotate(-8deg);
    transform-origin: center;
    user-select: none;
    z-index: 0;
}

.heart-love-message {
    opacity: 0;
    visibility: hidden;
    font-family: 'Dancing Script', cursive;
    font-size: clamp(1.6rem, 4vw, 2.6rem);
    font-weight: 700;
    color: #ffffff;
    text-shadow: 0 18px 30px rgba(0, 0, 0, 0.55);
    letter-spacing: 0.02em;
    z-index: 1;
}

.heart-love-message-inner {
    display: inline-block;
    animation: heart-love-float 2.4s ease-in-out infinite;
    will-change: transform;
}

@keyframes heart-love-float {
    0%,
    100% {
        transform: translateY(0);
    }
    50% {
        transform: translateY(-8px);
    }
}

@media (prefers-reduced-motion: reduce) {
    .heart-emoji {
        transform: none;
    }

    .heart-love-message-inner {
        animation: none;
    }
}

/* Mobile Responsive */
@media screen and (max-width: 480px) {
    .envelope-wrapper {
        transform: none;
    }
    
    .title {
        font-size: 2rem;
    }
    
    .letter {
        padding: 20px;
    }
}
