/* ============================================================
   🎂 PREMIUM 3D BIRTHDAY WEBSITE - MAIN STYLESHEET
   Deep romantic dark theme with glassmorphism & glow
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Playfair+Display:ital,wght@0,400;0,700;0,900;1,400;1,700&family=Cormorant+Garamond:ital,wght@0,300;0,400;0,600;1,300;1,600&family=Dancing+Script:wght@400;700&family=Inter:wght@300;400;500;600&display=swap');

/* ── CSS Variables ─────────────────────────────────────── */
:root {
    --primary: #ff1a6b;
    --primary-glow: rgba(255, 26, 107, 0.6);
    --secondary: #9b59b6;
    --secondary-glow: rgba(155, 89, 182, 0.5);
    --accent: #ffd700;
    --accent-glow: rgba(255, 215, 0, 0.4);
    --bg-dark: #020008;
    --bg-mid: #0d0018;
    --bg-section: #08000f;
    --glass: rgba(255, 255, 255, 0.04);
    --glass-border: rgba(255, 255, 255, 0.1);
    --glass-border-pink: rgba(255, 26, 107, 0.3);
    --text-primary: #fff5f8;
    --text-secondary: rgba(255, 245, 248, 0.75);
    --text-muted: rgba(255, 245, 248, 0.45);
    --font-display: 'Playfair Display', serif;
    --font-elegant: 'Cormorant Garamond', serif;
    --font-script: 'Dancing Script', cursive;
    --font-body: 'Inter', sans-serif;
    --transition: all 0.6s cubic-bezier(0.4, 0, 0.2, 1);
    --shadow-glow: 0 0 40px rgba(255, 26, 107, 0.3);
    --shadow-strong: 0 20px 60px rgba(0, 0, 0, 0.8);
}

/* ── Reset & Base ──────────────────────────────────────── */
*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
    overflow-x: hidden;
}

body {
    font-family: var(--font-body);
    background: var(--bg-dark);
    color: var(--text-primary);
    overflow-x: hidden;
    cursor: default;
    -webkit-font-smoothing: antialiased;
}

body.no-scroll {
    overflow: hidden;
}

/* ── Custom Scrollbar ──────────────────────────────────── */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: var(--bg-dark); }
::-webkit-scrollbar-thumb {
    background: linear-gradient(180deg, var(--primary), var(--secondary));
    border-radius: 3px;
}

/* ── Selection ─────────────────────────────────────────── */
::selection {
    background: rgba(255, 26, 107, 0.35);
    color: #fff;
}

/* ══════════════════════════════════════════════════════════
   LOADING SCREEN
══════════════════════════════════════════════════════════ */
#loading-screen {
    position: fixed;
    inset: 0;
    z-index: 10000;
    background: #000;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    transition: opacity 1s ease, visibility 1s ease;
}

#loading-screen.hidden {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}

.loading-heart-canvas {
    width: 160px;
    height: 160px;
    margin-bottom: 32px;
}

.loading-text {
    font-family: var(--font-elegant);
    font-size: clamp(1.1rem, 3vw, 1.4rem);
    color: var(--text-secondary);
    letter-spacing: 0.08em;
    margin-bottom: 28px;
    font-style: italic;
}

.loading-bar-container {
    width: min(300px, 80vw);
    height: 2px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 2px;
    overflow: hidden;
    margin-bottom: 12px;
}

.loading-bar {
    height: 100%;
    background: linear-gradient(90deg, var(--primary), var(--accent), var(--secondary));
    background-size: 200% 100%;
    width: 0%;
    border-radius: 2px;
    transition: width 0.3s ease;
    animation: loadingShimmer 2s linear infinite;
}

@keyframes loadingShimmer {
    0% { background-position: 0% 50%; }
    100% { background-position: 200% 50%; }
}

.loading-percent {
    font-family: var(--font-body);
    font-size: 0.85rem;
    color: var(--primary);
    letter-spacing: 0.15em;
    font-weight: 500;
}

/* ══════════════════════════════════════════════════════════
   NAVIGATION
══════════════════════════════════════════════════════════ */
#nav {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    padding: 16px 32px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: rgba(2, 0, 8, 0.6);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-bottom: 1px solid rgba(255, 26, 107, 0.12);
    transform: translateY(-100%);
    transition: transform 0.8s cubic-bezier(0.4, 0, 0.2, 1);
}

#nav.visible {
    transform: translateY(0);
}

.nav-logo {
    font-family: var(--font-script);
    font-size: 1.6rem;
    color: var(--primary);
    text-shadow: 0 0 20px var(--primary-glow);
    cursor: pointer;
}

