.ab-hud {
  position: fixed;
  inset: 0;
  z-index: 4;
  pointer-events: none;
  opacity: var(--hud);
  transition: opacity 600ms var(--ease-standard);
}

.ab-bracket {
  position: absolute;
  width: clamp(26px, calc(3.4 * var(--vw, 1vw)), 52px);
  height: clamp(26px, calc(3.4 * var(--vw, 1vw)), 52px);
  border: 1px solid var(--instr-soft);
  opacity: calc(0.35 + var(--temp) * 0.5);
  transition: opacity 900ms var(--ease-standard);
}

.ab-bracket-tl {
  top: clamp(16px, calc(2.4 * var(--vw, 1vw)), 30px);
  left: clamp(16px, calc(2.4 * var(--vw, 1vw)), 30px);
  border-right: 0;
  border-bottom: 0;
  translate: calc((var(--hud) - 1) * 20px) calc((var(--hud) - 1) * 20px);
}

.ab-bracket-tr {
  top: clamp(16px, calc(2.4 * var(--vw, 1vw)), 30px);
  right: clamp(16px, calc(2.4 * var(--vw, 1vw)), 30px);
  border-left: 0;
  border-bottom: 0;
  translate: calc((1 - var(--hud)) * 20px) calc((var(--hud) - 1) * 20px);
}

.ab-bracket-bl {
  bottom: clamp(16px, calc(2.4 * var(--vw, 1vw)), 30px);
  left: clamp(16px, calc(2.4 * var(--vw, 1vw)), 30px);
  border-right: 0;
  border-top: 0;
  translate: calc((var(--hud) - 1) * 20px) calc((1 - var(--hud)) * 20px);
}

.ab-bracket-br {
  bottom: clamp(16px, calc(2.4 * var(--vw, 1vw)), 30px);
  right: clamp(16px, calc(2.4 * var(--vw, 1vw)), 30px);
  border-left: 0;
  border-top: 0;
  translate: calc((1 - var(--hud)) * 20px) calc((1 - var(--hud)) * 20px);
}

.ab-rail {
  position: absolute;
  top: 50%;
  right: clamp(16px, calc(2.6 * var(--vw, 1vw)), 34px);
  translate: 0 -50%;
  display: flex;
  flex-direction: row-reverse;
  align-items: center;
  gap: 12px;
  transition: opacity 600ms var(--ease-standard);
}

body.ab-root[data-fragment] .ab-rail {
  opacity: 0;
}

.ab-rail-line {
  position: relative;
  width: 1px;
  height: min(calc(46 * var(--vh, 1vh)), 400px);
  background: var(--instr-faint);
}

.ab-rail-line::after {
  content: '';
  position: absolute;
  left: -1px;
  top: 0;
  width: 3px;
  height: calc(var(--depth) * 100%);
  background: linear-gradient(to bottom, transparent, var(--instr));
  opacity: 0.7;
}

.ab-rail-marks {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  align-items: flex-end;
  height: min(calc(46 * var(--vh, 1vh)), 400px);
}

.ab-rail-marks li {
  color: var(--instr-soft);
  opacity: 0.46;
  transition: opacity var(--dur-slow) var(--ease-standard);
}

.ab-rail-marks button {
  all: unset;
  box-sizing: border-box;
  display: flex;
  flex-direction: row-reverse;
  align-items: center;
  gap: 8px;
  padding: 3px 0 3px 10px;
  font-family: var(--font-hud);
  font-size: 9px;
  letter-spacing: 0.28em;
  color: inherit;
  cursor: pointer;
}

.ab-rail-marks b {
  font-weight: 400;
  letter-spacing: 0.1em;
  opacity: 0.55;
}

.ab-rail-marks svg {
  width: 13px;
  height: 13px;
  overflow: visible;
}

.ab-rail-marks .ring {
  fill: none;
  stroke: #f4f9ff;
  stroke-width: 1.4;
  stroke-dasharray: 1;
  stroke-dashoffset: 1;
  transition: stroke-dashoffset 700ms var(--ease-decel);
}

.ab-rail-marks .dot {
  fill: currentColor;
}

.ab-rail-marks li i {
  width: 6px;
  height: 1px;
  background: currentColor;
  transition: width var(--dur-slow) var(--ease-decel);
}

.ab-rail-marks li:hover,
.ab-rail-marks li:focus-within {
  opacity: 0.85;
}

.ab-rail-marks li.is-current {
  opacity: 1;
  color: #f4f9ff;
  text-shadow: 0 0 12px rgba(200, 225, 255, 0.55);
}

.ab-rail-marks li.is-current i {
  width: 16px;
}

.ab-rail-marks li.is-current .ring,
.ab-rail-marks li:hover .ring {
  stroke-dashoffset: 0;
}

.ab-rail-marks button:focus-visible {
  outline: 1px solid var(--edge);
  outline-offset: 3px;
}

body.ab-root[data-hud-on] .ab-rail {
  pointer-events: auto;
}

.ab-rail-cursor {
  position: absolute;
  top: 0;
  right: -3px;
  width: 7px;
  height: 7px;
  border: 1px solid #f4f9ff;
  background: rgba(4, 7, 14, 0.9);
  rotate: 45deg;
  box-shadow: 0 0 10px rgba(210, 230, 255, 0.85), 0 0 22px rgba(160, 205, 255, 0.35);
  pointer-events: none;
}

.ab-readout {
  position: absolute;
  top: clamp(20px, calc(2.8 * var(--vw, 1vw)), 36px);
  right: clamp(52px, calc(6 * var(--vw, 1vw)), 92px);
  display: flex;
  align-items: center;
  gap: 12px;
  font-family: var(--font-hud);
  font-size: 9px;
  letter-spacing: 0.34em;
  text-transform: uppercase;
  color: var(--instr-soft);
  white-space: nowrap;
}

.ab-readout-sep {
  width: 18px;
  height: 1px;
  background: var(--instr-faint);
}

.ab-wordmark {
  position: absolute;
  bottom: clamp(20px, calc(2.8 * var(--vw, 1vw)), 36px);
  left: 50%;
  translate: -50% 0;
  width: clamp(140px, calc(15 * var(--vw, 1vw)), 210px);
  opacity: calc(0.18 + var(--temp) * 0.5);
  mix-blend-mode: screen;
  transition: opacity 900ms var(--ease-standard);
}

@media (max-width: 860px) {
  .ab-rail,
  .ab-wordmark {
    display: none;
  }

  .ab-readout {
    gap: 8px;
    font-size: 8px;
    letter-spacing: 0.24em;
  }
}
