:root {
  /* Colors - Neon Theme */
  --neon-green: #48dd84;
  --neon-cyan: #48c4dd;
  --neon-magenta: #dd48c4;

  --bg-dark: #0a0a0a;
  --bg-darker: #050505;
  --text-main: #f0f0f0;
  --text-muted: #a0a0a0;

  /* Typography */
  --font-main: 'Outfit', sans-serif;
  --font-mono: 'Space Mono', monospace;

  /* Layout */
  --header-height: 80px;
  --max-width: 1200px;
}

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

html {
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-main);
  background-color: var(--bg-dark);
  color: var(--text-main);
  min-height: 100vh;
  overflow-x: hidden;
  line-height: 1.6;
}

/* --- Utilities --- */
a {
  text-decoration: none;
  color: inherit;
  transition: color 0.3s ease;
}

ul {
  list-style: none;
}

.btn {
  display: inline-block;
  padding: 12px 32px;
  border-radius: 4px;
  font-weight: 600;
  text-transform: uppercase;
  font-family: var(--font-mono);
  letter-spacing: 1px;
  cursor: pointer;
  transition: all 0.3s ease;
}

.primary-btn {
  background: transparent;
  color: var(--neon-green);
  border: 1px solid var(--neon-green);
  box-shadow: 0 0 10px rgba(72, 221, 132, 0.2);
}

.primary-btn:hover {
  background: rgba(72, 221, 132, 0.1);
  box-shadow: 0 0 20px rgba(72, 221, 132, 0.4);
  transform: translateY(-2px);
}

.secondary-btn {
  background: transparent;
  color: var(--text-muted);
  border: 1px solid var(--text-muted);
  margin-left: 16px;
}

.secondary-btn:hover {
  border-color: var(--text-main);
  color: var(--text-main);
}

.highlight {
  color: var(--neon-green);
  font-weight: 700;
}

/* --- SVG Filters (Hidden) --- */
.svg-filters {
  position: absolute;
  width: 0;
  height: 0;
  pointer-events: none;
}

/* --- Header --- */
.glass-header {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: var(--header-height);
  background: rgba(10, 10, 10, 0.7);
  backdrop-filter: blur(10px);
  z-index: 1000;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

nav {
  max-width: var(--max-width);
  margin: 0 auto;
  height: 100%;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0 24px;
}

.logo {
  font-family: var(--font-mono);
  font-size: 24px;
  font-weight: 700;
  letter-spacing: -1px;
}

.logo .dot {
  color: var(--neon-green);
}

.nav-links {
  display: flex;
  gap: 32px;
}

.nav-links li a {
  font-size: 14px;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--text-muted);
}

.nav-links li a:hover {
  color: var(--neon-green);
  text-shadow: 0 0 8px rgba(72, 221, 132, 0.5);
}

/* --- Sections Common --- */
main {
  padding-top: var(--header-height);
}

.section-container {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 100px 24px;
}

.section-title {
  font-size: 48px;
  margin-bottom: 64px;
  position: relative;
  display: inline-block;
}

.section-title::after {
  content: '';
  position: absolute;
  bottom: -10px;
  left: 0;
  width: 60px;
  height: 4px;
  background: var(--neon-green);
  box-shadow: 0 0 10px rgba(72, 221, 132, 0.5);
}

/* --- Hero Section --- */
.hero-section {
  min-height: calc(100vh - var(--header-height));
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 24px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  align-items: center;
  gap: 48px;
}

.hero-subtitle {
  font-family: var(--font-mono);
  color: var(--neon-green);
  font-size: 16px;
  margin-bottom: 16px;
}

.hero-title {
  font-size: 80px;
  font-weight: 800;
  line-height: 1.1;
  margin-bottom: 24px;
  text-transform: uppercase;
}

.hero-role {
  font-size: 20px;
  color: var(--text-muted);
  margin-bottom: 48px;
  max-width: 400px;
}

/* Glitch Effect */
.glitch {
  position: relative;
}

.glitch::before,
.glitch::after {
  content: attr(data-text);
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
}

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

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

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

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

  40% {
    clip: rect(4px, 9999px, 107px, 0);
  }

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

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

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

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

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

  40% {
    clip: rect(98px, 9999px, 4px, 0);
  }

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

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

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


/* --- Electric Card Styles (Preserved & Adapted) --- */
.hero-visual {
  display: flex;
  justify-content: center;
  align-items: center;
  perspective: 1000px;
}

