/* ==========================================================================
   Premium UI Framework & Design Tokens
   ========================================================================== */
:root {
    /* Sophisticated Rose-Gold & Luxury Palette */
    --bg-gradient: linear-gradient(135deg, #fbc5d8 0%, #fbc2eb 50%, #a1c4fd 100%);
    --glass-bg: rgba(255, 255, 255, 0.45);
    --glass-border: rgba(255, 255, 255, 0.6);
    --glass-shadow: 0 24px 64px rgba(224, 75, 117, 0.15), 0 8px 24px rgba(0, 0, 0, 0.04);
    
    /* Typography Colors */
    --primary-color: #b7094c;
    --secondary-color: #5c134f;
    --text-main: #3a0ca3;
    --text-muted: #7209b7;
    
    /* Premium Accents */
    --accent-glow: 0 0 20px rgba(247, 37, 133, 0.5);
    --btn-gradient: linear-gradient(45deg, #f72585, #7209b7);
    --btn-gradient-hover: linear-gradient(45deg, #7209b7, #f72585);
}

/* --- Structural Resets --- */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    -webkit-font-smoothing: antialiased;
}

body {
    background: var(--bg-gradient);
    min-height: 100vh;
    min-height: -webkit-fill-available;
    overflow-x: hidden;
    position: relative;
    display: flex;
    justify-content: center;
    align-items: center;
}

canvas {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 1;
}

.hidden {
    display: none !important;
    opacity: 0;
}

/* ==========================================================================
   1. Luxury Intro Overlay
   ========================================================================== */
.intro-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: radial-gradient(circle at center, #fbc2eb, #b7094c);
    z-index: 999;
    display: flex;
    justify-content: center;
    align-items: center;
    transition: opacity 1s cubic-bezier(0.25, 1, 0.5, 1);
}

.intro-card {
    background: rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(25px);
    -webkit-backdrop-filter: blur(25px);
    border: 1px solid var(--glass-border);
    padding: 3rem 2rem;
    border-radius: 32px;
    text-align: center;
    color: #fff;
    box-shadow: 0 30px 70px rgba(0, 0, 0, 0.2);
    max-width: 90%;
    width: 420px;
    animation: premiumEntrance 0.8s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.heart-icon-wrap i {
    font-size: 4.5rem;
    color: #fff;
    margin-bottom: 1.5rem;
    filter: drop-shadow(0 0 15px rgba(255, 255, 255, 0.6));
}

.pulse {
    animation: premiumPulse 1.5s infinite ease-in-out;
}

.btn {
    background: var(--btn-gradient);
    color: white;
    border: none;
    padding: 1rem 2.5rem;
    font-size: 1.15rem;
    font-weight: 600;
    letter-spacing: 0.5px;
    border-radius: 50px;
    cursor: pointer;
    margin-top: 2rem;
    transition: all 0.3s cubic-bezier(0.25, 1, 0.5, 1);
    box-shadow: 0 10px 25px rgba(247, 37, 133, 0.4);
}

.btn:hover {
    transform: translateY(-3px);
    background: var(--btn-gradient-hover);
    box-shadow: 0 15px 30px rgba(247, 37, 133, 0.6), var(--accent-glow);
}

.btn:active {
    transform: translateY(-1px);
}

/* ==========================================================================
   2. Main Layout Container (High-End Glassmorphism)
   ========================================================================== */
.main-content {
    width: 100%;
    max-width: 720px;
    padding: 2rem 1.2rem;
    z-index: 2;
    animation: premiumFadeIn 1.2s cubic-bezier(0.25, 1, 0.5, 1) forwards;
}

.glass-container {
    background: var(--glass-bg);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid var(--glass-border);
    border-radius: 40px;
    padding: 3rem 2.5rem;
    box-shadow: var(--glass-shadow);
    display: flex;
    flex-direction: column;
    gap: 3.5rem;
    align-items: center;
}

/* --- Typography & Header --- */
.header {
    text-align: center;
    width: 100%;
}

.title {
    color: var(--primary-color);
    font-size: 2.3rem;
    font-weight: 800;
    line-height: 1.3;
    margin-bottom: 0.8rem;
    letter-spacing: -0.5px;
    background: linear-gradient(45deg, var(--primary-color), var(--secondary-color));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.typewriter {
    font-size: 1.1rem;
    color: var(--text-muted);
    font-weight: 500;
    line-height: 1.6;
    min-height: 2rem;
    max-width: 90%;
    margin: 0 auto;
}

/* ==========================================================================
   3. Premium Interactive Image Slider
   ========================================================================== */
.slider-section {
    width: 100%;
    max-width: 520px;
}

.slider {
    position: relative;
    border-radius: 28px;
    overflow: hidden;
    aspect-ratio: 4 / 3;
    box-shadow: 0 20px 45px rgba(92, 19, 79, 0.15);
    border: 6px solid rgba(255, 255, 255, 0.8);
    transform: translateZ(0); /* Fix overflow bugs on safari */
}

.slides {
    width: 100%;
    height: 100%;
    position: relative;
}

.slide {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    transform: scale(1.05);
    transition: opacity 1.2s cubic-bezier(0.25, 1, 0.5, 1), transform 1.2s cubic-bezier(0.25, 1, 0.5, 1);
}

.slide.active {
    opacity: 1;
    transform: scale(1);
}

.slide img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* Slider Pagination Dots */
.slider-dots {
    position: absolute;
    bottom: 16px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 10px;
    background: rgba(0, 0, 0, 0.2);
    padding: 6px 12px;
    border-radius: 20px;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

.dot {
    width: 8px;
    height: 8px;
    background: rgba(255, 255, 255, 0.5);
    border-radius: 50%;
    cursor: pointer;
    transition: all 0.4s cubic-bezier(0.25, 1, 0.5, 1);
}

.dot.active {
    background: #fff;
    width: 20px;
    border-radius: 10px;
    box-shadow: 0 0 8px #fff;
}

/* ==========================================================================
   4. The Letter Concept (Luxury Envelope & Poetry Panel)
   ========================================================================== */
.letter-section {
    width: 100%;
    display: flex;
    justify-content: center;
}

.envelope {
    background: rgba(255, 255, 255, 0.7);
    border: 1px solid rgba(255, 255, 255, 0.9);
    border-radius: 24px;
    width: 100%;
    max-width: 580px;
    padding: 2.5rem;
    cursor: pointer;
    transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.03);
    text-align: center;
}

.envelope:hover {
    transform: translateY(-5px);
    background: rgba(255, 255, 255, 0.85);
    box-shadow: 0 20px 40px rgba(183, 9, 76, 0.12);
}

.envelope-front {
    font-size: 1.4rem;
    color: var(--primary-color);
    font-weight: 700;
    letter-spacing: 0.5px;
}

.envelope-front i {
    margin-right: 10px;
    animation: premiumPulse 1.4s infinite;
}

/* Content Within Opened Letter */
.letter-content {
    text-align: left;
    color: var(--text-main);
    line-height: 1.8;
    font-size: 1.1rem;
    animation: premiumSlideDown 0.6s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.letter-content h3 {
    margin-bottom: 1.5rem;
    color: var(--primary-color);
    font-size: 1.4rem;
    font-weight: 700;
    border-bottom: 2px dashed rgba(183, 9, 76, 0.2);
    padding-bottom: 0.5rem;
}

.letter-content p {
    margin-bottom: 1.5rem;
}

/* Premium Highlight States */
.letter-content strong {
    color: var(--primary-color);
    font-size: 1.2rem;
}

.signature {
    text-align: right;
    font-weight: 700;
    margin-top: 2.5rem;
    color: var(--secondary-color);
    border-top: 1px solid rgba(0, 0, 0, 0.05);
    padding-top: 1rem;
}

/* ==========================================================================
   5. Floating Minimalist Audio Controls
   ========================================================================== */
.music-toggle {
    position: fixed;
    bottom: 24px;
    right: 24px;
    background: rgba(255, 255, 255, 0.7);
    border: 1px solid var(--glass-border);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    color: var(--primary-color);
    width: 52px;
    height: 52px;
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.08);
    z-index: 10;
    transition: all 0.3s cubic-bezier(0.25, 1, 0.5, 1);
}

.music-toggle:hover {
    transform: scale(1.1) rotate(10deg);
    background: #fff;
    box-shadow: 0 12px 28px rgba(183, 9, 76, 0.2);
}

/* ==========================================================================
   6. Keyframes & Animation Library
   ========================================================================== */
@keyframes premiumPulse {
    0%, 100% { transform: scale(1); filter: drop-shadow(0 0 5px rgba(247,37,133,0.2)); }
    50% { transform: scale(1.08); filter: drop-shadow(0 0 15px rgba(247,37,133,0.6)); }
}

@keyframes premiumEntrance {
    from { opacity: 0; transform: scale(0.85) translateY(20px); }
    to { opacity: 1; transform: scale(1) translateY(0); }
}

@keyframes premiumFadeIn {
    from { opacity: 0; transform: translateY(30px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes premiumSlideDown {
    from { opacity: 0; transform: translateY(-20px); }
    to { opacity: 1; transform: translateY(0); }
}

/* ==========================================================================
   7. Advanced Responsive System (Fluid layouts)
   ========================================================================== */
@media (max-width: 640px) {
    .glass-container {
        padding: 2rem 1.5rem;
        gap: 2.5rem;
        border-radius: 32px;
    }
    
    .title {
        font-size: 1.85rem;
    }
    
    .typewriter {
        font-size: 0.98rem;
        max-width: 100%;
    }
    
    .envelope {
        padding: 1.8rem 1.2rem;
    }
    
    .letter-content {
        font-size: 1rem;
        line-height: 1.7;
    }

    .music-toggle {
        bottom: 16px;
        right: 16px;
        width: 46px;
        height: 46px;
    }
}

@media (max-width: 400px) {
    .title {
        font-size: 1.6rem;
    }
}
/* ==========================================================================
   4. Premium Memo Photo Card Section
   ========================================================================== */
.memo-section {
    width: 100%;
    display: flex;
    justify-content: center;
    perspective: 1000px; /* Enables rich 3D hover physics */
    margin-top: 1rem;
}

.memo-card {
    background: #ffffff;
    padding: 1.2rem 1.2rem 2rem 1.2rem;
    border-radius: 4px;
    width: 100%;
    max-width: 320px;
    box-shadow: 0 15px 35px rgba(92, 19, 79, 0.12), 
                0 5px 15px rgba(0, 0, 0, 0.06),
                inset 0 0 40px rgba(0, 0, 0, 0.02);
    transform: rotate(3deg); /* Soft organic slant */
    transition: all 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    position: relative;
    border: 1px solid rgba(0, 0, 0, 0.05);
}

/* Decorative Thumbtack Pin */
.memo-pin {
    position: absolute;
    top: -12px;
    left: 50%;
    transform: translateX(-50%);
    color: #ff4d6d;
    font-size: 1.4rem;
    filter: drop-shadow(2px 3px 2px rgba(0,0,0,0.15));
    z-index: 3;
    transition: transform 0.3s ease;
}

.memo-photo-wrap {
    width: 100%;
    aspect-ratio: 1 / 1; /* Classic square polaroid look */
    overflow: hidden;
    background: #f7f7f7;
    border: 1px solid rgba(0, 0, 0, 0.08);
    position: relative;
}

/* Subtle glossy reflection sheet across the photo */
.memo-photo-wrap::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, rgba(255,255,255,0.2) 0%, rgba(255,255,255,0) 50%);
    pointer-events: none;
}

.memo-photo {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.6s cubic-bezier(0.25, 1, 0.5, 1);
}

/* Script Handwriting Area */
.memo-caption {
    text-align: center;
    padding-top: 1.2rem;
}

.memo-text {
    font-family: 'Georgia', serif;
    font-style: italic;
    font-size: 1.15rem;
    color: #4a0e2e;
    font-weight: 600;
    margin-bottom: 0.3rem !important;
}

.memo-date {
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 2px;
    color: #a37081;
    font-weight: 700;
}

/* Premium Dynamic Floating Effect on Hover */
.memo-card:hover {
    transform: rotate(0deg) scale(1.06) translateY(-8px);
    box-shadow: 0 25px 50px rgba(183, 9, 76, 0.18), 0 10px 20px rgba(0, 0, 0, 0.04);
}

.memo-card:hover .memo-pin {
    transform: translateX(-50%) translateY(-2px) scale(1.1);
}

.memo-card:hover .memo-photo {
    transform: scale(1.04);
}

/* Responsive adjustment for small viewport heights */
@media (max-width: 640px) {
    .memo-card {
        max-width: 280px;
        padding: 1rem 1rem 1.6rem 1rem;
    }
    .memo-text {
        font-size: 1.05rem;
    }
}