/* ═══ POWER MODE — floating HUDs, scroll FX, cursor ═══ */

.scroll-progress {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  z-index: 200;
  background: rgba(255, 255, 255, 0.04);
  pointer-events: none;
}
.scroll-progress i {
  display: block;
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, var(--accent), var(--accent-2));
  box-shadow: 0 0 12px var(--accent-glow);
  transition: width 0.08s linear;
}

.cursor-ring {
  position: fixed;
  width: 36px;
  height: 36px;
  border: 1px solid rgba(0, 255, 163, 0.35);
  border-radius: 50%;
  pointer-events: none;
  z-index: 9998;
  transform: translate(-50%, -50%);
  transition: width 0.35s var(--ease-fluid, ease), height 0.35s, border-color 0.25s, opacity 0.25s;
  mix-blend-mode: screen;
}
.cursor-ring.is-hover {
  width: 56px;
  height: 56px;
  border-color: rgba(0, 255, 163, 0.6);
}
.cursor-dot {
  position: fixed;
  width: 6px;
  height: 6px;
  background: var(--accent);
  border-radius: 50%;
  pointer-events: none;
  z-index: 9999;
  transform: translate(-50%, -50%);
  box-shadow: 0 0 10px var(--accent);
}

/* Floating HUD layer */
.float-layer {
  position: fixed;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  overflow: hidden;
}

.float-hud {
  position: absolute;
  padding: 0.55rem 0.65rem;
  border: 1px solid rgba(0, 255, 163, 0.12);
  border-radius: 10px;
  background: rgba(8, 8, 10, 0.75);
  backdrop-filter: blur(12px);
  box-shadow:
    0 20px 50px rgba(0, 0, 0, 0.4),
    0 0 30px rgba(0, 255, 163, 0.04),
    inset 0 1px 0 rgba(255, 255, 255, 0.05);
  will-change: transform;
  opacity: 0;
  animation: hudFadeIn 1.2s var(--ease-fluid, ease) forwards;
}
.float-hud .mono {
  font-size: 0.5rem;
  display: block;
  margin-bottom: 0.25rem;
  opacity: 0.7;
}
@keyframes hudFadeIn {
  to { opacity: var(--hud-opacity, 0.55); }
}

.float-hud--1 { top: 18%; right: 4%; width: 130px; --hud-opacity: 0.5; animation-delay: 0.2s; }
.float-hud--2 { top: 42%; left: 2%; width: 118px; --hud-opacity: 0.45; animation-delay: 0.5s; }
.float-hud--3 { top: 62%; right: 6%; width: 140px; --hud-opacity: 0.48; animation-delay: 0.8s; }
.float-hud--4 { top: 78%; left: 5%; width: 125px; --hud-opacity: 0.42; animation-delay: 1.1s; }
.float-hud--5 { top: 28%; left: 8%; width: 110px; --hud-opacity: 0.38; animation-delay: 0.35s; }
.float-hud--6 { top: 52%; right: 12%; width: 115px; --hud-opacity: 0.4; animation-delay: 0.65s; }

.float-hud__kpi b {
  font-size: 0.95rem;
  color: var(--accent);
  display: block;
  line-height: 1;
}
.float-hud__kpi small {
  font-family: var(--mono);
  font-size: 0.48rem;
  color: var(--text-muted);
}
.float-hud__bars {
  display: flex;
  gap: 3px;
  align-items: flex-end;
  height: 28px;
  margin-top: 0.25rem;
}
.float-hud__bars i {
  flex: 1;
  height: var(--h);
  background: linear-gradient(180deg, var(--accent), transparent);
  border-radius: 2px 2px 0 0;
  opacity: 0.65;
  animation: barPulse 2.5s ease-in-out infinite;
}
.float-hud__bars i:nth-child(2) { animation-delay: 0.3s; }
.float-hud__bars i:nth-child(3) { animation-delay: 0.6s; }
.float-hud__bars i:nth-child(4) { animation-delay: 0.9s; }
@keyframes barPulse {
  0%, 100% { opacity: 0.5; transform: scaleY(1); }
  50% { opacity: 0.85; transform: scaleY(1.08); }
}

.float-hud__term {
  font-family: var(--mono);
  font-size: 0.48rem;
  line-height: 1.65;
  color: var(--text-muted);
}
.float-hud__term .k { color: var(--accent); }

.float-hud__tg {
  font-size: 0.52rem;
  color: var(--accent-2);
  padding: 0.3rem 0.45rem;
  border-radius: 6px;
  background: rgba(0, 136, 204, 0.15);
  text-align: center;
  margin-top: 0.2rem;
}

.float-hud__flow {
  display: flex;
  align-items: center;
  gap: 2px;
  font-family: var(--mono);
  font-size: 0.45rem;
  margin-top: 0.25rem;
  flex-wrap: wrap;
}
.float-hud__flow span {
  padding: 0.2rem 0.35rem;
  border: 1px solid var(--border);
  border-radius: 4px;
  color: var(--text-muted);
}
.float-hud__flow span.on { color: var(--accent); border-color: rgba(0,255,163,0.3); }

