:root {
  --bg-dark: #050608;
  --bg-surface: #0a0d14;
  --bg-surface-glass: rgba(10, 13, 20, 0.75);
  --border-white-5: rgba(255, 255, 255, 0.06);
  --border-white-10: rgba(255, 255, 255, 0.12);
  --border-white-20: rgba(255, 255, 255, 0.22);
  --indigo-accent: #6366f1;
  --cyan-accent: #06b6d4;
  --emerald-accent: #10b981;
  --purple-accent: #8b5cf6;
}

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

html {
  scroll-behavior: auto; /* Handled smoothly by Lenis */
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  background-color: var(--bg-dark);
  color: #94a3b8;
}

body {
  min-height: 100vh;
  position: relative;
  background-color: #030407;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

/* Custom Typography */
.font-display {
  font-family: 'Space Grotesk', -apple-system, sans-serif;
}

.font-mono {
  font-family: 'JetBrains Mono', monospace;
}

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

.custom-cursor-ring {
  position: fixed;
  top: 0;
  left: 0;
  width: 36px;
  height: 36px;
  border: 1.5px solid rgba(255, 255, 255, 0.45);
  border-radius: 50%;
  pointer-events: none;
  z-index: 9998;
  transform: translate(-50%, -50%);
  transition: width 0.3s cubic-bezier(0.16, 1, 0.3, 1), 
              height 0.3s cubic-bezier(0.16, 1, 0.3, 1), 
              border-color 0.2s ease,
              background-color 0.2s ease;
  display: flex;
  align-items: center;
  justify-content: center;
}

.custom-cursor-ring.active {
  width: 72px;
  height: 72px;
  background-color: rgba(99, 102, 241, 0.15);
  border-color: rgba(99, 102, 241, 0.8);
  backdrop-filter: blur(2px);
}

.cursor-label {
  font-family: 'JetBrains Mono', monospace;
  font-size: 9px;
  font-weight: 700;
  color: #ffffff;
  letter-spacing: 0.05em;
  opacity: 0;
  transition: opacity 0.2s ease;
}

.custom-cursor-ring.active .cursor-label {
  opacity: 1;
}

@media (pointer: coarse) {
  .custom-cursor-dot, .custom-cursor-ring {
    display: none !important;
  }
}

/* Background WebGL & Matrix */
#webglCanvas {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
}

#matrixCanvas {
  position: fixed;
  inset: 0;
  z-index: 9990;
  pointer-events: auto;
  background: rgba(0, 0, 0, 0.88);
}

/* Top Telemetry HUD Bar */
.hud-top-bar {
  letter-spacing: 0.05em;
}

.hud-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background-color: #10b981;
}

/* Equalizer Bars for Audio SFX */
.sound-bars {
  display: flex;
  align-items: flex-end;
  gap: 2px;
  height: 12px;
  width: 14px;
}

.sound-bars .bar {
  width: 2px;
  background-color: #6366f1;
  border-radius: 1px;
  transition: height 0.15s ease;
}

.sound-bars.playing .bar-1 { height: 10px; animation: eqBounce 0.4s infinite alternate ease-in-out; }
.sound-bars.playing .bar-2 { height: 6px; animation: eqBounce 0.6s infinite alternate ease-in-out 0.1s; }
.sound-bars.playing .bar-3 { height: 12px; animation: eqBounce 0.5s infinite alternate ease-in-out 0.2s; }
.sound-bars.playing .bar-4 { height: 8px; animation: eqBounce 0.7s infinite alternate ease-in-out 0.15s; }

.sound-bars:not(.playing) .bar {
  height: 3px;
  background-color: #475569;
}

@keyframes eqBounce {
  0% { height: 2px; }
  100% { height: 12px; }
}

