/* Alexandra Nistor — custom cursor, soft purple tint + View label
   Drop onto any page with cursor-tint.js.

   Rest: 11px disc in the menu accent (#502e60).
   Over menu and ordinary links: eases to a 58px circle filled with
   semi-transparent purple (~48% opacity, normal blend), so it reads
   as a definite purple disc while text stays legible underneath.
   Over gallery illustrations (a.work, or .an-cursor-view): a solid
   purple 58px disc with “View” in white Montserrat.
   Over social icons: the 34px black badge eases to #502e60 (glyph
   stays knocked out in the page colour) and the cursor becomes a
   50px, 1.5px purple ring — chosen over a small dot, which would
   sit on the glyph, or the 48% tint, which would muddy the fill.

   Hover on the page is driven by CSS :hover and, for scripted
   recording (which does not fire native :hover), by the .is-an-hover
   class that cursor-tint.js adds to the hovered element.

   Inactive on touch and when prefers-reduced-motion is set.
*/

:root {
  --an-cursor-accent: #502e60;
  --an-cursor-ink: #221e20;
  --an-cursor-dot: 11px;
  --an-cursor-hover: 58px;
  --an-cursor-social-ring: 50px;
  --an-cursor-label: #faf9f6;
}

html.has-an-cursor,
html.has-an-cursor * {
  cursor: none !important;
}

.an-cursor {
  position: fixed;
  top: 0;
  left: 0;
  width: var(--an-cursor-dot);
  height: var(--an-cursor-dot);
  margin: 0;
  padding: 0;
  border: 0 solid transparent;
  border-radius: 50%;
  background: var(--an-cursor-accent);
  pointer-events: none;
  z-index: 10000;
  transform: translate3d(-100px, -100px, 0) translate(-50%, -50%);
  opacity: 0;
  overflow: hidden;
  will-change: transform, width, height, background, opacity, border-color, border-width;
  box-sizing: border-box;
  mix-blend-mode: normal;
}

.an-cursor.is-on {
  opacity: 1;
}

.an-cursor-label {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: "Montserrat", system-ui, sans-serif;
  font-weight: 500;
  font-size: 11px;
  letter-spacing: 0.08em;
  line-height: 1;
  color: var(--an-cursor-label);
  white-space: nowrap;
  pointer-events: none;
  opacity: 0;
  user-select: none;
}

/* Social badges: only the outer circle (the black disc), not glyph marks. */
.socials a svg.icon > circle:first-of-type {
  fill: var(--an-cursor-ink);
  transition: fill 0.25s ease;
}
.socials a:hover svg.icon > circle:first-of-type,
.socials a.is-an-hover svg.icon > circle:first-of-type,
.socials a:focus-visible svg.icon > circle:first-of-type {
  fill: var(--an-cursor-accent);
}

/* Scripted recording ticks frames; CSS transitions would run in wall-clock
   time and finish in a handful of frames. Fill is driven from JS instead. */
html.has-an-record .socials a svg.icon > circle:first-of-type {
  transition: none;
}

/* Same menu underline as home.css :hover, so recordings see it too. */
nav.menu a.is-an-hover,
nav.menu a:hover,
nav.menu a:focus-visible {
  color: var(--accent, #502e60);
  box-shadow: inset 0 -1px 0 var(--accent, #502e60);
}

@media (prefers-reduced-motion: reduce) {
  html.has-an-cursor,
  html.has-an-cursor * {
    cursor: auto !important;
  }
  .an-cursor { display: none !important; }
  .socials a svg.icon > circle:first-of-type {
    transition: none;
  }
}

@media (hover: none), (pointer: coarse) {
  html.has-an-cursor,
  html.has-an-cursor * {
    cursor: auto !important;
  }
  .an-cursor { display: none !important; }
}
