/* CASCODE — fixed pagination and telemetry HUD */
.cascode-frame {
  position: fixed;
  z-index: 40;
  inset: 74px 10px 10px;
  border: 1px solid rgba(255,255,255,.1);
  pointer-events: none;
}

.cascode-frame::before,
.cascode-frame::after {
  content: "+";
  position: absolute;
  color: rgba(244,242,236,.72);
  font: 10px/1 var(--font-mono, monospace);
}

.cascode-frame::before { left: -4px; top: -5px; }
.cascode-frame::after { right: -4px; bottom: -5px; }

.cascode-pager {
  --pager-progress: 0;
  position: fixed;
  z-index: 42;
  left: 18px;
  top: 50%;
  display: grid;
  grid-template-columns: 12px auto;
  align-items: center;
  gap: 12px;
  height: min(360px, 48vh);
  transform: translateY(-50%);
  pointer-events: auto;
}

.cascode-pager__track {
  position: relative;
  width: 1px;
  height: 100%;
  background: rgba(255,255,255,.16);
}

.cascode-pager__fill {
  position: absolute;
  inset: 0;
  background: #5de7c5;
  transform: scaleY(var(--pager-progress));
  transform-origin: top;
  box-shadow: 0 0 12px rgba(93,231,197,.45);
}

.cascode-pager__thumb {
  position: absolute;
  left: -3px;
  top: calc(var(--pager-progress) * 100%);
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #f4f2ec;
  transform: translateY(-50%);
  box-shadow: 0 0 0 3px rgba(93,231,197,.14), 0 0 14px rgba(93,231,197,.55);
}

.cascode-pager__items {
  position: absolute;
  inset: 0 auto 0 18px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.cascode-pager__item {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 20px;
  padding: 0;
  border: 0;
  color: rgba(244,242,236,.35);
  background: none;
  font: 9px/1 var(--font-mono, monospace);
  letter-spacing: .08em;
  text-transform: uppercase;
  cursor: pointer;
  transition: color .25s ease;
}

.cascode-pager__item::before {
  content: "";
  width: 6px;
  height: 1px;
  background: currentColor;
  transition: width .25s ease, background .25s ease;
}

.cascode-pager__item span {
  max-width: 0;
  overflow: hidden;
  white-space: nowrap;
  opacity: 0;
  transition: max-width .35s ease, opacity .25s ease;
}

.cascode-pager:hover .cascode-pager__item span,
.cascode-pager__item.is-active span,
.cascode-pager__item:focus-visible span {
  max-width: 110px;
  opacity: 1;
}

.cascode-pager__item.is-active {
  color: #5de7c5;
}

.cascode-pager__item.is-active::before {
  width: 18px;
  background: #5de7c5;
}

.cascode-hud {
  position: fixed;
  z-index: 42;
  right: 10px;
  bottom: 10px;
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 12px 24px;
  width: min(310px, calc(100vw - 40px));
  padding: 13px 16px 12px;
  border-top: 1px solid rgba(255,255,255,.12);
  border-left: 1px solid rgba(255,255,255,.12);
  background: rgba(5,8,12,.56);
  color: #78848b;
  font: 9px/1.45 var(--font-mono, monospace);
  letter-spacing: .06em;
  text-transform: uppercase;
  backdrop-filter: blur(12px);
  pointer-events: none;
}

.cascode-hud::before,
.cascode-hud::after {
  content: "+";
  position: absolute;
  color: rgba(244,242,236,.75);
}

.cascode-hud::before { left: -4px; top: -5px; }
.cascode-hud::after { right: -4px; bottom: -5px; }

.cascode-hud__section {
  grid-column: 1 / -1;
  display: flex;
  justify-content: space-between;
  gap: 18px;
  padding-bottom: 9px;
  border-bottom: 1px solid rgba(255,255,255,.1);
}

.cascode-hud__section strong {
  color: #f4f2ec;
  font-weight: 500;
}

.cascode-hud__section b {
  color: #5de7c5;
  font-weight: 500;
}

.cascode-hud__metrics {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 3px 12px;
}

.cascode-hud__metrics output {
  color: #dce2e1;
}

.cascode-hud__cue {
  align-self: end;
  color: #5de7c5;
  white-space: nowrap;
}

@media (max-width: 860px) {
  .cascode-frame {
    display: none;
  }

  .cascode-pager {
    display: none;
  }

  .cascode-hud {
    display: none;
  }
}

@media (max-height: 650px) {
  .cascode-pager { height: 210px; }
  .cascode-hud__metrics { display: none; }
}
