.nodes-hero {
  position: relative;
  overflow-x: clip;
  padding-top: 76px;
  padding-bottom: 82px;
  border-bottom: 1px solid var(--border-soft);
  background:
    radial-gradient(720px 460px at 18% 8%, color-mix(in srgb, var(--color-panel-raised) 72%, transparent), transparent 72%),
    radial-gradient(660px 520px at 92% 62%, color-mix(in srgb, var(--color-panel) 88%, transparent), transparent 74%),
    var(--color-bg);
}

.nodes-hero::before {
  content: '';
  position: absolute;
  inset: 0;
  pointer-events: none;
  opacity: 0.38;
  background-image:
    linear-gradient(var(--grid-soft) 1px, transparent 1px),
    linear-gradient(90deg, var(--grid-soft) 1px, transparent 1px);
  background-size: 46px 46px;
  mask-image: linear-gradient(to bottom, var(--color-black), transparent 86%);
}

.nodes-hero-layout {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: minmax(0, 1.04fr) minmax(420px, 0.96fr);
  align-items: center;
  gap: 62px;
}

.nodes-hero-copy h1 {
  max-width: 9em;
  margin-top: 20px;
  margin-bottom: 22px;
}

.nodes-hero-lead {
  max-width: 38em;
  margin-bottom: 25px;
  color: var(--color-text-muted);
  font-size: 18px;
}

.nodes-fact-row {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px 0;
  padding-top: 20px;
  border-top: 1px dashed var(--color-border);
  color: var(--color-text-muted);
  font-size: 13px;
}

.nodes-fact-row span {
  display: inline-flex;
  align-items: baseline;
  gap: 5px;
}

.nodes-fact-row span + span::before {
  content: '';
  width: 4px;
  height: 4px;
  flex: 0 0 auto;
  margin-inline: 13px;
  border-radius: var(--radius-pill);
  background: var(--color-accent);
}

.nodes-fact-row strong {
  color: var(--color-text);
  font-family: var(--font-mono);
  font-weight: 700;
}

.route-console {
  min-height: 490px;
  background:
    linear-gradient(var(--grid-soft) 1px, transparent 1px),
    linear-gradient(90deg, var(--grid-soft) 1px, transparent 1px),
    var(--color-panel);
  background-size: 28px 28px;
}

.route-console::before {
  content: '';
  position: absolute;
  inset: 14px;
  pointer-events: none;
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-medium);
}

.route-console-head,
.route-console-foot {
  position: relative;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-family: var(--font-mono);
  letter-spacing: 0.08em;
}

.route-console-head {
  padding: 25px 28px 5px;
}

.route-console-code {
  color: var(--color-text-muted);
  font-size: 11px;
}

.route-console-state {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--color-success);
  font-size: 11px;
}

.route-console-state i {
  width: 7px;
  height: 7px;
  flex: 0 0 auto;
  border-radius: var(--radius-pill);
  background: var(--color-success);
  box-shadow: 0 0 0 5px color-mix(in srgb, var(--color-success) 12%, transparent);
}

.route-console-map {
  position: relative;
  z-index: 1;
  width: 100%;
  height: auto;
  display: block;
  padding-inline: 12px;
  color: var(--color-wave);
}

.route-grid-line {
  fill: none;
  stroke: var(--grid-strong);
  stroke-width: 1;
}

