:root {
  --color-bg: #020617;
  --color-bg-light: #081120;
  --color-bg-lighter: #0B1628;
  --color-surface: rgba(17, 24, 39, 0.6);
  --color-surface-hover: rgba(30, 41, 59, 0.8);
  --color-border: rgba(255, 255, 255, 0.1);
  --color-text: #f8fafc;
  --color-text-muted: #94a3b8;
  --color-primary: #0ea5e9;
  --color-cyan: #06b6d4;
  --color-emerald: #10b981;
  --color-purple: #8b5cf6;
  --color-keyword: #c678dd;
  --color-function: #61afef;
  --color-string: #98c379;
  --color-variable: #e06c75;
  --color-comment: #5c6370;
  --font-main: 'Inter', sans-serif;
  --font-display: 'Space Grotesk', sans-serif;
  --glow-shadow: 0 0 20px rgba(14, 165, 233, 0.5);
  --glass-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.37);
  --glass-blur: blur(12px);
}

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

body {
  font-family: var(--font-main);
  background-color: var(--color-bg);
  color: var(--color-text);
  overflow: hidden;
  height: 100vh;
  width: 100vw;
  cursor: none;
  user-select: none;
}

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

.cursor-ring {
  position: fixed;
  top: 0;
  left: 0;
  width: 40px;
  height: 40px;
  border: 1px solid rgba(6, 182, 212, 0.5);
  border-radius: 50%;
  pointer-events: none;
  z-index: 9998;
  transform: translate(-50%, -50%);
  transition: width 0.2s, height 0.2s, border-color 0.2s;
}

body:active .cursor-ring {
  width: 30px;
  height: 30px;
  background: rgba(6, 182, 212, 0.2);
}

/* Page Entrance */
.page-entrance-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: var(--color-bg);
  z-index: 10000;
  animation: fade-out 2s cubic-bezier(0.8, 0, 0.2, 1) forwards;
  animation-delay: 0.5s;
}

@keyframes fade-out {
  0% { opacity: 1; pointer-events: all; }
  100% { opacity: 0; pointer-events: none; }
}

/* Background Environment */
.background-container {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  z-index: 0;
  pointer-events: none;
  animation: bg-zoom 10s ease-out forwards;
}

@keyframes bg-zoom {
  0% { transform: scale(1.1); }
  100% { transform: scale(1); }
}

.bg-gradient {
  position: absolute;
  width: 60vw;
  height: 60vw;
  border-radius: 50%;
  filter: blur(80px);
  opacity: 0.15;
  animation: float 20s infinite ease-in-out alternate;
}

.bg-aurora-1 {
  top: -10%;
  left: -10%;
  background: radial-gradient(circle, var(--color-purple), transparent 70%);
}

.bg-aurora-2 {
  bottom: -10%;
  right: -10%;
  background: radial-gradient(circle, var(--color-cyan), transparent 70%);
  animation-delay: -10s;
}

.bg-blur-blob {
  position: absolute;
  width: 30vw;
  height: 30vw;
  border-radius: 50%;
  filter: blur(100px);
  opacity: 0.1;
  animation: blob-move 30s infinite alternate linear;
}

.blob-1 {
  top: 20%;
  left: 40%;
  background: var(--color-emerald);
}

.blob-2 {
  bottom: 20%;
  right: 20%;
  background: var(--color-primary);
  animation-delay: -15s;
}

.bg-grid {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-image: 
    linear-gradient(to right, rgba(255,255,255,0.03) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(255,255,255,0.03) 1px, transparent 1px);
  background-size: 50px 50px;
  transform: perspective(500px) rotateX(60deg) scale(2);
  transform-origin: bottom center;
  animation: grid-move 15s linear infinite;
  mask-image: linear-gradient(to top, transparent, black);
  -webkit-mask-image: linear-gradient(to top, black, transparent);
}

.stars-layer {
  position: absolute;
  width: 100%;
  height: 100%;
}

.star {
  position: absolute;
  background: white;
  border-radius: 50%;
  animation: twinkle var(--duration) infinite alternate ease-in-out;
}

