/* 1. Basic Setup */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body,
html {
    height: 100%;
    width: 100%;
    overflow: hidden;
    background-color: #f4f1ea; /* Global paper color matches bknd.jpg */
}

/* 2. Background Image Layer */
#bg-container {
    position: fixed;
    inset: 0;
    z-index: 0;

    background: #f4f1ea url('bknd.webp') no-repeat center center;
    background-size: cover;

    animation: breathe 12s ease-in-out infinite;
}

/* Keep element for compatibility without affecting functionality */
#bg-image {
    display: none;
}

@keyframes breathe {
    0%,
    100% {
        transform: scale(1);
    }

    50% {
        transform: scale(1.04);
    }
}

/* 3. Static Grain Overlay */
#bg-container::after {
    content: "";
    position: fixed;
    inset: 0;
    background-image: url("https://upload.wikimedia.org/wikipedia/commons/7/76/1k_Noise_Texture.png");
    opacity: 0.04;
    pointer-events: none;
    z-index: 0;
}

/* 4. The Dust Particles Layer */
#tsparticles {
    position: fixed;
    inset: 0;
    z-index: 1;
    pointer-events: none;
}

/* Ensure all visible content stays above background */
nav,
main,
.hero,
.content,
section,
header,
footer {
    position: relative;
    z-index: 2;
}

/* 5. Navigation */
nav {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    padding: 30px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    z-index: 10;
}

.burger-container {
    position: relative;
    cursor: pointer;
    padding: 10px;
}

.burger-menu span {
    display: block;
    width: 25px;
    height: 2px;
    background-color: #333;
    margin: 5px 0;
}

.menu-overlay {
    position: absolute;
    top: 100%;
    left: 0;

    display: flex;
    flex-direction: column;
    gap: 15px;

    background: rgba(255, 255, 255, 0.75);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);

    padding: 25px;
    border-radius: 12px;

    border: 1px solid rgba(255, 255, 255, 0.4);

    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.08);

    min-width: 160px;

    opacity: 0;
    visibility: hidden;
    transform: translateY(10px);

    transition: all 0.4s cubic-bezier(0.165, 0.84, 0.44, 1);
}

.burger-container:hover .menu-overlay {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.menu-overlay a {
    text-decoration: none;
    color: #333;
    font-family: 'Segoe UI', sans-serif;
    font-weight: 600;
    font-size: 1rem;
    transition: color 0.3s ease;
}

.menu-overlay a:hover {
    color: #a33333;
}

/* Social Icons */
.social-icons {
    display: flex;
    gap: 20px;
    margin-right: 50px;
}

.social-icons a {
    color: #333;
    font-size: 1.2rem;
    transition: color 0.3s;
}

.social-icons a:hover {
    color: #a33333;
}

/* 6. Modals */
.modal {
    display: none;
    position: fixed;
    z-index: 100;

    left: 0;
    top: 0;

    width: 100%;
    height: 100%;

    background-color: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(8px);
}

.modal-content {
    background-color: rgba(244, 241, 234, 0.9);

    margin: 10% auto;

    padding: 40px;

    border: 1px solid rgba(220, 220, 220, 0.5);

    width: 90%;
    max-width: 500px;

    position: relative;

    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    line-height: 1.6;
    color: #333;

    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);

    border-radius: 12px;
}

.close {
    position: absolute;
    right: 20px;
    top: 15px;

    color: #999;

    font-size: 24px;

    cursor: pointer;
}

.close:hover {
    color: #a33333;
}

/* 7. Mobile Optimization */
@media (max-width: 768px) {

    #bg-container {
        background: #f4f1ea url('bknd.webp') no-repeat center center !important;
        background-size: cover !important;
    }

    #bg-image {
        display: none !important;
    }

    nav {
        padding: 20px;
    }

    .social-icons {
        gap: 15px;
        margin-right: 10px;
    }

    .menu-overlay {
        min-width: 140px;
        padding: 20px;
    }
}