/* 
 * Sajal Halder - Backend Developer Portfolio
 * Theme: Terminal Noir - A dark terminal-inspired theme with neon accents
 */

:root {
  /* Dark theme (default) */
  --bg-primary: #0a0a0a;
  --bg-secondary: #111111;
  --bg-tertiary: #1a1a1a;
  --text-primary: #f0f0f0;
  --text-secondary: #b0b0b0;
  --text-muted: #707070;
  --accent-neon: #0cfa60;
  --accent-blue: #0099ff;
  --accent-purple: #cc66ff;
  --accent-orange: #ff6e42;
  --border-color: #333333;
  --shadow: rgba(0, 0, 0, 0.4);
  --error: #ff4242;
  --crt-glow: rgba(12, 250, 96, 0.15);
  --crt-bloom: rgba(12, 250, 96, 0.08);
  
  /* Typography */
  --font-main: 'JetBrains Mono', monospace;
  --font-size-base: 16px;
  --line-height: 1.6;
}

/* Light theme variables */
[data-theme="light"] {
  --bg-primary: #f0f0f0;
  --bg-secondary: #e0e0e0;
  --bg-tertiary: #d0d0d0;
  --text-primary: #121212;
  --text-secondary: #333333;
  --text-muted: #666666;
  --accent-neon: #00a651;
  --accent-blue: #0077cc;
  --accent-purple: #9933cc;
  --accent-orange: #e64a19;
  --border-color: #cccccc;
  --shadow: rgba(0, 0, 0, 0.1);
  --crt-glow: rgba(0, 166, 81, 0.15);
  --crt-bloom: rgba(0, 166, 81, 0.08);
}

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

body {
  font-family: var(--font-main);
  background-color: var(--bg-primary);
  transition: background 0.5s ease, color 0.5s ease;
  color: var(--text-primary);
  font-size: var(--font-size-base);
  line-height: var(--line-height);
  overflow-x: hidden;
  position: relative;
}

/* Smooth theme transitions */
*,
*::before,
*::after {
  transition-property: background-color, border-color, color, box-shadow, opacity, text-shadow;
  transition-duration: 0.3s;
  transition-timing-function: ease;
}

/* Exclude animations from transitions to avoid conflicts */
@keyframes no-transition {
  0% { transition: none; }
  100% { transition: none; }
}

[class*="animation"],
.cursor,
.logo-cursor,
.moving-scanline,
.noise-overlay,
.glitch-effect,
[class*="animation"]::before,
[class*="animation"]::after {
  transition: none !important;
}

/* Dark mode background */
body:not([data-theme="light"])::before {
  content: '';
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-image: 
    linear-gradient(rgba(10, 10, 10, 0.85), rgba(10, 10, 10, 0.9)),
    url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%230cfa60' fill-opacity='0.05'%3E%3Cpath d='M36 34v-4h-2v4h-4v2h4v4h2v-4h4v-2h-4zm0-30V0h-2v4h-4v2h4v4h2V6h4V4h-4zM6 34v-4H4v4H0v2h4v4h2v-4h4v-2H6zM6 4V0H4v4H0v2h4v4h2V6h4V4H6z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E"),
    radial-gradient(circle at center, rgba(10, 10, 10, 0.9) 0%, rgba(10, 10, 10, 0.95) 70%, rgba(0, 0, 0, 1) 100%);
  background-size: auto, 60px 60px, 100% 100%;
  background-attachment: fixed;
  pointer-events: none;
  z-index: -2;
}

/* Light mode background */
body[data-theme="light"]::before {
  content: '';
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-image: 
    linear-gradient(rgba(240, 240, 240, 0.85), rgba(240, 240, 240, 0.9)),
    url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%2300a651' fill-opacity='0.05'%3E%3Cpath d='M36 34v-4h-2v4h-4v2h4v4h2v-4h4v-2h-4zm0-30V0h-2v4h-4v2h4v4h2V6h4V4h-4zM6 34v-4H4v4H0v2h4v4h2v-4h4v-2H6zM6 4V0H4v4H0v2h4v4h2V6h4V4H6z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E"),
    radial-gradient(circle at center, rgba(240, 240, 240, 0.9) 0%, rgba(240, 240, 240, 0.95) 70%, rgba(255, 255, 255, 1) 100%);
  background-size: auto, 60px 60px, 100% 100%;
  background-attachment: fixed;
  pointer-events: none;
  z-index: -2;
}

/* CRT screen effect - dark theme */
body:not([data-theme="light"])::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: repeating-linear-gradient(
    transparent 0px,
    rgba(0, 0, 0, 0.05) 1px,
    transparent 2px
  );
  pointer-events: none;
  z-index: 9999;
  animation: glitch-horizontal 8s steps(1) infinite;
}

/* CRT screen effect - light theme */
body[data-theme="light"]::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: repeating-linear-gradient(
    transparent 0px,
    rgba(0, 0, 0, 0.03) 1px,
    transparent 2px
  );
  pointer-events: none;
  z-index: 9999;
  animation: glitch-horizontal 8s steps(1) infinite;
}

/* Scanlines effect - dark theme */
.scanlines-effect {
  content: '';
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: repeating-linear-gradient(
    0deg,
    rgba(0, 0, 0, 0) 0px,
    rgba(0, 0, 0, 0) 1px,
    rgba(0, 0, 0, 0.1) 1px,
    rgba(0, 0, 0, 0.1) 2px
  );
  background-size: 100% 4px;
  pointer-events: none;
  z-index: 9998;
  opacity: 0.3;
  animation: scanline-static 0.5s steps(30) infinite;
}

/* Scanlines effect - light theme */
body[data-theme="light"] .scanlines-effect {
  background: repeating-linear-gradient(
    0deg,
    rgba(0, 0, 0, 0) 0px,
    rgba(0, 0, 0, 0) 1px,
    rgba(0, 0, 0, 0.05) 1px,
    rgba(0, 0, 0, 0.05) 2px
  );
  opacity: 0.2;
}

/* Moving scanline effect - dark theme */
.moving-scanline {
  content: '';
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 8px;
  background: linear-gradient(
    to bottom,
    rgba(255, 255, 255, 0) 0%,
    rgba(255, 255, 255, 0.3) 50%,
    rgba(12, 250, 96, 0.1) 50.5%,
    rgba(255, 255, 255, 0) 100%
  );
  opacity: 0.15;
  animation: scanline 6s cubic-bezier(0.645, 0.045, 0.355, 1) infinite;
  z-index: 9997;
  pointer-events: none;
  box-shadow: 0 0 10px rgba(12, 250, 96, 0.05), 0 0 20px rgba(12, 250, 96, 0.02);
  mix-blend-mode: screen;
}

/* Moving scanline effect - light theme */
body[data-theme="light"] .moving-scanline {
  background: linear-gradient(
    to bottom,
    rgba(0, 0, 0, 0) 0%,
    rgba(0, 0, 0, 0.2) 50%,
    rgba(0, 166, 81, 0.08) 50.5%,
    rgba(0, 0, 0, 0) 100%
  );
  opacity: 0.1;
  box-shadow: 0 0 10px rgba(0, 166, 81, 0.03), 0 0 20px rgba(0, 166, 81, 0.01);
  mix-blend-mode: multiply;
}

