/* ==========================================
   CUSTOMIZABLE CSS VARIABLES (CHOP & CHANGE)
   ========================================== */
:root {
    /* Color Palette */
    --bg-cream: #fbf8f3;
    --burgundy-deep: #4a121a;
    --burgundy-mid: #722f37;
    --burgundy-light: #984447;
    --text-dark: #2c1a1c;
    --accent-gold: #d4af37;

    
    /* Fonts */
    --font-serif: 'Playfair Display', Georgia, serif;
    --font-script: 'Pinyon Script', cursive;

    /* IMAGE PLACEHOLDERS (Swap URLs inside the quotes with your PNG paths) */
    --envelope-img: url('envelope.jpg');
    --parchment-bg: url('https://www.transparenttextures.com/patterns/cream-paper.png');
    --letter-bg: url('https://i.pinimg.com/736x/28/61/5b/28615b6570b6b93f8956c77a4e8f47cb.jpg');
    --music-bg: url('kissmusic.jpg');
}


/* ==========================================
   GLOBAL STYLES & LAYOUT
   ========================================== */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: var(--font-serif);
    background-color: var(--ink);
    color: var(--text-dark);
    overflow-x: hidden;
    height: 100vh;
    /* background-image: var(--parchment-bg); */
}

/* Page Container Management */
.page {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100vh;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.5s ease-in-out;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: 40px 20px;
    text-align: center;
}

.page.active {
    opacity: 1;
    pointer-events: auto;
}

/* Vintage Borders and Frames */
.vintage-frame {
    border: 2px solid var(--burgundy-deep);
    outline: 1px solid var(--burgundy-deep);
    outline-offset: 4px;
    padding: 40px;
    background-color: rgba(251, 248, 243, 0.9);
    
    max-width: 600px;
    width: 100%;
    border-radius: 4px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.05);
    position: relative;
    z-index: 0;
}

/* Typography Defaults */
h1, h2, h3 {
    color: var(--burgundy-deep);
    letter-spacing: 1px;
    margin-bottom: 20px;
}

h1 { font-size: 2.5rem; }

/* Elegant Buttons */
.btn {
    font-family: var(--font-serif);
    background-color: var(--burgundy-deep);
    color: var(--bg-cream);
    border: 1px solid var(--accent-gold);
    padding: 12px 28px;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.3s ease;
    text-transform: uppercase;
    letter-spacing: 2px;
    margin: 10px;
    border-radius: 2px;
}

.btn:hover {
    background-color: var(--burgundy-mid);
    box-shadow: 0 0 10px rgba(114, 47, 55, 0.3);
}

/* Global Navigation Buttons */
.global-nav {
    position: fixed;
    bottom: 20px;
    left: 0;
    width: 100%;
    display: flex;
    justify-content: center;
    gap: 40px;
    z-index: 1000;
    opacity: 0;
    transition: opacity 0.5s ease;
    pointer-events: none;
}

.global-nav.visible {
    opacity: 1;
    pointer-events: auto;
}

.nav-btn {
    background: var(--bg-cream);
    border: 1px solid rgba(74, 18, 26, 0.25);
    box-shadow: 0 8px 18px rgba(0, 0, 0, 0.12);
    font-family: var(--font-serif);
    color: var(--burgundy-deep);
    font-size: 1rem;
    cursor: pointer;
    text-transform: uppercase;
    letter-spacing: 3px;
    padding: 8px 16px;
    border-radius: 4px;
    transition: all 0.3s ease;
}

.nav-btn:hover {
    border-color: var(--burgundy-deep);
    color: var(--burgundy-light);
    background: rgba(251, 248, 243, 0.95);
    box-shadow: 0 12px 24px rgba(0, 0, 0, 0.16);
}

/* Blackout overlay for Page 1 -> Page 2 transition */
#blackout {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: black;
    opacity: 0;
    pointer-events: none;
    z-index: 9999;
    transition: opacity 0.5s ease-in-out;
}

#blackout.active {
    opacity: 1;
}

/* ==========================================
   PAGE 1 SPECIFIC STYLES
   ========================================== */
.cake-container {
    width: 280px;
    height: 280px;
    margin: 0 auto 30px;
    border-radius: 50%;
    border: 4px solid var(--burgundy-deep);
    background-image: var(--cake-lit-img);
    background-size: cover;
    background-position: center;
    transition: background-image 0.5s ease;
    position: relative;
    overflow: visible;
    box-shadow: 0 8px 20px rgba(0,0,0,0.15);
}

.cake-container.blown {
    background-image: var(--cake-blown-img);
}

/* Candles & Flames */
.candles {
    position: absolute;
    top: 16%;
    left: 0;
    width: 100%;
    height: 40%;
    pointer-events: none;
    display: flex;
    justify-content: space-around;
    align-items: flex-start;
}