.nav-links {
    display: flex;
    align-items: center;
    gap: 8px;
    list-style: none;
}

.nav-links a {
    display: block;
    padding: 8px 16px;
    font-family: var(--font-body);
    font-size: 0.8rem;
    font-weight: 500;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--text-secondary);
    text-decoration: none;
    border-radius: 50px;
    transition: var(--transition);
    position: relative;
}

.nav-links a:hover,
.nav-links a.active {
    color: #fff;
    background: rgba(255, 26, 107, 0.15);
    text-shadow: 0 0 12px var(--primary-glow);
}

/* Hamburger */
.hamburger {
    display: none;
    flex-direction: column;
    gap: 5px;
    cursor: pointer;
    padding: 4px;
    z-index: 1001;
}

.hamburger span {
    display: block;
    width: 26px;
    height: 2px;
    background: var(--text-primary);
    border-radius: 2px;
    transition: var(--transition);
}

.hamburger.open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.hamburger.open span:nth-child(2) { opacity: 0; transform: scaleX(0); }
.hamburger.open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

.mobile-menu {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 999;
    background: rgba(2, 0, 8, 0.97);
    backdrop-filter: blur(30px);
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 24px;
}

.mobile-menu.open {
    display: flex;
}

.mobile-menu a {
    font-family: var(--font-display);
    font-size: clamp(1.5rem, 6vw, 2.5rem);
    color: var(--text-secondary);
    text-decoration: none;
    letter-spacing: 0.1em;
    transition: var(--transition);
}

.mobile-menu a:hover {
    color: var(--primary);
    text-shadow: 0 0 20px var(--primary-glow);
}

/* ══════════════════════════════════════════════════════════
   MUSIC PLAYER
══════════════════════════════════════════════════════════ */
#music-player {
    position: fixed;
    bottom: 28px;
    right: 28px;
    z-index: 900;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 10px;
    opacity: 0;
    transform: translateY(20px);
    transition: var(--transition);
}

#music-player.visible {
    opacity: 1;
    transform: translateY(0);
}

.music-btn {
    width: 52px;
    height: 52px;
    border-radius: 50%;
    border: 1px solid var(--glass-border-pink);
    background: rgba(255, 26, 107, 0.15);
    backdrop-filter: blur(20px);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.4rem;
    color: #fff;
    transition: var(--transition);
    box-shadow: 0 0 20px rgba(255, 26, 107, 0.2);
}

.music-btn:hover {
    background: rgba(255, 26, 107, 0.3);
    box-shadow: 0 0 30px rgba(255, 26, 107, 0.5);
    transform: scale(1.1);
}

.music-btn.playing {
    animation: musicPulse 1.5s ease-in-out infinite;
}

@keyframes musicPulse {
    0%, 100% { box-shadow: 0 0 20px rgba(255, 26, 107, 0.3); }
    50% { box-shadow: 0 0 40px rgba(255, 26, 107, 0.7); }
}

.music-controls {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 8px;
    background: rgba(2, 0, 8, 0.85);
    backdrop-filter: blur(20px);
    border: 1px solid var(--glass-border-pink);
    border-radius: 16px;
    padding: 14px;
    opacity: 0;
    visibility: hidden;
    transform: translateY(10px);
    transition: var(--transition);
}

.music-controls.show {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.music-volume {
    -webkit-appearance: none;
    appearance: none;
    width: 100px;
    height: 3px;
    border-radius: 3px;
    background: linear-gradient(90deg, var(--primary) var(--vol, 70%), rgba(255,255,255,0.15) var(--vol, 70%));
    cursor: pointer;
    outline: none;
}

.music-volume::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background: var(--primary);
    box-shadow: 0 0 8px var(--primary-glow);
    cursor: pointer;
}

.music-label {
    font-size: 0.7rem;
    color: var(--text-muted);
    letter-spacing: 0.1em;
    text-transform: uppercase;
}

