/* ==========================================================================
   Design System & Variables
   ========================================================================== */
:root {
    --bg-dark: #090407;
    --bg-velvet: #130a10;
    --primary-rose: #d68798;
    --primary-gold: #e5b382;
    --accent-red: #e04b68;
    --text-light: #f5edf0;
    --text-muted: #bdaab1;
    --glass-bg: rgba(26, 14, 21, 0.45);
    --glass-border: rgba(252, 226, 230, 0.08);
    --glass-glow: rgba(214, 135, 152, 0.15);
    --rose-gold-gradient: linear-gradient(135deg, #f6cbd1 0%, #d68798 50%, #9e5b6b 100%);
    --gold-gradient: linear-gradient(135deg, #fad9a6 0%, #e5b382 50%, #b27b47 100%);
    --font-heading: 'Playfair Display', Georgia, serif;
    --font-body: 'Montserrat', sans-serif;
    --font-cursive: 'Great Vibes', cursive;
}

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

html {
    scroll-behavior: smooth;
    overflow-x: hidden;
    background-color: var(--bg-dark);
    color: var(--text-light);
    font-family: var(--font-body);
}

body {
    min-height: 100vh;
    overflow-x: hidden;
    perspective: 1000px;
}

/* ==========================================================================
   Background Canvas & Orbs
   ========================================================================== */
#sparkle-canvas {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: -2;
    pointer-events: none;
}

.glow-orb {
    position: fixed;
    border-radius: 50%;
    filter: blur(150px);
    opacity: 0.15;
    z-index: -3;
    pointer-events: none;
}

.orb-1 {
    top: -20%;
    left: -20%;
    width: 60vw;
    height: 60vw;
    background: radial-gradient(circle, var(--primary-rose), transparent 70%);
    animation: drift 20s infinite alternate ease-in-out;
}

.orb-2 {
    bottom: -20%;
    right: -20%;
    width: 60vw;
    height: 60vw;
    background: radial-gradient(circle, var(--primary-gold), transparent 70%);
    animation: drift 25s infinite alternate-reverse ease-in-out;
}

@keyframes drift {
    0% { transform: translate(0, 0) scale(1); }
    100% { transform: translate(10%, 15%) scale(1.2); }
}

/* ==========================================================================
   Music Player Widget
   ========================================================================== */
#music-player-container {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 100;
    transition: opacity 1s ease, transform 1s ease;
}

#music-player-container.hidden {
    opacity: 0;
    transform: translateY(-20px);
    pointer-events: none;
}

#music-toggle {
    display: flex;
    align-items: center;
    gap: 10px;
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    backdrop-filter: blur(12px);
    padding: 10px 18px;
    border-radius: 30px;
    cursor: pointer;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
    transition: all 0.3s ease;
}

#music-toggle:hover {
    border-color: var(--primary-rose);
    box-shadow: 0 4px 25px var(--glass-glow);
    transform: scale(1.05);
}

#music-toggle svg {
    width: 18px;
    height: 18px;
    fill: var(--primary-rose);
    transition: fill 0.3s;
}

#music-toggle:hover svg {
    fill: var(--primary-gold);
}

.music-text {
    color: var(--text-light);
    font-size: 0.85rem;
    font-weight: 600;
    letter-spacing: 0.05em;
    text-transform: uppercase;
}

.hidden {
    display: none !important;
}

/* ==========================================================================
   Stage 1: Envelope Entrance Page
   ========================================================================== */
#entrance-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 999;
    background-color: var(--bg-dark);
    transition: opacity 1.5s ease-out, transform 1.5s ease-out;
}

#entrance-container.fade-out {
    opacity: 0;
    transform: scale(1.05);
    pointer-events: none;
}

