@import url("https://fonts.googleapis.com/css2?family=Press+Start+2P&display=swap");

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

html {
  scroll-behavior: smooth;
}

:root {
  --primary: #33ff33;
  --secondary: #ff3377;
  --accent: #ffff33;
  --dark: #000;
  --light: #fff;
  --gray: #333;
  --secondary-dark: #cc2255;
  --primary-dark: #229922;
  --primary-light: #55ff55;
  --secondary-light: #ff6699;
}

body {
  background-color: var(--dark);
  color: var(--light);
  font-family: "Press Start 2P", cursive;
  line-height: 1.6;
  overflow-x: hidden;
}

/* Custom Scrollbar */
::-webkit-scrollbar {
  width: 10px;
}

::-webkit-scrollbar-track {
  background: var(--dark);
  border-left: 1px solid var(--gray);
}

::-webkit-scrollbar-thumb {
  background: var(--primary);
  border: 2px solid var(--dark);
}

::-webkit-scrollbar-thumb:hover {
  background: var(--accent);
}

/* Scanline Effect */
.scanlines {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(
    to bottom,
    rgba(255, 255, 255, 0),
    rgba(255, 255, 255, 0) 50%,
    rgba(0, 0, 0, 0.2) 50%,
    rgba(0, 0, 0, 0.2)
  );
  background-size: 100% 4px;
  z-index: 999;
  pointer-events: none;
  opacity: 0.6;
  animation: scanline 10s linear infinite;
}

@keyframes scanline {
  0% {
    background-position: 0 0;
  }
  100% {
    background-position: 0 100%;
  }
}

/* CRT Turn-on Animation */
.crt-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: #000;
  z-index: 10000;
  animation: turn-on 3s linear forwards;
  pointer-events: none;
}

@keyframes turn-on {
  0% {
    transform: scale(1, 0.002);
    opacity: 1;
  }
  20% {
    transform: scale(1, 0.002);
    opacity: 1;
  }
  50% {
    transform: scale(1, 0.002);
    opacity: 1;
  }
  55% {
    transform: scale(1, 1);
    opacity: 1;
  }
  100% {
    transform: scale(1, 1);
    opacity: 0;
  }
}

.pixel-bg {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(rgba(0, 0, 0, 0.7), rgba(0, 0, 0, 0.7)),
    url("data:image/svg+xml,%3Csvg width='20' height='20' viewBox='0 0 20 20' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='%2333ff33' fill-opacity='0.1'%3E%3Cpath d='M0 0h10v10H0zM10 10h10v10H10z'/%3E%3C/g%3E%3C/svg%3E");
  z-index: -1;
  animation: bg-pulse 20s infinite alternate;
}

@keyframes bg-pulse {
  0% {
    opacity: 0.9;
  }
  100% {
    opacity: 1;
  }
}

/* Moving pixel objects animation */
.pixel-object {
  position: fixed; /* Changed from absolute to fixed */
  width: 20px;
  height: 20px;
  background-color: var(--primary);
  opacity: 0.2;
  z-index: -1;
  animation: float 15s linear infinite;
  pointer-events: none;
}

.pixel-object:nth-child(2n) {
  background-color: var(--secondary);
  width: 15px;
  height: 15px;
  animation-duration: 25s;
  animation-delay: -5s;
}

.pixel-object:nth-child(3n) {
  background-color: var(--accent);
  width: 10px;
  height: 10px;
  animation-duration: 20s;
  animation-delay: -10s;
}

@keyframes float-vertical {
  0% {
    transform: translateY(-100px) rotate(0deg);
  }
  100% {
    transform: translateY(calc(100vh + 100px)) rotate(360deg);
  }
}

/* Add this for some diagonal moving pixels */
@keyframes float-diagonal {
  0% {
    transform: translate(-100px, -100px) rotate(0deg);
  }
  100% {
    transform: translate(calc(100vw + 100px), calc(100vh + 100px))
      rotate(360deg);
  }
}

@keyframes float {
  0% {
    transform: translate(-100px, 0) rotate(0deg);
  }
  100% {
    transform: translate(calc(100vw + 100px), 100vh) rotate(360deg);
  }
}

.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 20px;
}

/* Header */
header {
  text-align: center;
  padding: 40px 0 30px;
  position: relative;
  border-bottom: 4px solid var(--primary);
}

.title-container {
  position: relative;
  display: inline-block;
}

h1 {
  font-size: 2.5rem;
  position: relative;
  color: var(--primary);
  text-shadow: 4px 4px 0 var(--secondary), 0 0 10px var(--primary);
  margin-bottom: 20px;
  animation: glitch 5s infinite;
}

@keyframes glitch {
  0%,
  90%,
  100% {
    transform: translate(0, 0);
    text-shadow: 4px 4px 0 var(--secondary);
  }
  92% {
    transform: translate(-5px, 0);
    text-shadow: -4px 0 0 var(--accent);
  }
  94% {
    transform: translate(5px, 0);
    text-shadow: 4px 0 0 var(--secondary);
  }
  96% {
    transform: translate(0, 0);
    text-shadow: none;
  }
  98% {
    transform: translate(0, 0);
    text-shadow: 4px 4px 0 var(--secondary);
  }
}

.subtitle {
  font-size: 1rem;
  color: var(--accent);
  margin-bottom: 30px;
}

.blink {
  animation: blink 1s infinite;
}

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

/* Navigation - Updated Navbar */
.navbar {
  background-color: rgba(0, 0, 0, 0.8);
  border: 4px solid var(--primary);
  border-radius: 0;
  padding: 0;
  margin: 30px auto;
  max-width: 800px;
  position: relative;
  box-shadow: 0 8px 0 rgba(51, 255, 51, 0.2);
}

.navbar::before {
  content: "";
  position: absolute;
  top: -8px;
  left: -8px;
  right: -8px;
  bottom: -8px;
  border: 2px solid var(--accent);
  z-index: -1;
  pointer-events: none;
}

.nav-list {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  list-style: none;
  padding: 0;
  margin: 0;
}

.nav-item {
  position: relative;
}

.nav-item:not(:last-child)::after {
  content: "";
  position: absolute;
  right: 0;
  top: 25%;
  height: 50%;
  width: 2px;
  background-color: var(--accent);
}

.nav-link {
  display: block;
  color: var(--accent);
  text-decoration: none;
  padding: 15px 20px;
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 1px;
  transition: all 0.3s;
  position: relative;
  overflow: hidden;
}