@keyframes scanline {
  0% { transform: translateY(-100vh); }
  100% { transform: translateY(100vh); }
}

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

/* Noise overlay - dark theme */
.noise-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  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.85' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noiseFilter)'/%3E%3C/svg%3E");
  opacity: 0.07;
  pointer-events: none;
  z-index: 9997;
  animation: noise 0.5s steps(2) infinite;
}

/* Noise overlay - light theme */
body[data-theme="light"] .noise-overlay {
  opacity: 0.04;
}

@keyframes noise {
  0% { transform: translate(0, 0); }
  10% { transform: translate(-1px, 1px); }
  20% { transform: translate(1px, -1px); }
  30% { transform: translate(-1px, -1px); }
  40% { transform: translate(1px, 1px); }
  50% { transform: translate(-1px, 0); }
  60% { transform: translate(0, 1px); }
  70% { transform: translate(1px, -1px); }
  80% { transform: translate(0, -1px); }
  90% { transform: translate(-1px, 1px); }
  100% { transform: translate(0, 0); }
}

/* Terminal styling */
.cursor {
  display: inline-block;
  width: 10px;
  height: 1.2em;
  background-color: var(--accent-neon);
  animation: blink 1s infinite;
  vertical-align: middle;
}

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

/* Container */
.container {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 2rem;
  width: 100%;
}

/* Responsive container padding */
@media (max-width: 1200px) {
  .container {
    max-width: 95%;
    padding: 0 1.5rem;
  }
}

@media (max-width: 768px) {
  .container {
    padding: 0 1rem;
  }
}

@media (max-width: 480px) {
  .container {
    padding: 0 0.75rem;
  }
}

/* Enhanced large screen experience */
@media (min-width: 1400px) {
  .container {
    max-width: 1200px;
    padding: 0 2.5rem;
  }
  
  .hero {
    padding: 0 3rem;
  }
  
  .terminal {
    width: 900px;
    height: 450px;
  }
  
  .terminal-body {
    padding: 2.5rem;
    font-size: 1rem;
  }
  
  .section {
    padding: 10rem 0 5rem;
  }
  
  .about-content,
  .contact-grid {
    gap: 4rem;
  }
  
  .skills-grid,
  .projects-grid {
    gap: 2.5rem;
  }
}

@media (min-width: 1600px) {
  .container {
    max-width: 1300px;
  }
  
  .terminal {
    width: 1000px;
    height: 500px;
  }
  
  .hero::before {
    width: 800px;
    height: 800px;
  }
}

/* Navigation */
.navbar {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  background-color: rgba(10, 10, 10, 0.9);
  backdrop-filter: blur(5px);
  z-index: 1000;
  border-bottom: 1px solid var(--border-color);
  transition: all 0.5s ease;
}

body[data-theme="light"] .navbar {
  background-color: rgba(240, 240, 240, 0.9);
  border-bottom: 1px solid var(--border-color);
}

.navbar .container {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1.5rem 2rem;
  position: relative;
}

/* Enhanced responsive navbar */
@media (max-width: 1024px) {
  .navbar .container {
    padding: 1.2rem 1.5rem;
  }
  
  .nav-links {
    gap: 1.5rem;
  }
}

.logo {
  color: var(--accent-neon);
  font-weight: 500;
  font-size: 1.2rem;
  position: relative;
}

.logo-prefix {
  color: var(--text-muted);
}

.logo-text {
  color: var(--accent-neon);
}

.logo-cursor {
  color: var(--accent-neon);
  animation: cursor-blink 1.2s infinite;
}

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

.nav-links {
  display: flex;
  gap: 2rem;
}

.nav-link {
  color: var(--text-secondary);
  text-decoration: none;
  font-size: 0.9rem;
  padding: 0.4rem 0.8rem;
  border-radius: 4px;
  position: relative;
  transition: color 0.3s ease;
}

.nav-link:hover,
.nav-link.active {
  color: var(--accent-neon);
}

.nav-link::before {
  content: '[';
  opacity: 0;
  margin-right: 0.2rem;
  transition: opacity 0.3s ease;
}

.nav-link::after {
  content: ']';
  opacity: 0;
  margin-left: 0.2rem;
  transition: opacity 0.3s ease;
}

.nav-link:hover::before,
.nav-link:hover::after,
.nav-link.active::before,
.nav-link.active::after {
  opacity: 1;
}

/* Hero section */
.hero {
  height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 2rem;
  position: relative;
  overflow: hidden;
  min-height: 600px; /* Ensure minimum height on mobile */
}

/* Enhanced hero responsiveness */
@media (max-width: 1200px) {
  .hero {
    padding: 0 1.5rem;
    min-height: 550px;
  }
}

@media (max-width: 768px) {
  .hero {
    padding: 0 1rem;
    min-height: 500px;
    height: 90vh;
  }
}

@media (max-width: 480px) {
  .hero {
    padding: 0 0.75rem;
    min-height: 450px;
    height: 85vh;
  }
}

.hero::before {
  content: '';
  position: absolute;
  width: 700px;
  height: 700px;
  background: radial-gradient(
    circle, 
    rgba(12, 250, 96, 0.08) 0%, 
    rgba(12, 250, 96, 0.03) 40%, 
    rgba(12, 250, 96, 0) 70%
  );
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  z-index: -1;
  animation: glow-pulse 8s infinite alternate;
  filter: blur(20px);
}

@keyframes glow-pulse {
  0% { opacity: 0.5; transform: translate(-50%, -50%) scale(1); }
  50% { opacity: 0.8; transform: translate(-50%, -50%) scale(1.1); }
  100% { opacity: 0.5; transform: translate(-50%, -50%) scale(1); }
}

.terminal {
  width: 800px;
  height: 400px;
  background-color: var(--bg-secondary);
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 20px 80px rgba(0, 0, 0, 0.4), 0 0 0 1px var(--border-color);
  display: flex;
  flex-direction: column;
  position: relative;
  transition: background-color 0.5s ease, box-shadow 0.5s ease;
  max-width: 95vw; /* Ensure it doesn't overflow on mobile */
}

/* Enhanced terminal responsiveness */
@media (max-width: 1200px) {
  .terminal {
    width: 700px;
    height: 380px;
  }
}

@media (max-width: 1024px) {
  .terminal {
    width: 600px;
    height: 360px;
  }
}

@media (max-width: 768px) {
  .terminal {
    width: 95%;
    max-width: 550px;
    height: 340px;
  }
}

@media (max-width: 480px) {
  .terminal {
    width: 95%;
    height: 300px;
  }
}

@media (max-width: 375px) {
  .terminal {
    width: 98%;
    height: 280px;
  }
}

body[data-theme="light"] .terminal {
  box-shadow: 0 20px 80px rgba(0, 0, 0, 0.15), 0 0 0 1px var(--border-color);
}

.terminal::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  border-radius: 8px;
  box-shadow: 
    0 0 5px rgba(12, 250, 96, 0.2),
    0 0 20px rgba(12, 250, 96, 0.05),
    0 0 60px rgba(12, 250, 96, 0.02);
  filter: blur(1px);
  opacity: 0.8;
  z-index: -1;
  animation: crt-flicker 8s infinite;
  pointer-events: none;
  transition: box-shadow 0.5s ease;
}

