/* ==========================================================================
   style.css — Retro Pixel Arcade Design System (Old Fonts & Colors)
   ========================================================================== */

/* ===== 1. DESIGN TOKENS (RETRO ARCADE STATE) ===== */
:root {
  --bg-dark:       #0c0c10;
  --bg-gradient:   linear-gradient(135deg, #0c0c10 0%, #14141c 100%);
  --bg-card:       rgba(26, 26, 36, 0.85);
  
  /* Borders & Outlines */
  --border-neon:   #4ade80; /* Phosphor Green */
  --border-active: #f43f5e; /* Retro Pink */
  
  /* Cyber Neons */
  --accent-cyan:   #38bdf8; /* Cyber Cyan */
  --accent-pink:   #f43f5e; /* Retro Pink */
  --accent-purple: #b497cf; 
  --accent-green:  #4ade80; /* Phosphor Green */
  --accent-yellow: #facc15; /* Arcade Yellow */

  --text-primary:  #f4f4f5;
  --text-muted:    #a1a1aa;
  
  /* Fonts - Kept from old style */
  --font-head:    'Press Start 2P', system-ui, sans-serif;
  --font-body:    'VT323', monospace;
  
  /* Stepped animation for retro feel */
  --transition:    all 0.1s steps(4, end);
  --radius:        0px; /* Sharp retro edges */
  
  /* Retro Pixel Shadows */
  --pixel-shadow:  4px 4px 0px #000;
  --pixel-shadow-hover: 6px 6px 0px #000;
}

/* ===== 2. RESET & SETUP ===== */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
}

#bg-canvas {
  position: fixed;
  inset: 0;
  width: 100vw;
  height: 100vh;
  z-index: -2;
  pointer-events: none;
}

body {
  background: transparent;
  color: var(--text-primary);
  font-family: var(--font-body);
  font-size: 22px; /* VT323 is narrow, needs larger font size */
  line-height: 1.4;
  overflow-x: hidden;
  min-height: 100vh;
  image-rendering: pixelated;
}

/* Hide default cursor only on devices with a mouse (fine pointer) */
@media (pointer: fine) {
  body {
    cursor: none !important;
  }
  a, button, input, select, textarea, .cursor-target {
    cursor: none !important;
  }
}

/* Hide custom crosshair cursor on touch/mobile devices */
@media (pointer: coarse), (max-width: 768px) {
  #target-cursor {
    display: none !important;
  }
}

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

/* ===== 3. CUSTOM RETRO CURSOR (TargetCursor) ===== */
#target-cursor {
  position: fixed;
  top: 0;
  left: 0;
  width: 28px;
  height: 28px;
  pointer-events: none;
  z-index: 10000;
  transform: translate(-50%, -50%);
  display: flex;
  align-items: center;
  justify-content: center;
  mix-blend-mode: normal;
  transition: width 0.1s steps(4, end), height 0.1s steps(4, end);
}

.cursor-ring {
  position: absolute;
  width: 100%;
  height: 100%;
  border: 2px solid var(--border-neon); /* Green by default */
  border-radius: 0; /* Square crosshair */
  transition: border-color 0.1s, border-width 0.1s;
}

/* Crosshair lines */
.cursor-ring::before, .cursor-ring::after {
  content: '';
  position: absolute;
  background: var(--border-neon);
  transition: background 0.1s;
}
.cursor-ring::before {
  top: -4px; bottom: -4px; left: 50%; width: 2px;
  transform: translateX(-50%);
}
.cursor-ring::after {
  left: -4px; right: -4px; top: 50%; height: 2px;
  transform: translateY(-50%);
}

.cursor-dot {
  width: 6px;
  height: 6px;
  background-color: var(--accent-yellow);
  border-radius: 0; /* Square pixel dot */
  transition: background-color 0.1s, transform 0.1s;
}

