:root {
  --bg-primary: #020204; /* Deep Obsidian */
  --accent-blue: #00d4ff; /* Electric Cyan */
  --signal-green: #00ff41; /* Phosphor-Green */
  --text-primary: #ffffff;
  --text-secondary: #a0a0a0;
  --border-color: #1a1a1a;
  --accent-glow: rgba(0, 212, 255, 0.4);
  --signal-glow: rgba(0, 255, 65, 0.4);
}

body {
  background-color: var(--bg-primary);
  color: var(--text-primary);
  overflow-x: hidden;
  font-family: "Montserrat", sans-serif;
}

/* ========== PROGRESS BAR ========== */
.progress-bar {
  position: fixed;
  top: 0;
  left: 0;
  height: 3px;
  width: 0%;
  background: linear-gradient(90deg, var(--accent-blue), #00ffaa);
  z-index: 2000;
  transition: width 0.1s ease-out;
  box-shadow: 0 0 15px var(--accent-blue);
}

/* ========== HERO SECTION ========== */
.hero {
  height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  overflow: hidden;
}

.hero-content {
  text-align: center;
  z-index: 1;
}

.hero-title {
  font-size: clamp(2.5rem, 8vw, 7rem);
  font-weight: 900;
  letter-spacing: 0.1em;
  margin-bottom: 1rem;
  font-family: "Orbitron", sans-serif;
}

.shimmer {
  background: linear-gradient(
    90deg,
    var(--accent-blue) 0%,
    #ffffff 25%,
    var(--accent-blue) 50%,
    #ffffff 75%,
    var(--accent-blue) 100%
  );
  background-size: 200% auto;
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  animation: shimmerAnim 4s linear infinite;
}

@keyframes shimmerAnim {
  0% {
    background-position: 200% center;
  }
  100% {
    background-position: -200% center;
  }
}

.hero-subtitle {
  font-size: clamp(1rem, 2.5vw, 1.5rem);
  color: var(--text-secondary);
  letter-spacing: 0.3em;
  text-transform: uppercase;
  margin-bottom: 2rem;
}

.hero-divider {
  width: 200px;
  height: 2px;
  background: linear-gradient(
    90deg,
    transparent,
    var(--accent-blue),
    transparent
  );
  margin: 0 auto;
}

/* ========== PROJECTS SPLIT VIEW ========== */
.projects-container {
  display: grid;
  grid-template-columns: 1fr 1fr;
  min-height: 100vh;
  position: relative;
  background: linear-gradient(
    to bottom,
    rgba(0, 10, 30, 0) 0%,
    rgba(0, 10, 30, 0.5) 20%,
    rgba(0, 10, 30, 0.5) 100%
  );
}

.image-column {
  position: relative;
  height: 100vh;
  position: sticky;
  top: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(
    135deg,
    rgba(0, 212, 255, 0.05) 0%,
    transparent 50%
  );
  border-right: 1px solid var(--border-color);
  z-index: 10;
}

.sticky-image-wrapper {
  position: relative;
  width: 80%;
  max-width: 500px;
  aspect-ratio: 16/9;
  display: flex;
  align-items: center;
  justify-content: center;
}

.sticky-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 12px;
  box-shadow: 0 0 40px rgba(0, 212, 255, 0.3);
  transition:
    filter 0.3s ease,
    transform 0.3s ease;
}

.sticky-image.active {
  box-shadow: 0 0 50px var(--accent-glow);
}

.image-glow {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 120%;
  height: 120%;
  background: radial-gradient(ellipse, var(--accent-glow) 0%, transparent 70%);
  opacity: 0.6;
  filter: blur(30px);
  z-index: -1;
  animation: glowPulse 3s ease-in-out infinite;
}

@keyframes glowPulse {
  0%,
  100% {
    opacity: 0.4;
    transform: translate(-50%, -50%) scale(1);
  }
  50% {
    opacity: 0.7;
    transform: translate(-50%, -50%) scale(1.1);
  }
}

/* Glitch-Scale Transition */
.glitch-target {
  filter: blur(10px);
  transform: scale(0.95);
  opacity: 0.8;
}

.glitch-target.active {
  filter: blur(0);
  transform: scale(1);
  opacity: 1;
  transition:
    filter 0.4s cubic-bezier(0.34, 1.56, 0.64, 1),
    transform 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}

