    /* Graph-paper grid background */
    body::before {
        content: "";
        position: absolute;
        inset: 0;
        z-index: 0;
        background-image: linear-gradient(to right, #dbe4f0 1px, transparent 1px),
            linear-gradient(to bottom, #dbe4f0 1px, transparent 1px);
        background-size: 40px 40px;
        /* Make sure the background pseudo-element does not intercept clicks */
        pointer-events: none;
    }

    /* Smooth animated overlay (fixed so it doesn't affect document flow) */
    .bg-anim {
        position: fixed;
        inset: 0;
        background: linear-gradient(180deg,
                transparent 0%,
                rgba(5, 195, 248, 0.25) 50%,
                transparent 100%);
        animation: flowDown 25s linear infinite;
        z-index: 0;
        pointer-events: none;
    }

    @keyframes flowDown {
        0% {
            transform: translateY(-100%);
        }

        100% {
            transform: translateY(100%);
        }
    }

    /* Hover grid overlay (fixed to viewport, no overflow to prevent scroll) */
    .hover-grid {
        position: fixed;
        inset: 0;
        z-index: 1;
        /* Keep grid visible but do not intercept pointer events so underlying UI stays clickable */
        pointer-events: none;
        overflow: hidden;
        width: 100vw;
        height: 100vh;
        top: 0;
        left: 0;
    }

    /* Ensure main content sits above the hover grid by default (fixes pages using <main> or .main) */
    .main, main, .main-content {
        position: relative;
        z-index: 2;
    }

    .cell {
        width: 40px;
        height: 40px;
        border-radius: 10px;
        background: transparent;
        position: absolute;
        /* Ensure individual grid cells do not capture pointer events */
        pointer-events: none;
    }

    /* Custom navbar tweaks */
    .navbar-custom {
        background-color: #d9faff !important;
        border-radius: 20px;
        margin: 0.3rem 1rem;
        z-index: 10;
    }

    /* Hover underline effect */
    .nav-link {
        position: relative;
    }

    .nav-link::after {
        content: '';
        position: absolute;
        left: 0;
        bottom: -2px;
        width: 0;
        height: 3px;
        background-color: #2563eb;
        transition: width 0.3s ease-in-out;
    }

    .nav-link:hover::after {
        width: 100%;
    }

/* --- Footer (match header theme) --- */
.site-footer {
    background-color: #d9faff;
    border: 1px solid #00ddff;
    border-radius: 10px;
    margin: 1rem;
    padding: 0.75rem 1rem;
    z-index: 5;
}

.site-footer .container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
}

.footer-brand img {
    height: 46px;
    object-fit: contain;
}

.footer-link {
    color: #4a5a7d;
    text-decoration: none;
    font-weight: 500;
    position: relative;
    padding-bottom: 2px;
}

.footer-link::after {
    content: '';
    position: absolute;
    left: 0;
    bottom: -2px;
    width: 0;
    height: 3px;
    background-color: #2563eb;
    transition: width .25s ease-in-out;
}

.footer-link:hover::after {
    width: 100%;
}

.site-footer .text-muted {
    color: #4a5a7d;
}