/* TORLIB DIGITAL MATRIX — CSS ONLY */

/* Dark foundation */
html {
    min-height: 100%;
    background: #020806 !important;
}

body {
    position: relative;
    isolation: isolate;
    min-height: 100vh;
    background: transparent !important;
    color: #d9f8e6 !important;
}

/* Fullscreen moving network */
body::before {
    content: "";
    position: fixed;
    inset: 0;
    z-index: -1;
    pointer-events: none;

    background:
        linear-gradient(
            rgba(0, 255, 120, .085) 1px,
            transparent 1px
        ),
        linear-gradient(
            90deg,
            rgba(0, 255, 120, .085) 1px,
            transparent 1px
        ),
        radial-gradient(
            ellipse 80% 70% at 15% 35%,
            rgba(0, 180, 85, .24),
            transparent 75%
        ),
        radial-gradient(
            ellipse 70% 80% at 85% 70%,
            rgba(0, 110, 100, .22),
            transparent 75%
        );

    background-size:
        56px 56px,
        56px 56px,
        150% 150%,
        150% 150%;

    animation: torlib-matrix-flow 20s linear infinite;
}

@keyframes torlib-matrix-flow {
    from {
        background-position:
            0 0,
            0 0,
            0% 0%,
            100% 100%;
    }

    to {
        background-position:
            56px 56px,
            56px 56px,
            100% 100%,
            0% 0%;
    }
}

/* Subtle moving light beam */
body::after {
    content: "";
    position: fixed;
    inset: 0;
    z-index: -1;
    pointer-events: none;

    background: linear-gradient(
        180deg,
        transparent 0%,
        rgba(0, 255, 135, .025) 46%,
        rgba(0, 255, 135, .11) 50%,
        rgba(0, 255, 135, .025) 54%,
        transparent 100%
    );

    background-size: 100% 180%;
    animation: torlib-matrix-scan 15s linear infinite;
}

@keyframes torlib-matrix-scan {
    from { background-position: 0 -100vh; }
    to   { background-position: 0 100vh; }
}

/* Transparent WordPress wrappers */
.wp-site-blocks,
.wp-block-group,
.wp-block-post-content,
main {
    background-color: transparent !important;
}

/* Search interface */
.os-wrap,
.os-top,
.os-results {
    position: relative;
    z-index: 1;
}

.os-logo {
    color: #caffdf !important;
    text-shadow:
        0 0 16px rgba(0, 255, 120, .50),
        0 0 35px rgba(0, 200, 100, .20);
}

.os-search input {
    background: rgba(2, 15, 10, .92) !important;
    border: 1px solid rgba(45, 255, 130, .55) !important;
    color: #eafff1 !important;
    box-shadow: 0 0 22px rgba(0, 255, 120, .10);
}

.os-search input:focus {
    outline: 2px solid rgba(70, 255, 150, .65);
    outline-offset: 2px;
}

/* Search result panels */
.os-result,
.os-card {
    background: rgba(3, 15, 11, .84) !important;
    border: 1px solid rgba(35, 220, 110, .23) !important;
    border-radius: 8px;
    box-shadow: 0 8px 25px rgba(0, 0, 0, .18);
    transition:
        border-color .2s ease,
        box-shadow .2s ease;
}

.os-result:hover,
.os-card:hover {
    border-color: rgba(60, 255, 145, .60) !important;
    box-shadow: 0 0 22px rgba(0, 255, 120, .09);
}

.os-result-title,
.os-card-title {
    color: #9affbd !important;
}

.os-result-url {
    color: #59d99b !important;
}

/* Accessibility */
@media (prefers-reduced-motion: reduce) {
    body::before,
    body::after {
        animation: none !important;
    }

    .os-result,
    .os-card {
        transition: none !important;
    }
}

@media (max-width: 768px) {
    body::before {
        animation-duration: 32s;
    }
}

/* TORLIB MATRIX — FULLSCREEN LAYER FIX */

/* Make the page background transparent */
html {
    background: #010805 !important;
}

body {
    position: relative !important;
    isolation: isolate !important;
    background: transparent !important;
    min-height: 100vh;
}

/* Keep the animated layers visible behind all content */
body::before,
body::after {
    position: fixed !important;
    inset: 0 !important;
    pointer-events: none !important;
    z-index: 0 !important;
}

/* Place the website above the animation */
body > * {
    position: relative;
    z-index: 1;
}

/* Main moving matrix background */
body::before {
    background:
        repeating-linear-gradient(
            90deg,
            transparent 0,
            transparent 57px,
            rgba(0, 255, 125, .14) 58px,
            transparent 59px
        ),
        repeating-linear-gradient(
            0deg,
            transparent 0,
            transparent 57px,
            rgba(0, 255, 125, .12) 58px,
            transparent 59px
        ),
        radial-gradient(
            ellipse 70% 60% at 25% 35%,
            rgba(0, 235, 110, .24),
            transparent 75%
        ),
        radial-gradient(
            ellipse 70% 65% at 80% 75%,
            rgba(0, 190, 155, .20),
            transparent 75%
        ) !important;

    background-size:
        60px 60px,
        60px 60px,
        160% 160%,
        160% 160% !important;

    animation: torlib-matrix-visible 12s linear infinite !important;
}

@keyframes torlib-matrix-visible {
    0% {
        background-position:
            0 0,
            0 0,
            0% 0%,
            100% 100%;
    }

    100% {
        background-position:
            60px 60px,
            60px 60px,
            100% 100%,
            0% 0%;
    }
}

/* Animated scanning beam */
body::after {
    background: linear-gradient(
        180deg,
        transparent 0%,
        transparent 42%,
        rgba(0, 255, 140, .12) 49%,
        rgba(0, 255, 140, .22) 50%,
        rgba(0, 255, 140, .12) 51%,
        transparent 58%,
        transparent 100%
    ) !important;

    background-size: 100% 200% !important;
    animation: torlib-scan-visible 9s linear infinite !important;
}

@keyframes torlib-scan-visible {
    from { background-position: 0 -100vh; }
    to   { background-position: 0 100vh; }
}

/* Prevent WordPress containers from hiding the background */
.wp-site-blocks,
.wp-block-group,
.wp-block-post-content,
.os-home,
.os-wrap,
.os-results {
    background-color: transparent !important;
}

@media (prefers-reduced-motion: reduce) {
    body::before,
    body::after {
        animation: none !important;
    }
}
