/* Love Letter - Artistic & Vintage Design */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Kalam', cursive;
    background: 
        radial-gradient(circle at 20% 50%, rgba(255, 248, 220, 0.8) 0%, transparent 50%),
        radial-gradient(circle at 80% 20%, rgba(255, 228, 181, 0.6) 0%, transparent 50%),
        radial-gradient(circle at 40% 80%, rgba(250, 235, 215, 0.4) 0%, transparent 50%),
        linear-gradient(135deg, #f5f1eb 0%, #e8ddd4 100%);
    min-height: 100vh;
    overflow-x: hidden;
    color: #3d2914;
    line-height: 1.6;
}

/* Vintage ornaments scattered around */
.vintage-ornament {
    position: fixed;
    font-size: 2rem;
    color: rgba(139, 69, 19, 0.3);
    z-index: 1;
    pointer-events: none;
    transition: all 0.8s ease;
    animation: breathe 4s ease-in-out infinite;
}

.vintage-ornament.top-left { top: 10%; left: 5%; }
.vintage-ornament.top-right { top: 15%; right: 8%; }
.vintage-ornament.mid-left { top: 45%; left: 3%; }
.vintage-ornament.mid-right { top: 50%; right: 5%; }
.vintage-ornament.bottom-left { bottom: 20%; left: 7%; }
.vintage-ornament.bottom-right { bottom: 15%; right: 10%; }

@keyframes breathe {
    0%, 100% { transform: scale(1) rotate(0deg); opacity: 0.3; }
    50% { transform: scale(1.1) rotate(5deg); opacity: 0.6; }
}

/* Scattered rose petals */
.petal-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 2;
}

.petal {
    position: absolute;
    font-size: 1.2rem;
    opacity: 0;
    animation: petalFall 8s ease-in-out infinite;
}

.petal:nth-child(1) { left: 10%; animation-delay: 0s; }
.petal:nth-child(2) { left: 30%; animation-delay: 2s; }
.petal:nth-child(3) { left: 50%; animation-delay: 4s; }
.petal:nth-child(4) { left: 70%; animation-delay: 6s; }
.petal:nth-child(5) { left: 90%; animation-delay: 1s; }

@keyframes petalFall {
    0% { 
        transform: translateY(-100px) rotate(0deg); 
        opacity: 0; 
    }
    10% { 
        opacity: 0.7; 
    }
    90% { 
        opacity: 0.7; 
    }
    100% { 
        transform: translateY(100vh) rotate(360deg); 
        opacity: 0; 
    }
}

/* Main letter canvas */
.letter-canvas {
    position: relative;
    max-width: 90%;
    margin: 0 auto;
    padding: 2rem 1rem;
    min-height: 100vh;
}

/* Individual letter pieces scattered organically */
.letter-piece {
    position: relative;
    margin: 4rem 0;
    opacity: 0;
    transform: translateY(50px) rotate(-1deg);
    transition: all 0.8s ease;
    padding: 1.5rem;
}

.letter-piece.appear {
    opacity: 1;
    transform: translateY(0) rotate(0deg);
}

/* Opening piece */
.opening {
    background: 
        linear-gradient(45deg, transparent 0%, rgba(255,255,255,0.9) 2%, rgba(255,255,255,0.9) 98%, transparent 100%);
    border-radius: 15px 25px 20px 10px;
    box-shadow: 
        0 10px 30px rgba(139, 69, 19, 0.1),
        inset 0 1px 0 rgba(255,255,255,0.8);
    transform: rotate(1deg);
    margin-left: 10%;
}

.ink-blot {
    position: absolute;
    width: 20px;
    height: 20px;
    background: radial-gradient(circle, rgba(139, 69, 19, 0.6) 0%, transparent 70%);
    border-radius: 50%;
}

.ink-blot.left { top: 10px; left: 20px; }