/* ══════════════════════════════════════════════════════════
   SECTION BASE
══════════════════════════════════════════════════════════ */
section {
    position: relative;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.section-inner {
    position: relative;
    z-index: 2;
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 80px 32px;
}

.section-label {
    font-family: var(--font-body);
    font-size: 0.7rem;
    font-weight: 600;
    letter-spacing: 0.25em;
    text-transform: uppercase;
    color: var(--primary);
    margin-bottom: 16px;
    opacity: 0.8;
}

.section-title {
    font-family: var(--font-display);
    font-size: clamp(2.2rem, 5vw, 4rem);
    font-weight: 700;
    line-height: 1.15;
    margin-bottom: 20px;
}

.section-title .accent {
    color: var(--primary);
    text-shadow: 0 0 30px var(--primary-glow);
}

.section-subtitle {
    font-family: var(--font-elegant);
    font-size: clamp(1rem, 2.5vw, 1.3rem);
    color: var(--text-secondary);
    line-height: 1.7;
    font-style: italic;
}

.divider {
    width: 80px;
    height: 2px;
    background: linear-gradient(90deg, transparent, var(--primary), transparent);
    margin: 24px auto;
}

/* ══════════════════════════════════════════════════════════
   SECTION 1: HERO / OPENING SCREEN
══════════════════════════════════════════════════════════ */
#opening {
    position: fixed;
    inset: 0;
    z-index: 500;
    background: var(--bg-dark);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    transition: opacity 1.2s ease, visibility 1.2s ease;
}

#opening.exit {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}

#opening-canvas {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
}

.opening-content {
    position: relative;
    z-index: 2;
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 16px;
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 1s ease, transform 1s ease;
}

.opening-content.visible {
    opacity: 1;
    transform: translateY(0);
}

.opening-pre {
    font-family: var(--font-elegant);
    font-size: clamp(0.9rem, 2.5vw, 1.15rem);
    letter-spacing: 0.2em;
    text-transform: uppercase;
    color: var(--text-muted);
}

.opening-title {
    font-family: var(--font-display);
    font-size: clamp(1.8rem, 6vw, 4.5rem);
    font-weight: 700;
    background: linear-gradient(135deg, #fff 30%, #ffb3cc 70%, #ffd700);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    line-height: 1.2;
    text-shadow: none;
    filter: drop-shadow(0 0 30px rgba(255, 26, 107, 0.5));
}

.opening-sub {
    font-family: var(--font-script);
    font-size: clamp(1.4rem, 4vw, 2.2rem);
    color: var(--primary);
    text-shadow: 0 0 20px var(--primary-glow);
}

.enter-btn {
    margin-top: 24px;
    padding: 18px 52px;
    font-family: var(--font-body);
    font-size: 0.85rem;
    font-weight: 600;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    color: #fff;
    background: linear-gradient(135deg, rgba(255, 26, 107, 0.2), rgba(155, 89, 182, 0.2));
    border: 1px solid rgba(255, 26, 107, 0.5);
    border-radius: 60px;
    cursor: pointer;
    position: relative;
    overflow: hidden;
    transition: var(--transition);
    box-shadow: 0 0 30px rgba(255, 26, 107, 0.2), inset 0 0 20px rgba(255, 26, 107, 0.05);
}

.enter-btn::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    opacity: 0;
    transition: opacity 0.4s ease;
    border-radius: inherit;
}

.enter-btn:hover {
    border-color: var(--primary);
    box-shadow: 0 0 60px rgba(255, 26, 107, 0.6), 0 0 120px rgba(255, 26, 107, 0.2);
    transform: translateY(-2px) scale(1.02);
}

.enter-btn:hover::before {
    opacity: 0.25;
}

.enter-btn span {
    position: relative;
    z-index: 1;
}

.btn-ripple {
    position: absolute;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.3);
    animation: ripple 0.8s ease-out forwards;
    pointer-events: none;
}

@keyframes ripple {
    from { width: 0; height: 0; opacity: 1; transform: translate(-50%, -50%); }
    to { width: 300px; height: 300px; opacity: 0; transform: translate(-50%, -50%); }
}

/* ══════════════════════════════════════════════════════════
   SECTION 2: HERO BIRTHDAY SCENE
══════════════════════════════════════════════════════════ */
#hero {
    background: var(--bg-dark);
    min-height: 100vh;
}

#hero-canvas {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
}

.hero-content {
    position: relative;
    z-index: 2;
    text-align: center;
    padding: 120px 32px 80px;
    width: 100%;
}

.hero-eyebrow {
    font-family: var(--font-elegant);
    font-size: clamp(0.85rem, 2vw, 1rem);
    letter-spacing: 0.3em;
    text-transform: uppercase;
    color: var(--text-muted);
    margin-bottom: 16px;
}

.hero-title {
    font-family: var(--font-display);
    font-size: clamp(2.4rem, 8vw, 8rem);
    font-weight: 900;
    line-height: 1.1;
    background: linear-gradient(135deg, #fff 0%, #ffb3cc 40%, #ffd700 70%, #ff1a6b 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    filter: drop-shadow(0 0 40px rgba(255, 26, 107, 0.4));
    margin-bottom: 16px;
}

.hero-name {
    font-family: var(--font-script);
    font-size: clamp(2rem, 6vw, 5rem);
    color: var(--primary);
    text-shadow: 0 0 40px var(--primary-glow), 0 0 80px rgba(255, 26, 107, 0.3);
    display: block;
    margin-bottom: 40px;
}

.hero-3d-container {
    width: 100%;
    height: 420px;
    position: relative;
}

#hero-3d-canvas {
    width: 100%;
    height: 100%;
}

