/* ==========================================================================
   XPYRO STUDIOS — 3D Cyber Immersive Scene & Motion System (3d-scene.css)
   ========================================================================== */

/* Fullscreen WebGL Canvas */
#webgl-canvas {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  z-index: 0;
  pointer-events: none;
  background: transparent;
  display: block;
  overflow: hidden;
}

/* Ensure body and content overlay nicely with depth */
body.home-page {
  position: relative;
  background-color: var(--bg);
  overflow-x: hidden;
}

/* Make backgrounds translucent so the 3D WebGL universe shines through */
.hero,
.achievements,
.clients,
.portfolio-section,
.thumbnail-showcase,
.reviews,
.faq,
.contact,
.footer {
  position: relative;
  z-index: 1;
}

/* Translucent backdrop blur for section cards */
.achievement-card,
.review-card,
.service-card,
.faq-item,
.contact-shell {
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
}

/* ==========================================================================
   3D PERSPECTIVE WRAPPERS & TILT CARDS
   ========================================================================== */
.tilt-3d-card {
  perspective: 1200px;
  transform-style: preserve-3d;
  will-change: transform;
}

.tilt-3d-card-inner {
  position: relative;
  transform-style: preserve-3d;
  transition: transform 0.18s cubic-bezier(0.2, 0, 0, 1), box-shadow 0.25s ease;
  will-change: transform, box-shadow;
  border-radius: inherit;
}

/* 3D Depth Layers for elements inside cards */
.layer-3d-depth-sm {
  transform: translateZ(16px);
  transform-style: preserve-3d;
  transition: transform 0.2s ease;
}

.layer-3d-depth-md {
  transform: translateZ(32px);
  transform-style: preserve-3d;
  transition: transform 0.2s ease;
}

.layer-3d-depth-lg {
  transform: translateZ(48px);
  transform-style: preserve-3d;
  transition: transform 0.2s ease;
}

/* Specular Sheen / Photorealistic Glare for cards */
.card-sheen-overlay {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  border-radius: inherit;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.3s ease;
  z-index: 5;
  mix-blend-mode: overlay;
  background: radial-gradient(
    circle at var(--sheen-x, 50%) var(--sheen-y, 50%),
    rgba(255, 255, 255, 0.42) 0%,
    rgba(255, 255, 255, 0.1) 35%,
    transparent 70%
  );
}

.tilt-3d-card:hover .card-sheen-overlay {
  opacity: 1;
}

/* ==========================================================================
   HERO 3D SHOWREEL & BRAND ELEMENTS
   ========================================================================== */
.hero-showreel {
  perspective: 1400px;
}

.hero-showreel .showreel-wrapper {
  transform-style: preserve-3d;
  will-change: transform, box-shadow;
  transition: box-shadow 0.3s ease, border-color 0.3s ease;
  box-shadow: 
    0 25px 60px rgba(0, 0, 0, 0.75),
    0 0 35px rgba(255, 13, 37, 0.25),
    inset 0 1px 1px rgba(255, 255, 255, 0.2);
}

.hero-showreel .showreel-wrapper:hover {
  box-shadow: 
    0 35px 80px rgba(0, 0, 0, 0.85),
    0 0 50px rgba(255, 13, 37, 0.45),
    0 0 80px rgba(17, 167, 150, 0.25),
    inset 0 1px 2px rgba(255, 255, 255, 0.35);
}

/* 3D Floating HUD Markers on Showreel */
.showreel-hud-overlay {
  transform: translateZ(40px);
  pointer-events: none;
}