/* Cyber Badge Logo */
.cyber-badge {
  width: 36px;
  height: 36px;
  border-radius: 8px;
  background: linear-gradient(135deg, rgba(99, 102, 241, 0.2) 0%, rgba(6, 182, 212, 0.2) 100%);
  border: 1px solid rgba(99, 102, 241, 0.4);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 0 15px rgba(99, 102, 241, 0.2);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.brand-link:hover .cyber-badge {
  transform: rotate(-6deg) scale(1.08);
  box-shadow: 0 0 25px rgba(99, 102, 241, 0.45);
}

/* Navigation items */
.nav-item {
  color: #94a3b8;
  font-size: 0.8125rem;
  font-weight: 500;
  padding: 0.35rem 0.95rem;
  border-radius: 9999px;
  text-decoration: none;
  transition: all 0.2s ease;
}

.nav-item:hover, .nav-item.active {
  color: #ffffff;
  background: rgba(255, 255, 255, 0.08);
}

.icon-hud-btn {
  width: 38px;
  height: 38px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #94a3b8;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border-white-10);
  cursor: pointer;
  transition: all 0.2s ease;
  text-decoration: none;
}

.icon-hud-btn:hover {
  color: #ffffff;
  border-color: rgba(99, 102, 241, 0.4);
  background: rgba(99, 102, 241, 0.1);
}

.mobile-nav-link {
  color: #94a3b8;
  padding: 0.75rem 0.5rem;
  border-bottom: 1px solid var(--border-white-5);
  text-decoration: none;
  transition: color 0.2s ease;
}

.mobile-nav-link:hover {
  color: #ffffff;
}

/* Gradient Headline */
.gradient-headline {
  background: linear-gradient(135deg, #ffffff 0%, #cbd5e1 30%, #818cf8 70%, #38bdf8 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  text-shadow: 0 0 40px rgba(99, 102, 241, 0.25);
}

/* Futuristic Buttons */
.btn-futuristic-primary {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.875rem 1.75rem;
  border-radius: 12px;
  font-family: 'Space Grotesk', sans-serif;
  font-weight: 700;
  font-size: 0.9375rem;
  color: #ffffff;
  background: linear-gradient(135deg, #6366f1 0%, #4338ca 100%);
  border: 1px solid rgba(255, 255, 255, 0.2);
  cursor: pointer;
  text-decoration: none;
  box-shadow: 0 0 25px rgba(99, 102, 241, 0.4);
  transition: transform 0.2s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.2s ease;
}

.btn-futuristic-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 0 35px rgba(99, 102, 241, 0.6);
}

.btn-futuristic-secondary {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.875rem 1.5rem;
  border-radius: 12px;
  font-family: 'Space Grotesk', sans-serif;
  font-weight: 600;
  font-size: 0.9375rem;
  color: #cbd5e1;
  background: rgba(14, 18, 28, 0.8);
  border: 1px solid var(--border-white-10);
  cursor: pointer;
  text-decoration: none;
  backdrop-filter: blur(12px);
  transition: transform 0.2s cubic-bezier(0.16, 1, 0.3, 1), border-color 0.2s ease, color 0.2s ease;
}

.btn-futuristic-secondary:hover {
  transform: translateY(-2px);
  border-color: rgba(99, 102, 241, 0.4);
  color: #ffffff;
}

/* HUD Terminal Window Card */
.hud-terminal-window {
  border-radius: 16px;
  background: rgba(8, 11, 18, 0.85);
  border: 1px solid var(--border-white-10);
  box-shadow: 0 20px 40px -15px rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(20px);
  overflow: hidden;
}

.hud-terminal-bar {
  padding: 0.75rem 1rem;
  background: rgba(255, 255, 255, 0.03);
  border-bottom: 1px solid var(--border-white-5);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

/* BENTO CARDS WITH DYNAMIC SPOTLIGHT */
.bento-card {
  background: rgba(10, 14, 22, 0.65);
  border: 1px solid var(--border-white-10);
  border-radius: 24px;
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  position: relative;
  overflow: hidden;
  transition: border-color 0.3s ease, transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.bento-card:hover {
  border-color: rgba(99, 102, 241, 0.4);
  transform: translateY(-3px);
}

.bento-spotlight {
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: radial-gradient(400px circle at var(--mouse-x, -500px) var(--mouse-y, -500px), rgba(99, 102, 241, 0.12), transparent 80%);
  opacity: 0;
  transition: opacity 0.3s ease;
}

.bento-card:hover .bento-spotlight {
  opacity: 1;
}

.tech-pill {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.75rem;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border-white-5);
  color: #cbd5e1;
  padding: 0.3rem 0.65rem;
  border-radius: 9999px;
  transition: all 0.2s ease;
}

.tech-pill:hover {
  background: rgba(99, 102, 241, 0.15);
  border-color: rgba(99, 102, 241, 0.3);
  color: #ffffff;
}

/* Spec Matrix Cards */
.spec-card {
  padding: 1.75rem;
  background: rgba(10, 14, 22, 0.55);
  border: 1px solid var(--border-white-10);
  border-radius: 20px;
  backdrop-filter: blur(14px);
  transition: transform 0.25s ease, border-color 0.25s ease;
}

.spec-card:hover {
  transform: translateY(-3px);
  border-color: rgba(255, 255, 255, 0.2);
}

.spec-header {
  display: flex;
  align-items: baseline;
  gap: 0.75rem;
  margin-bottom: 1.25rem;
  padding-bottom: 0.75rem;
  border-bottom: 1px solid var(--border-white-5);
}

.spec-num {
  font-family: 'JetBrains Mono', monospace;
  font-size: 1rem;
  font-weight: 700;
  color: #6366f1;
}

.spec-title {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 1.125rem;
  font-weight: 700;
  color: #ffffff;
}

.spec-list {
  list-style: none;
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.8125rem;
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
}

.spec-list li {
  display: flex;
  align-items: center;
  justify-content: space-between;
  color: #94a3b8;
}

.spec-badge {
  font-size: 0.6875rem;
  padding: 0.15rem 0.45rem;
  border-radius: 4px;
  background: rgba(99, 102, 241, 0.1);
  border: 1px solid rgba(99, 102, 241, 0.2);
  color: #a5b4fc;
}

/* Trajectory Timeline */
.timeline-orb {
  position: absolute;
  left: 1rem;
  top: 0.35rem;
  transform: translateX(-50%);
  width: 14px;
  height: 14px;
  border-radius: 50%;
  border: 3px solid #000000;
  box-shadow: 0 0 10px rgba(99, 102, 241, 0.5);
}

/* HUD Contact Box */
.hud-contact-box {
  background: rgba(10, 14, 22, 0.7);
  border: 1px solid var(--border-white-10);
  backdrop-filter: blur(24px);
  box-shadow: 0 25px 60px -15px rgba(0, 0, 0, 0.8);
}

/* INTERACTIVE TERMINAL MODAL */
.terminal-modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 1000;
  background: rgba(0, 0, 0, 0.65);
  backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
  transition: opacity 0.2s ease;
}

.terminal-modal-overlay.hidden {
  opacity: 0;
  pointer-events: none;
}

.terminal-window {
  width: 100%;
  max-width: 680px;
  background: #090c14;
  border: 1px solid rgba(99, 102, 241, 0.35);
  border-radius: 16px;
  box-shadow: 0 30px 80px -10px rgba(0, 0, 0, 0.9), 0 0 30px rgba(99, 102, 241, 0.2);
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.terminal-window-header {
  padding: 0.85rem 1.25rem;
  background: #0f1422;
  border-bottom: 1px solid var(--border-white-10);
  display: flex;
  align-items: center;
  justify-content: space-between;
  cursor: move;
}

.term-btn {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  border: none;
  cursor: pointer;
}

.term-close { background-color: #ef4444; }
.term-min { background-color: #f59e0b; }
.term-max { background-color: #10b981; }

.terminal-body {
  padding: 1.25rem;
  height: 380px;
  overflow-y: auto;
  color: #e2e8f0;
}

.terminal-input {
  background: transparent;
  border: none;
  outline: none;
  color: #38bdf8;
  font-family: inherit;
  font-size: inherit;
  width: 100%;
}

/* Toast */
.toast-notification {
  position: fixed;
  bottom: 2rem;
  right: 2rem;
  background: #0f1424;
  color: #ffffff;
  padding: 0.85rem 1.5rem;
  border-radius: 12px;
  border: 1px solid var(--indigo-accent);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.8);
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.8125rem;
  z-index: 9999;
  transform: translateY(0);
  opacity: 1;
  transition: opacity 0.25s ease, transform 0.25s ease;
}

.toast-notification.hidden {
  opacity: 0;
  transform: translateY(12px);
  pointer-events: none;
}

/* Utility Helpers */
.text-balance { text-wrap: balance; }
.border-white-5 { border-color: var(--border-white-5); }
.border-white-10 { border-color: var(--border-white-10); }
.bg-surface-dark { background-color: #0b0f19; }

@media (max-width: 640px) {
  .hud-top-bar {
    font-size: 10px;
    padding-left: 1rem;
    padding-right: 1rem;
  }
}
