/* Clean Reset */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    background-color: #0b090f;
    overflow-x: hidden;
    font-family: 'Outfit', 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    color: #fff;
    min-height: 100vh;
}

/* Background Canvas & Ambient Glows */
#particle-canvas {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 1;
}

.ambient-glow {
    position: fixed;
    width: 40vw;
    height: 40vw;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(255, 105, 180, 0.12) 0%, rgba(138, 43, 226, 0.08) 50%, rgba(0, 0, 0, 0) 100%);
    filter: blur(80px);
    pointer-events: none;
    z-index: 0;
    transition: all 2s ease;
}

.glow-1 {
    top: -10%;
    left: -10%;
    animation: floatGlow1 20s infinite alternate;
}

.glow-2 {
    bottom: -10%;
    right: -10%;
    animation: floatGlow2 25s infinite alternate;
}

@keyframes floatGlow1 {
    0% {
        transform: translate(0, 0) scale(1);
    }

    100% {
        transform: translate(50px, 80px) scale(1.2);
    }
}

@keyframes floatGlow2 {
    0% {
        transform: translate(0, 0) scale(1.2);
    }

    100% {
        transform: translate(-80px, -50px) scale(0.9);
    }
}

/* Photo Gallery Container */
.gallery-wrapper {
    position: relative;
    z-index: 2;
    padding: 12vh 12px 32px 12px;
    /* Leaves the top screen area completely empty */
    width: 100%;
    min-height: 100vh;
}

/* Masonry Grid Layout */
.gallery-grid {
    column-count: 5;
    column-gap: 16px;
    width: 100%;
    transition: column-gap 0.5s ease, padding 0.5s ease;
}

/* Seamless view option */
.gallery-grid.seamless {
    column-gap: 0;
    padding: 0;
}

.gallery-grid.seamless .gallery-item {
    margin-bottom: 0;
    margin-top: 0;
    margin-left: 0;
    margin-right: 0;
    border-radius: 0;
    padding: 0;
    background: transparent;
    box-shadow: none;
    transform: none !important;
    filter: none;
}

.gallery-grid.seamless .gallery-item-peg,
.gallery-grid.seamless .gallery-item-heart {
    display: none;
}

.gallery-grid.seamless .gallery-item img {
    border: none;
}

/* Gallery Item Card (Polaroid Style) */
.gallery-item {
    display: block;
    width: 100%;
    break-inside: avoid;
    -webkit-column-break-inside: avoid;
    page-break-inside: avoid;
    margin-bottom: 24px;
    margin-top: 14px;
    position: relative;
    padding: 10px 10px 32px 10px;
    background-color: #faf9f6; /* Cream white polaroid background */
    border-radius: 2px;
    cursor: pointer;
    box-shadow: 0 10px 24px rgba(0, 0, 0, 0.4),
                inset 0 0 15px rgba(0, 0, 0, 0.01);
    transition: filter 0.6s ease, box-shadow 0.6s cubic-bezier(0.16, 1, 0.3, 1);
    /* Soft vintage filter */
    filter: sepia(12%) contrast(97%);
    will-change: transform; /* Hardware GPU acceleration */
}

/* Wooden Peg (Clip) */
.gallery-item-peg {
    position: absolute;
    top: -14px;
    left: 50%;
    transform: translateX(-50%);
    width: 12px;
    height: 28px;
    background: linear-gradient(to right, #d4b285, #b88f5c);
    border: 1px solid #997343;
    border-radius: 1px;
    box-shadow: 0 3px 6px rgba(0, 0, 0, 0.3);
    z-index: 10;
    transition: transform 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}

/* Peg Metal Wire Spring */
.gallery-item-peg::after {
    content: '';
    position: absolute;
    top: 9px;
    left: -1px;
    width: 12px;
    height: 2px;
    background-color: #444;
    border-top: 1px solid #888;
    z-index: 11;
}

.gallery-item img {
    display: block;
    width: 100%;
    height: auto;
    object-fit: cover;
    border: 1px solid rgba(0, 0, 0, 0.08);
    transition: transform 0.8s cubic-bezier(0.16, 1, 0.3, 1);
    will-change: transform;
}

/* Polaroid Heart Doodle at the bottom center */
.gallery-item-heart {
    position: absolute;
    bottom: 8px;
    left: 50%;
    transform: translateX(-50%);
    font-size: 13px;
    color: rgba(255, 105, 180, 0.4);
    transition: color 0.4s ease, transform 0.4s ease;
    user-select: none;
    pointer-events: none;
}

/* Hover effects */
.gallery-item:hover {
    z-index: 15;
    transform: scale(1.06) rotate(0deg) translateY(-8px) !important;
    filter: sepia(0%) contrast(100%);
    box-shadow: 0 25px 50px rgba(255, 105, 180, 0.25),
        0 0 30px rgba(138, 43, 226, 0.15);
}

.gallery-item:hover .gallery-item-peg {
    transform: translateX(-50%) translateY(-2px) scale(1.05);
}

.gallery-item:hover .gallery-item-heart {
    color: rgba(255, 105, 180, 0.95);
    transform: translateX(-50%) scale(1.2);
}

.gallery-item:hover img {
    transform: scale(1.02);
}

/* Custom 3D Glare Filter Overlay */
.gallery-item-glare {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.08) 0%, rgba(255, 255, 255, 0) 65%);
    opacity: 0;
    transition: opacity 0.5s ease;
    pointer-events: none;
    z-index: 8;
}

