/* Topology gallery + lightbox */
.topo-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1.25rem;
}

.topo-card {
  display: flex;
  flex-direction: column;
  text-align: left;
  background: var(--bg-panel);
  border: 1px solid var(--line);
  padding: 0;
  overflow: hidden;
  cursor: zoom-in;
  transition: border-color 0.3s, transform 0.3s var(--ease), box-shadow 0.3s;
  width: 100%;
}

.topo-card:hover,
.topo-card:focus-visible {
  border-color: var(--line-strong);
  transform: translateY(-3px);
  box-shadow: 0 16px 40px rgba(15, 40, 55, 0.08);
  outline: none;
}

.topo-thumb {
  position: relative;
  aspect-ratio: 16 / 10;
  background:
    radial-gradient(ellipse at 70% 30%, rgba(12, 155, 114, 0.08), transparent 55%),
    linear-gradient(180deg, #f0f5f7, #e8eef2);
  overflow: hidden;
  border-bottom: 1px solid var(--line);
}

.topo-thumb svg {
  width: 100%;
  height: 100%;
  display: block;
}

.topo-thumb-badge {
  position: absolute;
  top: 0.75rem;
  left: 0.75rem;
  z-index: 2;
  font-family: var(--font-mono);
  font-size: 0.65rem;
  letter-spacing: 0.1em;
  color: var(--accent);
  background: rgba(255, 255, 255, 0.85);
  border: 1px solid var(--line-strong);
  padding: 0.2rem 0.5rem;
  backdrop-filter: blur(6px);
}

.topo-zoom-hint {
  position: absolute;
  right: 0.75rem;
  bottom: 0.75rem;
  z-index: 2;
  font-family: var(--font-mono);
  font-size: 0.65rem;
  color: var(--text-dim);
  background: rgba(255, 255, 255, 0.8);
  padding: 0.25rem 0.5rem;
  border: 1px solid var(--line);
  opacity: 0;
  transform: translateY(4px);
  transition: opacity 0.25s, transform 0.25s;
}

.topo-card:hover .topo-zoom-hint,
.topo-card:focus-visible .topo-zoom-hint {
  opacity: 1;
  transform: translateY(0);
}

.topo-card-body {
  padding: 1.15rem 1.25rem 1.35rem;
}

.topo-card-body h3 {
  font-family: var(--font-display);
  font-size: 1.05rem;
  font-weight: 700;
  margin-bottom: 0.4rem;
  line-height: 1.35;
}

.topo-card-body p {
  font-size: 0.88rem;
  color: var(--text-muted);
  line-height: 1.6;
}

/* SVG topology animations */
.topo-svg .topo-grid-lines {
  stroke: rgba(12, 155, 114, 0.12);
  stroke-width: 1;
}

.topo-svg .topo-link {
  fill: none;
  stroke: rgba(12, 155, 114, 0.35);
  stroke-width: 1.5;
}

.topo-svg .topo-link-flow {
  fill: none;
  stroke: var(--accent);
  stroke-width: 1.8;
  stroke-dasharray: 6 10;
  stroke-linecap: round;
  animation: topo-dash 1.2s linear infinite;
  opacity: 0.85;
}

.topo-svg .topo-link-flow.delay-1 { animation-delay: 0.2s; }
.topo-svg .topo-link-flow.delay-2 { animation-delay: 0.4s; }
.topo-svg .topo-link-flow.delay-3 { animation-delay: 0.6s; }

@keyframes topo-dash {
  to { stroke-dashoffset: -32; }
}

.topo-svg .topo-packet {
  fill: var(--accent);
  filter: drop-shadow(0 0 4px rgba(12, 155, 114, 0.7));
}

.topo-svg .topo-node {
  fill: #fff;
  stroke: var(--accent);
  stroke-width: 1.5;
}

.topo-svg .topo-node-core {
  fill: rgba(12, 155, 114, 0.15);
  stroke: var(--accent);
  stroke-width: 1.2;
}

.topo-svg .topo-node-pulse {
  fill: none;
  stroke: var(--accent);
  stroke-width: 1;
  opacity: 0;
  transform-box: fill-box;
  transform-origin: center;
  animation: topo-pulse 2.4s ease-out infinite;
}

.topo-svg .topo-node-pulse.d2 { animation-delay: 0.8s; }
.topo-svg .topo-node-pulse.d3 { animation-delay: 1.6s; }

@keyframes topo-pulse {
  0% { transform: scale(1); opacity: 0.55; }
  100% { transform: scale(2.8); opacity: 0; }
}

.topo-svg .topo-label {
  fill: var(--text);
  font-family: var(--font-mono), monospace;
  font-size: 9px;
  font-weight: 500;
}

.topo-svg .topo-label-dim {
  fill: var(--text-dim);
  font-family: var(--font-mono), monospace;
  font-size: 7.5px;
}

.topo-svg .topo-hub {
  fill: rgba(12, 155, 114, 0.12);
  stroke: var(--accent);
  stroke-width: 1.5;
}

.topo-svg .topo-screen {
  fill: #0c1a22;
  stroke: var(--accent);
  stroke-width: 1.5;
}

.topo-svg .topo-screen-glow {
  fill: var(--accent);
  opacity: 0.35;
  animation: topo-blink 1.4s ease-in-out infinite;
}

@keyframes topo-blink {
  0%, 100% { opacity: 0.2; }
  50% { opacity: 0.55; }
}

.topo-svg .topo-scan {
  fill: none;
  stroke: rgba(12, 155, 114, 0.45);
  stroke-width: 1;
  animation: topo-scan 3s ease-in-out infinite;
}

@keyframes topo-scan {
  0%, 100% { transform: translateY(0); opacity: 0; }
  10% { opacity: 0.8; }
  50% { transform: translateY(48px); opacity: 0.5; }
  90% { opacity: 0; }
}

/* Lightbox */
.topo-lightbox {
  position: fixed;
  inset: 0;
  z-index: 2000;
  display: grid;
  place-items: center;
  padding: 1.5rem;
  background: rgba(10, 20, 28, 0.55);
  backdrop-filter: blur(10px);
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s, visibility 0.3s;
}

.topo-lightbox.open {
  opacity: 1;
  visibility: visible;
}

.topo-lightbox-panel {
  width: min(960px, 100%);
  max-height: min(90vh, 720px);
  background: var(--bg-panel);
  border: 1px solid var(--line-strong);
  box-shadow: 0 24px 80px rgba(8, 24, 36, 0.28);
  display: flex;
  flex-direction: column;
  transform: translateY(16px) scale(0.97);
  transition: transform 0.35s var(--ease);
  overflow: hidden;
}

.topo-lightbox.open .topo-lightbox-panel {
  transform: translateY(0) scale(1);
}

.topo-lightbox-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  padding: 1.15rem 1.35rem;
  border-bottom: 1px solid var(--line);
}

