:root {
  --cn-cursor-accent: #124b90;
  --cn-cursor-big: #f29120;
}

@property --cn-cursor-dot-scale {
  syntax: "<number>";
  inherits: false;
  initial-value: 1;
}

@property --cn-cursor-halo-scale {
  syntax: "<number>";
  inherits: false;
  initial-value: 1;
}

@media (hover: hover) and (pointer: fine) and (prefers-reduced-motion: no-preference) {
  html.cn-custom-cursor-active,
  html.cn-custom-cursor-active body,
  html.cn-custom-cursor-active body *,
  html.cn-custom-cursor-active dialog::backdrop {
    cursor: none !important;
  }

  /* The homepage previously had a card-only cursor. The global cursor replaces it. */
  html.cn-custom-cursor-active .custom-cursor {
    display: none !important;
  }

  .cn-site-cursor {
    position: fixed;
    inset: 0;
    z-index: 2147483646;
    pointer-events: none;
    opacity: 0;
    visibility: hidden;
    transition: opacity 160ms ease, visibility 160ms ease;
  }

  .cn-site-cursor.is-visible {
    opacity: 1;
    visibility: visible;
  }

  .cn-site-cursor__dot,
  .cn-site-cursor__halo {
    position: fixed;
    top: 0;
    left: 0;
    border-radius: 999px;
    will-change: transform, width, height, opacity;
    pointer-events: none;
  }

  .cn-site-cursor__dot {
    --cn-cursor-dot-scale: 1;
    width: 5px;
    height: 5px;
    margin: -2.5px 0 0 -2.5px;
    background: var(--cn-cursor-accent);
    box-shadow: 0 0 10px rgba(18, 75, 144, 0.7);
    transition: opacity 160ms ease, --cn-cursor-dot-scale 160ms ease;
  }

  .cn-site-cursor__halo {
    --cn-cursor-halo-scale: 1;
    display: grid;
    place-items: center;
    width: 16px;
    height: 16px;
    margin: -8px 0 0 -8px;
    border: 1px solid var(--cn-cursor-accent);
    background: var(--cn-cursor-big);
    box-shadow: 0 0 18px rgba(242, 145, 32, 0.12);
    transition:
      width 220ms cubic-bezier(0.16, 1, 0.3, 1),
      height 220ms cubic-bezier(0.16, 1, 0.3, 1),
      margin 220ms cubic-bezier(0.16, 1, 0.3, 1),
      background-color 180ms ease,
      border-color 180ms ease,
      box-shadow 180ms ease,
      --cn-cursor-halo-scale 120ms ease;
  }

  .cn-site-cursor__label {
    color: #111;
    font: 700 14px/1 Arial, sans-serif;
    opacity: 0;
    scale: 0.55;
    transition: opacity 140ms ease, scale 180ms cubic-bezier(0.16, 1, 0.3, 1);
  }

  .cn-site-cursor.is-interactive .cn-site-cursor__halo {
    width: 48px;
    height: 48px;
    margin: -24px 0 0 -24px;
    border-color: var(--cn-cursor-accent);
    background: var(--cn-cursor-big);
    box-shadow: 0 0 30px rgba(242, 145, 32, 0.28);
  }

  .cn-site-cursor.is-interactive .cn-site-cursor__dot {
    opacity: 0;
    --cn-cursor-dot-scale: 0;
  }

  .cn-site-cursor.is-interactive .cn-site-cursor__label {
    opacity: 1;
    scale: 1;
  }

  .cn-site-cursor.is-text .cn-site-cursor__halo {
    opacity: 0;
  }

  /* Keep the text pointer on the exact insertion position as the halo trails. */
  .cn-site-cursor.is-text .cn-site-cursor__dot {
    width: 2px;
    height: 16px;
    margin: -8px 0 0 -1px;
    border-radius: 1px;
    background: var(--cn-cursor-accent);
    box-shadow: 0 0 0 1px #fff;
    opacity: 1;
    --cn-cursor-dot-scale: 1;
  }

  .cn-site-cursor.is-pressed .cn-site-cursor__halo {
    --cn-cursor-halo-scale: 0.72;
  }
}

@media (hover: none), (pointer: coarse), (prefers-reduced-motion: reduce) {
  .cn-site-cursor {
    display: none !important;
  }
}
