.system-map {
  background-color: var(--bg);
  background-image: radial-gradient(color-mix(in srgb, var(--line) 60%, transparent) 1px, transparent 1px);
  background-size: 22px 22px;
  color: var(--text);
  padding: 7rem 0;
  position: relative;
}

/* Fade the dot grid out toward the edges instead of a hard-edged tile —
   quieter, more considered than a uniform pattern edge-to-edge. */

.system-map::before {
  background: radial-gradient(ellipse 70% 60% at 50% 55%, transparent 0%, var(--bg) 78%);
  content: "";
  inset: 0;
  position: absolute;
}

.system-map__header {
  margin: 0 auto;
  max-width: 640px;
  padding: 0 1.5rem 3.5rem;
  position: relative;
  z-index: 1;
  text-align: center;
}

.system-map__eyebrow {
  background: color-mix(in srgb, var(--hub-accent) 16%, transparent);
  border-radius: 0;
  color: var(--hub-accent);
  display: inline-block;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  margin-bottom: 1.1em;
  padding: 0.4em 0.9em;
  text-transform: uppercase;
}

.system-map__headline {
  color: var(--text);
  font-family: var(--font-heading);
  font-size: clamp(2.2rem, 5vw, 4rem);
  line-height: 1.05;
  margin: 0 0 0.6em;
}

.system-map__subcopy {
  color: var(--muted);
  font-family: var(--font-body);
  font-size: 1rem;
  line-height: 1.6;
  margin: 0;
}

/* --------------------------------------------------- Desktop diagram --- */

/* Below ~900px this hands off to a vertical list instead (further down) —
   a horizontal-scroll version of this same wide diagram was tried and
   didn't hold up (clipped box text, and a sideways scroll on a flowchart
   is easy to miss on a phone), so the two stay genuinely separate again. */

.system-map__diagram-scroll {
  display: none;
  margin: 0 auto;
  max-width: 1640px;
  padding: 0 3vw;
  position: relative;
  z-index: 1;
}

.system-map__diagram {
  aspect-ratio: 2.3 / 1;
  margin: 0 auto;
  position: relative;
}

@media (min-width: 900px) {
  .system-map__diagram-scroll {
    display: block;
  }
  .system-map__list {
    display: none;
  }
}

.system-map__line {
  background: none;
  position: absolute;
}

.system-map__line--h {
  border-top: 1px dotted var(--line);
  left: var(--x);
  top: var(--top);
  transform-origin: var(--origin, center);
  width: var(--w);
}

.system-map__line--v {
  border-left: 1px dotted var(--line);
  height: var(--h);
  left: var(--x);
  top: var(--top);
  transform-origin: var(--origin, center);
}

/* Build-out animation: hidden by default only once module.js confirms it can
   run the sequence (adds .is-ready) — no JS, no ScrollTrigger, and the
   diagram still renders fully assembled, never blank. */

.system-map.is-ready .system-map__hub {
  opacity: 0;
  transform: translate(-50%, -50%) scale(0.7);
}

.system-map.is-ready .system-map__box,
.system-map.is-ready .system-map__icons {
  opacity: 0;
}

.system-map.is-ready .system-map__box {
  transform: translate(-50%, -50%) scale(0.85);
}

.system-map.is-ready .system-map__line--h {
  transform: scaleX(0);
}

.system-map.is-ready .system-map__line--v {
  transform: scaleY(0);
}

.system-map__box {
  background: var(--box-bg);
  backdrop-filter: blur(14px) saturate(160%);
  -webkit-backdrop-filter: blur(14px) saturate(160%);
  border: 1px solid var(--box-border);
  border-radius: 0;
  box-shadow: 0 10px 24px -14px rgba(0, 0, 0, 0.55);
  left: var(--x);
  padding: 0.6rem 1rem;
  position: absolute;
  text-align: center;
  top: var(--top);
  transform: translate(-50%, -50%);
  transition: box-shadow 0.25s ease, border-color 0.25s ease, background-color 0.25s ease;
  white-space: nowrap;
  z-index: 1;
}

.system-map__box:hover {
  background: rgba(255, 255, 255, 0.03);
  border-color: color-mix(in srgb, var(--hub-accent) 55%, transparent);
  box-shadow: 0 14px 30px -12px rgba(0, 0, 0, 0.65);
}

@supports not (backdrop-filter: blur(1px)) {
  .system-map__box {
    background: color-mix(in srgb, var(--box-bg-solid) 55%, var(--bg));
  }
}

.system-map__box-label {
  color: var(--box-text);
  display: block;
  font-family: var(--font-mono);
  font-size: 0.78rem;
  font-weight: 600;
}

.system-map__box-caption {
  color: color-mix(in srgb, var(--box-text) 70%, transparent);
  display: block;
  font-family: var(--font-body);
  font-size: 0.68rem;
  margin-top: 0.15em;
}

