/* =========================================================
   MCO WebLab - Futuristic Motion & UI/UX Design System
   Based on Awwwards & Linear Cybernetic Design Standards
   ========================================================= */

:root {
  --accent-cyan: #00F0FF;
  --accent-blue: #3B82F6;
  --accent-purple: #A855F7;
  --accent-violet: #7000FF;
  
  --accent-glow-cyan: rgba(0, 240, 255, 0.25);
  --accent-glow-purple: rgba(168, 85, 247, 0.25);
  --accent-glow-strong: rgba(0, 240, 255, 0.6);
  
  --bg-deep: #05070B;
}

/* =========================================================
   1. FIXED DYNAMIC BACKGROUND SYSTEM (From futuristic-ui-demo)
   ========================================================= */

/* Interactive 3D Particle Mesh Canvas */
#bgCanvas {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  z-index: 0;
  pointer-events: none;
}

/* Ambient Floating Glowing Blobs */
.ambient-glow {
  position: fixed;
  border-radius: 50%;
  filter: blur(120px);
  pointer-events: none;
  z-index: 1;
  opacity: 0.38;
  animation: float-glow 16s infinite ease-in-out alternate;
  will-change: transform;
}

.glow-1 {
  width: 520px;
  height: 520px;
  background: var(--accent-cyan);
  top: -120px;
  left: -120px;
}

.glow-2 {
  width: 620px;
  height: 620px;
  background: var(--accent-violet);
  bottom: -150px;
  right: -140px;
  animation-delay: -8s;
}

.glow-3 {
  width: 380px;
  height: 380px;
  background: var(--accent-blue);
  top: 45%;
  left: 50%;
  transform: translate(-50%, -50%);
  opacity: 0.18;
  animation-delay: -4s;
}

@keyframes float-glow {
  0% { transform: scale(1) translate(0, 0); }
  50% { transform: scale(1.18) translate(35px, 25px); }
  100% { transform: scale(0.95) translate(-25px, 40px); }
}

/* Film Grain Texture Overlay for Tactile Cinematic Depth */
.noise-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-image: 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.8' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noiseFilter)' opacity='0.035'/%3E%3C/svg%3E");
  pointer-events: none;
  z-index: 2;
}

/* Interactive Cursor Spotlight Follower */
.cursor-spotlight {
  position: fixed;
  width: 550px;
  height: 550px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(0, 240, 255, 0.16) 0%, rgba(168, 85, 247, 0.08) 35%, rgba(0, 0, 0, 0) 70%);
  pointer-events: none;
  transform: translate(-50%, -50%);
  z-index: 3;
  opacity: 0.65;
  transition: opacity 0.3s ease;
  will-change: left, top;
}

/* Ensure document flow layers appear on top of background system */
main, footer, header, .app-wrapper {
  position: relative;
  z-index: 10;
}

/* =========================================================
   1.5. FLOATING DYNAMIC GLASSMORPHISM PILL ISLAND HEADER
   ========================================================= */

