/* ==================================================
   ALPHA HEIGHT METHOD — HUD PRIMITIVES
   Mission-HUD / Sequential Initialization Aesthetic
   ================================================== */

/* --- 1. HUD CORNER BRACKET FRAMES (TIER 1) --- */
.hud-frame {
  position: relative;
}

.hud-frame::before {
  content: '';
  position: absolute;
  inset: -1px;
  pointer-events: none;
  z-index: 5;
  background:
    linear-gradient(to right, var(--hud) 14px, transparent 14px) 0 0,
    linear-gradient(to bottom, var(--hud) 14px, transparent 14px) 0 0,
    linear-gradient(to left, var(--hud) 14px, transparent 14px) 100% 0,
    linear-gradient(to bottom, var(--hud) 14px, transparent 14px) 100% 0,
    linear-gradient(to right, var(--hud) 14px, transparent 14px) 0 100%,
    linear-gradient(to top, var(--hud) 14px, transparent 14px) 0 100%,
    linear-gradient(to left, var(--hud) 14px, transparent 14px) 100% 100%,
    linear-gradient(to top, var(--hud) 14px, transparent 14px) 100% 100%;
  background-size: 14px 1px, 1px 14px, 14px 1px, 1px 14px, 14px 1px, 1px 14px, 14px 1px, 1px 14px;
  background-repeat: no-repeat;
  transition: background var(--transition-fast);
}

.hud-frame--red::before,
.hud-frame.active::before,
.hud-frame.hud-active::before {
  background:
    linear-gradient(to right, var(--red) 14px, transparent 14px) 0 0,
    linear-gradient(to bottom, var(--red) 14px, transparent 14px) 0 0,
    linear-gradient(to left, var(--red) 14px, transparent 14px) 100% 0,
    linear-gradient(to bottom, var(--red) 14px, transparent 14px) 100% 0,
    linear-gradient(to right, var(--red) 14px, transparent 14px) 0 100%,
    linear-gradient(to top, var(--red) 14px, transparent 14px) 0 100%,
    linear-gradient(to left, var(--red) 14px, transparent 14px) 100% 100%,
    linear-gradient(to top, var(--red) 14px, transparent 14px) 100% 100%;
  background-size: 14px 1px, 1px 14px, 14px 1px, 1px 14px, 14px 1px, 1px 14px, 14px 1px, 1px 14px;
  background-repeat: no-repeat;
}

/* --- 2. NOTCH GEOMETRY --- */
.notch {
  -webkit-clip-path: polygon(0 0, calc(100% - 12px) 0, 100% 12px, 100% 100%, 12px 100%, 0 calc(100% - 12px));
  clip-path: polygon(0 0, calc(100% - 12px) 0, 100% 12px, 100% 100%, 12px 100%, 0 calc(100% - 12px));
  border-radius: 0 !important;
}

.notch-sm {
  -webkit-clip-path: polygon(0 0, calc(100% - 8px) 0, 100% 8px, 100% 100%, 8px 100%, 0 calc(100% - 8px));
  clip-path: polygon(0 0, calc(100% - 8px) 0, 100% 8px, 100% 100%, 8px 100%, 0 calc(100% - 8px));
  border-radius: 0 !important;
}

/* --- 3. MONO LABELS (Accessibility: 11px, full opacity, --label #9A9AA3, 0.14em tracking) --- */
.mono-label {
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: var(--label);
  opacity: 1;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
  user-select: none;
}

/* --- 4. HAIRLINES --- */
.hairline {
  position: relative;
  width: 100%;
  height: 1px;
  background-color: var(--border);
  margin: 16px 0;
}

.hairline::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0;
  width: 0;
  height: 100%;
  background-color: var(--red);
  transition: width var(--transition-normal);
}

.hairline.active::before,
.active > .hairline::before,
*:hover > .hairline::before {
  width: 20%;
}

