/* ===== ENHANCED SPACE STATION PORTFOLIO STYLES ===== */

/* ===== PERFORMANCE BASE ===== */
* {
  box-sizing: border-box;
  /* Hardware acceleration */
  transform: translateZ(0);
  backface-visibility: hidden;
}

body {
  margin: 0;
  padding: 0;
  font-family: 'TheGoodMonolith', -apple-system, BlinkMacSystemFont, sans-serif;
  overflow: hidden;
  background: #000;
  width: 100vw;
  height: 100vh;
  /* Mobile optimization */
  -webkit-overflow-scrolling: touch;
  touch-action: none;
  -webkit-text-size-adjust: 100%;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  /* Prevent horizontal scrolling */
  overflow-x: hidden;
}

canvas {
  position: relative;
  z-index: 1;
  display: block;
  touch-action: none;
}

#canvas-container {
  position: relative;
  width: 100vw;
  height: 100vh;
  z-index: 1;
  /* Prevent layout shifts */
  contain: layout;
}

.hidden-initial {
  opacity: 0;
  pointer-events: none;
}

.show-main {
  opacity: 1;
  pointer-events: all;
  transition: opacity 0.8s ease;
}

/* ===== ENHANCED PRELOADER WITH SPACE STATION THEME ===== */
.preloader {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(135deg, #000000 0%, #0a0a1a 50%, #000000 100%);
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  z-index: 10000;
  transition: all 0.8s ease;
  opacity: 1;
  visibility: visible;
  overscroll-behavior: none;
}

.preloader.fade-out {
  opacity: 0;
  visibility: hidden;
  transform: scale(1.02);
}

.preloader-content {
  text-align: center;
  width: 100%;
  max-width: 350px;
  contain: layout;
  padding: 0 20px;
}

/* ===== PORTFOLIO TITLE IN PRELOADER ===== */
.preloader-title {
  font-family: 'TheGoodMonolith', -apple-system, BlinkMacSystemFont, sans-serif;
  font-size: clamp(24px, 6vw, 36px);
  font-weight: 900;
  color: rgba(255, 255, 255, 0.95);
  text-transform: uppercase;
  letter-spacing: clamp(2px, 1vw, 4px);
  text-shadow: 
      0 2px 4px rgba(0, 0, 0, 0.8),
      0 0 20px rgba(255, 255, 255, 0.3),
      0 0 40px rgba(100, 200, 255, 0.2);
  margin: 0 0 8px 0;
  line-height: 1;
  background: linear-gradient(135deg, #ffffff, #a8e6cf, #ffd93d);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  animation: title-glow 2s ease-in-out infinite alternate;
}

.preloader-subtitle {
  font-family: -apple-system, BlinkMacSystemFont, sans-serif;
  font-size: clamp(10px, 2.5vw, 14px);
  font-weight: 600;
  color: rgba(100, 200, 255, 0.8);
  text-transform: uppercase;
  letter-spacing: clamp(1px, 0.5vw, 2px);
  margin: 0 0 clamp(20px, 5vw, 32px) 0;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.8);
}

@keyframes title-glow {
  0% { 
      text-shadow: 
          0 2px 4px rgba(0, 0, 0, 0.8),
          0 0 20px rgba(255, 255, 255, 0.3),
          0 0 40px rgba(100, 200, 255, 0.2);
  }
  100% { 
      text-shadow: 
          0 2px 4px rgba(0, 0, 0, 0.8),
          0 0 30px rgba(255, 255, 255, 0.5),
          0 0 60px rgba(100, 200, 255, 0.4);
  }
}

/* ===== GLOWING PROGRESS BAR CONTAINER ===== */
.loader-container {
  width: min(280px, 85vw);
  height: 6px;
  background: rgba(30, 30, 30, 0.8);
  border-radius: 10px;
  overflow: hidden;
  margin: 0 auto clamp(16px, 4vw, 24px) auto;
  position: relative;
  will-change: transform;
  box-shadow: 
      inset 0 2px 4px rgba(0, 0, 0, 0.6),
      0 0 10px rgba(0, 0, 0, 0.3);
  border: 1px solid rgba(100, 200, 255, 0.2);
}

/* ===== ENHANCED GLOWING PROGRESS BAR ===== */
.loader-bar {
  height: 100%;
  background: linear-gradient(90deg, 
      #00aaff 0%,
      #0088cc 25%,
      #0066aa 50%,
      #004488 75%,
      #002266 100%
  );
  width: 0%;
  border-radius: 10px;
  transition: width 0.3s ease-out;
  position: relative;
  overflow: hidden;
  will-change: width;
  
  /* Main glow effect */
  box-shadow: 
      0 0 20px rgba(0, 170, 255, 0.8),
      0 0 40px rgba(0, 170, 255, 0.6),
      0 0 60px rgba(0, 170, 255, 0.4),
      inset 0 1px 0 rgba(255, 255, 255, 0.3);
  
  /* Animated shimmer effect */
  background-size: 200% 100%;
  animation: progress-glow 2s ease-in-out infinite;
}

.loader-bar::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, 
      transparent, 
      rgba(255, 255, 255, 0.4), 
      transparent
  );
  animation: progress-shimmer 2s ease-in-out infinite;
}