/* ══════════════════════════════════════════════════════════
   SECTION 3: COUNTDOWN
══════════════════════════════════════════════════════════ */
#countdown {
    background: linear-gradient(180deg, var(--bg-dark) 0%, var(--bg-mid) 50%, var(--bg-dark) 100%);
}

.countdown-card {
    background: var(--glass);
    backdrop-filter: blur(30px);
    border: 1px solid var(--glass-border-pink);
    border-radius: 32px;
    padding: clamp(32px, 6vw, 64px);
    text-align: center;
    box-shadow: var(--shadow-glow), var(--shadow-strong);
    position: relative;
    overflow: hidden;
}

.countdown-card::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(ellipse at center, rgba(255, 26, 107, 0.06) 0%, transparent 60%);
    pointer-events: none;
}

.countdown-heading {
    font-family: var(--font-display);
    font-size: clamp(1.5rem, 4vw, 2.8rem);
    font-weight: 700;
    margin-bottom: 8px;
}

.countdown-heading .heart {
    color: var(--primary);
    text-shadow: 0 0 20px var(--primary-glow);
    display: inline-block;
    animation: heartbeat 1.2s ease-in-out infinite;
}

@keyframes heartbeat {
    0%, 100% { transform: scale(1); }
    20% { transform: scale(1.25); }
    40% { transform: scale(1); }
    60% { transform: scale(1.15); }
}

.countdown-birthday-date {
    font-family: var(--font-elegant);
    font-size: clamp(1rem, 2.5vw, 1.3rem);
    color: var(--text-secondary);
    font-style: italic;
    margin-bottom: 40px;
}

.countdown-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
    margin-bottom: 40px;
}

.countdown-unit {
    background: rgba(255, 26, 107, 0.08);
    border: 1px solid rgba(255, 26, 107, 0.2);
    border-radius: 20px;
    padding: 20px 12px;
    position: relative;
    overflow: hidden;
    transition: var(--transition);
}

.countdown-unit:hover {
    border-color: rgba(255, 26, 107, 0.5);
    background: rgba(255, 26, 107, 0.12);
    transform: translateY(-4px);
    box-shadow: 0 12px 40px rgba(255, 26, 107, 0.2);
}

.countdown-number {
    font-family: var(--font-display);
    font-size: clamp(2rem, 5vw, 3.5rem);
    font-weight: 900;
    color: #fff;
    line-height: 1;
    display: block;
    text-shadow: 0 0 20px rgba(255, 26, 107, 0.5);
}

.countdown-label-text {
    font-family: var(--font-body);
    font-size: 0.68rem;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: var(--primary);
    margin-top: 6px;
    display: block;
}

.relationship-badge {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 14px 28px;
    background: linear-gradient(135deg, rgba(255, 215, 0, 0.1), rgba(255, 26, 107, 0.1));
    border: 1px solid rgba(255, 215, 0, 0.25);
    border-radius: 60px;
    font-family: var(--font-elegant);
    font-size: clamp(1rem, 2.5vw, 1.2rem);
    color: var(--accent);
    font-style: italic;
    box-shadow: 0 0 30px rgba(255, 215, 0, 0.15);
}

/* ══════════════════════════════════════════════════════════
   SECTION 4: MEMORIES / TIMELINE
══════════════════════════════════════════════════════════ */
#memories {
    background: var(--bg-section);
    padding: 80px 0;
}

.memories-header {
    text-align: center;
    margin-bottom: 80px;
}

.timeline {
    position: relative;
    max-width: 900px;
    margin: 0 auto;
}

.timeline::before {
    content: '';
    position: absolute;
    left: 50%;
    top: 0;
    bottom: 0;
    width: 1px;
    background: linear-gradient(180deg, transparent, var(--primary), var(--secondary), transparent);
    transform: translateX(-50%);
}

.timeline-item {
    display: flex;
    gap: 40px;
    margin-bottom: 60px;
    align-items: flex-start;
    position: relative;
    opacity: 0;
    transform: translateY(40px);
}

.timeline-item:nth-child(even) {
    flex-direction: row-reverse;
}

.timeline-item:nth-child(even) .timeline-card {
    text-align: right;
}

