/* Custom Design & Animations for AK Sahoo Portfolio */

/* Grid background texture */
.grid-overlay {
  background-size: 40px 40px;
  background-image: 
    linear-gradient(to right, rgba(255, 255, 255, 0.02) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(255, 255, 255, 0.02) 1px, transparent 1px);
  position: absolute;
  inset: 0;
  mask-image: radial-gradient(ellipse 60% 50% at 50% 0%, #000 70%, transparent 100%);
}

/* Custom scrollbar */
::-webkit-scrollbar {
  width: 8px;
}
::-webkit-scrollbar-track {
  background: #07090e;
}
::-webkit-scrollbar-thumb {
  background: #1e293b;
  border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
  background: #334155;
}

/* Filter tab button active state */
.filter-btn.active {
  background: rgba(255, 255, 255, 0.15);
  color: #ffffff;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

/* Modal styling */
dialog::backdrop {
  background-color: rgba(0, 0, 0, 0.85);
  backdrop-filter: blur(8px);
}

/* Subtle glow transitions */
.app-card {
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.05);
  transition: box-shadow 0.3s cubic-bezier(0.16, 1, 0.3, 1), border-color 0.3s ease, background-color 0.3s ease;
}

.app-card:hover {
  box-shadow: 0 10px 30px -10px rgba(99, 102, 241, 0.25), 0 0 0 1px rgba(99, 102, 241, 0.4);
}

.video-card {
  transition: box-shadow 0.3s cubic-bezier(0.16, 1, 0.3, 1), border-color 0.3s ease, background-color 0.3s ease;
}

.video-card:hover {
  box-shadow: 0 10px 30px -10px rgba(239, 68, 68, 0.25), 0 0 0 1px rgba(239, 68, 68, 0.4);
}

/* ==========================================================================
   WebGL Fluid Simulation Cursor Backdrop (Ported from Worldview Compass)
   ========================================================================== */
#fluidCanvas, .fluid-canvas {
  position: fixed;
  inset: 0;
  width: 100vw;
  height: 100vh;
  pointer-events: none;
  user-select: none;
  overflow: hidden;
  z-index: 1;
  mix-blend-mode: screen;
  opacity: 0.88;
}

/* Fluid Dynamics Header Toggle Button */
.fluid-toggle-btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  cursor: pointer;
  user-select: none;
}

.fluid-toggle-btn.is-active {
  background: rgba(6, 182, 212, 0.12);
  border-color: rgba(6, 182, 212, 0.4);
  color: #22d3ee;
  box-shadow: 0 0 15px -3px rgba(6, 182, 212, 0.35);
}

.fluid-toggle-btn.is-active:hover {
  background: rgba(6, 182, 212, 0.2);
  border-color: rgba(6, 182, 212, 0.6);
  color: #67e8f9;
}

.fluid-toggle-btn.is-inactive {
  background: rgba(255, 255, 255, 0.04);
  border-color: rgba(255, 255, 255, 0.08);
  color: #64748b;
  box-shadow: none;
}

.fluid-toggle-btn.is-inactive:hover {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.15);
  color: #94a3b8;
}

.fluid-toggle-btn .fluid-indicator {
  position: absolute;
  top: -2px;
  right: -2px;
  width: 7px;
  height: 7px;
  border-radius: 9999px;
  transition: all 0.25s ease;
}

.fluid-toggle-btn.is-active .fluid-indicator {
  background-color: #22d3ee;
  box-shadow: 0 0 8px #22d3ee;
}

.fluid-toggle-btn.is-inactive .fluid-indicator {
  background-color: #475569;
  box-shadow: none;
  opacity: 0.35;
}