/* Drift animation base */
.float-hud {
  animation: hudFadeIn 1.2s ease forwards, hudDrift 8s ease-in-out infinite;
}
.float-hud--1 { animation: hudFadeIn 1.2s 0.2s ease forwards, hudDrift1 9s ease-in-out infinite; }
.float-hud--2 { animation: hudFadeIn 1.2s 0.5s ease forwards, hudDrift2 11s ease-in-out infinite; }
.float-hud--3 { animation: hudFadeIn 1.2s 0.8s ease forwards, hudDrift3 10s ease-in-out infinite; }
.float-hud--4 { animation: hudFadeIn 1.2s 1.1s ease forwards, hudDrift4 12s ease-in-out infinite; }
.float-hud--5 { animation: hudFadeIn 1.2s 0.35s ease forwards, hudDrift2 13s ease-in-out infinite; }
.float-hud--6 { animation: hudFadeIn 1.2s 0.65s ease forwards, hudDrift1 10s ease-in-out infinite; }

@keyframes hudDrift1 {
  0%, 100% { transform: translate(0, 0) rotate(0deg); }
  50% { transform: translate(-12px, 18px) rotate(-1deg); }
}
@keyframes hudDrift2 {
  0%, 100% { transform: translate(0, 0) rotate(0deg); }
  50% { transform: translate(15px, -14px) rotate(1deg); }
}
@keyframes hudDrift3 {
  0%, 100% { transform: translate(0, 0); }
  33% { transform: translate(-8px, 10px); }
  66% { transform: translate(10px, -8px); }
}
@keyframes hudDrift4 {
  0%, 100% { transform: translate(0, 0) rotate(0deg); }
  50% { transform: translate(8px, 16px) rotate(0.5deg); }
}

/* Scroll-triggered section FX */
.scroll-section {
  --scroll-p: 0;
  position: relative;
}

.scroll-section.in-view .section-title {
  animation: titleSlide 0.9s var(--ease-fluid, cubic-bezier(0.16, 1, 0.3, 1)) both;
}
.scroll-section.in-view .section-num {
  animation: fadeSlide 0.7s var(--ease-fluid, ease) both;
}

@keyframes titleSlide {
  from { opacity: 0; transform: translateY(40px); filter: blur(8px); }
  to { opacity: 1; transform: none; filter: none; }
}
@keyframes fadeSlide {
  from { opacity: 0; transform: translateX(-16px); }
  to { opacity: 1; transform: none; }
}

/* Enhanced reveal variants */
.reveal-scale {
  opacity: 0;
  transform: translateY(50px) scale(0.94);
  transition: opacity 1s var(--ease-fluid, ease), transform 1s var(--ease-fluid, ease), filter 1s;
  filter: blur(10px);
}
.reveal-scale.is-visible {
  opacity: 1;
  transform: none;
  filter: none;
}

.reveal-left {
  opacity: 0;
  transform: translateX(-40px);
  transition: opacity 0.9s var(--ease-fluid, ease), transform 0.9s var(--ease-fluid, ease);
}
.reveal-left.is-visible { opacity: 1; transform: none; }

.reveal-right {
  opacity: 0;
  transform: translateX(40px);
  transition: opacity 0.9s var(--ease-fluid, ease), transform 0.9s var(--ease-fluid, ease);
}
.reveal-right.is-visible { opacity: 1; transform: none; }

/* Stagger grid children on scroll */
.stagger-grid.is-visible > * {
  animation: staggerIn 0.7s var(--ease-fluid, ease) backwards;
}
.stagger-grid.is-visible > *:nth-child(1) { animation-delay: 0.05s; }
.stagger-grid.is-visible > *:nth-child(2) { animation-delay: 0.1s; }
.stagger-grid.is-visible > *:nth-child(3) { animation-delay: 0.15s; }
.stagger-grid.is-visible > *:nth-child(4) { animation-delay: 0.2s; }
.stagger-grid.is-visible > *:nth-child(5) { animation-delay: 0.25s; }
.stagger-grid.is-visible > *:nth-child(6) { animation-delay: 0.3s; }
.stagger-grid.is-visible > *:nth-child(n+7) { animation-delay: 0.35s; }

@keyframes staggerIn {
  from { opacity: 0; transform: translateY(28px) scale(0.96); }
  to { opacity: 1; transform: none; }
}

/* Section glow on enter */
.scroll-section.in-view::before {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse 60% 40% at 50% 0%, rgba(0, 255, 163, 0.04), transparent);
  pointer-events: none;
  animation: sectionGlow 1.5s ease both;
}
@keyframes sectionGlow {
  from { opacity: 0; }
  to { opacity: 1; }
}

/* Magnetic btn hint */
.btn--primary {
  position: relative;
  overflow: hidden;
}
.btn--primary::after {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at var(--bx, 50%) var(--by, 50%), rgba(255,255,255,0.25), transparent 60%);
  opacity: 0;
  transition: opacity 0.3s;
}
.btn--primary:hover::after { opacity: 1; }

/* Mesh canvas overlay */
#mesh-canvas {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  opacity: 0.35;
}

/* Stronger cursor glow desktop */
@media (pointer: fine) and (min-width: 769px) {
  body:hover .cursor-glow { opacity: 0.35; }
  .cursor-glow {
    width: 700px;
    height: 700px;
  }
}

@media (max-width: 768px) {
  .float-layer,
  .cursor-ring,
  .cursor-dot,
  #mesh-canvas {
    display: none !important;
  }
  .scroll-section.in-view .section-title {
    animation: none;
    filter: none;
  }
  .reveal-scale { filter: none !important; }
}

@media (prefers-reduced-motion: reduce) {
  .float-hud { animation: none !important; opacity: 0.3 !important; }
  .reveal-scale, .reveal-left, .reveal-right { filter: none; transition: opacity 0.3s; }
  .stagger-grid.is-visible > * { animation: none; }
}
