@media (any-hover: hover) and (any-pointer: fine) {
  .has-portfolio-cursor,
  .has-portfolio-cursor body *,
  .portfolio-cursor-embedded,
  .portfolio-cursor-embedded body * {
    cursor: none !important;
  }
}

.portfolio-cursor {
  position: fixed;
  inset: 0;
  z-index: 2147483647;
  width: auto;
  height: auto;
  margin: 0;
  padding: 0;
  border: 0;
  overflow: visible;
  background: transparent;
  pointer-events: none;
  visibility: hidden;
  --cursor-accent: var(--accent, #d0d629);
  --cursor-trail-fill: #f6f6f429;
  --cursor-ease: cubic-bezier(0.22, 0.72, 0.23, 1);
}

.has-portfolio-cursor .portfolio-cursor {
  visibility: visible;
}

.portfolio-cursor-trail {
  position: absolute;
  inset: 0;
}

.portfolio-cursor-ring,
.portfolio-cursor-dot {
  position: absolute;
  top: 0;
  left: 0;
}

.portfolio-cursor-dot::before,
.portfolio-cursor-ring > span {
  display: block;
  border-radius: 999px;
}

.portfolio-cursor-dot::before {
  content: '';
  width: 4px;
  height: 4px;
  background: #f6f6f4;
  transform: translate(-50%, -50%);
  transition:
    background-color 160ms var(--cursor-ease),
    box-shadow 160ms var(--cursor-ease);
}

.portfolio-cursor-ring > span {
  display: grid;
  place-items: center;
  overflow: hidden;
  box-sizing: border-box;
  width: 22px;
  height: 22px;
  transform: translate(-50%, -50%);
  white-space: nowrap;
  color: #101010;
  font:
    600 12px/1.2 Satoshi,
    sans-serif;
}

.portfolio-cursor-ring > span,
.portfolio-control-fill {
  background-color: color-mix(
    in srgb,
    var(--cursor-trail-fill),
    var(--cursor-control-fill, transparent) var(--cursor-hover-blend, 0%)
  );
}

.portfolio-control-fill {
  position: absolute;
  inset: 0 auto auto 0;
  border-radius: 999px;
  pointer-events: none;
  z-index: -1;
  --cursor-trail-fill: #f6f6f429;
}

:is(.dock-navigation, .case-toc) > .portfolio-control-fill {
  z-index: 1;
}

:is(.dock-menu, .reach-menu) > .portfolio-control-fill {
  z-index: 0;
}

.portfolio-cursor-label {
  position: relative;
  z-index: 1;
  opacity: 0;
  transition: opacity 90ms ease;
}

:root .portfolio-cursor-glass.glass-surface {
  --glass-fill: color-mix(in srgb, var(--cursor-accent) 90%, transparent);
  box-shadow: none;
  position: absolute;
  inset: 0;
  border-radius: inherit;
  opacity: 0;
  transition: opacity 200ms var(--cursor-ease);
}

.portfolio-cursor-glass > .glass-optics {
  display: none;
}

.portfolio-cursor[data-label] .portfolio-cursor-glass {
  opacity: 1;
}

/* The game invitation is the only cursor pill with an accent contour. */
:root .portfolio-cursor[data-game-label] .portfolio-cursor-glass.glass-surface {
  --glass-fill: #101110eb;
  box-shadow: inset 0 0 0 1px var(--cursor-accent);
}

.portfolio-cursor[data-game-label] .portfolio-cursor-label {
  color: var(--cursor-accent);
}

.portfolio-cursor-dot {
  transition: opacity 150ms var(--cursor-ease) 65ms;
}

/* The pointer surface supplies the mouse hover paint. Native focus keeps its fill. */
@media (any-hover: hover) and (any-pointer: fine) {
  :is(.has-portfolio-cursor, .portfolio-cursor-embedded):not(
      :has(:is(.dock-navigation, .dock-menu, .reach-menu, .case-toc) :focus-visible)
    )
    :is(.dock-hover, .menu-hover, .case-nav-hover) {
    visibility: hidden;
  }

  :is(.has-portfolio-cursor, .portfolio-cursor-embedded)
    :is(
      .glass-control,
      .sound-toggle,
      .music-toggle,
      .portfolio-back,
      .nav-toggle,
      .case-section-toggle,
      button.glass-surface
    ):hover:not(:focus-visible) {
    box-shadow: 0 8px 24px #00000020 !important;
  }

  :is(.has-portfolio-cursor, .portfolio-cursor-embedded)
    :is(button, [role='button'], .back-link, .button, .btn):hover:not(:focus-visible)::after {
    opacity: 0;
  }
}

.portfolio-cursor {
  --cursor-control-fill: color-mix(in srgb, var(--cursor-control-paint, #303124) 52%, transparent);
}

.portfolio-cursor[data-quiet-control] {
  --cursor-control-fill: transparent;
}

.portfolio-cursor[data-action] .portfolio-cursor-dot::before {
  background-color: var(--cursor-dot-accent, var(--cursor-accent));
  box-shadow: 0 0 0 1px #101010b3;
}

.portfolio-cursor[data-label] .portfolio-cursor-dot {
  opacity: 0;
  transition-delay: 0ms;
}

.portfolio-cursor[data-label] .portfolio-cursor-ring > span {
  background-color: transparent;
}

.portfolio-cursor[data-label] .portfolio-cursor-label {
  opacity: 1;
  transition-delay: 42ms;
}

@media (prefers-reduced-motion: reduce) {
  .portfolio-cursor-ring > span,
  .portfolio-cursor-glass,
  .portfolio-cursor-label,
  .portfolio-cursor-dot,
  .portfolio-cursor-dot::before {
    transition: none;
  }
}