.route-trunk,
.route-branch {
  fill: none;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.route-trunk {
  stroke: var(--color-wave);
  stroke-width: 2.2;
}

.route-trunk-soft {
  stroke: color-mix(in srgb, var(--color-wave) 20%, transparent);
  stroke-width: 12;
}

.route-branch {
  stroke: color-mix(in srgb, var(--color-text-muted) 68%, var(--color-border));
  stroke-width: 1.4;
  stroke-dasharray: 6 8;
}

.route-node {
  fill: var(--color-wave);
}

.route-node-halo {
  fill: color-mix(in srgb, var(--color-wave) 18%, transparent);
}

.route-terminal {
  fill: var(--color-panel);
  stroke: var(--color-text-muted);
  stroke-width: 2;
}

.route-console-labels {
  position: absolute;
  right: 28px;
  bottom: 62px;
  left: 28px;
  z-index: 2;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 7px;
}

.route-console-labels span {
  min-width: 0;
  padding: 7px 8px;
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-small);
  color: var(--color-text-muted);
  background: var(--panel-glass);
  font-family: var(--font-mono);
  font-size: 10px;
  text-align: center;
}

.route-console-foot {
  position: absolute;
  right: 28px;
  bottom: 25px;
  left: 28px;
  color: var(--color-text-muted);
  font-size: 10px;
}

.nodes-content {
  position: relative;
}

.nodes-content > .shell {
  position: relative;
}

.nodes-content .toc-tabs {
  top: 10px;
  margin-top: 28px;
  margin-bottom: 0;
}

.nodes-section {
  position: relative;
}

.nodes-section.section-soft {
  margin-inline: calc(var(--gutter) * -1);
  padding-right: var(--gutter);
  padding-left: var(--gutter);
  border-inline: 1px solid var(--border-soft);
  border-radius: var(--radius-large);
}

.section-heading {
  display: grid;
  grid-template-columns: minmax(0, 0.9fr) minmax(320px, 0.7fr);
  align-items: end;
  gap: 48px;
  margin-bottom: 34px;
}

.section-heading h2 {
  margin-bottom: 0;
}

.section-heading > p {
  margin: 0;
  color: var(--color-text-muted);
}

.route-type,
.stream-state {
  max-width: 100%;
  min-height: 27px;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  overflow: hidden;
  padding: 4px 10px;
  border-radius: var(--radius-pill);
  font-family: var(--font-mono);
  font-size: 11px;
  line-height: 1.3;
}

.route-type {
  color: var(--color-wave);
  border: 1px solid var(--color-border);
  background: var(--color-panel-raised);
}

.stream-state {
  color: var(--color-success);
  border: 1px solid color-mix(in srgb, var(--color-success) 38%, var(--color-border));
  background: color-mix(in srgb, var(--color-success) 8%, var(--color-panel));
}

.stream-state::before {
  content: '';
  width: 6px;
  height: 6px;
  flex: 0 0 auto;
  border-radius: var(--radius-pill);
  background: currentColor;
}

.stream-state-caution {
  color: var(--color-warning);
  border-color: color-mix(in srgb, var(--color-warning) 38%, var(--color-border));
  background: color-mix(in srgb, var(--color-warning) 7%, var(--color-panel));
}

.route-notes {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
  margin-top: 22px;
}

.route-notes > div {
  padding: 20px;
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-medium);
  background: var(--panel-soft);
}

.route-notes strong {
  color: var(--color-text);
}

.route-notes p {
  margin: 8px 0 0;
  color: var(--color-text-muted);
  font-size: 14px;
}

.topology-ledger {
  display: grid;
  gap: 0;
  border-top: 1px solid var(--border-soft);
}

.topology-row {
  min-width: 0;
  display: grid;
  grid-template-columns: 118px minmax(0, 1fr) 180px;
  align-items: center;
  gap: 32px;
  padding-top: 34px;
  padding-bottom: 34px;
  border-bottom: 1px dashed var(--color-border);
  transform-style: preserve-3d;
}

.topology-row:nth-child(even) {
  margin-left: 6%;
}

.topology-index {
  display: flex;
  align-items: center;
  gap: 13px;
  color: var(--color-text-muted);
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.07em;
}

.topology-copy h3 {
  margin-bottom: 12px;
}

.topology-copy p {
  margin-bottom: 12px;
  color: var(--color-text-muted);
}

.topology-copy p:last-child {
  margin-bottom: 0;
}