/* Hover Cursor States */
#target-cursor.cursor-hovered {
  width: 36px;
  height: 36px;
}
#target-cursor.cursor-hovered .cursor-ring {
  border-color: var(--border-active); /* Changes to pink */
  border-width: 2px;
}
#target-cursor.cursor-hovered .cursor-ring::before,
#target-cursor.cursor-hovered .cursor-ring::after {
  background: var(--border-active);
}
#target-cursor.cursor-hovered .cursor-dot {
  background-color: var(--accent-cyan);
  transform: scale(1.2);
}

/* ===== 4. CRT SCANLINES OVERLAYS ===== */
#crt-overlay {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 9999;
  opacity: 0; /* OFF by default */
  transition: opacity 0.3s ease;
  background: 
    linear-gradient(rgba(18, 16, 16, 0) 50%, rgba(0, 0, 0, 0.22) 50%),
    radial-gradient(circle, transparent 40%, rgba(0, 0, 0, 0.6) 130%);
  background-size: 100% 5px, 100% 100%;
}

/* Rolling scan bar overlay */
#crt-overlay::after {
  content: ' ';
  display: block;
  position: absolute;
  top: 0; left: 0; right: 0; bottom: 0;
  background: linear-gradient(to bottom, rgba(18, 16, 16, 0) 0%, rgba(18, 16, 16, 0.18) 10%, rgba(18, 16, 16, 0) 20%);
  background-size: 100% 100%;
  pointer-events: none;
  opacity: 0;
}

/* Body level class when crt filter is fully active */
body.crt-active #crt-overlay {
  opacity: 0.95;
  animation: crt-flicker 0.15s infinite;
}

body.crt-active #crt-overlay::after {
  opacity: 1;
  animation: crt-roll 8s linear infinite;
}

/* Phosphor glow for texts and icons */
body.crt-active {
  text-shadow: 0 0 3px rgba(74, 222, 128, 0.4), 0 0 6px rgba(244, 63, 94, 0.2);
}

/* Curved glass tube vignette screen bezel */
body.crt-active::after {
  content: ' ';
  display: block;
  position: fixed;
  top: 0; left: 0; bottom: 0; right: 0;
  box-shadow: inset 0 0 80px rgba(0, 0, 0, 0.75), inset 0 0 160px rgba(0, 0, 0, 0.95);
  z-index: 9998;
  pointer-events: none;
}

@keyframes crt-flicker {
  0% { opacity: 0.94; }
  50% { opacity: 0.96; }
  100% { opacity: 0.94; }
}

@keyframes crt-roll {
  0% { transform: translateY(-100%); }
  100% { transform: translateY(100%); }
}

/* ===== 5. STICKY NAVBAR ===== */
nav {
  position: fixed;
  top: 0; left: 0; right: 0;
  height: 80px;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 40px;
  background: var(--bg-dark);
  border-bottom: 6px solid var(--border-neon);
}

.nav-logo {
  font-family: var(--font-head);
  font-size: 16px;
  font-weight: 700;
  color: var(--accent-yellow);
  text-transform: uppercase;
}

.nav-links {
  display: flex;
  gap: 24px;
  list-style: none;
}

.nav-links a {
  font-family: var(--font-head);
  font-size: 11px;
  color: var(--text-muted);
  text-transform: uppercase;
  padding: 6px 12px;
  border: 2px solid transparent;
  transition: var(--transition);
}

.nav-links a:hover {
  color: var(--border-neon);
  border: 2px dashed var(--border-neon);
  background: rgba(74, 222, 128, 0.05);
}

/* CRT Toggle Button */
.btn-crt {
  padding: 8px 16px;
  background: transparent;
  border: 2px solid var(--border-neon);
  color: var(--border-neon);
  font-family: var(--font-head);
  font-size: 10px;
  font-weight: 700;
  transition: var(--transition);
  box-shadow: var(--pixel-shadow);
}
.btn-crt:hover {
  background: var(--border-neon);
  color: #000;
  box-shadow: var(--pixel-shadow-hover);
}
.btn-crt:active {
  transform: translate(2px, 2px);
  box-shadow: 0 0 0 #000;
}