/* Reusing the exact card styles but ensuring they work in container */
.card-wrapper-1 {
  width: 350px;
  height: 500px;
  padding: 2px;
  border-radius: 24px;
  position: relative;
  background: linear-gradient(-30deg, rgba(72, 221, 132, 0.4), transparent, rgba(72, 221, 132, 0.4)),
    linear-gradient(to bottom, #111, #000);
  transform-style: preserve-3d;
  transition: transform 0.6s ease;
}

.hero-card:hover {
  transform: rotateY(-15deg) rotateX(10deg);
}

.inner-wrapper-1 {
  position: relative;
  width: 100%;
  height: 100%;
}

.border-layer-1 {
  border: 2px solid rgba(72, 221, 132, 0.5);
  border-radius: 24px;
  padding-right: 4px;
  padding-bottom: 4px;
  width: 100%;
  height: 100%;
}

.card-main-1 {
  width: 100%;
  height: 100%;
  border-radius: 24px;
  border: 2px solid var(--neon-green);
  filter: url(#turbulent-1);
}

.glow-1-layer-1 {
  border: 2px solid rgba(72, 221, 132, 0.6);
  border-radius: 24px;
  width: 100%;
  height: 100%;
  position: absolute;
  top: 0;
  left: 0;
  filter: blur(1px);
}

.glow-1-layer-2 {
  border: 2px solid var(--neon-green);
  border-radius: 24px;
  width: 100%;
  height: 100%;
  position: absolute;
  top: 0;
  left: 0;
  filter: blur(4px);
}

.overlay-1-1 {
  position: absolute;
  width: 100%;
  height: 100%;
  top: 0;
  left: 0;
  border-radius: 24px;
  opacity: 1;
  mix-blend-mode: overlay;
  filter: blur(16px);
}

/* --- About Section --- */
.about-grid {
  display: grid;
  grid-template-columns: 1.5fr 1fr;
  gap: 64px;
}

.about-text p {
  font-size: 18px;
  margin-bottom: 24px;
  color: var(--text-muted);
}

.stats-container {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
}

.stat-item {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.05);
  padding: 32px;
  border-radius: 12px;
  text-align: center;
  transition: transform 0.3s ease;
}

.stat-item:hover {
  transform: translateY(-5px);
  border-color: var(--neon-green);
}

.stat-number {
  display: block;
  font-size: 48px;
  font-weight: 800;
  color: var(--neon-green);
  margin-bottom: 8px;
}

.stat-label {
  font-family: var(--font-mono);
  text-transform: uppercase;
  font-size: 14px;
  letter-spacing: 1px;
}

/* --- Skills Section --- */
.skills-wrapper {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 48px;
}

.skill-category h3 {
  font-size: 24px;
  margin-bottom: 24px;
  color: var(--text-main);
}

.skill-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.skill-tag {
  padding: 8px 16px;
  background: rgba(255, 255, 255, 0.05);
  border-radius: 20px;
  font-family: var(--font-mono);
  font-size: 14px;
  border: 1px solid transparent;
  transition: all 0.3s ease;
}

.skill-tag:hover {
  border-color: var(--neon-cyan);
  color: var(--neon-cyan);
  box-shadow: 0 0 10px rgba(72, 196, 221, 0.2);
}

/* --- Projects Section --- */
.projects-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 40px;
}

.project-card {
  position: relative;
  group: card;
}

/* Scaling down the electric card for project previews */
.small-card {
  width: 100%;
  height: 350px;
}

.glass-blue .border-layer-1 {
  border-color: rgba(72, 196, 221, 0.5);
}

.glass-blue .card-main-1 {
  border-color: var(--neon-cyan);
}

.glass-blue .glow-1-layer-1 {
  border-color: var(--neon-cyan);
}

.glass-pink .border-layer-1 {
  border-color: rgba(221, 72, 196, 0.5);
}

.glass-pink .card-main-1 {
  border-color: var(--neon-magenta);
}

.glass-pink .glow-1-layer-1 {
  border-color: var(--neon-magenta);
}

.project-info {
  padding: 24px 0;
}

.project-info h3 {
  font-size: 24px;
  margin-bottom: 8px;
}

.project-info p {
  color: var(--text-muted);
  margin-bottom: 16px;
}

.project-link {
  color: var(--neon-green);
  font-family: var(--font-mono);
  text-transform: uppercase;
  font-size: 14px;
  letter-spacing: 1px;
}

/* --- Contact & Footer --- */
.contact-section {
  text-align: center;
  padding-bottom: 150px;
}

.contact-text {
  font-size: 24px;
  margin-bottom: 48px;
  color: var(--text-muted);
}

footer {
  padding: 32px 0;
  text-align: center;
  border-top: 1px solid rgba(255, 255, 255, 0.05);
  color: var(--text-muted);
  font-size: 14px;
}

.heart {
  color: var(--neon-green);
}

/* --- Responsive --- */
@media (max-width: 900px) {
  .hero-section {
    grid-template-columns: 1fr;
    text-align: center;
    padding-top: 40px;
  }

  .hero-role {
    margin-left: auto;
    margin-right: auto;
  }

  .hero-visual {
    margin-top: 40px;
  }

  .about-grid,
  .skills-wrapper {
    grid-template-columns: 1fr;
  }

  .nav-links {
    display: none;
    /* simple padding for now, could add mobile menu later if requested */
  }
}

/* Animation Styles */
.fade-section {
  opacity: 0;
  transform: translateY(30px);
  transition: opacity 0.8s ease-out, transform 0.8s ease-out;
}

.fade-section.visible {
  opacity: 1;
  transform: translateY(0);
}

/* --- 3D Scene Container (Hero) --- */
.scene-3d {
  perspective: 800px;
  display: flex;
  justify-content: center;
  align-items: center;
  background: transparent;
  /* Clear background for 3D object */
}

.cube-container {
  width: 100px;
  height: 100px;
  transform-style: preserve-3d;
  animation: rotateCube 8s infinite linear;
}

.cube {
  width: 100%;
  height: 100%;
  position: relative;
  transform-style: preserve-3d;
}

.face {
  position: absolute;
  width: 100px;
  height: 100px;
  background: rgba(0, 0, 0, 0.8);
  border: 2px solid var(--neon-green);
  display: flex;
  justify-content: center;
  align-items: center;
  font-size: 24px;
  font-weight: bold;
  color: var(--neon-green);
  box-shadow: 0 0 15px rgba(72, 221, 132, 0.4) inset;
  backface-visibility: visible;
}

.front {
  transform: rotateY(0deg) translateZ(50px);
}

.back {
  transform: rotateY(180deg) translateZ(50px);
}