.fog-layer {
  position: absolute;
  bottom: 0;
  left: 0;
  width: 200%;
  height: 50%;
  background: url('data:image/svg+xml,%3Csvg viewBox="0 0 1000 1000" xmlns="http://www.w3.org/2000/svg"%3E%3Cfilter id="noise"%3E%3CfeTurbulence type="fractalNoise" baseFrequency="0.01" numOctaves="3" result="noise"/%3E%3CfeColorMatrix type="matrix" values="1 0 0 0 0 0 1 0 0 0 0 0 1 0 0 0 0 0 0.2 0"/%3E%3C/filter%3E%3Crect width="100%25" height="100%25" filter="url(%23noise)"/%3E%3C/svg%3E');
  opacity: 0.1;
  animation: fog-move 60s linear infinite;
  mask-image: linear-gradient(to top, black, transparent);
  -webkit-mask-image: linear-gradient(to top, black, transparent);
}

.fog-2 {
  animation-direction: reverse;
  opacity: 0.05;
  height: 70%;
}

.light-beams {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  overflow: hidden;
}

.beam {
  position: absolute;
  top: -50%;
  left: 50%;
  width: 100px;
  height: 200%;
  background: linear-gradient(to right, transparent, rgba(6, 182, 212, 0.05), transparent);
  transform: rotate(45deg);
  animation: beam-sweep 15s infinite linear;
}
.beam:nth-child(2) {
  left: 20%;
  animation-delay: -7.5s;
  background: linear-gradient(to right, transparent, rgba(139, 92, 246, 0.05), transparent);
}

.bg-noise {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: 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.65" numOctaves="3" stitchTiles="stitch"/%3E%3C/filter%3E%3Crect width="100%25" height="100%25" filter="url(%23noiseFilter)"/%3E%3C/svg%3E');
  opacity: 0.03;
  mix-blend-mode: overlay;
}

.particles {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
}

.particle {
  position: absolute;
  background-color: var(--color-cyan);
  border-radius: 50%;
  opacity: 0;
  animation: particle-rise var(--duration) linear infinite;
}

/* Layout */
.main-scene {
  position: relative;
  z-index: 1;
  display: flex;
  justify-content: space-between;
  align-items: center;
  width: 100%;
  height: 100%;
  padding: 0 8vw;
  transform-style: preserve-3d;
}

/* UI Layer */
.ui-layer {
  flex: 1;
  max-width: 600px;
  position: relative;
  z-index: 2;
  perspective: 1000px;
}

.hero-content {
  display: flex;
  flex-direction: column;
  gap: 24px;
  opacity: 0;
  transform: translateY(30px);
  animation: fade-in-up 1.5s cubic-bezier(0.16, 1, 0.3, 1) forwards;
  animation-delay: 1s;
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 12px;
  background: rgba(16, 185, 129, 0.1);
  border: 1px solid rgba(16, 185, 129, 0.2);
  border-radius: 20px;
  font-size: 0.8rem;
  color: var(--color-emerald);
  width: max-content;
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
}

.pulse-dot {
  width: 8px;
  height: 8px;
  background-color: var(--color-emerald);
  border-radius: 50%;
  box-shadow: 0 0 8px var(--color-emerald);
  animation: pulse 2s infinite;
}

.gradient-text {
  font-family: var(--font-display);
  font-size: 4rem;
  line-height: 1.1;
  font-weight: 700;
  background: linear-gradient(135deg, #fff 0%, #94a3b8 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  letter-spacing: -1px;
}

.subtitle {
  font-size: 1.5rem;
  font-weight: 500;
  color: var(--color-cyan);
}

.description {
  font-size: 1.1rem;
  line-height: 1.6;
  color: var(--color-text-muted);
  max-width: 480px;
}

/* Loading Module */
.loading-module {
  margin-top: 16px;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  padding: 24px;
  border-radius: 16px;
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  box-shadow: var(--glass-shadow);
  transform: translateZ(20px);
}

.progress-bar-container {
  width: 100%;
  height: 6px;
  background: rgba(255, 255, 255, 0.05);
  border-radius: 4px;
  overflow: hidden;
  margin-bottom: 12px;
  position: relative;
}

.progress-bar {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, var(--color-primary), var(--color-cyan));
  border-radius: 4px;
  position: relative;
  transition: width 0.3s ease;
}