.nav-link:hover,
.nav-link.active {
  background-color: var(--primary);
  color: var(--dark);
}

.nav-link::before {
  content: ">";
  position: absolute;
  left: -20px;
  transition: all 0.3s;
  opacity: 0;
}

.nav-link::after {
  content: "<";
  position: absolute;
  right: -20px;
  transition: all 0.3s;
  opacity: 0;
}

.nav-link:hover::before {
  left: 10px;
  opacity: 1;
}

.nav-link:hover::after {
  right: 10px;
  opacity: 1;
}

/* Projects Section */
.projects {
  padding: 50px 0;
  position: relative;
}

.section-title {
  text-align: center;
  font-size: 1.8rem;
  margin-bottom: 40px;
  color: var(--primary);
  text-shadow: 3px 3px 0 var(--secondary), 0 0 10px var(--primary);
}

.projects-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 30px;
}

/* Tinder-Style Card Stack Layout */
.projects-grid {
  position: relative;
  width: 100%;
  max-width: 500px;
  height: 600px;
  margin: 80px auto 50px;
  perspective: 1000px;
}

/* Card Stack Container */
.project-card {
  position: absolute;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 90%;
  max-width: 450px;
  height: 550px;
  cursor: grab;
  transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  user-select: none;
  touch-action: none;
}

.project-card:active {
  cursor: grabbing;
}

/* Flipped card gets bigger and comes to front */
.project-card.flipped {
  transform: translateX(-50%) translateY(30px) scale(1.25);
  z-index: 20;
  width: 100%;
  max-width: 650px;
}

/* Stack positioning - only show current card */
.project-card[data-stack="0"] {
  z-index: 10;
  transform: translateX(-50%) translateY(0) scale(1);
  opacity: 1;
}

.project-card[data-stack="1"],
.project-card[data-stack="2"],
.project-card[data-stack="3"],
.project-card[data-stack="hidden"] {
  display: none;
}

/* Swiping states */
.project-card.swiping {
  transition: none;
}

.project-card.swiped-left {
  transform: translateX(-150%) translateY(-50px) rotate(-30deg) !important;
  opacity: 0 !important;
  transition: all 0.5s ease-out;
}

.project-card.swiped-right {
  transform: translateX(50%) translateY(-50px) rotate(30deg) !important;
  opacity: 0 !important;
  transition: all 0.5s ease-out;
}

.card-inner {
  position: relative;
  width: 100%;
  height: 100%;
  transition: transform 0.6s cubic-bezier(0.68, -0.55, 0.265, 1.55);
  transform-style: preserve-3d;
  will-change: transform;
}

.project-card.flipped .card-inner {
  transform: rotateY(180deg);
}

.card-front,
.card-back {
  position: absolute;
  width: 100%;
  height: 100%;
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
  -moz-backface-visibility: hidden;
  border: 3px solid var(--primary);
  box-shadow: 0 8px 16px rgba(0, 0, 0, 0.6),
              0 0 30px rgba(51, 255, 51, 0.2);
  transition: all 0.3s ease;
  transform: translateZ(0);
  -webkit-transform: translateZ(0);
  -webkit-font-smoothing: antialiased;
  overflow: hidden;
  border-radius: 15px;
}

.project-card:hover .card-front,
.project-card:hover .card-back {
  box-shadow: 0 12px 24px rgba(51, 255, 51, 0.4),
              0 0 40px rgba(51, 255, 51, 0.3),
              inset 0 0 20px rgba(51, 255, 51, 0.1);
  border-color: var(--accent);
}

/* Card Front */
.card-front {
  background: #000;
  background-color: #000000;
  z-index: 2;
}

.card-back {
  background: linear-gradient(135deg, #141414 0%, #2a2a2a 100%);
  background-color: #1a1a1a;
  transform: rotateY(180deg);
  z-index: 1;
}

/* Front Side - Image */
.card-front .project-image {
  width: 100%;
  height: 100%;
  position: relative;
  overflow: hidden;
}

.card-front .project-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.6s ease;
  filter: brightness(0.8) saturate(1.2);
}

.project-card:hover .card-front .project-image img {
  transform: scale(1.1);
  filter: brightness(1) saturate(1.5);
}

/* Image Overlay */
.image-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(
    to bottom,
    rgba(0, 0, 0, 0.2) 0%,
    rgba(0, 0, 0, 0.6) 70%,
    rgba(0, 0, 0, 0.9) 100%
  );
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 20px;
  z-index: 2;
}

.front-title {
  font-size: 1.1rem;
  color: var(--primary);
  text-shadow: 2px 2px 8px rgba(0, 0, 0, 0.9),
               0 0 20px rgba(51, 255, 51, 0.5);
  align-self: flex-start;
  line-height: 1.4;
  letter-spacing: 1px;
  animation: glowPulse 3s ease-in-out infinite;
}

@keyframes glowPulse {
  0%, 100% { 
    text-shadow: 2px 2px 8px rgba(0, 0, 0, 0.9),
                 0 0 20px rgba(51, 255, 51, 0.5);
  }
  50% { 
    text-shadow: 2px 2px 8px rgba(0, 0, 0, 0.9),
                 0 0 30px rgba(51, 255, 51, 0.8);
  }
}

/* Flip Hint */
.flip-hint {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  opacity: 0.9;
  transition: all 0.3s ease;
  align-self: center;
}

.project-card:hover .flip-hint {
  opacity: 1;
  transform: translateY(-5px);
}

.flip-icon {
  font-size: 2rem;
  color: var(--accent);
  text-shadow: 0 0 10px rgba(255, 255, 51, 0.8);
  animation: rotateHint 2s ease-in-out infinite;
}

@keyframes rotateHint {
  0%, 100% { transform: rotate(0deg); }
  50% { transform: rotate(180deg); }
}

.flip-text {
  font-size: 0.7rem;
  color: var(--light);
  text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.9);
  letter-spacing: 2px;
}

/* Back Side - Content */
.back-content {
  padding: 25px;
  display: flex;
  flex-direction: column;
  height: 100%;
  position: relative;
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: var(--primary) var(--gray);
}

.back-content::-webkit-scrollbar {
  width: 6px;
}

.back-content::-webkit-scrollbar-track {
  background: var(--gray);
}

