.network {
  position: relative; isolation: isolate;
  background: radial-gradient(ellipse at 75% 48%, #192e2a, transparent 70%), #101b1e;
}
.network-terrain {
  position: absolute; inset: 0; z-index: -1; pointer-events: none;
  background: url(network-contours.svg) repeat;
  mask-image:
    radial-gradient(ellipse var(--field-width, 42%) var(--field-height, 44%) at var(--field-x, 72%) var(--field-y, 45%), #000 10%, #000c 65%, #0002 160%),
    linear-gradient(90deg, #0001, #000 12%, #000 88%, #0001),
    linear-gradient(#0001, #000 12%, #000 88%, #0001);
  mask-composite: intersect;
}
.network-terrain.rendered {background-image: none}
.network-terrain canvas {display: block; width: 100%; height: 100%}
.network-spread {
  display: grid;
  grid-template-columns: minmax(0, .8fr) minmax(0, 1.2fr);
  gap: 24px clamp(24px, 4vw, 72px);
  align-items: center;
}
.network-copy h2 {max-width: 13ch; margin-bottom: .35em}
.network-copy p:last-child {margin-bottom: 0}
.network-spread .note {grid-column: 1 / -1; margin: 0; padding-top: 16px; border-top: 1px solid var(--line)}
.network-figure {margin: 0; min-width: 0}
.network-figure figcaption {
  display: flex; justify-content: space-between; align-items: center; min-height: 42px;
  border-block-end: 1px solid #63917d59; color: var(--ice);
  font: .73rem/1.3 monospace; text-transform: uppercase; letter-spacing: .09em;
}
.network-motion {
  background: transparent; color: var(--muted); font: inherit; letter-spacing: 0;
  text-transform: none; border: 0; padding: 10px 4px; cursor: pointer;
}
.network-motion:hover {color: var(--lime)}
.network-scene {position: relative}
.topology {display: block; width: 100%; height: auto; overflow: visible}
.net-links {fill: none; stroke: #9dcab1; stroke-width: 1.5}
.net-links path:nth-child(n+3) {stroke: var(--ice); stroke-dasharray: 4 3}
.net-signals {fill: #ddff90; visibility: hidden; filter: drop-shadow(0 0 3px #beff75)}
.net-device {color: var(--ice)}
.net-device circle {fill: #102324; stroke: currentColor; stroke-width: 1.2}
.net-device use {fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linejoin: round}
.net-device.host {color: var(--lime)}
.net-device .net-halo {fill: #b6df6510; stroke-opacity: .38}
.net-device text {
  text-anchor: middle; fill: var(--ink); stroke: #102021; stroke-width: 4px; paint-order: stroke;
  font: 600 16px/1 Barlow, sans-serif;
}
.net-device .net-sub {fill: var(--lime); font: 12px monospace}
.cell-bars {fill: none; stroke: var(--lime); stroke-width: 2.5}
.cell-bars .no-cell {opacity: 0}
[data-mode="outage"] .cell-bars {stroke: #8d8171}
[data-mode="outage"] .no-cell {opacity: 1; stroke: #ffc08b}
[data-mode="outage"] .net-status {fill: #ffc08b}
[data-mode="join"] .net-device:last-child > circle {stroke-dasharray: 3 4}
[data-mode="online"] .net-device:last-child > circle,
[data-mode="recovery"] .net-device:last-child > circle {stroke: var(--lime); fill: #263d2a}
[data-mode="outage"] .net-links path:nth-child(3),
[data-mode="join"] .net-links path:nth-child(3) {stroke: #b6a48b; stroke-dasharray: 2 10; opacity: .58}
[data-mode="radio"] .cell-bars, [data-mode="nearby"] .cell-bars,
.net-links .net-inactive, .net-device.net-inactive {opacity: 0}
@media (prefers-reduced-motion: no-preference) {
  .net-device, .net-links path, .cell-bars, .cell-bars .no-cell, .net-device > circle {
    transition: opacity 380ms ease-out, stroke 320ms ease-out, fill 320ms ease-out, stroke-dasharray 320ms ease-out;
  }
  .net-chapters button {transition: background-color 200ms, color 200ms, border-color 200ms}
}
.net-story {border-top: 1px solid #63917d59; padding-top: 12px}
.net-chapters {display: flex; flex-wrap: wrap; gap: 4px}
.net-chapters button {
  border: 1px solid var(--line); background: transparent; color: var(--muted);
  font: inherit; font-size: .85rem; padding: 6px 10px; cursor: pointer;
}
.net-chapters button:hover, .net-chapters button[aria-pressed=true] {
  color: var(--lime); border-color: #839b67; background: #233125;
}
.net-story h3 {margin: 16px 0 4px; font-size: clamp(1.25rem, 2vw, 1.65rem)}
.network .net-story p {margin: 0; min-height: 4.8em}
@media (max-width: 800px) {
  .network-terrain {--field-x: 50%; --field-y: 55%}
  .network-spread {grid-template-columns: 1fr}
  .network-copy h2 {max-width: none}
}
@media (max-width: 480px) {
  .network .net-story p {min-height: 6.4em}
}
