/* Shared Rostra cursor system. Custom artwork is desktop-only and remains
   supplemental: touch, high-contrast, and unsupported browsers keep native
   platform cursors through each declaration's final fallback keyword. */
:root {
  --cursor-rostra-default: default;
  --cursor-rostra-action: pointer;
  --cursor-rostra-text: text;
  --cursor-rostra-unavailable: not-allowed;
  --cursor-rostra-grab: grab;
  --cursor-rostra-grabbing: grabbing;
  --cursor-rostra-video: pointer;
}

@media (any-hover: hover) and (any-pointer: fine) {
  :root {
    --cursor-rostra-default: url("assets/cursors/rostra-arrow.svg") 7 7, default;
    --cursor-rostra-action: url("assets/cursors/rostra-action.svg") 14 15, pointer;
    --cursor-rostra-text: url("assets/cursors/rostra-text.svg") 14 17, text;
    --cursor-rostra-unavailable: url("assets/cursors/rostra-unavailable.svg") 17 17, not-allowed;
    --cursor-rostra-grab: url("assets/cursors/rostra-grab.svg") 18 18, grab;
    --cursor-rostra-grabbing: url("assets/cursors/rostra-grabbing.svg") 18 18, grabbing;
    --cursor-rostra-video: url("assets/cursors/rostra-video.svg") 19 19, pointer;
  }

  :where(html, body) {
    cursor: var(--cursor-rostra-default);
  }

  body :where(
    a,
    button,
    summary,
    label,
    select,
    [role="button"],
    input[type="button"],
    input[type="submit"],
    input[type="reset"],
    input[type="checkbox"],
    input[type="radio"],
    input[type="file"],
    input[type="range"],
    input[type="color"]
  ) {
    cursor: var(--cursor-rostra-action);
  }

  body :is(
    input:not([type]),
    input[type="text"],
    input[type="email"],
    input[type="search"],
    input[type="tel"],
    input[type="url"],
    input[type="password"],
    input[type="number"],
    input[type="date"],
    input[type="datetime-local"],
    input[type="time"],
    textarea,
    [contenteditable="true"],
    [contenteditable="plaintext-only"]
  ) {
    cursor: var(--cursor-rostra-text);
  }

  body :is(
    button:disabled,
    input:disabled,
    textarea:disabled,
    select:disabled,
    [aria-disabled="true"]
  ) {
    cursor: var(--cursor-rostra-unavailable);
  }

  body :is(video, [data-rostra-cursor="video"]) {
    cursor: var(--cursor-rostra-video);
  }
}

@media (forced-colors: active) {
  :root {
    --cursor-rostra-default: default;
    --cursor-rostra-action: pointer;
    --cursor-rostra-text: text;
    --cursor-rostra-unavailable: not-allowed;
    --cursor-rostra-grab: grab;
    --cursor-rostra-grabbing: grabbing;
    --cursor-rostra-video: pointer;
  }
}
