/* Torzon Directory — header Tor circuit strip */

:root {
  --circuit-h: 46px;
}

html:has(body.site-theme) {
  scroll-padding-top: calc(var(--site-chrome-h, 132px) + 12px);
}

/* .layout / .sidebar offset for unified header → mobile-parity.css (--site-chrome-h) */

@media (max-width: 768px) {
  :root {
    --circuit-h: 38px;
  }

  body.site-theme .header-circuit {
    display: block;
    padding: 8px 12px 10px;
  }

  .header-circuit__inner {
    flex-wrap: nowrap;
    overflow-x: auto;
    scrollbar-width: none;
    gap: 8px;
  }

  .header-circuit__inner::-webkit-scrollbar {
    display: none;
  }

  .header-circuit__label {
    font-size: 10px;
    letter-spacing: 0.05em;
  }

  .header-circuit__hop--b .header-circuit__label {
    max-width: 4.5rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }
}

body.site-theme .topbar,
body.site-theme .layout,
body.site-theme .footer {
  position: relative;
  z-index: 2;
}

body.site-theme .header.header--unified {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 110;
}

body.site-theme .header:not(.header--unified) {
  position: relative;
  z-index: 2;
}

.header-circuit {
  border-top: none;
  border-bottom: none;
  background: linear-gradient(180deg, rgba(16, 26, 44, 0.95), rgba(8, 12, 22, 0.9));
  padding: 10px 18px 12px;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.05),
    0 6px 20px rgba(0, 0, 0, 0.25);
}

.header-circuit__inner {
  max-width: 1440px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  min-height: calc(var(--circuit-h) - 22px);
}

.header-circuit__badge {
  font-family: var(--mono);
  font-size: 9px;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: #7a94c4;
  padding: 3px 8px;
  border-radius: 999px;
  border: 1px solid rgba(100, 125, 165, 0.28);
  background: rgba(70, 95, 145, 0.08);
  flex-shrink: 0;
}

.header-circuit__flow {
  display: flex;
  align-items: center;
  gap: 0;
  flex: 1 1 auto;
  min-width: 0;
  justify-content: center;
}

.header-circuit__hop {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
}

.header-circuit__node {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: rgba(110, 165, 235, 0.85);
  box-shadow: 0 0 12px rgba(100, 160, 230, 0.55);
}

.header-circuit__hop--c .header-circuit__node {
  background: rgba(90, 140, 210, 0.9);
  box-shadow: 0 0 14px rgba(80, 130, 200, 0.5);
}

.header-circuit__label {
  font-family: var(--mono);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #b4c8e4;
  white-space: nowrap;
}

.header-circuit__link {
  position: relative;
  flex: 1 1 56px;
  max-width: 148px;
  min-width: 40px;
  height: 3px;
  margin: 0 10px;
}

.header-circuit__wire {
  display: block;
  height: 2px;
  border-radius: 1px;
  background: linear-gradient(
    90deg,
    rgba(80, 120, 180, 0.12),
    rgba(120, 170, 230, 0.55),
    rgba(80, 120, 180, 0.12)
  );
}

.header-circuit__packet {
  position: absolute;
  top: -3px;
  left: 0;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #7a94c4;
  box-shadow: 0 0 10px rgba(100, 130, 180, 0.45);
  animation: circuit-packet 3.2s ease-in-out infinite;
}

.header-circuit__packet--delay {
  animation-delay: 1.1s;
  background: #5a7098;
  box-shadow: 0 0 10px rgba(70, 95, 145, 0.4);
}

.header-circuit.is-copy-burst .header-circuit__packet {
  animation-duration: 0.85s;
}

@keyframes circuit-packet {
  0% {
    left: 0;
    opacity: 0;
  }
  8% {
    opacity: 1;
  }
  92% {
    opacity: 1;
  }
  100% {
    left: calc(100% - 6px);
    opacity: 0;
  }
}

.authority-strip {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 14px 0 0;
}

.authority-strip__item {
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  padding: 5px 10px;
  border-radius: 999px;
  border: 1px solid rgba(100, 125, 165, 0.24);
  background: rgba(8, 12, 20, 0.75);
  color: #8a9cb8;
}

.page-intent {
  border-left: 3px solid rgba(100, 130, 180, 0.45);
  padding-left: 14px;
  margin: 0 0 1rem;
  color: var(--text);
  font-size: 14px;
  font-weight: 500;
}

@media (prefers-reduced-motion: reduce) {
  .header-circuit__packet {
    animation: none;
  }
}
