/* Circuit board layer: background traces, connector traces, component pads */

:root {
    /* Theme hooks: skins override these (see assets/skins) */
    --cb-trace: rgba(252, 252, 252, 0.30);
    --cb-pad: rgba(252, 252, 252, 0.55);
    --cb-pulse-colors: 255, 255, 255;   /* one or more "r, g, b" values separated by | */
    --cb-flow: #ffffff;
    --cb-pad-fill: #173e5b;
    --cb-pad-flash: #ffffff;
    --cb-ring: 252, 252, 252;

    /* Header background (header.js) */
    --hd-bg-top: #040d16;
    --hd-bg-bottom: #0d2c44;
    --hd-rgb: 73, 185, 234;
    --hd-accent-rgb: 255, 186, 110;
}

/* Header: generated binary background instead of the photo */
.intro-box {
    position: relative;
    background-color: #081a29;
}

#header-bg {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
}

.intro-box .bx-wrapper {
    background: transparent;
    box-shadow: none;
}

.intro-box .intro-box-1 {
    background: none;
}

.intro-box-1-text-welcome,
.intro-box-1-text-operating {
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.85), 0 0 3px rgba(0, 0, 0, 0.6);
}

#circuit-bg {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -10;
    pointer-events: none;
}

/* Connector lines between the icons and the articles, drawn as PCB traces */
.line {
    overflow: visible;
}

.line .neon-line {
    stroke-width: 1.5;
    stroke-linejoin: round;
}

.cb-flow {
    fill: none;
    stroke: var(--cb-flow);
    stroke-width: 3.5;
    stroke-linecap: round;
    stroke-linejoin: round;
    stroke-dasharray: 26px var(--len);
    stroke-dashoffset: 26px;
    animation: cb-flow 4s linear infinite;
}

@keyframes cb-flow {
    0% {
        stroke-dashoffset: 26px;
        opacity: 0;
    }
    6% {
        opacity: 1;
    }
    70% {
        stroke-dashoffset: calc(-1 * var(--len));
        opacity: 1;
    }
    72%, 100% {
        stroke-dashoffset: calc(-1 * var(--len));
        opacity: 0;
    }
}

.cb-via {
    fill: #fcfcfc;
}

.cb-pad {
    fill: var(--cb-pad-fill);
    stroke: #fcfcfc;
    stroke-width: 2;
    transform-box: fill-box;
    transform-origin: center;
    animation: cb-pad 4s ease-out infinite;
}

@keyframes cb-pad {
    0%, 62% {
        transform: scale(1);
        fill: var(--cb-pad-fill);
    }
    72% {
        transform: scale(1.7);
        fill: var(--cb-pad-flash);
    }
    100% {
        transform: scale(1);
        fill: var(--cb-pad-fill);
    }
}

/* Icons behave like component pads sending a signal out */
.image-container {
    background-color: rgba(23, 62, 91, 0.18);
    animation: cb-ping 4s ease-out infinite;
}

.icon-2 { animation-delay: 0.5s; }
.icon-3 { animation-delay: 1s; }
.icon-4 { animation-delay: 1.5s; }
.icon-5 { animation-delay: 2s; }

@keyframes cb-ping {
    0% {
        box-shadow: inset 0 2px 2px #fcfcfc, 0 2px 2px #fcfcfc, 0 0 0 0 rgba(var(--cb-ring), 0.7);
    }
    40%, 100% {
        box-shadow: inset 0 2px 2px #fcfcfc, 0 2px 2px #fcfcfc, 0 0 0 16px rgba(var(--cb-ring), 0);
    }
}

/* Logo as the central chip: rotating pin ring */
.outer-circle-2::before,
.outer-circle-2::after {
    content: '';
    position: absolute;
    border-radius: 50%;
    pointer-events: none;
}

.outer-circle-2::before {
    top: -9px;
    right: -9px;
    bottom: -9px;
    left: -9px;
    border: 3px dashed rgba(252, 252, 252, 0.85);
    animation: cb-spin 40s linear infinite;
}

.outer-circle-2::after {
    top: -18px;
    right: -18px;
    bottom: -18px;
    left: -18px;
    border: 1px solid rgba(252, 252, 252, 0.45);
    animation: cb-halo 4s ease-out infinite;
}

@keyframes cb-spin {
    to {
        transform: rotate(360deg);
    }
}

@keyframes cb-halo {
    0% {
        transform: scale(0.92);
        opacity: 0.9;
    }
    60%, 100% {
        transform: scale(1.18);
        opacity: 0;
    }
}

@media (prefers-reduced-motion: reduce) {
    .cb-flow {
        display: none;
    }

    .cb-pad,
    .image-container,
    .outer-circle-2::before,
    .outer-circle-2::after {
        animation: none;
    }
}