.handwritten {
    font-family: 'Caveat', cursive;
    font-size: 2rem;
    color: #8b4513;
    text-align: center;
    font-weight: 600;
}

.small-text {
    font-size: 0.8rem;
    font-family: 'Kalam', cursive;
    color: rgba(139, 69, 19, 0.7);
    margin-top: 0.5rem;
    font-weight: 300;
}

.quill-mark {
    position: absolute;
    bottom: 10px;
    right: 15px;
    font-size: 1.5rem;
    opacity: 0.6;
}

/* Confession piece */
.confession {
    background: 
        linear-gradient(135deg, rgba(255,255,255,0.95) 0%, rgba(250,245,235,0.95) 100%);
    border-radius: 20px 5px 25px 15px;
    box-shadow: 0 15px 35px rgba(139, 69, 19, 0.15);
    transform: rotate(-0.5deg);
    margin-right: 15%;
    position: relative;
    overflow: hidden;
}

.torn-edge {
    position: absolute;
    top: -5px;
    left: 0;
    right: 0;
    height: 10px;
    background: 
        radial-gradient(circle at 10% 50%, transparent 8px, rgba(250,245,235,0.95) 8px),
        radial-gradient(circle at 30% 50%, transparent 6px, rgba(250,245,235,0.95) 6px),
        radial-gradient(circle at 50% 50%, transparent 9px, rgba(250,245,235,0.95) 9px),
        radial-gradient(circle at 70% 50%, transparent 7px, rgba(250,245,235,0.95) 7px),
        radial-gradient(circle at 90% 50%, transparent 8px, rgba(250,245,235,0.95) 8px);
}

.vintage-text {
    font-family: 'Satisfy', cursive;
    font-size: 1.1rem;
    line-height: 1.8;
    color: #5d4037;
    text-align: justify;
    padding: 0 1rem;
}

.drop-cap {
    font-family: 'Euphoria Script', cursive;
    font-size: 4rem;
    float: left;
    line-height: 3rem;
    margin: 0 8px 0 0;
    color: #8b4513;
    text-shadow: 2px 2px 4px rgba(139, 69, 19, 0.3);
}

.date-flourish {
    text-align: center;
    margin-top: 1.5rem;
    padding: 1rem;
    border-top: 2px dotted rgba(139, 69, 19, 0.3);
}

.ornate-date {
    font-family: 'Amatic SC', cursive;
    font-size: 1.8rem;
    font-weight: 700;
    color: #8b4513;
    display: block;
}

.date-decoration {
    font-size: 0.9rem;
    color: rgba(139, 69, 19, 0.7);
    margin-top: 0.5rem;
}

/* Journey piece */
.journey {
    background: 
        linear-gradient(45deg, rgba(255,255,255,0.9) 0%, rgba(255,248,220,0.9) 100%);
    border-radius: 10px 30px 15px 25px;
    box-shadow: 0 20px 40px rgba(139, 69, 19, 0.1);
    transform: rotate(0.5deg);
    margin-left: 5%;
    position: relative;
}

.wax-seal {
    position: absolute;
    top: -15px;
    right: 20px;
    font-size: 2rem;
    z-index: 10;
}

.flowing-text {
    font-family: 'Caveat', cursive;
    font-size: 1.3rem;
    line-height: 1.7;
    color: #5d4037;
    position: relative;
}

.margin-note {
    position: absolute;
    font-family: 'Kalam', cursive;
    font-size: 0.7rem;
    color: rgba(139, 69, 19, 0.8);
    width: 120px;
    transform: rotate(-5deg);
}

.margin-note.left {
    left: -130px;
    top: 20%;
}

.margin-note.right {
    right: -130px;
    top: 60%;
    transform: rotate(5deg);
}

.tiny-text {
    font-style: italic;
    opacity: 0.7;
}

/* Memory fragments */
.memory-fragments {
    position: relative;
    height: 200px;
    margin: 6rem 0;
}