body[data-theme="light"] .terminal::after {
  box-shadow: 
    0 0 5px rgba(0, 166, 81, 0.2),
    0 0 20px rgba(0, 166, 81, 0.05),
    0 0 60px rgba(0, 166, 81, 0.02);
  opacity: 0.6;
}

@keyframes crt-flicker {
  0% { opacity: 0.8; }
  3% { opacity: 0.9; }
  5% { opacity: 0.8; }
  10% { opacity: 0.7; }
  20% { opacity: 0.8; }
  50% { opacity: 0.7; }
  70% { opacity: 0.8; }
  90% { opacity: 0.7; }
  95% { opacity: 0.9; }
  100% { opacity: 0.8; }
}

.terminal-header {
  background-color: var(--bg-tertiary);
  padding: 0.8rem 1rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--border-color);
}

.terminal-buttons {
  display: flex;
  gap: 8px;
}

.terminal-button {
  width: 12px;
  height: 12px;
  border-radius: 50%;
}

.terminal-button.close {
  background-color: #ff5f57;
}

.terminal-button.minimize {
  background-color: #ffbd2e;
}

.terminal-button.maximize {
  background-color: #28ca41;
}

.terminal-title {
  color: var(--text-secondary);
  font-size: 0.85rem;
  font-weight: 400;
}

.terminal-body {
  padding: 2rem;
  flex-grow: 1;
  display: flex;
  flex-direction: column;
  position: relative;
  text-shadow: 0 0 2px var(--crt-glow);
}

.terminal-body::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-image: 
    linear-gradient(
      transparent 50%, 
      rgba(0, 0, 0, 0.05) 50%
    ),
    linear-gradient(
      90deg, 
      rgba(255, 255, 255, 0.04) 50%, 
      transparent 50%
    );
  background-size: 2px 2px;
  pointer-events: none;
  opacity: 0.4;
  mix-blend-mode: overlay;
  z-index: 1;
}

.terminal-line {
  display: flex;
  align-items: center;
  margin-bottom: 8px;
  font-family: var(--font-main);
  font-size: 0.9rem;
  position: relative;
  z-index: 2;
  text-shadow: 0 0 3px var(--crt-glow), 0 0 7px var(--crt-bloom);
}

.prompt {
  color: var(--accent-neon);
  margin-right: 8px;
  text-shadow: 0 0 5px var(--crt-glow), 0 0 10px var(--crt-bloom);
}

.terminal-prompt {
  display: flex;
  gap: 10px;
  margin-bottom: 1rem;
}

.prompt-user {
  color: var(--accent-neon);
  text-shadow: 0 0 5px var(--crt-glow), 0 0 10px var(--crt-bloom);
}

.prompt-location {
  color: var(--accent-blue);
  text-shadow: 0 0 5px var(--crt-glow), 0 0 10px var(--crt-bloom);
}

.prompt-sign {
  color: var(--text-primary);
}

.command-input {
  display: inline;
  color: var(--text-primary);
  position: relative;
  z-index: 2;
}

.terminal-output {
  margin-top: 1rem;
  color: var(--text-secondary);
  line-height: 1.6;
  opacity: 0;
  transition: opacity 0.3s ease;
  position: relative;
  z-index: 2;
  text-shadow: 0 0 3px var(--crt-glow), 0 0 7px var(--crt-bloom);
}

.output-line {
  margin-bottom: 0.3rem;
}

/* Section styling */
.section {
  padding: 8rem 0 4rem;
  min-height: 80vh;
  position: relative;
}

/* Enhanced section responsiveness */
@media (max-width: 1024px) {
  .section {
    padding: 6rem 0 3rem;
    min-height: 70vh;
  }
}

@media (max-width: 768px) {
  .section {
    padding: 5rem 0 2.5rem;
    min-height: 60vh;
  }
}

@media (max-width: 480px) {
  .section {
    padding: 4rem 0 2rem;
    min-height: auto;
  }
}

.section-title {
  font-size: 1.8rem;
  margin-bottom: 3rem;
  color: var(--text-primary);
  position: relative;
  display: inline-block;
}

.section-title::before {
  content: '#';
  color: var(--accent-neon);
  margin-right: 0.8rem;
  font-weight: bold;
}

.section-title::after {
  content: '';
  display: block;
  position: absolute;
  width: 100%;
  height: 1px;
  background-color: var(--accent-neon);
  bottom: -10px;
  opacity: 0.5;
}

/* About section */
.about-content {
  display: grid;
  grid-template-columns: auto 1fr 1fr;
  gap: 3rem;
  align-items: start; /* Ensure proper alignment */
}

/* Profile Picture Container */
.profile-container {
  display: flex;
  justify-content: center;
  align-items: flex-start;
  padding-top: 1rem;
}

.profile-image-wrapper {
  position: relative;
  text-align: center;
}

.profile-image {
  position: relative;
  width: 200px;
  height: 200px;
  border-radius: 12px;
  overflow: hidden;
  border: 2px solid var(--accent-neon);
  box-shadow: 
    0 0 20px rgba(12, 250, 96, 0.3),
    inset 0 0 20px rgba(12, 250, 96, 0.1);
  background: var(--bg-secondary);
  transition: all 0.3s ease;
}

.profile-image:hover {
  transform: translateY(-5px);
  box-shadow: 
    0 10px 30px rgba(12, 250, 96, 0.4),
    inset 0 0 30px rgba(12, 250, 96, 0.15);
}

.profile-pic {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  filter: grayscale(20%) contrast(1.1) brightness(1.05);
  transition: filter 0.3s ease;
}

.profile-image:hover .profile-pic {
  filter: grayscale(0%) contrast(1.2) brightness(1.1);
}

.profile-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 2;
}

.profile-scanlines {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: repeating-linear-gradient(
    0deg,
    transparent,
    transparent 2px,
    rgba(12, 250, 96, 0.05) 2px,
    rgba(12, 250, 96, 0.05) 4px
  );
  opacity: 0.6;
}

.profile-glow {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: radial-gradient(
    circle at center,
    transparent 40%,
    rgba(12, 250, 96, 0.1) 70%,
    rgba(12, 250, 96, 0.2) 100%
  );
  opacity: 0;
  transition: opacity 0.3s ease;
}

.profile-image:hover .profile-glow {
  opacity: 1;
}

.profile-status {
  margin-top: 1rem;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  font-family: var(--font-main);
  font-size: 0.85rem;
  color: var(--text-secondary);
}

.status-indicator {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--accent-neon);
  box-shadow: 0 0 8px var(--accent-neon);
  animation: pulse-status 2s infinite;
}

.status-text {
  color: var(--accent-neon);
  font-weight: 500;
  letter-spacing: 0.5px;
}

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

/* Enhanced about section responsiveness */
@media (max-width: 1200px) {
  .about-content {
    gap: 2.5rem;
  }
  
  .profile-image {
    width: 180px;
    height: 180px;
  }
}

@media (max-width: 1024px) {
  .about-content {
    grid-template-columns: 1fr;
    gap: 2rem;
    text-align: center;
  }
  
  .profile-container {
    order: -1; /* Move profile to top on mobile */
    margin-bottom: 1rem;
  }
  
  .profile-image {
    width: 160px;
    height: 160px;
  }
}