.back-content::-webkit-scrollbar-thumb {
  background: var(--primary);
  border-radius: 3px;
}

.back-content::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(
    90deg,
    var(--primary) 0%,
    var(--secondary) 50%,
    var(--accent) 100%
  );
  animation: gradientShift 3s ease infinite;
}

@keyframes gradientShift {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.7; }
}

.project-title {
  font-size: 1rem;
  margin-bottom: 15px;
  color: var(--primary);
  line-height: 1.4;
  letter-spacing: 1px;
  text-shadow: 0 0 10px rgba(51, 255, 51, 0.3);
}

.project-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 10px 0 15px 0;
}

.tag {
  background: var(--secondary);
  color: var(--light);
  padding: 5px 10px;
  font-size: 0.55rem;
  border: 1px solid var(--secondary-light);
  transition: all 0.3s ease;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  box-shadow: 0 2px 4px rgba(255, 51, 119, 0.4);
}

.tag:hover {
  background: var(--secondary-light);
  transform: translateY(-2px);
  box-shadow: 0 3px 6px rgba(255, 51, 119, 0.6);
}

.project-description {
  font-size: 0.7rem;
  line-height: 1.5;
  margin-bottom: 15px;
  color: rgba(255, 255, 255, 0.95);
  flex-grow: 1;
  text-align: left;
}

.view-project {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  background-color: var(--primary);
  color: var(--dark);
  padding: 12px 20px;
  text-decoration: none;
  font-size: 0.65rem;
  transition: all 0.3s ease;
  border: 2px solid var(--primary);
  box-shadow: 4px 4px 0 rgba(51, 255, 51, 0.5);
  text-transform: uppercase;
  letter-spacing: 1.5px;
  font-weight: bold;
  width: 100%;
  position: relative;
  overflow: hidden;
}

.view-project::before {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  width: 0;
  height: 0;
  background: rgba(255, 255, 51, 0.3);
  border-radius: 50%;
  transform: translate(-50%, -50%);
  transition: width 0.6s, height 0.6s;
}

.view-project:hover::before {
  width: 300px;
  height: 300px;
}

.view-project::after {
  content: "→";
  font-size: 1.2rem;
  transition: transform 0.3s ease;
  position: relative;
  z-index: 1;
}

.view-project:hover {
  background-color: var(--accent);
  transform: translateY(-2px);
  box-shadow: 6px 6px 0 rgba(255, 255, 51, 0.6);
}

.view-project:hover::after {
  transform: translateX(5px);
}

.view-project:active {
  transform: translateY(0);
  box-shadow: 2px 2px 0 rgba(51, 255, 51, 0.5);
}

/* Flip Back Hint */
.flip-back-hint {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin-top: 15px;
  padding-top: 15px;
  border-top: 1px dashed var(--primary);
  font-size: 0.6rem;
  color: var(--primary);
  opacity: 0.7;
  transition: opacity 0.3s ease;
}

.back-content:hover .flip-back-hint {
  opacity: 1;
}

.flip-back-hint .flip-icon {
  font-size: 1.2rem;
  animation: rotateHintSlow 3s ease-in-out infinite;
}

@keyframes rotateHintSlow {
  0%, 100% { transform: rotate(0deg); }
  50% { transform: rotate(-180deg); }
}

/* Swipe Indicators */
.swipe-indicator {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  font-size: 3rem;
  opacity: 0;
  transition: opacity 0.3s ease;
  pointer-events: none;
  z-index: 100;
  text-shadow: 0 0 20px currentColor;
}

.swipe-indicator.left {
  left: 30px;
  color: var(--secondary);
}

.swipe-indicator.right {
  right: 30px;
  color: var(--primary);
}

.project-card.swipe-hint-left .swipe-indicator.left {
  opacity: 1;
}

.project-card.swipe-hint-right .swipe-indicator.right {
  opacity: 1;
}

/* Stack Navigation Hint */
.stack-hint {
  text-align: center;
  margin-top: 30px;
  font-size: 0.7rem;
  color: var(--primary);
  opacity: 0.8;
}

.stack-hint .hint-icon {
  font-size: 1.5rem;
  display: block;
  margin-bottom: 10px;
  animation: swipeHint 2s ease-in-out infinite;
}

@keyframes swipeHint {
  0%, 100% { transform: translateX(0); }
  50% { transform: translateX(20px); }
}

/* Counter */
.project-counter {
  position: absolute;
  top: -60px;
  left: 50%;
  transform: translateX(-50%);
  font-size: 0.8rem;
  color: var(--accent);
  background: rgba(0, 0, 0, 0.8);
  padding: 8px 20px;
  border: 2px solid var(--primary);
  text-shadow: 0 0 10px var(--accent);
}

/* End State - All Cards Completed */
.completion-card {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 90%;
  max-width: 450px;
  padding: 40px;
  background: linear-gradient(135deg, #141414 0%, #2a2a2a 100%);
  border: 3px solid var(--primary);
  border-radius: 15px;
  text-align: center;
  box-shadow: 0 8px 16px rgba(0, 0, 0, 0.6),
              0 0 30px rgba(51, 255, 51, 0.3);
  animation: fadeInScale 0.5s ease-out;
}

@keyframes fadeInScale {
  from {
    opacity: 0;
    transform: translate(-50%, -50%) scale(0.8);
  }
  to {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1);
  }
}

.completion-card h3 {
  font-size: 1.5rem;
  color: var(--primary);
  margin-bottom: 20px;
  text-shadow: 0 0 20px rgba(51, 255, 51, 0.5);
}

.completion-card p {
  font-size: 0.8rem;
  color: rgba(255, 255, 255, 0.8);
  line-height: 1.8;
  margin-bottom: 30px;
}

.completion-card .reset-btn {
  display: inline-block;
  background-color: var(--primary);
  color: var(--dark);
  padding: 15px 30px;
  font-size: 0.7rem;
  border: 2px solid var(--primary);
  cursor: pointer;
  transition: all 0.3s ease;
  text-transform: uppercase;
  letter-spacing: 2px;
  font-weight: bold;
  box-shadow: 4px 4px 0 rgba(51, 255, 51, 0.5);
}

.completion-card .reset-btn:hover {
  background-color: var(--accent);
  border-color: var(--accent);
  transform: translateY(-3px);
  box-shadow: 6px 6px 0 rgba(255, 255, 51, 0.6);
}