/* Glitch effect for data swap */
.glitch-effect {
  animation: glitch 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94) both;
}

@keyframes glitch {
  0% {
    clip-path: inset(5% 0 85% 0);
    transform: translateX(-2px);
    filter: contrast(150%) drop-shadow(-2px 0 rgba(0, 212, 255, 0.8))
      drop-shadow(2px 0 rgba(255, 0, 212, 0.8));
  }
  20% {
    clip-path: inset(25% 0 60% 0);
    transform: translateX(2px);
    filter: contrast(150%) drop-shadow(2px 0 rgba(0, 212, 255, 0.8))
      drop-shadow(-2px 0 rgba(255, 0, 212, 0.8));
  }
  40% {
    clip-path: inset(45% 0 40% 0);
    transform: translateX(-1px);
    filter: contrast(150%) drop-shadow(-1px 0 rgba(0, 212, 255, 0.9))
      drop-shadow(1px 0 rgba(255, 0, 212, 0.9));
  }
  60% {
    clip-path: inset(55% 0 30% 0);
    transform: translateX(1px);
    filter: contrast(150%) drop-shadow(1px 0 rgba(0, 212, 255, 0.7))
      drop-shadow(-1px 0 rgba(255, 0, 212, 0.7));
  }
  80% {
    clip-path: inset(65% 0 20% 0);
    transform: translateX(-2px);
    filter: contrast(150%) drop-shadow(-2px 0 rgba(0, 212, 255, 0.8))
      drop-shadow(2px 0 rgba(255, 0, 212, 0.8));
  }
  100% {
    clip-path: inset(0 0 0 0);
    transform: translateX(0);
    filter: contrast(100%);
  }
}

/* ========== CONTENT COLUMN ========== */
.content-column {
  padding: 4rem 3rem 6rem;
  background: transparent;
  backdrop-filter: blur(20px);
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
}

.projects-track {
  display: flex;
  flex-direction: column;
  gap: 6rem;
}

.project-panel {
  min-height: 80vh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  opacity: 0.3;
  transition:
    opacity 0.5s ease,
    transform 0.5s ease;
  transform: translateY(30px);
}

.project-panel.active {
  opacity: 1;
  transform: translateY(0);
}

/* Header */
.project-panel.active h2 {
  opacity: 0;
  transform: translateY(20px);
  animation:
    fadeInUp 0.6s ease forwards,
    breathe 4s ease-in-out infinite 0.6s;
  color: var(--accent-blue);
  letter-spacing: 0.02em;
  margin-bottom: 1rem;
}

.project-panel.active h2::after {
  content: "";
  display: block;
  width: 60px;
  height: 3px;
  background: var(--signal-green);
  margin: 0.5rem 0 0;
  border-radius: 2px;
  box-shadow: 0 0 10px var(--signal-green);
}

