/* Custom Styles for Aleksei's DevOps Portfolio */

@import url('https://fonts.googleapis.com/css2?family=JetBrains+Mono:ital,wght@0,100..800;1,100..800&family=Space+Grotesk:wght@300..700&display=swap');

:root {
  --neon-blue: #00f0ff;
  --neon-green: #39ff14;
  --neon-purple: #bd00ff;
  --glow-shadow: 0 0 10px rgba(0, 240, 255, 0.5), 0 0 20px rgba(0, 240, 255, 0.2);
  --glow-green-shadow: 0 0 10px rgba(57, 255, 20, 0.5), 0 0 20px rgba(57, 255, 20, 0.2);
}

/* Base resets & transitions */
html {
  scroll-behavior: smooth;
  scrollbar-width: thin;
  scrollbar-color: var(--neon-blue) #12131a;
}

body {
  font-family: 'Space Grotesk', sans-serif;
  background-color: #0b0c10;
  color: #c5c6c7;
  overflow-x: hidden;
}

.font-mono {
  font-family: 'JetBrains Mono', monospace;
}

/* Custom Scrollbar for Webkit */
::-webkit-scrollbar {
  width: 6px;
}
::-webkit-scrollbar-track {
  background: #0b0c10;
}
::-webkit-scrollbar-thumb {
  background: var(--neon-blue);
  border-radius: 3px;
  box-shadow: 0 0 5px var(--neon-blue);
}
::-webkit-scrollbar-thumb:hover {
  background: var(--neon-purple);
  box-shadow: 0 0 10px var(--neon-purple);
}

/* CRT Scanline and Overlay Effects */
.crt-overlay {
  pointer-events: none;
  z-index: 9999;
}
.crt-overlay::after {
  content: " ";
  display: block;
  position: fixed;
  top: 0; left: 0; bottom: 0; right: 0;
  background: 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% 4px, 6px 100%;
  opacity: 0.45;
}

/* Glow Effects */
.neon-text-blue {
  color: var(--neon-blue);
  text-shadow: 0 0 5px rgba(0, 240, 255, 0.5), 0 0 10px rgba(0, 240, 255, 0.3);
}
.neon-text-green {
  color: var(--neon-green);
  text-shadow: 0 0 5px rgba(57, 255, 20, 0.5), 0 0 10px rgba(57, 255, 20, 0.3);
}
.neon-text-purple {
  color: var(--neon-purple);
  text-shadow: 0 0 5px rgba(189, 0, 255, 0.5), 0 0 10px rgba(189, 0, 255, 0.3);
}

.neon-border-blue {
  border-color: var(--neon-blue);
  box-shadow: var(--glow-shadow);
}
.neon-border-green {
  border-color: var(--neon-green);
  box-shadow: var(--glow-green-shadow);
}
.neon-border-purple {
  border-color: var(--neon-purple);
  box-shadow: 0 0 10px rgba(189, 0, 255, 0.5);
}

/* Glassmorphism */
.glass-panel {
  background: rgba(15, 23, 42, 0.65);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid rgba(255, 255, 255, 0.07);
}

.glass-panel-hover:hover {
  background: rgba(15, 23, 42, 0.8);
  border-color: rgba(0, 240, 255, 0.3);
  box-shadow: 0 10px 30px -10px rgba(0, 240, 255, 0.15);
  transform: translateY(-2px);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Animations */
@keyframes cursor-blink {
  0%, 100% { opacity: 1; }
  50% { opacity: 0; }
}
.terminal-cursor {
  display: inline-block;
  width: 8px;
  height: 18px;
  background-color: var(--neon-green);
  margin-left: 4px;
  animation: cursor-blink 1s step-end infinite;
}

@keyframes pulse-slow {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.7; transform: scale(0.98); }
}
.pulse-glow {
  animation: pulse-slow 3s infinite ease-in-out;
}

/* RJ45 Connector animation keyframes inside the intro */
@keyframes rj45-plug-in {
  0% {
    transform: translate(23px, -120px) scale(0.9);
    opacity: 0;
  }
  60% {
    transform: translate(23px, -30px) scale(1.02);
    opacity: 1;
  }
  75% {
    transform: translate(23px, -5px);
  }
  80% {
    transform: translate(23px, 46px);
    filter: drop-shadow(0 0 20px rgba(57, 255, 20, 0.8));
  }
  100% {
    transform: translate(23px, 46px);
    filter: drop-shadow(0 0 10px rgba(57, 255, 20, 0.4));
  }
}

.animate-rj45 {
  animation: rj45-plug-in 2.2s cubic-bezier(0.19, 1, 0.22, 1) forwards;
}

/* Cable path tracing animation */
@keyframes draw-cable {
  to {
    stroke-dashoffset: 0;
  }
}
.cable-line {
  stroke-dasharray: 600;
  stroke-dashoffset: 600;
  animation: draw-cable 2.5s ease-out forwards;
}

/* Subtle background noise overlay */
.bg-noise {
  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.8' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noiseFilter)' opacity='0.015'/%3E%3C/svg%3E");
}

/* Card hover glow and rotation effect */
.tilt-card {
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  transform-style: preserve-3d;
}

.perspective-1000 {
  perspective: 1000px;
}

/* Timeline specific additions */
.timeline-middle-dot {
  position: relative;
}
.timeline-middle-dot::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 16px;
  height: 16px;
  background: var(--neon-blue);
  border-radius: 50%;
  box-shadow: var(--glow-shadow);
  animation: pulse-slow 2s infinite;
}

/* Radial network pulse for clicks/connections */
.network-wave {
  position: absolute;
  border: 2px solid var(--neon-blue);
  border-radius: 50%;
  animation: wave-expand 1.2s cubic-bezier(0.1, 0.8, 0.3, 1) forwards;
  opacity: 1;
  pointer-events: none;
}
@keyframes wave-expand {
  0% {
    width: 0px;
    height: 0px;
    opacity: 1;
    transform: translate(-50%, -50%);
  }
  100% {
    width: 600px;
    height: 600px;
    opacity: 0;
    transform: translate(-50%, -50%);
  }
}

/* Fade in class for scroll reveal */
.reveal-item {
  opacity: 0;
  transform: translateY(30px);
  transition: opacity 0.8s ease, transform 0.8s ease;
}
.reveal-item.active {
  opacity: 1;
  transform: translateY(0);
}

/* Active Nav Links styling */
.nav-link {
  position: relative;
  transition: color 0.3s;
}
.nav-link::after {
  content: '';
  position: absolute;
  bottom: -4px;
  left: 0;
  width: 0;
  height: 2px;
  background-color: var(--neon-blue);
  box-shadow: 0 0 5px var(--neon-blue);
  transition: width 0.3s;
}
.nav-link.active {
  color: var(--neon-blue) !important;
}
.nav-link.active::after {
  width: 100%;
}
.nav-link:hover::after {
  width: 100%;
}