.header-nav-wrapper {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  width: 100%;
  z-index: 50;
  padding: 18px 0;
  pointer-events: none;
  transition: padding 0.4s cubic-bezier(0.16, 1, 0.3, 1), transform 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

.navbar-island {
  pointer-events: auto;
  margin: 0 auto;
  width: 100%;
  max-width: 80rem; /* 1280px / 7xl */
  padding: 0 1.5rem;
  border-radius: 9999px;
  background: transparent;
  border: 1px solid transparent;
  box-shadow: none;
  backdrop-filter: blur(0px);
  -webkit-backdrop-filter: blur(0px);
  transition: max-width 0.45s cubic-bezier(0.16, 1, 0.3, 1),
              padding 0.4s cubic-bezier(0.16, 1, 0.3, 1),
              background 0.4s cubic-bezier(0.16, 1, 0.3, 1),
              border-color 0.4s cubic-bezier(0.16, 1, 0.3, 1),
              box-shadow 0.4s cubic-bezier(0.16, 1, 0.3, 1),
              backdrop-filter 0.4s cubic-bezier(0.16, 1, 0.3, 1),
              transform 0.4s cubic-bezier(0.16, 1, 0.3, 1);
  will-change: max-width, padding, background, border-color, box-shadow;
}

/* Scrolled state: Morph smoothly into a Glassmorphism Pill Island */
.header-nav-wrapper.is-scrolled {
  padding: 12px 0;
}

.header-nav-wrapper.is-scrolled .navbar-island {
  max-width: 66rem; /* 1056px sleek pill */
  padding: 8px 24px;
  background: rgba(9, 13, 26, 0.78);
  backdrop-filter: blur(20px) saturate(180%);
  -webkit-backdrop-filter: blur(20px) saturate(180%);
  border: 1px solid rgba(255, 255, 255, 0.14);
  box-shadow: 0 16px 40px -10px rgba(0, 0, 0, 0.8),
              0 0 25px rgba(59, 130, 246, 0.16),
              inset 0 1px 0 rgba(255, 255, 255, 0.18);
  transform: translateY(2px);
}

@media (hover: hover) {
  .header-nav-wrapper.is-scrolled .navbar-island:hover {
    border-color: rgba(0, 240, 255, 0.35);
    box-shadow: 0 20px 48px -8px rgba(0, 0, 0, 0.9),
                0 0 32px rgba(0, 240, 255, 0.22),
                inset 0 1px 0 rgba(255, 255, 255, 0.25);
  }
}

/* Responsive logo scaling inside island */
.navbar-island .nav-logo-img {
  height: 52px;
  transition: height 0.4s cubic-bezier(0.16, 1, 0.3, 1), transform 0.3s ease;
}

@media (min-width: 640px) {
  .navbar-island .nav-logo-img {
    height: 56px;
  }
}

@media (min-width: 1024px) {
  .navbar-island .nav-logo-img {
    height: 68px;
  }
}

.header-nav-wrapper.is-scrolled .navbar-island .nav-logo-img {
  height: 38px !important;
}

@media (min-width: 1024px) {
  .header-nav-wrapper.is-scrolled .navbar-island .nav-logo-img {
    height: 44px !important;
  }
}

/* Condensed CTA inside scrolled pill */
.header-nav-wrapper.is-scrolled .nav-cta-btn {
  padding-top: 0.5rem;
  padding-bottom: 0.5rem;
  padding-left: 1.15rem;
  padding-right: 1.15rem;
  font-size: 0.8125rem;
}

/* Mobile glassmorphism pill island */
@media (max-width: 768px) {
  .header-nav-wrapper {
    padding: 12px 0;
  }

  .navbar-island {
    padding: 0 1.25rem;
  }

  .header-nav-wrapper.is-scrolled {
    padding: 8px 0;
  }

  .header-nav-wrapper.is-scrolled .navbar-island {
    max-width: calc(100% - 1.5rem);
    margin: 0 auto;
    padding: 6px 14px;
    background: rgba(9, 13, 26, 0.88);
  }

  .header-nav-wrapper.is-scrolled .navbar-island .nav-logo-img {
    height: 36px !important;
  }
}

/* =========================================================
   2. RAY-TRACED SPOTLIGHT BORDERS
   ========================================================= */

.spotlight-card, .glass-panel {
  position: relative;
}

@media (hover: hover) {
  .spotlight-card::before, .glass-panel::before {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: inherit;
    padding: 1.5px;
    background: radial-gradient(
      320px circle at var(--mouse-x, -999px) var(--mouse-y, -999px),
      rgba(0, 240, 255, 0.45),
      rgba(168, 85, 247, 0.2) 35%,
      transparent 70%
    );
    -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    -webkit-mask-composite: xor;
    mask-composite: exclude;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    z-index: 2;
  }

  .spotlight-card:hover::before, .glass-panel:hover::before {
    opacity: 1;
  }
}

/* =========================================================
   3. MAGNETIC BUTTON PHYSICS
   ========================================================= */

.magnetic-btn {
  will-change: transform;
  transition: transform 0.2s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.3s ease;
  transform-style: preserve-3d;
}

.magnetic-btn:active {
  transform: scale(0.96) !important;
}

/* =========================================================
   4. 3D PERSPECTIVE TILT WITH DYNAMIC GLARE
   ========================================================= */

.tilt-card {
  transition: transform 0.2s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.3s ease;
  transform-style: preserve-3d;
  will-change: transform;
  position: relative;
}

.card-glare {
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: radial-gradient(
    400px circle at var(--glare-x, 50%) var(--glare-y, 50%),
    rgba(255, 255, 255, 0.12),
    transparent 60%
  );
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.3s ease;
  z-index: 3;
}

.tilt-card:hover .card-glare {
  opacity: 1;
}

/* =========================================================
   5. MASK-REVEAL TYPOGRAPHY
   ========================================================= */

.mask-wrap {
  overflow: hidden;
  display: inline-block;
  vertical-align: bottom;
}

.mask-text {
  display: inline-block;
  transform: translateY(110%);
  transition: transform 0.85s cubic-bezier(0.16, 1, 0.3, 1);
  will-change: transform;
}

.is-inview .mask-text,
.sr-visible .mask-text {
  transform: translateY(0%);
}

/* =========================================================
   6. INFINITE CLIENT MARQUEE TRACK
   ========================================================= */

.marquee-container {
  overflow: hidden;
  white-space: nowrap;
  position: relative;
  mask-image: linear-gradient(to right, transparent 0%, black 10%, black 90%, transparent 100%);
  -webkit-mask-image: linear-gradient(to right, transparent 0%, black 10%, black 90%, transparent 100%);
}

.marquee-track {
  display: inline-flex;
  gap: 24px;
  animation: marquee-slide 30s linear infinite;
  will-change: transform;
}

.marquee-container:hover .marquee-track {
  animation-play-state: paused;
}

@keyframes marquee-slide {
  from { transform: translateX(0); }
  to { transform: translateX(-50%); }
}

/* =========================================================
   7. ACCESSIBILITY & MOBILE REFINEMENTS
   ========================================================= */

@media (max-width: 768px) {
  .cursor-spotlight {
    display: none !important;
  }
  .ambient-glow {
    opacity: 0.28;
    filter: blur(80px);
  }
}

/* =========================================================
   3D COVER FLOW STAGE (Left / Center / Right Depth System)
   ========================================================= */
.deck-3d-wrapper {
  perspective: 1000px;
  -webkit-perspective: 1000px;
  perspective-origin: center center;
  -webkit-perspective-origin: center center;
  position: relative;
  width: 100%;
  max-width: 100%;
  min-height: 480px;
  padding: 16px 0 10px 0;
  touch-action: pan-y;
  overflow: hidden;
  -webkit-mask-image: linear-gradient(to right, transparent 0%, black 10px, black calc(100% - 10px), transparent 100%);
  mask-image: linear-gradient(to right, transparent 0%, black 10px, black calc(100% - 10px), transparent 100%);
}

.deck-3d-card {
  position: absolute !important;
  top: 12px;
  left: 0;
  right: 0;
  margin: 0 auto;
  width: calc(100% - 72px) !important;
  max-width: 320px !important;
  transform-style: preserve-3d;
  -webkit-transform-style: preserve-3d;
  transition: transform 0.5s cubic-bezier(0.16, 1, 0.3, 1), 
              opacity 0.4s cubic-bezier(0.16, 1, 0.3, 1), 
              filter 0.4s ease,
              box-shadow 0.4s ease;
  will-change: transform, opacity;
  user-select: none;
  -webkit-user-select: none;
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
}

/* Active Center Card */
.deck-3d-card.is-active {
  z-index: 30;
  opacity: 1;
  pointer-events: auto;
  transform: translate3d(0, 0, 0) scale(1) rotateY(0deg);
  box-shadow: 0 25px 60px rgba(0, 0, 0, 0.9), 0 0 35px rgba(99, 102, 241, 0.35);
  filter: none;
  cursor: default;
}

/* Left Card (Previous option in back to the left, reaching screen edge) */
.deck-3d-card.is-left-peek {
  z-index: 20;
  opacity: 0.78;
  pointer-events: auto;
  cursor: pointer;
  transform: translate3d(-64%, 0, -65px) scale(0.88) rotateY(18deg);
  box-shadow: -15px 20px 45px rgba(0, 0, 0, 0.85);
  filter: brightness(0.8) saturate(0.9);
}

.deck-3d-card.is-left-peek:hover,
.deck-3d-card.is-left-peek:active {
  opacity: 0.95;
  filter: brightness(0.95) saturate(1);
}

/* Right Card (Next option in back to the right, reaching screen edge) */
.deck-3d-card.is-right-peek {
  z-index: 20;
  opacity: 0.78;
  pointer-events: auto;
  cursor: pointer;
  transform: translate3d(64%, 0, -65px) scale(0.88) rotateY(-18deg);
  box-shadow: 15px 20px 45px rgba(0, 0, 0, 0.85);
  filter: brightness(0.8) saturate(0.9);
}

.deck-3d-card.is-right-peek:hover,
.deck-3d-card.is-right-peek:active {
  opacity: 0.95;
  filter: brightness(0.95) saturate(1);
}

/* Hidden cards behind in depth */
.deck-3d-card.is-hidden-far {
  z-index: 5;
  opacity: 0;
  pointer-events: none;
  transform: translate3d(0, 0, -220px) scale(0.65) rotateY(0deg);
  filter: brightness(0.3);
}

/* Visual cues for peek cards */
.deck-3d-card .peek-cue {
  display: none !important;
}

.deck-3d-card.is-left-peek .peek-cue-left {
  display: flex !important;
}

.deck-3d-card.is-right-peek .peek-cue-right {
  display: flex !important;
}

.deck-3d-card.is-active .peek-cue {
  display: none !important;
}

/* =========================================================
   FUTURISTIC MOBILE CYBER DRAWER (120Hz Floating Island Capsule)
   ========================================================= */
#mobile-menu-drawer {
  position: fixed;
  top: 12px;
  right: 12px;
  bottom: 12px;
  width: calc(100% - 24px);
  max-width: 330px;
  height: calc(100% - 24px);
  max-height: calc(100dvh - 24px);
  border-radius: 28px;
  background: rgba(8, 11, 24, 0.94);
  backdrop-filter: blur(28px) saturate(190%);
  -webkit-backdrop-filter: blur(28px) saturate(190%);
  border: 1px solid rgba(255, 255, 255, 0.14);
  box-shadow: -15px 0 50px rgba(0, 0, 0, 0.85), 0 0 35px rgba(99, 102, 241, 0.2);
  transform: translate3d(115%, 0, 0);
  transition: transform 0.42s cubic-bezier(0.16, 1, 0.3, 1), 
              opacity 0.3s ease;
  will-change: transform;
  z-index: 60;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

#mobile-menu-drawer.is-open {
  transform: translate3d(0, 0, 0);
}

.mobile-nav-tile {
  transform: translate3d(30px, 0, 0);
  opacity: 0;
  transition: transform 0.45s cubic-bezier(0.16, 1, 0.3, 1), 
              opacity 0.4s ease, 
              background 0.25s ease, 
              border-color 0.25s ease;
  will-change: transform, opacity;
}

#mobile-menu-drawer.is-open .mobile-nav-tile {
  transform: translate3d(0, 0, 0);
  opacity: 1;
}

/* Kinetic Orbital Rotations for Cyber Reactor Logos */
@keyframes spinSlow {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

@keyframes spinReverse {
  from { transform: rotate(360deg); }
  to { transform: rotate(0deg); }
}

.animate-spin-slow {
  animation: spinSlow 22s linear infinite;
}

.animate-spin-reverse {
  animation: spinReverse 28s linear infinite;
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
  #bgCanvas {
    display: none !important;
  }
  .ambient-glow {
    animation: none !important;
  }
  .marquee-track {
    animation: none !important;
  }
  .deck-3d-card {
    transition: none !important;
  }
  #mobile-menu-drawer {
    transition: none !important;
  }
  .mobile-nav-tile {
    transition: none !important;
    transform: none !important;
    opacity: 1 !important;
  }
}