/* 3D Extrusion effect on Brand Name */
.xpyro-brand-wordmark {
  perspective: 1000px;
  transform-style: preserve-3d;
  display: inline-block;
  cursor: pointer;
  transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.xpyro-brand-wordmark:hover {
  transform: scale(1.03) translateZ(20px);
}

.xpyro-brand-letters {
  display: inline-block;
  position: relative;
  text-shadow:
    0 1px 0 rgba(255, 255, 255, 0.4),
    0 2px 0 rgba(200, 200, 200, 0.25),
    0 3px 0 rgba(150, 150, 150, 0.15),
    0 4px 8px rgba(0, 0, 0, 0.6),
    0 0 25px rgba(255, 13, 37, 0.35);
  transition: text-shadow 0.3s ease;
}

.xpyro-brand-wordmark:hover .xpyro-brand-letters {
  text-shadow:
    0 1px 0 rgba(255, 255, 255, 0.8),
    0 2px 0 rgba(255, 13, 37, 0.4),
    0 4px 1px rgba(255, 13, 37, 0.3),
    0 6px 12px rgba(0, 0, 0, 0.8),
    0 0 35px var(--accent, #FF0D25);
}

/* Lens 3D Tilt */
.xpyro-lens-wrapper {
  display: inline-block;
  transform-style: preserve-3d;
  transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1), filter 0.3s ease;
  filter: drop-shadow(0 0 16px rgba(255, 13, 37, 0.4));
}

.xpyro-brand-wordmark:hover .xpyro-lens-wrapper {
  transform: rotateZ(15deg) scale(1.08) translateZ(35px);
  filter: drop-shadow(0 0 25px var(--accent, #FF0D25));
}

/* ==========================================================================
   ACHIEVEMENTS 3D FLOATING CARDS
   ========================================================================== */
.achievements-grid {
  perspective: 1200px;
}

.achievement-card {
  transform-style: preserve-3d;
  transition: transform 0.25s cubic-bezier(0.2, 0, 0, 1), box-shadow 0.3s ease, border-color 0.3s ease;
  position: relative;
  overflow: hidden;
  box-shadow: 0 15px 35px rgba(0, 0, 0, 0.4);
}

.achievement-card::before {
  content: "";
  position: absolute;
  inset: -1px;
  border-radius: inherit;
  padding: 1px;
  background: linear-gradient(
    135deg,
    rgba(255, 255, 255, 0.15),
    transparent 50%,
    var(--accent-soft, rgba(255, 13, 37, 0.25)) 100%
  );
  -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  pointer-events: none;
}

.achievement-card:hover {
  box-shadow: 
    0 25px 50px rgba(0, 0, 0, 0.6),
    0 0 30px var(--accent-ghost, rgba(255, 13, 37, 0.2));
  border-color: rgba(255, 255, 255, 0.25);
}

.achievement-card .achievement-number {
  transform: translateZ(36px);
  display: inline-block;
  text-shadow: 0 0 20px rgba(255, 255, 255, 0.3);
}

.achievement-card .achievement-label {
  transform: translateZ(24px);
  display: inline-block;
}

/* ==========================================================================
   MAGNETIC 3D BUTTONS
   ========================================================================== */
.btn--magnetic {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transform-style: preserve-3d;
  transition: transform 0.2s cubic-bezier(0.2, 0, 0, 1), box-shadow 0.2s ease;
  will-change: transform;
}

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

.btn--magnetic .btn-glow-pulse {
  position: absolute;
  inset: -2px;
  border-radius: inherit;
  background: var(--glow-grad, linear-gradient(135deg, #FF2B40, #FF0D25));
  opacity: 0;
  filter: blur(12px);
  transition: opacity 0.3s ease;
  z-index: -1;
  pointer-events: none;
}

.btn--magnetic:hover .btn-glow-pulse {
  opacity: 0.65;
}

/* ==========================================================================
   REVIEWS 3D FLOATING LEVITATION
   ========================================================================== */
.reviews-grid {
  perspective: 1400px;
}

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

.review-card:hover {
  box-shadow: 
    0 30px 60px rgba(0, 0, 0, 0.6),
    0 0 35px var(--accent-ghost, rgba(255, 13, 37, 0.15));
}

.review-card .review-header {
  transform: translateZ(28px);
}

.review-card .review-stars {
  transform: translateZ(20px);
}

.review-card .review-body {
  transform: translateZ(16px);
}

.review-card .review-quote-icon {
  transform: translateZ(35px);
  transition: transform 0.3s ease, color 0.3s ease;
}

.review-card:hover .review-quote-icon {
  transform: translateZ(48px) scale(1.15) rotate(-5deg);
  color: var(--accent, #FF0D25);
}

/* ==========================================================================
   CONTACT 3D GLOW SHELL
   ========================================================================== */
.contact-shell {
  perspective: 1000px;
  transform-style: preserve-3d;
  transition: transform 0.3s cubic-bezier(0.2, 0, 0, 1), box-shadow 0.3s ease;
}

.contact-shell:hover {
  box-shadow: 
    0 30px 80px rgba(0, 0, 0, 0.7),
    0 0 60px rgba(17, 167, 150, 0.25),
    0 0 100px rgba(255, 13, 37, 0.2);
}

.contact-heading {
  transform: translateZ(32px);
}

.contact-sub {
  transform: translateZ(20px);
}

.contact-links {
  transform: translateZ(24px);
}

/* ==========================================================================
   PORTFOLIO & THUMBNAIL 3D CARDS
   ========================================================================== */
.portfolio-card,
.thumbnail-item {
  transform-style: preserve-3d;
  perspective: 1000px;
  transition: transform 0.25s cubic-bezier(0.2, 0, 0, 1), box-shadow 0.3s ease;
}

.portfolio-card:hover,
.thumbnail-item:hover {
  box-shadow: 
    0 25px 60px rgba(0, 0, 0, 0.7),
    0 0 30px var(--accent-soft, rgba(255, 13, 37, 0.25));
}

.portfolio-card img,
.thumbnail-item img {
  transform-style: preserve-3d;
  transition: transform 0.35s cubic-bezier(0.2, 0, 0, 1);
}

.portfolio-card:hover img,
.thumbnail-item:hover img {
  transform: scale(1.04) translateZ(18px);
}

/* ==========================================================================
   AUDIO HUD TELEMETRY INDICATOR (CYBER MATRIX)
   ========================================================================== */
.cyber-hud-audio-bars {
  display: inline-flex;
  align-items: flex-end;
  gap: 3px;
  height: 14px;
  margin-left: 8px;
  vertical-align: middle;
}

.cyber-hud-audio-bars span {
  width: 2px;
  background: var(--accent, #FF0D25);
  border-radius: 1px;
  animation: hudBarPulse 1.2s ease-in-out infinite alternate;
}

.cyber-hud-audio-bars span:nth-child(1) { height: 40%; animation-delay: 0.1s; }
.cyber-hud-audio-bars span:nth-child(2) { height: 90%; animation-delay: 0.3s; }
.cyber-hud-audio-bars span:nth-child(3) { height: 60%; animation-delay: 0.2s; }
.cyber-hud-audio-bars span:nth-child(4) { height: 100%; animation-delay: 0.4s; }
.cyber-hud-audio-bars span:nth-child(5) { height: 50%; animation-delay: 0.15s; }

@keyframes hudBarPulse {
  0% { transform: scaleY(0.3); opacity: 0.5; }
  100% { transform: scaleY(1); opacity: 1; }
}

/* Smooth 3D Idle Levitation Keyframes */
@keyframes float3D {
  0% {
    transform: translateY(0px) rotateX(0deg) rotateY(0deg);
  }
  50% {
    transform: translateY(-8px) rotateX(2deg) rotateY(-2deg);
  }
  100% {
    transform: translateY(0px) rotateX(0deg) rotateY(0deg);
  }
}

.levitate-3d {
  animation: float3D 6s ease-in-out infinite;
}