/* ===== 6. HERO SECTION ===== */
#hero {
  position: relative;
  height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  overflow: hidden;
  padding: 0 20px;
  border-bottom: 6px solid var(--border-neon);
}

#hero-canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
  pointer-events: none;
}

.hero-content {
  position: relative;
  z-index: 1;
  max-width: 850px;
  padding: 40px;
  background: rgba(12, 12, 16, 0.95);
  border: 4px solid var(--border-active); /* Pink outline */
  box-shadow: var(--pixel-shadow);
}

.hero-badge {
  display: inline-block;
  font-family: var(--font-head);
  font-size: 10px;
  color: var(--accent-cyan);
  margin-bottom: 20px;
  text-transform: uppercase;
}

.hero-title {
  font-family: var(--font-head);
  font-size: clamp(1.8rem, 6vw, 3.8rem);
  font-weight: 700;
  line-height: 1.1;
  margin-bottom: 24px;
}

/* Shiny Text adapted to Retro Color Cycle */
.shiny-text {
  color: var(--accent-yellow);
  animation: colorCycle 6s linear infinite;
}

@keyframes colorCycle {
  0%, 100% { color: var(--accent-yellow); }
  33% { color: var(--border-neon); }
  66% { color: var(--accent-cyan); }
}

.hero-sub {
  font-size: 26px; /* Larger body size for VT323 */
  color: var(--text-muted);
  max-width: 650px;
  margin: 0 auto 40px auto;
  min-height: 80px;
}

/* TextType cursor */
#hero-type-text {
  font-weight: 600;
  color: var(--text-primary);
  border-right: 3px solid var(--accent-cyan);
  padding-right: 4px;
}

.hero-cta {
  display: flex;
  gap: 24px;
  justify-content: center;
  flex-wrap: wrap;
}

/* Retro Pixel Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  padding: 14px 28px;
  font-family: var(--font-head);
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  border: 4px solid #000;
  box-shadow: var(--pixel-shadow);
  position: relative;
  transition: transform 0.05s steps(4, end), box-shadow 0.05s steps(4, end);
}

.btn:hover {
  transform: translate(-2px, -2px);
  box-shadow: var(--pixel-shadow-hover);
}

.btn:active {
  transform: translate(2px, 2px);
  box-shadow: 0px 0px 0px #000;
}

.btn-primary {
  background: var(--border-neon); /* Green */
  color: #000;
}

.btn-ghost {
  background: var(--bg-card);
  color: var(--text-primary);
}

.scroll-hint {
  position: absolute;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  color: var(--text-muted);
  font-size: 18px;
  text-transform: uppercase;
}

.scroll-arrow {
  width: 8px;
  height: 8px;
  border-right: 3px solid var(--text-muted);
  border-bottom: 3px solid var(--text-muted);
  transform: rotate(45deg);
  animation: scrollPulse 1.5s infinite;
}

@keyframes scrollPulse {
  0% { transform: rotate(45deg) translate(0, 0); opacity: 0.3; }
  50% { transform: rotate(45deg) translate(0, 6px); opacity: 1; }
  100% { transform: rotate(45deg) translate(0, 0); opacity: 0.3; }
}

/* ===== 7. ABOUT SECTION ===== */
#about {
  padding: 100px 0;
  border-bottom: 6px solid var(--border-neon);
}

.about-grid {
  display: grid;
  grid-template-columns: 1.2fr 0.8fr;
  gap: 60px;
  align-items: center;
}

.section-label {
  font-family: var(--font-head);
  font-size: 11px;
  text-transform: uppercase;
  color: var(--border-active);
  margin-bottom: 16px;
  display: inline-block;
  border-bottom: 2px dashed var(--border-active);
  padding-bottom: 4px;
}