.candle {
    position: relative;
    width: 14px;
    height: 68px;
    background: linear-gradient(#fff,#f6f6f6);
    border-radius: 3px;
    display: flex;
    justify-content: center;
    align-items: flex-start;
}

.wick {
    position: absolute;
    top: 8px;
    width: 2px;
    height: 8px;
    background: #222;
    left: 50%;
    transform: translateX(-50%);
}

.flame {
    position: absolute;
    top: -8px;
    left: 50%;
    transform: translateX(-50%);
    width: 14px;
    height: 18px;
    background: radial-gradient(circle at 40% 40%, #fff 0 20%, #ffd36b 22% 45%, #ff8a00 46% 70%, rgba(255,138,0,0.9) 71% 100%);
    border-radius: 50% 50% 40% 40%;
    box-shadow: 0 0 8px rgba(255,140,0,0.9);
    animation: flicker 150ms infinite alternate;
    transition: all 600ms ease;
}

.flame.out {
    opacity: 0;
    transform: translateX(-50%) translateY(-6px) scale(0.5);
    box-shadow: none;
}

@keyframes flicker {
    0% { transform: translateX(-50%) translateY(0) scaleY(1); }
    100% { transform: translateX(-50%) translateY(-2px) scaleY(0.9); }
}

.smoke {
    position: absolute;
    top: -18px;
    left: 50%;
    transform: translateX(-50%);
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: rgba(120,120,120,0.25);
    animation: rise 1200ms ease-out forwards;
}

@keyframes rise {
    0% { opacity: 0.9; transform: translateX(-50%) translateY(0) scale(1); }
    100% { opacity: 0; transform: translateX(-50%) translateY(-30px) scale(2); }
}

/* ==========================================
   PAGE 2 SPECIFIC STYLES
   ========================================== */
.envelope-container {
    width: 250px;
    height: 180px;
    margin: 0 auto 30px;
    background-image: var(--envelope-img);
    background-size: cover;
    background-position: center;
    border: 1px solid rgba(0,0,0,0.1);
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
}

.mail-actions {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 15px;
    margin-top: 20px;
    min-height: 80px;
}

#btn-yes {
    position: relative;
    z-index: 10;
}

/* ==========================================
   PAGE 3 SPECIFIC STYLES (Scrollable Memory Lane)
   ========================================== */
#page3 {
    overflow-y: auto;
    display: block; /* Overriding flex to allow natural document scrolling */
    height: 100vh;
    padding-bottom: 100px; /* Space for nav buttons */
}

.scroll-wrapper {
    max-width: 700px;
    margin: 60px auto;
    padding: 0 20px;
}

.memory-section {
    background-color: rgba(251, 248, 243, 0.95);
    border: 1px solid var(--burgundy-mid);
    padding: 40px 30px;
    margin-bottom: 60px;
    border-radius: 4px;
    box-shadow: 0 5px 20px rgba(0,0,0,0.03);
    position: relative;
}

 .memory-section::before {
    content: "᯽  ᯽  ᯽  ᯽  ᯽  ᯽  ᯽";
    display: block;
    text-align: center;
    color: var(--burgundy-mid);
    letter-spacing: 5px;
    margin-bottom: 20px;
    font-size: 1rem;
} 
/* .memory-section {
    position: relative;
}
.memory-section::before {
    content: "";
    position: absolute;
    top: -20px;
    left: 50%;
    transform: translateX(-50%);
    width: 190px;
    height: 85px;
    background-color: transparent;
    background-image: url('https://i.pinimg.com/1200x/00/a1/4e/00a14edc54e4d4cc17d57debd2434ed3.jpg');
    background-position: center;
    background-repeat: no-repeat;
    background-size: contain;
    mix-blend-mode: multiply;
    opacity: 1;
    pointer-events: none;
} */
/* Section 1: 100 Things List */
.love-list {
    list-style: none;
    text-align: left;
    max-width: 500px;
    margin: 0 auto;
}

.love-list li {
    font-size: 1.1rem;
    line-height: 1.6;
    padding: 12px 0;
    border-bottom: 1px dashed rgba(114, 47, 55, 0.2);
    display: flex;
    align-items: flex-start;
}

.love-list li::before {
    content: attr(data-number) ".";
    font-weight: bold;
    color: var(--burgundy-deep);
    margin-right: 15px;
    min-width: 30px;
}

/* Section 2: Music Playlist Box */
.playlist-frame {
    border: 2px solid var(--burgundy-light);
    background: var(--music-bg) center/cover no-repeat, transparent;
    padding: 16px 20px;
    margin: 20px auto;
    max-width: 450px;
    min-height: 200px; /* ensures a consistent display area for the image */
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    color: #777;
}

