/* ═══════════════════════════════════════════════════════════
   FUTURISTIC UI — cutting-edge interactions & effects
   ═══════════════════════════════════════════════════════════ */

/* ─── CUSTOM MORPHING CURSOR ─── */
.fx-cursor {
  position: fixed;
  width: 20px; height: 20px;
  border: 2px solid var(--blue);
  border-radius: 50%;
  pointer-events: none;
  z-index: 99998;
  transition: width 0.35s cubic-bezier(0.23,1,0.32,1),
              height 0.35s cubic-bezier(0.23,1,0.32,1),
              border-radius 0.35s cubic-bezier(0.23,1,0.32,1),
              background 0.35s ease,
              border-color 0.35s ease,
              opacity 0.2s ease;
  transform: translate(-50%, -50%);
  opacity: 0;
}
.fx-cursor.visible { opacity: 1; }
.fx-cursor.hover-link {
  width: 56px; height: 56px;
  background: rgba(27,79,216,0.08);
  border-color: var(--blue);
}
.fx-cursor.hover-text {
  width: 4px; height: 28px;
  border-radius: 2px;
  background: var(--blue);
  border-color: var(--blue);
  mix-blend-mode: normal;
  backdrop-filter: none;
}
.fx-cursor.hover-card {
  width: 80px; height: 80px;
  border-radius: 20px;
  background: rgba(27,79,216,0.04);
  border-color: rgba(27,79,216,0.3);
}
.fx-cursor.hover-input {
  width: 4px; height: 22px;
  border-radius: 2px;
  background: var(--blue);
  border-color: var(--blue);
  mix-blend-mode: normal;
  backdrop-filter: none;
}
.fx-cursor.clicking {
  transform: translate(-50%, -50%) scale(0.75);
}

/* ─── PROXIMITY GLOW ─── */
.fx-glow {
  position: relative;
  overflow: visible;
}
.fx-glow::before {
  content: '';
  position: absolute;
  inset: -2px;
  border-radius: inherit;
  background: radial-gradient(
    600px circle at var(--glow-x, 50%) var(--glow-y, 50%),
    rgba(27,79,216,0.12),
    transparent 40%
  );
  opacity: 0;
  transition: opacity 0.4s ease;
  pointer-events: none;
  z-index: 0;
}
.fx-glow.glowing::before { opacity: 1; }
[data-theme="dark"] .fx-glow::before {
  background: radial-gradient(
    600px circle at var(--glow-x, 50%) var(--glow-y, 50%),
    rgba(100,149,237,0.15),
    transparent 40%
  );
}

/* ─── TEXT SCRAMBLE/DECODE ─── */
.fx-scramble .char {
  display: inline;
  opacity: 0;
  filter: blur(8px);
  transition: opacity 0.3s ease, filter 0.4s ease;
}
.fx-scramble .char.decoded {
  opacity: 1;
  filter: blur(0);
}
/* Preserve original formatting inside scrambled headings */
.fx-scramble em { font-style: italic; }
.fx-scramble strong { font-weight: 700; }

/* ─── AURORA BOREALIS BACKGROUND ─── */
.fx-aurora {
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  opacity: 0.35;
  overflow: hidden;
}
[data-theme="dark"] .fx-aurora { opacity: 0.2; }
.fx-aurora-layer {
  position: absolute;
  width: 200%;
  height: 200%;
  top: -50%;
  left: -50%;
  background: conic-gradient(
    from var(--aurora-angle, 0deg) at 50% 50%,
    transparent 0%,
    rgba(27,79,216,0.06) 10%,
    transparent 20%,
    rgba(14,159,110,0.04) 30%,
    transparent 40%,
    rgba(167,139,250,0.05) 50%,
    transparent 60%,
    rgba(27,79,216,0.04) 70%,
    transparent 80%,
    rgba(14,159,110,0.06) 90%,
    transparent 100%
  );
  animation: fx-aurora-spin 30s linear infinite;
  filter: blur(80px);
}
.fx-aurora-layer:nth-child(2) {
  animation-duration: 45s;
  animation-direction: reverse;
  opacity: 0.7;
}
@keyframes fx-aurora-spin {
  to { transform: rotate(360deg); }
}

/* ─── SCROLL PROGRESS HELIX ─── */
.fx-scroll-helix {
  position: fixed;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  width: 6px;
  height: 120px;
  z-index: 9000;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.3s ease;
}
.fx-scroll-helix.visible { opacity: 1; }
.fx-scroll-helix canvas { width: 100%; height: 100%; }