.timeline-dot {
    position: absolute;
    left: 50%;
    top: 24px;
    transform: translateX(-50%);
    width: 16px;
    height: 16px;
    background: var(--primary);
    border-radius: 50%;
    border: 3px solid var(--bg-section);
    box-shadow: 0 0 15px var(--primary-glow), 0 0 30px rgba(255, 26, 107, 0.3);
    z-index: 2;
    flex-shrink: 0;
}

.timeline-card {
    flex: 1;
    background: var(--glass);
    backdrop-filter: blur(20px);
    border: 1px solid var(--glass-border);
    border-radius: 24px;
    padding: 28px;
    transition: var(--transition);
    max-width: calc(50% - 40px);
}

.timeline-card:hover {
    border-color: var(--glass-border-pink);
    box-shadow: var(--shadow-glow);
    transform: translateY(-4px);
}

.timeline-photo {
    width: 100%;
    height: 160px;
    object-fit: cover;
    border-radius: 16px;
    margin-bottom: 16px;
    background: linear-gradient(135deg, rgba(255, 26, 107, 0.1), rgba(155, 89, 182, 0.1));
}

.timeline-date {
    font-family: var(--font-body);
    font-size: 0.7rem;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    color: var(--primary);
    margin-bottom: 6px;
}

.timeline-title {
    font-family: var(--font-display);
    font-size: clamp(1.1rem, 2.5vw, 1.5rem);
    font-weight: 700;
    margin-bottom: 10px;
    color: var(--text-primary);
}

.timeline-desc {
    font-family: var(--font-elegant);
    font-size: clamp(0.9rem, 1.8vw, 1.05rem);
    color: var(--text-secondary);
    line-height: 1.7;
    font-style: italic;
}

/* ══════════════════════════════════════════════════════════
   SECTION 5: PHOTO GALLERY
══════════════════════════════════════════════════════════ */
#gallery {
    background: linear-gradient(180deg, var(--bg-dark) 0%, var(--bg-mid) 100%);
}

.gallery-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 24px;
    margin-top: 60px;
}

.gallery-card {
    position: relative;
    border-radius: 20px;
    overflow: hidden;
    cursor: pointer;
    background: rgba(255, 26, 107, 0.05);
    border: 1px solid var(--glass-border);
    transition: var(--transition);
    aspect-ratio: 4/5;
    transform-style: preserve-3d;
}

.gallery-card:hover {
    border-color: var(--glass-border-pink);
    box-shadow: 0 20px 60px rgba(255, 26, 107, 0.25);
    transform: translateY(-8px) perspective(800px) rotateX(3deg);
}

.gallery-card img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.6s ease;
}

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

.gallery-card-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg, transparent 40%, rgba(2, 0, 8, 0.9));
    opacity: 0;
    transition: opacity 0.4s ease;
    display: flex;
    align-items: flex-end;
    padding: 20px;
}

.gallery-card:hover .gallery-card-overlay {
    opacity: 1;
}

.gallery-card-caption {
    font-family: var(--font-elegant);
    font-size: 1rem;
    color: var(--text-primary);
    font-style: italic;
}

/* Lightbox */
#lightbox {
    position: fixed;
    inset: 0;
    z-index: 2000;
    background: rgba(0, 0, 0, 0.95);
    backdrop-filter: blur(10px);
    display: none;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.4s ease;
}

#lightbox.open {
    display: flex;
    opacity: 1;
}

.lightbox-inner {
    position: relative;
    max-width: 90vw;
    max-height: 90vh;
    display: flex;
    align-items: center;
    justify-content: center;
}

#lightbox-img {
    max-width: 80vw;
    max-height: 80vh;
    object-fit: contain;
    border-radius: 16px;
    box-shadow: 0 0 60px rgba(255, 26, 107, 0.3);
    border: 1px solid rgba(255, 26, 107, 0.2);
}

.lightbox-close {
    position: absolute;
    top: -50px;
    right: 0;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: rgba(255, 26, 107, 0.2);
    border: 1px solid rgba(255, 26, 107, 0.4);
    color: #fff;
    font-size: 1.2rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition);
}

.lightbox-close:hover {
    background: var(--primary);
    box-shadow: 0 0 20px var(--primary-glow);
}

.lightbox-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: rgba(255, 26, 107, 0.2);
    border: 1px solid rgba(255, 26, 107, 0.4);
    color: #fff;
    font-size: 1.1rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition);
}

.lightbox-nav:hover {
    background: var(--primary);
    box-shadow: 0 0 20px var(--primary-glow);
}

.lightbox-prev { left: -70px; }
.lightbox-next { right: -70px; }