@media (max-width: 768px) {
  .about-content {
    gap: 1.5rem;
  }
  
  .profile-image {
    width: 140px;
    height: 140px;
  }
}

@media (max-width: 480px) {
  .profile-image {
    width: 120px;
    height: 120px;
  }
  
  .profile-status {
    font-size: 0.8rem;
  }
}

.about-code {
  background-color: var(--bg-secondary);
  border-radius: 8px;
  border: 1px solid var(--border-color);
  font-size: 0.9rem;
  line-height: 1.5;
  position: relative;
  overflow: hidden;
}

.code-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.8rem 1rem;
  background-color: var(--bg-tertiary);
  border-bottom: 1px solid var(--border-color);
}

.file-name {
  color: var(--text-secondary);
  font-size: 0.85rem;
}

.code-actions {
  display: flex;
  gap: 8px;
}

.code-action {
  width: 16px;
  height: 16px;
  cursor: pointer;
  opacity: 0.7;
  transition: opacity 0.2s ease;
}

.code-action:hover {
  opacity: 1;
}

.code-action.copy {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='%23f0f0f0' viewBox='0 0 16 16'%3E%3Cpath d='M4 1.5H3a2 2 0 0 0-2 2V14a2 2 0 0 0 2 2h10a2 2 0 0 0 2-2V3.5a2 2 0 0 0-2-2h-1v1h1a1 1 0 0 1 1 1V14a1 1 0 0 1-1 1H3a1 1 0 0 1-1-1V3.5a1 1 0 0 1 1-1h1v-1z'/%3E%3Cpath d='M9.5 1a.5.5 0 0 1 .5.5v1a.5.5 0 0 1-.5.5h-3a.5.5 0 0 1-.5-.5v-1a.5.5 0 0 1 .5-.5h3zm-3-1A1.5 1.5 0 0 0 5 1.5v1A1.5 1.5 0 0 0 6.5 4h3A1.5 1.5 0 0 0 11 2.5v-1A1.5 1.5 0 0 0 9.5 0h-3z'/%3E%3C/svg%3E");
  background-size: contain;
  background-repeat: no-repeat;
  position: relative;
}

.code-action.copy.copied {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='%230cfa60' viewBox='0 0 16 16'%3E%3Cpath d='M13.854 3.646a.5.5 0 0 1 0 .708l-7 7a.5.5 0 0 1-.708 0l-3.5-3.5a.5.5 0 1 1 .708-.708L6.5 10.293l6.646-6.647a.5.5 0 0 1 .708 0z'/%3E%3C/svg%3E");
  animation: pulse 1s;
}

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

.code-block {
  padding: 1.5rem;
  margin: 0;
  white-space: pre-wrap;
}

.code-keyword {
  color: var(--accent-purple);
}

.code-string {
  color: var(--accent-orange);
}

.code-property {
  color: var(--accent-blue);
}

.code-value {
  color: var(--accent-neon);
}

.code-comment {
  color: var(--text-muted);
  font-style: italic;
}

.stats-container {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  margin-top: 2rem;
}

/* Enhanced stats responsiveness */
@media (max-width: 1024px) {
  .stats-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
  }
}

@media (max-width: 768px) {
  .stats-container {
    grid-template-columns: 1fr;
    gap: 1rem;
  }
}

@media (max-width: 480px) {
  .stats-container {
    gap: 0.75rem;
  }
}

.stat-card {
  background-color: var(--bg-secondary);
  padding: 1.5rem;
  border-radius: 8px;
  border: 1px solid var(--border-color);
  text-align: center;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.stat-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
}

.stat-value {
  font-size: 2.5rem;
  font-weight: 600;
  color: var(--accent-neon);
  margin-bottom: 0.5rem;
}

.stat-label {
  font-size: 0.9rem;
  color: var(--text-secondary);
}

/* Skills section */
.skills-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  gap: 2rem;
}

/* Enhanced skills section responsiveness */
@media (max-width: 1200px) {
  .skills-grid {
    grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
    gap: 1.5rem;
  }
}

@media (max-width: 768px) {
  .skills-grid {
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 1.25rem;
  }
}

@media (max-width: 480px) {
  .skills-grid {
    grid-template-columns: 1fr;
    gap: 1rem;
  }
}

.skill-category {
  background-color: var(--bg-secondary);
  padding: 1.5rem;
  border-radius: 8px;
  border: 1px solid var(--border-color);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.category-title {
  color: var(--accent-neon);
  margin-bottom: 1.5rem;
  font-size: 1.1rem;
  font-weight: 500;
  position: relative;
  padding-left: 1.5rem;
}

.category-title::before {
  content: '>';
  position: absolute;
  left: 0;
  color: var(--accent-neon);
}

.skill-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.8rem;
}

.skill-tag {
  background-color: var(--bg-tertiary);
  color: var(--text-secondary);
  padding: 0.4rem 0.8rem;
  border-radius: 4px;
  font-size: 0.85rem;
  border: 1px solid var(--border-color);
  transition: all 0.3s ease;
  opacity: 0;
  transform: translateY(10px);
}

.skill-tag:hover {
  background-color: var(--bg-primary);
  color: var(--accent-neon);
  border-color: var(--accent-neon);
  transform: translateY(-3px);
  box-shadow: 0 5px 15px rgba(12, 250, 96, 0.1);
}

/* Experience section */
.timeline {
  position: relative;
  max-width: 800px;
  margin: 0 auto;
  padding-left: 2rem;
}

.timeline::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0;
  width: 2px;
  height: 100%;
  background: linear-gradient(to bottom, var(--accent-neon), var(--accent-blue));
  opacity: 0.5;
}

.timeline-item {
  margin-bottom: 3rem;
  position: relative;
}

.timeline-item::before {
  content: '';
  position: absolute;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background-color: var(--accent-neon);
  left: -2.4rem;
  top: 0.5rem;
  box-shadow: 0 0 10px rgba(12, 250, 96, 0.5);
}

.timeline-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 1rem;
}

.timeline-company {
  color: var(--text-primary);
  font-size: 1.2rem;
  margin-bottom: 0.3rem;
  flex: 1;
}

.timeline-role {
  color: var(--accent-blue);
  font-size: 0.9rem;
}

.timeline-period {
  display: inline-block;
  padding: 0.5rem 0.8rem;
  background-color: var(--bg-tertiary);
  border-radius: 20px;
  font-size: 0.8rem;
  color: var(--accent-neon);
  border: 1px solid var(--border-color);
  min-width: 180px;
  text-align: center;
}

.timeline-date {
  margin-bottom: 0.2rem;
  white-space: nowrap;
}

.timeline-location {
  white-space: nowrap;
}

.timeline-body {
  background-color: var(--bg-secondary);
  padding: 1.5rem;
  border-radius: 8px;
  border: 1px solid var(--border-color);
}

.achievement {
  display: flex;
  align-items: flex-start;
  gap: 1rem;
  margin-bottom: 1rem;
}

.achievement:last-child {
  margin-bottom: 0;
}

.achievement-icon {
  font-size: 1.2rem;
  color: var(--accent-neon);
}

.achievement span:nth-child(2) {
  color: var(--text-secondary);
  line-height: 1.5;
}

