.hg-net {
    --hg-ink:      #0B0D0F;
    --hg-card:     #141517;
    --hg-line:     #1E1E1F;
    --hg-line2:    #2A2A2C;
    --hg-paper:    #F7F7F7;
    --hg-orange:   #FF9626;
    --hg-mute:     #86868B;
    --hg-quiet:    #B9B9BA;
    --hg-dim:      #575757;
    --hg-net-size: 560px;

    position: relative;
    width: 100%;
    max-width: var(--hg-net-size);
    aspect-ratio: 4 / 3;
    margin: 0 auto;
    border-radius: 24px;
    background:
        radial-gradient(60% 50% at 50% 50%, rgba(255,150,38,0.10), transparent 62%),
        radial-gradient(120% 80% at 50% 100%, rgba(255,150,38,0.04), transparent 60%),
        linear-gradient(180deg, #121316 0%, #0B0D0F 100%);
    border: 1px solid var(--hg-line);
    overflow: hidden;
    font-family: "Inter", system-ui, -apple-system, sans-serif;
    color: var(--hg-paper);
    -webkit-font-smoothing: antialiased;
    box-sizing: border-box;
}

.hg-net *, .hg-net *::before, .hg-net *::after { box-sizing: border-box; }

.hg-net::before {
    content: "";
    position: absolute;
    inset: 0;
    background-image:
        linear-gradient(rgba(247,247,247,0.025) 1px, transparent 1px),
        linear-gradient(90deg, rgba(247,247,247,0.025) 1px, transparent 1px);
    background-size: 32px 32px;
    -webkit-mask-image: radial-gradient(70% 70% at 50% 50%, #000, transparent 100%);
            mask-image: radial-gradient(70% 70% at 50% 50%, #000, transparent 100%);
    pointer-events: none;
}

/* Corner crops */
.hg-net .hg-crop {
    position: absolute;
    width: 14px;
    height: 14px;
    border: 1px solid var(--hg-orange);
    opacity: 0.55;
}
.hg-net .hg-crop.tl { top: 14px;    left: 14px;   border-right: 0; border-bottom: 0; }
.hg-net .hg-crop.tr { top: 14px;    right: 14px;  border-left: 0;  border-bottom: 0; }
.hg-net .hg-crop.bl { bottom: 14px; left: 14px;   border-right: 0; border-top: 0; }
.hg-net .hg-crop.br { bottom: 14px; right: 14px;  border-left: 0;  border-top: 0; }

/* Bottom stamp */
.hg-net .hg-stamp {
    position: absolute;
    bottom: 16px;
    left: 50%;
    transform: translateX(-50%);
    font-family: "SF Mono", "Fira Mono", monospace;
    font-size: 10px;
    letter-spacing: 0.22em;
    text-transform: uppercase;
    color: var(--hg-dim);
    white-space: nowrap;
}
.hg-net .hg-stamp::before,
.hg-net .hg-stamp::after { content: "·"; margin: 0 8px; color: var(--hg-orange); }

/* SVG lines layer */
.hg-net svg.hg-svg {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
}

/* Chips */
.hg-net .hg-chips { position: absolute; inset: 0; }
.hg-net .hg-chip {
    --ax: -50%;
    position: absolute;
    transform: translate(var(--ax), -50%);
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 7px 12px 7px 9px;
    background: rgba(20,21,23,0.92);
    border: 1px solid var(--hg-line2);
    border-radius: 100px;
    color: var(--hg-quiet);
    font-family: "SF Mono", "Fira Mono", monospace;
    font-size: 12px;
    letter-spacing: -0.01em;
    text-decoration: none;
    -webkit-backdrop-filter: blur(6px);
            backdrop-filter: blur(6px);
    cursor: pointer;
    transition:
        transform .35s cubic-bezier(0.22,1,0.36,1),
        color .25s,
        border-color .25s,
        background .25s,
        box-shadow .35s;
    white-space: nowrap;
    z-index: 2;
    animation: hg-bob 5s ease-in-out infinite;
}
.hg-net .hg-chip[data-anchor="left"]  { --ax: 0%;    }
.hg-net .hg-chip[data-anchor="right"] { --ax: -100%; }
.hg-net .hg-chip:nth-child(2n) { animation-duration: 6.2s; animation-delay: -1.8s; }
.hg-net .hg-chip:nth-child(3n) { animation-duration: 4.4s; animation-delay: -3.1s; }
.hg-net .hg-chip:nth-child(5n) { animation-duration: 7s;   animation-delay: -0.7s; }

@keyframes hg-bob {
    0%, 100% { transform: translate(var(--ax), -50%); }
    50%       { transform: translate(var(--ax), calc(-50% - 3px)); }
}

.hg-net .hg-chip .hg-glyph {
    display: inline-grid;
    place-items: center;
    width: 18px;
    height: 18px;
    border-radius: 5px;
    background: var(--hg-ink);
    border: 1px solid var(--hg-line2);
    color: var(--hg-mute);
    transition: color .25s, border-color .25s, background .25s;
}
.hg-net .hg-chip .hg-glyph svg { width: 11px; height: 11px; display: block; }
.hg-net .hg-chip .hg-name { color: var(--hg-quiet); }
.hg-net .hg-chip .hg-ext  { color: var(--hg-dim); }

.hg-net .hg-chip:hover,
.hg-net .hg-chip.active {
    color: var(--hg-paper);
    border-color: var(--hg-orange);
    background: rgba(255,150,38,0.10);
    transform: translate(var(--ax), -50%) scale(1.10);
    animation-play-state: paused;
    box-shadow: 0 0 0 1px rgba(255,150,38,0.55), 0 12px 36px -8px rgba(255,150,38,0.30);
    z-index: 4;
}
.hg-net .hg-chip:hover .hg-glyph,
.hg-net .hg-chip.active .hg-glyph {
    color: var(--hg-orange);
    border-color: rgba(255,150,38,0.55);
    background: rgba(255,150,38,0.10);
}
.hg-net .hg-chip:hover .hg-name,
.hg-net .hg-chip.active .hg-name { color: var(--hg-paper); }
.hg-net .hg-chip:hover .hg-ext,
.hg-net .hg-chip.active .hg-ext  { color: var(--hg-orange); }

/* Tooltip */
.hg-net .hg-chip[data-tip]::after {
    content: attr(data-tip);
    position: absolute;
    top: calc(100% + 8px);
    left: 50%;
    transform: translateX(-50%);
    background: var(--hg-ink);
    color: var(--hg-paper);
    font-family: "Inter", sans-serif;
    font-size: 10.5px;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    padding: 5px 9px;
    border-radius: 6px;
    border: 1px solid var(--hg-line2);
    opacity: 0;
    pointer-events: none;
    transition: opacity .2s;
    white-space: nowrap;
    z-index: 5;
}
.hg-net .hg-chip:hover::after { opacity: 1; }

/* Central node */
.hg-net .hg-node {
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    z-index: 3;
    display: grid;
    place-items: center;
}
.hg-net .hg-core {
    position: relative;
    padding: 18px 24px;
    background: var(--hg-ink);
    border: 1px solid var(--hg-orange);
    border-radius: 14px;
    box-shadow:
        0 0 0 1px rgba(255,150,38,0.20),
        0 0 60px -6px rgba(255,150,38,0.45),
        inset 0 1px 0 rgba(247,247,247,0.04);
    animation: hg-corePulse 3.2s ease-in-out infinite;
}
@keyframes hg-corePulse {
    0%, 100% {
        box-shadow:
            0 0 0 1px rgba(255,150,38,0.20),
            0 0 60px -6px rgba(255,150,38,0.45),
            inset 0 1px 0 rgba(247,247,247,0.04);
        transform: scale(1);
    }
    50% {
        box-shadow:
            0 0 0 1px rgba(255,150,38,0.30),
            0 0 80px -2px rgba(255,150,38,0.55),
            inset 0 1px 0 rgba(247,247,247,0.04);
        transform: scale(1.025);
    }
}

.hg-net .hg-lockup {
    display: inline-flex;
    align-items: baseline;
    font-family: "SF Mono", "Fira Mono", monospace;
    font-weight: 500;
    font-size: 28px;
    letter-spacing: -0.04em;
    line-height: 1;
}
.hg-net .hg-lockup .hg-prefix { color: var(--hg-orange); }
.hg-net .hg-lockup .hg-word   { color: var(--hg-paper); }
.hg-net .hg-lockup .hg-caret  {
    color: var(--hg-orange);
    margin-left: 2px;
    animation: hg-blink 1.1s steps(1) infinite;
}
@keyframes hg-blink { 50% { opacity: 0; } }

/* Pulse rings */
.hg-net .hg-ring {
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    border-radius: 999px;
    border: 1px solid rgba(255,150,38,0.22);
    pointer-events: none;
}
.hg-net .hg-ring.r1 { width: 180px; height: 180px; animation: hg-ringPulse 3.2s ease-in-out infinite; }
.hg-net .hg-ring.r2 { width: 260px; height: 260px; border-color: rgba(255,150,38,0.12); animation: hg-ringPulse 3.2s ease-in-out infinite .3s; }
.hg-net .hg-ring.r3 { width: 360px; height: 360px; border-color: rgba(255,150,38,0.06); animation: hg-ringPulse 3.2s ease-in-out infinite .6s; }
@keyframes hg-ringPulse {
    0%, 100% { opacity: 0.55; }
    50%       { opacity: 1; }
}

/* Lit state */
.hg-net.lit svg.hg-svg .hg-line { stroke-opacity: 0.85 !important; }
.hg-net.lit .hg-chip { color: var(--hg-paper); border-color: rgba(255,150,38,0.55); }

/* Travelling pulse dot */
.hg-net .hg-pulse {
    position: absolute;
    width: 10px;
    height: 10px;
    border-radius: 99px;
    background: var(--hg-orange);
    box-shadow: 0 0 12px var(--hg-orange), 0 0 28px rgba(255,150,38,0.55);
    transform: translate(-50%, -50%);
    pointer-events: none;
    z-index: 2;
    opacity: 0;
}
.hg-net .hg-pulse::after {
    content: "";
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    width: 26px;
    height: 26px;
    border-radius: 99px;
    background: radial-gradient(circle, rgba(255,150,38,0.55), transparent 65%);
}

/* Responsive */
@media (max-width: 640px) {
    .hg-net .hg-chip { font-size: 10.5px; padding: 5px 9px 5px 7px; }
    .hg-net .hg-chip .hg-glyph { width: 14px; height: 14px; }
    .hg-net .hg-chip .hg-glyph svg { width: 9px; height: 9px; }
    .hg-net .hg-core { padding: 12px 16px; }
    .hg-net .hg-lockup { font-size: 20px; }
    .hg-net .hg-ring.r1 { width: 130px; height: 130px; }
    .hg-net .hg-ring.r2 { width: 190px; height: 190px; }
    .hg-net .hg-ring.r3 { width: 260px; height: 260px; }
}