.right {
  transform: rotateY(90deg) translateZ(50px);
}

.left {
  transform: rotateY(-90deg) translateZ(50px);
}

.top {
  transform: rotateX(90deg) translateZ(50px);
  background: rgba(72, 221, 132, 0.1);
}

.bottom {
  transform: rotateX(-90deg) translateZ(50px);
  background: rgba(72, 221, 132, 0.1);
}

@keyframes rotateCube {
  0% {
    transform: rotateX(-20deg) rotateY(0deg);
  }

  100% {
    transform: rotateX(-20deg) rotateY(360deg);
  }
}

/* --- 3D Text in Projects --- */
.scene-3d-text {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  perspective: 600px;
}

.text-3d-layer {
  font-size: 48px;
  font-weight: 900;
  line-height: 1;
  color: #fff;
  transform: rotateY(15deg) rotateX(10deg);
  text-shadow:
    1px 1px 0 var(--neon-cyan),
    2px 2px 0 var(--neon-cyan),
    3px 3px 0 var(--neon-cyan),
    4px 4px 0 var(--neon-cyan),
    10px 10px 20px rgba(0, 0, 0, 0.5);
  margin-bottom: 8px;
  letter-spacing: 2px;
}

.glass-pink .text-3d-layer {
  text-shadow:
    1px 1px 0 var(--neon-magenta),
    2px 2px 0 var(--neon-magenta),
    3px 3px 0 var(--neon-magenta),
    4px 4px 0 var(--neon-magenta),
    10px 10px 20px rgba(0, 0, 0, 0.5);
}

.text-3d-sub {
  font-size: 16px;
  letter-spacing: 8px;
  color: var(--text-muted);
  font-family: var(--font-mono);
}

/* --- Code Editor Visual (Skills) --- */
.code-editor-wrapper {
  background: rgba(15, 15, 20, 0.95);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 12px;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(10px);
  max-width: 800px;
  margin: 0 auto;
  overflow: hidden;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  position: relative;
  /* Electric Glow Border */
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.05), 0 0 20px rgba(72, 221, 132, 0.1);
}

.code-editor-wrapper:hover {
  transform: translateY(-5px);
  box-shadow:
    0 30px 60px rgba(0, 0, 0, 0.6),
    0 0 30px rgba(72, 221, 132, 0.2);
  border-color: rgba(72, 221, 132, 0.4);
}

.editor-header {
  background: rgba(255, 255, 255, 0.05);
  padding: 12px 20px;
  display: flex;
  align-items: center;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.editor-dots {
  display: flex;
  gap: 8px;
  margin-right: 20px;
}

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

.red {
  background: #ff5f56;
}

.yellow {
  background: #ffbd2e;
}

.green {
  background: #27c93f;
}

.editor-title {
  font-family: var(--font-mono);
  font-size: 13px;
  color: var(--text-muted);
  opacity: 0.8;
}

.editor-content {
  display: flex;
  padding: 24px 0;
  position: relative;
}

/* Line Numbers with fade */
.line-numbers {
  display: flex;
  flex-direction: column;
  padding: 0 16px;
  text-align: right;
  color: rgba(255, 255, 255, 0.15);
  font-family: var(--font-mono);
  font-size: 14px;
  line-height: 1.6;
  border-right: 1px solid rgba(255, 255, 255, 0.05);
  user-select: none;
}

.code-block {
  padding: 0 24px;
  font-family: 'Fira Code', 'Space Mono', monospace;
  /* Use Fira Code if available */
  font-size: 15px;
  line-height: 1.6;
  color: #e0e0e0;
  white-space: pre-wrap;
  /* Preserve whitespace */
}

/* Indentation helper since HTML strips whitespace */
.indent {
  padding-left: 24px;
  display: block;
}

/* Syntax Highlighting - Neon Dracula Inspired */
.keyword {
  color: var(--neon-magenta);
  font-weight: bold;
}

.variable {
  color: #f8f8f2;
}

.operator {
  color: var(--neon-cyan);
}

.property {
  color: var(--neon-green);
}

.string {
  color: #f1fa8c;
}

/* Animated Cursor */
.code-block::after {
  content: '_';
  color: var(--neon-green);
  animation: blink 1s step-end infinite;
  font-weight: bold;
  margin-left: 2px;
}

@keyframes blink {

  0%,
  100% {
    opacity: 1;
  }

  50% {
    opacity: 0;
  }
}

/* --- Pro Visuals: Background & Loader --- */

/* 1. Canvas Background */
#bg-canvas {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: -1;
  /* Behind everything */
  background: radial-gradient(circle at center, #1a1a1a 0%, #000 100%);
}

/* 2. Cyber Core 3D Loader */
.loader-wrapper {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: #050505;
  z-index: 9999;
  /* Topmost */
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  transition: opacity 0.8s ease-out, visibility 0.8s;
}

.loader-wrapper.loaded {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.cyber-core {
  position: relative;
  width: 100px;
  height: 100px;
  perspective: 1000px;
  transform-style: preserve-3d;
}

/* Glowing Inner Energy */
.core-inner {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 40px;
  height: 40px;
  background: var(--neon-cyan);
  border-radius: 50%;
  box-shadow: 0 0 30px var(--neon-cyan);
  animation: corePulse 1.5s infinite ease-in-out alternate;
}

/* Spinning Outer Shell */
.core-outer {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  border: 4px solid transparent;
  border-top: 4px solid var(--neon-green);
  border-bottom: 4px solid var(--neon-magenta);
  border-radius: 50%;
  animation: spinCore 2s infinite linear;
  box-shadow: 0 0 10px rgba(72, 221, 132, 0.3);
}

/* Counter-Rotating Ring */
.core-ring {
  position: absolute;
  top: -20px;
  left: -20px;
  width: 140px;
  height: 140px;
  border: 1px dashed rgba(255, 255, 255, 0.3);
  border-radius: 50%;
  animation: spinRing 10s infinite linear reverse;
}

.loading-text {
  margin-top: 40px;
  font-family: var(--font-mono);
  font-size: 14px;
  letter-spacing: 4px;
  color: var(--text-muted);
  animation: textBlink 1s infinite alternate;
}

@keyframes corePulse {
  0% {
    transform: translate(-50%, -50%) scale(0.8);
    opacity: 0.8;
  }

  100% {
    transform: translate(-50%, -50%) scale(1.2);
    opacity: 1;
    box-shadow: 0 0 50px var(--neon-cyan);
  }
}

@keyframes spinCore {
  0% {
    transform: rotate(0deg) rotateX(45deg);
  }

  100% {
    transform: rotate(360deg) rotateX(45deg);
  }
}

@keyframes spinRing {
  0% {
    transform: rotate(0deg);
  }

  100% {
    transform: rotate(360deg);
  }
}

@keyframes textBlink {
  0% {
    opacity: 0.3;
  }

  100% {
    opacity: 1;
  }
}


/* --- Expert Feature 2: Scroll Connected Grid --- */
.connector-container {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: -1;
  pointer-events: none;
}

.connector-line {
  position: absolute;
  background: var(--neon-green);
  width: 2px;
  height: 0;
  /* Starts at 0, grows via JS */
  left: 50%;
  transform: translateX(-50%);
  opacity: 0.3;
  box-shadow: 0 0 10px var(--neon-green);
  transition: height 0.5s ease-out;
}

/* Specific positions for lines (will be managed better by JS mostly, but defaults here) */
#line-hero-about {
  top: 100vh;
}

#line-about-skills {
  top: 150vh;
}

