:root {
  --primary: #6c5ae6;
  /* Royal Blue */
  --secondary: #efefe5;
  /* Green White */
  --accent: #00f3ff;
  /* Cyan for highlights */
  --bg: #09090e;
  /* Cinder */
  --text: #ffffff;
  --glass: rgba(9, 9, 14, 0.8);
  /* Darker glass */
  --glass-border: rgba(108, 90, 230, 0.3);
  /* Blue tint border */
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: 'Inter', sans-serif;
  background-color: var(--bg);
  color: var(--text);
  overflow-x: hidden;
  min-height: 100vh;
  width: 100vw;
}

#bg-canvas {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
}

#content {
  position: relative;
  z-index: 1;
  height: 100%;
  width: 100%;
  overflow-y: auto;
  /* Allow scrolling */
  padding: 2rem;
}

.container {
  max-width: 1200px;
  margin: 0 auto;
  padding-top: 4rem;
  padding-bottom: 4rem;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.hero-wrapper {
  position: relative;
  width: 100%;
  display: flex;
  justify-content: center;
  margin-bottom: 4rem;
}

.hero-glow {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 600px;
  height: 400px;
  background: radial-gradient(circle, rgba(108, 90, 230, 0.2) 0%, rgba(9, 9, 14, 0) 70%);
  z-index: -1;
  pointer-events: none;
}



.tablet-overlay {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%) scale(0);
  width: 300px;
  height: 400px;
  background: rgba(9, 9, 14, 0.95);
  border: 2px solid var(--accent);
  border-radius: 15px;
  z-index: 200;
  display: flex;
  justify-content: center;
  align-items: center;
  opacity: 0;
  pointer-events: none;
  box-shadow: 0 0 30px rgba(0, 243, 255, 0.2);
}

.tablet-overlay.active {
  pointer-events: auto;
}

.tablet-content {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  text-align: center;
  width: 100%;
  padding: 2rem;
}

.tablet-content h3 {
  color: var(--accent);
  font-family: 'Orbitron', sans-serif;
  margin-bottom: 1rem;
}

.tablet-link {
  color: var(--secondary);
  text-decoration: none;
  font-family: 'Space Mono', monospace;
  padding: 0.8rem;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(255, 255, 255, 0.05);
  transition: all 0.3s ease;
}

.tablet-link:hover {
  background: rgba(108, 90, 230, 0.2);
  border-color: var(--primary);
}

.close-btn {
  background: transparent;
  border: 1px solid var(--secondary);
  color: var(--secondary);
  padding: 0.5rem;
  cursor: pointer;
  font-family: 'Orbitron', sans-serif;
  margin-top: 1rem;
  transition: all 0.3s ease;
}

.close-btn:hover {
  background: var(--secondary);
  color: var(--bg);
}

.hero-badge {
  display: inline-block;
  padding: 0.25rem 0.75rem;
  border: 1px solid rgba(108, 90, 230, 0.5);
  border-radius: 50px;
  background: rgba(108, 90, 230, 0.1);
  color: var(--primary);
  font-family: 'Orbitron', sans-serif;
  font-size: 0.8rem;
  letter-spacing: 2px;
  margin-bottom: 0.5rem;
  /* Adjusted spacing */
  position: absolute;
  /* Absolute positioning */
  top: -30px;
  /* Move above header */
  left: 50%;
  transform: translateX(-50%);
  z-index: 2;
  box-shadow: 0 0 15px rgba(108, 90, 230, 0.2);
  backdrop-filter: blur(5px);
  white-space: nowrap;
}

.hero {
  text-align: center;
  margin-bottom: 4rem;
}

