@font-face {
    font-family: "Relay Ubuntu";
    src: url("./fonts/relayfrontend-ubuntu-regular.woff2") format("woff2");
    font-weight: 400;
    font-style: normal;
}

@font-face {
    font-family: "Relay Ubuntu";
    src: url("./fonts/relayfrontend-ubuntu-medium.woff2") format("woff2");
    font-weight: 500;
    font-style: normal;
}

@font-face {
    font-family: "Science Gothic Ghostline";
    src: url("./fonts/science-gothic-250-ghostline.woff2") format("woff2");
    font-weight: 250;
    font-style: normal;
}

:root {
    --bg-main: #020606;
    --bg-window: rgba(8, 14, 10, 0.76);
    --bg-window-corner: rgba(8, 14, 10, 0.58);

    --text-main: #9fbd9f;
    --text-title: #a8cda9;
    --text-bright: #a9c9aa;
    --text-muted: #7f927f;
    --text-logo: #b8f5bc;
    --text-button: #b6d8b7;
    --text-warm: #ffd6a0;

    --green-008: rgba(120, 255, 160, 0.008);
    --green-014: rgba(120, 255, 160, 0.14);

    --border-soft: rgba(170, 255, 195, 0.10);
    --border-medium: rgba(170, 255, 195, 0.18);
    --border-hover: rgba(190, 255, 205, 0.34);

    --frame-014: rgba(155, 255, 180, 0.14);
    --frame-018: rgba(155, 255, 180, 0.18);

    --corner-014: rgba(45, 255, 45, 0.18);
    --corner-018: rgba(45, 255, 45, 0.24);
    --corner-026: rgba(45, 255, 45, 0.14);
    --corner-040: rgba(45, 255, 45, 0.24);

    --shadow-window: rgba(100, 255, 150, 0.045);
}

* {
    box-sizing: border-box;
}

html,
body {
    margin: 0;
    width: 100%;
    height: 100%;
    overflow: hidden;
    background: var(--bg-main);
    color: var(--text-main);
    font-family: "Relay Ubuntu", sans-serif;
    font-weight: 400;
    letter-spacing: 0.02em;
    user-select: none;
}

/* Background */

