/* ===== v2026 · HTML overlay graph labels + reticle scope ===== */

/* ===== Graph labels (HTML overlay over Three.js topology) ===== */
.graph-labels {
    position: fixed;
    inset: 0;
    z-index: 5;
    pointer-events: none;
    overflow: hidden;
}
.graph-label {
    position: absolute;
    top: 0; left: 0;
    transform-origin: 0 0;
    will-change: transform, opacity;
    font-family: var(--font-mono);
    color: rgba(241, 244, 255, 0.92);
    white-space: nowrap;
    transition: opacity 0.4s ease, color 0.4s ease;
    user-select: none;
}
.graph-label.dimmed { opacity: 0.22; }

.graph-label-mini {
    font-size: 10.5px;
    letter-spacing: 0.06em;
    padding: 3px 8px;
    background: rgba(7, 11, 24, 0.55);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 4px;
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    text-shadow: 0 1px 4px rgba(0, 0, 0, 0.9);
}
.graph-label-primary {
    display: inline-flex;
    flex-direction: column;
    gap: 2px;
    padding: 8px 14px;
    background: rgba(7, 11, 24, 0.78);
    border: 1px solid rgba(111, 214, 255, 0.45);
    border-radius: 8px;
    box-shadow:
        0 0 0 1px rgba(111, 214, 255, 0.12),
        0 8px 24px rgba(3, 8, 30, 0.6),
        0 0 32px rgba(111, 214, 255, 0.18);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
}
.graph-label-primary .gl-name {
    font-family: var(--font-sans);
    font-size: 14px;
    font-weight: 600;
    letter-spacing: -0.005em;
    color: var(--fg);
}
.graph-label-primary .gl-stack {
    font-family: var(--font-mono);
    font-size: 10.5px;
    letter-spacing: 0.08em;
    color: var(--accent);
    text-transform: lowercase;
}
.graph-label.clickable {
    pointer-events: auto;
    cursor: pointer;
    transition: opacity 0.4s ease, color 0.4s ease, border-color 0.2s ease, box-shadow 0.2s ease;
}
.graph-label.clickable:hover {
    border-color: var(--accent);
    box-shadow:
        0 0 0 1px rgba(111, 214, 255, 0.32),
        0 12px 32px rgba(42, 92, 255, 0.4),
        0 0 48px rgba(111, 214, 255, 0.45);
}

/* Hovered label upgrade — co-located with the label styles it tweaks */
.graph-label.hot {
    color: #ffffff;
    z-index: 6;
}
.graph-label-mini.hot {
    background: rgba(111, 214, 255, 0.18);
    border-color: var(--accent);
    color: var(--fg);
}
.graph-label-primary.hot {
    border-color: var(--accent);
    box-shadow:
        0 0 0 1px rgba(111, 214, 255, 0.4),
        0 14px 38px rgba(42, 92, 255, 0.55),
        0 0 56px rgba(111, 214, 255, 0.55);
}

/* ===== Reticle (cursor crosshair → lock-on scope on hover) ===== */
.reticle {
    position: fixed;
    top: 0; left: 0;
    width: 0; height: 0;
    z-index: 25;
    pointer-events: none;
    transform: translate(50vw, 50vh);
    opacity: 0;
    transition: opacity 0.3s ease;
}
.reticle.visible { opacity: 1; }
.reticle .r-h, .reticle .r-v {
    position: absolute;
    background: var(--accent);
    opacity: 0.4;
    transition: width 0.35s cubic-bezier(.22,1,.36,1),
                height 0.35s cubic-bezier(.22,1,.36,1),
                left 0.35s cubic-bezier(.22,1,.36,1),
                top 0.35s cubic-bezier(.22,1,.36,1),
                opacity 0.25s ease;
}
.reticle .r-h { left: -22px; top: 0; width: 44px; height: 1px; transform: translateY(-0.5px); }
.reticle .r-v { top: -22px; left: 0; width: 1px; height: 44px; transform: translateX(-0.5px); }
.reticle .r-corner {
    position: absolute;
    width: 6px; height: 6px;
    border: 1px solid var(--accent);
    opacity: 0.55;
    transition: top 0.35s cubic-bezier(.22,1,.36,1),
                left 0.35s cubic-bezier(.22,1,.36,1),
                width 0.35s cubic-bezier(.22,1,.36,1),
                height 0.35s cubic-bezier(.22,1,.36,1),
                opacity 0.25s ease,
                border-color 0.25s ease,
                box-shadow 0.25s ease;
}
.reticle .r-tl { top: -14px; left: -14px; border-width: 1px 0 0 1px; }
.reticle .r-tr { top: -14px; left:   8px; border-width: 1px 1px 0 0; }
.reticle .r-bl { top:   8px; left: -14px; border-width: 0 0 1px 1px; }
.reticle .r-br { top:   8px; left:   8px; border-width: 0 1px 1px 0; }

