Shadow DOM attaches a separate tree beneath a host element. Ordinary document selectors do not reach straight into it, and component styles stay inside.
The demo changes the outer CSS color while the inner card keeps its color. If consumers need styling control, expose custom properties or `::part` intentionally.
When to use
Use it to encapsulate reusable web components and reduce style collisions.