/* --- Expert Feature 3: Card Glare --- */
.card-glare {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(105deg,
      transparent 20%,
      rgba(255, 255, 255, 0.4) 30%,
      transparent 40%);
  opacity: 0;
  mix-blend-mode: overlay;
  transition: opacity 0.3s;
  pointer-events: none;
  border-radius: 24px;
  transform: translateX(-100%);
  /* Start out of view */
}

.project-card:hover .card-glare {
  opacity: 1;
}

/* --- Expert Feature 1: Magnetic UI --- */
.magnetic-item,
.magnetic-btn {
  display: inline-block;
  transition: transform 0.2s cubic-bezier(0.25, 0.46, 0.45, 0.94);
  will-change: transform;
}


/* --- God Tier: System Overload Mode --- */

/* The Switch UI */
.overload-toggle {
  position: fixed;
  bottom: 40px;
  right: 40px;
  z-index: 1000;
  display: flex;
  align-items: center;
  gap: 12px;
  cursor: pointer;
  background: rgba(0, 0, 0, 0.6);
  padding: 10px 16px;
  border-radius: 30px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(5px);
}

.toggle-icon {
  font-size: 24px;
  animation: pulseWarning 2s infinite;
}

.toggle-label {
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--text-muted);
  letter-spacing: 2px;
  line-height: 1.2;
}

@keyframes pulseWarning {

  0%,
  100% {
    opacity: 0.5;
    transform: scale(1);
  }

  50% {
    opacity: 1;
    transform: scale(1.1);
  }
}

/* --- OVERLOAD STATE ACTIVATED --- */
body.system-overload {
  /* Red Alert Colors */
  --neon-green: #ff003c;
  /* Cyber Red */
  --neon-cyan: #ffbd2e;
  /* Warning Yellow */
  --neon-magenta: #ffffff;
  /* Intense White */

  /* Shake screen slightly */
  animation: screenShake 0.2s infinite;
}

/* Intensify Grid Color */
body.system-overload .connector-line {
  box-shadow: 0 0 20px var(--neon-green);
  width: 4px;
  /* Thicker lines */
}

/* Intensify Core Loader (if visible or reused) */
body.system-overload .core-inner {
  background: var(--neon-green);
  box-shadow: 0 0 50px var(--neon-green);
}

/* Warning Screen Shake Animation (Subtle but noticeable) */
@keyframes screenShake {
  0% {
    transform: translate(1px, 1px) rotate(0deg);
  }

  10% {
    transform: translate(-1px, -2px) rotate(-1deg);
  }

  20% {
    transform: translate(-3px, 0px) rotate(1deg);
  }

  30% {
    transform: translate(3px, 2px) rotate(0deg);
  }

  40% {
    transform: translate(1px, -1px) rotate(1deg);
  }

  50% {
    transform: translate(-1px, 2px) rotate(-1deg);
  }

  60% {
    transform: translate(-3px, 1px) rotate(0deg);
  }

  70% {
    transform: translate(3px, 1px) rotate(-1deg);
  }

  80% {
    transform: translate(-1px, -1px) rotate(1deg);
  }

  90% {
    transform: translate(1px, 2px) rotate(0deg);
  }

  100% {
    transform: translate(1px, -2px) rotate(-1deg);
  }
}

/* Stop shake on hover for usability */
body.system-overload:hover {
  animation: none;
}


/* --- Out of Box: Bug Hunter Game --- */
.footer-debug {
  margin-top: 40px;
  opacity: 0.5;
  transition: opacity 0.3s;
}