.progress-glow {
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  width: 20px;
  background: #fff;
  filter: blur(5px);
  opacity: 0.5;
  animation: slide-glow 2s infinite;
}

.progress-stats {
  display: flex;
  justify-content: space-between;
  font-size: 0.9rem;
  font-family: monospace;
  color: var(--color-text-muted);
}

.percentage {
  color: var(--color-cyan);
  font-weight: 600;
}

/* Actions */
.actions {
  display: flex;
  align-items: center;
  gap: 24px;
  margin-top: 16px;
}

.btn-primary {
  position: relative;
  padding: 14px 32px;
  font-size: 1rem;
  font-weight: 600;
  color: #fff;
  background: linear-gradient(135deg, rgba(255,255,255,0.1), rgba(255,255,255,0.05));
  border: 1px solid rgba(255,255,255,0.2);
  border-radius: 8px;
  cursor: none;
  overflow: hidden;
  transition: transform 0.2s, border-color 0.2s;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

.btn-primary:hover {
  border-color: var(--color-cyan);
  transform: translateY(-2px);
}

.btn-glow {
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.2), transparent);
  transition: left 0.5s ease;
}

.btn-primary:hover .btn-glow {
  left: 100%;
}

.eta {
  font-size: 0.9rem;
  color: var(--color-text-muted);
}

/* Floating Cards */
.floating-cards {
  position: absolute;
  top: -100px;
  right: -100px;
  width: 120%;
  height: 120%;
  pointer-events: none;
  opacity: 0;
  animation: fade-in 2s ease-in forwards;
  animation-delay: 2s;
}

.holo-card {
  position: absolute;
  padding: 12px 20px;
  background: rgba(17, 24, 39, 0.4);
  border: 1px solid rgba(255, 255, 255, 0.05);
  border-radius: 12px;
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--color-text-muted);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  box-shadow: 0 4px 16px rgba(0,0,0,0.2);
  animation: float 6s infinite ease-in-out;
  display: flex;
  align-items: center;
  gap: 8px;
}