/* Projects section */
.projects-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 2rem;
}

/* Enhanced projects section responsiveness */
@media (max-width: 1200px) {
  .projects-grid {
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1.5rem;
  }
}

@media (max-width: 768px) {
  .projects-grid {
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 1.25rem;
  }
}

@media (max-width: 480px) {
  .projects-grid {
    grid-template-columns: 1fr;
    gap: 1rem;
  }
}

.project-card {
  background-color: var(--bg-secondary);
  border-radius: 8px;
  padding: 2rem;
  border: 1px solid var(--border-color);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  height: 100%;
  display: flex;
  flex-direction: column;
}

.project-card:hover {
  transform: translateY(-5px) translateZ(0);
  box-shadow: 0 15px 40px rgba(0, 0, 0, 0.2);
}

.project-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1.2rem;
}

.project-header h3 {
  font-size: 1.2rem;
  color: var(--text-primary);
  position: relative;
}

.project-status {
  font-size: 0.7rem;
  color: var(--text-secondary);
  padding: 0.3rem 0.7rem;
  border-radius: 20px;
  display: flex;
  align-items: center;
  gap: 6px;
}

.status-dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background-color: var(--text-muted);
}

.status-dot.active {
  background-color: var(--accent-neon);
  box-shadow: 0 0 6px var(--accent-neon);
}

.project-description {
  color: var(--text-secondary);
  margin-bottom: 1.5rem;
  line-height: 1.6;
  flex-grow: 1;
}

.project-tech {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 1.5rem;
}

.tech-tag {
  font-size: 0.75rem;
  color: var(--text-muted);
  background-color: var(--bg-tertiary);
  padding: 0.2rem 0.6rem;
  border-radius: 4px;
  border: 1px solid var(--border-color);
}

.project-links {
  display: flex;
  gap: 1rem;
}

.project-link {
  color: var(--accent-blue);
  text-decoration: none;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.9rem;
  transition: color 0.3s ease;
}

.project-link:hover {
  color: var(--accent-neon);
}

.link-arrow {
  transition: transform 0.3s ease;
  display: inline-block;
}

.project-link:hover .link-arrow {
  transform: translateX(3px);
}

/* Contact section */
.contact-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 3rem;
  align-items: center;
}

/* Enhanced contact section responsiveness */
@media (max-width: 1024px) {
  .contact-grid {
    grid-template-columns: 1fr;
    gap: 2rem;
  }
}

@media (max-width: 768px) {
  .contact-grid {
    gap: 1.5rem;
  }
}

.contact-info {
  color: var(--text-secondary);
  line-height: 1.6;
}

.contact-info p {
  margin-bottom: 2rem;
}

.contact-links {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.contact-link {
  display: flex;
  align-items: center;
  gap: 1rem;
  color: var(--text-primary);
  text-decoration: none;
  padding: 1rem;
  background-color: var(--bg-secondary);
  border-radius: 8px;
  border: 1px solid var(--border-color);
  transition: all 0.3s ease;
}

.contact-link:hover {
  background-color: var(--bg-tertiary);
  transform: translateX(5px);
  border-color: var(--accent-neon);
}

.link-icon {
  width: 2rem;
  height: 2rem;
  display: flex;
  align-items: center;
  justify-content: center;
  background-color: var(--bg-tertiary);
  border-radius: 50%;
  font-size: 1rem;
  color: var(--accent-neon);
}

.contact-terminal {
  background-color: var(--bg-secondary);
  border-radius: 8px;
  border: 1px solid var(--border-color);
  overflow: hidden;
}

.mini-terminal {
  width: 100%;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
}

.mini-terminal .terminal-header {
  padding: 0.6rem 1rem;
}

.mini-terminal .terminal-body {
  padding: 1.5rem;
}

.output {
  color: var(--text-secondary);
}

.command {
  color: var(--text-primary);
}

/* Footer */
.footer {
  background-color: var(--bg-secondary);
  border-top: 1px solid var(--border-color);
  padding: 2rem 0;
  margin-top: 4rem;
}

.footer-content {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 1rem;
}

/* Enhanced footer responsiveness */
@media (max-width: 768px) {
  .footer-content {
    flex-direction: column;
    text-align: center;
    gap: 1.5rem;
  }
  
  .footer-links {
    justify-content: center;
  }
}

.footer-content p {
  color: var(--text-muted);
  font-size: 0.85rem;
}

.footer-links {
  display: flex;
  gap: 1.5rem;
}

.footer-link {
  color: var(--text-secondary);
  text-decoration: none;
  font-size: 0.85rem;
  transition: color 0.3s ease;
}

.footer-link:hover {
  color: var(--accent-neon);
}

/* Animations */
.fade-in {
  opacity: 0;
  transform: translateY(20px);
  animation: fadeIn 0.8s forwards;
}

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

/* VHS glitch effect */
@keyframes glitch-horizontal {
  0% { transform: translate(0); }
  1% { transform: translate(-2px, 2px); }
  2% { transform: translate(0); }
  5% { transform: translate(-2px, -2px); }
  6% { transform: translate(0); }
  100% { transform: translate(0); }
}

@keyframes glitch-vertical {
  0% { 
    clip-path: inset(0 0 0 0); 
    opacity: 1;
  }
  1% { 
    clip-path: inset(20% 0 30% 0); 
    opacity: 0.98;
  }
  2% { 
    clip-path: inset(0 0 0 0); 
    opacity: 1;
  }
  5% { 
    clip-path: inset(10% 0 60% 0); 
    opacity: 0.98;
  }
  6% { 
    clip-path: inset(0 0 0 0); 
    opacity: 1;
  }
  100% { 
    clip-path: inset(0 0 0 0); 
    opacity: 1;
  }
}

body::before {
  animation: glitch-horizontal 8s steps(1) infinite;
}

.glitch-effect {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: transparent;
  pointer-events: none;
  z-index: 9996;
  animation: glitch-vertical 15s steps(1) infinite;
  mix-blend-mode: overlay;
}

body[data-theme="light"] .glitch-effect {
  mix-blend-mode: multiply;
  opacity: 0.7;
}

/* Screen flicker and distortion effects */
.flicker-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: rgba(0, 0, 0, 0.15);
  opacity: 0;
  pointer-events: none;
  z-index: 9999;
  mix-blend-mode: multiply;
  transition: opacity 0.05s linear, background-color 0.5s ease;
}

body[data-theme="light"] .flicker-overlay {
  background-color: rgba(0, 0, 0, 0.05);
  mix-blend-mode: darken;
}

.distort {
  animation: distort-effect 0.1s linear;
}

@keyframes distort-effect {
  0% { transform: translate(0) skew(0); filter: hue-rotate(0); }
  20% { transform: translate(-2px) skew(1deg, 0deg); filter: hue-rotate(5deg); }
  40% { transform: translate(2px, 1px) skew(-1deg, 1deg); filter: hue-rotate(-5deg); }
  60% { transform: translate(-2px) skew(0deg, -1deg); filter: hue-rotate(5deg); }
  80% { transform: translate(2px, 1px) skew(1deg); filter: hue-rotate(-5deg); }
  100% { transform: translate(0) skew(0); filter: hue-rotate(0); }
}