h1.glitch {
  font-family: 'Orbitron', sans-serif;
  font-size: 6rem;
  font-weight: 900;
  margin-bottom: 0.5rem;
  position: relative;
  color: transparent;
  background: linear-gradient(180deg, #ffffff 0%, #6c5ae6 100%);
  -webkit-background-clip: text;
  background-clip: text;
  text-shadow: none;
  /* Gradient handles it */
  letter-spacing: 6px;
  text-transform: uppercase;
  filter: drop-shadow(0 0 10px rgba(108, 90, 230, 0.5));
}

/* Glitch Effect */
h1.glitch::before,
h1.glitch::after {
  content: attr(data-text);
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: transparent;
}

h1.glitch::before {
  left: 2px;
  text-shadow: -1px 0 var(--secondary);
  clip: rect(24px, 550px, 90px, 0);
  animation: glitch-anim-2 3s infinite linear alternate-reverse;
}

h1.glitch::after {
  left: -2px;
  text-shadow: -1px 0 var(--primary);
  clip: rect(85px, 550px, 140px, 0);
  animation: glitch-anim 2.5s infinite linear alternate-reverse;
}

@keyframes glitch-anim {
  0% {
    clip: rect(10px, 9999px, 30px, 0);
  }

  20% {
    clip: rect(80px, 9999px, 100px, 0);
  }

  40% {
    clip: rect(10px, 9999px, 50px, 0);
  }

  60% {
    clip: rect(40px, 9999px, 80px, 0);
  }

  80% {
    clip: rect(120px, 9999px, 140px, 0);
  }

  100% {
    clip: rect(60px, 9999px, 90px, 0);
  }
}

@keyframes glitch-anim-2 {
  0% {
    clip: rect(60px, 9999px, 90px, 0);
  }

  20% {
    clip: rect(10px, 9999px, 40px, 0);
  }

  40% {
    clip: rect(100px, 9999px, 120px, 0);
  }

  60% {
    clip: rect(20px, 9999px, 60px, 0);
  }

  80% {
    clip: rect(80px, 9999px, 100px, 0);
  }

  100% {
    clip: rect(30px, 9999px, 50px, 0);
  }
}

.subtitle {
  font-size: 1.2rem;
  color: rgba(255, 255, 255, 0.8);
  letter-spacing: 1px;
  font-family: 'Inter', sans-serif;
}

.projects-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 2rem;
  width: 100%;
  margin-bottom: 4rem;
}

/* --- Refined Project Cards --- */
.project-card {
  background: rgba(9, 9, 14, 0.6);
  border: 1px solid rgba(255, 255, 255, 0.05);
  border-radius: 16px;
  padding: 2rem;
  text-decoration: none;
  color: var(--text);
  transition: all 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  opacity: 0;
  transform: translateY(20px);
  backdrop-filter: blur(20px);
}

.project-card:hover {
  transform: translateY(-5px);
  border-color: var(--primary);
  box-shadow:
    inset 0 0 20px rgba(108, 90, 230, 0.2),
    0 10px 30px -10px rgba(0, 0, 0, 0.8);
}

.project-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 50%;
  height: 100%;
  background: linear-gradient(90deg,
      transparent,
      rgba(255, 255, 255, 0.1),
      transparent);
  transform: skewX(-25deg);
  transition: 0.5s;
}

.project-card:hover::before {
  left: 150%;
  transition: 0.7s;
}

.card-content h3 {
  font-family: 'Orbitron', sans-serif;
  font-size: 1.5rem;
  margin-bottom: 1rem;
  color: var(--primary);
}

.card-content p {
  font-family: 'Inter', sans-serif;
  font-size: 0.95rem;
  line-height: 1.5;
  color: rgba(255, 255, 255, 0.7);
  margin-bottom: 1.5rem;
}

.badge {
  display: inline-block;
  padding: 0.25rem 0.75rem;
  border-radius: 4px;
  /* Sharper */
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(255, 255, 255, 0.05);
}

.badge.python {
  color: var(--accent);
  border-color: var(--accent);
  background: rgba(0, 243, 255, 0.1);
}

.badge.javascript {
  color: #f1e05a;
  border-color: #f1e05a;
  background: rgba(241, 224, 90, 0.1);
}

.hero-link {
  text-decoration: none;
  display: inline-block;
  position: relative;
  z-index: 10;
  cursor: pointer;
}

.hero-link:hover h1.glitch {
  filter: drop-shadow(0 0 20px rgba(108, 90, 230, 0.8));
}

/* --- Card Visuals --- */
.card-visual {
  height: 120px;
  width: 100%;
  background: rgba(0, 0, 0, 0.3);
  border-radius: 8px;
  margin-bottom: 1.5rem;
  position: relative;
  overflow: hidden;
  display: flex;
  justify-content: center;
  align-items: center;
}