.loader-bar::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(180deg, 
      rgba(255, 255, 255, 0.3) 0%, 
      transparent 50%, 
      rgba(0, 0, 0, 0.1) 100%
  );
  border-radius: 10px;
}

@keyframes progress-glow {
  0%, 100% {
      box-shadow: 
          0 0 20px rgba(0, 170, 255, 0.8),
          0 0 40px rgba(0, 170, 255, 0.6),
          0 0 60px rgba(0, 170, 255, 0.4),
          inset 0 1px 0 rgba(255, 255, 255, 0.3);
  }
  50% {
      box-shadow: 
          0 0 30px rgba(0, 170, 255, 1),
          0 0 60px rgba(0, 170, 255, 0.8),
          0 0 90px rgba(0, 170, 255, 0.6),
          inset 0 1px 0 rgba(255, 255, 255, 0.4);
  }
}

@keyframes progress-shimmer {
  0% {
      left: -100%;
  }
  100% {
      left: 100%;
  }
}

/* ===== LOADING TEXT AND PERCENTAGE ===== */
.loader-text {
  color: rgba(100, 200, 255, 0.9);
  font-size: clamp(11px, 2.5vw, 14px);
  font-weight: 500;
  font-family: -apple-system, BlinkMacSystemFont, sans-serif;
  margin-bottom: clamp(8px, 2vw, 12px);
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.8);
  letter-spacing: 0.5px;
  animation: text-fade 1.5s ease-in-out infinite alternate;
}

.loader-percentage {
  color: rgba(255, 255, 255, 0.95);
  font-size: clamp(18px, 4vw, 24px);
  font-weight: 700;
  font-family: 'TheGoodMonolith', -apple-system, BlinkMacSystemFont, sans-serif;
  margin-top: clamp(12px, 3vw, 16px);
  text-shadow: 
      0 2px 4px rgba(0, 0, 0, 0.8),
      0 0 15px rgba(100, 200, 255, 0.5);
  letter-spacing: 1px;
  animation: percentage-glow 1s ease-in-out infinite alternate;
}

@keyframes text-fade {
  0% { opacity: 0.6; }
  100% { opacity: 1; }
}

@keyframes percentage-glow {
  0% { 
      text-shadow: 
          0 2px 4px rgba(0, 0, 0, 0.8),
          0 0 15px rgba(100, 200, 255, 0.5);
  }
  100% { 
      text-shadow: 
          0 2px 4px rgba(0, 0, 0, 0.8),
          0 0 25px rgba(100, 200, 255, 0.7),
          0 0 35px rgba(0, 170, 255, 0.5);
  }
}

/* ===== ENHANCED STAR ANIMATION ===== */
.space-animation {
  position: absolute;
  width: 100%;
  height: 100%;
  overflow: hidden;
  z-index: 1;
  contain: layout;
}