.envelope-wrapper {
    position: relative;
    width: 450px;
    height: 300px;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.envelope {
    position: relative;
    width: 100%;
    height: 100%;
    background: #2a1523;
    border-bottom-left-radius: 10px;
    border-bottom-right-radius: 10px;
    box-shadow: 0 20px 50px rgba(0,0,0,0.5);
    cursor: pointer;
    transform-style: preserve-3d;
    transition: transform 0.5s ease;
}

.envelope-flap {
    position: absolute;
    top: 0;
    width: 0;
    height: 0;
    border-left: 225px solid transparent;
    border-right: 225px solid transparent;
    border-top: 170px solid #3c1e32;
    transform-origin: top;
    z-index: 30;
    transition: transform 0.5s ease 0.3s, border-top-color 0.5s;
}

.envelope-pocket {
    position: absolute;
    bottom: 0;
    width: 0;
    height: 0;
    border-left: 225px solid #2f1727;
    border-right: 225px solid #2f1727;
    border-bottom: 150px solid #200f1a;
    border-radius: 0 0 10px 10px;
    z-index: 20;
}

.letter-preview {
    position: absolute;
    top: 20px;
    left: 20px;
    right: 20px;
    background: linear-gradient(135deg, #fffbf6, #f3e9db);
    border-radius: 8px;
    height: 130px;
    z-index: 15;
    padding: 20px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
    color: #4a283b;
    text-align: center;
    transition: transform 0.6s cubic-bezier(0.175, 0.885, 0.32, 1.275) 0.5s;
    transform: translateY(0);
}

.letter-preview h3 {
    font-family: var(--font-cursive);
    font-size: 2.2rem;
    margin-bottom: 5px;
    color: var(--accent-red);
}

.letter-preview p {
    font-size: 0.9rem;
    font-style: italic;
    margin-bottom: 10px;
}

.tap-hint {
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: #8c6a7d;
    display: inline-block;
    animation: bounce 1.5s infinite;
}

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

.envelope-seal {
    position: absolute;
    top: 150px;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 60px;
    height: 60px;
    background: var(--accent-red);
    border-radius: 50%;
    z-index: 40;
    display: flex;
    justify-content: center;
    align-items: center;
    box-shadow: 0 5px 15px rgba(0,0,0,0.3);
    transition: transform 0.3s ease, background 0.3s ease;
}

.heart-seal-icon {
    width: 32px;
    height: 32px;
    fill: #ffffff;
    animation: heartbeat 1.2s infinite;
}

@keyframes heartbeat {
    0%, 100% { transform: scale(1); }
    30% { transform: scale(1.15); }
    45% { transform: scale(1.05); }
    60% { transform: scale(1.2); }
}

/* Open Animation State */
.envelope.open .envelope-flap {
    transform: rotateX(180deg);
    z-index: 10;
    border-top-color: #2a1523;
}

.envelope.open .letter-preview {
    transform: translateY(-110px) scale(1.03);
    z-index: 25;
}

.envelope.open .envelope-seal {
    transform: translate(-50%, -50%) scale(0);
    pointer-events: none;
}

.envelope-title-outside {
    margin-top: 50px;
    font-family: var(--font-heading);
    font-size: 1.5rem;
    font-weight: 400;
    text-align: center;
    background: var(--rose-gold-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    letter-spacing: 0.1em;
    opacity: 0.9;
    animation: pulseGlow 3s infinite alternate;
}

@keyframes pulseGlow {
    0% { text-shadow: 0 0 10px rgba(214,135,152,0.1); }
    100% { text-shadow: 0 0 20px rgba(214,135,152,0.5); }
}

/* ==========================================================================
   Stage 2: Main Website Styling
   ========================================================================== */
main {
    position: relative;
    width: 100%;
    z-index: 10;
    opacity: 0;
    transition: opacity 1.5s ease;
}

main.fade-in {
    opacity: 1;
}

.section-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 6rem 2rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    position: relative;
}

.section-title {
    font-family: var(--font-heading);
    font-size: 2.8rem;
    text-align: center;
    margin-bottom: 3.5rem;
    position: relative;
    background: var(--rose-gold-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.section-title::after {
    content: '✦';
    display: block;
    font-size: 1rem;
    margin-top: 10px;
    color: var(--primary-rose);
    -webkit-text-fill-color: var(--primary-rose);
}

/* ==========================================================================
   Hero Section
   ========================================================================== */
#hero {
    min-height: 100vh;
    text-align: center;
}

.hero-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1.5rem;
}

.heart-sparkle {
    font-size: 1.8rem;
    color: var(--primary-rose);
    animation: sparkle-pulse 2s infinite alternate;
}

@keyframes sparkle-pulse {
    0% { transform: scale(0.9); opacity: 0.7; filter: drop-shadow(0 0 2px var(--primary-rose)); }
    100% { transform: scale(1.1); opacity: 1; filter: drop-shadow(0 0 10px var(--primary-rose)); }
}

.glow-text {
    font-family: var(--font-heading);
    font-size: 5rem;
    font-weight: 700;
    background: linear-gradient(to right, #ffffff 10%, #fad9a6 40%, #d68798 60%, #ffffff 90%);
    background-size: 200% auto;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    animation: shine 5s linear infinite;
    filter: drop-shadow(0 0 15px rgba(214,135,152,0.3));
}

@keyframes shine {
    to { background-position: 200% center; }
}

.hero-subtitle {
    font-size: 1.2rem;
    max-width: 600px;
    color: var(--text-muted);
    font-weight: 300;
    line-height: 1.6;
    letter-spacing: 0.05em;
}

.scroll-indicator {
    margin-top: 4rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    color: var(--text-muted);
    font-size: 0.8rem;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    opacity: 0.7;
}

.down-arrow {
    width: 24px;
    height: 24px;
    fill: var(--primary-rose);
    animation: float-arrow 2s infinite ease-in-out;
}

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

/* ==========================================================================
   Polaroid Cards
   ========================================================================== */
.polaroid-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 3.5rem;
    width: 100%;
    max-width: 900px;
}

.polaroid-card {
    background: rgba(255, 255, 255, 0.95);
    padding: 16px 16px 24px 16px;
    border-radius: 4px;
    box-shadow: 0 15px 35px rgba(0,0,0,0.6), 0 0 30px rgba(214,135,152,0.1);
    color: #2b1f26;
    transition: transform 0.6s cubic-bezier(0.165, 0.84, 0.44, 1), box-shadow 0.6s;
    transform: rotate(var(--rotation, 0deg)) translateY(50px);
    opacity: 0;
}

.polaroid-card:nth-child(1) {
    --rotation: -3deg;
}

.polaroid-card:nth-child(2) {
    --rotation: 3deg;
}

.polaroid-card.revealed {
    transform: rotate(var(--rotation, 0deg)) translateY(0);
    opacity: 1;
}

.polaroid-card:hover {
    transform: rotate(0deg) scale(1.05) translateY(-10px);
    box-shadow: 0 25px 50px rgba(0,0,0,0.7), 0 0 40px rgba(214,135,152,0.3);
    z-index: 5;
}

.polaroid-img-wrapper {
    position: relative;
    width: 100%;
    aspect-ratio: 1;
    overflow: hidden;
    border-radius: 2px;
    background-color: #130a10;
}

.polaroid-img-wrapper img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.8s ease;
}

.polaroid-card:hover .polaroid-img-wrapper img {
    transform: scale(1.08);
}

.polaroid-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(180deg, transparent 60%, rgba(19, 10, 16, 0.3));
    pointer-events: none;
}