/* Smooth Fade In Animation */
@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(6px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.animate-fadeIn {
  animation: fadeIn 0.25s ease-out forwards;
}

/* ==========================================================================
   Micro 3D Parallax Tilt with Inertia Physics (Derived from codes.txt)
   ========================================================================== */
.tilt-card {
  perspective: 1000px;
  transform-style: preserve-3d;
  will-change: transform;
  /* CRITICAL: Never animate 'transform' via CSS transitions on tilt cards;
     let the rAF lerp physics loop control transform at native 60-120fps without easing conflicts. */
  transition-property: border-color, background-color, box-shadow, opacity !important;
  transition-duration: 0.25s !important;
  transition-timing-function: ease-out !important;
}

/* Neutralize Tailwind hover translateY to prevent 3D matrix collisions */
.tilt-card:hover {
  transform: none;
}

.tilt-inner {
  transform-style: preserve-3d;
  border-radius: inherit;
  width: 100%;
  height: 100%;
  position: relative;
}

.tilt-inner > * {
  transform-style: preserve-3d;
}

.tilt-glow {
  position: absolute;
  inset: -1px;
  border-radius: inherit;
  background: radial-gradient(380px circle at var(--glow-x, var(--mouse-x, 50%)) var(--glow-y, var(--mouse-y, 50%)), rgba(99, 102, 241, 0.22), transparent 70%);
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.35s ease;
  z-index: 10;
}

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

/* ==========================================================================
   Gated APK Download Modal & Glassmorphism
   ========================================================================== */
dialog#apkModal::backdrop {
  background: rgba(4, 7, 13, 0.88);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
}

dialog#apkModal {
  max-width: 440px;
  width: 92vw;
  border-radius: 1.5rem;
  background: transparent;
  padding: 0;
  border: 1px solid rgba(255, 255, 255, 0.12);
  box-shadow: 0 30px 70px -15px rgba(0, 0, 0, 0.85), 0 0 50px -10px rgba(99, 102, 241, 0.3);
  outline: none;
}

dialog#apkModal[open] {
  animation: modalPop 0.3s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

@keyframes modalPop {
  0% {
    opacity: 0;
    transform: scale(0.92) translateY(20px);
  }
  100% {
    opacity: 1;
    transform: scale(1) translateY(0);
  }
}

/* Download Toast Notification */
#downloadToast {
  position: fixed;
  bottom: 2rem;
  right: 2rem;
  z-index: 9999;
  transform: translateY(140%);
  opacity: 0;
  pointer-events: none;
  transition: all 0.35s cubic-bezier(0.16, 1, 0.3, 1);
}

#downloadToast.show {
  transform: translateY(0);
  opacity: 1;
  pointer-events: auto;
}

/* ==========================================================================
   AETHER // 3D Seamless Coverflow Engine Styles
   ========================================================================== */
.gallery-stage {
  perspective: 1400px;
  transform-style: preserve-3d;
  position: relative;
  width: 100%;
  overflow: hidden;
  user-select: none;
  -webkit-user-select: none;
  touch-action: pan-y;
  background: transparent;
}

/* Open Panoramic View: Spans the complete viewport width on PC */
.gallery-stage-open {
  width: 100vw;
  position: relative;
  left: 50%;
  right: 50%;
  margin-left: -50vw;
  margin-right: -50vw;
  overflow: hidden;
  background: transparent !important;
  border: none !important;
  border-radius: 0 !important;
  box-shadow: none !important;
}

.gallery-stage-screenshots {
  height: 560px;
}

.gallery-stage-apps {
  height: 510px;
}

@media (min-width: 640px) {
  .gallery-stage-screenshots {
    height: 610px;
  }
  .gallery-stage-apps {
    height: 550px;
  }
}

@media (min-width: 1024px) {
  .gallery-stage {
    perspective: 1600px;
  }
  .gallery-stage-screenshots {
    height: 650px;
  }
  .gallery-stage-apps {
    height: 580px;
  }
}

.cards-wrapper {
  position: absolute;
  top: 48%;
  left: 50%;
  transform: translate(-50%, -50%);
  transform-style: preserve-3d;
  pointer-events: none;
}

/* App Showcase Card Dimensions */
.cards-wrapper-apps {
  width: 275px;
  height: 440px;
  max-width: 82vw;
}

@media (min-width: 480px) {
  .cards-wrapper-apps {
    width: 310px;
    height: 450px;
  }
}

