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

:root {
  --bg-deep: #050a18;
  --bg-mid: #0a1628;
  --bg-panel: rgba(10, 22, 40, 0.85);
  --cyan: #00f0ff;
  --cyan-dim: #007a82;
  --amber: #ffb800;
  --amber-dim: #7a5800;
  --red: #ff3355;
  --text: #e0e8f0;
  --text-dim: #6a7a8a;
  --mono: 'JetBrains Mono', monospace;
  --display: 'Orbitron', sans-serif;
  --sans: 'IBM Plex Sans', sans-serif;
}

body {
  background: var(--bg-deep);
  color: var(--text);
  font-family: var(--sans);
  overflow-x: hidden;
  min-height: 100vh;
}

/* Custom scrollbar */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: var(--bg-deep); }
::-webkit-scrollbar-thumb { background: var(--cyan-dim); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--cyan); }

/* Glitch animation */
@keyframes glitch {
  0%, 100% { text-shadow: 2px 0 var(--cyan), -2px 0 var(--red); }
  20% { text-shadow: -3px 2px var(--cyan), 3px -1px var(--red); }
  40% { text-shadow: 3px -2px var(--cyan), -3px 1px var(--red); }
  60% { text-shadow: -2px 3px var(--cyan), 2px -3px var(--red); }
  80% { text-shadow: 1px -1px var(--cyan), -1px 2px var(--red); }
}

@keyframes glitchTitle {
  0%, 90%, 100% { transform: translate(0); opacity: 1; }
  91% { transform: translate(-3px, 1px); opacity: 0.8; }
  92% { transform: translate(2px, -1px); opacity: 1; }
  93% { transform: translate(-1px, 2px); opacity: 0.9; }
  94% { transform: translate(3px, 0px); opacity: 1; }
}

@keyframes pulse-glow {
  0%, 100% { box-shadow: 0 0 20px rgba(0, 240, 255, 0.3), 0 0 60px rgba(0, 240, 255, 0.1); }
  50% { box-shadow: 0 0 30px rgba(0, 240, 255, 0.5), 0 0 80px rgba(0, 240, 255, 0.2); }
}

@keyframes vortex-spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(20px); }
  to { opacity: 1; transform: translateY(0); }
}

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

@keyframes travel-flash {
  0% { opacity: 0; }
  10% { opacity: 1; }
  30% { opacity: 1; }
  100% { opacity: 0; }
}

@keyframes scanline {
  0% { top: -100%; }
  100% { top: 100%; }
}

@keyframes particle-float {
  0%, 100% { transform: translateY(0) translateX(0); opacity: 0; }
  10% { opacity: 0.6; }
  90% { opacity: 0.6; }
  50% { transform: translateY(-100vh) translateX(20px); }
}

.glitch-text {
  animation: glitchTitle 4s infinite;
}

.pulse-btn {
  animation: pulse-glow 2s infinite;
}

.fade-in-up {
  animation: fadeInUp 0.6s ease-out forwards;
}

.typing-cursor::after {
  content: '█';
  animation: typewriter-cursor 0.8s infinite;
  color: var(--cyan);
}

/* Particle background */
.particle {
  position: fixed;
  width: 2px;
  height: 2px;
  background: var(--cyan);
  border-radius: 50%;
  pointer-events: none;
  opacity: 0;
}

/* Travel flash overlay */
.travel-flash {
  position: fixed;
  inset: 0;
  background: white;
  z-index: 9999;
  animation: travel-flash 1.2s ease-out forwards;
  pointer-events: none;
}

/* Scanline effect */
.scanline::after {
  content: '';
  position: absolute;
  top: -100%;
  left: 0;
  right: 0;
  height: 4px;
  background: linear-gradient(transparent, rgba(0, 240, 255, 0.1), transparent);
  animation: scanline 3s linear infinite;
  pointer-events: none;
}

/* Vortex loading spinner */
.vortex-container {
  position: relative;
  width: 80px;
  height: 80px;
}

.vortex-ring {
  position: absolute;
  border: 2px solid transparent;
  border-radius: 50%;
  animation: vortex-spin linear infinite;
}

.vortex-ring:nth-child(1) {
  inset: 0;
  border-top-color: var(--cyan);
  animation-duration: 1.5s;
}

.vortex-ring:nth-child(2) {
  inset: 8px;
  border-right-color: var(--amber);
  animation-duration: 2s;
  animation-direction: reverse;
}

.vortex-ring:nth-child(3) {
  inset: 16px;
  border-bottom-color: var(--cyan);
  animation-duration: 1s;
}

.vortex-ring:nth-child(4) {
  inset: 24px;
  border-left-color: var(--amber);
  animation-duration: 2.5s;
  animation-direction: reverse;
}

/* Timeline node */
.timeline-node {
  position: relative;
  padding-left: 24px;
  border-left: 2px solid var(--cyan-dim);
  transition: all 0.3s;
}

.timeline-node::before {
  content: '';
  position: absolute;
  left: -6px;
  top: 4px;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--cyan);
  border: 2px solid var(--bg-deep);
}

.timeline-node.amber { border-left-color: var(--amber-dim); }
.timeline-node.amber::before { background: var(--amber); }

.timeline-node:hover { background: rgba(0, 240, 255, 0.05); }

/* Input glow */
.action-input:focus {
  box-shadow: 0 0 0 2px var(--cyan), 0 0 20px rgba(0, 240, 255, 0.2);
  border-color: var(--cyan);
}

/* Quick jump chips */
.chip {
  transition: all 0.2s;
  cursor: pointer;
}

.chip:hover {
  background: rgba(0, 240, 255, 0.2);
  border-color: var(--cyan);
  transform: translateY(-1px);
}

/* Responsive */
@media (max-width: 768px) {
  .main-layout {
    flex-direction: column;
  }
  .side-panel {
    position: fixed;
    right: -100%;
    top: 0;
    bottom: 0;
    width: 80%;
    max-width: 320px;
    z-index: 100;
    transition: right 0.3s ease;
  }
  .side-panel.open {
    right: 0;
  }
  .side-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.6);
    z-index: 99;
  }
}