/* Dolf Agency — FX: cursor morphs into a labelled disc over work / video cards.
   Driven by fx/cursor-label.js: it sets body[data-cursor="view|open|play|custom"]
   and injects span.cursor-label inside main.js's .cursor-follower.
   Selectors are one notch more specific than body.cursor-hover .cursor-follower,
   so the disc wins over the link-hover ring regardless of load order.
   body.cursor-off still hides the whole .cursor (iframes, Cal.com embed). */

/* ---------- Label (lives inside the follower; hidden at rest) ---------- */
.cursor-label {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  overflow: hidden;
  border-radius: 50%;
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 500;
  line-height: 1;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  white-space: nowrap;
  color: var(--bg);
  pointer-events: none;
  opacity: 0;
  transform: translateY(6px);
  transition: opacity 0.25s ease, transform 0.45s var(--ease-out);
}
.fx-cursor-label-inner {
  display: inline-flex;
  align-items: center;
  gap: 0.45em;
  /* optical centring: letter-spacing adds trailing space after the last glyph */
  padding-left: 0.14em;
  /* a long custom data-cursor word ends in an ellipsis instead of being cut by the circle */
  max-width: 74px;
}
.fx-cursor-text {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  /* room for accents (Ç, Ã, É) that the clip would otherwise cut at line-height 1 */
  line-height: 1.6;
}
.fx-cursor-arrow {
  display: inline-block;
  font-size: 12px;
  letter-spacing: 0;
  transform: translate(-3px, 3px);
  opacity: 0;
  transition: transform 0.5s var(--ease-out), opacity 0.3s ease;
}
.cursor-label__tri {
  display: inline-block;
  width: 0;
  height: 0;
  border-style: solid;
  border-width: 5px 0 5px 8px;
  border-color: transparent transparent transparent var(--bg);
  transform: scale(0.4);
  opacity: 0;
  transition: transform 0.5s var(--ease-out), opacity 0.3s ease;
}

/* The dot fades instead of snapping when the disc takes over */
.fx-cursor-label-on .cursor .cursor-dot { transition: opacity 0.2s ease; }

/* ---------- Active: ring → solid disc ---------- */
body[data-cursor] .cursor .cursor-follower {
  width: 88px;
  height: 88px;
  background: var(--fg);
  border-color: var(--fg);
  transition:
    width 0.5s var(--ease-out),
    height 0.5s var(--ease-out),
    background 0.3s ease,
    border-color 0.3s ease;
}
body[data-cursor] .cursor .cursor-dot { opacity: 0; }
body[data-cursor] .cursor .cursor-label {
  opacity: 1;
  transform: none;
  transition-delay: 60ms;
}
body[data-cursor] .cursor .fx-cursor-arrow,
body[data-cursor] .cursor .cursor-label__tri {
  opacity: 1;
  transform: none;
  transition-delay: 140ms;
}

/* The video card's own play button hands over to the disc while it is active */
.fx-cursor-label-on .vcard .vcard-play {
  transition: transform 0.45s var(--ease-out), background 0.3s ease, opacity 0.3s ease;
}
body[data-cursor] .vcard.fx-cursor-target .vcard-play {
  opacity: 0;
  transform: translate(-50%, -50%) scale(0.7);
}

@media (prefers-reduced-motion: reduce) {
  /* main.js does not build the cursor here; keep everything static just in case */
  .cursor-label,
  .fx-cursor-arrow,
  .cursor-label__tri,
  body[data-cursor] .cursor .cursor-follower,
  .fx-cursor-label-on .vcard .vcard-play {
    transition: none !important;
  }
}
