/* =========================================================
   Works 3D Showcase — works-3d.css
   ========================================================= */

/* ── Main container ─────────────────────────────────────── */
#works3dShowcase {
  position: relative;
  width: 100%;
  height: 100vh;
  min-height: 500px;
  overflow: hidden;
  background: #0c0e12;
}

#works3dCanvas {
  position: absolute;
  inset: 0;
  width: 100% !important;
  height: 100% !important;
  display: block;
  touch-action: pan-y;          /* allow vertical scroll on mobile */
  pointer-events: none;         /* let touch pass through to ScrollTrigger */
}

/* Edge-fade overlay — keeps tabs/info readable while center stays clear for photos */
.w3d-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(
    to bottom,
    rgba(8, 9, 13, 0.55)  0%,
    transparent           14%,
    transparent           82%,
    rgba(8, 9, 13, 0.65) 100%
  );
  pointer-events: none;
  z-index: 2;
}

/* ── Category tabs ──────────────────────────────────────── */
.w3d-tabs {
  position: absolute;
  top: 20px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: 3px;
  background: rgba(0, 0, 0, 0.72);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 50px;
  padding: 5px;
  z-index: 30;
  white-space: nowrap;
  pointer-events: auto;
}

.w3d-tab {
  background: transparent;
  border: none;
  color: rgba(255, 255, 255, 0.48);
  font-family: inherit;
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.05em;
  padding: 6px 16px;
  border-radius: 50px;
  cursor: pointer;
  transition: background 0.22s ease, color 0.22s ease;
  outline: none;
}

.w3d-tab:hover  { color: rgba(255, 255, 255, 0.80); }
.w3d-tab:focus-visible {
  box-shadow: 0 0 0 2px rgba(255,255,255,0.4);
}

.w3d-tab.is-active {
  background: rgba(255, 255, 255, 0.15);
  color: #fff;
}

/* ── Info overlay (bottom-left) ─────────────────────────── */
.w3d-info {
  position: absolute;
  bottom: 32px;
  left: clamp(18px, 4vw, 52px);
  z-index: 20;
  color: #fff;
  pointer-events: none;
}

.w3d-eyebrow {
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.20em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.50);
  margin: 0 0 8px;
}

.w3d-heading {
  font-size: clamp(1.0rem, 2.0vw, 1.50rem);
  font-weight: 600;
  line-height: 1.38;
  max-width: 400px;
  margin: 0;
  text-shadow: 0 2px 16px rgba(0, 0, 0, 0.55);
  transition: opacity 0.3s ease;
}

/* ── Photo count (bottom-right) ─────────────────────────── */
.w3d-count {
  position: absolute;
  bottom: 38px;
  right: clamp(18px, 4vw, 52px);
  z-index: 20;
  color: rgba(255, 255, 255, 0.35);
  font-size: 11px;
  letter-spacing: 0.10em;
  margin: 0;
  pointer-events: none;
  font-variant-numeric: tabular-nums;
}

/* ── Scroll hint ────────────────────────────────────────── */
.w3d-scroll-hint {
  position: absolute;
  bottom: 34px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 20;
  color: rgba(255, 255, 255, 0.32);
  font-size: 10px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  display: flex;
  align-items: center;
  gap: 6px;
  pointer-events: none;
  animation: w3dHintBob 2.2s ease-in-out infinite;
}

.w3d-scroll-hint svg {
  width: 13px;
  height: 13px;
}

@keyframes w3dHintBob {
  0%, 100% { opacity: 0.7; transform: translateX(-50%) translateY(0); }
  50%       { opacity: 1.0; transform: translateX(-50%) translateY(4px); }
}

/* ── Carousel ───────────────────────────────────────────── */
.w3d-carousel-outer {
  position: absolute;
  top: 50%;
  left: 0;
  right: 0;
  transform: translateY(-50%);
  height: 60vh;
  display: flex;
  align-items: center;
  overflow: visible;
  z-index: 10;
  pointer-events: none;
}

.w3d-carousel-track {
  display: flex;
  align-items: center;
  gap: 24px;
  will-change: transform;
}

.w3d-photo {
  flex-shrink: 0;
  width: 420px;
  height: 56vh;
  max-height: 520px;
  border-radius: 14px;
  overflow: hidden;
  transform-origin: center center;
  transform: scale(0.32);
  opacity: 0.25;
  box-shadow: 0 16px 60px rgba(0, 0, 0, 0.65);
  pointer-events: none;
  transition: box-shadow 0.3s ease;
}

.w3d-photo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  user-select: none;
  -webkit-user-drag: none;
  pointer-events: none;
}

/* ── Hide mobile CTA bar + header while showcase pinned ── */
body.w3d-pinned .mobile-cta-bar { display: none !important; }
body.w3d-pinned .site-header {
  transform: translateY(-100%);
  transition: transform 0.4s ease;
}
body:not(.w3d-pinned) .site-header {
  transform: translateY(0);
  transition: transform 0.4s ease;
}

/* ── Accessibility: screen-reader only ─────────────────── */
.sr-only {
  position: absolute;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden;
  clip: rect(0,0,0,0);
  white-space: nowrap;
  border: 0;
}

/* ── Mobile tweaks ──────────────────────────────────────── */
@media (max-width: 767px) {
  .w3d-tabs {
    top: 14px;
    max-width: calc(100vw - 24px);
    flex-wrap: wrap;
    justify-content: center;
    border-radius: 14px;
    gap: 2px;
  }
  .w3d-tab {
    font-size: 11px;
    padding: 5px 12px;
  }
  .w3d-info  { bottom: 22px; }
  .w3d-count { display: none; }
  .w3d-scroll-hint { bottom: 24px; }
  .w3d-carousel-outer { height: 50vh; top: 50%; transform: translateY(-50%); }
  .w3d-photo {
    width: 280px;
    height: 44vh;
    max-height: 380px;
    border-radius: 10px;
  }
}

/* ── Reduced motion ─────────────────────────────────────── */
@media (prefers-reduced-motion: reduce) {
  .w3d-scroll-hint { animation: none; opacity: 0.5; }
  .w3d-heading     { transition: none; }
}