.fragment {
    position: absolute;
    background: rgba(255,255,255,0.9);
    border-radius: 50px;
    padding: 1rem 1.5rem;
    box-shadow: 0 10px 25px rgba(139, 69, 19, 0.1);
    font-family: 'Caveat', cursive;
    font-size: 1.1rem;
    color: #8b4513;
    opacity: 0;
    transition: all 0.6s ease;
}

.fragment.appear {
    opacity: 1;
}

.fragment[data-float="left"] {
    left: 10%;
    top: 20px;
    transform: rotate(-3deg);
}

.fragment[data-float="right"] {
    right: 15%;
    top: 80px;
    transform: rotate(2deg);
}

.fragment[data-float="center"] {
    left: 50%;
    top: 140px;
    transform: translateX(-50%) rotate(-1deg);
}

.fragment-decoration {
    margin-left: 0.5rem;
    font-size: 1.2rem;
}

/* Revelation piece */
.revelation {
    background: 
        linear-gradient(135deg, rgba(255,245,238,0.95) 0%, rgba(255,228,181,0.95) 100%);
    border-radius: 25px 10px 20px 30px;
    transform: rotate(-0.8deg);
    margin: 8rem 10% 8rem 5%;
    position: relative;
}

.illuminated-border {
    border: 3px solid rgba(139, 69, 19, 0.3);
    border-radius: 20px 5px 15px 25px;
    padding: 2rem;
    position: relative;
}

.illuminated-border::before {
    content: '❦';
    position: absolute;
    top: -15px;
    left: 20px;
    background: rgba(255,245,238,0.95);
    padding: 0 10px;
    font-size: 1.5rem;
    color: #8b4513;
}

.profound-text {
    font-family: 'Satisfy', cursive;
    font-size: 1.2rem;
    line-height: 1.8;
    color: #5d4037;
    text-align: justify;
}

.illuminated-letter {
    font-family: 'Euphoria Script', cursive;
    font-size: 5rem;
    float: left;
    line-height: 4rem;
    margin: 0 10px 0 0;
    color: #8b4513;
    text-shadow: 3px 3px 6px rgba(139, 69, 19, 0.3);
}

/* Interactive section */
.interactive-section {
    background: 
        radial-gradient(ellipse at center, rgba(255,182,193,0.3) 0%, rgba(255,228,181,0.2) 70%, transparent 100%),
        linear-gradient(135deg, rgba(255,255,255,0.9) 0%, rgba(250,235,215,0.9) 100%);
    border-radius: 30px 15px 25px 20px;
    transform: rotate(0.3deg);
    margin: 6rem 8% 6rem 12%;
    position: relative;
    overflow: hidden;
}

.vintage-invitation {
    text-align: center;
    padding: 1rem;
}

.invitation-header {
    font-family: 'Amatic SC', cursive;
    font-size: 2.2rem;
    font-weight: 700;
    color: #8b4513;
    margin-bottom: 1.5rem;
}

.invitation-body {
    font-family: 'Caveat', cursive;
    font-size: 1.3rem;
    line-height: 1.7;
    color: #5d4037;
    margin-bottom: 2rem;
}

.day-plan {
    margin-bottom: 2rem;
}

.time-section {
    margin: 1.5rem 0;
    padding: 1rem;
    border-radius: 15px;
    position: relative;
}

.time-section.morning {
    background: linear-gradient(135deg, rgba(255, 248, 220, 0.6), rgba(255, 239, 213, 0.4));
    border-left: 3px solid rgba(255, 165, 0, 0.5);
}

.time-section.evening {
    background: linear-gradient(135deg, rgba(75, 0, 130, 0.1), rgba(72, 61, 139, 0.05));
    border-left: 3px solid rgba(75, 0, 130, 0.3);
}

.time-header {
    font-family: 'Amatic SC', cursive;
    font-size: 1.4rem;
    font-weight: 700;
    color: #8b4513;
    margin-bottom: 0.5rem;
    text-align: center;
}

