/* Shared by every page (index, live, cv): the custom cursor and keyboard focus ring. */

/* ---------- custom cursor (js/cursor.js; fine pointers only) ---------- */

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

.has-cursor iframe {
    cursor: auto !important;
}

.cursor {
    --c: var(--blue);
    --on: #fff;
    position: fixed;
    inset: 0;
    z-index: 100;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.2s ease;
}

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

.cursor.on-blue {
    --c: #fff;
    --on: var(--blue);
}

.cursor-dot,
.cursor-ring {
    position: absolute;
    left: 0;
    top: 0;
    will-change: transform;
}

.cursor-dot::before,
.cursor-ring::before {
    content: "";
    position: absolute;
    border-radius: 50%;
}

/* Dot: sits exactly on the pointer, no lag. */
.cursor-dot::before {
    left: -3.5px;
    top: -3.5px;
    width: 7px;
    height: 7px;
    background: var(--c);
    transition: transform 0.25s var(--ease, cubic-bezier(0.2, 0.7, 0.1, 1)), background 0.2s ease;
}

/* Ring: trails on a spring, grows and fills over anything clickable. */
.cursor-ring::before {
    left: -18px;
    top: -18px;
    width: 36px;
    height: 36px;
    border: 1.5px solid var(--c);
    background: transparent;
    transform: scale(1);
    transition: transform 0.4s cubic-bezier(0.3, 1.6, 0.4, 1), background 0.25s ease, border-color 0.2s ease, opacity 0.25s ease;
    opacity: 0.55;
}

.cursor.is-hot .cursor-ring::before {
    transform: scale(1.5);
    background: color-mix(in srgb, var(--c) 14%, transparent);
    opacity: 1;
}

.cursor.has-label .cursor-ring::before {
    transform: scale(2);
    background: var(--c);
    border-color: var(--c);
}

.cursor.is-hot .cursor-dot::before {
    transform: scale(0);
}

/* Press: squeeze in, spring back out on release. */
.cursor.is-down .cursor-ring::before {
    transform: scale(0.75);
    transition-duration: 0.12s;
    transition-timing-function: ease-out;
}

.cursor.is-down.has-label .cursor-ring::before {
    transform: scale(1.7);
}

.cursor.is-down .cursor-dot::before {
    transform: scale(1.6);
}

.cursor-label {
    position: absolute;
    left: 0;
    top: 0;
    width: 80px;
    margin: -8px 0 0 -40px;
    color: var(--on);
    font-size: 11px;
    font-weight: 900;
    line-height: 16px;
    letter-spacing: 0.06em;
    text-align: center;
    text-transform: uppercase;
    white-space: nowrap;
    opacity: 0;
    transition: opacity 0.15s ease;
}

.cursor.has-label .cursor-label {
    opacity: 1;
    transition-delay: 0.08s;
}

@media print {
    .cursor {
        display: none;
    }
}

/* ---------- keyboard focus ---------- */

:focus-visible {
    outline: 2px solid var(--blue);
    outline-offset: 3px;
}

.blue :focus-visible,
section.contact :focus-visible {
    outline-color: #fff;
}