.playlist-icon {
    font-size: 2rem;
    --bg-cream: #fbf8f3;
    --bg-cream: #fbf8f3;
    color: var(--bg-cream);
    margin-bottom: 10px;
}

/* Section 3: Heartfelt Letter */
.letter-content {
    font-family: var(--font-serif);
    font-size: 1.1rem;
    line-height: 1.8;
    text-align: center;
    white-space: pre-line;
    padding: 20px;
    color: var(--text-dark);
    margin: 0 auto;
}

.letter-signature {
    font-family: var(--font-script);
    font-size: 2.5rem;
    text-align: right;
    margin: 30px 0 0;
    color: var(--burgundy-deep);
}

/* Responsive Design Tweaks */
@media (max-width: 600px) {
    h1 { font-size: 2rem; }
    .vintage-frame { padding: 20px; }
    .cake-container { width: 200px; height: 200px; }
    .calendar { padding: 10px; max-width: 100%; }
    .calendar-grid { gap: 6px; }
    .memory-section { padding: 25px 15px; }
    .letter-content { text-align: center; padding: 20px 10px; }
    .letter-signature { text-align: right; margin-right: 0; }
}

/* ====== Page 1: Calendar styles (vintage burgundy & cream) ====== */
:root {
    --burgundy: #6b0f0f;
    --cream: #f7efe6;
    --ink: #320d0d;
}

#page1 .page-title { color: var(--burgundy); }

.calendar {
    position: relative;
    z-index: 9999;
    overflow: visible;
    background: var(--ink);
    border: 1px solid rgba(107,15,15,0.12);
    border-radius: 8px;
    padding: 14px;
    max-width: 720px;
    width: 100%;
    margin: 0 auto;
    box-shadow: 0 6px 18px rgba(11,6,6,0.08);
}

.calendar-grid {
    position: relative;
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 8px;
    align-items: center;
}

.weekday {
    font-size: 0.8rem;
    color: var(--cream);
    text-align: center;
    font-weight: 600;
    padding: 6px 0;
}

.day {
    position: relative;
    min-height: 64px;
    padding: 8px;
    border-radius: 6px;
    background: var(--cream);
    color: var(--ink);
    display: flex;
    align-items: flex-start;
    justify-content: center;
    font-family: "Palatino Linotype","Book Antiqua", Palatino, serif;
    font-size: 1rem;
    box-shadow: inset 0 -2px 0 rgba(107,15,15,0.02);
    transition: transform 160ms ease, background 160ms ease;
}

.day.empty { background: transparent; box-shadow: none; min-height: 36px; }

.day:not(.empty):hover { transform: translateY(-3px); cursor: pointer; background: rgba(255,250,245,0.9); }

#june-26 {
    color: var(--burgundy);
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
}

.ring {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 88%;
    height: 88%;
    transform: translate(-50%, -50%);
    pointer-events: none;
}
.ring path { fill: none; stroke: var(--burgundy); stroke-width: 4; stroke-linecap: round; stroke-linejoin: round; stroke-dasharray: 260; stroke-dashoffset: 260; opacity: 0.95; filter: drop-shadow(0 2px 2px rgba(11,6,6,0.25)); }

.circled .ring path { animation: ink-draw 900ms cubic-bezier(.2,.9,.1,1) forwards; }

@keyframes ink-draw {
    0% { stroke-dashoffset: 240; opacity: 0; transform: scale(0.98); }
    60% { opacity: 1; }
    100% { stroke-dashoffset: 0; opacity: 1; transform: scale(1); }
}

/* Reuse existing blackout active class for transitions */
#blackout {
    position: fixed; inset: 0; background: #000; opacity: 0; pointer-events: none; transition: opacity 600ms ease; z-index: 9999;
}
#blackout.active { opacity: 1; pointer-events: auto; }

@media (max-width: 600px) {
    .day {
        min-height: 0;
        height: auto;
        padding: 10px 6px;
        font-size: 0.85rem;
    }
    .calendar {
        padding: 8px;
        max-width: 100%;
    }
    .calendar-grid {
        gap: 5px;
        grid-template-columns: repeat(7, minmax(0, 1fr));
    }
    .weekday {
        font-size: 0.75rem;
        padding: 4px 0;
    }
}

/* ====== Wrong click feedback ====== */
.day.wrong {
    background: linear-gradient(180deg, #ffefef, #ffd6d6);
    color: #7a0b0b;
    box-shadow: 0 0 0 3px rgba(255, 0, 0, 0.08) inset;
    transform: translateY(-2px) scale(1.02);
    transition: transform 160ms ease, background 160ms ease;
}

@keyframes wrong-flash {
    0% { transform: scale(1); }
    50% { transform: scale(1.04); }
    100% { transform: scale(1); }
}


