/* --- Base & Reset --- */
body {
  background-color: #050505;
  color: #EAEAEA;
  overflow-x: hidden;
}

/* --- Noise Texture --- */
.noise-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 50;
  opacity: 0.05;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noiseFilter'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.65' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noiseFilter)'/%3E%3C/svg%3E");
}

/* --- Custom Cursor --- */
.cursor-dot,
.cursor-outline {
  position: fixed;
  top: 0;
  left: 0;
  transform: translate(-50%, -50%);
  border-radius: 50%;
  z-index: 9999;
  pointer-events: none;
}

.cursor-dot {
  width: 8px;
  height: 8px;
  background-color: #FFD700;
}

.cursor-outline {
  width: 40px;
  height: 40px;
  border: 1px solid rgba(255, 215, 0, 0.5);
  transition: width 0.2s, height 0.2s, background-color 0.2s;
}

/* Hover State for Cursor */
body.hovering .cursor-outline {
  width: 60px;
  height: 60px;
  background-color: rgba(255, 215, 0, 0.1);
  border-color: #FFD700;
}

/* --- Tech Effects --- */
.matrix-bg {
  background-image:
    linear-gradient(rgba(18, 16, 16, 0) 50%, rgba(0, 0, 0, 0.25) 50%),
    linear-gradient(90deg, rgba(255, 0, 0, 0.06), rgba(0, 255, 0, 0.02), rgba(0, 0, 255, 0.06));
  background-size: 100% 2px, 3px 100%;
  pointer-events: none;
}

.tech-grid {
  background-size: 40px 40px;
  background-image: linear-gradient(to right, rgba(255, 255, 255, 0.03) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(255, 255, 255, 0.03) 1px, transparent 1px);
  mask-image: radial-gradient(circle at center, black 40%, transparent 100%);
}

.tech-grid-dark {
  background-size: 40px 40px;
  background-image: linear-gradient(to right, rgba(0, 0, 0, 0.03) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(0, 0, 0, 0.03) 1px, transparent 1px);
  mask-image: radial-gradient(circle at center, black 40%, transparent 100%);
}

/* --- Glitch Effect Text --- */
.glitch-wrapper {
  position: relative;
  display: inline-block;
}

.glitch-wrapper::before,
.glitch-wrapper::after {
  content: attr(data-text);
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: #050505;
}

.glitch-wrapper::before {
  left: 2px;
  text-shadow: -1px 0 #ff00c1;
  clip: rect(44px, 450px, 56px, 0);
  animation: glitch-anim 5s infinite linear alternate-reverse;
}

.glitch-wrapper::after {
  left: -2px;
  text-shadow: -1px 0 #00fff9;
  clip: rect(44px, 450px, 56px, 0);
  animation: glitch-anim2 5s infinite linear alternate-reverse;
}

@keyframes glitch-anim {
  0% {
    clip: rect(31px, 9999px, 94px, 0);
  }

  20% {
    clip: rect(6px, 9999px, 6px, 0);
  }

  40% {
    clip: rect(69px, 9999px, 37px, 0);
  }

  60% {
    clip: rect(60px, 9999px, 14px, 0);
  }

  80% {
    clip: rect(26px, 9999px, 86px, 0);
  }

  100% {
    clip: rect(51px, 9999px, 18px, 0);
  }
}

@keyframes glitch-anim2 {
  0% {
    clip: rect(69px, 9999px, 89px, 0);
  }

  20% {
    clip: rect(3px, 9999px, 97px, 0);
  }

  40% {
    clip: rect(39px, 9999px, 20px, 0);
  }

  60% {
    clip: rect(27px, 9999px, 61px, 0);
  }

  80% {
    clip: rect(60px, 9999px, 87px, 0);
  }

  100% {
    clip: rect(81px, 9999px, 31px, 0);
  }
}

/* --- Scanner Effect on Cards --- */
.scan-card {
  position: relative;
  overflow: hidden;
}

.scan-card::after {
  content: "";
  position: absolute;
  top: -100%;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(to bottom, transparent, rgba(255, 215, 0, 0.2), transparent);
  transition: 0.5s;
}

.scan-card:hover::after {
  top: 100%;
  transition: 0.5s;
}

/* --- Spotlight Effect --- */
.spotlight-card {
  background-image: radial-gradient(600px circle at var(--mouse-x) var(--mouse-y),
      rgba(255, 215, 0, 0.06),
      transparent 40%);
}

/* --- Preloader --- */
#preloader {
  position: fixed;
  inset: 0;
  background: #000;
  z-index: 10000;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  font-family: 'Space Mono', monospace;
}

.loader-bar {
  width: 300px;
  height: 2px;
  background: #333;
  margin-top: 20px;
  position: relative;
  overflow: hidden;
}

.loader-progress {
  position: absolute;
  left: 0;
  top: 0;
  height: 100%;
  background: #FFD700;
  width: 0%;
  transition: width 0.1s linear;
}

/* --- Back to Top --- */
.progress-ring__circle {
  transition: stroke-dashoffset 0.1s;
  transform: rotate(-90deg);
  transform-origin: 50% 50%;
}

/* --- Scrollbar --- */
::-webkit-scrollbar {
  width: 6px;
}

::-webkit-scrollbar-track {
  background: #000;
}

::-webkit-scrollbar-thumb {
  background: #FFD700;
}

/* --- Utilities --- */
.reveal {
  opacity: 0;
  transform: translateY(30px);
  transition: all 0.8s cubic-bezier(0.16, 1, 0.3, 1);
}

.reveal.active {
  opacity: 1;
  transform: translateY(0);
}

/* --- Custom Ping Animation --- */
@keyframes ping-slow {

  75%,
  100% {
    transform: scale(2);
    opacity: 0;
  }
}

.animate-ping-slow {
  animation: ping-slow 2s cubic-bezier(0, 0, 0.2, 1) infinite;
}