.switchboard-bg {
    position: fixed;
    inset: 0;
    background:
        radial-gradient(circle at 28% 36%, rgba(60,255,180,.075), transparent 42%),
        radial-gradient(circle at 72% 60%, rgba(255,180,80,.055), transparent 45%),
        linear-gradient(180deg, #020606, #031010 50%, #020606);
    z-index: 0;
}

.noise-layer,
.grid-layer,
.depth-layer,
.network-layer,
.scan-layer,
.vignette-layer {
    position: absolute;
    inset: 0;
    pointer-events: none;
}

.noise-layer {
    opacity: .11;
    background-image: radial-gradient(rgba(255,255,255,.32) 1px, transparent 1px);
    background-size: 4px 4px;
}

.grid-layer {
    opacity: .32;
    background-image:
        linear-gradient(rgba(100,255,180,.05) 1px, transparent 1px),
        linear-gradient(90deg, rgba(100,255,180,.05) 1px, transparent 1px),
        linear-gradient(rgba(100,255,180,.018) 1px, transparent 1px),
        linear-gradient(90deg, rgba(100,255,180,.018) 1px, transparent 1px);
    background-size: 120px 120px, 120px 120px, 24px 24px, 24px 24px;
}

.depth-layer {
    opacity: .28;
    background:
        repeating-linear-gradient(90deg, transparent 0, transparent 150px, rgba(80,255,180,.04) 151px, transparent 153px),
        repeating-linear-gradient(0deg, transparent 0, transparent 220px, rgba(255,180,80,.03) 221px, transparent 223px);
    animation: drift 55s linear infinite;
}

.background-network-layer {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    opacity: .32;
}

.background-route {
    fill: none;
    stroke: rgba(100, 255, 185, .08);
    stroke-width: .8px;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.network-layer {
    width: 100%;
    height: 100%;
    opacity: .3;
    transition: opacity 5s ease;
}

.network-layer.observing {
    opacity: 1;
}

.route {
    fill: none;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.route.trunk { stroke: rgba(130, 255, 205, .36); }
.route.regional { stroke: rgba(100, 255, 185, .27); }
.route.local { stroke: rgba(100, 255, 185, .21); }
.route.blue { stroke: rgba(110, 200, 255, .25); }
.route.red { stroke: rgba(255, 120, 100, .25); }

.route.rewire-flash {
    stroke: rgba(255, 230, 140, .95);
}

.route.corridor {
    stroke: rgba(130, 255, 205, .31);
}

.external-route {
    stroke: rgba(110, 255, 200, .20);
    stroke-width: 1px;
}

.node.green { fill: rgba(190, 255, 220, .9); }
.node.blue { fill: rgba(95, 165, 215, .72); }
.node.red { fill: rgba(215, 125, 100, .72); }
.node.exchange { fill: rgba(210, 255, 230, .96); }
.node.backbone { fill: rgba(225, 255, 238, .98); }

.node.rewire-flash {
    filter: drop-shadow(0 0 12px rgba(255, 230, 140, .95));
}

.pressure-ring {
    fill: none;
    stroke: rgba(190, 255, 220, .28);
    stroke-width: 1;
    pointer-events: none;
}

.exchange-ring {
    fill: none;
    stroke: rgba(160, 255, 210, .24);
    stroke-width: 1;
}

.receiver-capacity-arc {
    fill: none;
    stroke: rgba(95, 165, 215, .42);
    stroke-width: 1.35px;
    stroke-linecap: round;
    pointer-events: none;
}

.receiver-overflow-arc {
    fill: none;
    stroke: rgba(130, 110, 215, .5);
    stroke-width: 1.35px;
    stroke-linecap: round;
    pointer-events: none;
}

.sender-tick {
    stroke: rgba(215, 125, 100, .42);
    stroke-width: 1px;
    stroke-linecap: round;
    pointer-events: none;
}

.relay-box {
    fill: rgba(120, 255, 195, .24);
}

.pulse {
    fill: rgba(225, 255, 240, .96);
    filter: drop-shadow(0 0 3px rgba(255,255,255,.6));
}

.scan-layer {
    background: linear-gradient(to bottom, transparent, rgba(120,255,200,.025), transparent);
    animation: scan 13s linear infinite;
}

.vignette-layer {
    background: radial-gradient(circle, transparent 42%, rgba(0,0,0,.76) 100%);
}

/* UI */

.switchboard-ui {
    position: relative;
    width: 100vw;
    height: 100vh;
    z-index: 2;
    opacity: 1;
    transition: opacity 5s ease;
}

.switchboard-ui.observing {
    opacity: 0;
    pointer-events: none;
}

/* Window Base */

.window {
    position: absolute;
    overflow: visible;
    background:
        linear-gradient(
            to right,
            var(--green-008) 0px,
            var(--green-008) 14px,
            transparent 14px
        ) left 32px / 14px calc(100% - 32px) no-repeat,
        linear-gradient(
            to bottom,
            var(--green-008) 0px,
            var(--green-008) 32px,
            transparent 32px
        ) top / 100% 32px no-repeat,
        var(--bg-window);
    border-top: 1px solid var(--frame-018);
    border-left: 1px solid var(--frame-014);
    box-shadow: 0 0 3px 2px var(--shadow-window);
    backdrop-filter: blur(2px);
}

.window.hidden {
    display: none;
}

.window::before {
    content: "";
    position: absolute;
    top: 40px;
    left: 22px;
    right: 10px;
    bottom: 10px;
    border: 1px solid var(--border-soft);
    background:
        linear-gradient(var(--corner-018), var(--corner-018)) left top / 8px 1px no-repeat,
        linear-gradient(var(--corner-018), var(--corner-018)) left top / 1px 8px no-repeat,
        linear-gradient(var(--corner-014), var(--corner-014)) right top / 8px 1px no-repeat,
        linear-gradient(var(--corner-014), var(--corner-014)) right top / 1px 8px no-repeat,
        linear-gradient(var(--corner-014), var(--corner-014)) left bottom / 8px 1px no-repeat,
        linear-gradient(var(--corner-014), var(--corner-014)) left bottom / 1px 8px no-repeat;
    pointer-events: none;
}

.window::after {
    content: "";
    position: absolute;
    top: -1px;
    left: -1px;
    right: -1px;
    bottom: -1px;
    pointer-events: none;
    background:
        linear-gradient(var(--corner-026), var(--corner-026)) left bottom / 14px 1px no-repeat,
        linear-gradient(var(--corner-026), var(--corner-026)) left bottom / 1px 14px no-repeat,
        linear-gradient(var(--corner-040), var(--corner-040)) left top / 14px 1px no-repeat,
        linear-gradient(var(--corner-040), var(--corner-040)) left top / 1px 14px no-repeat,
        linear-gradient(var(--corner-026), var(--corner-026)) right top / 14px 1px no-repeat,
        linear-gradient(var(--corner-026), var(--corner-026)) right top / 1px 14px no-repeat,
        linear-gradient(var(--bg-window-corner), var(--bg-window-corner)) right bottom / 24px 24px no-repeat;
}

.window-titlebar {
    position: absolute;
    top: 6px;
    left: 34px;
    height: 20px;
    color: var(--text-title);
    font-size: 14px;
    line-height: 20px;
    user-select: none;
    z-index: 2;
}

.window-content {
    position: absolute;
    top: var(--content-top, 54px);
    left: var(--content-left, 42px);
    right: var(--content-right, 28px);
    bottom: var(--content-bottom, 28px);
    color: var(--text-bright);
}

.window-signal {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 32px;
    pointer-events: none;
    background: var(--window-signal-bg);
}

.drag-top {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 32px;
    cursor: move;
    z-index: 3;
}

.drag-left {
    position: absolute;
    top: 32px;
    left: 0;
    width: 16px;
    bottom: 0;
    cursor: move;
    z-index: 3;
}

/* Window Placement */

.status-window {
    left: 70px;
    top: 70px;
    width: 380px;
    height: 100px;
    --content-top: 48px;
    --content-left: 42px;
    --content-right: 22px;
    --content-bottom: 20px;
    --window-signal-bg:
        repeating-linear-gradient(
            to bottom,
            transparent 0px,
            transparent 5px,
            rgba(120, 255, 160, 0.050) 5px,
            rgba(120, 255, 160, 0.050) 6px,
            transparent 6px,
            transparent 22px,
            rgba(120, 255, 160, 0.085) 22px,
            rgba(120, 255, 160, 0.085) 24px,
            transparent 24px,
            transparent 32px
        );
}

.destinations-window {
    left: calc(50vw - 460px);
    top: calc(54vh - 215px);
    width: 920px;
    height: 430px;
    visibility: hidden;
    --content-top: 58px;
    --content-left: 48px;
    --content-right: 48px;
    --content-bottom: 32px;
    --window-signal-bg:
        repeating-linear-gradient(
            to bottom,
            transparent 0px,
            transparent 4px,
            rgba(40, 190, 255, 0.045) 4px,
            rgba(40, 190, 255, 0.045) 5px,
            transparent 5px,
            transparent 14px,
            rgba(40, 190, 255, 0.080) 14px,
            rgba(40, 190, 255, 0.080) 16px,
            transparent 16px,
            transparent 32px
        );
}

.destinations-window.initialized {
    visibility: visible;
}

.destinations-window.one-card {
    left: calc(30vw - 190px);
    width: 340px;
}

.destinations-window.two-card {
    left: calc(30vw - 325px);
    width: 610px;
}

.destinations-window.three-card {
    left: calc(30vw - 460px);
    width: 880px;
}

.identity-window {
    left: calc(50vw - 240px);
    top: calc(50vh - 185px);
    width: 480px;
    height: 370px;
    --content-top: 54px;
    --content-left: 40px;
    --content-right: 28px;
    --content-bottom: 28px;
    --window-signal-bg:
        repeating-linear-gradient(
            to bottom,
            transparent 0px,
            transparent 5px,
            rgba(255, 190, 40, 0.045) 5px,
            rgba(255, 190, 40, 0.045) 6px,
            transparent 6px,
            transparent 20px,
            rgba(255, 190, 40, 0.075) 20px,
            rgba(255, 190, 40, 0.075) 22px,
            transparent 22px,
            transparent 32px
        );
}

/* Status */

.status-content {
    display: flex;
    align-items: center;
    gap: 8px;
    overflow: hidden;
    white-space: nowrap;
    font-size: 15px;
    letter-spacing: 0.08em;
}

.status-label {
    color: var(--text-logo);
    text-shadow:
        0 0 2px rgba(45, 255, 45, 0.45),
        0 0 8px rgba(45, 255, 45, 0.12);
}

/* Destinations */

.destinations-content {
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.identity-track {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 26px;
    width: 100%;
    height: 100%;
}

.identity-track.single-card {
    justify-content: center;
}

.identity-track.double-card {
    justify-content: center;
}

.identity-track.triple-card {
    justify-content: center;
}

.identity-card {
    position: relative;
    width: 240px;
    height: 320px;
    flex: 0 0 auto;
    overflow: hidden;
    border: 1px solid rgba(170, 255, 195, 0.16);
    background:
        radial-gradient(circle at 32% 24%, rgba(130, 255, 205, 0.09), transparent 42%),
        radial-gradient(circle at 70% 76%, rgba(255, 190, 80, 0.08), transparent 50%),
        rgba(4, 10, 8, 0.84);
    box-shadow:
        inset 0 0 0 1px rgba(120, 255, 160, 0.03),
        0 0 18px rgba(100, 255, 150, 0.035);
    color: var(--text-bright);
    font-family: inherit;
    cursor: pointer;
    padding: 0;
    text-align: left;
}

.identity-card:hover {
    border-color: var(--border-hover);
    box-shadow:
        inset 0 0 0 1px rgba(120, 255, 160, 0.06),
        0 0 26px rgba(100, 255, 150, 0.08);
}

.identity-card::before {
    content: "";
    position: absolute;
    inset: 0;
    background:
        linear-gradient(135deg, rgba(255,255,255,0.08), transparent 18%, transparent 78%, rgba(120,255,160,0.05)),
        repeating-linear-gradient(
            to bottom,
            transparent 0px,
            transparent 7px,
            rgba(120,255,160,0.018) 8px,
            transparent 9px
        );
    opacity: .52;
    pointer-events: none;
}

.identity-card-visual {
    position: absolute;
    inset: 0;
    background:
        linear-gradient(180deg, transparent 0%, rgba(0,0,0,.08) 48%, rgba(0,0,0,.66) 100%);
}

.create-card-visual {
    background:
        radial-gradient(circle at 50% 38%, rgba(180, 245, 188, 0.14), transparent 34%),
        linear-gradient(180deg, transparent 0%, rgba(0,0,0,.1) 48%, rgba(0,0,0,.66) 100%);
}

.identity-card-text {
    position: absolute;
    left: 18px;
    right: 18px;
    bottom: 18px;
    z-index: 2;
    text-shadow:
        0 0 6px rgba(0, 0, 0, 0.82),
        0 0 12px rgba(0, 0, 0, 0.58);
}

.identity-name {
    color: var(--text-logo);
    font-size: 20px;
    font-weight: 500;
    letter-spacing: 0.08em;
}

.identity-company {
    margin-top: 8px;
    color: var(--text-warm);
    font-size: 13px;
    letter-spacing: 0.08em;
}

.carousel-button {
    position: absolute;
    top: 50%;
    z-index: 4;
    transform: translateY(-50%);
    width: 34px;
    height: 70px;
    border: 1px solid rgba(170, 255, 195, 0.12);
    background: rgba(8, 14, 10, 0.68);
    color: var(--text-button);
    font-size: 34px;
    line-height: 1;
    cursor: pointer;
}

.carousel-button:hover:not(:disabled) {
    color: var(--text-logo);
    border-color: var(--border-hover);
}

.carousel-button:disabled {
    opacity: .25;
    cursor: default;
}

.carousel-button.hidden {
    display: none;
}

.carousel-button-left {
    left: 28px;
}

.carousel-button-right {
    right: 28px;
}

/* Identity Form */

.identity-content {
    overflow: hidden;
}

.identity-form {
    display: flex;
    flex-direction: column;
    height: 100%;
    gap: 14px;
}

.type-toggle {
    display: flex;
    gap: 10px;
}

.type-button,
.ghost-button {
    background: rgba(8, 14, 10, 0.58);
    border: 1px solid rgba(170, 255, 195, 0.14);
    color: var(--text-button);
    font-family: inherit;
    font-size: 13px;
    letter-spacing: 0.08em;
    cursor: pointer;
    padding: 8px 12px;
}

.type-button:hover,
.ghost-button:hover {
    color: var(--text-logo);
    border-color: var(--border-hover);
}

.type-button.selected,
.ghost-button.primary {
    color: var(--text-logo);
    border-color: rgba(190, 255, 205, 0.32);
    box-shadow: 0 0 12px rgba(120, 255, 160, 0.045);
}

.field-label {
    color: var(--text-muted);
    font-size: 12px;
    letter-spacing: 0.08em;
}

.text-field {
    width: 100%;
    background: rgba(3, 8, 6, 0.72);
    border: 1px solid rgba(170, 255, 195, 0.14);
    color: var(--text-logo);
    caret-color: var(--text-logo);
    font-family: inherit;
    font-size: 15px;
    letter-spacing: 0.08em;
    outline: 0;
    padding: 9px 10px;
    user-select: text;
}

.text-field:focus {
    border-color: var(--border-hover);
}

.company-field {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.company-field.hidden {
    display: none;
}

.identity-error {
    min-height: 18px;
    color: rgba(255, 140, 110, 0.9);
    font-size: 12px;
    letter-spacing: 0.08em;
}

.identity-actions {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    margin-top: auto;
}

/* Observe */

.observe-button {
    position: fixed;
    right: 28px;
    bottom: 24px;
    z-index: 3;
    width: 36px;
    height: 36px;
    border: 1px solid rgba(170, 255, 195, 0.12);
    background: rgba(8, 14, 10, 0.42);
    color: rgba(180, 245, 188, 0.58);
    font-size: 15px;
    cursor: pointer;
    transition:
        opacity 5s ease,
        color 180ms ease,
        border-color 180ms ease;
}

.observe-button:hover {
    color: var(--text-logo);
    border-color: var(--border-hover);
}

.observe-button.observing {
    opacity: 0;
    pointer-events: none;
}

/* Motion */

@keyframes drift {
    from { transform: translate(0,0); }
    to { transform: translate(-120px,60px); }
}

@keyframes scan {
    from { transform: translateY(-100%); }
    to { transform: translateY(100%); }
}