/* ==========================================================================
   ZENITH RAI - DIGITAL CYBER-MATRIX PORTFOLIO STYLESHEET
   ========================================================================== */

:root {
  --bg-primary: #050811;
  --bg-secondary: #0a0f1d;
  --bg-card: rgba(11, 19, 38, 0.72);
  --bg-card-hover: rgba(16, 28, 56, 0.85);
  
  --cyan: #00f5ff;
  --cyan-glow: rgba(0, 245, 255, 0.35);
  --cyan-dim: rgba(0, 245, 255, 0.15);
  
  --purple: #8b5cf6;
  --purple-glow: rgba(139, 92, 246, 0.35);
  --purple-dim: rgba(139, 92, 246, 0.15);
  
  --emerald: #10b981;
  --emerald-glow: rgba(16, 185, 129, 0.35);
  
  --text-main: #f1f5f9;
  --text-muted: #94a3b8;
  --text-dim: #64748b;
  
  --border-subtle: rgba(255, 255, 255, 0.08);
  --border-glow: rgba(0, 245, 255, 0.25);
  
  --font-cyber: 'Orbitron', 'Space Grotesk', sans-serif;
  --font-mono: 'JetBrains Mono', 'Fira Code', monospace;
  --font-sans: 'Space Grotesk', 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
}

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

html {
  scroll-behavior: smooth;
  color-scheme: dark;
}

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

/* Custom Scrollbar */
::-webkit-scrollbar {
  width: 8px;
}
::-webkit-scrollbar-track {
  background: var(--bg-primary);
}
::-webkit-scrollbar-thumb {
  background: #1e293b;
  border-radius: 4px;
  border: 1px solid var(--border-subtle);
}
::-webkit-scrollbar-thumb:hover {
  background: var(--cyan);
  box-shadow: 0 0 10px var(--cyan);
}

/* Custom Cyber Cursor */
.custom-cursor-dot {
  position: fixed;
  top: 0;
  left: 0;
  width: 6px;
  height: 6px;
  background-color: var(--cyan);
  border-radius: 50%;
  pointer-events: none;
  z-index: 9999;
  transform: translate(-50%, -50%);
  transition: opacity 0.2s ease;
  box-shadow: 0 0 8px var(--cyan), 0 0 16px var(--cyan);
}

.custom-cursor-ring {
  position: fixed;
  top: 0;
  left: 0;
  width: 32px;
  height: 32px;
  border: 1.5px solid rgba(0, 245, 255, 0.6);
  border-radius: 50%;
  pointer-events: none;
  z-index: 9998;
  transform: translate(-50%, -50%);
  transition: width 0.2s ease, height 0.2s ease, border-color 0.2s ease;
}

.cursor-hover .custom-cursor-ring {
  width: 48px;
  height: 48px;
  border-color: var(--purple);
  background-color: rgba(139, 92, 246, 0.1);
}

/* Digital Grid Background */
.digital-grid-bg {
  position: fixed;
  inset: 0;
  background-image: 
    linear-gradient(to right, rgba(0, 245, 255, 0.03) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(0, 245, 255, 0.03) 1px, transparent 1px);
  background-size: 40px 40px;
  pointer-events: none;
  z-index: -2;
}

/* Canvas Overlay */
#cyber-canvas {
  position: fixed;
  inset: 0;
  width: 100vw;
  height: 100vh;
  pointer-events: none;
  z-index: -1;
}

/* Cyber Vignette & Radial Glow */
.cyber-glow-bg {
  position: fixed;
  inset: 0;
  background: 
    radial-gradient(circle at 15% 20%, rgba(0, 245, 255, 0.08) 0%, transparent 40%),
    radial-gradient(circle at 85% 70%, rgba(139, 92, 246, 0.08) 0%, transparent 40%),
    radial-gradient(circle at 50% 50%, rgba(16, 185, 129, 0.03) 0%, transparent 60%);
  pointer-events: none;
  z-index: -2;
}

/* Scanline Effect */
.scanlines {
  position: fixed;
  inset: 0;
  background: linear-gradient(
    rgba(18, 16, 16, 0) 50%, 
    rgba(0, 0, 0, 0.25) 50%
  );
  background-size: 100% 4px;
  pointer-events: none;
  z-index: 99;
  opacity: 0.35;
}

/* Cyber Glass Card */
.cyber-card {
  background: var(--bg-card);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid var(--border-subtle);
  border-radius: 16px;
  position: relative;
  overflow: hidden;
  transition: transform 0.3s cubic-bezier(0.2, 0.8, 0.2, 1),
              box-shadow 0.3s cubic-bezier(0.2, 0.8, 0.2, 1),
              border-color 0.3s ease;
}