@media (min-width: 640px) {
  .cards-wrapper-apps {
    width: 350px;
    height: 460px;
  }
}

@media (min-width: 1024px) {
  .cards-wrapper-apps {
    width: 380px;
    height: 470px;
  }
}

/* Smartphone Mockup Card Dimensions */
.cards-wrapper-phone {
  width: 260px;
  height: 500px;
}

@media (min-width: 640px) {
  .cards-wrapper-phone {
    width: 290px;
    height: 540px;
  }
}

@media (min-width: 1024px) {
  .cards-wrapper-phone {
    width: 300px;
    height: 560px;
  }
}

/* Suggestion 3: Tablet / Desktop Landscape Mockup Card Dimensions */
.cards-wrapper-tablet {
  width: 310px;
  height: 230px;
}

@media (min-width: 640px) {
  .cards-wrapper-tablet {
    width: 440px;
    height: 300px;
  }
}

@media (min-width: 1024px) {
  .cards-wrapper-tablet {
    width: 520px;
    height: 340px;
  }
}

/* Base 3D Carousel Card */
.carousel-card {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  border-radius: 1.5rem;
  transform-style: preserve-3d;
  will-change: transform, opacity;
  pointer-events: auto;
  cursor: grab;
  background: rgba(13, 17, 27, 0.96);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid rgba(255, 255, 255, 0.12);
  box-shadow: 
    0 25px 60px -15px rgba(0, 0, 0, 0.85),
    0 0 0 1px rgba(255, 255, 255, 0.05) inset;
  overflow: hidden;
  transition: border-color 0.4s ease, box-shadow 0.4s ease;
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
}

.carousel-card:active {
  cursor: grabbing;
}

/* Active Center Card Elevation */
.carousel-card.is-active {
  border-color: rgba(99, 102, 241, 0.6);
  box-shadow: 
    0 35px 80px -15px rgba(0, 0, 0, 0.95),
    0 0 50px -10px rgba(99, 102, 241, 0.4),
    0 0 0 1px rgba(255, 255, 255, 0.25) inset;
}

/* Center-only Active CTA Reveal */
.carousel-card .card-cta-reveal {
  opacity: 0.6;
  transform: translateY(4px);
  transition: all 0.35s cubic-bezier(0.16, 1, 0.3, 1);
}

.carousel-card.is-active .card-cta-reveal {
  opacity: 1;
  transform: translateY(0);
}

/* Inactive cards: disable button/link pointer events so overlapping wings never steal taps */
.carousel-card:not(.is-active) a,
.carousel-card:not(.is-active) button {
  pointer-events: none !important;
}

/* Mobile responsive inactive card emphasis: subtly dim background cards while letting GSAP control opacity curve */
@media (max-width: 639px) {
  .carousel-card:not(.is-active) {
    filter: brightness(0.75);
  }
}

/* Floor Ambient Reflection with Dynamic Luminescence */
.stage-floor-reflection {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 200px;
  background: radial-gradient(ellipse 70% 50% at 50% 100%, var(--stage-glow, rgba(99, 102, 241, 0.25)), transparent 75%);
  transform: rotateX(75deg);
  pointer-events: none;
  transition: background 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}

/* Keyboard HUD and Floating Badges */
.hud-pill {
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  background: rgba(15, 23, 42, 0.75);
  border: 1px solid rgba(255, 255, 255, 0.12);
  box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.5);
}


/* QR Code SVG Presentation */
.qr-container svg {
  display: block;
  width: 100%;
  height: 100%;
  border-radius: 0.75rem;
}

/* Drag Proxy element for GSAP Draggable */
.drag-proxy {
  position: absolute;
  top: 0;
  left: 0;
  width: 1px;
  height: 1px;
  visibility: hidden;
  pointer-events: none;
}

/* Below-the-fold content optimization: lazy layout rendering until scrolled near viewport */
.cv-auto {
  content-visibility: auto;
  contain-intrinsic-size: 0 400px;
}



