/* ==========================================================================
   GeerSoft IT Solutions — Bespoke Quantum Reticle & Neural Ribbon Cursor
   Global across all pages (Desktop fine-pointer only)
   ========================================================================== */

@media (pointer: fine) and (hover: hover) {
  html.gs-cursor-enabled,
  html.gs-cursor-enabled body,
  html.gs-cursor-enabled a,
  html.gs-cursor-enabled button,
  html.gs-cursor-enabled label,
  html.gs-cursor-enabled [role="button"],
  html.gs-cursor-enabled select,
  html.gs-cursor-enabled input,
  html.gs-cursor-enabled textarea {
    cursor: none !important;
  }
}

/* Fullscreen lightweight canvas for neural ribbon, click shockwaves & sparks */
#gs-cursor-canvas {
  position: fixed;
  inset: 0;
  width: 100vw;
  height: 100vh;
  pointer-events: none;
  z-index: 99997;
  opacity: 0;
  transition: opacity 0.25s ease;
}

html.gs-cursor-enabled #gs-cursor-canvas.is-visible {
  opacity: 1;
}

/* Precision Optical Core + Rotating Quantum Telemetry Reticle */
.gs-cursor-root {
  position: fixed;
  top: 0;
  left: 0;
  pointer-events: none;
  z-index: 99999;
  opacity: 0;
  transition: opacity 0.22s ease;
}

html.gs-cursor-enabled .gs-cursor-root.is-visible {
  opacity: 1;
}

/* 0ms-Lag Precision Core (Diamond + Center Pinpoint) */
.gs-cursor-core {
  position: fixed;
  top: 0;
  left: 0;
  width: 10px;
  height: 10px;
  margin-left: -5px;
  margin-top: -5px;
  pointer-events: none;
  will-change: transform;
  display: flex;
  align-items: center;
  justify-content: center;
}