.section-title {
  font-family: var(--font-head);
  font-size: clamp(1.4rem, 4vw, 2.2rem);
  font-weight: 700;
  line-height: 1.2;
  margin-bottom: 24px;
}

.section-title em {
  font-style: normal;
  color: var(--accent-cyan);
}

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

.instagram-link {
  color: var(--border-neon);
  font-weight: 600;
  border-bottom: 2px dashed var(--border-neon);
}
.instagram-link:hover {
  color: #fff;
  border-color: #fff;
}

.skills-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 32px;
}

.skill-tag {
  font-family: var(--font-head);
  font-size: 10px;
  padding: 8px 16px;
  background: var(--bg-card);
  border: 3px solid var(--text-muted);
  color: var(--text-primary);
  transition: var(--transition);
}

.skill-tag:hover {
  border-color: var(--border-neon);
  color: var(--border-neon);
  background: rgba(74, 222, 128, 0.05);
}

.about-stats {
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.stat-card {
  padding: 24px;
  background: var(--bg-card);
  border: 4px solid var(--border-neon);
  box-shadow: var(--pixel-shadow);
  transition: var(--transition);
}
.stat-card:hover {
  transform: translate(-2px, -2px);
  box-shadow: var(--pixel-shadow-hover);
}

.stat-num {
  font-family: var(--font-head);
  font-size: 28px;
  font-weight: 700;
  color: var(--accent-yellow);
  margin-bottom: 8px;
}

.stat-label {
  color: var(--text-muted);
  font-size: 20px;
}

/* ===== 8. ARCADE PLAYGROUND SECTION ===== */
#arcade {
  padding: 100px 0;
  border-bottom: 6px solid var(--border-neon);
}

.section-sub {
  color: var(--text-muted);
  font-size: 24px;
  max-width: 800px;
  margin-bottom: 40px;
}

#game-container {
  position: relative;
  width: 100%;
  height: 550px;
  background: #000;
  border: 4px solid var(--border-neon);
  box-shadow: var(--pixel-shadow);
}

#playground-canvas {
  width: 100%;
  height: 100%;
  display: block;
}

/* Game HUD Overlays */
.game-hud {
  position: absolute;
  top: 20px;
  left: 20px;
  right: 20px;
  display: flex;
  justify-content: space-between;
  pointer-events: none;
  font-family: var(--font-head);
  font-size: 11px;
  font-weight: 700;
  color: #fff;
  z-index: 10;
}

.hud-item {
  padding: 8px 16px;
  background: #000;
  border: 3px solid var(--border-neon);
}

#game-score {
  color: var(--accent-cyan);
}
#game-targets {
  color: var(--accent-pink);
}

/* ===== 9. PROJECTS SECTION ===== */
#projects {
  padding: 100px 0;
  border-bottom: 6px solid var(--border-neon);
}

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

.project-card {
  background: var(--bg-card);
  border: 4px solid var(--border-neon);
  box-shadow: var(--pixel-shadow);
  transition: var(--transition);
  display: flex;
  flex-direction: column;
  height: 100%;
  position: relative;
  overflow: hidden;
}

.project-card:hover {
  transform: translate(-6px, -6px);
  border-color: var(--border-active);
  box-shadow: 
    3px 3px 0px var(--accent-pink),
    6px 6px 0px var(--accent-cyan),
    9px 9px 0px #000;
  animation: card-glitch 0.25s steps(4, end) 1;
}

@keyframes card-glitch {
  0% { transform: translate(0px, 0px) skewX(0deg); }
  25% { transform: translate(-8px, -4px) skewX(3deg); filter: hue-rotate(40deg); }
  50% { transform: translate(-3px, -8px) skewX(-3deg); }
  75% { transform: translate(-7px, -5px) skewX(1deg); filter: hue-rotate(-40deg); }
  100% { transform: translate(-6px, -6px) skewX(0deg); }
}