.completion-card .reset-btn:active {
  transform: translateY(0);
  box-shadow: 2px 2px 0 rgba(51, 255, 51, 0.5);
}

.completion-icon {
  font-size: 4rem;
  margin-bottom: 20px;
  animation: completionPulse 2s ease-in-out infinite;
}

@keyframes completionPulse {
  0%, 100% {
    transform: scale(1);
    opacity: 1;
  }
  50% {
    transform: scale(1.1);
    opacity: 0.8;
  }
}

/* Skills Section */
.skills {
  padding: 50px 0;
  background-color: rgba(51, 51, 51, 0.3);
  border-top: 4px solid var(--primary);
  border-bottom: 4px solid var(--primary);
  position: relative;
}

.skill-icon {
  width: 50px;
  height: 50px;
  object-fit: contain;
  margin-bottom: 10px;
}

.skill-name {
  font-size: 0.8rem;
  word-wrap: break-word;
  max-width: 100%;
  padding: 0 5px;
  margin-top: 10px;
}

/* Footer */
footer {
  padding: 30px 0;
  text-align: center;
  border-top: 4px solid var(--primary);
  margin-top: 50px;
}

.footer-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 20px;
}

.social-links {
  display: flex;
  flex-wrap: wrap; /* Allows items to wrap to next line */
  gap: 20px; /* Space between items */
  justify-content: center; /* Centers items when they wrap */
  max-width: 100%; /* Prevents horizontal overflow */
  padding: 0 10px; /* Adds padding on small screens */
  margin: 0 auto; /* Centers the container */
}

.social-icon {
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 2px solid var(--primary);
  transition: all 0.3s;
  background-color: var(--dark);
  image-rendering: pixelated;
}

.social-icon:hover {
  background-color: var(--primary);
  transform: translateY(-3px) scale(1.1);
  box-shadow: 4px 4px 0 var(--secondary);
}

.social-icon:hover .pixel-icon {
  fill: var(--dark);
}

.social-icon::after {
  content: "";
  position: absolute;
  top: -4px;
  left: -4px;
  right: -4px;
  bottom: -4px;
  border: 2px solid var(--accent);
  z-index: -1;
  opacity: 0;
  transition: opacity 0.3s;
}

.social-btn {
  color: var(--primary);
  text-decoration: none;
  padding: 8px 12px;
  border: 3px solid var(--primary);
  font-size: 0.7rem;
  text-transform: uppercase;
  transition: all 0.3s;
  background-color: var(--dark);
  box-shadow: 4px 4px 0 var(--secondary);
  image-rendering: pixelated;
}

.social-btn:hover {
  background-color: var(--primary);
  color: var(--dark);
  transform: translateY(-3px);
  box-shadow: 6px 6px 0 var(--secondary);
}

.social-icon:hover::after {
  opacity: 1;
}

.social-links a {
  color: var(--primary);
  font-size: 1.5rem;
  transition: color 0.3s;
}

.social-links a:hover {
  color: var(--accent);
}

.copyright {
  font-size: 0.7rem;
  color: #777;
}

/* Skills Grid */
.skills-grid {
  display: flex;
  justify-content: center;
  gap: 20px;
  flex-wrap: wrap;
  padding: 20px 0;
}

.skill-item {
  background-color: var(--gray);
  border: 3px solid var(--primary);
  padding: 12px 8px;
  width: 100px;
  min-width: 100px;
  max-width: 100px;
  height: 110px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  transition: all 0.3s;
  position: relative;
}

.skill-item:hover {
  border-color: var(--accent);
  transform: translateY(-5px);
  box-shadow: 4px 4px 0 var(--secondary);
  z-index: 20;
}

.fab {
  font-size: 2.2rem;
  color: var(--primary);
  margin-bottom: 8px;
}

.skill-name {
  position: absolute;
  bottom: -40px;
  left: 50%;
  transform: translateX(-50%) translateY(10px);
  font-size: 0.7rem;
  color: var(--light);
  text-align: center;
  padding: 8px 12px;
  opacity: 0;
  pointer-events: none;
  transition: all 0.3s ease;
  white-space: nowrap;
  background: rgba(0, 0, 0, 0.9);
  border: 2px solid var(--primary);
  z-index: 10;
  min-width: max-content;
}

.skill-item:hover .skill-name {
  color: var(--accent);
  text-shadow: 0 0 10px rgba(255, 255, 0, 0.8);
  border-color: var(--accent);
  opacity: 1;
  transform: translateX(-50%) translateY(0);
  box-shadow: 0 4px 12px rgba(51, 255, 51, 0.4);
}

.skill-item:hover .fab {
  color: var(--accent);
  transform: scale(1.2);
  text-shadow: 0 0 10px rgba(255, 255, 51, 0.5);
}

.skill-item:hover .skill-icon {
  width: 40px;
  transform: scale(1.3);
  transition: transform 0.2s, filter 0.2s;
}
/* Music Player Styles */

.pause-icon {
  display: none;
  font-size: 16px;
}

.music-btn.playing .play-icon {
  display: inline;
}

.music-btn.playing .pause-icon {
  display: none;
}

.music-btn:not(.playing) .play-icon {
  display: none;
}

.music-btn:not(.playing) .pause-icon {
  display: inline;
}

.music-player {
  position: fixed;
  bottom: 20px;
  right: 20px;
  z-index: 1000;
  display: flex;
  flex-direction: column-reverse;
  align-items: center;
  gap: 5px;
}

.music-btn {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background-color: var(--primary);
  color: var(--dark);
  border: 2px solid var(--accent);
  font-size: 20px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.3s;
  box-shadow: 0 0 10px rgba(0, 0, 0, 0.5);
}

.music-btn:hover {
  background-color: var(--accent);
  transform: scale(1.1);
}

.music-btn.playing {
  animation: pulse 1s infinite;
}

.music-btn.muted {
  opacity: 0.6;
  position: relative;
}

.music-btn.muted::after {
  content: "";
  position: absolute;
  top: 50%;
  left: 0;
  width: 100%;
  height: 2px;
  background: var(--secondary);
  transform: rotate(-45deg);
}

@keyframes pulse {
  0% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.1);
  }
  100% {
    transform: scale(1);
  }
}