#lightbox-caption {
    position: absolute;
    bottom: -48px;
    left: 0;
    right: 0;
    text-align: center;
    font-family: var(--font-elegant);
    font-size: 1rem;
    color: var(--text-secondary);
    font-style: italic;
}

/* ══════════════════════════════════════════════════════════
   SECTION 6: LOVE LETTER
══════════════════════════════════════════════════════════ */
#letter-section {
    background: var(--bg-section);
}

.letter-wrapper {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 48px;
    text-align: center;
}

/* Envelope */
.envelope-container {
    position: relative;
    width: 280px;
    height: 200px;
    perspective: 600px;
    cursor: pointer;
}

.envelope {
    position: relative;
    width: 100%;
    height: 100%;
    transform-style: preserve-3d;
}

.envelope-body {
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, #1a0520, #2d0535);
    border: 1px solid rgba(255, 26, 107, 0.4);
    border-radius: 8px 8px 24px 24px;
    box-shadow: 0 20px 60px rgba(255, 26, 107, 0.2);
}

.envelope-flap {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 100px;
    background: linear-gradient(135deg, #2d0535, #1a0520);
    clip-path: polygon(0 0, 50% 70%, 100% 0);
    border: 1px solid rgba(255, 26, 107, 0.3);
    transform-origin: top center;
    transition: transform 0.8s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 2;
}

.envelope-flap.open {
    transform: perspective(600px) rotateX(-160deg);
}

.envelope-heart {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 2rem;
    z-index: 3;
    transition: opacity 0.3s ease;
}

.envelope.opened .envelope-heart {
    opacity: 0;
}

/* Letter */
#letter-modal {
    position: fixed;
    inset: 0;
    z-index: 3000;
    background: rgba(0, 0, 0, 0.92);
    backdrop-filter: blur(20px);
    display: none;
    align-items: center;
    justify-content: center;
    padding: 20px;
    opacity: 0;
    transition: opacity 0.5s ease;
}

#letter-modal.open {
    display: flex;
    opacity: 1;
}

.letter-paper {
    max-width: 600px;
    width: 100%;
    max-height: 85vh;
    overflow-y: auto;
    background: linear-gradient(180deg, #fff9f0, #fffaf5);
    border-radius: 4px;
    padding: clamp(32px, 6vw, 56px);
    position: relative;
    box-shadow: 0 40px 100px rgba(0, 0, 0, 0.8), 0 0 60px rgba(255, 26, 107, 0.15);
    transform: translateY(60px) scale(0.9);
    transition: transform 0.6s cubic-bezier(0.4, 0, 0.2, 1);
    color: #3a1020;
}

#letter-modal.open .letter-paper {
    transform: translateY(0) scale(1);
}

.letter-paper::before {
    content: '';
    position: absolute;
    left: 72px;
    top: 0;
    bottom: 0;
    width: 1px;
    background: rgba(255, 26, 107, 0.2);
}

.letter-paper::after {
    content: '';
    position: absolute;
    left: 80px;
    top: 0;
    bottom: 0;
    width: 1px;
    background: rgba(255, 26, 107, 0.1);
}

.letter-greeting {
    font-family: var(--font-script);
    font-size: 1.8rem;
    color: var(--primary);
    margin-bottom: 24px;
}

.letter-body {
    font-family: 'Cormorant Garamond', serif;
    font-size: clamp(1rem, 2vw, 1.2rem);
    line-height: 2;
    color: #3a1020;
    white-space: pre-line;
}

.letter-signature {
    font-family: var(--font-script);
    font-size: 1.6rem;
    color: var(--primary);
    margin-top: 28px;
    text-align: right;
}

.letter-close {
    position: absolute;
    top: 16px;
    right: 20px;
    background: none;
    border: none;
    font-size: 1.5rem;
    color: rgba(58, 16, 32, 0.4);
    cursor: pointer;
    transition: color 0.3s;
    line-height: 1;
}

.letter-close:hover {
    color: var(--primary);
}

.letter-particles-canvas {
    position: absolute;
    inset: 0;
    pointer-events: none;
    z-index: -1;
}

/* ══════════════════════════════════════════════════════════
   SECTION 7: GIFT BOX
══════════════════════════════════════════════════════════ */
#gift-section {
    background: linear-gradient(180deg, var(--bg-dark) 0%, var(--bg-mid) 100%);
}

.gift-content {
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 40px;
}

.gift-title {
    font-family: var(--font-display);
    font-size: clamp(1.8rem, 4vw, 3.2rem);
    font-weight: 700;
}

#gift-canvas-container {
    width: 100%;
    max-width: 500px;
    height: 400px;
    position: relative;
}