/* Responsive design */
@media (max-width: 1024px) {
  .about-content,
  .contact-grid {
    grid-template-columns: 1fr;
    gap: 2rem;
  }
  
  .section {
    padding: 6rem 0 3rem;
  }
  
  /* Ensure desktop grid layout is preserved for tablets */
  .about-content {
    grid-template-columns: 1fr;
  }
  
  .stats-container {
    margin-top: 1rem;
  }
}

.menu-toggle {
  display: none;
  flex-direction: column;
  justify-content: space-between;
  width: 30px;
  height: 21px;
  cursor: pointer;
  z-index: 1010;
}

.menu-toggle span {
  display: block;
  width: 100%;
  height: 3px;
  background-color: var(--accent-neon);
  transition: all 0.3s ease;
}

.menu-toggle.active span:nth-child(1) {
  transform: translateY(9px) rotate(45deg);
}

.menu-toggle.active span:nth-child(2) {
  opacity: 0;
}

.menu-toggle.active span:nth-child(3) {
  transform: translateY(-9px) rotate(-45deg);
}

@media (max-width: 768px) {
  .navbar .container {
    flex-direction: row;
    justify-content: space-between;
    align-items: center;
    padding: 1rem;
    position: relative;
  }
  
  .menu-toggle {
    display: flex;
    position: relative;
    right: 0;
    top: 0;
    z-index: 1020;
  }
  
  .nav-links {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    width: 100%;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    padding: 1.5rem 0;
    background-color: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-top: none;
    border-radius: 0 0 8px 8px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
  }
  
  .nav-links.active {
    display: flex;
  }
  
  .nav-link {
    width: 100%;
    text-align: center;
    padding: 0.75rem 1rem;
    margin: 0;
    border-radius: 4px;
    transition: all 0.3s ease;
  }
  
  .nav-link:hover {
    background-color: var(--bg-tertiary);
  }
  
  /* Theme toggle positioning for mobile */
  .theme-toggle {
    margin-left: auto;
    margin-right: 1rem;
  }
  
  /* Enhanced terminal mobile styling */
  .terminal {
    width: 95%;
    max-width: 550px;
    height: 340px;
    margin: 0 auto;
  }
  
  .terminal-body {
    padding: 1.5rem 1rem;
    font-size: 0.85rem;
  }
  
  .terminal-line {
    font-size: 0.85rem;
    margin-bottom: 6px;
  }
  
  .terminal-output {
    font-size: 0.8rem;
    line-height: 1.4;
  }
  
  /* Mobile hero section optimizations */
  .hero {
    min-height: 500px;
    height: 90vh;
    padding: 0 1rem;
  }
  
  .hero::before {
    width: 400px;
    height: 400px;
    filter: blur(15px);
  }
}

@media (max-width: 480px) {
  .section-title {
    font-size: 1.5rem;
  }
  
  .nav-link {
    font-size: 0.8rem;
    padding: 0.3rem 0.5rem;
  }
  
  /* Enhanced terminal mobile styling for smaller screens */
  .terminal {
    width: 95%;
    height: 280px;
    margin: 0 auto;
  }
  
  .terminal-header {
    padding: 0.6rem 0.8rem;
  }
  
  .terminal-title {
    font-size: 0.75rem;
  }
  
  .terminal-buttons {
    gap: 6px;
  }
  
  .terminal-button {
    width: 10px;
    height: 10px;
  }
  
  .terminal-body {
    padding: 1rem 0.8rem;
    font-size: 0.75rem;
  }
  
  .terminal-line {
    font-size: 0.75rem;
    margin-bottom: 4px;
  }
  
  .terminal-output {
    font-size: 0.7rem;
    line-height: 1.3;
    margin-top: 0.8rem;
  }
  
  .prompt {
    margin-right: 6px;
  }
  
  /* About section mobile optimization for small screens */
  .about-code {
    border-radius: 6px;
  }
  
  .code-header {
    padding: 0.6rem 0.8rem;
  }
  
  .file-name {
    font-size: 0.75rem;
  }
  
  .code-block {
    padding: 0.8rem;
    font-size: 0.7rem;
    line-height: 1.3;
  }
  
  .stats-container {
    gap: 0.8rem;
  }
  
  .stat-card {
    padding: 0.8rem;
  }
  
  .stat-value {
    font-size: 1.8rem;
    margin-bottom: 0.3rem;
  }
  
  .stat-label {
    font-size: 0.75rem;
  }
  
  /* Contact terminal optimization */
  .contact-terminal .mini-terminal {
    margin-top: 1rem;
  }
  
  .contact-terminal .terminal-header {
    padding: 0.5rem 0.7rem;
  }
  
  .contact-terminal .terminal-body {
    padding: 1rem 0.7rem;
    font-size: 0.75rem;
  }
  
  .contact-terminal .terminal-line {
    font-size: 0.75rem;
    margin-bottom: 3px;
  }
  
  .timeline {
    padding-left: 1.5rem;
  }
  
  .timeline-item::before {
    left: -1.9rem;
  }
  
  .timeline-header {
    flex-direction: column;
    gap: 0.8rem;
  }
  
  .timeline-period {
    align-self: flex-start;
    min-width: 100%;
    width: 100%;
    text-align: left;
    padding-left: 1rem;
  }
}

/* Enhanced terminal responsiveness */
@media (max-width: 640px) {
  .terminal {
    transform: scale(0.95);
    transform-origin: center;
    margin: 0 auto;
    width: 95%;
    max-width: 500px;
  }

  .terminal::after {
    box-shadow: 
      0 0 3px var(--crt-glow),
      0 0 12px var(--crt-bloom);
  }

  /* Increase contrast for better readability on smaller screens */
  .terminal-line, 
  .command-input, 
  .terminal-output .output-line {
    text-shadow: 0 0 2px var(--crt-glow);
  }
}

/* Additional mobile optimizations for About section */
@media (max-width: 640px) {
  .about-content {
    gap: 1.5rem;
  }
  
  .code-actions {
    gap: 6px;
  }
  
  .code-action {
    width: 14px;
    height: 14px;
  }
  
  /* Improve touch targets on mobile */
  .code-action.copy {
    padding: 2px;
    cursor: pointer;
  }
  
  /* Make stats more mobile-friendly */
  .stats-container {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1rem;
  }
  
  .stat-card:hover {
    transform: none; /* Disable hover effects on mobile */
  }
}

/* Very small screens (iPhone SE, etc.) */
@media (max-width: 375px) {
  .container {
    padding: 0 1rem;
  }
  
  .terminal {
    height: 260px;
    width: 98%;
  }
  
  .terminal-body {
    padding: 0.8rem 0.6rem;
    font-size: 0.7rem;
  }
  
  .code-block {
    font-size: 0.65rem;
    padding: 0.6rem;
  }
  
  .stat-value {
    font-size: 1.6rem;
  }
  
  .stat-label {
    font-size: 0.7rem;
  }
  
  /* Adjust section padding for very small screens */
  .section {
    padding: 6rem 0 3rem;
  }
}

/* Performance optimizations */
html {
  scroll-behavior: smooth;
}

/* Reduce motion for users who prefer it */
@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
  
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* Better scrollbar styling */
::-webkit-scrollbar {
  width: 8px;
}