.topology-sketch {
  width: 180px;
  height: 110px;
  color: var(--color-text-muted);
}

.topology-sketch path,
.topology-sketch circle {
  fill: none;
  stroke: currentColor;
  stroke-width: 1.5;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.use-grid {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 16px;
}

.use-card {
  min-width: 0;
  padding: 26px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-large);
  background:
    linear-gradient(145deg, color-mix(in srgb, var(--color-panel-raised) 52%, transparent), transparent 58%),
    var(--color-panel);
}

.use-card:nth-child(1),
.use-card:nth-child(2),
.use-card:nth-child(3) {
  grid-column: span 2;
}

.use-card:nth-child(4),
.use-card:nth-child(5) {
  grid-column: span 3;
}

.use-code {
  display: inline-flex;
  margin-bottom: 20px;
  color: var(--color-accent);
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.1em;
}

.use-card h3 {
  font-size: 23px;
}

.use-card p,
.use-card li {
  color: var(--color-text-muted);
}

.use-card ul {
  display: grid;
  gap: 8px;
  margin: 20px 0 0;
  padding: 18px 0 0;
  border-top: 1px dashed var(--color-border);
  list-style: none;
}

.use-card li {
  position: relative;
  padding-left: 17px;
  font-size: 14px;
}

.use-card li::before {
  content: '';
  position: absolute;
  top: 0.72em;
  left: 0;
  width: 6px;
  height: 6px;
  border-radius: var(--radius-pill);
  background: var(--color-accent);
}

.switch-ledger {
  display: grid;
  gap: 0;
  margin: 0;
  padding: 0;
  list-style: none;
  counter-reset: switch-step;
}

.switch-ledger li {
  position: relative;
  min-height: 130px;
  display: grid;
  grid-template-columns: 94px minmax(0, 1fr);
  gap: 26px;
  padding-top: 26px;
  padding-bottom: 26px;
  border-bottom: 1px solid var(--border-soft);
  counter-increment: switch-step;
}

.switch-ledger li::before {
  content: counter(switch-step, decimal-leading-zero);
  width: 54px;
  height: 54px;
  display: grid;
  place-items: center;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-small);
  color: var(--color-bg);
  background: var(--color-accent);
  font-family: var(--font-mono);
  font-size: 13px;
  font-weight: 800;
}

.switch-ledger li::after {
  content: '';
  position: absolute;
  top: 80px;
  bottom: -1px;
  left: 27px;
  border-left: 1px dashed var(--color-border);
}

.switch-ledger li:last-child::after {
  display: none;
}

.switch-ledger h3 {
  margin-bottom: 9px;
  font-size: 22px;
}

.switch-ledger p {
  max-width: 58em;
  margin: 0;
  color: var(--color-text-muted);
}

.boundary-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

.boundary-grid article {
  position: relative;
  padding: 28px 28px 28px 34px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-medium);
  background: var(--color-panel);
}

.boundary-grid article::before {
  content: '';
  position: absolute;
  top: 30px;
  bottom: 30px;
  left: 0;
  width: 4px;
  border-radius: 0 var(--radius-pill) var(--radius-pill) 0;
  background: var(--color-accent);
}

.boundary-grid h3 {
  font-size: 21px;
}

.boundary-grid p {
  margin: 0;
  color: var(--color-text-muted);
}

.access-panel {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 34px;
  margin-top: 42px;
  padding: 34px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-large);
  background:
    radial-gradient(400px 190px at 88% 0%, color-mix(in srgb, var(--color-accent) 11%, transparent), transparent 72%),
    var(--color-panel-raised);
  box-shadow: var(--shadow-card);
}

.access-label {
  margin-bottom: 8px;
  color: var(--color-accent);
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.12em;
}

.access-panel h3 {
  margin-bottom: 10px;
}

.access-panel p:last-child {
  max-width: 48em;
  margin-bottom: 0;
  color: var(--color-text-muted);
}