/* ─── KEYBOARD SPOTLIGHT ─── */
.fx-spotlight {
  position: fixed;
  width: 200px; height: 200px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(27,79,216,0.1) 0%, transparent 70%);
  pointer-events: none;
  z-index: 99990;
  transform: translate(-50%, -50%);
  opacity: 0;
  transition: opacity 0.4s ease, left 0.3s cubic-bezier(0.23,1,0.32,1), top 0.3s cubic-bezier(0.23,1,0.32,1);
}
.fx-spotlight.on { opacity: 1; }
[data-theme="dark"] .fx-spotlight {
  background: radial-gradient(circle, rgba(100,149,237,0.12) 0%, transparent 70%);
}

/* ─── SMOOTH PAGE TRANSITIONS ─── */
.fx-page-exit {
  animation: fx-exit 0.3s ease forwards;
}
.fx-page-enter {
  animation: fx-enter 0.4s cubic-bezier(0.23,1,0.32,1) forwards;
}
@keyframes fx-exit {
  to { opacity: 0; transform: translateY(-12px); }
}
@keyframes fx-enter {
  from { opacity: 0; transform: translateY(16px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ─── SCROLL VELOCITY WARP ─── */
.fx-warp {
  transition: transform 0.15s ease;
}
/* Never warp elements that rely on overflow clipping */
.testi-carousel .fx-warp,
.testi-carousel.fx-warp { transform: none !important; }

/* ─── AMBIENT TIME GRADIENT ─── */
.fx-ambient-bar {
  position: fixed;
  top: 0; left: 0; right: 0;
  height: 2px;
  z-index: 201;
  pointer-events: none;
  opacity: 0.7;
  background: linear-gradient(90deg,
    var(--ambient-c1, #1B4FD8),
    var(--ambient-c2, #0E9F6E),
    var(--ambient-c3, #A78BFA)
  );
}

/* ─── RIPPLE EFFECT ─── */
.fx-ripple {
  position: absolute;
  border-radius: 50%;
  background: rgba(27,79,216,0.15);
  transform: scale(0);
  animation: fx-ripple-expand 0.6s ease-out forwards;
  pointer-events: none;
}
[data-theme="dark"] .fx-ripple {
  background: rgba(100,149,237,0.12);
}
@keyframes fx-ripple-expand {
  to { transform: scale(4); opacity: 0; }
}

/* ─── FLOATING ACTION ORBS ─── */
.fx-orb-container {
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  overflow: hidden;
}
.fx-orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(60px);
  opacity: 0;
  animation: fx-orb-float 20s ease-in-out infinite;
}
.fx-orb:nth-child(1) {
  width: 300px; height: 300px;
  background: rgba(27,79,216,0.06);
  top: 20%; left: 10%;
  animation-delay: 0s;
}
.fx-orb:nth-child(2) {
  width: 250px; height: 250px;
  background: rgba(14,159,110,0.05);
  top: 60%; right: 10%;
  animation-delay: -7s;
}
.fx-orb:nth-child(3) {
  width: 200px; height: 200px;
  background: rgba(167,139,250,0.05);
  bottom: 20%; left: 40%;
  animation-delay: -14s;
}
@keyframes fx-orb-float {
  0%, 100% { transform: translateY(0) translateX(0); opacity: 0.4; }
  25% { transform: translateY(-30px) translateX(15px); opacity: 0.7; }
  50% { transform: translateY(-10px) translateX(-20px); opacity: 0.5; }
  75% { transform: translateY(-40px) translateX(10px); opacity: 0.8; }
}

/* ─── PARALLAX DEPTH ON SCROLL ─── */
[data-depth] {
  will-change: translate;
  transition: translate 0.1s linear;
}

/* ─── HAPTIC-FEEDBACK TAP FLASH ─── */
.fx-tap-flash {
  animation: fx-tap 0.15s ease;
}
@keyframes fx-tap {
  0% { transform: scale(1); }
  50% { transform: scale(0.97); }
  100% { transform: scale(1); }
}

/* ─── RESPECT USER PREFERENCES ─── */
@media (prefers-reduced-motion: reduce) {
  .fx-cursor, .fx-aurora, .fx-scroll-helix,
  .fx-spotlight, .fx-orb-container, .fx-ambient-bar { display: none !important; }
  .fx-scramble .char { opacity: 1 !important; filter: none !important; transform: none !important; }
  [data-depth] { transform: none !important; }
  .fx-warp { filter: none !important; }
}

/* ─── HIDE CURSOR EFFECTS ON TOUCH ─── */
@media (hover: none) {
  .fx-cursor { display: none !important; }
  .fx-spotlight { display: none !important; }
}

/* ─── MOBILE: TONE DOWN HEAVY EFFECTS ─── */
@media (max-width: 768px) {
  .fx-aurora-layer { filter: blur(100px); }
  .fx-scroll-helix { display: none; }
  .fx-orb { filter: blur(80px); }
  .fx-orb:nth-child(1) { width: 200px; height: 200px; }
  .fx-orb:nth-child(2) { width: 160px; height: 160px; }
  .fx-orb:nth-child(3) { width: 120px; height: 120px; }
}