#gift-canvas {
    width: 100%;
    height: 100%;
}

.gift-reveal {
    font-family: var(--font-script);
    font-size: clamp(1.8rem, 4vw, 3.2rem);
    color: var(--primary);
    text-shadow: 0 0 30px var(--primary-glow);
    opacity: 0;
    transform: scale(0.7);
    transition: opacity 0.8s ease, transform 0.8s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.gift-reveal.visible {
    opacity: 1;
    transform: scale(1);
}

/* ══════════════════════════════════════════════════════════
   SECTION 8: BEATING HEART
══════════════════════════════════════════════════════════ */
#heart-section {
    background: var(--bg-section);
}

.heart-content {
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 40px;
}

#heart-canvas-container {
    width: 380px;
    height: 380px;
    position: relative;
}

#heart-canvas-3d {
    width: 100%;
    height: 100%;
}

.heart-text-center {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    pointer-events: none;
}

.heart-i-love-you {
    font-family: var(--font-display);
    font-size: clamp(1.4rem, 4vw, 2.2rem);
    font-weight: 900;
    color: #fff;
    text-shadow: 0 0 20px rgba(255, 255, 255, 0.5);
    letter-spacing: 0.1em;
}

.heart-forever {
    font-family: var(--font-elegant);
    font-size: clamp(1rem, 2.5vw, 1.5rem);
    color: var(--primary);
    font-style: italic;
    text-shadow: 0 0 15px var(--primary-glow);
}

/* ══════════════════════════════════════════════════════════
   SECTION 9: FINAL SECTION
══════════════════════════════════════════════════════════ */
#final-section {
    background: var(--bg-dark);
    position: relative;
    min-height: 100vh;
}

#final-canvas {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
}

.final-content {
    position: relative;
    z-index: 2;
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    gap: 24px;
    padding: 80px 32px;
}

.final-happy-birthday {
    font-family: var(--font-display);
    font-size: clamp(2.5rem, 8vw, 7rem);
    font-weight: 900;
    background: linear-gradient(135deg, #ffd700, #ff1a6b, #9b59b6);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    filter: drop-shadow(0 0 30px rgba(255, 26, 107, 0.5));
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.8s ease, transform 0.8s ease;
}

.final-happy-birthday.visible {
    opacity: 1;
    transform: translateY(0);
}

.final-name {
    font-family: var(--font-script);
    font-size: clamp(2.5rem, 7vw, 6rem);
    color: var(--primary);
    text-shadow: 0 0 40px var(--primary-glow);
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.8s ease 0.3s, transform 0.8s ease 0.3s;
}

.final-name.visible {
    opacity: 1;
    transform: translateY(0);
}

.final-poem {
    font-family: var(--font-elegant);
    font-size: clamp(1.1rem, 3vw, 1.8rem);
    color: var(--text-secondary);
    font-style: italic;
    max-width: 600px;
    opacity: 0;
    transition: opacity 0.8s ease 0.6s;
}

.final-poem.visible {
    opacity: 1;
}

.final-love {
    font-family: var(--font-display);
    font-size: clamp(2rem, 6vw, 5rem);
    font-weight: 900;
    color: #fff;
    text-shadow: 0 0 40px rgba(255, 255, 255, 0.3);
    opacity: 0;
    transition: opacity 0.8s ease 0.9s;
}

.final-love.visible {
    opacity: 1;
}

/* ══════════════════════════════════════════════════════════
   BUTTONS (SHARED)
══════════════════════════════════════════════════════════ */
.btn-primary {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 16px 44px;
    font-family: var(--font-body);
    font-size: 0.85rem;
    font-weight: 600;
    letter-spacing: 0.15em;
    text-transform: uppercase;
    color: #fff;
    background: linear-gradient(135deg, rgba(255, 26, 107, 0.2), rgba(155, 89, 182, 0.2));
    border: 1px solid rgba(255, 26, 107, 0.5);
    border-radius: 60px;
    cursor: pointer;
    transition: var(--transition);
    position: relative;
    overflow: hidden;
    box-shadow: 0 0 20px rgba(255, 26, 107, 0.15);
    text-decoration: none;
}

.btn-primary:hover {
    background: linear-gradient(135deg, rgba(255, 26, 107, 0.4), rgba(155, 89, 182, 0.4));
    border-color: var(--primary);
    box-shadow: 0 0 40px rgba(255, 26, 107, 0.5);
    transform: translateY(-2px);
}

.btn-gold {
    background: linear-gradient(135deg, rgba(255, 215, 0, 0.15), rgba(255, 140, 0, 0.15));
    border-color: rgba(255, 215, 0, 0.4);
    color: var(--accent);
}

.btn-gold:hover {
    background: linear-gradient(135deg, rgba(255, 215, 0, 0.3), rgba(255, 140, 0, 0.3));
    border-color: var(--accent);
    box-shadow: 0 0 40px rgba(255, 215, 0, 0.4);
    color: #fff;
}

/* ══════════════════════════════════════════════════════════
   CANVAS OVERLAY PARTICLES
══════════════════════════════════════════════════════════ */
#global-particles {
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 1;
    opacity: 0;
    transition: opacity 1s ease;
}

