```python
def drift_check(readings: list, step: int) -> int:
    """
    Given sensor readings in the order they were taken and an allowed step,
    return the position of the first reading that differs from the one immediately
    before it by more than that step, in either direction. Return minus one when
    every reading stays inside the allowed step.
    """
    if not readings or step <= 0:
        raise ValueError("Invalid input")

    for i in range(1, len(readings)):
        if abs(readings[i] - readings[i - 1]) > step:
            return i

    return -1
```