/* ==========================================================================
   THE MISCREANT STUDIOS - GAMES SHOWCASE & MACOS GLASSMORPHIC ECOSYSTEM
   Live Service, Running Operations, Deep Void Nebula Rising, Endless Runner
   ========================================================================== */

/* --------------------------------------------------------------------------
   0. LENIS ULTRA-SMOOTH INERTIAL SCROLL & PROGRESS BAR
   -------------------------------------------------------------------------- */
html.lenis, html.lenis body {
  height: auto;
}
.lenis.lenis-smooth {
  scroll-behavior: auto !important;
}
.lenis.lenis-smooth [data-lenis-prevent] {
  overscroll-behavior: contain;
}
.lenis.lenis-scrolling iframe {
  pointer-events: none;
}

/* Neon Top Scroll Progress Indicator */
.scroll-progress-bar {
  position: fixed;
  top: 0;
  left: 0;
  width: 0%;
  height: 3px;
  background: linear-gradient(90deg, #8b5cf6, #c084fc, #06b6d4, #a855f7);
  background-size: 200% 100%;
  animation: progress-gradient-shift 4s ease infinite;
  box-shadow: 0 0 14px rgba(168, 85, 247, 0.8), 0 0 28px rgba(6, 182, 212, 0.4);
  z-index: 1000;
  pointer-events: none;
  transition: width 0.05s ease-out;
}

@keyframes progress-gradient-shift {
  0% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
  100% { background-position: 0% 50%; }
}

/* Hero Parallax Transition Layers */
.hero-content {
  transition: transform 0.1s ease-out, opacity 0.1s ease-out, filter 0.1s ease-out;
  will-change: transform, opacity, filter;
}

.hero-foreground-layer {
  transition: transform 0.1s ease-out, opacity 0.1s ease-out;
  will-change: transform;
}

/* --------------------------------------------------------------------------
   1. SECTION CONTAINER & BACKDROP TRANSITION
   -------------------------------------------------------------------------- */
.showcase-section {
  position: relative;
  z-index: 20;
  height: 100vh;
  min-height: 100vh;
  max-height: 100vh;
  padding: 0;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  align-items: center;
  background: 
    /* 1. Fine Dot-Matrix Points (Light shade grill dots) */
    radial-gradient(circle at 1px 1px, rgba(192, 132, 252, 0.16) 1.2px, transparent 1.6px),
    /* 2. Fine Horizontal Grill Lines */
    linear-gradient(rgba(139, 92, 246, 0.045) 1px, transparent 1px),
    /* 3. Fine Vertical Grill Lines */
    linear-gradient(90deg, rgba(139, 92, 246, 0.045) 1px, transparent 1px),
    /* 4. Left Corner Ambient Spotlight */
    radial-gradient(circle at 12% 20%, rgba(139, 92, 246, 0.18) 0%, rgba(6, 182, 212, 0.06) 32%, transparent 60%),
    /* 5. Right Corner Ambient Spotlight */
    radial-gradient(circle at 88% 20%, rgba(192, 132, 252, 0.16) 0%, rgba(139, 92, 246, 0.05) 32%, transparent 60%),
    /* 6. Base Deep Studio Gradient */
    linear-gradient(180deg, 
      transparent 0%, 
      rgba(7, 5, 18, 0.6) 10%, 
      rgba(8, 6, 20, 0.94) 25%, 
      rgba(6, 4, 16, 0.99) 50%, 
      #060410 100%);
  background-size: 
    48px 48px,
    48px 48px,
    48px 48px,
    100% 100%,
    100% 100%,
    100% 100%;
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  border-top: none;
  overflow: hidden;
  box-sizing: border-box;
}

.showcase-section .app-container {
  height: 100%;
  width: 100%;
  max-height: 100vh;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  align-items: center;
  padding-top: clamp(28px, 4.5vh, 48px);
  padding-bottom: clamp(28px, 4.5vh, 48px);
  box-sizing: border-box;
}

/* Ambient Radial Glow Spots in Background */
.showcase-section::before {
  content: '';
  position: absolute;
  top: 12%;
  left: 50%;
  transform: translateX(-50%);
  width: 1200px;
  height: 650px;
  background: radial-gradient(circle, rgba(139, 92, 246, 0.14) 0%, rgba(6, 182, 212, 0.06) 50%, transparent 75%);
  pointer-events: none;
  z-index: 0;
}

.showcase-section::after {
  content: '';
  position: absolute;
  bottom: 8%;
  right: 8%;
  width: 900px;
  height: 600px;
  background: radial-gradient(circle, rgba(192, 132, 252, 0.09) 0%, transparent 70%);
  pointer-events: none;
  z-index: 0;
}

/* --------------------------------------------------------------------------
   2. SECTION HEADERS & STUDIO TELEMETRY
   -------------------------------------------------------------------------- */
.showcase-header {
  text-align: center;
  max-width: 820px;
  margin: 0 auto;
}

.showcase-title {
  font-size: clamp(1.8rem, 2.5vw, 2.4rem);
  font-weight: 800;
  line-height: 1.1;
  letter-spacing: -0.03em;
  color: #ffffff;
  margin-bottom: 0;
}

/* --------------------------------------------------------------------------
   4. 3D COVERFLOW GAMES CAROUSEL ARCHITECTURE
   -------------------------------------------------------------------------- */
.games-carousel-wrapper {
  position: relative;
  width: 100%;
  margin: auto auto;
  padding: 0;
  user-select: none;
  overflow: visible;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.carousel-stage {
  position: relative;
  width: 100%;
  height: min(470px, 58vh);
  margin: 0 auto;
  display: flex;
  justify-content: center;
  align-items: center;
  perspective: 1200px;
  perspective-origin: 50% 50%;
  overflow: visible;
}

.carousel-track {
  position: relative;
  width: 100%;
  height: 100%;
  display: flex;
  justify-content: center;
  align-items: center;
  transform-style: preserve-3d;
}

/* Common macOS Window Card Base */
.macos-card {
  background: rgba(14, 11, 28, 0.72);
  backdrop-filter: blur(28px) saturate(180%);
  -webkit-backdrop-filter: blur(28px) saturate(180%);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 20px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  box-shadow: 
    0 25px 50px -12px rgba(0, 0, 0, 0.65),
    inset 0 1px 1px rgba(255, 255, 255, 0.15);
  position: relative;
  transform-style: preserve-3d;
}

/* Carousel Card Specifics */
.carousel-card {
  position: absolute;
  width: min(440px, 86vw);
  max-width: 460px;
  height: min(460px, 56vh);
  max-height: 470px;
  transform-origin: center center;
  transition: transform 0.65s cubic-bezier(0.22, 1, 0.36, 1), 
              opacity 0.65s ease, 
              filter 0.65s ease, 
              box-shadow 0.65s ease, 
              border-color 0.4s ease;
  will-change: transform, opacity;
  cursor: pointer;
  z-index: 1;
}

.carousel-card.active-card {
  cursor: default;
  border-color: rgba(192, 132, 252, 0.48);
  box-shadow: 
    0 35px 70px -15px rgba(0, 0, 0, 0.9),
    0 0 35px rgba(139, 92, 246, 0.32),
    inset 0 1px 2px rgba(255, 255, 255, 0.3);
}

.carousel-card .game-card-media {
  height: 165px;
  position: relative;
  overflow: hidden;
}

.carousel-card .game-card-body {
  padding: 14px 18px 16px;
  display: flex;
  flex-direction: column;
  flex-grow: 1;
}

/* Specular border sheen sweep on hover */
.macos-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 2px;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.8), transparent);
  transition: left 0.75s ease;
  pointer-events: none;
  z-index: 10;
}