.footer-debug:hover {
  opacity: 1;
}

#debug-trigger {
  background: none;
  border: none;
  font-size: 20px;
  cursor: pointer;
  filter: grayscale(1);
  transition: filter 0.3s;
}

#debug-trigger:hover {
  filter: grayscale(0);
}

/* Game Overlay */
#bug-game-ui {
  position: fixed;
  top: 20px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 10000;
  text-align: center;
  pointer-events: none;
}

#bug-game-ui.hidden {
  display: none;
}

.score-board {
  font-family: var(--font-mono);
  color: #ff003c;
  font-size: 24px;
  font-weight: bold;
  text-shadow: 0 0 10px #ff003c;
  background: rgba(0, 0, 0, 0.8);
  padding: 10px 20px;
  border: 1px solid #ff003c;
  border-radius: 4px;
}

.game-message {
  color: var(--neon-cyan);
  font-family: var(--font-mono);
  font-size: 14px;
  margin-top: 5px;
  opacity: 0.8;
}

/* The Bug */
.bug {
  position: fixed;
  width: 30px;
  height: 30px;
  background: url('data:image/svg+xml;utf8,<svg xmlns=%22http://www.w3.org/2000/svg%22 viewBox=%220 0 24 24%22 fill=%22%23ff003c%22><path d=%22M12 2C8.13 2 5 5.13 5 9c0 2.38 1.19 4.47 3 5.74V17c0 .55.45 1 1 1h6c.55 0 1-.45 1-1v-2.26c1.81-1.27 3-3.36 3-5.74 0-3.87-3.13-7-7-7zm0 18c-1.1 0-2-.9-2-2h4c0 1.1-.9 2-2 2z%22/></svg>') no-repeat center/contain;
  z-index: 9998;
  cursor: crosshair;
  animation: jitterBug 0.2s infinite;
  transition: transform 0.1s;
}

.bug:active {
  transform: scale(0.9);
}

@keyframes jitterBug {
  0% {
    transform: translate(0, 0) rotate(0deg);
  }

  25% {
    transform: translate(2px, 2px) rotate(5deg);
  }

  50% {
    transform: translate(0, -2px) rotate(0deg);
  }

  75% {
    transform: translate(-2px, 0) rotate(-5deg);
  }

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

/* --- Out of Box: Hacker Text Effect --- */
.section-title {
  font-family: var(--font-mono);
  /* Force mono for glitch effect alignment */
}


/* --- Secret: Hidden Developer Terminal --- */
#cli-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(10, 10, 10, 0.95);
  z-index: 20000;
  display: flex;
  justify-content: center;
  align-items: center;
  backdrop-filter: blur(5px);
}

#cli-overlay.hidden {
  display: none;
}

.cli-container {
  width: 80%;
  max-width: 800px;
  height: 60vh;
  background: #000;
  border: 1px solid var(--neon-green);
  border-radius: 8px;
  box-shadow: 0 0 20px rgba(72, 221, 132, 0.2);
  display: flex;
  flex-direction: column;
  padding: 20px;
  font-family: 'Courier New', monospace;
  color: var(--neon-green);
}

.cli-header {
  border-bottom: 1px solid rgba(72, 221, 132, 0.3);
  padding-bottom: 10px;
  margin-bottom: 10px;
  font-weight: bold;
}

.cli-output {
  flex-grow: 1;
  overflow-y: auto;
  margin-bottom: 10px;
  font-size: 14px;
  line-height: 1.5;
}

.cli-output div {
  margin-bottom: 5px;
}

.cmd {
  color: var(--neon-cyan);
  font-weight: bold;
}

.res {
  color: #fff;
}

.cli-input-line {
  display: flex;
  align-items: center;
  border-top: 1px solid rgba(72, 221, 132, 0.3);
  padding-top: 10px;
}

.prompt {
  color: var(--neon-magenta);
  margin-right: 10px;
}

#cli-input {
  background: transparent;
  border: none;
  color: #fff;
  flex-grow: 1;
  font-family: inherit;
  font-size: 14px;
  outline: none;
  caret-color: var(--neon-green);
}

/* --- Secret: Konami Code RGB Mode --- */
body.rgb-mode {
  animation: rgbCycle 5s infinite linear;
}

@keyframes rgbCycle {
  0% {
    --neon-green: #ff0000;
    --neon-cyan: #00ff00;
    --neon-magenta: #0000ff;
  }

  33% {
    --neon-green: #0000ff;
    --neon-cyan: #ff0000;
    --neon-magenta: #00ff00;
  }

  66% {
    --neon-green: #00ff00;
    --neon-cyan: #0000ff;
    --neon-magenta: #ff0000;
  }

  100% {
    --neon-green: #ff0000;
    --neon-cyan: #00ff00;
    --neon-magenta: #0000ff;
  }
}


/* --- Cyber Deck Control Panel --- */
.cyber-deck {
  margin-top: 40px;
  display: flex;
  flex-direction: column;
  gap: 15px;
  background: rgba(0, 0, 0, 0.4);
  padding: 20px;
  border-radius: 16px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(5px);
  width: fit-content;
  position: relative;
  overflow: hidden;
}

/* Fancy Header/Label for Panel */
.cyber-deck::before {
  content: 'CYBER_CONTROLS_v9';
  position: absolute;
  top: 5px;
  left: 10px;
  font-size: 8px;
  font-family: var(--font-mono);
  color: rgba(255, 255, 255, 0.3);
}

.deck-row {
  display: flex;
  gap: 15px;
}

