/* =========================================================
   SHOWCASE.CSS — Premium 3D Masonry Portfolio Section
   Anshay Basene Portfolio
   ========================================================= */

/* ===== SHOWCASE SECTION WRAPPER ===== */
#portfolio {
  position: relative;
  background: #0b0b0b;
  overflow: hidden;
}

#portfolio::before {
  content: '';
  position: absolute;
  top: -40%;
  left: 50%;
  transform: translateX(-50%);
  width: 900px;
  height: 900px;
  background: radial-gradient(circle, rgba(168,85,247,0.06) 0%, rgba(96,165,250,0.03) 40%, transparent 70%);
  pointer-events: none;
  z-index: 0;
}

/* ===== CURSOR SPOTLIGHT ===== */
.showcase-spotlight {
  position: fixed;
  width: 400px;
  height: 400px;
  border-radius: 50%;
  pointer-events: none;
  z-index: 1;
  background: radial-gradient(circle, rgba(168,85,247,0.07) 0%, rgba(96,165,250,0.04) 40%, transparent 70%);
  transform: translate(-50%, -50%);
  transition: opacity 0.3s;
  opacity: 0;
}
#portfolio:hover .showcase-spotlight { opacity: 1; }

/* ===== FILTER TABS — NEW STYLE ===== */
.showcase-filters {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 48px;
  position: relative;
  z-index: 2;
}

.showcase-tab {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 10px 22px;
  border-radius: 100px;
  border: 1px solid rgba(255,255,255,0.08);
  background: rgba(255,255,255,0.02);
  color: #999;
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  font-family: 'Inter', sans-serif;
  letter-spacing: 0.4px;
  transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
  position: relative;
  overflow: hidden;
  -webkit-tap-highlight-color: transparent;
}

.showcase-tab::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(168,85,247,0.2), rgba(96,165,250,0.15));
  opacity: 0;
  transition: opacity 0.3s;
}

.showcase-tab:hover {
  color: #fff;
  border-color: rgba(168,85,247,0.4);
  transform: translateY(-2px);
}

.showcase-tab:hover::before { opacity: 1; }

.showcase-tab.active {
  background: linear-gradient(135deg, #a855f7, #6366f1);
  border-color: transparent;
  color: #fff;
  box-shadow: 0 8px 24px rgba(168,85,247,0.4), 0 0 0 1px rgba(255,255,255,0.1) inset;
  transform: translateY(-1px);
}

.showcase-tab.active::before { opacity: 0; }

.showcase-tab .tab-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
  opacity: 0.6;
}

.showcase-tab.active .tab-dot {
  background: #fff;
  opacity: 1;
  animation: pulse-dot 2s infinite;
}

@keyframes pulse-dot {
  0%, 100% { transform: scale(1); opacity: 1; }
  50% { transform: scale(1.4); opacity: 0.6; }
}

/* ===== MASONRY GRID ===== */
.masonry-grid {
  column-count: 2;
  column-gap: 20px;
  position: relative;
  z-index: 2;
}

@media (min-width: 640px)  { .masonry-grid { column-count: 2; } }
@media (min-width: 900px)  { .masonry-grid { column-count: 3; } }
@media (min-width: 1200px) { .masonry-grid { column-count: 4; } }
@media (min-width: 1500px) { .masonry-grid { column-count: 5; } }

/* ===== 3D CARD — BASE ===== */
.sc-card {
  width: 100%;
  display: inline-block;
  break-inside: avoid;
  margin: 0 0 20px;
  position: relative;
  border-radius: 18px;
  overflow: hidden;
  cursor: pointer;
  transform-style: preserve-3d;
  perspective: 1000px;
  /* Scroll-in hidden state */
  opacity: 0;
  transform: translateY(40px);
  transition:
    opacity 0.55s ease,
    transform 0.55s ease;
  will-change: transform, opacity;
}

.sc-card.card-visible {
  opacity: 1;
  transform: translateY(0);
}

/* Hiding state for filter */
.sc-card.sc-hiding {
  opacity: 0;
  transform: translateY(16px) scale(0.96);
  pointer-events: none;
  transition: opacity 0.3s ease, transform 0.3s ease;
}
.sc-card.sc-hidden { display: none; }

/* ===== CARD INNER (3D HOST) ===== */
.sc-card-inner {
  position: relative;
  border-radius: 18px;
  overflow: hidden;
  /* The 3D transform is applied here by JS */
  transition: transform 0.05s linear;
  transform-style: preserve-3d;
  background: #111;
  border: 1px solid rgba(255,255,255,0.06);
  box-shadow:
    0 4px 20px rgba(0,0,0,0.5),
    0 1px 0 rgba(255,255,255,0.04) inset;
}