.topo-lightbox-head h3 {
  font-family: var(--font-display);
  font-size: 1.25rem;
  margin-bottom: 0.3rem;
}

.topo-lightbox-head p {
  font-size: 0.9rem;
  color: var(--text-muted);
}

.topo-lightbox-close {
  width: 40px;
  height: 40px;
  flex-shrink: 0;
  border: 1px solid var(--line);
  display: grid;
  place-items: center;
  font-size: 1.25rem;
  color: var(--text-muted);
  transition: color 0.2s, border-color 0.2s, background 0.2s;
}

.topo-lightbox-close:hover {
  color: var(--accent);
  border-color: var(--accent);
  background: var(--accent-dim);
}

.topo-lightbox-stage {
  position: relative;
  flex: 1;
  min-height: 320px;
  background:
    radial-gradient(ellipse at 50% 20%, rgba(12, 155, 114, 0.1), transparent 50%),
    linear-gradient(180deg, #eef4f7, #e4ebf0);
  padding: 1rem;
}

.topo-lightbox-stage svg {
  width: 100%;
  height: 100%;
  min-height: 360px;
}

.topo-lightbox-nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.85rem 1.25rem;
  border-top: 1px solid var(--line);
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--text-dim);
}

.topo-lightbox-nav button {
  padding: 0.45rem 0.9rem;
  border: 1px solid var(--line);
  color: var(--text-muted);
  transition: color 0.2s, border-color 0.2s;
}

.topo-lightbox-nav button:hover {
  color: var(--accent);
  border-color: var(--accent);
}

body.topo-open {
  overflow: hidden;
}

/* Hero LED topology showcase */
.hero-topo {
  position: relative;
  background: var(--bg-panel);
  border: 1px solid var(--line-strong);
  box-shadow:
    0 0 0 1px rgba(12, 155, 114, 0.06),
    0 20px 50px rgba(15, 40, 55, 0.1);
  overflow: hidden;
  cursor: zoom-in;
  transition: transform 0.35s var(--ease), box-shadow 0.35s;
}

.hero-topo:hover,
.hero-topo:focus-visible {
  transform: translateY(-4px);
  box-shadow:
    0 0 0 1px rgba(12, 155, 114, 0.18),
    0 28px 60px rgba(15, 40, 55, 0.14),
    0 0 40px rgba(12, 155, 114, 0.12);
  outline: none;
}

.hero-topo::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: linear-gradient(90deg, transparent, var(--accent), transparent);
  animation: scan-line 3s linear infinite;
  z-index: 2;
}

.hero-topo-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.9rem 1.1rem;
  border-bottom: 1px solid var(--line);
  background: linear-gradient(180deg, rgba(12, 155, 114, 0.06), transparent);
  position: relative;
  z-index: 1;
}

.hero-topo-live {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-family: var(--font-mono);
  font-size: 0.68rem;
  letter-spacing: 0.12em;
  color: var(--accent);
  margin-bottom: 0.25rem;
}

.hero-topo-live i {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 10px var(--accent);
  animation: blink 1.6s step-end infinite;
}

.hero-topo-head strong {
  display: block;
  font-family: var(--font-display);
  font-size: 1rem;
  font-weight: 700;
}

.hero-topo-zoom {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  color: var(--text-dim);
  border: 1px solid var(--line);
  padding: 0.3rem 0.55rem;
  white-space: nowrap;
  transition: color 0.2s, border-color 0.2s, background 0.2s;
}

.hero-topo:hover .hero-topo-zoom {
  color: var(--accent);
  border-color: var(--accent);
  background: var(--accent-dim);
}

.hero-topo-canvas {
  aspect-ratio: 16 / 10;
  background:
    radial-gradient(ellipse at 78% 35%, rgba(12, 155, 114, 0.12), transparent 45%),
    linear-gradient(180deg, #eef4f7, #e4ebf0);
}

.hero-topo-canvas svg {
  width: 100%;
  height: 100%;
  display: block;
}

.hero-topo-foot {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.75rem 1.1rem;
  border-top: 1px solid var(--line);
  font-family: var(--font-mono);
  font-size: 0.7rem;
  color: var(--text-dim);
  letter-spacing: 0.04em;
}

.hero-topo-foot span:last-child {
  color: var(--accent);
}

@media (max-width: 800px) {
  .topo-grid {
    grid-template-columns: 1fr;
  }

  .topo-lightbox-stage svg {
    min-height: 260px;
  }

  .hero-topo {
    margin-top: 0.5rem;
  }
}