.polaroid-caption {
    padding-top: 18px;
    text-align: center;
}

.polaroid-caption h4 {
    font-family: var(--font-heading);
    font-size: 1.35rem;
    font-weight: 700;
    color: #4a1e2b;
    margin-bottom: 6px;
}

.polaroid-caption p {
    font-family: var(--font-body);
    font-size: 0.85rem;
    color: #614a56;
    line-height: 1.4;
    font-weight: 400;
}

/* ==========================================================================
   Glassmorphic Card UI (Compliment Card)
   ========================================================================== */
.glass-card {
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-radius: 20px;
    padding: 3rem;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.4), 
                inset 0 1px 1px rgba(255, 255, 255, 0.1);
    width: 100%;
    max-width: 700px;
    text-align: center;
    position: relative;
    overflow: hidden;
}

.glass-card::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(252, 226, 230, 0.05) 0%, transparent 60%);
    pointer-events: none;
}

.compliment-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2rem;
}

.sparkle-decorative {
    font-size: 2rem;
    color: var(--primary-gold);
    animation: sparkle-pulse 3s infinite alternate;
}

.compliment-card h3 {
    font-family: var(--font-heading);
    font-size: 2rem;
    background: var(--gold-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    letter-spacing: 0.05em;
}

.compliment-display-wrapper {
    min-height: 100px;
    display: flex;
    align-items: center;
    justify-content: center;
}

#compliment-text {
    font-family: var(--font-heading);
    font-size: 1.35rem;
    font-style: italic;
    line-height: 1.8;
    color: var(--text-light);
    transition: opacity 0.5s ease, transform 0.5s ease;
}

#compliment-text.fade-out {
    opacity: 0;
    transform: translateY(-10px);
}

#compliment-text.fade-in {
    opacity: 1;
    transform: translateY(0);
}

