/* --- Root Variables & Reset --- */
:root {
    --bg-dark: #080405;
    --panel-bg: rgba(13, 10, 11, 0.75);
    --accent: #e09a8a;
    --accent-glow: rgba(224, 154, 138, 0.4);
    --rose-gold: linear-gradient(135deg, #e7a0a0 0%, #b76e79 100%);
    --glass-border: rgba(255, 255, 255, 0.12);
    --text-main: #f8f1f1;
    --text-dim: rgba(248, 241, 241, 0.6);
}

* {
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
}

body {
    margin: 0;
    padding: 0;
    background-color: var(--bg-dark);
    font-family: 'Inter', sans-serif;
    color: var(--text-main);
    min-height: 100vh;
    overflow-x: hidden;
    background-image: url('background.jpg');
    background-size: cover;
    background-position: center 20%;
    background-repeat: no-repeat;
    background-attachment: fixed;
}

body::after {
    content: '';
    position: fixed;
    inset: 0;
    background: radial-gradient(circle at center, transparent 20%, rgba(0,0,0,0.5) 100%);
    pointer-events: none;
    z-index: 1;
}

/* --- Dashboard Panel Layout --- */
.dashboard-panel {
    position: fixed;
    top: 0;
    left: 0;
    width: 420px;
    height: 100vh;
    background: var(--panel-bg);
    backdrop-filter: blur(45px) saturate(160%);
    -webkit-backdrop-filter: blur(45px) saturate(160%);
    border-right: 1px solid var(--glass-border);
    z-index: 10;
    display: flex;
    flex-direction: column;
    transition: all 0.5s ease;
}

.panel-inner {
    padding: 3rem 2rem;
    height: 100%;
    display: flex;
    flex-direction: column;
    overflow-y: auto;
    scrollbar-width: none;
}

.panel-inner::-webkit-scrollbar { display: none; }

/* --- Pink Gradient Timeline --- */
.timeline-container {
    margin: 2.5rem 0;
    position: relative;
    padding-left: 20px;
}

/* --- Synced Pink Gradient Timeline --- */
.timeline-container::before {
    content: '';
    position: absolute;
    left: 0;
    top: 10px;
    width: 3px;
    height: 0;
    background: linear-gradient(
        to bottom,
        #FFD1DC, #FFB6C1, #FF69B4, #C71585, #A52A2A, #880808, #550000
    );
    border-radius: 10px;
    box-shadow: 0 0 10px rgba(255, 105, 180, 0.2);
    
    /* We use individual properties to ensure no overrides */
    transition-property: height;
    transition-duration: 4.5s; 
    transition-timing-function: cubic-bezier(0.22, 1, 0.36, 1);
    transition-delay: 0.1s;
}

.timeline-container.reveal::before {
    /* Ensures the line covers the full length of the container including the 7th card */
    height: calc(100% - 20px);
}   

.milestone-wrapper {
    position: relative;
    margin-bottom: 2rem;
    opacity: 0;
    transform: translateY(30px);
    transition: all 0.8s cubic-bezier(0.22, 1, 0.36, 1);
    will-change: transform, opacity;
}

/* The timeline dots */
.milestone-wrapper::before {
    content: '';
    position: absolute;
    left: -25px;
    top: 22px;
    width: 12px;
    height: 12px;
    background: var(--bg-dark);
    border: 2px solid var(--accent);
    border-radius: 50%;
    z-index: 2;
    
    /* Reset transition to be instant so it inherits the reveal delay */
    transition: transform 0.4s ease; 
}

.milestone-wrapper.reveal {
    opacity: 1;
    transform: translateY(0);
}

.milestone-wrapper.reveal::before {
    transform: scale(1.2);
}

.milestone-wrapper.reveal:nth-child(1) { transition-delay: 0.1s; }
.milestone-wrapper.reveal:nth-child(2) { transition-delay: 0.7s; }
.milestone-wrapper.reveal:nth-child(3) { transition-delay: 1.3s; }
.milestone-wrapper.reveal:nth-child(4) { transition-delay: 1.9s; }
.milestone-wrapper.reveal:nth-child(5) { transition-delay: 2.5s; }
.milestone-wrapper.reveal:nth-child(6) { transition-delay: 3.1s; }
.milestone-wrapper.reveal:nth-child(7) { transition-delay: 3.7s; }

/* Individual Pink Dot Spectrum Colors */
.milestone-wrapper:nth-child(1)::before { border-color: #FFD1DC; box-shadow: 0 0 8px #FFD1DC; }
.milestone-wrapper:nth-child(2)::before { border-color: #FFB6C1; box-shadow: 0 0 8px #FFB6C1; }
.milestone-wrapper:nth-child(3)::before { border-color: #FF69B4; box-shadow: 0 0 8px #FF69B4; }
.milestone-wrapper:nth-child(4)::before { border-color: #C71585; box-shadow: 0 0 8px #C71585; }
.milestone-wrapper:nth-child(5)::before { border-color: #A52A2A; box-shadow: 0 0 8px #A52A2A; }
.milestone-wrapper:nth-child(6)::before { border-color: #880808; box-shadow: 0 0 8px #880808; }
.milestone-wrapper:nth-child(7)::before { border-color: #550000; box-shadow: 0 0 8px #550000; }

.milestone-card {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--glass-border);
    border-radius: 18px;
    padding: 1.2rem;
    border-left: 3px solid rgba(255, 182, 193, 0.3);
    transition: all 0.4s ease;
}

.milestone-card:hover {
    background: rgba(255, 255, 255, 0.06);
    transform: translateX(5px);
    border-color: var(--accent);
}

.highlight-milestone .milestone-card {
    border-left: 3px solid #C71585;
    background: rgba(199, 21, 133, 0.1);
}

/* --- Typography --- */
.brand-tag { font-size: 0.7rem; text-transform: uppercase; letter-spacing: 4px; color: var(--accent); margin-bottom: 0.5rem; font-weight: 600; }

h1 {
    font-family: 'Dancing Script', cursive;
    font-size: 3rem;
    margin: 0;
    background: var(--rose-gold);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

h3 {   
    margin: 0;
    background: var(--rose-gold);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.anniversary-date {
    display: flex;
    align-items: center; 
    gap: 8px;
    font-size: 0.9rem;
    color: var(--text-dim);
    margin-top: 0.5rem;
}

.infinity-sign {
    font-family: Arial, sans-serif;
    font-size: 1.8rem; 
    font-weight: bold;
    display: inline-block;
    background: var(--rose-gold);
    -webkit-background-clip: text;
    transform: translateY(2px) scale(1.2); 
    filter: drop-shadow(0 0 1px rgba(183, 110, 121, 0.8)); 
    line-height: 0; 
    padding: 0 5px;
}

.milestone-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 0.6rem; }
.badge { font-size: 0.65rem; font-weight: 800; padding: 4px 10px; background: rgba(255, 255, 255, 0.08); border-radius: 50px; color: var(--accent); }
.accent-badge { background: var(--rose-gold); color: white; }
.milestone-status { font-size: 0.6rem; opacity: 0.5; text-transform: uppercase; }
.milestone-card h3 { font-family: 'Dancing Script', cursive; font-size: 1.5rem; margin: 0 0 0.6rem 0; font-weight: 700; }

/* --- Counter Styling --- */
.counter-display { font-family: 'Inter', sans-serif; font-size: 0.9rem; color: var(--text-dim); display: flex; gap: 6px; }
.unit-val { color: var(--text-main); font-weight: 700; }
.sec-box { color: white; font-weight: 800; text-shadow: 0 0 10px var(--accent); min-width: 30px; }

/* --- Scratch Area --- */
.surprise-reveal-area { margin-top: 1rem; opacity: 0; transform: translateY(30px); transition: all 0.8s ease 4s; }
.surprise-reveal-area.reveal { opacity: 1; transform: translateY(0); }

.section-title { display: flex; align-items: center; gap: 10px; margin-bottom: 0.8rem; }
.section-title h4 { margin: 0; color: var(--accent); text-transform: uppercase; letter-spacing: 2px; font-size: 0.8rem; }
.reveal-hint { font-size: 0.8rem; opacity: 0.7; margin-bottom: 1.2rem; }
.scratch-card-container { position: relative; width: 100%; height: 160px; border-radius: 20px; overflow: hidden; background: #110c0d; border: 1px solid var(--glass-border); }
.reveal-content { position: absolute; inset: 0; display: flex; justify-content: center; align-items: center; text-align: center; }
.reveal-inner h5 { font-family: 'Dancing Script', cursive; font-size: 1.6rem; margin: 0; color: var(--accent); }
.reveal-inner p { font-size: 0.75rem; margin-top: 5px; opacity: 0.8; }
.reveal-emoji { font-size: 2.2rem; display: block; margin-bottom: 5px; animation: giftBounce 2s infinite ease-in-out; }

@keyframes giftBounce { 0%, 100% { transform: translateY(0) scale(1); } 50% { transform: translateY(-10px) scale(1.1); } }

#scratchCanvas { position: absolute; top: 0; left: 0; cursor: crosshair; touch-action: none; z-index: 2; }

/* --- Footer --- */
footer { margin-top: auto; padding-top: 2rem; }
#musicToggle { width: 100%; padding: 0.8rem; background: transparent; border: 1px solid var(--accent); color: var(--accent); border-radius: 50px; cursor: pointer; font-weight: 600; display: flex; justify-content: center; align-items: center; gap: 10px; transition: 0.3s; }
#musicToggle:hover { background: var(--accent); color: white; }
.footer-bottom { margin-top: 1.5rem; text-align: center; }
.legal-copy { font-size: 0.65rem; opacity: 0.4; margin: 0; }
.heart-icon { font-size: 0.8rem; margin: 8px 0; }

@keyframes heartPulse { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.03); } }
.heartbeat { animation: heartPulse 2s infinite ease-in-out; }

@media (max-width: 768px) {
    body {
        /* Fixes the background image to the top half of the viewport */
        background-attachment: fixed;
        background-position: center top;
        background-size: 100% 50vh; /* Scales image to top 50% of screen */
        background-repeat: no-repeat;
        overflow-x: hidden;
    }

    /* Create a 'spacer' before the panel to show the image */
    body::before {
        content: '';
        display: block;
        height: 50vh; /* This matches the image height */
        width: 100%;
        pointer-events: none;
    }

    .dashboard-panel {
        position: relative; 
        width: 100%;
        height: auto;
        min-height: 50vh;
        margin-top: 0; /* Removed margin-top since body::before handles spacing */
        border-right: none;
        border-top: 1px solid var(--glass-border);
        border-radius: 30px 30px 0 0;
        box-shadow: 0 -20px 40px rgba(0,0,0,0.8);
        background: var(--panel-bg);
        backdrop-filter: blur(20px);
    }

    .panel-inner {
        padding: 2rem 1.2rem;
        overflow-y: visible; /* Let the body handle the scroll */
    }

    h1 {
        font-size: 2.2rem;
    }

    .timeline-container {
        padding-left: 15px;
    }

    .milestone-card {
        padding: 1rem;
    }
    
    .counter-display {
        flex-wrap: wrap; 
        font-size: 0.8rem;
    }
}