/* concentric rings — fade in only when locked */
.reticle .r-ring {
    position: absolute;
    border-radius: 50%;
    border: 1px solid var(--accent);
    opacity: 0;
    pointer-events: none;
    transition: width 0.45s cubic-bezier(.22,1,.36,1),
                height 0.45s cubic-bezier(.22,1,.36,1),
                top 0.45s cubic-bezier(.22,1,.36,1),
                left 0.45s cubic-bezier(.22,1,.36,1),
                opacity 0.3s ease;
}
.reticle .r-ring-outer { width: 8px; height: 8px; top: -4px; left: -4px; }
.reticle .r-ring-inner { width: 4px; height: 4px; top: -2px; left: -2px; opacity: 0; }

/* ----- locked state: scope-like lock-on, expanded brackets, rings appear, pulse ----- */
.reticle.locked .r-h { left: -42px; width: 84px; opacity: 0.85; }
.reticle.locked .r-v { top:  -42px; height: 84px; opacity: 0.85; }
.reticle.locked .r-tl { top: -26px; left: -26px; width: 10px; height: 10px; opacity: 1;
    box-shadow: -2px -2px 12px rgba(111, 214, 255, 0.55); }
.reticle.locked .r-tr { top: -26px; left:  16px; width: 10px; height: 10px; opacity: 1;
    box-shadow:  2px -2px 12px rgba(111, 214, 255, 0.55); }
.reticle.locked .r-bl { top:  16px; left: -26px; width: 10px; height: 10px; opacity: 1;
    box-shadow: -2px  2px 12px rgba(111, 214, 255, 0.55); }
.reticle.locked .r-br { top:  16px; left:  16px; width: 10px; height: 10px; opacity: 1;
    box-shadow:  2px  2px 12px rgba(111, 214, 255, 0.55); }
.reticle.locked .r-ring-outer {
    width: 64px; height: 64px; top: -32px; left: -32px;
    opacity: 0.85;
    box-shadow: 0 0 24px rgba(111, 214, 255, 0.35), inset 0 0 16px rgba(111, 214, 255, 0.18);
    animation: reticle-ring-pulse 1.6s ease-in-out infinite;
}
.reticle.locked .r-ring-inner {
    width: 14px; height: 14px; top: -7px; left: -7px;
    opacity: 0.6;
}
@keyframes reticle-ring-pulse {
    0%, 100% { transform: scale(1);    opacity: 0.85; }
    50%      { transform: scale(1.08); opacity: 0.55; }
}

.reticle .r-tooltip {
    position: absolute;
    left: 36px;
    top: 36px;
    padding: 7px 11px;
    background: rgba(7, 11, 24, 0.92);
    border: 1px solid var(--accent);
    border-radius: 4px;
    font-family: var(--font-mono);
    font-size: 11px;
    color: var(--fg);
    white-space: nowrap;
    box-shadow: 0 0 24px rgba(111, 214, 255, 0.32);
    opacity: 0;
    transition: opacity 0.2s ease, left 0.35s cubic-bezier(.22,1,.36,1), top 0.35s cubic-bezier(.22,1,.36,1);
    display: inline-flex; flex-direction: column; gap: 2px;
}
.reticle .r-tooltip.visible { opacity: 1; }
.reticle .r-tooltip strong { color: var(--accent); letter-spacing: 0.04em; }
.reticle .r-tooltip span   { color: var(--fg-dim); font-size: 10px; letter-spacing: 0.08em; }
body:has(#webgl:hover) .reticle { opacity: 1; }