/* Premium Button Styling */
.btn-primary {
    background: var(--rose-gold-gradient);
    border: none;
    padding: 14px 28px;
    border-radius: 30px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 12px;
    color: #4a1321;
    font-family: var(--font-body);
    font-weight: 600;
    font-size: 0.9rem;
    letter-spacing: 0.05em;
    box-shadow: 0 4px 15px rgba(214,135,152,0.4);
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.btn-primary span {
    position: relative;
    z-index: 2;
}

.btn-primary svg {
    width: 18px;
    height: 18px;
    fill: #4a1321;
    transition: transform 0.3s;
    position: relative;
    z-index: 2;
}

.btn-primary::after {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.4), transparent);
    transition: left 0.6s ease;
}

.btn-primary:hover::after {
    left: 100%;
}

.btn-primary:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 22px rgba(214, 135, 152, 0.6);
}

.btn-primary:active {
    transform: translateY(-1px);
}

.btn-primary:hover svg {
    transform: translateX(4px);
}

/* ==========================================================================
   Virtual Birthday Cake
   ========================================================================== */
.cake-card {
    max-width: 600px;
}

.cake-instruction {
    color: var(--text-muted);
    font-size: 0.9rem;
    margin-bottom: 2.5rem;
}

.cake-wrapper {
    position: relative;
    width: 250px;
    height: 250px;
    margin: 0 auto 2rem auto;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    align-items: center;
}

.cake-stand {
    width: 280px;
    height: 12px;
    background: linear-gradient(to right, #cfd8dc, #eceff1, #cfd8dc);
    border-radius: 6px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.4);
    z-index: 1;
}