.star {
  position: absolute;
  width: 1px;
  height: 1px;
  background: rgba(200, 220, 255, 0.6);
  border-radius: 50%;
  animation: star-twinkle 4s infinite linear;
}

.star:nth-child(3n) {
  width: 1.5px;
  height: 1.5px;
  background: rgba(100, 200, 255, 0.7);
  animation: star-twinkle 6s infinite linear;
  box-shadow: 0 0 3px rgba(100, 200, 255, 0.8);
}

.star:nth-child(5n) {
  background: rgba(220, 230, 255, 0.4);
  animation: star-twinkle 8s infinite linear;
  box-shadow: 0 0 2px rgba(220, 230, 255, 0.6);
}

.star:nth-child(7n) {
  width: 2px;
  height: 2px;
  background: rgba(0, 170, 255, 0.8);
  animation: star-twinkle 5s infinite linear;
  box-shadow: 0 0 4px rgba(0, 170, 255, 0.9);
}

@keyframes star-twinkle {
  0%, 100% { opacity: 0.2; transform: scale(1); }
  50% { opacity: 1; transform: scale(1.2); }
}

/* ===== RESTORED ORIGINAL MOBILE OPTIMIZED 3D LABELS ===== */
.model-label {
  position: absolute;
  width: clamp(26px, 5vw, 36px);
  height: clamp(26px, 5vw, 36px);
  border-radius: 50%;
  background: rgba(255, 215, 0, 0.85);
  border: 2px solid rgba(255, 170, 0, 0.9);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: bold;
  font-size: clamp(11px, 2.5vw, 14px);
  font-family: 'TheGoodMonolith', -apple-system, BlinkMacSystemFont, sans-serif;
  color: #1a1a1a;
  cursor: pointer;
  z-index: 90;
  transition: all 0.2s ease;
  box-shadow: 0 0 12px rgba(255, 170, 0, 0.4);
  user-select: none;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
  /* Hardware acceleration */
  will-change: transform;
}

.model-label:active {
  transform: scale(1.1);
  background: rgba(255, 170, 0, 0.95);
  color: white;
  box-shadow: 0 0 20px rgba(255, 170, 0, 0.6);
}

.model-label.active {
  background: rgba(255, 100, 100, 0.9);
  border-color: rgba(255, 68, 68, 0.9);
  box-shadow: 0 0 20px rgba(255, 100, 100, 0.6);
  color: white;
}

/* Simplified pulse animation */
.model-label::before {
  content: '';
  position: absolute;
  width: 100%;
  height: 100%;
  border-radius: 50%;
  background: rgba(255, 170, 0, 0.2);
  animation: simple-pulse 2s infinite;
  z-index: -1;
}

@keyframes simple-pulse {
  0% { transform: scale(1); opacity: 0.8; }
  100% { transform: scale(1.6); opacity: 0; }
}

/* ===== ANNOTATION POINTS - RESTORED ORIGINAL ===== */
.annotation-point {
  position: absolute;
  width: clamp(24px, 4.5vw, 32px);
  height: clamp(24px, 4.5vw, 32px);
  border-radius: 50%;
  background: rgba(255, 215, 0, 0.85);
  border: 2px solid rgba(255, 170, 0, 0.9);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: bold;
  font-size: clamp(10px, 2vw, 12px);
  font-family: 'TheGoodMonolith', -apple-system, BlinkMacSystemFont, sans-serif;
  color: #1a1a1a;
  cursor: pointer;
  z-index: 100;
  transition: all 0.2s ease;
  box-shadow: 0 0 10px rgba(255, 170, 0, 0.4);
  user-select: none;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
  /* Hardware acceleration */
  will-change: transform;
}

.annotation-point:active {
  transform: scale(1.1);
  background: rgba(255, 170, 0, 0.95);
  color: white;
  box-shadow: 0 0 16px rgba(255, 170, 0, 0.6);
}