.deck-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: var(--text-muted);
  padding: 10px 16px;
  border-radius: 8px;
  cursor: pointer;
  font-family: var(--font-mono);
  font-size: 11px;
  transition: all 0.3s ease;
  min-width: 140px;
  justify-content: center;
}

.deck-btn .icon {
  font-size: 16px;
}

.deck-btn:hover {
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
  transform: translateY(-2px);
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
}

.deck-btn:active {
  transform: scale(0.95);
}

/* Overload Button Specifics */
.deck-btn.warning:hover {
  border-color: #ff003c;
  color: #ff003c;
  box-shadow: 0 0 15px rgba(255, 0, 60, 0.3);
}

/* Game Button Specifics */
.deck-btn.neon:hover {
  border-color: var(--neon-cyan);
  color: var(--neon-cyan);
  box-shadow: 0 0 15px rgba(72, 196, 221, 0.3);
}

/* --- Feature: Spotlight --- */
#spotlight-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 9990;
  /* Below Loader/Overload UI but above content */
  background: radial-gradient(circle 150px at var(--x, 50%) var(--y, 50%),
      transparent 0%,
      rgba(0, 0, 0, 0.98) 100%);
  pointer-events: none;
  /* Let clicks pass through hole */
  transition: opacity 0.5s;
}

#spotlight-overlay.hidden {
  opacity: 0;
}

/* --- Feature: Gravity --- */
.gravity-active body {
  overflow: hidden;
  /* Prevent scrolling when everything falls */
}

/* Elements to fall */
.falling-object {
  position: absolute;
  /* Will be set via JS, basic styling here */
  z-index: 50;
  cursor: grab;
  user-select: none;
  transition: none !important;
  /* Physics needs manual update */
}

.falling-object:active {
  cursor: grabbing;
}


/* --- Professional Feature: Classified Project Modal --- */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.85);
  backdrop-filter: blur(8px);
  z-index: 10000;
  display: flex;
  justify-content: center;
  align-items: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}

.modal-overlay.active {
  opacity: 1;
  pointer-events: all;
}

.modal-dossier {
  width: 90%;
  max-width: 700px;
  background: rgba(10, 15, 20, 0.95);
  border: 1px solid var(--neon-cyan);
  border-top: 4px solid var(--neon-cyan);
  box-shadow: 0 0 40px rgba(72, 196, 221, 0.2);
  position: relative;
  padding: 30px;
  transform: scale(0.9) translateY(20px);
  transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  overflow: hidden;
}

.modal-overlay.active .modal-dossier {
  transform: scale(1) translateY(0);
}

/* Authentic dossier look */
.modal-dossier::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: repeating-linear-gradient(45deg,
      rgba(72, 196, 221, 0.03) 0px,
      rgba(72, 196, 221, 0.03) 1px,
      transparent 1px,
      transparent 10px);
  pointer-events: none;
  z-index: 0;
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  padding-bottom: 20px;
  margin-bottom: 20px;
  position: relative;
  z-index: 1;
}

.stamp-box {
  border: 2px solid #ff003c;
  color: #ff003c;
  padding: 5px 10px;
  font-family: 'Courier New', monospace;
  font-weight: bold;
  font-size: 14px;
  transform: rotate(-5deg);
  letter-spacing: 2px;
  opacity: 0.8;
}

.modal-id {
  font-family: var(--font-mono);
  color: var(--text-muted);
  font-size: 12px;
}

.modal-close {
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 24px;
  cursor: pointer;
  transition: color 0.3s;
}

.modal-close:hover {
  color: #ff003c;
}

.modal-body {
  position: relative;
  z-index: 1;
}

#modal-title {
  font-size: 32px;
  margin-bottom: 20px;
  color: #fff;
  text-transform: uppercase;
  letter-spacing: 1px;
}

.mission-block,
.tech-block {
  margin-bottom: 25px;
}