.macos-card:hover::before {
  left: 100%;
}

.macos-card:hover {
  border-color: rgba(192, 132, 252, 0.4);
  box-shadow: 
    0 35px 70px -15px rgba(0, 0, 0, 0.85),
    0 0 40px rgba(139, 92, 246, 0.28),
    inset 0 1px 2px rgba(255, 255, 255, 0.3);
}

/* --------------------------------------------------------------------------
   3. INTERACTIVE BUTTON STYLES
   -------------------------------------------------------------------------- */
.btn-primary-glow {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 12px 26px;
  background: linear-gradient(135deg, #9333ea 0%, #7c3aed 100%);
  color: #ffffff;
  font-family: var(--font-display);
  font-size: 0.92rem;
  font-weight: 700;
  letter-spacing: 0.03em;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.25);
  cursor: pointer;
  box-shadow: 0 0 25px rgba(147, 51, 234, 0.45);
  transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  text-decoration: none;
}

.btn-primary-glow:hover {
  transform: translateY(-2px);
  background: linear-gradient(135deg, #a855f7 0%, #8b5cf6 100%);
  box-shadow: 0 0 35px rgba(168, 85, 247, 0.65);
}

.btn-secondary-mac {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 22px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 12px;
  color: #e2e8f0;
  font-family: var(--font-display);
  font-size: 0.92rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.22s ease;
  text-decoration: none;
}

.btn-secondary-mac:hover {
  background: rgba(255, 255, 255, 0.12);
  color: #ffffff;
  border-color: rgba(255, 255, 255, 0.25);
}

.game-card-media {
  position: relative;
  height: 250px;
  overflow: hidden;
}

.game-card-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.7s cubic-bezier(0.16, 1, 0.3, 1);
}

