/* ──────────────────────────────────────────────────────────────────────────
   LOGOS · FUI FX — HUD targeting-reticle cursor (monochrome, hairline).
   Tracks the pointer INSTANTLY (no easing/lag). Over interactive targets the
   crosshair retracts and corner brackets snap into a "lock" frame; on press the
   reticle tightens ("fire"). Fine pointers only; off under reduced-motion;
   suspended while the owner editor/manage overlays are open; native caret kept
   over text inputs. Tokens from style.css :root.
   ────────────────────────────────────────────────────────────────────────── */

@media (pointer: fine) {
  html.fui-cursor, html.fui-cursor * { cursor: none; }
  html.fui-cursor input, html.fui-cursor textarea, html.fui-cursor select,
  html.fui-cursor [contenteditable="true"], html.fui-cursor .ql-editor, html.fui-cursor iframe { cursor: auto; }
}

.fui-ret {
  position: fixed; top: 0; left: 0; width: 44px; height: 44px; margin: -22px 0 0 -22px;
  pointer-events: none; z-index: 100050; opacity: 0; transition: opacity .2s ease; will-change: transform;
}
html.fui-cursor.fui-ready .fui-ret { opacity: 1; }
.fui-ret-in { position: absolute; inset: 0; transition: transform .12s ease;
  filter: drop-shadow(0 0 2px rgba(5,5,6,.9)); }   /* dark halo → separates hairlines from bright nebula */
.fui-ret i, .fui-ret .fui-dot { position: absolute; display: block; }

/* center dot */
.fui-dot { width: 4px; height: 4px; left: 20px; top: 20px; border-radius: 50%; background: var(--ash); transition: background .14s ease, width .14s ease, height .14s ease, left .14s ease, top .14s ease; }

/* crosshair ticks (gapped) — the resting instrument */
.fui-ret .t { background: var(--silver); opacity: .8; transition: opacity .14s ease; }
.fui-ret .t-n { top: 4px;  left: 21px; width: 1px; height: 8px; }
.fui-ret .t-s { bottom: 4px;left: 21px; width: 1px; height: 8px; }
.fui-ret .t-w { left: 4px; top: 21px;  height: 1px; width: 8px; }
.fui-ret .t-e { right: 4px;top: 21px;  height: 1px; width: 8px; }

/* corner brackets — the lock frame (hidden until hover) */
.fui-ret .b { width: 9px; height: 9px; opacity: 0; transform: scale(1.3); transition: opacity .15s ease, transform .15s cubic-bezier(.2,.8,.2,1), border-color .15s ease; }
.fui-ret .b-nw { top: 6px; left: 6px;  border-top: 1px solid var(--silver); border-left: 1px solid var(--silver); }
.fui-ret .b-ne { top: 6px; right: 6px; border-top: 1px solid var(--silver); border-right: 1px solid var(--silver); }
.fui-ret .b-sw { bottom: 6px; left: 6px; border-bottom: 1px solid var(--silver); border-left: 1px solid var(--silver); }
.fui-ret .b-se { bottom: 6px; right: 6px;border-bottom: 1px solid var(--silver); border-right: 1px solid var(--silver); }

/* hover an interactive target → lock on: ticks retract, brackets snap in, brighten */
.fui-ret.is-hot .t { opacity: 0; }
.fui-ret.is-hot .b { opacity: 1; transform: scale(1); border-color: var(--white); }
.fui-ret.is-hot .fui-dot { background: var(--white); width: 5px; height: 5px; left: 19.5px; top: 19.5px; }

/* press → tighten ("fire") */
.fui-ret.is-down .fui-ret-in { transform: scale(.82); }

/* radar sweep — spins only while locked on a target (acquiring) */
.fui-ret .sweep { top: 6px; left: 21.5px; width: 1px; height: 16px;
  background: linear-gradient(var(--white), transparent); transform-origin: bottom center;
  opacity: 0; transition: opacity .15s ease; }
.fui-ret.is-hot .sweep { opacity: .65; animation: fui-sweep 2.1s linear infinite; }
@keyframes fui-sweep { from { transform: rotate(0deg); } to { transform: rotate(360deg); } }

/* scan-ping — expands once on press (fire pulse) */
.fui-ret .ping { left: 14px; top: 14px; width: 16px; height: 16px; border-radius: 50%;
  border: 1px solid var(--white); opacity: 0; }
.fui-ret.is-firing .ping { animation: fui-ping .45s ease-out; }
@keyframes fui-ping { 0% { transform: scale(.4); opacity: .5; } 100% { transform: scale(1.9); opacity: 0; } }

/* telemetry readout beside the reticle (live coords / LOCK) */
.fui-tag {
  position: fixed; top: 0; left: 0; margin: 13px 0 0 27px; pointer-events: none; z-index: 100050;
  display: inline-flex; align-items: center; gap: 6px; padding: 3px 7px;
  font-family: var(--mono); font-size: 8.5px; letter-spacing: .15em; white-space: nowrap;
  color: var(--silver); background: rgba(5,5,6,.55); border: 1px solid var(--line); border-radius: 2px;
  -webkit-backdrop-filter: blur(3px); backdrop-filter: blur(3px);
  opacity: 0; transition: opacity .2s ease, color .15s ease, border-color .15s ease; will-change: transform;
}
html.fui-cursor.fui-ready .fui-tag { opacity: .92; }
.fui-tag .mk { width: 4px; height: 4px; border-radius: 50%; background: var(--silver); transition: background .15s ease; }
.fui-tag.is-hot { color: var(--white); border-color: var(--silver); }
.fui-tag.is-hot .mk { background: var(--white); }

/* over text fields / off-window → hide reticle + tag (native caret reads clean) */
.fui-ret.is-text, .fui-ret.is-out, .fui-tag.is-text, .fui-tag.is-out { opacity: 0 !important; }

/* suspend while owner overlays are open (precision tools want native cursor) */
html.fui-suspend.fui-cursor, html.fui-suspend.fui-cursor * { cursor: auto; }
html.fui-suspend .fui-ret, html.fui-suspend .fui-tag { opacity: 0 !important; }

@media (prefers-reduced-motion: reduce) {
  html.fui-cursor, html.fui-cursor * { cursor: auto; }
  .fui-ret { display: none !important; }
}