::-webkit-scrollbar-track {
  background: var(--bg-secondary);
}

::-webkit-scrollbar-thumb {
  background: var(--accent-neon);
  border-radius: 4px;
}

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

/* Focus styles for accessibility */
*:focus {
  outline: 2px solid var(--accent-neon);
  outline-offset: 2px;
}

.nav-link:focus,
.contact-link:focus,
.project-link:focus {
  outline: 2px solid var(--accent-neon);
  outline-offset: 2px;
}

/* Skip to main content link for accessibility */
.skip-link {
  position: absolute;
  top: -40px;
  left: 6px;
  background: var(--accent-neon);
  color: var(--bg-primary);
  padding: 8px;
  text-decoration: none;
  z-index: 10000;
  border-radius: 4px;
}

.skip-link:focus {
  top: 6px;
}

/* Terminal Theme Toggle Switch - Enhanced Design */
.theme-toggle {
  display: flex;
  align-items: center;
  margin-left: 1rem;
  position: relative;
}

.switch {
  position: relative;
  display: inline-block;
  width: 70px;
  height: 34px;
  cursor: pointer;
  user-select: none;
}

.switch input {
  opacity: 0;
  width: 0;
  height: 0;
  position: absolute;
}

.slider {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(145deg, var(--bg-tertiary), var(--bg-secondary));
  border: 2px solid var(--border-color);
  border-radius: 34px;
  transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 3px 6px;
  box-shadow: 
    inset 0 2px 6px rgba(0, 0, 0, 0.3),
    inset 0 -2px 6px rgba(255, 255, 255, 0.02),
    0 0 0 1px rgba(12, 250, 96, 0.1);
  overflow: hidden;
}

/* Terminal scanline effect on slider */
.slider::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: repeating-linear-gradient(
    0deg,
    transparent 0px,
    transparent 1px,
    rgba(12, 250, 96, 0.03) 1px,
    rgba(12, 250, 96, 0.03) 2px
  );
  pointer-events: none;
  border-radius: 32px;
  animation: toggle-scanlines 2s linear infinite;
}

@keyframes toggle-scanlines {
  0% { transform: translateY(-2px); }
  100% { transform: translateY(2px); }
}

.slider:before {
  position: absolute;
  content: "";
  height: 24px;
  width: 24px;
  left: 4px;
  top: 3px;
  background: radial-gradient(circle at 30% 30%, var(--text-primary), var(--text-secondary));
  border-radius: 50%;
  transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  box-shadow: 
    0 3px 8px rgba(0, 0, 0, 0.4),
    0 0 12px rgba(12, 250, 96, 0.15),
    inset 0 1px 3px rgba(255, 255, 255, 0.1),
    inset 0 -1px 3px rgba(0, 0, 0, 0.3);
  z-index: 3;
  border: 1px solid rgba(12, 250, 96, 0.2);
}

/* Terminal glow effect */
.slider:before::after {
  content: '';
  position: absolute;
  top: -2px;
  left: -2px;
  right: -2px;
  bottom: -2px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(12, 250, 96, 0.2), transparent 70%);
  z-index: -1;
  animation: toggle-pulse 3s ease-in-out infinite;
}

@keyframes toggle-pulse {
  0%, 100% { 
    opacity: 0.5; 
    transform: scale(1); 
  }
  50% { 
    opacity: 1; 
    transform: scale(1.1); 
  }
}