.annotation-point.active {
  background: rgba(255, 100, 100, 0.9);
  border-color: rgba(255, 68, 68, 0.9);
  box-shadow: 0 0 16px rgba(255, 100, 100, 0.6);
  color: white;
}

.annotation-point::before {
  content: '';
  position: absolute;
  width: 100%;
  height: 100%;
  border-radius: 50%;
  background: rgba(255, 170, 0, 0.2);
  animation: simple-pulse 1.8s infinite;
  z-index: -1;
}

/* ===== OPTIMIZED MODAL - RESTORED ORIGINAL STYLING ===== */
.info-modal {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background: rgba(10, 15, 25, 0.95);
  border: 2px solid rgba(255, 255, 255, 0.25);
  border-radius: 16px;
  padding: clamp(12px, 3vw, 24px);
  max-width: min(92vw, 700px);
  width: 92vw;
  max-height: 88vh;
  color: rgba(255, 255, 255, 0.95);
  z-index: 10001;
  display: none;
  /* Optimized backdrop filter */
  backdrop-filter: blur(12px) saturate(1.2);
  -webkit-backdrop-filter: blur(12px) saturate(1.2);
  box-shadow: 
      0 12px 40px rgba(0, 0, 0, 0.6),
      0 4px 16px rgba(255, 255, 255, 0.08),
      inset 0 1px 0 rgba(255, 255, 255, 0.15);
  overflow-y: auto;
  transition: all 0.3s ease;
  /* Mobile scroll optimization */
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
  /* Hardware acceleration */
  will-change: transform, opacity;
}

.info-modal.active {
  display: block;
  animation: modal-show 0.3s ease;
}

@keyframes modal-show {
  from { 
      opacity: 0; 
      transform: translate(-50%, -45%) scale(0.95);
  }
  to { 
      opacity: 1; 
      transform: translate(-50%, -50%) scale(1);
  }
}

.modal-backdrop {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.4);
  z-index: 9998;
  display: none;
  /* Prevent mobile bounce scrolling */
  overscroll-behavior: none;
}

.modal-backdrop.active {
  display: block;
  animation: backdrop-show 0.2s ease;
}

@keyframes backdrop-show {
  from { opacity: 0; }
  to { opacity: 1; }
}

/* ===== MODAL CONTENT (RESTORED ORIGINAL) ===== */
.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: clamp(12px, 3vw, 20px);
  border-bottom: 1px solid rgba(255, 255, 255, 0.15);
  padding-bottom: clamp(8px, 2vw, 16px);
  gap: 12px;
}

.modal-title {
  font-size: clamp(16px, 4vw, 24px);
  font-weight: 700;
  color: #ffffff;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.5);
  letter-spacing: -0.3px;
  flex: 1;
  font-family: 'TheGoodMonolith', -apple-system, BlinkMacSystemFont, sans-serif;
  text-transform: uppercase;
  line-height: 1.2;
}

.close-btn {
  background: rgba(255, 60, 60, 0.9);
  border: 2px solid rgba(255, 100, 100, 0.8);
  color: white;
  font-size: clamp(16px, 3vw, 20px);
  cursor: pointer;
  padding: clamp(6px, 1.5vw, 8px);
  width: clamp(32px, 7vw, 44px);
  height: clamp(32px, 7vw, 44px);
  border-radius: 50%;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  /* Mobile touch optimization */
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
  box-shadow: 
      0 3px 12px rgba(255, 60, 60, 0.4),
      inset 0 1px 0 rgba(255, 255, 255, 0.2);
  flex-shrink: 0;
  /* Hardware acceleration */
  will-change: transform;
}

.close-btn:hover {
  background: rgba(255, 80, 80, 0.95);
  transform: scale(1.05);
  box-shadow: 
      0 4px 16px rgba(255, 60, 60, 0.6),
      inset 0 1px 0 rgba(255, 255, 255, 0.3);
}

.close-btn:active {
  transform: scale(0.95);
}

.modal-main {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: clamp(16px, 3vw, 24px);
  align-items: start;
}