/* 8-Bit Game Volume Slider */
#volumeSlider {
  appearance: none;
  width: 100px;
  height: 16px;
  background: var(--dark);
  border: 4px solid var(--primary);
  outline: none;
  box-shadow: 4px 4px 0 var(--secondary);
  image-rendering: pixelated;
  margin-bottom: 15px;
  position: relative;
}

#volumeSlider::before {
  position: absolute;
  top: -20px;
  left: 0;
  font-size: 0.6rem;
  color: var(--accent);
  text-shadow: 2px 2px 0 var(--dark);
}

/* Track - the groove */
#volumeSlider::-webkit-slider-runnable-track {
  height: 8px;
  background: repeating-linear-gradient(
    to right,
    var(--gray),
    var(--gray) 2px,
    var(--dark) 2px,
    var(--dark) 4px
  );
  border: 2px solid var(--accent);
}

#volumeSlider::-moz-range-track {
  height: 8px;
  background: repeating-linear-gradient(
    to right,
    var(--gray),
    var(--gray) 2px,
    var(--dark) 2px,
    var(--dark) 4px
  );
  border: 2px solid var(--accent);
}

/* Thumb - the handle */
#volumeSlider::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 12px;
  height: 20px;
  background: var(--accent);
  border: 3px solid var(--primary);
  border-bottom: 6px solid var(--primary);
  margin-top: -6px; /* Centers thumb on track */
  cursor: pointer;
  image-rendering: pixelated;
  box-shadow: 2px 2px 0 var(--secondary);
}

#volumeSlider::-moz-range-thumb {
  width: 12px;
  height: 20px;
  background: var(--accent);
  border: 3px solid var(--primary);
  border-bottom: 6px solid var(--primary);
  cursor: pointer;
  image-rendering: pixelated;
  box-shadow: 2px 2px 0 var(--secondary);
}

/* Volume indicators */
#volumeSlider::after {
  position: absolute;
  bottom: -15px;
  left: 0;
  width: 100%;
  color: var(--primary);
  font-size: 0.6rem;
  text-align: center;
  letter-spacing: 2px;
}

/* Health Bar Contact - 8-bit Style */
.health-contact {
  text-align: center;
  margin: 20px auto;
  max-width: 250px;
  cursor: pointer;
  transition: all 0.3s;
}

.health-text {
  color: var(--accent);
  font-size: 0.8rem;
  text-shadow: 2px 2px 0 var(--dark);
  margin-bottom: 5px;
  letter-spacing: 1px;
}

.health-bar {
  height: 16px;
  border: 3px solid var(--primary);
  background: var(--dark);
  position: relative;
  overflow: hidden;
  box-shadow: 4px 4px 0 var(--gray);
}

.health-fill {
  height: 100%;
  width: 100%;
  background: repeating-linear-gradient(
    45deg,
    var(--secondary),
    var(--secondary) 4px,
    var(--secondary-dark) 4px,
    var(--secondary-dark) 8px
  );
  position: relative;
  transition: width 0.5s cubic-bezier(0.65, 0, 0.35, 1);
  display: flex; /* Add this */
  align-items: center; /* Add this */
  justify-content: center; /* Add this */
}

.health-fill::before {
  content: attr(data-text);
  position: relative;
  width: 100%;
  text-align: center;
  font-size: 0.6rem;
  color: var(--dark);
  text-transform: uppercase;
  letter-spacing: 1px;
}

/* Hover Animations */
.health-contact:hover {
  transform: translateY(-3px);
}

.health-contact:hover .health-bar {
  border-color: var(--accent);
  box-shadow: 4px 4px 0 var(--secondary);
}

.health-contact:hover .health-fill {
  animation: healthPulse 0.8s infinite alternate,
    healthGlow 1.5s infinite alternate;
}

@keyframes healthPulse {
  0% {
    transform: scaleX(1);
  }
  100% {
    transform: scaleX(0.95);
  }
}

@keyframes healthGlow {
  0% {
    box-shadow: 0 0 5px var(--secondary);
  }
  100% {
    box-shadow: 0 0 15px var(--secondary);
  }
}

.refilling {
  animation: healthRefill 5s linear forwards,
    healthPulse 0.8s infinite alternate;
}

@keyframes healthRefill {
  0% {
    width: 0%;
  }
  100% {
    width: 100%;
  }
}

/* Add this for the refill transition effect */
.health-bar::after {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 0%;
  height: 100%;
  background: rgba(255, 255, 255, 0.2);
  mix-blend-mode: overlay;
}

/* Hero Section */
.hero {
  height: 80vh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  background: linear-gradient(rgba(0, 0, 0, 0.8), rgba(0, 0, 0, 0.8)),
    url('data:image/svg+xml;utf8,<svg width="20" height="20" xmlns="http://www.w3.org/2000/svg"><rect width="2" height="2" fill="%2333ff33" opacity="0.2"/></svg>');
  position: relative;
  overflow: hidden;
}

/* Pixel Text Effect */
.pixel-text-container {
  position: relative;
  display: inline-block;
}

.pixel-text {
  font-family: "Press Start 2P", cursive;
  font-size: clamp(2rem, 5vw, 4rem);
  color: var(--primary);
  text-shadow: 4px 4px 0 var(--secondary);
  letter-spacing: 2px;
  position: relative;
}

.pixel-text::after {
  content: attr(data-text);
  position: absolute;
  left: 0;
  top: 0;
  color: var(--accent);
  width: 0;
  overflow: hidden;
  animation: typing 3s steps(10) infinite alternate;
}

.typing-cursor {
  position: absolute;
  right: -15px;
  top: 0;
  width: 10px;
  height: 1em;
  background: var(--accent);
  animation: blink 1s infinite;
}

/* Scroll Hint */
.pixel-scroll-hint {
  display: flex;
  flex-direction: column;
  align-items: center;
  margin-top: 2rem;
  text-decoration: none;
}

.pixel-arrow {
  color: var(--primary);
  font-size: 1.5rem;
  animation: bounce 2s infinite;
  margin-bottom: 0.5rem;
}

.pixel-scroll-hint p {
  color: var(--accent);
  font-size: 0.8rem;
  margin-top: 5px;
  text-transform: uppercase;
}

/* Animations */
@keyframes typing {
  to {
    width: 100%;
  }
}

@keyframes bounce {
  0%,
  100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-10px);
  }
}