.system-map__hub {
  background: var(--bg);
  border: 1.5px solid var(--hub-accent);
  border-radius: 0;
  box-shadow: 0 0 0 6px color-mix(in srgb, var(--hub-accent) 8%, transparent), 0 16px 34px -16px rgba(0, 0, 0, 0.7);
  left: var(--x);
  padding: 0.9rem 1.6rem;
  position: absolute;
  text-align: center;
  top: var(--top);
  transform: translate(-50%, -50%);
  white-space: nowrap;
  z-index: 2;
}

.system-map__hub-label {
  color: var(--hub-accent);
  display: block;
  font-family: var(--font-mono);
  font-size: 0.85rem;
  font-weight: 700;
  letter-spacing: 0.02em;
}

.system-map__hub-sublabel {
  color: var(--muted);
  display: block;
  font-family: var(--font-body);
  font-size: 0.7rem;
  margin-top: 0.2em;
}

.system-map__icons {
  display: grid;
  gap: 0.3rem;
  grid-template-columns: repeat(2, 1fr);
  left: var(--x);
  position: absolute;
  top: var(--top);
  transform: translate(-50%, -50%);
  z-index: 1;
}

.system-map__icons--single {
  display: block;
}

.system-map__icon {
  align-items: center;
  background: color-mix(in srgb, var(--box-bg) 22%, var(--bg));
  border: 1px solid color-mix(in srgb, var(--line) 140%, transparent);
  border-radius: 0;
  color: var(--muted);
  display: flex;
  font-family: var(--font-mono);
  font-size: 0.62rem;
  height: 26px;
  justify-content: center;
  width: 26px;
}

/* --------------------------------------------------------- Mobile list -- */

/* Mobile reads as one flowing system, not an arbitrary list — each step
   keeps the same glass treatment as the desktop boxes, joined by a short
   dotted connector, same visual language as the flowchart above.

   Explicitly gated to <900px here too, not left to rely on cascade order
   against the @media (min-width: 900px) block above that hides it — this
   exact rule used to sit un-gated and later in the file, which won the
   specificity tie and made the list render on desktop too, alongside the
   diagram. */

@media (max-width: 899px) {
  .system-map__list {
    display: grid;
    gap: 1.6rem;
    margin: 0 auto;
    max-width: 640px;
    padding: 0 1.5rem;
    position: relative;
    z-index: 1;
  }
}

.system-map__list li {
  background: var(--box-bg);
  backdrop-filter: blur(14px) saturate(160%);
  -webkit-backdrop-filter: blur(14px) saturate(160%);
  border: 1px solid var(--box-border);
  border-radius: 0;
  color: var(--box-text);
  font-family: var(--font-mono);
  font-size: 0.86rem;
  padding: 0.9rem 1.1rem;
  position: relative;
}

.system-map__list li:not(:first-child)::before {
  border-left: 1px dotted var(--line);
  content: "";
  height: 1.6rem;
  left: 1.4rem;
  position: absolute;
  top: -1.6rem;
}

.system-map__list-hub {
  border-color: var(--hub-accent) !important;
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--hub-accent) 14%, transparent);
}

@supports not (backdrop-filter: blur(1px)) {
  .system-map__list li {
    background: color-mix(in srgb, var(--box-bg-solid) 45%, var(--bg));
  }
}

.system-map__list-tag {
  color: var(--muted);
  display: block;
  font-size: 0.68rem;
  letter-spacing: 0.05em;
  margin-bottom: 0.3em;
  text-transform: uppercase;
}

/* --------------------------------------------------------- Traveler --- */

/* A small figure that walks the network once it's built — desktop only,
   position set entirely by module.js (GSAP tweens left/top as percentages
   of .system-map__diagram, the same coordinate space every box and line
   already uses). Hidden until JS actually starts it, so nothing shows if
   GSAP never loads or reduced-motion is on. */

.system-map__traveler {
  display: none;
  pointer-events: none;
  position: absolute;
  transform: translate(-50%, -100%);
  z-index: 6;
}

.system-map__traveler.is-active {
  display: block;
}

.system-map__traveler-figure {
  animation: system-map-walk 0.42s ease-in-out infinite alternate;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.system-map__traveler-head {
  background: var(--hub-accent);
  border-radius: 50%;
  box-shadow: 0 0 8px 2px color-mix(in srgb, var(--hub-accent) 55%, transparent);
  height: 7px;
  margin-bottom: 1px;
  width: 7px;
}

.system-map__traveler-body {
  border-left: 5px solid transparent;
  border-right: 5px solid transparent;
  border-top: 10px solid var(--hub-accent);
  height: 0;
  opacity: 0.9;
  width: 0;
}

@keyframes system-map-walk {
  from { transform: translateY(0); }
  to { transform: translateY(-2px); }
}

@media (max-width: 899px) {
  .system-map__traveler {
    display: none !important;
  }
}