@media (max-width: 768px) {
  .modal-main {
    grid-template-columns: 1fr;
    gap: clamp(12px, 2.5vw, 16px);
  }
}

.modal-image {
  border-radius: 12px;
  overflow: hidden;
  background: rgba(0, 0, 0, 0.2);
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.modal-image img {
  width: 100%;
  height: auto;
  display: block;
  transition: transform 0.3s ease;
}

.modal-image img:hover {
  transform: scale(1.02);
}

.modal-details {
  display: flex;
  flex-direction: column;
  gap: clamp(12px, 2.5vw, 18px);
}

.project-description {
  font-size: clamp(13px, 2.8vw, 15px);
  line-height: 1.6;
  color: rgba(255, 255, 255, 0.85);
  text-align: justify;
}

.tech-stack {
  display: flex;
  flex-wrap: wrap;
  gap: clamp(6px, 1.2vw, 8px);
  margin-bottom: clamp(8px, 1.5vw, 12px);
}

.tech-tag {
  background: rgba(255, 255, 255, 0.1);
  color: rgba(255, 255, 255, 0.9);
  padding: clamp(4px, 0.8vw, 6px) clamp(8px, 1.5vw, 12px);
  border-radius: 16px;
  font-size: clamp(10px, 2vw, 12px);
  font-weight: 500;
  border: 1px solid rgba(255, 255, 255, 0.2);
  transition: all 0.2s ease;
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
}

.tech-tag:hover {
  background: rgba(255, 255, 255, 0.15);
  transform: translateY(-1px);
  box-shadow: 0 2px 8px rgba(255, 255, 255, 0.1);
}

.project-links {
  display: flex;
  flex-direction: column;
  gap: clamp(8px, 1.5vw, 12px);
}

.project-links h4 {
  font-size: clamp(12px, 2.2vw, 14px);
  color: rgba(255, 255, 255, 0.8);
  margin: 0;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  font-weight: 600;
}

.links-grid {
  display: flex;
  flex-direction: column;
  gap: clamp(6px, 1.2vw, 8px);
}

.project-link {
  display: flex;
  align-items: center;
  gap: clamp(8px, 1.5vw, 12px);
  padding: clamp(8px, 1.5vw, 12px) clamp(12px, 2vw, 16px);
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 8px;
  color: rgba(255, 255, 255, 0.9);
  text-decoration: none;
  transition: all 0.3s ease;
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
}

.project-link:hover {
  background: rgba(255, 255, 255, 0.12);
  transform: translateY(-1px);
  box-shadow: 0 3px 12px rgba(255, 255, 255, 0.1);
  border-color: rgba(255, 255, 255, 0.25);
}

.link-icon {
  font-size: clamp(14px, 2.5vw, 16px);
  flex-shrink: 0;
}

.link-text {
  font-size: clamp(12px, 2.2vw, 14px);
  font-weight: 500;
  flex: 1;
}

/* ===== IMAGE LIGHTBOX ===== */
.image-lightbox {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 20000;
  display: none;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.image-lightbox.active {
  display: flex;
  opacity: 1;
}

.lightbox-backdrop {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.9);
  cursor: pointer;
}

.lightbox-container {
  position: relative;
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: clamp(20px, 4vw, 40px);
}

.lightbox-image {
  max-width: 90%;
  max-height: 90%;
  object-fit: contain;
  border-radius: 8px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.8);
  animation: lightbox-zoom-in 0.3s ease;
}

@keyframes lightbox-zoom-in {
  from {
    transform: scale(0.8);
    opacity: 0;
  }
  to {
    transform: scale(1);
    opacity: 1;
  }
}

.lightbox-close {
  position: absolute;
  top: clamp(20px, 4vw, 40px);
  right: clamp(20px, 4vw, 40px);
  background: rgba(255, 60, 60, 0.9);
  border: 2px solid rgba(255, 100, 100, 0.8);
  color: white;
  font-size: clamp(20px, 4vw, 28px);
  cursor: pointer;
  padding: clamp(8px, 2vw, 12px);
  width: clamp(40px, 8vw, 56px);
  height: clamp(40px, 8vw, 56px);
  border-radius: 50%;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
  box-shadow: 0 4px 15px rgba(255, 60, 60, 0.4);
}