/* Active state - Clean design */
.switch input:checked + .slider {
  background: linear-gradient(145deg, var(--accent-neon), #0aa550);
  border-color: var(--accent-neon);
  box-shadow: 
    inset 0 2px 6px rgba(0, 0, 0, 0.2),
    inset 0 -2px 6px rgba(255, 255, 255, 0.1),
    0 0 20px rgba(12, 250, 96, 0.3),
    0 0 0 1px rgba(12, 250, 96, 0.3);
}

@keyframes toggle-active-glow {
  0%, 100% { 
    box-shadow: 
      inset 0 2px 6px rgba(0, 0, 0, 0.2),
      inset 0 -2px 6px rgba(255, 255, 255, 0.1),
      0 0 20px rgba(12, 250, 96, 0.3),
      0 0 0 1px rgba(12, 250, 96, 0.3);
  }
  50% { 
    box-shadow: 
      inset 0 2px 6px rgba(0, 0, 0, 0.2),
      inset 0 -2px 6px rgba(255, 255, 255, 0.1),
      0 0 25px rgba(12, 250, 96, 0.4),
      0 0 0 1px rgba(12, 250, 96, 0.4);
  }
}

.switch input:checked + .slider:before {
  transform: translateX(36px);
  background: radial-gradient(circle at 30% 30%, var(--bg-primary), var(--bg-secondary));
  box-shadow: 
    0 3px 8px rgba(0, 0, 0, 0.6),
    0 0 15px rgba(12, 250, 96, 0.3),
    inset 0 1px 3px rgba(255, 255, 255, 0.15),
    inset 0 -1px 3px rgba(0, 0, 0, 0.4);
  border-color: rgba(12, 250, 96, 0.4);
}

/* Simple theme icons with clean styling */
.theme-icon {
  font-size: 13px;
  transition: all 0.3s ease;
  z-index: 2;
  opacity: 0.4;
  position: relative;
}

.theme-icon.dark {
  color: var(--text-secondary);
  margin-left: 1px;
}

.theme-icon.light {
  color: var(--accent-orange);
  margin-right: 1px;
}

/* Clean icon activation effects */
.switch input:not(:checked) + .slider .theme-icon.dark {
  opacity: 1;
  color: var(--accent-neon);
  text-shadow: 0 0 5px var(--accent-neon);
}

.switch input:checked + .slider .theme-icon.light {
  opacity: 1;
  color: var(--accent-orange);
  text-shadow: 0 0 5px var(--accent-orange);
}

@keyframes icon-glow-dark {
  0%, 100% { 
    text-shadow: 0 0 5px var(--accent-neon);
  }
  50% { 
    text-shadow: 0 0 8px var(--accent-neon);
  }
}

@keyframes icon-glow-light {
  0%, 100% { 
    text-shadow: 0 0 5px var(--accent-orange);
  }
  50% { 
    text-shadow: 0 0 8px var(--accent-orange);
  }
}

/* Light theme adjustments */
body[data-theme="light"] .slider {
  background: linear-gradient(145deg, var(--bg-tertiary), var(--bg-secondary));
  border-color: var(--border-color);
  box-shadow: 
    inset 0 2px 6px rgba(0, 0, 0, 0.15),
    inset 0 -2px 6px rgba(255, 255, 255, 0.1),
    0 0 0 1px rgba(0, 166, 81, 0.1);
}

body[data-theme="light"] .slider:before {
  background: radial-gradient(circle at 30% 30%, var(--text-primary), var(--text-secondary));
  box-shadow: 
    0 3px 8px rgba(0, 0, 0, 0.3),
    0 0 12px rgba(0, 166, 81, 0.15),
    inset 0 1px 3px rgba(255, 255, 255, 0.1),
    inset 0 -1px 3px rgba(0, 0, 0, 0.2);
  border-color: rgba(0, 166, 81, 0.2);
}

body[data-theme="light"] .switch input:checked + .slider {
  background: linear-gradient(145deg, var(--accent-neon), #0aa550);
  border-color: var(--accent-neon);
  box-shadow: 
    inset 0 2px 6px rgba(0, 0, 0, 0.15),
    inset 0 -2px 6px rgba(255, 255, 255, 0.1),
    0 0 20px rgba(0, 166, 81, 0.4),
    0 0 40px rgba(0, 166, 81, 0.2),
    0 0 0 1px rgba(0, 166, 81, 0.3);
}

body[data-theme="light"] .switch input:checked + .slider:before {
  background: radial-gradient(circle at 30% 30%, var(--bg-primary), var(--bg-secondary));
  box-shadow: 
    0 3px 8px rgba(0, 0, 0, 0.4),
    0 0 15px rgba(0, 166, 81, 0.3),
    inset 0 1px 3px rgba(255, 255, 255, 0.15),
    inset 0 -1px 3px rgba(0, 0, 0, 0.3);
  border-color: rgba(0, 166, 81, 0.4);
}

/* Simple hover effects */
.switch:hover .slider {
  border-color: var(--accent-neon);
  box-shadow: 
    inset 0 2px 6px rgba(0, 0, 0, 0.3),
    inset 0 -2px 6px rgba(255, 255, 255, 0.02),
    0 0 15px rgba(12, 250, 96, 0.2),
    0 0 0 1px rgba(12, 250, 96, 0.2);
  transform: scale(1.02);
}

.switch:hover .slider:before {
  box-shadow: 
    0 4px 10px rgba(0, 0, 0, 0.5),
    0 0 15px rgba(12, 250, 96, 0.2),
    inset 0 1px 3px rgba(255, 255, 255, 0.15),
    inset 0 -1px 3px rgba(0, 0, 0, 0.4);
}

body[data-theme="light"] .switch:hover .slider {
  border-color: var(--accent-neon);
  box-shadow: 
    inset 0 2px 6px rgba(0, 0, 0, 0.15),
    inset 0 -2px 6px rgba(255, 255, 255, 0.1),
    0 0 15px rgba(0, 166, 81, 0.2),
    0 0 0 1px rgba(0, 166, 81, 0.2);
}

/* Simple click animation */
.switch:active .slider {
  transform: scale(0.98);
  transition: transform 0.1s ease;
}

/* Simple focus states for accessibility */
.switch input:focus + .slider {
  outline: 2px solid var(--accent-neon);
  outline-offset: 2px;
}

/* Konami Code Easter Egg - Matrix Mode */
.matrix-mode {
  animation: matrix-entrance 0.5s ease-in-out;
  position: relative;
  overflow: hidden;
}

.matrix-mode::before {
  content: '';
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: 
    repeating-linear-gradient(
      0deg,
      transparent,
      transparent 2px,
      rgba(0, 255, 65, 0.02) 2px,
      rgba(0, 255, 65, 0.02) 4px
    );
  pointer-events: none;
  z-index: 9999;
  animation: matrix-scan 3s linear infinite;
}

.matrix-mode::after {
  content: '⚡ MATRIX ACCESS GRANTED ⚡\A ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\A WELCOME TO THE SYSTEM, NEO...';
  white-space: pre;
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background: rgba(0, 0, 0, 0.95);
  color: #00ff41;
  font-family: var(--font-main);
  font-size: 1.2rem;
  font-weight: bold;
  padding: 30px 50px;
  border: 2px solid #00ff41;
  border-radius: 8px;
  box-shadow: 
    0 0 30px rgba(0, 255, 65, 0.8),
    inset 0 0 30px rgba(0, 255, 65, 0.2);
  text-shadow: 
    0 0 5px #00ff41,
    0 0 10px #00ff41,
    0 0 15px #00ff41;
  z-index: 10000;
  animation: matrix-message 5s ease-in-out;
  pointer-events: none;
  text-align: center;
  line-height: 1.6;
}

.matrix-mode * {
  text-shadow: 
    0 0 3px #00ff41,
    0 0 6px #00ff41,
    0 0 9px #00ff41;
  color: #00ff41 !important;
  transition: all 0.3s ease;
}

.matrix-mode .terminal {
  border-color: #00ff41;
  box-shadow: 
    0 0 40px rgba(0, 255, 65, 0.4),
    inset 0 0 40px rgba(0, 255, 65, 0.15);
  background: rgba(0, 0, 0, 0.9);
}

.matrix-mode .nav-link,
.matrix-mode .project-title,
.matrix-mode .section-title {
  animation: matrix-flicker 2s infinite alternate;
}

.matrix-mode .project-card,
.matrix-mode .stat-card {
  border-color: #00ff41 !important;
  box-shadow: 
    0 0 20px rgba(0, 255, 65, 0.3),
    inset 0 0 20px rgba(0, 255, 65, 0.1) !important;
}

/* Matrix canvas styling */
#matrix-canvas {
  background: transparent;
}

@keyframes matrix-entrance {
  0% {
    filter: brightness(1) contrast(1) hue-rotate(0deg) saturate(1);
  }
  25% {
    filter: brightness(1.3) contrast(1.3) hue-rotate(45deg) saturate(1.5);
  }
  50% {
    filter: brightness(1.6) contrast(1.6) hue-rotate(90deg) saturate(2);
  }
  75% {
    filter: brightness(1.4) contrast(1.4) hue-rotate(45deg) saturate(1.8);
  }
  100% {
    filter: brightness(1.2) contrast(1.2) hue-rotate(0deg) saturate(1.3);
  }
}

@keyframes matrix-scan {
  0% {
    transform: translateY(-100%);
    opacity: 0;
  }
  10% {
    opacity: 1;
  }
  90% {
    opacity: 1;
  }
  100% {
    transform: translateY(100vh);
    opacity: 0;
  }
}

@keyframes matrix-message {
  0% {
    opacity: 0;
    transform: translate(-50%, -50%) scale(0.5) rotateX(90deg);
  }
  15% {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1.05) rotateX(0deg);
  }
  20% {
    transform: translate(-50%, -50%) scale(1) rotateX(0deg);
  }
  85% {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1) rotateX(0deg);
  }
  100% {
    opacity: 0;
    transform: translate(-50%, -50%) scale(0.5) rotateX(-90deg);
  }
}

@keyframes matrix-flicker {
  0% {
    text-shadow: 
      0 0 3px #00ff41,
      0 0 6px #00ff41,
      0 0 9px #00ff41;
    opacity: 1;
  }
  25% {
    text-shadow: 
      0 0 5px #00ff41,
      0 0 10px #00ff41,
      0 0 15px #00ff41,
      0 0 20px #00ff41;
    opacity: 0.9;
  }
  50% {
    text-shadow: 
      0 0 2px #00ff41,
      0 0 4px #00ff41,
      0 0 6px #00ff41;
    opacity: 1;
  }
  75% {
    text-shadow: 
      0 0 8px #00ff41,
      0 0 16px #00ff41,
      0 0 24px #00ff41,
      0 0 32px #00ff41;
    opacity: 0.8;
  }
  100% {
    text-shadow: 
      0 0 3px #00ff41,
      0 0 6px #00ff41,
      0 0 9px #00ff41;
    opacity: 1;
  }
}

/* End Matrix Mode */
