/* =============================================
   WANTED MUSIC - Animations
   wanted-music.com
   ============================================= */

/* =============================================
   Scroll Progress
   ============================================= */

@property --scroll-pct {
  syntax: "<number>";
  initial-value: 0;
  inherits: false;
}

.scroll-progress {
  position: fixed;
  top: 0;
  left: 0;
  z-index: 2000;
  height: 3px;
  width: calc(var(--scroll-pct) * 100%);
  background: linear-gradient(90deg, #ff1f32, #cf1223, #7a0d19);
  box-shadow: 0 0 18px rgba(255, 31, 50, 0.45);
  transition: width 80ms linear;
}

/* =============================================
   Electric Rain Background
   ============================================= */

.electric-rain-canvas {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 1;
  opacity: 0.54;
  filter: saturate(1.12) contrast(1.06);
  mix-blend-mode: screen;
}

/* =============================================
   Page Loader
   ============================================= */

.loader {
  position: fixed;
  inset: 0;
  z-index: 3000;
  display: grid;
  place-items: center;
  background: #040404;
  transition: opacity 550ms var(--ease-expo), visibility 550ms var(--ease-expo);
}

.loader.hidden {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.loader-wrap {
  width: min(86vw, 520px);
  display: grid;
  gap: 1rem;
  text-align: center;
}

.loader-logo {
  margin: 0 auto;
  width: 92px;
  height: 92px;
}

.loader-logo path {
  stroke-dasharray: 340;
  stroke-dashoffset: 340;
  animation: logo-draw 1.8s ease-out forwards;
}

.loader-bar {
  height: 5px;
  border-radius: var(--radius-full);
  overflow: hidden;
  background: rgba(255, 255, 255, 0.09);
}

.loader-bar span {
  display: block;
  width: 0;
  height: 100%;
  background: linear-gradient(90deg, #ff1f32, #b80f20);
  animation: load-progress 2s ease forwards;
}

/* =============================================
   Cursor
   ============================================= */

.cursor-dot,
.cursor-outline {
  position: fixed;
  top: 0;
  left: 0;
  pointer-events: none;
  z-index: 2100;
  opacity: 0;
  transition: transform var(--t-fast), opacity var(--t-fast);
}

.cursor-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #ffffff;
  transform: translate(-50%, -50%);
}

.cursor-outline {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: 1px solid rgba(255, 31, 50, 0.75);
  transform: translate(-50%, -50%);
  mix-blend-mode: difference;
}

.cursor-enabled .cursor-dot,
.cursor-enabled .cursor-outline {
  opacity: 1;
}

.cursor-hover .cursor-outline {
  transform: translate(-50%, -50%) scale(2.5);
}

.cursor-click .cursor-dot {
  transform: translate(-50%, -50%) scale(0.6);
}

/* =============================================
   Reveal / Text
   ============================================= */

@property --angle {
  syntax: "<angle>";
  initial-value: 120deg;
  inherits: false;
}

.text-gradient-animated {
  background: linear-gradient(var(--angle), #ff3042, #c31225, #7a0d19);
  background-size: 160% 160%;
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  animation: gradient-rotate 5s linear infinite;
}

/* =============================================
   Retro Red Titles (Always On)
   ============================================= */

.retro-scan-title {
  position: relative;
  color: #ffffff;
  -webkit-text-fill-color: #ffffff;
  background: none;
  text-shadow:
    0 0 1px rgba(255, 255, 255, 0.55),
    0 0 10px rgba(255, 31, 50, 0.2);
}

.retro-scan-title.text-gradient-animated {
  background: none !important;
  color: #ffffff !important;
  -webkit-text-fill-color: #ffffff !important;
  animation: none;
}

.retro-scan-title::after {
  content: attr(data-retro-text);
  position: absolute;
  inset: 0;
  color: transparent;
  -webkit-text-fill-color: transparent;
  background-image: linear-gradient(
    115deg,
    rgba(255, 31, 50, 0) 34%,
    rgba(255, 31, 50, 0.12) 40%,
    rgba(255, 31, 50, 0.95) 48%,
    rgba(255, 180, 188, 0.65) 52%,
    rgba(255, 31, 50, 0.16) 57%,
    rgba(255, 31, 50, 0) 62%
  );
  background-size: 240% 100%;
  background-position: 120% 50%;
  -webkit-background-clip: text;
  background-clip: text;
  text-shadow: 0 0 14px rgba(255, 31, 50, 0.55);
  mix-blend-mode: screen;
  pointer-events: none;
  animation: retro-scan-sweep 2.6s linear infinite;
}

.hero-title.retro-scan-title::after {
  background-image: linear-gradient(
    90deg,
    rgba(255, 31, 50, 0) 0%,
    rgba(255, 31, 50, 0) 40%,
    rgba(255, 31, 50, 0.16) 46%,
    rgba(255, 31, 50, 0.98) 50%,
    rgba(255, 183, 189, 0.72) 54%,
    rgba(255, 31, 50, 0.18) 59%,
    rgba(255, 31, 50, 0) 66%,
    rgba(255, 31, 50, 0) 100%
  );
  background-size: 230% 100%;
  background-position: -130% 50%;
  text-shadow:
    0 0 16px rgba(255, 31, 50, 0.66),
    0 0 32px rgba(255, 31, 50, 0.44);
  animation: hero-red-traverse 3.1s linear infinite;
}

.nav-live-text.is-swapping {
  animation: nav-live-text-swap 420ms var(--ease-expo);
}

.reveal {
  opacity: 0;
  transform: translate3d(0, 34px, 0) scale(0.965) rotateX(8deg);
  transform-origin: 50% 100%;
  filter: blur(12px) saturate(0.88);
}

.reveal.in-view {
  opacity: 1;
  transform: translate3d(0, 0, 0) scale(1) rotateX(0deg);
  filter: blur(0) saturate(1);
  transition:
    transform 820ms var(--ease-expo),
    opacity 760ms var(--ease-expo),
    filter 880ms var(--ease-expo);
  transition-delay: var(--reveal-delay, 0ms);
}

.reveal-clip {
  clip-path: inset(100% 0 0 0);
  opacity: 0;
  filter: blur(10px);
}

.reveal-clip.in-view {
  clip-path: inset(0 0 0 0);
  opacity: 1;
  filter: blur(0);
  transition:
    clip-path 760ms var(--ease-expo),
    opacity 700ms var(--ease-expo),
    filter 760ms var(--ease-expo);
  transition-delay: var(--reveal-delay, 0ms);
}

@supports (animation-timeline: view()) {
  .use-view-timeline .reveal {
    opacity: 0;
    transform: translateY(20px);
    animation: fade-in linear both;
    animation-timeline: view();
    animation-range: entry 0% entry 70%;
  }

  .use-view-timeline .reveal-clip {
    clip-path: inset(100% 0 0 0);
    animation: clip-reveal linear both;
    animation-timeline: view();
    animation-range: entry 0% entry 60%;
  }
}

.stagger-1 {
  transition-delay: 0ms;
}

.stagger-2 {
  transition-delay: 80ms;
}

.stagger-3 {
  transition-delay: 160ms;
}

.stagger-4 {
  transition-delay: 240ms;
}

/* =============================================
   Grain Overlay
   ============================================= */

body::after {
  content: "";
  position: fixed;
  inset: -100%;
  z-index: 9999;
  pointer-events: none;
  opacity: 0.022;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='180' height='180' viewBox='0 0 180 180'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='1.15' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='180' height='180' filter='url(%23n)' opacity='0.5'/%3E%3C/svg%3E");
  animation: grain 0.4s steps(3) infinite;
}

/* =============================================
   Keyframes
   ============================================= */

@keyframes logo-draw {
  to {
    stroke-dashoffset: 0;
  }
}

@keyframes load-progress {
  to {
    width: 100%;
  }
}

@keyframes gradient-rotate {
  to {
    --angle: 480deg;
    background-position: 100% 50%;
  }
}

@keyframes retro-scan-sweep {
  0%,
  8% {
    background-position: 120% 50%;
    opacity: 0.12;
  }

  18% {
    opacity: 1;
  }

  78% {
    opacity: 0.55;
  }

  100% {
    background-position: -120% 50%;
    opacity: 0.12;
  }
}

@keyframes hero-red-traverse {
  0%,
  8% {
    background-position: -130% 50%;
    opacity: 0.16;
  }

  20% {
    opacity: 1;
  }

  80% {
    opacity: 0.72;
  }

  100% {
    background-position: 130% 50%;
    opacity: 0.16;
  }
}

@keyframes nav-live-dot-pulse {
  0%,
  100% {
    transform: scale(0.88);
    opacity: 0.72;
  }

  50% {
    transform: scale(1.22);
    opacity: 1;
  }
}

@keyframes nav-live-text-swap {
  0% {
    opacity: 0;
    transform: translateY(6px);
    filter: blur(3px);
  }

  100% {
    opacity: 1;
    transform: translateY(0);
    filter: blur(0);
  }
}

@keyframes fade-in {
  from {
    opacity: 0;
    transform: translate3d(0, 34px, 0) scale(0.965) rotateX(8deg);
    filter: blur(12px) saturate(0.88);
  }

  to {
    opacity: 1;
    transform: translate3d(0, 0, 0) scale(1) rotateX(0deg);
    filter: blur(0) saturate(1);
  }
}

@keyframes clip-reveal {
  from {
    clip-path: inset(100% 0 0 0);
    opacity: 0;
    filter: blur(10px);
  }

  to {
    clip-path: inset(0 0 0 0);
    opacity: 1;
    filter: blur(0);
  }
}

@keyframes eq {
  0%,
  100% {
    height: 20%;
  }

  50% {
    height: 100%;
  }
}

@keyframes bounce {
  0%,
  100% {
    transform: translateY(0);
  }

  50% {
    transform: translateY(6px);
  }
}

@keyframes grain {
  0% {
    transform: translate(0, 0);
  }

  25% {
    transform: translate(8%, -5%);
  }

  50% {
    transform: translate(-8%, 4%);
  }

  75% {
    transform: translate(6%, 8%);
  }

  100% {
    transform: translate(0, 0);
  }
}

@keyframes heroAmbientShift {
  0% {
    transform: scale(1) translate3d(0, 0, 0);
    filter: saturate(1);
  }

  50% {
    transform: scale(1.035) translate3d(-1.5%, 1.2%, 0);
    filter: saturate(1.06);
  }

  100% {
    transform: scale(1.02) translate3d(1.6%, -1.1%, 0);
    filter: saturate(1.02);
  }
}

@keyframes pageAmbientShift {
  0% {
    transform: scale(1) translate3d(0, 0, 0);
    opacity: 0.95;
  }

  50% {
    transform: scale(1.03) translate3d(-1.2%, 1%, 0);
    opacity: 1;
  }

  100% {
    transform: scale(1.02) translate3d(1.4%, -1.1%, 0);
    opacity: 0.96;
  }
}

/* =============================================
   Reduced Motion
   ============================================= */

@media (prefers-reduced-motion: reduce) {
  .scroll-progress,
  .loader,
  .cursor-dot,
  .cursor-outline,
  .text-gradient-animated,
  body::after,
  .hero::before,
  .page-hero::before {
    animation: none;
    transition: none;
  }

  .retro-scan-title::after {
    animation: none;
    background-position: 50% 50%;
    opacity: 0.35;
  }

  .nav-live-dot,
  .nav-live-text.is-swapping {
    animation: none;
  }

  .reveal,
  .reveal-clip {
    opacity: 1;
    transform: none;
    filter: none;
    clip-path: inset(0 0 0 0);
  }
}

@media (hover: none) {
  .cursor-dot,
  .cursor-outline {
    display: none;
  }
}