/* xResize Animation */
.xresize-visual .window-box {
  width: 60px;
  height: 40px;
  border: 2px solid var(--primary);
  border-radius: 4px;
  animation: resize-pulse 3s infinite ease-in-out;
  box-shadow: 0 0 10px rgba(0, 243, 255, 0.3);
}

@keyframes resize-pulse {

  0%,
  100% {
    width: 60px;
    height: 40px;
  }

  50% {
    width: 90px;
    height: 60px;
  }
}

/* Compuco-AI Animation */
.compuco-visual .terminal-prompt {
  font-family: 'Orbitron', monospace;
  color: var(--secondary);
  font-size: 1.2rem;
}

.compuco-visual .typing-cursor {
  display: inline-block;
  width: 8px;
  height: 1.2rem;
  background: var(--secondary);
  animation: blink 1s infinite;
}

@keyframes blink {

  0%,
  100% {
    opacity: 1;
  }

  50% {
    opacity: 0;
  }
}

/* wPGM Animation */
.wpgm-visual .grid-path {
  width: 80px;
  height: 80px;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.1) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.1) 1px, transparent 1px);
  background-size: 20px 20px;
  position: relative;
}

.wpgm-visual .path-dot {
  width: 8px;
  height: 8px;
  background: var(--primary);
  border-radius: 50%;
  position: absolute;
  top: 0;
  left: 0;
  animation: path-move 4s infinite linear;
  box-shadow: 0 0 8px var(--primary);
}

@keyframes path-move {
  0% {
    top: 10px;
    left: 10px;
  }

  25% {
    top: 10px;
    left: 50px;
  }

  50% {
    top: 50px;
    left: 50px;
  }

  75% {
    top: 50px;
    left: 10px;
  }

  100% {
    top: 10px;
    left: 10px;
  }
}

/* Download_Manager Animation */
.download-visual .folder {
  width: 50px;
  height: 40px;
  border: 2px solid rgba(255, 255, 255, 0.5);
  border-radius: 4px;
  position: relative;
  margin-top: 20px;
}

.download-visual .file-icon {
  width: 20px;
  height: 25px;
  background: var(--secondary);
  position: absolute;
  top: -40px;
  left: 50%;
  transform: translateX(-50%);
  animation: download-drop 2s infinite ease-in;
}

@keyframes download-drop {
  0% {
    top: -40px;
    opacity: 0;
  }

  20% {
    opacity: 1;
  }

  80% {
    top: 10px;
    opacity: 1;
  }

  100% {
    top: 10px;
    opacity: 0;
  }
}

/* Dodle_Jum Animation */
.dodle-visual .platform {
  width: 60px;
  height: 4px;
  background: var(--primary);
  position: absolute;
  bottom: 30px;
}

.dodle-visual .jumper {
  width: 15px;
  height: 15px;
  background: var(--secondary);
  border-radius: 50%;
  position: absolute;
  bottom: 34px;
  animation: bounce 1.5s infinite ease-in-out;
}

@keyframes bounce {

  0%,
  100% {
    bottom: 34px;
  }

  50% {
    bottom: 80px;
  }
}

/* hangman.py Animation */
.hangman-visual .gallows {
  width: 60px;
  height: 80px;
  border-left: 2px solid rgba(255, 255, 255, 0.5);
  border-top: 2px solid rgba(255, 255, 255, 0.5);
  position: relative;
  margin-left: -20px;
}

.hangman-visual .rope {
  height: 20px;
  width: 2px;
  background: rgba(255, 255, 255, 0.5);
  position: absolute;
  right: 10px;
  top: 0;
}

.hangman-visual .man {
  width: 10px;
  height: 10px;
  border: 2px solid var(--primary);
  border-radius: 50%;
  position: absolute;
  right: 4px;
  top: 20px;
  animation: swing 3s infinite ease-in-out;
  transform-origin: top center;
}

.hangman-visual .man::after {
  content: '';
  position: absolute;
  top: 10px;
  left: 50%;
  transform: translateX(-50%);
  width: 2px;
  height: 20px;
  background: var(--primary);
}

@keyframes swing {

  0%,
  100% {
    transform: rotate(-10deg);
  }

  50% {
    transform: rotate(10deg);
  }
}

@media (max-width: 768px) {
  h1.glitch {
    font-size: 3rem;
  }

  .container {
    padding-top: 2rem;
  }

  .projects-grid {
    grid-template-columns: 1fr;
  }
}