/* Floating Pixels Background */
.hero::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: url('data:image/svg+xml;utf8,<svg width="20" height="20" xmlns="http://www.w3.org/2000/svg"><rect width="3" height="3" fill="%2333ff33" opacity="0.1"/></svg>');
  animation: pixelFloat 20s linear infinite;
}

@keyframes pixelFloat {
  from {
    transform: translateY(0) translateX(0);
  }
  to {
    transform: translateY(-100vh) translateX(100px);
  }
}

/* About Section */
.about-section {
  padding: 50px 0;
  background-color: rgba(51, 51, 51, 0.3);
  border-top: 4px solid var(--secondary);
  border-bottom: 4px solid var(--secondary);
}

.about-content {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
  gap: 40px;
  max-width: 900px;
  margin: 0 auto;
}

.portrait-container {
  width: 300px;
  height: 300px;
  border: 4px solid var(--accent);
  box-shadow: 8px 8px 0 var(--secondary);
  overflow: hidden;
  margin: 0 auto 20px;
  transition: all 0.3s;
}

.portrait-container:hover {
  transform: scale(1.05) rotate(5deg);
  border-color: var(--primary);
}

.profile-image {
  width: 100%;
  height: 100%;
  object-fit: cover; /* This ensures proper filling without stretching */
  object-position: center top; /* Focuses on face by default */
  display: block;
}
/* Matrix Canvas */
#matrix-canvas {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
  opacity: 0.3;
}

.hero-content {
  position: relative;
  z-index: 2;
  text-align: center;
  max-width: 800px;
  padding: 20px;
}
.bio-text {
  flex: 1;
  min-width: 300px;
  padding: 20px;
  background-color: var(--gray);
  border: 4px solid var(--primary);
  line-height: 1.8;
  font-size: 0.9rem;
  transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.bio-text p {
  margin-bottom: 15px;
}

.skills-list {
  list-style: none;
  padding-left: 20px;
}

.skills-list li {
  position: relative;
  margin-bottom: 8px;
  padding-left: 20px;
}

.skills-list li::before {
  content: "*";
  position: absolute;
  left: 0;
  color: var(--primary);
}

/* Contact Section */
.contact-section {
  padding: 50px 0;
  background-color: rgba(0, 0, 0, 0.7);
}

.form-row {
  margin-bottom: 20px;
}

.form-row label {
  display: block;
  margin-bottom: 8px;
  color: var(--accent);
}

.pixel-input,
.pixel-textarea {
  width: 100%;
  max-width: 100%;
  padding: 12px 15px;
  background-color: var(--dark);
  border: 3px solid var(--primary);
  color: var(--light);
  font-family: "Press Start 2P", cursive;
  font-size: 0.8rem;
  box-sizing: border-box;
  line-height: 1.5;
  display: flex;
  align-items: center;
}

.pixel-textarea {
  line-height: 1.6;
  padding-top: 15px;
  min-height: 150px;
  resize: vertical;
}

.pixel-button {
  background-color: var(--primary);
  color: var(--dark);
  border: none;
  padding: 12px 24px;
  font-family: "Press Start 2P", cursive;
  font-size: 0.8rem;
  cursor: pointer;
  transition: all 0.3s;
  box-shadow: 4px 4px 0 var(--secondary);
}

.pixel-button:hover {
  background-color: var(--accent);
  transform: translateY(-3px);
  box-shadow: 6px 6px 0 var(--secondary);
}

.contact-alternatives {
  text-align: center;
  margin-top: 40px;
}

.contact-methods {
  display: flex;
  justify-content: center;
  gap: 20px;
  margin-top: 20px;
  flex-wrap: wrap;
}

.contact-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 20px;
  background-color: var(--gray);
  border: 3px solid var(--primary);
  color: var(--primary);
  text-decoration: none;
  transition: all 0.3s;
}

.contact-chip:hover {
  background-color: var(--primary);
  color: var(--dark);
  transform: translateY(-3px);
  box-shadow: 4px 4px 0 var(--secondary);
}

/* Form Container */
.contact-form {
  height: auto;
  max-width: 600px;
  margin: 0 auto;
  padding: 30px;
  background-color: var(--gray);
  border: 4px solid var(--primary);
  box-shadow: 8px 8px 0 var(--secondary-dark);
}

/* Form Rows */
.form-row {
  position: relative;
  margin-bottom: 30px;
}

/* Input Fields */
.pixel-input,
.pixel-textarea {
  width: 100%;
  padding: 15px;
  background-color: var(--dark);
  border: 3px solid var(--primary);
  color: var(--light);
  font-family: "Press Start 2P", cursive;
  font-size: 0.8rem;
  transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.pixel-textarea {
  min-height: 150px;
  resize: vertical;
}

/* Floating Labels */
.floating-label {
  position: absolute;
  left: 15px;
  top: 15px;
  color: var(--accent);
  font-size: 0.8rem;
  transition: all 0.3s ease;
  pointer-events: none;
  text-shadow: 2px 2px 0 var(--dark);
}

/* Input Highlight Effect */
.input-highlight {
  position: absolute;
  bottom: 0;
  left: 0;
  width: 0;
  height: 3px;
  background-color: var(--accent);
  transition: width 0.4s ease;
}

/* Focus/Hover States */
.pixel-input:hover,
.pixel-textarea:hover,
.bio-text:hover {
  border-color: var(--primary-light);
  box-shadow: 0 0 0 2px var(--primary-light);
}

.pixel-input:focus,
.pixel-textarea:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent);
  padding-left: 20px;
}

.pixel-input:focus ~ .floating-label,
.pixel-textarea:focus ~ .floating-label,
.pixel-input:not(:placeholder-shown) ~ .floating-label,
.pixel-textarea:not(:placeholder-shown) ~ .floating-label {
  top: -25px;
  left: 5px;
  font-size: 0.7rem;
  color: var(--primary);
  text-shadow: 2px 2px 0 var(--secondary-dark);
}

.pixel-input:focus ~ .input-highlight,
.pixel-textarea:focus ~ .input-highlight {
  width: 100%;
}

/* Submit Button */
.pixel-button {
  position: relative;
  background-color: var(--primary);
  color: var(--dark);
  border: none;
  padding: 15px 30px;
  font-family: "Press Start 2P", cursive;
  font-size: 0.8rem;
  cursor: pointer;
  transition: all 0.3s ease;
  box-shadow: 4px 4px 0 var(--secondary-dark);
  overflow: hidden;
  display: block; /* Make the button a block-level element */
  margin: 0 auto; /* Center the button horizontally */
}