/* Glow border on hover */
.sc-card:hover .sc-card-inner {
  border-color: rgba(168,85,247,0.5);
  box-shadow:
    0 20px 60px rgba(0,0,0,0.6),
    0 0 40px rgba(168,85,247,0.2),
    0 0 0 1px rgba(168,85,247,0.3);
}

/* ===== LAYER 1 — BACKGROUND MEDIA ===== */
.sc-media {
  position: relative;
  overflow: hidden;
  display: block;
  background: #0d0d0d;
  /* desaturated default */
  filter: saturate(0.55) contrast(0.9) brightness(0.85);
  transition: filter 0.5s ease;
}

.sc-card:hover .sc-media {
  filter: saturate(1.15) contrast(1.05) brightness(1.0);
}

.sc-media img,
.sc-media video,
.sc-media .sc-video-preview {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.7s cubic-bezier(0.25, 0.46, 0.45, 0.94);
  transform: translateZ(0) scale(1.04);
  will-change: transform;
}

.sc-card:hover .sc-media img,
.sc-card:hover .sc-media video,
.sc-card:hover .sc-media .sc-video-preview {
  transform: scale(1.1) translateZ(0);
}

/* ===== LAYER 2 — GRADIENT OVERLAY (mid layer) ===== */
.sc-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(
    175deg,
    rgba(0,0,0,0.0) 0%,
    rgba(0,0,0,0.05) 40%,
    rgba(0,0,0,0.65) 75%,
    rgba(0,0,0,0.88) 100%
  );
  transition: opacity 0.4s ease;
  opacity: 0.7;
  z-index: 1;
}

.sc-card:hover .sc-overlay { opacity: 1; }

/* Neon edge glow on hover */
.sc-media::after {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: inherit;
  box-shadow: inset 0 0 0 1px rgba(168,85,247,0);
  transition: box-shadow 0.4s ease;
  z-index: 2;
  pointer-events: none;
}
.sc-card:hover .sc-media::after {
  box-shadow: inset 0 0 0 1px rgba(168,85,247,0.6), inset 0 0 30px rgba(168,85,247,0.08);
}

/* ===== LAYER 3 — LIGHT REFLECTION (glossy cursor follow) ===== */
.sc-gloss {
  position: absolute;
  inset: 0;
  border-radius: inherit;
  pointer-events: none;
  z-index: 3;
  opacity: 0;
  transition: opacity 0.3s ease;
  /* Actual gradient set by JS on mousemove */
  background: radial-gradient(circle at 50% 50%, rgba(255,255,255,0.12) 0%, transparent 60%);
}
.sc-card:hover .sc-gloss { opacity: 1; }

/* ===== LAYER 4 — TOP (text, tags) ===== */
.sc-info {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  padding: 18px 16px 16px;
  z-index: 4;
  transform: translateY(6px);
  transition: transform 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}
.sc-card:hover .sc-info { transform: translateY(0); }

.sc-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 10px;
  border-radius: 100px;
  font-size: 0.58rem;
  font-weight: 700;
  font-family: 'Outfit', sans-serif;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  margin-bottom: 8px;
  backdrop-filter: blur(8px);
  border: 1px solid transparent;
  opacity: 0;
  transform: translateY(6px);
  transition: opacity 0.35s ease 0.05s, transform 0.35s ease 0.05s;
}

.sc-card:hover .sc-badge {
  opacity: 1;
  transform: translateY(0);
}

