/* ==========================================================================
   Site-wide custom cursor (public/js/cursor.js adds the markup and the
   .hp-has-cursor body class, for mouse users without reduced motion only).
   Self-contained: it must not depend on any page's own tokens.
   ========================================================================== */

.hp-cursor,
.hp-cursor__spark {
    --hp-cursor-sky: #29abe2;
    --hp-cursor-sky-rgb: 41, 171, 226;
    --hp-cursor-red: #e0343b;
}

/* !important is deliberate: the native cursor has to disappear everywhere the
   custom one is drawn, whatever cursor a theme component sets for itself. */
.hp-has-cursor,
.hp-has-cursor * {
    cursor: none !important;
}

.hp-has-cursor :is(input:not([type="checkbox"]):not([type="radio"]):not([type="submit"]):not([type="button"]), textarea, [contenteditable="true"]) {
    cursor: text !important;
}

.hp-cursor {
    position: fixed;
    inset: 0;
    /* Above modals and the Calendly overlay, since the native cursor is hidden. */
    z-index: 2147483647;
    pointer-events: none;
    transition: opacity 0.25s ease;
}

.hp-cursor.is-hidden {
    opacity: 0;
}

.hp-cursor__dot,
.hp-cursor__ring {
    position: absolute;
    top: 0;
    left: 0;
    border-radius: 50%;
    translate: -100px -100px;
}

.hp-cursor__dot {
    width: 8px;
    height: 8px;
    margin: -4px 0 0 -4px;
    background: var(--hp-cursor-sky);
    box-shadow: 0 0 12px rgba(var(--hp-cursor-sky-rgb), 0.9);
}

.hp-cursor__ring {
    display: grid;
    place-items: center;
    width: 38px;
    height: 38px;
    margin: -19px 0 0 -19px;
    border: 1px solid rgba(var(--hp-cursor-sky-rgb), 0.6);
    transition: width 0.3s cubic-bezier(0.22, 1, 0.36, 1), height 0.3s cubic-bezier(0.22, 1, 0.36, 1), margin 0.3s cubic-bezier(0.22, 1, 0.36, 1), background-color 0.3s ease, border-color 0.3s ease, scale 0.2s ease;
}

.hp-cursor.is-hover .hp-cursor__ring {
    width: 62px;
    height: 62px;
    margin: -31px 0 0 -31px;
    border-color: transparent;
    background: rgba(var(--hp-cursor-sky-rgb), 0.16);
}

.hp-cursor.has-label .hp-cursor__ring {
    width: 84px;
    height: 84px;
    margin: -42px 0 0 -42px;
    border-color: transparent;
    background: var(--hp-cursor-sky);
}

.hp-cursor.has-label .hp-cursor__dot {
    opacity: 0;
}

.hp-cursor.is-down .hp-cursor__ring {
    scale: 0.82;
}

.hp-cursor__label {
    color: #04121c;
    font: 800 0.66rem/1 'Montserrat', sans-serif;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    opacity: 0;
    transition: opacity 0.2s ease;
}

[dir="rtl"] .hp-cursor__label {
    letter-spacing: normal;
}

.hp-cursor.has-label .hp-cursor__label {
    opacity: 1;
}

.hp-cursor__spark {
    position: fixed;
    z-index: 2147483646;
    width: 10px;
    height: 10px;
    margin: -5px 0 0 -5px;
    background: var(--hp-cursor-sky);
    -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 48 48'%3E%3Cpath d='M24 2c1.3 12.4 9.6 20.7 22 22-12.4 1.3-20.7 9.6-22 22-1.3-12.4-9.6-20.7-22-22C14.4 22.7 22.7 14.4 24 2Z'/%3E%3C/svg%3E") center / contain no-repeat;
    mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 48 48'%3E%3Cpath d='M24 2c1.3 12.4 9.6 20.7 22 22-12.4 1.3-20.7 9.6-22 22-1.3-12.4-9.6-20.7-22-22C14.4 22.7 22.7 14.4 24 2Z'/%3E%3C/svg%3E") center / contain no-repeat;
    pointer-events: none;
    animation: hp-spark 0.9s ease-out forwards;
}

.hp-cursor__spark.is-red {
    background: var(--hp-cursor-red);
}

@keyframes hp-spark {
    to {
        opacity: 0;
        transform: translate(var(--hp-dx), var(--hp-dy)) rotate(90deg) scale(0.2);
    }
}