.mission-block h4,
.tech-block h4 {
  color: var(--neon-cyan);
  font-family: var(--font-mono);
  font-size: 12px;
  margin-bottom: 10px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.mission-block p {
  color: var(--text-gray);
  line-height: 1.6;
  font-size: 16px;
  border-left: 2px solid rgba(72, 196, 221, 0.3);
  padding-left: 15px;
}

.tech-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.tech-tag {
  background: rgba(72, 196, 221, 0.1);
  border: 1px solid rgba(72, 196, 221, 0.3);
  color: var(--neon-cyan);
  padding: 5px 12px;
  font-family: var(--font-mono);
  font-size: 12px;
  border-radius: 4px;
}

.modal-actions {
  display: flex;
  gap: 15px;
  margin-top: 30px;
}

/* Scanner effect line */
.modal-scanner {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 2px;
  background: var(--neon-cyan);
  opacity: 0.3;
  animation: scanModal 3s linear infinite;
  z-index: 2;
  pointer-events: none;
}

@keyframes scanModal {
  0% {
    top: 0%;
    opacity: 0;
  }

  10% {
    opacity: 0.5;
  }

  90% {
    opacity: 0.5;
  }

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


/* --- GOD TIER: C.O.R.T.E.X AI --- */
.cortex-container {
  position: fixed;
  bottom: 30px;
  right: 30px;
  display: flex;
  align-items: flex-end;
  gap: 15px;
  z-index: 9999;
  font-family: var(--font-mono);
  pointer-events: none;
  /* Let clicks pass through unless on element */
}

/* Message Box */
.cortex-message-box {
  background: rgba(10, 15, 20, 0.9);
  border: 1px solid var(--neon-cyan);
  padding: 10px 15px;
  border-radius: 4px;
  color: var(--neon-cyan);
  font-size: 12px;
  min-width: 200px;
  max-width: 300px;
  box-shadow: 0 0 15px rgba(72, 196, 221, 0.2);
  position: relative;
  opacity: 0;
  transform: translateY(10px);
  transition: all 0.3s ease;
}

.cortex-message-box.active {
  opacity: 1;
  transform: translateY(0);
}

/* Authentic Tech border corner */
.cortex-message-box::after {
  content: '';
  position: absolute;
  top: -1px;
  right: -1px;
  width: 10px;
  height: 10px;
  border-top: 2px solid #fff;
  border-right: 2px solid #fff;
}

.cursor-blink {
  animation: blinkCursor 1s infinite step-end;
}

@keyframes blinkCursor {
  50% {
    opacity: 0;
  }
}

/* The Eye */
.cortex-eye-wrapper {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  pointer-events: auto;
}

.cortex-eye-outer {
  width: 60px;
  height: 60px;
  background: radial-gradient(circle at center, #111 40%, #000 100%);
  border-radius: 50%;
  border: 2px solid var(--neon-cyan);
  box-shadow: 0 0 20px var(--neon-cyan), inset 0 0 10px var(--neon-cyan);
  position: relative;
  overflow: hidden;
  display: flex;
  justify-content: center;
  align-items: center;
  animation: eyePulse 4s infinite ease-in-out;
}

@keyframes eyePulse {

  0%,
  100% {
    box-shadow: 0 0 20px var(--neon-cyan), inset 0 0 10px var(--neon-cyan);
  }

  50% {
    box-shadow: 0 0 35px var(--neon-cyan), inset 0 0 20px var(--neon-cyan);
  }
}

.cortex-retina {
  position: absolute;
  width: 100%;
  height: 100%;
  background: repeating-conic-gradient(rgba(72, 196, 221, 0.1) 0% 2%, transparent 2% 5%);
  border-radius: 50%;
  animation: rotateRetina 10s linear infinite;
}

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

.cortex-pupil {
  width: 20px;
  height: 20px;
  background: #fff;
  border-radius: 50%;
  box-shadow: 0 0 10px #fff, 0 0 20px var(--neon-cyan);
  position: absolute;
  transition: transform 0.1s ease-out;
  /* Smooth follow */
}

.cortex-label {
  margin-top: 5px;
  font-size: 10px;
  color: var(--neon-cyan);
  letter-spacing: 2px;
  opacity: 0.7;
}

/* Overload State for Cortex */
body.system-overload .cortex-message-box {
  border-color: #ff003c;
  color: #ff003c;
  box-shadow: 0 0 15px rgba(255, 0, 60, 0.2);
}

body.system-overload .cortex-eye-outer {
  border-color: #ff003c;
  box-shadow: 0 0 20px #ff003c, inset 0 0 10px #ff003c;
  animation: eyePulseRed 0.5s infinite ease-in-out;
  /* Panic mode */
}

body.system-overload .cortex-pupil {
  box-shadow: 0 0 10px #fff, 0 0 20px #ff003c;
}

@keyframes eyePulseRed {

  0%,
  100% {
    box-shadow: 0 0 20px #ff003c, inset 0 0 10px #ff003c;
  }

  50% {
    box-shadow: 0 0 40px #ff003c, inset 0 0 25px #ff003c;
  }
}


/* =========================================
   MOBILE / RESPONSIVE OPTIMIZATION
   ========================================= */

@media (max-width: 768px) {

  /* 1. Global Typography */
  body {
    font-size: 14px;
  }

  .section-title {
    font-size: 2rem;
  }

  /* 2. Hero Section */
  .hero-section {
    flex-direction: column-reverse;
    /* Visual on top? No, keep standard */
    padding: 100px 20px 50px;
    text-align: center;
    height: auto;
    min-height: 100vh;
  }

  .hero-content {
    align-items: center;
    /* Center align for mobile */
    margin-top: 30px;
  }

  .hero-title {
    font-size: 3rem;
  }

  .cta-group {
    justify-content: center;
    width: 100%;
  }

  .hero-visual {
    transform: scale(0.85);
    height: 350px;
    margin-bottom: 40px;
    /* Space between Card and Text */
  }

  /* 3. Cyber Deck (Mobile Grid) */
  .cyber-deck {
    margin-top: 40px;
    /* Reduced to bring buttons closer */
    margin-bottom: 100px;
    /* Keep the gap below */
    padding: 20px;
    width: 100%;
    background: rgba(0, 20, 0, 0.4);
    border: 1px solid rgba(0, 255, 65, 0.2);
    border-radius: 12px;
  }

  .deck-row {
    gap: 10px;
  }

  .deck-btn {
    padding: 8px 12px;
    font-size: 10px;
  }

  .deck-btn .icon {
    font-size: 14px;
  }

  /* 4. Projects & Skills */
  .projects-grid,
  .skills-grid {
    grid-template-columns: 1fr;
    /* Stack vertically */
    gap: 40px;
  }

  .project-card {
    margin-bottom: 20px;
  }

  /* Disable tilt perspective on mobile to avoid weird scroll feeling */
  .tilt-card {
    transform: none !important;
  }

  .tilt-card .card-wrapper-1 {
    transform: none !important;
  }

  /* 5. C.O.R.T.E.X Mobile (Compact & Top) */
  .cortex-container {
    bottom: auto;
    top: 20px;
    right: 20px;
    flex-direction: column-reverse;
    /* Text below eye */
    align-items: flex-end;
  }

  .cortex-eye-outer {
    width: 40px;
    height: 40px;
    border-width: 1px;
  }

  .cortex-pupil {
    width: 12px;
    height: 12px;
  }

  .cortex-message-box {
    max-width: 90vw;
    /* Full width message */
    right: 0;
    font-size: 10px;
    margin-top: 10px;
  }

  /* 6. Modals */
  .modal-dossier {
    width: 95%;
    padding: 20px;
    max-height: 90vh;
    overflow-y: auto;
    /* Scrollable content */
  }

  .modal-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
  }

  .modal-close {
    position: absolute;
    top: 15px;
    right: 15px;
  }

  /* 7. Footer */
  footer {
    padding-bottom: 80px;
    /* Space for bottom interaction if needed */
  }
}
/* =========================================
   PROJECT SYNAPSE: START SCREEN
   ========================================= */
.start-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: #000;
    z-index: 99999;
    display: flex;
    justify-content: center;
    align-items: center;
    transition: opacity 1s ease, visibility 1s;
}

.start-overlay.hidden {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}

.start-content {
    text-align: center;
    font-family: var(--font-mono);
}

.start-logo {
    font-size: 24px;
    letter-spacing: 5px;
    color: var(--text-muted);
    margin-bottom: 40px;
    opacity: 0.5;
}

.init-btn {
    background: transparent;
    border: 2px solid var(--neon-cyan);
    color: var(--neon-cyan);
    font-family: var(--font-mono);
    font-size: 20px;
    padding: 20px 40px;
    cursor: pointer;
    text-transform: uppercase;
    letter-spacing: 2px;
    transition: all 0.3s;
    position: relative;
    overflow: hidden;
    animation: pulseInit 2s infinite;
}

.init-btn:hover {
    background: var(--neon-cyan);
    color: #000;
    box-shadow: 0 0 50px var(--neon-cyan);
}

.start-warning {
    margin-top: 20px;
    font-size: 10px;
    color: #444;
    letter-spacing: 2px;
}

@keyframes pulseInit {
    0% { box-shadow: 0 0 0 0 rgba(72, 196, 221, 0.4); }
    70% { box-shadow: 0 0 0 20px rgba(72, 196, 221, 0); }
    100% { box-shadow: 0 0 0 0 rgba(72, 196, 221, 0); }
}


/* =========================================
   GOD TIER: ELECTRIC BORDER CARDS
   ========================================= */

.electric-card {
    position: relative;
    height: 450px;
    background: #050505; /* Deep black bg */
    border-radius: 20px;
    overflow: hidden; /* Contain inner elements but border acts outside? No, filter makes it bleed */
    cursor: pointer;
    transition: transform 0.3s ease;
    box-shadow: 0 10px 30px rgba(0,0,0,0.5);
    margin: 20px; /* Space for wobble */
}

/* Theme Colors */
.theme-green { --card-neon: var(--neon-green); }
.theme-cyan { --card-neon: var(--neon-cyan); }
.theme-magenta { --card-neon: var(--neon-magenta); }

/* The Electric Border */
.electric-card::before {
    content: '';
    position: absolute;
    top: 5px; left: 5px; right: 5px; bottom: 5px;
    border: 2px solid var(--card-neon);
    border-radius: 16px;
    box-shadow: 0 0 15px var(--card-neon), inset 0 0 10px var(--card-neon);
    filter: url(#electric-glitch); /* The Magic SVG Filter */
    opacity: 0.8;
    z-index: 1;
    pointer-events: none;
    transition: opacity 0.3s;
}

.electric-card:hover {
    transform: translateY(-5px) scale(1.02);
}

.electric-card:hover::before {
    opacity: 1;
    box-shadow: 0 0 30px var(--card-neon), inset 0 0 20px var(--card-neon);
}

/* Card Badge (Top Left) */
.card-badge {
    position: absolute;
    top: 30px;
    left: 30px;
    padding: 8px 16px;
    border: 1px solid var(--card-neon);
    color: #fff;
    font-family: var(--font-mono);
    font-size: 11px;
    letter-spacing: 2px;
    border-radius: 20px;
    background: rgba(0,0,0,0.6);
    backdrop-filter: blur(4px);
    z-index: 5;
    text-transform: uppercase;
    box-shadow: 0 0 10px rgba(0,0,0,0.5);
    transition: all 0.3s;
}

.electric-card:hover .card-badge {
    background: var(--card-neon);
    color: #000;
    box-shadow: 0 0 20px var(--card-neon);
}

/* Card Visual (Center - Glassy) */
.card-visual {
    width: 100%;
    height: 100%;
    position: relative;
    z-index: 2;
    background: radial-gradient(circle at center, rgba(255,255,255,0.02) 0%, transparent 70%);
}

.electric-card:hover .card-visual {
    background: radial-gradient(circle at center, rgba(255,255,255,0.05) 0%, transparent 70%);
}

/* Card Details (Bottom) */
.card-details {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    padding: 30px;
    background: linear-gradient(to top, rgba(0,0,0,0.95) 0%, rgba(0,0,0,0.8) 50%, transparent 100%);
    z-index: 5;
    border-top: 1px solid rgba(255,255,255,0.05);
}

.card-details h3 {
    font-size: 28px;
    margin-bottom: 10px;
    color: #fff;
    font-weight: 700;
    text-shadow: 0 2px 4px rgba(0,0,0,0.5);
}

.card-details p {
    font-size: 14px;
    color: rgba(255,255,255,0.7);
    line-height: 1.5;
    max-width: 90%;
}