.sc-badge.badge-video  { background: rgba(168,85,247,0.25); color: #d8b4fe; border-color: rgba(168,85,247,0.4); }
.sc-badge.badge-graphic { background: rgba(59,130,246,0.25); color: #93c5fd; border-color: rgba(59,130,246,0.4); }
.sc-badge.badge-motion { background: rgba(16,185,129,0.25); color: #6ee7b7; border-color: rgba(16,185,129,0.4); }

.sc-badge i { font-size: 0.55rem; }

.sc-title {
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-size: 0.9rem;
  font-weight: 700;
  color: #fff;
  line-height: 1.3;
  margin-bottom: 4px;
  text-shadow: 0 2px 12px rgba(0,0,0,0.8);
  transform: translateY(0) translateZ(12px); /* parallax lift for 3D */
}

.sc-client {
  font-size: 0.7rem;
  color: rgba(255,255,255,0.55);
  font-family: 'Inter', sans-serif;
  text-shadow: 0 1px 6px rgba(0,0,0,0.8);
}

/* ===== VIEW PROJECT CTA ===== */
.sc-cta {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%) scale(0.85);
  z-index: 5;
  opacity: 0;
  transition: opacity 0.35s ease, transform 0.35s cubic-bezier(0.34, 1.56, 0.64, 1);
  pointer-events: none;
}

.sc-card:hover .sc-cta {
  opacity: 1;
  transform: translate(-50%, -50%) scale(1);
  pointer-events: auto;
}

.sc-cta-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 22px;
  border-radius: 100px;
  background: rgba(168,85,247,0.9);
  backdrop-filter: blur(12px);
  border: 1px solid rgba(255,255,255,0.2);
  color: #fff;
  font-size: 0.75rem;
  font-weight: 700;
  font-family: 'Outfit', sans-serif;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  box-shadow: 0 8px 30px rgba(168,85,247,0.5), 0 0 0 1px rgba(255,255,255,0.1) inset;
  white-space: nowrap;
}

.sc-cta-btn i { font-size: 0.7rem; }

/* ===== VIDEO TYPE INDICATOR ===== */
.sc-video-badge {
  position: absolute;
  top: 12px;
  right: 12px;
  z-index: 5;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: rgba(0,0,0,0.55);
  border: 1px solid rgba(255,255,255,0.15);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: 0.65rem;
  backdrop-filter: blur(8px);
  opacity: 0;
  transform: scale(0.8);
  transition: opacity 0.3s ease, transform 0.3s ease;
}
.sc-card:hover .sc-video-badge {
  opacity: 1;
  transform: scale(1);
}

/* ===== FLOATING IDLE ANIMATION ===== */
@keyframes sc-float {
  0%, 100% { transform: translateY(0px); }
  50%       { transform: translateY(-5px); }
}

/* Only applied on non-hover desktop */
@media (hover: hover) and (pointer: fine) {
  .sc-card:not(:hover) .sc-card-inner {
    animation: sc-float 4s ease-in-out infinite;
  }
  /* Stagger the float start for adjacent cards */
  .sc-card:nth-child(2n) .sc-card-inner   { animation-delay: -1s; }
  .sc-card:nth-child(3n) .sc-card-inner   { animation-delay: -2s; }
  .sc-card:nth-child(4n) .sc-card-inner   { animation-delay: -0.5s; }
  .sc-card:nth-child(5n) .sc-card-inner   { animation-delay: -1.8s; }
}

/* ===== ASPECT RATIOS ===== */
.sc-media.ratio-16-9  { aspect-ratio: 16 / 9;  }
.sc-media.ratio-4-3   { aspect-ratio: 4  / 3;  }
.sc-media.ratio-3-4   { aspect-ratio: 3  / 4;  }
.sc-media.ratio-9-16  { aspect-ratio: 9  / 16; }
.sc-media.ratio-1-1   { aspect-ratio: 1  / 1;  }
.sc-media.ratio-4-5   { aspect-ratio: 4  / 5;  }
.sc-media.ratio-5-7   { aspect-ratio: 5  / 7;  }

/* ===== MOBILE — DISABLE 3D TILT ===== */
@media (max-width: 768px) {
  .masonry-grid {
    column-count: 2 !important;
    column-gap: 12px;
  }
  .sc-card {
    margin-bottom: 12px;
  }
  /* Disable heavy tilt on mobile */
  .sc-card-inner {
    transform: none !important;
    animation: none !important;
  }
  .sc-gloss { display: none; }
}

@media (max-width: 480px) {
  .masonry-grid { column-count: 1 !important; }
}

/* ===== INERTIA LEAVE TRANSITION ===== */
.sc-card.leaving-tilt .sc-card-inner {
  transition: transform 0.6s cubic-bezier(0.25, 0.46, 0.45, 0.94) !important;
}

/* ===== SECTION HEADER AREA ===== */
.showcase-header {
  position: relative;
  z-index: 2;
  margin-bottom: 10px;
}

.showcase-count {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: 'Outfit', sans-serif;
  font-size: 0.62rem;
  color: #555;
  letter-spacing: 2px;
  text-transform: uppercase;
  margin-top: 6px;
}

.showcase-count strong {
  color: var(--accent);
  font-weight: 700;
}

/* ===== SHIMMER PLACEHOLDER ===== */
.sc-shimmer {
  background: linear-gradient(90deg, #111 25%, #1a1a1a 50%, #111 75%);
  background-size: 400% 100%;
  animation: shimmer 1.6s infinite;
}

@keyframes shimmer {
  0%   { background-position: 100% 0; }
  100% { background-position: -100% 0; }
}

/* ===== SHOWCASE TAG PILLS ===== */
.showcase-tag {
  display: inline-block;
  font-size: 0.58rem;
  padding: 3px 8px;
  border-radius: 100px;
  background: rgba(255,255,255,0.08);
  color: rgba(255,255,255,0.5);
  font-family: 'Outfit', sans-serif;
  font-weight: 600;
  letter-spacing: 0.5px;
  margin-right: 4px;
}

/* ===== ENSURE SECTION POSITIONING FOR SPOTLIGHT ===== */
#portfolio { position: relative; }