.project-thumb {
  height: 200px;
  position: relative;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  border-bottom: 4px solid var(--border-neon);
}

.project-thumb-inner {
  font-size: 64px;
  transition: transform 0.1s steps(4, end);
}
.project-card:hover .project-thumb-inner {
  transform: scale(1.1) rotate(5deg);
}

/* Gradient fallback for retro thumbnails */
.project-gradient-1 {
  background: linear-gradient(135deg, #0f0c29, #302b63, #24243e);
}
.project-gradient-2 {
  background: linear-gradient(135deg, #0d1f12, #14532d, #052e16);
}

.project-body {
  padding: 24px;
  display: flex;
  flex-direction: column;
  flex-grow: 1;
}

.project-tags {
  display: flex;
  gap: 8px;
  margin-bottom: 16px;
  flex-wrap: wrap;
}

.project-tag {
  font-family: var(--font-head);
  font-size: 9px;
  padding: 4px 8px;
  background: rgba(255, 255, 255, 0.05);
  border: 2px solid rgba(255, 255, 255, 0.2);
  color: var(--text-muted);
}

.project-name {
  font-family: var(--font-head);
  font-size: 14px;
  font-weight: 700;
  color: var(--accent-yellow);
  margin-bottom: 12px;
}

.project-desc {
  font-size: 22px;
  color: var(--text-muted);
  line-height: 1.4;
  margin-bottom: 24px;
  flex-grow: 1;
}

.project-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-top: 2px dashed rgba(255, 255, 255, 0.1);
  padding-top: 16px;
}

.project-link {
  font-family: var(--font-head);
  font-size: 11px;
  color: var(--accent-cyan);
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.project-link svg {
  transition: transform 0.1s;
}
.project-link:hover svg {
  transform: translateX(4px);
}

.project-link.disabled {
  color: var(--text-muted);
  opacity: 0.5;
  pointer-events: none;
}

.project-status {
  font-family: var(--font-head);
  font-size: 9px;
  font-weight: 700;
  padding: 2px 6px;
  text-transform: uppercase;
}

.project-status.live {
  background: transparent;
  color: var(--accent-green);
  border: 2px solid var(--accent-green);
}
.project-status.wip {
  background: transparent;
  color: var(--accent-yellow);
  border: 2px solid var(--accent-yellow);
}

/* ===== 10. CONTACT SECTION ===== */
#contact {
  padding: 100px 0 40px 0;
}

.contact-box {
  max-width: 800px;
  margin: 0 auto;
  text-align: center;
  background: var(--bg-card);
  border: 4px solid var(--border-neon);
  box-shadow: var(--pixel-shadow);
  padding: 60px 40px;
  margin-bottom: 60px;
}

.contact-title {
  font-family: var(--font-head);
  font-size: clamp(1.4rem, 5vw, 2.2rem);
  font-weight: 700;
  margin-bottom: 16px;
}

.contact-p {
  color: var(--text-muted);
  font-size: 24px;
  max-width: 500px;
  margin: 0 auto 32px auto;
}

.contact-links {
  display: flex;
  gap: 16px;
  justify-content: center;
  flex-wrap: wrap;
}

/* ===== FOOTER ===== */
footer {
  text-align: center;
  padding: 32px;
  font-size: 18px;
  color: var(--text-muted);
  border-top: 6px solid var(--border-neon);
  background: var(--bg-dark);
}

/* ===== 11. RESPONSIVENESS ===== */
@media (max-width: 992px) {
  .about-grid {
    grid-template-columns: 1fr;
    gap: 40px;
  }
  
  nav {
    padding: 0 20px;
  }
}

@media (max-width: 768px) {
  .nav-links {
    display: none; /* Hide nav links on mobile for simplicity in prototype */
  }
  
  #game-container {
    height: 400px;
  }
}