.gs-cursor-core-gem {
  width: 7px;
  height: 7px;
  border-radius: 2px;
  transform: rotate(45deg);
  background: #ffffff;
  box-shadow:
    0 0 10px #ffffff,
    0 0 18px var(--neon-cyan, #38bdf8),
    0 0 28px var(--electric-blue, #3b82f6);
  transition:
    transform 0.22s cubic-bezier(0.16, 1, 0.3, 1),
    width 0.2s ease,
    height 0.2s ease,
    border-radius 0.2s ease,
    background 0.25s ease,
    opacity 0.2s ease;
}

/* Outer Spring-Lagging Quantum Telemetry Reticle */
.gs-cursor-reticle {
  position: fixed;
  top: 0;
  left: 0;
  width: 44px;
  height: 44px;
  margin-left: -22px;
  margin-top: -22px;
  pointer-events: none;
  will-change: transform;
  display: flex;
  align-items: center;
  justify-content: center;
}

.gs-cursor-svg {
  width: 100%;
  height: 100%;
  overflow: visible;
  transition:
    transform 0.28s cubic-bezier(0.16, 1, 0.3, 1),
    opacity 0.22s ease;
}

.gs-reticle-ring-outer {
  fill: none;
  stroke: var(--neon-cyan, #38bdf8);
  stroke-width: 1.4;
  stroke-dasharray: 22 14;
  stroke-linecap: round;
  opacity: 0.85;
  transform-origin: 24px 24px;
  animation: gsReticleSpinCW 8s linear infinite;
  transition: stroke 0.25s ease, stroke-width 0.25s ease, opacity 0.25s ease;
}

.gs-reticle-ring-inner {
  fill: none;
  stroke: var(--electric-blue, #60a5fa);
  stroke-width: 1;
  stroke-dasharray: 8 10;
  stroke-linecap: round;
  opacity: 0.6;
  transform-origin: 24px 24px;
  animation: gsReticleSpinCCW 5.5s linear infinite;
  transition: stroke 0.25s ease, opacity 0.25s ease;
}

.gs-reticle-ticks line {
  stroke: var(--neon-cyan, #38bdf8);
  stroke-width: 1.3;
  stroke-linecap: round;
  opacity: 0.72;
  transition: stroke 0.25s ease, opacity 0.25s ease;
}

@keyframes gsReticleSpinCW {
  from { transform: rotate(0deg); }
  to   { transform: rotate(360deg); }
}

@keyframes gsReticleSpinCCW {
  from { transform: rotate(360deg); }
  to   { transform: rotate(0deg); }
}

/* Contextual Micro-Label Pill inside Reticle (for View/Explore cards) */
.gs-cursor-label {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%) scale(0.7);
  padding: 5px 12px;
  border-radius: 999px;
  background: rgba(6, 12, 28, 0.9);
  border: 1px solid var(--neon-cyan, #38bdf8);
  color: #ffffff;
  font-family: var(--font-mono, monospace);
  font-size: 0.64rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  white-space: nowrap;
  box-shadow: 0 6px 24px rgba(0, 0, 0, 0.45), 0 0 18px var(--btn-glow, rgba(56, 189, 248, 0.35));
  backdrop-filter: blur(8px);
  opacity: 0;
  transition:
    opacity 0.22s ease,
    transform 0.28s cubic-bezier(0.34, 1.56, 0.64, 1);
}

/* --------------------------------------------------------------------------
   Cursor Interactive States
   -------------------------------------------------------------------------- */

/* 1. Hovering Buttons / Primary CTAs: Target-Lock Expansion */
.gs-cursor-root.is-cta .gs-cursor-svg {
  transform: scale(1.38);
}

.gs-cursor-root.is-cta .gs-reticle-ring-outer {
  stroke-dasharray: 14 6;
  stroke-width: 1.8;
  opacity: 1;
  animation-duration: 3.5s;
}

.gs-cursor-root.is-cta .gs-cursor-core-gem {
  transform: rotate(45deg) scale(1.35);
}

/* 2. Hovering Links / Tabs / Filter Pills */
.gs-cursor-root.is-link .gs-cursor-svg {
  transform: scale(1.18);
}

.gs-cursor-root.is-link .gs-reticle-ring-outer {
  stroke-dasharray: 28 8;
  opacity: 0.95;
}

.gs-cursor-root.is-link .gs-cursor-core-gem {
  transform: rotate(0deg) scale(1.15);
  border-radius: 50%;
}

/* 3. Hovering Portfolio / Service Cards: Contextual Pill Label */
.gs-cursor-root.is-card .gs-cursor-svg {
  transform: scale(1.55);
  opacity: 0.35;
}

.gs-cursor-root.is-card .gs-cursor-core-gem {
  opacity: 0;
  transform: scale(0.4);
}

.gs-cursor-root.is-card .gs-cursor-label {
  opacity: 1;
  transform: translate(-50%, -50%) scale(1);
}

/* 4. Hovering Inputs / Textareas: Sleek Vertical Cyber I-Beam */
.gs-cursor-root.is-text .gs-cursor-svg {
  transform: scale(0.45);
  opacity: 0.18;
}

.gs-cursor-root.is-text .gs-cursor-core-gem {
  width: 2px;
  height: 20px;
  border-radius: 2px;
  transform: rotate(0deg);
  background: var(--neon-cyan, #38bdf8);
  box-shadow: 0 0 12px var(--neon-cyan, #38bdf8);
}

/* 5. Active Click / Press Snap */
.gs-cursor-root.is-pressed .gs-cursor-svg {
  transform: scale(0.76) !important;
}

.gs-cursor-root.is-pressed .gs-cursor-core-gem {
  transform: rotate(45deg) scale(0.8);
}

/* --------------------------------------------------------------------------
   Light Mode Calibrations
   -------------------------------------------------------------------------- */
body[data-mode="light"] .gs-cursor-core-gem {
  background: var(--primary-blue, #2563eb);
  box-shadow:
    0 0 0 2px rgba(255, 255, 255, 0.92),
    0 0 14px var(--btn-glow, rgba(37, 99, 235, 0.45));
}

body[data-mode="light"] .gs-reticle-ring-outer {
  stroke: var(--primary-blue, #2563eb);
  opacity: 0.9;
}

body[data-mode="light"] .gs-reticle-ring-inner {
  stroke: var(--ai-purple, #4f46e5);
  opacity: 0.65;
}

body[data-mode="light"] .gs-reticle-ticks line {
  stroke: var(--primary-blue, #2563eb);
}

body[data-mode="light"] .gs-cursor-label {
  background: rgba(15, 23, 42, 0.94);
  color: #ffffff;
}

/* Magnetic CTA Smooth Spring Transition */
@media (pointer: fine) and (hover: hover) {
  html.gs-cursor-enabled .gs-magnetic {
    transition: translate 0.32s cubic-bezier(0.16, 1, 0.3, 1);
  }
}

/* Hide on touch / coarse pointers or reduced motion */
@media (pointer: coarse), (hover: none), (prefers-reduced-motion: reduce) {
  #gs-cursor-canvas,
  .gs-cursor-root {
    display: none !important;
  }
}