.cake-stand::after {
    content: '';
    display: block;
    width: 100px;
    height: 50px;
    background: linear-gradient(to bottom, #b0bec5, #78909c);
    margin: 0 auto;
    clip-path: polygon(15% 0%, 85% 0%, 100% 100%, 0% 100%);
}

.cake {
    position: relative;
    width: 200px;
    z-index: 2;
}

/* Layers of the Cake */
.cake-bottom {
    width: 200px;
    height: 70px;
    background: #4e2936;
    border-radius: 8px 8px 0 0;
    box-shadow: inset 0 -15px 0 rgba(0,0,0,0.15);
    position: relative;
}

.cake-middle {
    width: 180px;
    height: 55px;
    background: #d68798;
    margin: 0 auto;
    border-radius: 6px 6px 0 0;
    box-shadow: inset 0 -10px 0 rgba(0,0,0,0.1);
    position: relative;
    z-index: 2;
}

.cake-top {
    width: 150px;
    height: 45px;
    background: #fff0f3;
    margin: 0 auto;
    border-radius: 5px 5px 0 0;
    position: relative;
    z-index: 3;
}

/* Dripping Frosting */
.dripping-frosting {
    position: absolute;
    bottom: -10px;
    left: 0;
    width: 100%;
    height: 15px;
    background: #fff0f3;
    border-radius: 0 0 10px 10px;
}

.dripping-frosting::before {
    content: '';
    position: absolute;
    width: 20px;
    height: 25px;
    background: #fff0f3;
    border-radius: 50%;
    top: -5px;
    left: 15px;
    box-shadow: 30px 2px 0 #fff0f3, 60px 4px 0 #fff0f3, 90px 1px 0 #fff0f3, 110px 5px 0 #fff0f3;
}

/* Candles */
.candle {
    position: absolute;
    width: 8px;
    height: 40px;
    background: linear-gradient(to right, #e5b382 50%, #fad9a6 50%);
    background-size: 8px 100%;
    border-radius: 3px 3px 0 0;
    z-index: 4;
    cursor: pointer;
}

#candle-1 { bottom: 105px; left: 60px; }
#candle-2 { bottom: 115px; left: 96px; }
#candle-3 { bottom: 105px; left: 132px; }

.flame {
    position: absolute;
    top: -15px;
    left: -4px;
    width: 16px;
    height: 20px;
    background: radial-gradient(circle at center, #ffd54f 20%, #ff8f00 60%, transparent 80%);
    border-radius: 50% 50% 20% 20%;
    transform-origin: bottom center;
    animation: flicker 1.5s infinite alternate ease-in-out;
    filter: drop-shadow(0 0 8px #ff8f00);
}

@keyframes flicker {
    0% { transform: scale(1) rotate(-2deg); }
    100% { transform: scale(1.1) rotate(2deg); }
}

/* Candle Glow Effects */
.candle-glow {
    position: absolute;
    width: 120px;
    height: 120px;
    background: radial-gradient(circle, rgba(255, 143, 0, 0.2) 0%, transparent 70%);
    border-radius: 50%;
    z-index: 3;
    pointer-events: none;
    transform: translate(-50%, -50%);
    transition: opacity 0.5s ease;
}

#glow-1 { bottom: 30px; left: 64px; }
#glow-2 { bottom: 40px; left: 100px; }
#glow-3 { bottom: 30px; left: 136px; }

/* Blown Out Candle State */
.candle.extinguished .flame {
    display: none;
}

/* Wish Reveal Card styling */
#wish-reveal-card {
    margin-top: 1.5rem;
    animation: fadeInScale 0.8s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards;
}

.confetti-streamer {
    font-size: 3rem;
    margin-bottom: 1rem;
    animation: spin 3s infinite linear;
    display: inline-block;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

#wish-reveal-card h3 {
    font-family: var(--font-heading);
    font-size: 1.8rem;
    color: var(--primary-gold);
    margin-bottom: 0.8rem;
}

#wish-reveal-card p {
    font-size: 1.05rem;
    color: var(--text-light);
    line-height: 1.6;
    max-width: 450px;
    margin: 0 auto;
}

@keyframes fadeInScale {
    from { opacity: 0; transform: scale(0.9); }
    to { opacity: 1; transform: scale(1); }
}

/* ==========================================================================
   Timeline / Journey of Elegance
   ========================================================================== */
.timeline-container {
    position: relative;
    width: 100%;
    max-width: 800px;
    margin: 0 auto;
    padding: 2rem 0;
}

.timeline-container::before {
    content: '';
    position: absolute;
    top: 0;
    bottom: 0;
    left: 50%;
    width: 2px;
    background: linear-gradient(to bottom, transparent, var(--primary-rose) 10%, var(--primary-gold) 90%, transparent);
    transform: translateX(-50%);
}

.timeline-item {
    position: relative;
    width: 100%;
    margin-bottom: 4rem;
    display: flex;
    justify-content: flex-end;
}

.timeline-item:nth-child(even) {
    justify-content: flex-start;
}

.timeline-dot {
    position: absolute;
    left: 50%;
    top: 30px;
    width: 16px;
    height: 16px;
    background: var(--bg-dark);
    border: 2px solid var(--primary-rose);
    border-radius: 50%;
    transform: translateX(-50%);
    box-shadow: 0 0 10px var(--primary-rose);
    z-index: 2;
    transition: transform 0.3s;
}

.timeline-item:hover .timeline-dot {
    transform: translateX(-50%) scale(1.3);
    border-color: var(--primary-gold);
    box-shadow: 0 0 15px var(--primary-gold);
}

.timeline-content {
    width: 44%;
    padding: 2rem;
    position: relative;
    border-radius: 15px;
    transform: translateY(30px);
    opacity: 0;
    transition: transform 0.8s cubic-bezier(0.165, 0.84, 0.44, 1), opacity 0.8s;
}

.timeline-item.revealed .timeline-content {
    transform: translateY(0);
    opacity: 1;
}

.timeline-date {
    display: block;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.15em;
    color: var(--primary-rose);
    margin-bottom: 0.5rem;
    font-weight: 600;
}

.timeline-content h4 {
    font-family: var(--font-heading);
    font-size: 1.4rem;
    color: var(--primary-gold);
    margin-bottom: 0.8rem;
}

.timeline-content p {
    font-size: 0.9rem;
    color: var(--text-muted);
    line-height: 1.6;
    font-weight: 300;
}

/* ==========================================================================
   Parchment Letter Scroll Section
   ========================================================================== */
.letter-scroll-wrapper {
    position: relative;
    width: 100%;
    max-width: 680px;
    margin: 0 auto;
    padding: 20px 0;
    transform: translateY(40px);
    opacity: 0;
    transition: transform 0.8s ease, opacity 0.8s ease;
}

.letter-scroll-wrapper.revealed {
    transform: translateY(0);
    opacity: 1;
}

.scroll-roller {
    height: 16px;
    background: linear-gradient(to bottom, #d7ccc8, #a1887f, #d7ccc8);
    border-radius: 8px;
    box-shadow: 0 4px 10px rgba(0,0,0,0.5);
    position: relative;
    z-index: 5;
}

.scroll-roller::after {
    content: '';
    position: absolute;
    width: 24px;
    height: 24px;
    background: radial-gradient(circle, #e0f2f1 20%, #e0a96d 50%, #8d6e63 100%);
    border-radius: 50%;
    top: -4px;
}
.scroll-top::after { left: -10px; }
.scroll-bottom::after { right: -10px; }

.scroll-body {
    background: linear-gradient(to right, rgba(254,248,238,0.96), rgba(245,235,220,0.96) 5%, rgba(255,251,246,0.98) 95%, rgba(254,248,238,0.96));
    border-left: 1px solid rgba(141, 110, 99, 0.2);
    border-right: 1px solid rgba(141, 110, 99, 0.2);
    padding: 4rem 3.5rem;
    color: #3e2723;
    font-family: var(--font-body);
    box-shadow: 0 10px 40px rgba(0,0,0,0.3);
    z-index: 2;
    position: relative;
}

/* Decorative background texture */
.scroll-body::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: radial-gradient(rgba(141, 110, 99, 0.05) 9%, transparent 9%),
                      radial-gradient(rgba(141, 110, 99, 0.05) 9%, transparent 9%);
    background-size: 20px 20px;
    background-position: 0 0, 10px 10px;
    pointer-events: none;
}

.cursive-heading {
    font-family: var(--font-cursive);
    font-size: 3rem;
    color: #792b3a;
    margin-bottom: 2rem;
    text-align: left;
}

.letter-paragraph {
    font-size: 1rem;
    line-height: 1.9;
    margin-bottom: 1.5rem;
    text-align: justify;
    color: #4e342e;
    font-weight: 400;
}

.signature {
    margin-top: 3.5rem;
    text-align: right;
    font-family: var(--font-cursive);
    font-size: 2.2rem;
    color: #792b3a;
    line-height: 1.3;
}

.signature span {
    font-size: 2.5rem;
    display: inline-block;
    animation: heartbeat 1.5s infinite;
}

/* ==========================================================================
   Footer Section
   ========================================================================== */
footer {
    padding: 3rem 0;
    text-align: center;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
    background: rgba(10, 5, 8, 0.8);
    position: relative;
    z-index: 10;
}

footer p {
    color: var(--text-muted);
    font-size: 0.8rem;
    letter-spacing: 0.1em;
}

/* ==========================================================================
   Scroll Reveal System (JS Triggered)
   ========================================================================== */
.reveal-on-scroll {
    transform: translateY(40px);
    opacity: 0;
    transition: transform 1s cubic-bezier(0.165, 0.84, 0.44, 1), opacity 1s;
}

.reveal-on-scroll.revealed {
    transform: translateY(0);
    opacity: 1;
}

.delay-1 {
    transition-delay: 0.2s;
}
.delay-2 {
    transition-delay: 0.4s;
}

/* ==========================================================================
   Responsive Styling
   ========================================================================== */
@media (max-width: 768px) {
    .glow-text {
        font-size: 3rem;
    }
    
    .section-title {
        font-size: 2.2rem;
    }

    .envelope-wrapper {
        width: 320px;
        height: 220px;
    }

    .envelope-flap {
        border-left-width: 160px;
        border-right-width: 160px;
        border-top-width: 120px;
    }

    .envelope-pocket {
        border-left-width: 160px;
        border-right-width: 160px;
        border-bottom-width: 110px;
    }

    .envelope-seal {
        top: 110px;
        width: 50px;
        height: 50px;
    }
    
    .heart-seal-icon {
        width: 24px;
        height: 24px;
    }

    .envelope.open .letter-preview {
        transform: translateY(-80px) scale(1.02);
    }

    .letter-preview h3 {
        font-size: 1.8rem;
    }

    .letter-preview p {
        font-size: 0.75rem;
    }

    .glass-card {
        padding: 2rem 1.5rem;
    }

    .timeline-container::before {
        left: 30px;
    }

    .timeline-item {
        justify-content: flex-end !important;
        margin-bottom: 2.5rem;
    }

    .timeline-dot {
        left: 30px;
    }

    .timeline-content {
        width: calc(100% - 60px);
        padding: 1.5rem;
    }

    .scroll-body {
        padding: 2.5rem 1.5rem;
    }

    .cursive-heading {
        font-size: 2.2rem;
    }

    .letter-paragraph {
        font-size: 0.95rem;
        line-height: 1.7;
    }
}