.access-actions {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
}

@media (max-width: 1080px) {
  .nodes-hero-layout {
    grid-template-columns: minmax(0, 1fr) minmax(380px, 0.82fr);
    gap: 40px;
  }

  .route-console {
    min-height: 450px;
  }

  .topology-row {
    grid-template-columns: 104px minmax(0, 1fr) 150px;
    gap: 22px;
  }

  .topology-sketch {
    width: 150px;
  }

  .use-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .use-card:nth-child(1),
  .use-card:nth-child(2),
  .use-card:nth-child(3),
  .use-card:nth-child(4),
  .use-card:nth-child(5) {
    grid-column: auto;
  }

  .use-card:last-child {
    grid-column: 1 / -1;
  }
}

@media (max-width: 860px) {
  .nodes-hero {
    padding-top: 52px;
    padding-bottom: 64px;
  }

  .nodes-hero-layout {
    grid-template-columns: 1fr;
  }

  .nodes-hero-copy h1 {
    max-width: 11em;
  }

  .route-console {
    width: 100%;
    max-width: 620px;
    min-height: 440px;
    margin-inline: auto;
  }

  .section-heading {
    grid-template-columns: 1fr;
    align-items: start;
    gap: 16px;
  }

  .route-notes {
    grid-template-columns: 1fr;
  }

  .topology-row,
  .topology-row:nth-child(even) {
    grid-template-columns: 96px minmax(0, 1fr);
    margin-left: 0;
  }

  .topology-sketch {
    grid-column: 2;
  }

  .access-panel {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 640px) {
  .nodes-hero {
    padding-top: 42px;
    padding-bottom: 52px;
  }

  .nodes-hero-lead {
    font-size: 16px;
  }

  .nodes-fact-row {
    align-items: flex-start;
    flex-direction: column;
    gap: 8px;
  }

  .nodes-fact-row span + span::before {
    margin-right: 13px;
    margin-left: 0;
  }

  .route-console {
    min-height: 348px;
  }

  .route-console-head {
    padding: 21px 20px 0;
  }

  .route-console-map {
    margin-top: -8px;
  }

  .route-console-labels {
    right: 20px;
    bottom: 52px;
    left: 20px;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .route-console-labels span:nth-child(3),
  .route-console-labels span:nth-child(4) {
    display: none;
  }

  .route-console-foot {
    right: 20px;
    bottom: 21px;
    left: 20px;
  }

  .nodes-content .toc-tabs {
    margin-top: 18px;
  }

  .nodes-section.section-soft {
    margin-inline: calc(var(--gutter) * -1);
    border-inline: 0;
    border-radius: 0;
  }

  .topology-row,
  .topology-row:nth-child(even) {
    grid-template-columns: 52px minmax(0, 1fr);
    gap: 14px;
  }

  .topology-index {
    align-self: start;
    flex-direction: column;
    gap: 8px;
    overflow-wrap: anywhere;
    writing-mode: vertical-rl;
  }

  .topology-sketch {
    width: 132px;
    height: 82px;
  }

  .use-grid,
  .boundary-grid {
    grid-template-columns: 1fr;
  }

  .use-card:last-child {
    grid-column: auto;
  }

  .switch-ledger li {
    grid-template-columns: 58px minmax(0, 1fr);
    gap: 14px;
  }

  .switch-ledger li::before {
    width: 44px;
    height: 44px;
  }

  .switch-ledger li::after {
    top: 70px;
    left: 22px;
  }

  .boundary-grid article {
    padding: 24px 22px 24px 28px;
  }

  .access-panel {
    padding: 26px 22px;
  }

  .access-actions {
    align-items: stretch;
    flex-direction: column;
  }

  .access-actions .btn-primary,
  .access-actions .btn-secondary {
    width: 100%;
  }
}

@media (prefers-reduced-motion: reduce) {
  .route-console-state i {
    box-shadow: none;
  }
}