/* ===== Mouse-reactive layers ===== */

:root {
  --mx: 50vw;
  --my: 50vh;
}

.has-mouse-fx {
  cursor: none;
}

.has-mouse-fx a,
.has-mouse-fx button,
.has-mouse-fx .protocol-card,
.has-mouse-fx .bento-item,
.has-mouse-fx .mouse-fab {
  cursor: none;
}

/* Soft spotlight following cursor */
.mouse-glow {
  position: fixed;
  top: 0;
  left: 0;
  width: 360px;
  height: 360px;
  border-radius: 50%;
  pointer-events: none;
  z-index: 9998;
  background: radial-gradient(
    circle,
    rgba(168, 85, 247, 0.14) 0%,
    rgba(34, 211, 238, 0.06) 35%,
    transparent 70%
  );
  mix-blend-mode: screen;
  transition: opacity 0.35s ease;
  will-change: transform;
}

.mouse-ring {
  position: fixed;
  top: 0;
  left: 0;
  width: 28px;
  height: 28px;
  border: 1.5px solid rgba(168, 85, 247, 0.75);
  border-radius: 50%;
  pointer-events: none;
  z-index: 9999;
  box-shadow: 0 0 12px rgba(168, 85, 247, 0.35), inset 0 0 8px rgba(34, 211, 238, 0.15);
  transition: width 0.2s ease, height 0.2s ease, border-color 0.2s ease, opacity 0.35s ease;
  will-change: transform;
}

.mouse-ring.hover {
  width: 44px;
  height: 44px;
  border-color: rgba(34, 211, 238, 0.9);
  box-shadow: 0 0 20px rgba(34, 211, 238, 0.45);
}

/* Floating action dock */
.mouse-fab-dock {
  position: fixed;
  right: clamp(1rem, 3vw, 2rem);
  bottom: clamp(1.25rem, 4vh, 2.5rem);
  z-index: 9000;
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
  pointer-events: none;
}

.mouse-fab {
  pointer-events: auto;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  min-height: 48px;
  padding: 0.65rem 1.15rem 0.65rem 0.65rem;
  border: 1px solid rgba(168, 85, 247, 0.35);
  border-radius: 999px;
  background: rgba(7, 7, 13, 0.72);
  backdrop-filter: blur(12px);
  color: var(--text, #eaeaf0);
  font-family: var(--font-mono, monospace);
  font-size: 0.74rem;
  letter-spacing: 0.12em;
  text-decoration: none;
  transition: border-color 0.25s, box-shadow 0.25s, background 0.25s;
  will-change: transform;
}

.mouse-fab:hover {
  border-color: rgba(34, 211, 238, 0.55);
  box-shadow: 0 0 24px rgba(168, 85, 247, 0.25);
  background: rgba(12, 12, 22, 0.88);
}

.mouse-fab-icon {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: linear-gradient(135deg, rgba(168, 85, 247, 0.35), rgba(34, 211, 238, 0.2));
  font-size: 1rem;
  flex-shrink: 0;
}

.mouse-fab-label {
  padding-right: 0.25rem;
  white-space: nowrap;
}

/* Reel frame mouse spotlight */
.reel-frame {
  --spot-x: 50%;
  --spot-y: 50%;
  position: relative;
}

.reel-frame::after {
  content: '';
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 3;
  border-radius: inherit;
  background: radial-gradient(
    420px circle at var(--spot-x) var(--spot-y),
    rgba(168, 85, 247, 0.12) 0%,
    transparent 55%
  );
  opacity: 0;
  transition: opacity 0.35s ease;
}

.reel-frame:hover::after {
  opacity: 1;
}

/* Tilt cards */
[data-tilt] {
  transition: transform 0.12s ease-out, box-shadow 0.25s ease;
  transform-style: preserve-3d;
  position: relative;
  overflow: hidden;
}

[data-tilt]::before {
  content: '';
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 2;
  background: radial-gradient(
    280px circle at var(--tilt-x, 50%) var(--tilt-y, 50%),
    rgba(255, 255, 255, 0.08) 0%,
    transparent 60%
  );
  opacity: 0;
  transition: opacity 0.2s ease;
}

[data-tilt]:hover::before {
  opacity: 1;
}

[data-tilt]:hover {
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.45), 0 0 30px rgba(168, 85, 247, 0.12);
}

/* Hero bg smooth parallax transition */
.hero-cinema-bg {
  transition: transform 0.35s ease-out;
  will-change: transform;
}

.hero-cinema-content,
.hero-hud,
.hero-stats-rail {
  transition: transform 0.35s ease-out;
}

/* Section nav magnetic hint */
.section-nav a {
  transition: transform 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}

.section-nav a:hover {
  transform: scale(1.35);
  box-shadow: 0 0 14px rgba(168, 85, 247, 0.5);
}

@media (max-width: 768px) {
  .mouse-fab-dock {
    flex-direction: row;
    right: 50%;
    transform: translateX(50%);
    bottom: 1rem;
  }

  .mouse-fab-label {
    display: none;
  }

  .mouse-glow,
  .mouse-ring {
    display: none;
  }

  .has-mouse-fx {
    cursor: auto;
  }
}