.cyber-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(0, 245, 255, 0.5), transparent);
  opacity: 0;
  transition: opacity 0.3s ease;
}

.cyber-card:hover {
  border-color: var(--border-glow);
  box-shadow: 0 12px 30px -10px var(--cyan-glow);
  transform: translateY(-4px);
}

.cyber-card:hover::before {
  opacity: 1;
}

/* Corner Accents for Digital HUD */
.hud-corners {
  position: relative;
}
.hud-corners::after {
  content: '';
  position: absolute;
  top: 8px;
  right: 8px;
  width: 8px;
  height: 8px;
  border-top: 2px solid var(--cyan);
  border-right: 2px solid var(--cyan);
  opacity: 0.6;
}

/* Cyber Glitch & Text Gradients */
.text-cyan-glow {
  color: var(--cyan);
  text-shadow: 0 0 12px var(--cyan-glow);
}

.text-gradient-cyan {
  background: linear-gradient(135deg, #00f5ff 0%, #3b82f6 50%, #8b5cf6 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.text-gradient-purple {
  background: linear-gradient(135deg, #a855f7 0%, #ec4899 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

/* HUD Buttons */
.btn-cyber {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 12px 28px;
  font-family: var(--font-mono);
  font-size: 0.9rem;
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: #050811;
  background: linear-gradient(135deg, #00f5ff 0%, #00b4d8 100%);
  border: none;
  border-radius: 8px;
  cursor: pointer;
  overflow: hidden;
  transition: all 0.3s ease;
  box-shadow: 0 0 15px var(--cyan-glow);
  text-decoration: none;
}

.btn-cyber:hover {
  transform: translateY(-2px);
  box-shadow: 0 0 25px var(--cyan), 0 0 40px var(--cyan-glow);
  color: #000;
}

.btn-cyber-outline {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 12px 26px;
  font-family: var(--font-mono);
  font-size: 0.9rem;
  font-weight: 600;
  letter-spacing: 0.05em;
  color: var(--cyan);
  background: rgba(0, 245, 255, 0.04);
  border: 1px solid rgba(0, 245, 255, 0.4);
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.3s ease;
  text-decoration: none;
}

.btn-cyber-outline:hover {
  background: rgba(0, 245, 255, 0.15);
  border-color: var(--cyan);
  color: #ffffff;
  box-shadow: 0 0 20px var(--cyan-glow);
  transform: translateY(-2px);
}

/* Avatar Digital Reticle */
.avatar-reticle {
  position: relative;
  width: 280px;
  height: 280px;
}

@media (min-width: 768px) {
  .avatar-reticle {
    width: 360px;
    height: 360px;
  }
}

.reticle-ring {
  position: absolute;
  inset: -12px;
  border: 2px dashed rgba(0, 245, 255, 0.4);
  border-radius: 50%;
  animation: rotateReticle 24s linear infinite;
  pointer-events: none;
}

.reticle-ring-inner {
  position: absolute;
  inset: -4px;
  border: 1px solid rgba(139, 92, 246, 0.5);
  border-radius: 50%;
  border-left-color: transparent;
  border-right-color: transparent;
  animation: rotateReticleRev 16s linear infinite;
  pointer-events: none;
}

@keyframes rotateReticle {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

@keyframes rotateReticleRev {
  from { transform: rotate(360deg); }
  to { transform: rotate(0deg); }
}

/* Terminal Window Styles */
.terminal-window {
  background: rgba(8, 13, 27, 0.85);
  border: 1px solid rgba(0, 245, 255, 0.25);
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
  font-family: var(--font-mono);
}

.terminal-header {
  background: rgba(13, 21, 41, 0.95);
  padding: 10px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

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

.terminal-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
}
.dot-red { background: #ef4444; }
.dot-yellow { background: #f59e0b; }
.dot-green { background: #10b981; }

.terminal-title {
  font-size: 0.75rem;
  letter-spacing: 0.1em;
  color: var(--text-dim);
}

.terminal-body {
  padding: 18px;
  font-size: 0.9rem;
  line-height: 1.7;
  color: #cbd5e1;
}

.terminal-cursor::after {
  content: '▋';
  color: var(--cyan);
  animation: blinkCursor 1s step-end infinite;
}

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

/* Scroll-Driven Education History Timeline */
.timeline-container {
  position: relative;
  padding: 20px 0;
}

.timeline-spine {
  position: absolute;
  top: 0;
  bottom: 0;
  left: 20px;
  width: 3px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 2px;
}

@media (min-width: 768px) {
  .timeline-spine {
    left: 50%;
    transform: translateX(-50%);
  }
}

.timeline-spine-progress {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 0%;
  background: linear-gradient(to bottom, #00f5ff, #8b5cf6, #10b981);
  box-shadow: 0 0 12px var(--cyan);
  transition: height 0.15s ease-out;
}

.timeline-node {
  position: relative;
  margin-bottom: 50px;
  opacity: 0.4;
  transform: translateY(30px);
  transition: all 0.6s cubic-bezier(0.2, 0.8, 0.2, 1);
}

.timeline-node.active-node {
  opacity: 1;
  transform: translateY(0);
}

.timeline-bullet {
  position: absolute;
  left: 11px;
  top: 24px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--bg-primary);
  border: 3px solid var(--text-dim);
  z-index: 10;
  transition: all 0.4s ease;
}

@media (min-width: 768px) {
  .timeline-bullet {
    left: 50%;
    transform: translateX(-50%);
  }
}

.timeline-node.active-node .timeline-bullet {
  border-color: var(--cyan);
  background: var(--cyan);
  box-shadow: 0 0 16px var(--cyan), 0 0 30px var(--cyan-glow);
}

/* Semester Course Matrix */
.sem-tab-btn {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  padding: 8px 16px;
  border-radius: 8px;
  background: rgba(15, 23, 42, 0.6);
  border: 1px solid var(--border-subtle);
  color: var(--text-muted);
  cursor: pointer;
  transition: all 0.25s ease;
  white-space: nowrap;
}

.sem-tab-btn:hover {
  color: var(--cyan);
  border-color: rgba(0, 245, 255, 0.4);
  background: rgba(0, 245, 255, 0.05);
}

.sem-tab-btn.active-tab {
  background: linear-gradient(135deg, rgba(0, 245, 255, 0.15), rgba(139, 92, 246, 0.15));
  border-color: var(--cyan);
  color: #ffffff;
  box-shadow: 0 0 14px var(--cyan-glow);
}

.course-card {
  background: rgba(10, 16, 32, 0.65);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 12px;
  padding: 16px;
  transition: all 0.25s ease;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.course-card:hover {
  background: rgba(14, 22, 45, 0.85);
  border-color: rgba(0, 245, 255, 0.35);
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(0, 245, 255, 0.1);
}

/* Sound Telemetry Pill */
.sound-toggle-btn {
  background: rgba(15, 23, 42, 0.8);
  border: 1px solid var(--border-subtle);
  color: var(--text-dim);
  border-radius: 20px;
  padding: 6px 14px;
  font-family: var(--font-mono);
  font-size: 0.75rem;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: all 0.3s ease;
}

.sound-toggle-btn.sound-on {
  border-color: var(--cyan);
  color: var(--cyan);
  box-shadow: 0 0 10px var(--cyan-glow);
}

/* Badge tags */
.badge-tech {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  padding: 4px 10px;
  border-radius: 6px;
  background: rgba(0, 245, 255, 0.08);
  border: 1px solid rgba(0, 245, 255, 0.2);
  color: #38bdf8;
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.badge-purple {
  background: rgba(139, 92, 246, 0.08);
  border-color: rgba(139, 92, 246, 0.25);
  color: #c084fc;
}

.badge-green {
  background: rgba(16, 185, 129, 0.08);
  border-color: rgba(16, 185, 129, 0.25);
  color: #34d399;
}

.badge-private {
  background: rgba(244, 63, 94, 0.1);
  border-color: rgba(244, 63, 94, 0.3);
  color: #fb7185;
}

/* Telemetry Counter Numbers */
.counter-value {
  font-family: var(--font-cyber);
  font-weight: 700;
  letter-spacing: -0.02em;
}

/* Reveal on Scroll Animations */
.scroll-reveal {
  opacity: 0;
  transform: translateY(25px);
  transition: opacity 0.7s cubic-bezier(0.2, 0.8, 0.2, 1),
              transform 0.7s cubic-bezier(0.2, 0.8, 0.2, 1);
}

.scroll-reveal.revealed {
  opacity: 1;
  transform: translateY(0);
}

/* Code block highlight inside modal/details */
pre, code {
  font-family: var(--font-mono);
}

/* Responsive adjustments */
@media (max-width: 640px) {
  .btn-cyber, .btn-cyber-outline {
    width: 100%;
    padding: 12px 18px;
  }
}