.pixel-button .button-text {
  position: relative;
  z-index: 2;
  transition: all 0.3s ease;
}

.pixel-button .button-icon {
  position: absolute;
  right: -20px;
  opacity: 0;
  transition: all 0.3s ease;
}

.pixel-button:hover {
  transform: translateY(-3px);
  box-shadow: 6px 6px 0 var(--secondary-dark);
}

.pixel-button:hover .button-text {
  transform: translateX(-5px);
}

.pixel-button:hover .button-icon {
  right: 15px;
  opacity: 1;
}

.pixel-button:active {
  transform: translateY(1px);
  box-shadow: 2px 2px 0 var(--secondary-dark);
}

/* Responsive Adjustments */
@media (max-width: 600px) {
  .contact-form {
    padding: 30px;
  }

  .pixel-input,
  .bio-text .pixel-textarea {
    font-size: 0.7rem;
    padding: 12px;
  }
}

/* Carousel Container */
.projects-carousel {
  position: relative;
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  gap: 15px;
  padding: 0 20px;
}

.carousel-container {
  width: 100%;
  overflow: hidden;
  -webkit-overflow-scrolling: touch;
  scroll-snap-type: x mandatory;
  scroll-behavior: smooth;
  overflow-x: auto;
  overflow-y: hidden;
  -ms-overflow-style: none;
  justify-content: flex-start;
}

.carousel-container::-webkit-scrollbar {
  display: none;
}

.carousel-track {
  display: flex;
  gap: 30px;
  width: max-content;
  transition: transform 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
  text-align: center;
  justify-content: center;
  align-items: stretch;
}

/* Navigation Buttons */
.carousel-btn {
  width: 50px;
  height: 50px;
  background-color: var(--primary);
  color: var(--dark);
  border: 3px solid var(--accent);
  border-radius: 0;
  font-family: "Press Start 2P", cursive;
  cursor: pointer;
  transition: all 0.3s;
  flex-shrink: 0;
  position: relative;
  z-index: 2;
  box-shadow: 4px 4px 0 var(--secondary);
  display: flex;
  align-items: center;
  justify-content: center;
}

.carousel-btn:hover {
  background-color: var(--accent);
  transform: translateY(-3px);
  box-shadow: 6px 6px 0 var(--secondary-dark);
}

.carousel-btn:active {
  transform: translateY(1px);
  box-shadow: 2px 2px 0 var(--secondary-dark);
}

.carousel-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  background-color: var(--gray);
  transform: none;
  box-shadow: 4px 4px 0 var(--secondary);
}

.carousel-btn:disabled .pixel-arrow {
  opacity: 0.5;
}

.pixel-arrow {
  font-size: 1.5rem;
  line-height: 1;
  color: var(--secondary-light);
  display: block;
  transition: all 0.3s;
}

/* Project Cards in Carousel */
.project-card {
  flex: 0 0 calc(100% - 20px);
  max-width: 350px;
  scroll-snap-align: start;
  position: relative;
  margin-right: 30px;
  max-height: 100%;
}

/* Dot indicators */
.carousel-dots {
  display: flex;
  justify-content: center;
  gap: 10px;
  margin-top: 20px;
}

.carousel-dot {
  width: 12px;
  height: 12px;
  background-color: var(--gray);
  border: 2px solid var(--primary);
  cursor: pointer;
  transition: all 0.3s;
}

.carousel-dot.active {
  background-color: var(--primary);
  transform: scale(1.2);
  box-shadow: 0 0 5px var(--primary-light);
}

.no-projects-message {
  font-size: 1.5rem;
  color: #555;
  font-weight: bold;
  padding: 20px;
  border-radius: 8px;
}

/* Loading Spinner */
#loading-spinner {
  display: none;
}

.spinner-container {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: #000000;
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 99999;
  overflow: hidden;
}

.spinner-container::after {
  content: '';
  position: absolute;
  inset: 0;
  background: 
    radial-gradient(circle at 50% 50%, rgba(51, 255, 51, 0.1), transparent 50%),
    radial-gradient(circle at 80% 20%, rgba(255, 51, 119, 0.1), transparent 40%),
    radial-gradient(circle at 20% 80%, rgba(255, 255, 51, 0.1), transparent 40%),
    #000000;
  z-index: 1;
  pointer-events: none;
}

.spinner-container::before {
  content: '';
  position: absolute;
  inset: 0;
  background: repeating-linear-gradient(
    0deg,
    transparent,
    transparent 2px,
    rgba(51, 255, 51, 0.03) 2px,
    rgba(51, 255, 51, 0.03) 4px
  );
  animation: scanlineMove 0.5s linear infinite;
  z-index: 2;
}

@keyframes scanlineMove {
  0% { transform: translateY(0); }
  100% { transform: translateY(4px); }
}

/* Loading Content */
.loading-content {
  position: relative;
  z-index: 10;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2rem;
}