.gallery-item:hover .gallery-item-glare {
    opacity: 1;
}

/* Floating Controls (Glassmorphic) */
.floating-controls {
    position: fixed;
    bottom: 24px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 12px;
    z-index: 100;
    background: rgba(18, 14, 26, 0.5);
    backdrop-filter: blur(20px) saturate(180%);
    -webkit-backdrop-filter: blur(20px) saturate(180%);
    border: 1px solid rgba(255, 255, 255, 0.08);
    padding: 10px 16px;
    border-radius: 40px;
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.5),
        0 0 20px rgba(255, 105, 180, 0.1);
    transition: all 0.4s ease;
}

.floating-controls:hover {
    border-color: rgba(255, 105, 180, 0.3);
    box-shadow: 0 16px 48px rgba(0, 0, 0, 0.6),
        0 0 30px rgba(255, 105, 180, 0.2);
}

.control-btn {
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.08);
    width: 44px;
    height: 44px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: rgba(255, 255, 255, 0.7);
    transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
    outline: none;
}

.control-btn svg {
    width: 20px;
    height: 20px;
    fill: currentColor;
    transition: transform 0.3s ease;
}

.control-btn:hover {
    background: rgba(255, 105, 180, 0.15);
    border-color: rgba(255, 105, 180, 0.3);
    color: #ff69b4;
    transform: scale(1.1);
}

.control-btn:active {
    transform: scale(0.95);
}

.control-btn.active {
    background: #ff69b4;
    color: #fff;
    border-color: #ff69b4;
    box-shadow: 0 0 15px rgba(255, 105, 180, 0.5);
}

/* Lightbox Modal */
.lightbox {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background-color: rgba(6, 4, 10, 0.95);
    backdrop-filter: blur(25px);
    -webkit-backdrop-filter: blur(25px);
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.5s cubic-bezier(0.16, 1, 0.3, 1);
}

.lightbox.active {
    opacity: 1;
    pointer-events: all;
}

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

.lightbox-img {
    max-width: 100%;
    max-height: 85vh;
    object-fit: contain;
    border-radius: 8px;
    box-shadow: 0 25px 60px rgba(0, 0, 0, 0.8),
        0 0 50px rgba(255, 105, 180, 0.15);
    transform: scale(0.9);
    transition: transform 0.5s cubic-bezier(0.16, 1, 0.3, 1);
    user-select: none;
}

.lightbox.active .lightbox-img {
    transform: scale(1);
}

/* Lightbox UI Close & Navigation Buttons */
.lightbox-close {
    position: absolute;
    top: 24px;
    right: 24px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: #fff;
    width: 48px;
    height: 48px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
    z-index: 1010;
}

.lightbox-close:hover {
    background: rgba(255, 255, 255, 0.15);
    transform: scale(1.1) rotate(90deg);
}

.lightbox-btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.08);
    color: #fff;
    width: 56px;
    height: 56px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
    z-index: 1010;
    user-select: none;
}

.lightbox-btn:hover {
    background: rgba(255, 105, 180, 0.2);
    border-color: rgba(255, 105, 180, 0.4);
    color: #ff69b4;
    transform: translateY(-50%) scale(1.1);
}

.lightbox-prev {
    left: 24px;
}

.lightbox-next {
    right: 24px;
}

/* Responsive grid layout */
@media (max-width: 1400px) {
    .gallery-grid {
        column-count: 4;
    }
}

@media (max-width: 1000px) {
    .gallery-grid {
        column-count: 3;
    }
}

@media (max-width: 700px) {
    .gallery-grid {
        column-count: 2;
    }

    .lightbox-btn {
        width: 48px;
        height: 48px;
    }

    .lightbox-prev {
        left: 12px;
    }

    .lightbox-next {
        right: 12px;
    }
}

@media (max-width: 480px) {
    .gallery-grid {
        column-count: 1;
    }

    .floating-controls {
        bottom: 16px;
    }
}

