/* ===== Retro Terminal — CRT & Matrix Effects ===== */

/* ===== CRT Scanline Overlay ===== */
.crt-scanlines {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 9998;
  background: repeating-linear-gradient(
    0deg,
    transparent,
    transparent 1px,
    rgba(0, 255, 65, 0.03) 1px,
    rgba(0, 255, 65, 0.03) 2px
  );
  mix-blend-mode: overlay;
}

/* ===== CRT Screen Flicker ===== */
.crt-scanlines::after {
  content: '';
  position: absolute;
  inset: 0;
  background: rgba(0, 255, 65, 0.01);
  animation: crt-flicker 0.15s infinite alternate;
  pointer-events: none;
}

@keyframes crt-flicker {
  0% { opacity: 0.97; }
  50% { opacity: 1; }
  100% { opacity: 0.98; }
}

/* ===== Matrix Rain Container ===== */
.matrix-rain {
  position: absolute;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
  z-index: 0;
}

.matrix-rain canvas {
  display: block;
  width: 100%;
  height: 100%;
}

/* ===== Animated Gradient Mesh (Hero Background) — replaced with dark bg ===== */
@property --mesh-angle {
  syntax: '<angle>';
  initial-value: 0deg;
  inherits: false;
}

.hero-mesh {
  position: absolute;
  inset: 0;
  background: transparent;
  pointer-events: none;
  z-index: 0;
}

/* ===== Floating Orbs — dimmed for terminal look ===== */
.floating-orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(100px);
  pointer-events: none;
  z-index: 0;
}

.floating-orb-1 {
  width: 400px;
  height: 400px;
  background: rgba(0, 255, 65, 0.04);
  top: -100px;
  right: 10%;
  animation: orb-float-1 12s ease-in-out infinite;
}

.floating-orb-2 {
  width: 300px;
  height: 300px;
  background: rgba(0, 255, 65, 0.03);
  bottom: -50px;
  left: 5%;
  animation: orb-float-2 15s ease-in-out infinite;
}

.floating-orb-3 {
  width: 250px;
  height: 250px;
  background: rgba(0, 255, 65, 0.03);
  top: 40%;
  left: 50%;
  animation: orb-float-3 18s ease-in-out infinite;
}

@keyframes orb-float-1 {
  0%, 100% { transform: translate(0, 0) scale(1); }
  33% { transform: translate(30px, 40px) scale(1.05); }
  66% { transform: translate(-20px, 20px) scale(0.95); }
}

@keyframes orb-float-2 {
  0%, 100% { transform: translate(0, 0) scale(1); }
  33% { transform: translate(-40px, -30px) scale(1.08); }
  66% { transform: translate(20px, -10px) scale(0.92); }
}

@keyframes orb-float-3 {
  0%, 100% { transform: translate(0, 0) scale(1); }
  50% { transform: translate(-30px, 30px) scale(1.1); }
}

/* ===== Mouse-follow glow — green terminal ===== */
.hero-mouse-glow {
  position: absolute;
  width: 500px;
  height: 500px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(0, 255, 65, 0.08) 0%, transparent 70%);
  pointer-events: none;
  z-index: 0;
  left: var(--mouse-x, 50%);
  top: var(--mouse-y, 50%);
  transform: translate(-50%, -50%);
  transition: left 0.15s ease-out, top 0.15s ease-out;
  opacity: 0;
}

.hero:hover .hero-mouse-glow {
  opacity: 1;
}

/* ===== Glass morphism cards — terminal style ===== */
.glass-card {
  background: rgba(0, 255, 65, 0.02);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  border: 1px solid rgba(0, 255, 65, 0.15);
  transition: all var(--transition);
}

.glass-card:hover {
  background: rgba(0, 255, 65, 0.05);
  border-color: rgba(0, 255, 65, 0.35);
  box-shadow: 0 0 20px rgba(0, 255, 65, 0.1);
}

