/* ============================================================
   codelens.css — "code glow" portrait hover (js/codelens.js).
   mountCodeLens() adds .cl-root to the portrait wrapper and appends
   three canvases after the base <img>:
     .cl-dim    the photo, darkened, inside the feathered mask
     .cl-code   the glowing glyph grid
     .cl-bloom  one-pixel-per-cell glow map over the image rect,
                blurred + screen-blended
   No ring, no label. The canvases are hidden while nothing is drawn
   (.cl-live is set only while the effect is visible or fading).
   --cl-fade: optional extra mask for the layers (the hero fades its
   bottom edge like its base image).
   ============================================================ */
.cl-root {
  --cl-fade: none;
  position: relative;
  touch-action: pan-y;
  -webkit-tap-highlight-color: transparent;
  -webkit-user-select: none; user-select: none;
}
/* the hero portrait fades out at the bottom (same as .lens--hero .lens-base) */
.cl-root.lens--hero, .cl-root.cl-root--hero { --cl-fade: linear-gradient(to bottom, #000 78%, transparent); }

/* cursor disappears only over the opaque figure (toggled from JS per pointer move) */
.cl-root.cl-nocursor, .cl-root.cl-nocursor * { cursor: none; }

.cl-layer {
  position: absolute; inset: 0; width: 100%; height: 100%;
  display: block; pointer-events: none;
  -webkit-mask-image: var(--cl-fade); mask-image: var(--cl-fade);
  -webkit-mask-repeat: no-repeat; mask-repeat: no-repeat;
}
.cl-root:not(.cl-live) .cl-layer { visibility: hidden; }
.cl-bloom {
  filter: blur(7px) saturate(1.2);
  mix-blend-mode: screen;
  opacity: 1;
}
[data-theme="light"] .cl-bloom, :root:not([data-theme="dark"]) .cl-bloom { opacity: .85; }

/* Windows high contrast etc.: keep the plain photo */
@media (forced-colors: active) {
  .cl-layer { display: none; }
  .cl-root.cl-nocursor, .cl-root.cl-nocursor * { cursor: auto; }
}
@media print { .cl-layer { display: none; } }