/* Loading Logo */
.loading-logo {
  position: relative;
  width: 150px;
  height: 150px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.loading-diamond {
  font-size: 4rem;
  color: #33ff33;
  text-shadow: 
    0 0 20px #33ff33,
    0 0 40px #33ff33,
    0 0 60px #33ff33,
    0 0 80px #33ff33;
  animation: diamondPulse 2s ease-in-out infinite;
  z-index: 2;
}

@keyframes diamondPulse {
  0%, 100% {
    transform: scale(1) rotate(0deg);
    filter: brightness(1);
  }
  25% {
    transform: scale(1.1) rotate(90deg);
    filter: brightness(1.5);
  }
  50% {
    transform: scale(1) rotate(180deg);
    filter: brightness(1);
  }
  75% {
    transform: scale(1.1) rotate(270deg);
    filter: brightness(1.5);
  }
}

.loading-rings {
  position: absolute;
  inset: 0;
}

.ring {
  position: absolute;
  border: 3px solid;
  border-radius: 50%;
  animation: ringRotate 3s linear infinite;
}

.ring-1 {
  inset: 0;
  border-color: #33ff33 transparent transparent transparent;
  animation-duration: 2s;
}

.ring-2 {
  inset: 15px;
  border-color: transparent #ff3377 transparent transparent;
  animation-duration: 3s;
  animation-direction: reverse;
}

.ring-3 {
  inset: 30px;
  border-color: transparent transparent #ffff33 transparent;
  animation-duration: 4s;
}

@keyframes ringRotate {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

/* Loading Text */
.loading-text {
  font-family: 'Press Start 2P', monospace;
  font-size: 1.5rem;
  display: flex;
  gap: 0.5rem;
  align-items: center;
}

.loading-letter {
  color: #33ff33;
  text-shadow: 0 0 10px #33ff33;
  animation: letterBounce 1.4s ease-in-out infinite;
  display: inline-block;
}

.loading-letter:nth-child(1) { animation-delay: 0s; }
.loading-letter:nth-child(2) { animation-delay: 0.1s; }
.loading-letter:nth-child(3) { animation-delay: 0.2s; }
.loading-letter:nth-child(4) { animation-delay: 0.3s; }
.loading-letter:nth-child(5) { animation-delay: 0.4s; }
.loading-letter:nth-child(6) { animation-delay: 0.5s; }
.loading-letter:nth-child(7) { animation-delay: 0.6s; }

@keyframes letterBounce {
  0%, 60%, 100% {
    transform: translateY(0);
    color: #33ff33;
  }
  30% {
    transform: translateY(-10px);
    color: #ffff33;
  }
}

.loading-dots span {
  animation: dotFade 1.5s ease-in-out infinite;
  color: #ff3377;
  text-shadow: 0 0 10px #ff3377;
}

.loading-dots span:nth-child(1) { animation-delay: 0s; }
.loading-dots span:nth-child(2) { animation-delay: 0.2s; }
.loading-dots span:nth-child(3) { animation-delay: 0.4s; }

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

/* Loading Bar */
.loading-bar {
  position: relative;
  width: 400px;
  height: 30px;
  border: 3px solid #33ff33;
  background: rgba(0, 0, 0, 0.8);
  box-shadow: 
    0 0 20px rgba(51, 255, 51, 0.5),
    inset 0 0 20px rgba(0, 0, 0, 0.8);
  overflow: hidden;
}

.loading-progress {
  position: absolute;
  left: 0;
  top: 0;
  height: 100%;
  width: 0%;
  background: linear-gradient(
    90deg,
    #33ff33,
    #ffff33,
    #ff3377,
    #33ff33
  );
  background-size: 200% 100%;
  animation: progressFill 3s ease-out forwards, gradientShift 2s linear infinite;
  box-shadow: 0 0 20px currentColor;
}

@keyframes progressFill {
  0% { width: 0%; }
  100% { width: 100%; }
}

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

.loading-glitch {
  position: absolute;
  inset: 0;
  background: repeating-linear-gradient(
    90deg,
    transparent,
    transparent 10px,
    rgba(51, 255, 51, 0.1) 10px,
    rgba(51, 255, 51, 0.1) 11px
  );
  animation: glitchMove 0.5s linear infinite;
}

@keyframes glitchMove {
  0% { transform: translateX(0); }
  100% { transform: translateX(20px); }
}

/* Loading Stats */
.loading-stats {
  font-family: 'Press Start 2P', monospace;
  font-size: 0.8rem;
  color: #33ff33;
  display: flex;
  gap: 2rem;
  text-shadow: 0 0 10px #33ff33;
}

.stat-counter {
  color: #ffff33;
  text-shadow: 0 0 10px #ffff33;
  animation: counterTick 3s linear forwards;
}

@keyframes counterTick {
  0% { content: "0"; }
  100% { content: "100"; }
}

/* Loading Particles */
.loading-particles {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

/* Responsive */
@media (max-width: 768px) {
  .loading-logo {
    width: 100px;
    height: 100px;
  }
  
  .loading-diamond {
    font-size: 3rem;
  }
  
  .loading-text {
    font-size: 1rem;
  }
  
  .loading-bar {
    width: 300px;
    height: 25px;
  }
  
  .loading-stats {
    font-size: 0.6rem;
    flex-direction: column;
    gap: 0.5rem;
    text-align: center;
  }
}

@media (max-width: 480px) {
  .loading-bar {
    width: 250px;
    height: 20px;
  }
  
  .loading-text {
    font-size: 0.8rem;
    gap: 0.3rem;
  }
}

/* Form Errors */
.form-errors {
  margin-top: 1rem;
  color: var(--secondary);
  font-size: 0.9rem;
  white-space: pre-line;
}

.input-error {
  border-color: var(--secondary);
}

@keyframes shake {
  0% {
    transform: translateX(0);
  }
  20% {
    transform: translateX(-5px);
  }
  40% {
    transform: translateX(5px);
  }
  60% {
    transform: translateX(-5px);
  }
  80% {
    transform: translateX(5px);
  }
  100% {
    transform: translateX(0);
  }
}

.pixel-button.shake {
  animation: shake 0.3s;
}

/* Consolidated Media Queries */
@media (max-width: 768px) {
  h1 {
    font-size: 1.8rem;
  }
  .hero {
    min-height: 40vh;
  }
  
  .projects-grid {
    height: 550px;
    margin: 60px auto 30px;
  }
  
  .project-card {
    width: 95%;
    height: 500px;
  }
  
  /* Bigger scale on mobile when flipped */
  .project-card.flipped {
    transform: translateX(-50%) translateY(20px) scale(1.15);
    width: 92%;
    max-width: 92%;
  }
  
  .swipe-indicator {
    font-size: 2.5rem;
  }
  
  .swipe-indicator.left {
    left: 20px;
  }
  
  .swipe-indicator.right {
    right: 20px;
  }

  /* Navbar */
  .navbar {
    max-width: 90%;
  }
  .nav-list {
    flex-direction: column;
  }
  .nav-item:not(:last-child)::after {
    display: none;
  }
  .nav-item {
    border-bottom: 2px solid var(--accent);
  }
  .nav-item:last-child {
    border-bottom: none;
  }

  /* About & Contact */
  .about-content {
    flex-direction: column;
  }
  .bio-text {
    min-width: auto;
  }
  .contact-methods {
    flex-direction: column;
    align-items: center;
  }

  /* Profile Image Mobile */
  .portrait-container {
    width: 250px;
    height: 250px;
  }
}

@media (max-width: 600px) {
  .contact-form {
    padding: 30px;
  }
  .pixel-input,
  .bio-text,
  .pixel-textarea {
    font-size: 0.7rem;
    padding: 12px;
  }
}
