/* Ghostwire brand: shared by the client and the host settings app.
   Keep web/brand.css and internal/hostgui/ui/brand.css identical (make brand). */
@font-face { font-family: "Orbitron"; src: url(fonts/orbitron-latin-500-normal.woff2) format("woff2"); font-weight: 500; font-display: swap; }
@font-face { font-family: "Orbitron"; src: url(fonts/orbitron-latin-700-normal.woff2) format("woff2"); font-weight: 700; font-display: swap; }
@font-face { font-family: "Orbitron"; src: url(fonts/orbitron-latin-900-normal.woff2) format("woff2"); font-weight: 900; font-display: swap; }

:root {
  --gw-cyan: #5ef0ff;
  --gw-sky: #5cc6ff;
  --gw-violet: #b47cff;
  --gw-navy: #050c1a;
  --gw-grad: linear-gradient(135deg, #5ef0ff 0%, #5cc6ff 45%, #b47cff 100%);
  --gw-font: "Orbitron", "Segoe UI", system-ui, sans-serif;
}

/* network background: constellation tile + soft glows + slow drift */
.gw-bg { position: fixed; inset: 0; z-index: -1; overflow: hidden; pointer-events: none;
  background:
    radial-gradient(900px 520px at 85% -10%, rgba(180,124,255,.16), transparent 60%),
    radial-gradient(900px 520px at -10% 110%, rgba(94,240,255,.12), transparent 60%),
    var(--gw-navy); }
.gw-bg::before { content: ""; position: absolute; inset: -420px; background: url(bg-net.svg) repeat; opacity: .9;
  animation: gw-drift 160s linear infinite; }
.gw-bg i { position: absolute; width: 6px; height: 6px; border-radius: 50%; background: var(--gw-cyan);
  box-shadow: 0 0 12px 3px rgba(94,240,255,.55); animation: gw-twinkle 4s ease-in-out infinite; }
.gw-bg i:nth-child(1) { top: 18%; left: 12%; }
.gw-bg i:nth-child(2) { top: 64%; left: 82%; animation-delay: 1.3s; background: var(--gw-violet); box-shadow: 0 0 12px 3px rgba(180,124,255,.5); }
.gw-bg i:nth-child(3) { top: 84%; left: 30%; animation-delay: 2.6s; }
.gw-bg i:nth-child(4) { top: 30%; left: 70%; animation-delay: .7s; width: 4px; height: 4px; }
@keyframes gw-drift { to { transform: translate(640px, 420px); } }
@keyframes gw-twinkle { 0%, 100% { opacity: .15; transform: scale(.7); } 50% { opacity: .9; transform: scale(1); } }

/* logo: animated ghost + wordmark */
.gw-logo { display: flex; align-items: center; gap: 10px; }
.gw-logo .ghost { width: 54px; height: auto; flex: none; filter: drop-shadow(0 0 10px rgba(94,200,255,.35)); }
.gw-word b { display: block; font: 700 21px/1 var(--gw-font); letter-spacing: .02em; white-space: nowrap;
  background: linear-gradient(180deg, #f4fbff, #c4ebff); -webkit-background-clip: text; background-clip: text; color: transparent; }
.gw-word b span { background: linear-gradient(90deg, var(--gw-cyan), var(--gw-sky)); -webkit-background-clip: text; background-clip: text; color: transparent; }
.gw-word small { display: block; font: 500 8.5px/1 var(--gw-font); letter-spacing: .42em; color: #5ee7f5; margin-top: 6px; white-space: nowrap; }
.gw-word small em { font-style: normal; color: var(--gw-violet); }
.gw-logo.big .ghost { width: 84px; }
.gw-logo.big .gw-word b { font-size: 30px; }
.gw-logo.big .gw-word small { font-size: 11px; margin-top: 8px; }

/* data flow: client <-> umbra <-> host */
.flow svg { display: block; width: 100%; height: auto; overflow: visible; }
.flow .lnk { fill: none; stroke-linecap: round; }
.flow .sig { stroke: rgba(94,240,255,.22); stroke-width: 1.4; stroke-dasharray: 3 6; }
.flow .media, .flow .back { opacity: 0; transition: opacity .4s; }
.flow .media { stroke: url(#gwFlowGrad); stroke-width: 4.2; stroke-dasharray: 4 10; animation: gw-dash var(--dur, 1s) linear infinite; filter: drop-shadow(0 0 4px rgba(94,240,255,.9)); }
.flow .rail { fill: none; stroke: rgba(94,200,255,.10); stroke-width: 8; stroke-linecap: round; opacity: 0; transition: opacity .4s; }
.flow[data-mode="p2p"] .rail.direct-r, .flow[data-mode="relay"] .rail.relay-r { opacity: 1; }
.flow .back { stroke: var(--gw-violet); stroke-width: 1.6; stroke-dasharray: 1.5 10.5; animation: gw-dash calc(var(--dur, 1s) * 2.2) linear infinite; }
.flow .node circle.ring { fill: #0a1630; stroke: url(#gwFlowGrad); stroke-width: 2; }
.flow .node circle.halo { fill: rgba(94,240,255,.12); transform-box: fill-box; transform-origin: center; }
.flow .node .ico { fill: none; stroke: #cfeeff; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.flow .node text { fill: #9fb3d9; font: 600 9px var(--gw-font); letter-spacing: .08em; text-anchor: middle; text-transform: uppercase; }
.flow .node.off circle.ring { stroke: #2b3758; } .flow .node.off .ico { stroke: #4b5a80; }
.flow[data-mode="connecting"] .sig, .flow[data-mode="online"] .sig.h { stroke: var(--gw-cyan); stroke-opacity: .8; animation: gw-dash 1.1s linear infinite; }
.flow[data-mode="connecting"] .node circle.halo { animation: gw-pulse 1.6s ease-in-out infinite; }
.flow[data-mode="p2p"] .direct, .flow[data-mode="p2p"] .direct-back,
.flow[data-mode="relay"] .relay, .flow[data-mode="relay"] .relay-back { opacity: 1; }
.flow[data-mode="relay"] .node.umbra circle.halo, .flow[data-mode="p2p"] .node.client circle.halo,
.flow[data-mode="p2p"] .node.host circle.halo { animation: gw-pulse 2.4s ease-in-out infinite; }
.flow[data-mode="offline"] .sig { stroke-opacity: .08; }
@keyframes gw-dash { to { stroke-dashoffset: -28; } }
@keyframes gw-pulse { 0%, 100% { transform: scale(1); opacity: .5; } 50% { transform: scale(1.35); opacity: 1; } }

/* quality meter */
.q-meter { display: flex; align-items: center; gap: 10px; font: 600 11px var(--gw-font); letter-spacing: .1em; text-transform: uppercase; }
.q-meter .bars { display: flex; gap: 3px; align-items: flex-end; }
.q-meter .bars i { width: 5px; border-radius: 2px; background: rgba(140,160,255,.2); }
.q-meter .bars i:nth-child(1) { height: 6px; } .q-meter .bars i:nth-child(2) { height: 10px; }
.q-meter .bars i:nth-child(3) { height: 14px; } .q-meter .bars i:nth-child(4) { height: 18px; }
.q-meter[data-q="4"] .bars i, .q-meter[data-q="3"] .bars i:nth-child(-n+3), .q-meter[data-q="2"] .bars i:nth-child(-n+2), .q-meter[data-q="1"] .bars i:nth-child(1) { background: var(--q-col, var(--gw-cyan)); box-shadow: 0 0 6px var(--q-col, var(--gw-cyan)); }
.q-meter[data-q="4"] { --q-col: #34d399; } .q-meter[data-q="3"] { --q-col: var(--gw-cyan); } .q-meter[data-q="2"] { --q-col: #fbbf24; } .q-meter[data-q="1"] { --q-col: #f87171; }
.q-meter span { color: var(--q-col, #9fb3d9); }

@media (prefers-reduced-motion: reduce) {
  .gw-bg::before, .gw-bg i, .flow .media, .flow .back, .flow .sig, .flow .node circle.halo { animation: none !important; }
}
