At each position the encoder searches the window (blue) for the longest match with the lookahead (gray). Matches of 3+ symbols become an (offset, length) backreference; shorter ones stay literals.
Blue = sliding window (already emitted, still searchable) · green = last match · gray = lookahead · blue outline = current position.