.macos-card:hover .game-card-media img {
  transform: scale(1.05);
}

.game-card-media .media-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(0deg, rgba(14, 11, 28, 0.95) 0%, transparent 60%);
}

.game-card-body {
  padding: 24px 28px 28px;
  display: flex;
  flex-direction: column;
  flex-grow: 1;
}

.game-tagline-sub {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  font-weight: 600;
  color: #a855f7;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  margin-bottom: 4px;
}

.game-card-title {
  font-size: 1.45rem;
  font-weight: 700;
  letter-spacing: -0.015em;
  color: #ffffff;
  margin-bottom: 6px;
}

.game-card-desc {
  font-size: 0.84rem;
  color: #94a3b8;
  line-height: 1.5;
  margin-bottom: 12px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.game-specs-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  padding: 8px 12px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 10px;
  margin-bottom: 12px;
  margin-top: auto;
}

.spec-item {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.spec-label {
  font-family: var(--font-mono);
  font-size: 0.65rem;
  color: #64748b;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.spec-val {
  font-family: var(--font-display);
  font-size: 0.85rem;
  font-weight: 700;
  color: #f1f5f9;
}

.game-card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: auto;
}

.carousel-card .btn-secondary-mac {
  padding: 7px 16px;
  font-size: 0.8rem;
  border-radius: 8px;
}

.server-ping-badge {
  display: flex;
  align-items: center;
  gap: 6px;
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: #34d399;
}

.server-ping-badge .pulse {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background-color: #10b981;
  box-shadow: 0 0 8px #10b981;
}

/* --------------------------------------------------------------------------
   7. SCROLL REVEAL & 3D SPRING GLIDE ANIMATIONS
   -------------------------------------------------------------------------- */
.reveal-on-scroll {
  opacity: 0;
  transform: perspective(1000px) rotateX(10deg) translateY(60px) scale(0.95);
  filter: blur(8px);
  transition: opacity 0.85s cubic-bezier(0.16, 1, 0.3, 1),
              transform 0.85s cubic-bezier(0.16, 1, 0.3, 1),
              filter 0.85s cubic-bezier(0.16, 1, 0.3, 1);
  will-change: opacity, transform, filter;
}

.reveal-on-scroll.is-revealed {
  opacity: 1;
  transform: perspective(1000px) rotateX(0deg) translateY(0) scale(1);
  filter: blur(0px);
}

/* Stagger delays */
.delay-100 { transition-delay: 80ms; }
.delay-200 { transition-delay: 160ms; }
.delay-300 { transition-delay: 240ms; }
.delay-400 { transition-delay: 320ms; }

/* Scroll down anchor indicator on Hero */
.scroll-indicator-wrap {
  position: absolute;
  bottom: 25px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 15;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  color: #94a3b8;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  cursor: pointer;
  transition: color 0.2s ease, transform 0.2s ease, opacity 0.3s ease;
  text-decoration: none;
}

.scroll-indicator-wrap:hover {
  color: #c084fc;
  transform: translateX(-50%) translateY(3px);
}

.scroll-mouse-icon {
  width: 22px;
  height: 34px;
  border: 2px solid rgba(255, 255, 255, 0.25);
  border-radius: 12px;
  position: relative;
}

.scroll-mouse-icon::after {
  content: '';
  position: absolute;
  top: 6px;
  left: 50%;
  transform: translateX(-50%);
  width: 3px;
  height: 6px;
  background-color: #a855f7;
  border-radius: 2px;
  animation: mouse-wheel 1.8s infinite;
}

@keyframes mouse-wheel {
  0% { transform: translate(-50%, 0); opacity: 1; }
  100% { transform: translate(-50%, 14px); opacity: 0; }
}

/* --------------------------------------------------------------------------
   8. RESPONSIVE BREAKPOINTS
   -------------------------------------------------------------------------- */
@media (max-width: 768px) {
  .carousel-stage {
    height: 420px;
  }
  .carousel-card {
    width: calc(100vw - 36px);
    max-width: 350px;
  }
  .carousel-card .game-card-media {
    height: 135px;
  }
  .carousel-card .game-card-body {
    padding: 12px 16px 14px;
  }
}
