.stack-jump-links {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem 1.1rem;
    margin-top: 1.5rem;
}

.stack-jump-links a {
    text-decoration: underline;
    text-underline-offset: 0.25em;
}

.home-network {
    --network-ethernet: #2863a3;
    --network-coax: #94601a;
    --network-power: #27724b;
    --network-surface: #f0f2f4;
    --network-node: #fafafa;
    scroll-margin-top: 2rem;
}

.home-network > p {
    margin-top: 0.75rem;
    color: var(--muted);
}

.network-figure {
    margin-top: 1.75rem;
    padding: 1.5rem;
    background: var(--network-surface);
    border-radius: 16px;
}

.network-figure h3 {
    max-width: 30ch;
    font-size: 1.15rem;
    line-height: 1.4;
    text-wrap: balance;
}

.network-topology {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 52px minmax(0, 1fr);
    grid-template-rows: 76px 48px 76px 48px 76px 48px 76px 52px;
    margin: 1.75rem 0 1.25rem;
}

.network-node {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    min-width: 0;
    padding: 0.7rem;
    border: 1px solid var(--border);
    border-radius: 12px;
    background: var(--network-node);
    text-decoration: none;
    color: var(--fg);
}

a.network-node:hover {
    border-color: var(--network-ethernet);
}

.network-node strong,
.network-node span {
    display: block;
}

.network-node strong {
    font-size: 0.9rem;
    font-weight: 600;
    line-height: 1.3;
}

.network-node span {
    margin-top: 0.2rem;
    color: var(--muted);
    font-size: 0.75rem;
    line-height: 1.35;
}

.network-node svg {
    flex: 0 0 28px;
    width: 28px;
    height: 28px;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.5;
    stroke-linejoin: round;
    stroke-linecap: round;
}

.network-port {
    width: 24px;
    height: 24px;
    flex: 0 0 24px;
    margin: 0 2px;
    border: 2px solid var(--network-coax);
    border-radius: 50%;
    position: relative;
}

.network-port::after {
    content: "";
    position: absolute;
    inset: 7px;
    border-radius: 50%;
    background: var(--network-coax);
}

.network-gateway { grid-area: 1 / 1; }
.network-wan { grid-area: 2 / 1; }
.network-router { grid-area: 3 / 1; }
.network-lan { grid-area: 4 / 1; }
.network-switch { grid-area: 5 / 1; }
.network-to-coax { grid-area: 6 / 1; }
.network-moca-a { grid-area: 7 / 1; }
.network-coax { grid-area: 8 / 1 / 9 / 4; }
.network-moca-b { grid-area: 7 / 3; }
.network-from-coax { grid-area: 4 / 3 / 7 / 4; }
.network-injector { grid-area: 3 / 3; }
.network-poe-wire { grid-area: 2 / 3; }
.network-ap { grid-area: 1 / 3; }

.network-wire {
    position: relative;
    display: flex;
    justify-content: center;
    align-items: center;
    color: var(--network-ethernet);
    font-size: 0.7rem;
    line-height: 1.2;
}

.network-wire::before {
    content: "";
    position: absolute;
    top: 0;
    bottom: 0;
    left: calc(50% - 1px);
    width: 2px;
    background: currentColor;
}

.network-wire::after {
    content: "";
    position: absolute;
    left: calc(50% - 4px);
    bottom: 3px;
    width: 6px;
    height: 6px;
    border-right: 2px solid currentColor;
    border-bottom: 2px solid currentColor;
    transform: rotate(45deg);
}

.network-wire span {
    z-index: 1;
    padding: 0.25rem 0.4rem;
    background: var(--network-surface);
}

.network-wire-up::after {
    top: 3px;
    bottom: auto;
    transform: rotate(225deg);
}

.network-poe-wire { color: var(--network-power); }
.network-coax { color: var(--network-coax); }

.network-coax::before {
    top: 0;
    bottom: 12px;
    left: calc(25% - 13px);
    right: calc(25% - 13px);
    width: auto;
    background: none;
    border: 2px solid currentColor;
    border-top: 0;
    border-radius: 0 0 12px 12px;
}

.network-coax::after {
    left: auto;
    right: calc(25% - 17px);
    top: 3px;
    bottom: auto;
    transform: rotate(225deg);
}

.network-coax span {
    position: absolute;
    bottom: 2px;
    width: 8rem;
    text-align: center;
}

.network-figure figcaption {
    color: var(--muted);
    font-size: 0.8rem;
    line-height: 1.5;
}

.network-explainer { margin-top: 2rem; }
.network-explainer p { margin-top: 0.65rem; color: var(--muted); }
.network-gear-heading { margin-top: 2rem; }
.network-gear { margin-top: 0.5rem; }
.network-gear > div { padding: 1rem 0; border-bottom: 1px solid var(--border); scroll-margin-top: 2rem; }
.network-gear dt { display: flex; align-items: baseline; justify-content: space-between; gap: 1rem; font-weight: 600; }
.network-gear a { text-underline-offset: 0.2em; }
.network-quantity { flex-shrink: 0; color: var(--muted); font-size: 0.85rem; font-weight: 400; font-variant-numeric: tabular-nums; }
.network-gear dd { margin-top: 0.35rem; color: var(--muted); font-size: 0.9rem; }
.network-gear > div:target { background: var(--network-surface); outline: 8px solid var(--network-surface); }
.home-network a:focus-visible, .stack-jump-links a:focus-visible { outline: 2px solid var(--network-ethernet, currentColor); outline-offset: 4px; }
.home-network ::selection { background: var(--network-ethernet); color: #fff; }

@media (prefers-color-scheme: dark) {
    .home-network {
        --network-ethernet: #86b6ed;
        --network-coax: #d6ad68;
        --network-power: #80cba4;
        --network-surface: #22272c;
        --network-node: #1a1a1a;
    }
}

@media (max-width: 540px) {
    .network-figure { padding: 1.25rem; }
    .network-topology { grid-template-columns: minmax(0, 1fr); grid-template-rows: none; margin-top: 1.25rem; }
    .network-topology > * { grid-area: auto; }
    .network-node { padding: 0.8rem 1rem; }
    .network-node strong { font-size: 0.95rem; }
    .network-node span { font-size: 0.8rem; }
    .network-wire { height: 42px; }
    .network-wire span { font-size: 0.75rem; }
    .network-wire-up::after, .network-coax::after { top: auto; bottom: 3px; left: calc(50% - 4px); right: auto; transform: rotate(45deg); }
    .network-coax::before { top: 0; bottom: 0; left: calc(50% - 1px); right: auto; width: 2px; height: auto; border: 0; border-radius: 0; background: currentColor; }
    .network-coax span { position: relative; bottom: auto; width: auto; }
}