@keyframes fadeInUp {
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes breathe {
  0%,
  100% {
    letter-spacing: 0.02em;
  }
  50% {
    letter-spacing: 0.05em;
  }
}

/* Description */
.project-panel .description {
  font-size: 1.1rem;
  line-height: 1.7;
  color: var(--text-secondary);
  margin-bottom: 2rem;
  max-width: 600px;
  opacity: 0;
  transform: translateY(10px);
  animation: fadeInUp 0.6s ease forwards 0.2s;
}

/* Spec sheet - glass effect */
.spec-sheet {
  margin: 2rem 0;
  padding: 1.5rem;
  background: rgba(255, 255, 255, 0.03);
  backdrop-filter: blur(12px);
  border-radius: 0 8px 8px 0;
  border-left: 2px solid var(--signal-green);
  position: relative;
  overflow: hidden;
  box-shadow:
    inset 0 0 0 1px rgba(0, 212, 255, 0.2),
    0 0 15px rgba(0, 212, 255, 0.05);
}

.spec-item {
  font-family: "Courier New", monospace;
  font-size: 0.95rem;
  color: var(--text-secondary);
  margin: 0.75rem 0;
  padding-left: 1.5rem;
  position: relative;
  opacity: 0;
  transform: translateX(-10px);
}

/* Staggered slide-in from right */
.project-panel.active .spec-item {
  animation: slideInRight 0.4s ease forwards;
}

.project-panel.active .spec-item:nth-child(1) {
  animation-delay: 0.3s;
}
.project-panel.active .spec-item:nth-child(2) {
  animation-delay: 0.4s;
}
.project-panel.active .spec-item:nth-child(3) {
  animation-delay: 0.5s;
}
.project-panel.active .spec-item:nth-child(4) {
  animation-delay: 0.6s;
}

@keyframes slideInRight {
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

.spec-item::before {
  content: ">";
  position: absolute;
  left: 0;
  color: var(--signal-green);
  font-weight: bold;
  animation: caretBlink 1.5s infinite;
}

@keyframes caretBlink {
  0%,
  100% {
    opacity: 1;
  }
  50% {
    opacity: 0.3;
  }
}

/* Tech stack pills */
.tech-stack {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin: 1.5rem 0;
}

.tech-pill {
  padding: 0.5rem 1rem;
  background: transparent;
  border: 1px solid var(--accent-blue);
  border-radius: 999px;
  font-size: 0.85rem;
  color: var(--accent-blue);
  font-weight: 500;
  position: relative;
  overflow: hidden;
  transition: all 0.3s ease;
  cursor: default;
}

/* Border-trace effect */
.tech-pill::before {
  content: "";
  position: absolute;
  inset: 0;
  padding: 1px;
  border-radius: inherit;
  background: conic-gradient(
    from 0deg,
    transparent 0deg,
    var(--signal-green) 20deg,
    transparent 40deg,
    transparent 320deg,
    var(--signal-green) 340deg,
    transparent 360deg
  );
  -webkit-mask:
    linear-gradient(#fff 0 0) content-box,
    linear-gradient(#fff 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  opacity: 0;
  transition: opacity 0.3s;
  animation: rotate 3s linear infinite;
  pointer-events: none;
}

.tech-pill:hover::before {
  opacity: 1;
}

@keyframes rotate {
  to {
    transform: rotate(360deg);
  }
}

.tech-pill:hover {
  box-shadow:
    0 0 20px var(--accent-glow),
    inset 0 0 10px rgba(0, 212, 255, 0.2);
  transform: translateY(-2px);
}

/* Buttons */
.button-group {
  display: flex;
  gap: 1rem;
  margin-top: 2rem;
}

.project-btn {
  padding: 0.875rem 2rem;
  font-size: 1rem;
  font-weight: 600;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
  text-decoration: none;
  opacity: 0;
  transform: translateY(20px);
}

.project-panel.active .project-btn {
  animation: springIn 0.6s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
}

.project-btn:nth-child(2) {
  animation-delay: 0.3s !important;
}

@keyframes springIn {
  0% {
    opacity: 0;
    transform: translateY(20px) scale(0.9);
  }
  60% {
    opacity: 1;
    transform: translateY(-5px) scale(1.05);
  }
  100% {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.btn-primary {
  background: var(--accent-blue);
  color: #000;
}

.btn-primary:hover {
  background: #00ffe0;
  box-shadow: 0 0 30px var(--accent-glow);
  transform: translateY(-3px);
}

.btn-secondary {
  background: transparent;
  border: 2px solid var(--accent-blue);
  color: var(--accent-blue);
}

.btn-secondary:hover {
  background: rgba(0, 212, 255, 0.1);
  box-shadow: 0 0 20px var(--accent-glow);
  transform: translateY(-3px);
}

/* GitHub button border pulse when panel active */
.project-panel.active .btn-secondary {
  animation: borderPulse 2s ease-in-out infinite 0.6s;
}

@keyframes borderPulse {
  0%,
  100% {
    box-shadow: 0 0 5px var(--signal-glow);
    border-color: var(--signal-green);
  }
  50% {
    box-shadow: 0 0 20px var(--signal-glow);
    border-color: #00ff88;
  }
}

/* Responsive */
@media (max-width: 1024px) {
  .projects-container {
    grid-template-columns: 1fr;
  }

  .image-column {
    height: 50vh;
    position: relative;
    top: 0;
    border-right: none;
    border-bottom: 1px solid var(--border-color);
  }

  .sticky-image-wrapper {
    width: 90%;
  }

  .content-column {
    padding: 2rem 1.5rem 4rem;
  }
}

@media (max-width: 600px) {
  .hero-title {
    letter-spacing: 0.05em;
  }

  .button-group {
    flex-direction: column;
  }

  .project-btn {
    width: 100%;
    text-align: center;
  }
}

/* Particle canvas */
#particleCanvas {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: -1;
  opacity: 0.4;
  pointer-events: none;
}