/* ===== Animated gradient text — terminal green glow ===== */
.gradient-text-animated {
  background: none !important;
  -webkit-background-clip: unset !important;
  -webkit-text-fill-color: #00FF41 !important;
  background-clip: unset !important;
  animation: terminal-glow-pulse 3s ease-in-out infinite;
}

@keyframes terminal-glow-pulse {
  0%, 100% { text-shadow: 0 0 10px #00FF41, 0 0 20px rgba(0, 255, 65, 0.3); }
  50% { text-shadow: 0 0 20px #00FF41, 0 0 40px rgba(0, 255, 65, 0.5), 0 0 60px rgba(0, 255, 65, 0.2); }
}

/* ===== Animated gradient border on hover ===== */
.gradient-border {
  position: relative;
}

.gradient-border::before {
  content: '';
  position: absolute;
  inset: -1px;
  border-radius: inherit;
  background: #00FF41;
  z-index: -1;
  opacity: 0;
  transition: opacity var(--transition);
  box-shadow: 0 0 15px #00FF41;
}

.gradient-border:hover::before {
  opacity: 0.3;
}

/* ===== Section decorative blobs ===== */
.section-blob {
  position: absolute;
  pointer-events: none;
  z-index: 0;
}

.section-blob-left {
  width: 300px;
  height: 300px;
  left: -150px;
  top: 50%;
  transform: translateY(-50%);
  background: radial-gradient(circle, rgba(0, 255, 65, 0.04) 0%, transparent 70%);
  border-radius: 50%;
  filter: blur(60px);
}

.section-blob-right {
  width: 250px;
  height: 250px;
  right: -120px;
  top: 30%;
  background: radial-gradient(circle, rgba(0, 255, 65, 0.03) 0%, transparent 70%);
  border-radius: 50%;
  filter: blur(60px);
}

/* ===== Shimmer effect for stats — terminal scan ===== */
.stat-shimmer {
  position: relative;
  overflow: hidden;
}

.stat-shimmer::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(
    90deg,
    transparent 0%,
    rgba(0, 255, 65, 0.06) 50%,
    transparent 100%
  );
  background-size: 200% 100%;
  animation: shimmer 3s ease-in-out infinite;
}

@keyframes shimmer {
  0%, 100% { background-position: -200% 0; }
  50% { background-position: 200% 0; }
}

/* ===== Reveal animation ===== */
.reveal-up {
  opacity: 0;
  transform: translateY(40px);
  transition: all 0.8s cubic-bezier(0.16, 1, 0.3, 1);
}

.reveal-up.visible {
  opacity: 1;
  transform: translateY(0);
}

/* ===== Terminal typing cursor ===== */
.terminal-cursor::after {
  content: '_';
  animation: blink-cursor 1s step-end infinite;
  color: #00FF41;
}

@keyframes blink-cursor {
  0%, 100% { opacity: 1; }
  50% { opacity: 0; }
}

/* ===== Terminal prompt prefix ===== */
.terminal-prompt::before {
  content: '> ';
  color: #008F11;
}

/* ===== System line styling ===== */
.system-line {
  font-family: var(--font-mono) !important;
  font-size: 0.9rem;
  color: #008F11;
  margin-bottom: 12px;
  letter-spacing: 0.05em;
}

/* ===== Prefers reduced motion ===== */
@media (prefers-reduced-motion: reduce) {
  .hero-mesh,
  .floating-orb,
  .hero-mouse-glow,
  .stat-shimmer::after,
  .crt-scanlines::after {
    animation: none !important;
  }

  .hero-mouse-glow {
    display: none;
  }

  .gradient-text-animated {
    animation: none !important;
  }
}

/* ===== Mobile: disable heavy effects ===== */
@media (max-width: 768px) {
  .floating-orb {
    display: none;
  }

  .hero-mouse-glow {
    display: none;
  }

  .matrix-rain {
    opacity: 0.3;
  }
}