/* --- 5. FLAT HUD PLATES (TIER 2) --- */
.plate {
  background-color: var(--surface);
  border: 1px solid var(--border);
  border-radius: 0 !important;
  box-shadow: none !important;
  position: relative;
  transition: border-color var(--transition-fast), background-color var(--transition-fast);
}

.plate:hover {
  border-color: var(--hud);
  background-color: var(--surface-2);
}

.plate--indexed {
  position: relative;
  padding-top: 36px !important;
}

.plate--indexed::before {
  content: attr(data-index);
  position: absolute;
  top: 12px;
  left: 14px;
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.14em;
  color: var(--label);
  opacity: 1;
}

/* --- 6. BUTTONS HUD OVERRIDES --- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 14px 28px;
  font-family: var(--font-display);
  font-size: 0.95rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  cursor: pointer;
  border-radius: 0 !important;
  -webkit-clip-path: polygon(0 0, calc(100% - 12px) 0, 100% 12px, 100% 100%, 12px 100%, 0 calc(100% - 12px));
  clip-path: polygon(0 0, calc(100% - 12px) 0, 100% 12px, 100% 100%, 12px 100%, 0 calc(100% - 12px));
  transition: transform var(--transition-fast), background var(--transition-fast), border-color var(--transition-fast), box-shadow var(--transition-fast);
  outline: none;
  text-decoration: none;
  position: relative;
}

.btn:active {
  transform: scale(0.985);
}

.btn-primary {
  background: var(--red) !important;
  color: var(--white) !important;
  border: 1px solid var(--red) !important;
  box-shadow: 0 0 20px var(--red-soft) !important;
}

.btn-primary:hover {
  background: var(--red-hover) !important;
  border-color: var(--red-hover) !important;
  box-shadow: 0 0 28px rgba(225, 29, 46, 0.45) !important;
}

.btn-secondary {
  background: var(--surface) !important;
  color: var(--white) !important;
  border: 1px solid var(--border) !important;
  box-shadow: none !important;
  backdrop-filter: none !important;
  -webkit-backdrop-filter: none !important;
}

.btn-secondary:hover {
  background: var(--surface-2) !important;
  border-color: var(--hud) !important;
}

/* Button focus-visible ring wrapper support */
.btn-focus-wrapper {
  display: inline-block;
  position: relative;
}

.btn:focus-visible {
  outline: 2px solid var(--white);
  outline-offset: 3px;
}

/* --- 7. BADGE COMPONENT CONVERSION --- */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 4px 10px;
  border-radius: 0 !important;
  background: var(--red-soft) !important;
  border: 1px solid rgba(225, 29, 46, 0.3) !important;
  color: var(--white) !important;
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  margin-bottom: 12px;
}

.badge-dot {
  width: 6px;
  height: 6px;
  border-radius: 0 !important;
  background: var(--red);
  box-shadow: 0 0 8px var(--red);
  animation: pulseSquare 1.6s infinite ease-in-out;
}

@keyframes pulseSquare {
  0%, 100% {
    opacity: 1;
    transform: scale(1);
  }
  50% {
    opacity: 0.35;
    transform: scale(0.85);
  }
}

/* --- 8. GLOBAL SCROLL PROGRESS & TELEMETRY HUD (PHASE 8) --- */
.scroll-progress-line {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 2px;
  background: var(--red);
  z-index: 1001;
  transform-origin: 0 0;
  transform: scaleX(0);
  pointer-events: none;
  will-change: transform;
}

.hud-telemetry-widget {
  position: fixed;
  bottom: 20px;
  right: 20px;
  z-index: 900;
  background: rgba(16, 16, 19, 0.82);
  border: 1px solid var(--border);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  padding: 8px 12px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  pointer-events: none;
  user-select: none;
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.08em;
}

.telemetry-row {
  display: flex;
  align-items: center;
  gap: 8px;
  line-height: 1.2;
}

.telemetry-label {
  color: var(--red);
  font-weight: 700;
}

.telemetry-val {
  color: var(--white);
  font-variant-numeric: tabular-nums;
}

@media (max-width: 768px) {
  .hud-telemetry-widget {
    display: none !important;
  }
}