/* Interactive custom music audio hidden element */
#bg-audio {
    display: none;
}

/* Welcome Overlay (Autoplay Bypass) */
#welcome-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background-color: rgba(11, 9, 15, 0.96);
    backdrop-filter: blur(30px);
    -webkit-backdrop-filter: blur(30px);
    z-index: 2000;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: opacity 1.2s cubic-bezier(0.25, 1, 0.5, 1), visibility 1.2s;
}

#welcome-overlay.hidden {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}

/* Date Lock Screen styling */
.lock-container {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.08);
    backdrop-filter: blur(15px);
    -webkit-backdrop-filter: blur(15px);
    padding: 40px 32px;
    border-radius: 16px;
    width: 90%;
    max-width: 380px;
    text-align: center;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.3),
        0 0 40px rgba(255, 105, 180, 0.05);
    animation: fadeInLock 0.8s ease-out;
}

@keyframes fadeInLock {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.lock-heart-wrapper {
    margin-bottom: 28px;
    display: inline-block;
    position: relative;
    width: 80px;
    height: 80px;
}

.lock-heart {
    width: 80px;
    height: 80px;
    fill: #ff69b4;
    filter: drop-shadow(0 0 15px rgba(255, 105, 180, 0.8));
    animation: heartbeat 1.4s infinite alternate ease-in-out;
    transition: transform 0.5s ease, opacity 0.5s ease;
}

/* Key Wrapper styling */
.lock-key-wrapper {
    position: absolute;
    top: 24px;
    /* Align with the keyhole center */
    left: 45px;
    width: 48px;
    height: 32px;
    opacity: 0;
    transform: translateX(40px) scale(0.6);
    transition: opacity 0.5s ease, transform 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    pointer-events: none;
    z-index: 10;
}

.lock-key-wrapper.key-insert {
    opacity: 1;
    transform: translateX(0px) scale(0.9);
}

.lock-key-wrapper.key-turn {
    transform: translateX(0px) scale(0.9) rotate(90deg);
}

.lock-key {
    width: 100%;
    height: 100%;
    fill: #ffd700;
    /* Golden Key! */
    filter: drop-shadow(0 0 8px rgba(255, 215, 0, 0.8));
}

/* When correct key is turned, scale heart away */
.lock-container.lock-open .lock-heart {
    animation: none;
    transform: scale(0);
    opacity: 0;
}

.lock-container.lock-open .lock-key-wrapper {
    opacity: 0;
    transform: scale(0) rotate(90deg);
}

.lock-form {
    display: flex;
    gap: 12px;
    justify-content: center;
    margin-bottom: 12px;
}

#lock-date-input {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 8px;
    padding: 12px 16px;
    font-size: 16px;
    color: #fff;
    font-family: 'Outfit', sans-serif;
    outline: none;
    width: 160px;
    text-align: center;
    transition: all 0.3s ease;
    letter-spacing: 2px;
}

#lock-date-input::placeholder {
    color: rgba(255, 255, 255, 0.3);
    letter-spacing: 0px;
}

#lock-date-input:focus {
    border-color: #ff69b4;
    background: rgba(255, 255, 255, 0.08);
    box-shadow: 0 0 15px rgba(255, 105, 180, 0.3);
}

.lock-submit-btn {
    background: #ff69b4;
    border: none;
    border-radius: 8px;
    padding: 12px 24px;
    font-size: 16px;
    font-weight: 600;
    color: #fff;
    font-family: 'Outfit', sans-serif;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
    box-shadow: 0 4px 15px rgba(255, 105, 180, 0.3);
}

.lock-submit-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(255, 105, 180, 0.5);
    filter: brightness(1.1);
}

.lock-submit-btn:active {
    transform: translateY(0);
}

.lock-error {
    font-family: 'Outfit', sans-serif;
    font-size: 14px;
    color: #ff4a86;
    min-height: 20px;
    margin: 8px 0 0 0;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.lock-error.show {
    opacity: 1;
}

/* Shake Animation for incorrect password */
.shake {
    animation: shakeAnim 0.5s ease-in-out;
}

@keyframes shakeAnim {

    0%,
    100% {
        transform: translateX(0);
    }

    20%,
    60% {
        transform: translateX(-8px);
    }

    40%,
    80% {
        transform: translateX(8px);
    }
}

@keyframes heartbeat {
    0% {
        transform: scale(1);
        filter: drop-shadow(0 0 8px rgba(255, 105, 180, 0.5));
    }

    100% {
        transform: scale(1.15);
        filter: drop-shadow(0 0 20px rgba(255, 105, 180, 0.9));
    }
}