.card-html { top: 5%; left: 30%; animation-delay: 0s; border-left: 2px solid #e34f26; }
.card-css { top: 15%; right: 5%; animation-delay: 1.5s; border-left: 2px solid #264de4; }
.card-js { bottom: 40%; left: -5%; animation-delay: 3s; border-left: 2px solid #f7df1e; }
.card-git { bottom: 20%; right: -10%; animation-delay: 2s; border-left: 2px solid #f05032; }
.card-api { top: 40%; right: 10%; animation-delay: 4.5s; border-left: 2px solid var(--color-cyan); }
.card-db { bottom: -5%; left: 20%; animation-delay: 1s; border-left: 2px solid var(--color-emerald); }
.card-cloud { top: -10%; right: 40%; animation-delay: 3.5s; border-left: 2px solid var(--color-primary); }
.card-deploy { bottom: -15%; right: 30%; animation-delay: 5s; border-left: 2px solid var(--color-purple); }

/* SVG Scene Layer */
.scene-layer {
  flex: 1;
  display: flex;
  justify-content: flex-end;
  align-items: center;
  position: relative;
  z-index: 1;
  perspective: 1000px;
  opacity: 0;
  animation: fade-in-scale 1.5s cubic-bezier(0.16, 1, 0.3, 1) forwards;
  animation-delay: 1.5s;
}

#svg-wrapper {
  width: 100%;
  max-width: 800px;
  height: auto;
  transform: translateZ(50px);
  transition: transform 0.1s ease-out;
  filter: drop-shadow(0 20px 40px rgba(0,0,0,0.5));
}

#svg-wrapper svg {
  width: 100%;
  height: 100%;
  overflow: visible;
}

/* Animations */
@keyframes fade-in {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes fade-in-up {
  0% { opacity: 0; transform: translateY(30px); }
  100% { opacity: 1; transform: translateY(0); }
}

@keyframes fade-in-scale {
  0% { opacity: 0; transform: scale(0.9) translateZ(0); }
  100% { opacity: 1; transform: scale(1) translateZ(50px); }
}

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

@keyframes float {
  0% { transform: translateY(0px) rotate(0deg); }
  50% { transform: translateY(-15px) rotate(2deg); }
  100% { transform: translateY(0px) rotate(0deg); }
}

@keyframes blob-move {
  0% { transform: translate(0, 0) scale(1); }
  100% { transform: translate(100px, -100px) scale(1.2); }
}

@keyframes grid-move {
  0% { background-position: 0 0; }
  100% { background-position: 0 50px; }
}

@keyframes fog-move {
  0% { transform: translateX(0); }
  100% { transform: translateX(-50%); }
}

@keyframes beam-sweep {
  0% { transform: translateX(-200%) rotate(45deg); }
  100% { transform: translateX(200%) rotate(45deg); }
}

@keyframes slide-glow {
  0% { transform: translateX(-100%); }
  100% { transform: translateX(500%); }
}

@keyframes twinkle {
  0% { opacity: 0.2; transform: scale(0.8); }
  100% { opacity: 1; transform: scale(1.2); }
}

@keyframes particle-rise {
  0% { transform: translateY(100vh) scale(0); opacity: 0; }
  20% { opacity: 1; transform: translateY(80vh) scale(1); }
  80% { opacity: 1; }
  100% { transform: translateY(-10vh) scale(0); opacity: 0; }
}

/* SVG Specific Animations */
@keyframes breathe {
  0%, 100% { transform: scaleY(1); }
  50% { transform: scaleY(1.02) translateY(-2px); }
}

@keyframes sway {
  0%, 100% { transform: rotate(-1deg); }
  50% { transform: rotate(1deg); }
}

@keyframes blink {
  0%, 96%, 98%, 100% { transform: scaleY(1); }
  97% { transform: scaleY(0.1); }
}

@keyframes type {
  0%, 100% { transform: translateY(0) rotate(0); }
  25% { transform: translateY(-2px) rotate(-1deg); }
  75% { transform: translateY(-1px) rotate(1deg); }
}

@keyframes type-fast {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-3px); }
}

@keyframes steam-rise {
  0% { transform: translateY(0) scale(1); opacity: 0.6; }
  100% { transform: translateY(-40px) scale(1.5); opacity: 0; }
}

@keyframes glow-pulse {
  0%, 100% { filter: drop-shadow(0 0 10px var(--color-cyan)) brightness(1); }
  50% { filter: drop-shadow(0 0 20px var(--color-cyan)) brightness(1.2); }
}

@keyframes chair-roll {
  0%, 100% { transform: translateX(0); }
  50% { transform: translateX(2px); }
}

@keyframes leg-tap {
  0%, 100% { transform: rotate(0deg); }
  50% { transform: rotate(5deg) translateY(-2px); }
}

@keyframes hair-flow {
  0%, 100% { transform: skewX(0deg); }
  50% { transform: skewX(-2deg); }
}

@keyframes mouse-move {
  0%, 100% { transform: translate(0, 0); }
  25% { transform: translate(-3px, -2px); }
  50% { transform: translate(2px, 1px); }
  75% { transform: translate(1px, -3px); }
}

@keyframes desk-dust {
  0% { transform: translateY(0); opacity: 0; }
  50% { opacity: 0.8; }
  100% { transform: translateY(-20px); opacity: 0; }
}

/* Syntax Highlighting Classes for JS Injection */
.syntax-keyword { fill: var(--color-keyword); }
.syntax-function { fill: var(--color-function); }
.syntax-string { fill: var(--color-string); }
.syntax-variable { fill: var(--color-variable); }
.syntax-comment { fill: var(--color-comment); }
.syntax-plain { fill: var(--color-text); }

/* Media Queries */
@media (max-width: 1024px) {
  .main-scene {
    flex-direction: column;
    padding: 10vh 5vw;
    text-align: center;
    overflow-y: auto;
  }
  .ui-layer {
    margin-bottom: 40px;
  }
  .actions {
    justify-content: center;
  }
  .floating-cards {
    display: none;
  }
  .gradient-text {
    font-size: 3rem;
  }
  #svg-wrapper {
    max-width: 600px;
  }
}

@media (max-width: 768px) {
  .gradient-text {
    font-size: 2.5rem;
  }
  .subtitle {
    font-size: 1.2rem;
  }
  .actions {
    flex-direction: column;
    gap: 16px;
  }
}