.lightbox-close:hover {
  background: rgba(255, 80, 80, 0.95);
  transform: scale(1.05);
}

.lightbox-caption {
  position: absolute;
  bottom: clamp(20px, 4vw, 40px);
  left: 50%;
  transform: translateX(-50%);
  background: rgba(0, 0, 0, 0.8);
  color: white;
  padding: clamp(8px, 2vw, 12px) clamp(16px, 3vw, 24px);
  border-radius: 8px;
  font-size: clamp(14px, 2.5vw, 16px);
  max-width: 80%;
  text-align: center;
  backdrop-filter: blur(10px);
}

/* ===== MOBILE OPTIMIZATIONS ===== */
@media (max-width: 480px) {
  .mission-modal {
    max-width: 96vw;
    width: 96vw;
    padding: clamp(12px, 3vw, 20px);
    max-height: 95vh;
  }
  
  .modal-header {
    flex-direction: column;
    align-items: stretch;
    gap: 12px;
  }
  
  .close-btn {
    align-self: flex-end;
  }
  
  .tech-stack {
    gap: 6px;
  }
  
  .links-grid {
    gap: 8px;
  }
}

/* ===== DESKTOP OPTIMIZATIONS ===== */
@media (min-width: 769px) {
  .model-label {
    width: clamp(36px, 4.5vw, 44px);
    height: clamp(36px, 4.5vw, 44px);
    font-size: clamp(14px, 2.8vw, 16px);
  }
  
  .annotation-point {
    width: clamp(32px, 4vw, 40px);
    height: clamp(32px, 4vw, 40px);
    font-size: clamp(12px, 2.4vw, 14px);
  }
  
  /* Re-enable hover effects on desktop */
  .model-label:hover {
    transform: scale(1.15);
    background: rgba(0, 200, 255, 0.95);
    box-shadow: 0 0 30px rgba(0, 170, 255, 0.8);
  }
  
  .annotation-point:hover {
    transform: scale(1.15);
    background: rgba(255, 200, 0, 0.95);
    box-shadow: 0 0 25px rgba(255, 200, 0, 0.8);
  }
}

/* ===== LANDSCAPE MOBILE OPTIMIZATION ===== */
@media (max-height: 500px) and (orientation: landscape) {
  .model-label {
    width: clamp(24px, 4.5vw, 32px);
    height: clamp(24px, 4.5vw, 32px);
    font-size: clamp(10px, 2.2vw, 13px);
  }
  
  .annotation-point {
    width: clamp(22px, 4vw, 28px);
    height: clamp(22px, 4vw, 28px);
    font-size: clamp(9px, 2vw, 11px);
  }
  
  .mission-modal {
    max-height: 95vh;
    padding: clamp(8px, 2vw, 16px);
  }
}

/* ===== TOUCH DEVICE OPTIMIZATIONS ===== */
@media (hover: none) and (pointer: coarse) {
  .model-label:hover,
  .annotation-point:hover,
  .tech-tag:hover,
  .mission-link:hover {
    transform: none;
    background: inherit;
    box-shadow: inherit;
  }
}

/* ===== PERFORMANCE OPTIMIZATIONS ===== */
@media (prefers-reduced-motion: reduce) {
  * {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.1s !important;
  }
  
  .loader-bar,
  .preloader-title,
  .loader-percentage,
  .loader-text,
  .star {
    animation: none !important;
  }
}

/* Prevent iOS zoom on input focus */
@media screen and (max-width: 768px) {
  input, select, textarea, button {
    font-size: 16px !important;
  }
}

/* Memory optimization: reset will-change after animations */
.mission-modal:not(.active) {
  will-change: auto;
}

.model-label:not(:active):not(.active),
.annotation-point:not(:active):not(.active) {
  will-change: auto;
}