#global-particles.visible {
    opacity: 1;
}

/* ══════════════════════════════════════════════════════════
   CONFETTI
══════════════════════════════════════════════════════════ */
#confetti-canvas {
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 5000;
}

/* ══════════════════════════════════════════════════════════
   UTILITY
══════════════════════════════════════════════════════════ */
.text-center { text-align: center; }
.text-pink { color: var(--primary); text-shadow: 0 0 15px var(--primary-glow); }
.text-gold { color: var(--accent); text-shadow: 0 0 15px var(--accent-glow); }

.fade-in {
    opacity: 0;
    transform: translateY(30px);
}

.scale-in {
    opacity: 0;
    transform: scale(0.85);
}

/* ══════════════════════════════════════════════════════════
   RESPONSIVE
══════════════════════════════════════════════════════════ */
@media (max-width: 1024px) {
    .gallery-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .timeline::before { display: none; }

    .timeline-item,
    .timeline-item:nth-child(even) {
        flex-direction: column;
        align-items: flex-start;
    }

    .timeline-item:nth-child(even) .timeline-card {
        text-align: left;
    }

    .timeline-card {
        max-width: 100%;
    }

    .timeline-dot {
        display: none;
    }

    .lightbox-prev { left: -50px; }
    .lightbox-next { right: -50px; }
}

@media (max-width: 768px) {
    .nav-links { display: none; }
    .hamburger { display: flex; }

    #nav { padding: 14px 20px; }

    .gallery-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 14px;
    }

    .countdown-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    #heart-canvas-container {
        width: 280px;
        height: 280px;
    }

    .lightbox-prev { left: 10px; top: auto; bottom: -60px; transform: none; }
    .lightbox-next { right: 10px; top: auto; bottom: -60px; transform: none; }
    .lightbox-close { top: -50px; right: 0; }

    .section-inner {
        padding: 60px 20px;
    }

    .timeline-item {
        margin-bottom: 32px;
    }

    #music-player {
        bottom: 16px;
        right: 16px;
    }
}

@media (max-width: 480px) {
    .gallery-grid {
        grid-template-columns: 1fr;
        gap: 16px;
    }

    .gallery-card {
        aspect-ratio: 16/10;
    }

    .countdown-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
    }

    .enter-btn {
        padding: 16px 36px;
        font-size: 0.8rem;
    }

    .hero-3d-container {
        height: 280px;
    }

    #gift-canvas-container {
        height: 280px;
    }

    .envelope-container {
        width: 220px;
        height: 160px;
    }
}

/* ── Scroll reveal animation states ────────────────────── */
.reveal-up {
    opacity: 0;
    transform: translateY(50px);
    transition: opacity 0.8s ease, transform 0.8s cubic-bezier(0.4, 0, 0.2, 1);
}

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

.reveal-scale {
    opacity: 0;
    transform: scale(0.85);
    transition: opacity 0.8s ease, transform 0.8s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.reveal-scale.revealed {
    opacity: 1;
    transform: scale(1);
}

/* ── Particle canvas for global floating hearts ─────────── */
#global-hearts-canvas {
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 1;
    opacity: 0;
    transition: opacity 2s ease;
}

#global-hearts-canvas.visible {
    opacity: 1;
}

/* WebGL Fallback */
#webgl-fallback {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 9999;
    background: var(--bg-dark);
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 40px;
    gap: 24px;
}

#webgl-fallback.show {
    display: flex;
}

#webgl-fallback .fallback-heart {
    font-size: 6rem;
    animation: heartbeat 1.2s ease-in-out infinite;
}

#webgl-fallback .fallback-title {
    font-family: var(--font-display);
    font-size: clamp(2rem, 5vw, 4rem);
    font-weight: 900;
    color: var(--primary);
    text-shadow: 0 0 30px var(--primary-glow);
}

#webgl-fallback .fallback-text {
    font-family: var(--font-elegant);
    font-size: 1.2rem;
    color: var(--text-secondary);
    font-style: italic;
    max-width: 500px;
}
