/* Native OS cursor: the authored nib lands on the pointer at (4, 4). */
:root {
  --fluks-pen-ink: url('../img/pen-cursor-ink.svg') 4 4;
  --fluks-pen-white: url('../img/pen-cursor-white.svg') 4 4;
  --fluks-pen-ink-pressed: url('../img/pen-cursor-ink-pressed.svg') 4 4;
  --fluks-pen-white-pressed: url('../img/pen-cursor-white-pressed.svg') 4 4;
}
.fluks-ink-trail, .fluks-ink-desaturation {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 350;
  pointer-events: none !important;
  user-select: none;
}
.fluks-ink-trail[hidden], .fluks-ink-desaturation[hidden] { display: none; }
.fluks-ink-desaturation {
  mix-blend-mode: saturation;
  /* Bound the final effect even when the same point is crossed repeatedly. */
  opacity: .16;
}

@media (pointer: fine) and (hover: hover) and (prefers-reduced-motion: no-preference) {
  html.ink-cursor-ready:not(.no-anim):not(.is-motion-paused) body {
    --fluks-pen: var(--fluks-pen-ink);
    cursor: var(--fluks-pen), auto;
  }
  html.ink-cursor-ready:not(.no-anim):not(.is-motion-paused) .sidebar[data-ink-dark] {
    --fluks-pen: var(--fluks-pen-white);
    cursor: var(--fluks-pen), auto;
  }
  /* The static logo lives on a light disc even inside the dark header. */
  html.ink-cursor-ready .side-logo { --fluks-pen: var(--fluks-pen-ink); }
  html.ink-cursor-ready:not(.no-anim):not(.is-motion-paused) :where(a, button, summary, [role='button']) {
    cursor: var(--fluks-pen), pointer;
  }
  html.ink-cursor-ready:not(.no-anim):not(.is-motion-paused) body[data-ink-pressed] { --fluks-pen: var(--fluks-pen-ink-pressed); }
  html.ink-cursor-ready:not(.no-anim):not(.is-motion-paused) body[data-ink-pressed] .sidebar[data-ink-dark] { --fluks-pen: var(--fluks-pen-white-pressed); }
  html.ink-cursor-ready:not(.no-anim):not(.is-motion-paused) body[data-ink-pressed] .side-logo { --fluks-pen: var(--fluks-pen-ink-pressed); }
  /* Leave editing, resizing, dragging and native selection behavior to the browser. */
  html.ink-cursor-ready :where(input, textarea, select, [contenteditable]:not([contenteditable='false']), [role='textbox']) {
    cursor: revert;
  }
  html.ink-cursor-ready :where([contenteditable]:not([contenteditable='false']), [role='textbox']) * {
    cursor: inherit;
  }
}