.plan-text {
    font-family: 'Caveat', cursive;
    font-size: 1.1rem;
    line-height: 1.6;
    color: #5d4037;
    text-align: justify;
}

.romantic-question {
    font-family: 'Satisfy', cursive;
    font-size: 1.3rem;
    color: #8b4513;
    text-align: center;
    margin: 2rem 0 1.5rem;
    font-style: italic;
    padding: 1rem;
    border: 2px dotted rgba(139, 69, 19, 0.3);
    border-radius: 20px;
    background: rgba(255, 255, 255, 0.7);
}

.response-buttons {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    margin-top: 2rem;
}

.response-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.8rem;
    padding: 1.2rem 2rem;
    border: none;
    border-radius: 25px;
    font-family: 'Caveat', cursive;
    font-size: 1.3rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.accept-btn {
    background: linear-gradient(135deg, #ff9a9e 0%, #fecfef 50%, #fecfef 100%);
    color: #8b4513;
    box-shadow: 0 8px 25px rgba(255, 154, 158, 0.3);
}

.accept-btn:hover {
    transform: translateY(-3px) scale(1.02);
    box-shadow: 0 12px 35px rgba(255, 154, 158, 0.4);
    background: linear-gradient(135deg, #ff6b9d 0%, #fda4e0 50%, #fda4e0 100%);
}

.decline-btn {
    background: linear-gradient(135deg, #d3d3d3 0%, #e8e8e8 100%);
    color: #666;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.1);
}

.decline-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.15);
    background: linear-gradient(135deg, #c0c0c0 0%, #dcdcdc 100%);
}

.btn-emoji {
    font-size: 1.4rem;
    animation: gentlePulse 2s ease-in-out infinite;
}

.accept-btn .btn-emoji {
    animation-delay: 0s;
}

.decline-btn .btn-emoji {
    animation: none;
}

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

.beating-heart {
    font-size: 2rem;
    animation: heartbeat 1.5s ease-in-out infinite;
}

.whisper-text {
    font-family: 'Satisfy', cursive;
    font-size: 1.1rem;
    color: #8b4513;
    font-style: italic;
}

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

/* Number reveal */
.number-reveal {
    text-align: center;
    margin: 10rem 0;
    position: relative;
}

.giant-number {
    position: relative;
    display: inline-block;
}

.twenty {
    font-family: 'Amatic SC', cursive;
    font-size: clamp(8rem, 20vw, 12rem);
    font-weight: 700;
    color: transparent;
    background: 
        linear-gradient(45deg, #8b4513 0%, #cd853f 50%, #8b4513 100%);
    background-clip: text;
    -webkit-background-clip: text;
    text-shadow: 2px 2px 4px rgba(139, 69, 19, 0.3);
    display: block;
    line-height: 1;
}

.number-meaning {
    margin-top: 2rem;
}

.meaning-line {
    font-family: 'Caveat', cursive;
    font-size: 1.5rem;
    color: #8b4513;
    margin: 0.5rem 0;
    opacity: 0;
    animation: fadeInSequence 0.8s ease forwards;
}

.meaning-line:nth-child(1) { animation-delay: 0.5s; }
.meaning-line:nth-child(2) { animation-delay: 1s; }
.meaning-line:nth-child(3) { animation-delay: 1.5s; }

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

/* Closing piece */
.closing {
    background: 
        linear-gradient(135deg, rgba(255,255,255,0.95) 0%, rgba(255,248,220,0.95) 100%);
    border-radius: 40px 20px 35px 25px;
    transform: rotate(0.2deg);
    margin: 8rem 5% 4rem 10%;
    position: relative;
}

.elegant-closing {
    text-align: center;
    padding: 2rem;
}

.closing-text {
    font-family: 'Satisfy', cursive;
    font-size: 1.4rem;
    line-height: 1.8;
    color: #5d4037;
    margin-bottom: 2rem;
}

.signature-section {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    margin: 2rem 0;
}

.signature-flourish {
    font-size: 2rem;
    color: #8b4513;
}

.signature {
    font-family: 'Caveat', cursive;
    font-size: 1.3rem;
    color: #8b4513;
    text-align: center;
}

.fancy-signature {
    font-size: 2rem;
    font-weight: 700;
    display: block;
    margin-top: 0.5rem;
}

.postscript {
    font-family: 'Kalam', cursive;
    font-size: 0.9rem;
    color: rgba(139, 69, 19, 0.8);
    margin-top: 2rem;
    padding: 1rem;
    border-top: 1px dotted rgba(139, 69, 19, 0.3);
    font-style: italic;
}

/* Printer's mark (copyright) */
.printers-mark {
    text-align: center;
    margin: 6rem 0 2rem;
    opacity: 0.6;
}

.mark-text {
    font-family: 'Kalam', cursive;
    font-size: 0.8rem;
    color: rgba(139, 69, 19, 0.7);
    line-height: 1.5;
}

/* Celebration overlay */
.celebration-veil {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: 
        radial-gradient(circle at center, rgba(255,182,193,0.9) 0%, rgba(255,228,181,0.95) 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transition: all 0.5s ease;
}

.celebration-veil.active {
    opacity: 1;
    visibility: visible;
}

.romantic-celebration {
    text-align: center;
    padding: 3rem 2rem;
    background: rgba(255,255,255,0.95);
    border-radius: 30px 15px 25px 20px;
    box-shadow: 0 25px 50px rgba(139, 69, 19, 0.2);
    max-width: 90%;
    position: relative;
}

.celebration-roses {
    margin-bottom: 2rem;
}

.rose {
    display: inline-block;
    font-size: 3rem;
    margin: 0 1rem;
    animation: roseBloom 2s ease-in-out infinite;
}

.rose:nth-child(1) { animation-delay: 0s; }
.rose:nth-child(2) { animation-delay: 0.5s; }
.rose:nth-child(3) { animation-delay: 1s; }

@keyframes roseBloom {
    0%, 100% { transform: scale(1) rotate(0deg); }
    50% { transform: scale(1.2) rotate(5deg); }
}

.celebration-text h2 {
    font-family: 'Amatic SC', cursive;
    font-size: 2.5rem;
    font-weight: 700;
    color: #8b4513;
    margin-bottom: 1rem;
}

.celebration-text p {
    font-family: 'Caveat', cursive;
    font-size: 1.4rem;
    color: #5d4037;
    margin-bottom: 1.5rem;
}

.toast-glasses {
    font-size: 2rem;
    margin: 1rem 0;
}

.elegant-close {
    padding: 1rem 2rem;
    background: 
        linear-gradient(135deg, #8b4513 0%, #cd853f 100%);
    border: none;
    border-radius: 25px;
    color: white;
    font-family: 'Caveat', cursive;
    font-size: 1.2rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 10px 20px rgba(139, 69, 19, 0.3);
}

.elegant-close:hover {
    transform: translateY(-3px);
    box-shadow: 0 15px 30px rgba(139, 69, 19, 0.4);
}

/* Mobile optimizations */
@media (max-width: 480px) {
    .letter-canvas {
        padding: 1rem 0.5rem;
    }
    
    .letter-piece {
        margin: 3rem 0;
        padding: 1rem;
    }
    
    .margin-note {
        display: none; /* Hide margin notes on small screens */
    }
    
    .vintage-ornament {
        font-size: 1.5rem;
    }
    
    .drop-cap, .illuminated-letter {
        font-size: 3rem;
    }
    
    .twenty {
        font-size: 6rem;
    }
    
    .romantic-celebration {
        padding: 2rem 1rem;
    }
}

/* Performance optimizations */
.letter-piece {
    will-change: transform, opacity;
}

.vintage-ornament, .petal {
    will-change: transform;
}

/* Accessibility */
@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}