/* --- MIU-33 GLOBAL SYSTEM OVERRIDE V.033 // FINAL_MOBILE_SOVEREIGN --- */

:root {
  --emerald: #00FF41;
  --gold: #C9A46A;
  --obsidian: #080808;
  --concrete: #1a1a1a;
  --font-header: 'Russo One', sans-serif;
  --font-tech: 'Orbitron', monospace;
  --ease-luxury: cubic-bezier(0.4, 0, 0.2, 1);
  --ease-ballistic: cubic-bezier(0.19, 1, 0.22, 1);
  --glow-emerald-soft: 0 0 15px rgba(0, 255, 65, 0.4);
}

/* HERO VIDEO CALIBRATION + iOS FIX */
.video-container {
  position: relative;
  width: 100%;
  height: 100vh;
  overflow: hidden;
}

.video-container video {
  position: absolute;
  top: 50%;
  left: 50%;
  min-width: 100%;
  min-height: 100%;
  width: auto;
  height: auto;
  transform: translate(-50%, -50%);
  z-index: 0;
  object-fit: cover;
  -webkit-transform: translateZ(0);
  will-change: transform;
}

/* VAPI HUD */
#vapi-status {
  text-shadow: 0 0 10px var(--emerald);
  letter-spacing: 0.2em;
  background: rgba(0, 255, 65, 0.05);
  padding: 4px 8px;
  border-right: 2px solid var(--emerald);
  pointer-events: auto;
  touch-action: manipulation;
}

/* VIDEO MASK OVERLAY */
.video-container::after { content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(to bottom,
    rgba(8, 8, 8, 0.8) 0%,
    transparent 20%,
    transparent 80%,
    var(--obsidian) 100%);
  z-index: 10;
  pointer-events: none;
}

/* MOBILE SCROLL RESCUE */
@media (pointer: coarse) {
  html {
    scroll-behavior: auto !important;
    -webkit-overflow-scrolling: touch !important;
    touch-action: pan-y !important;
  }
  
  body {
    overflow-y: scroll !important;
    -webkit-overflow-scrolling: touch !important;
    touch-action: pan-y !important;
    position: relative !important;
    height: auto !important;
    transform: none !important;
  }
  
  #matrix {
    pointer-events: none !important;
    user-select: none !important;
    -webkit-user-select: none !important;
    touch-action: none !important;
    opacity: 0.15 !important; /* VISIBLE ON MOBILE */
  }
  
  #intro-sequence {
    pointer-events: none !important;
  }
  
  .dragon-scale {
    touch-action: pan-y !important;
  }
  
  .video-container,
  video[data-src],
  #hero-video {
    touch-action: pan-y !important;
    pointer-events: auto; }
  
  nav a {
    touch-action: manipulation !important;
    -webkit-tap-highlight-color: transparent;
  }
}

/* DESKTOP LENIS COMPATIBILITY */
@media (pointer: fine) {
  html {
    scroll-behavior: auto;
  }
  body {
    overflow-y: auto;
  }
  #matrix {
    pointer-events: none;
    opacity: 0.12;
  }
}

/* CORE SYSTEM */
html { 
  background-color: var(--obsidian); 
  color-scheme: dark; 
  text-size-adjust: 100%;
  -webkit-text-size-adjust: 100%;
}

body { 
  background-color: var(--obsidian); 
  color: #a4a4a4; 
  overflow-x: hidden; 
  font-family: var(--font-tech);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* HERO VIDEO PERSISTENCE */
#hero-video {
  contain: layout style paint;
  will-change: transform;
  -webkit-transform: translateZ(0);
  transform: translateZ(0);
}

/* TRACER ANIMATION */
.tracer {
  position: absolute; width: 2px; height: 100px; background: linear-gradient(to bottom, transparent, var(--emerald), transparent);
  opacity: 0; pointer-events: none; will-change: transform, opacity;
  animation: fireTracer 1.2s var(--ease-ballistic) forwards;
}

@keyframes fireTracer {
  0% { transform: translateY(-200px) scaleY(0); opacity: 0; }
  20% { opacity: 1; transform: translateY(-100px) scaleY(1.5); }
  100% { transform: translateY(100vh) scaleY(0.1); opacity: 0; }
}

/* DRAGON-SCALE */
.dragon-scale {
  filter: grayscale(1) contrast(1.2) brightness(0.8);
  transition: all 0.8s var(--ease-luxury);
  touch-action: pan-y;
}
.dragon-scale:hover { filter: grayscale(0) contrast(1) brightness(1); }

/* ARTIFACT CARDS */
.artifact-card {
  background: var(--concrete);
  border: 1px solid rgba(255, 255, 255, 0.05);
  transition: all 0.5s var(--ease-luxury);
}
.artifact-card:hover { border-color: var(--emerald); transform: translateY(-5px); }

/* MATRIX OVERLAY */
#matrix { 
  position: fixed; 
  inset: 0; 
  z-index: -1; 
  opacity: 0.12; 
  pointer-events: none;
}

/* RESPONSIVE */
@media (max-width: 768px) {
  h1 { font-size: 3.5rem !important; }
  .video-container video { opacity: 0.4; }
  
  button, a, [onclick] {
    min-height: 44px;
    min-width: 44px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
  }
}
/* REDUCED MOTION */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
  #matrix {
    opacity: 0.02 !important;
    display: none !important;
  }
  .tracer {
    display: none !important;
  }
}