/* parts-showcase.css */

#parts-showcase-pin {
  height: 100dvh;
  width: 100%;
  overflow: hidden;
  position: relative;
  perspective: 1200px;
  perspective-origin: 50% 50%;
  transform-style: preserve-3d;
  background-color: #f4f4f4;
  color: #111111;
  font-family: var(--font-sans, system-ui, -apple-system, sans-serif);
}

/* Header Light Theme Switcher override */
body[data-theme="light"] .site-header {
  background-color: rgba(255, 255, 255, 0.92) !important;
  backdrop-filter: blur(12px);
  border-color: rgba(0, 0, 0, 0.12) !important;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.08) !important;
}

body[data-theme="light"] .nav-link {
  color: #1e293b !important;
}

body[data-theme="light"] .nav-link:hover,
body[data-theme="light"] .nav-link.active {
  color: #0284c7 !important;
}

body[data-theme="light"] .pill-hamburger span {
  background-color: #0f172a !important;
}

/* Giant Background Words */
.showcase-bg-word {
  position: absolute;
  font-family: var(--font-tech, 'Inter', sans-serif);
  font-size: 12vw;
  font-weight: 800;
  text-transform: uppercase;
  color: #444444;
  opacity: 0.15;
  white-space: nowrap;
  letter-spacing: -0.04em;
  line-height: 0.9;
  z-index: 1;
  pointer-events: none;
  user-select: none;
}

.showcase-bg-top {
  top: 22%;
  left: 12%;
}

.showcase-bg-bottom {
  top: 58%;
  left: 28%;
}

.showcase-subheading {
  position: absolute;
  top: 44%;
  left: 56%;
  transform: translateY(-50%);
  font-family: var(--font-sans);
  font-size: clamp(0.75rem, 1.1vw, 0.95rem);
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: #555555;
  max-width: 340px;
  font-weight: 600;
  line-height: 1.5;
  z-index: 2;
  opacity: 0;
}

/* Corner UI Elements */
.showcase-corner-ui {
  position: absolute;
  z-index: 20;
  pointer-events: auto;
}

.ui-top-left {
  top: 36px;
  left: 40px;
  font-weight: 800;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  font-size: 0.8rem;
  color: #111111;
}

.ui-bottom-left {
  bottom: 36px;
  left: 40px;
  max-width: 320px;
  font-size: 0.85rem;
  color: #555555;
  line-height: 1.5;
  font-weight: 500;
}

.ui-bottom-right {
  bottom: 36px;
  right: 48px;
}

.showcase-cta-btn {
  pointer-events: auto;
  font-size: 0.85rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  font-weight: 700;
  padding: 0.75rem 1.5rem;
  border-radius: 6px;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.12);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.showcase-cta-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 14px 30px rgba(0, 0, 0, 0.18);
}

.ui-bottom-center {
  bottom: 36px;
  left: 50%;
  transform: translateX(-50%);
  font-size: 0.75rem;
  color: #666666;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 8px;
  opacity: 0;
}

.ui-bottom-center svg {
  animation: bounceDown 2s infinite ease-in-out;
}

@keyframes bounceDown {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(4px); }
}

/* Thin Right-Edge Progress Bar */
.showcase-progress-track {
  position: absolute;
  top: 0;
  right: 0;
  width: 3px;
  height: 100%;
  background: rgba(0, 0, 0, 0.08);
  z-index: 25;
}

.showcase-progress-fill {
  width: 100%;
  height: 100%;
  background: #000000;
  transform-origin: top;
  transform: scaleY(0);
}

/* 3D Flowing Cards Stream */
.showcase-cards-container {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  transform-style: preserve-3d;
  z-index: 10;
  pointer-events: none;
}

.fly-card {
  position: absolute;
  top: 50%;
  left: 50%;
  width: min(48vw, 760px);
  aspect-ratio: 16 / 10;
  margin-left: calc(min(48vw, 760px) * -0.5);
  margin-top: calc(min(48vw, 760px) * -10 / 32);
  border-radius: 6px;
  overflow: hidden;
  opacity: 0;
  pointer-events: auto;
  box-shadow: 0 25px 60px rgba(0, 0, 0, 0.22);
  background: #18181b;
  border: 1px solid rgba(255, 255, 255, 0.12);
  text-decoration: none;
  display: block;
  will-change: transform, opacity;
  transition: box-shadow 0.3s ease;
}

.fly-card:hover {
  box-shadow: 0 35px 80px rgba(0, 0, 0, 0.35);
}

.fly-card-img-wrap {
  width: 100%;
  height: 100%;
  position: relative;
  overflow: hidden;
  background: #09090b;
}

.fly-card-img-wrap img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.5s ease;
}

.fly-card:hover .fly-card-img-wrap img {
  transform: scale(1.05);
}

.fly-card-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(0, 0, 0, 0.88) 0%, rgba(0, 0, 0, 0.2) 50%, transparent 100%);
  z-index: 2;
}

.fly-card-content {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  padding: 1.75rem 2rem;
  z-index: 3;
  display: flex;
  align-items: center;
  justify-content: space-between;
  color: #ffffff;
}

.fly-card-title {
  font-family: var(--font-tech, 'Inter', sans-serif);
  font-size: clamp(1.25rem, 2vw, 1.85rem);
  font-weight: 700;
  margin: 0;
  color: #ffffff;
  letter-spacing: -0.02em;
}

.fly-card-arrow {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.15);
  backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #ffffff;
  transition: transform 0.3s ease, background 0.3s ease;
}

.fly-card:hover .fly-card-arrow {
  transform: translate(3px, -3px);
  background: #0284c7;
}

/* Final Precision Grid Layer */
.showcase-final-grid {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  z-index: 15;
  opacity: 0;
  pointer-events: none;
  background: #000000;
}

.showcase-final-grid.is-active {
  pointer-events: auto;
}

.grid-column {
  position: relative;
  height: 100%;
  border-right: 1px solid rgba(255, 255, 255, 0.15);
  overflow: hidden;
  clip-path: inset(100% 0 0 0);
  cursor: pointer;
  outline: none;
  transition: opacity 0.4s ease;
}

.grid-column:last-child {
  border-right: none;
}

.grid-column-bg {
  position: absolute;
  inset: 0;
  background-size: cover;
  background-position: center;
  transition: transform 0.6s cubic-bezier(0.16, 1, 0.3, 1), filter 0.6s ease;
  filter: brightness(0.65) saturate(0.85);
  will-change: transform, filter, clip-path;
}

.grid-column-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(0, 0, 0, 0.85) 0%, transparent 60%);
  z-index: 2;
}

.grid-column-content {
  position: absolute;
  bottom: 40px;
  left: 0;
  right: 0;
  padding: 0 1.5rem;
  z-index: 3;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  color: #ffffff;
}

.grid-column-title {
  font-family: var(--font-tech, 'Inter', sans-serif);
  font-weight: 700;
  font-size: 1.15rem;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  white-space: nowrap;
  writing-mode: vertical-rl;
  transform: rotate(180deg);
  opacity: 0;
  transition: opacity 0.4s ease;
}

.grid-column-arrow {
  opacity: 0;
  transform: translateY(10px);
  transition: opacity 0.3s ease, transform 0.3s ease;
}

/* Interactive Hover state for Final Grid */
.grid-column:hover .grid-column-bg,
.grid-column:focus-visible .grid-column-bg {
  transform: scale(1.05);
  filter: brightness(1) saturate(1.15);
}

.grid-column:hover .grid-column-arrow,
.grid-column:focus-visible .grid-column-arrow {
  opacity: 1;
  transform: translateY(0);
}

.showcase-final-grid:hover .grid-column:not(:hover) {
  opacity: 0.5;
}

.showcase-final-grid:hover .grid-column:not(:hover) .grid-column-bg {
  filter: brightness(0.35) saturate(0.5);
}

/* Focus styles for keyboard accessibility */
.grid-column:focus-visible {
  box-shadow: inset 0 0 0 3px #0284c7;
}

/* RESPONSIVE & MOBILE DESIGN */
@media (max-width: 1023px) {
  .showcase-bg-word {
    font-size: 18vw;
  }
  
  .showcase-bg-top {
    top: 15%;
    left: 5%;
  }

  .showcase-bg-bottom {
    top: 55%;
    left: 15%;
  }

  .showcase-subheading {
    top: 40%;
    left: 10%;
    transform: none;
    max-width: 280px;
    font-size: 0.75rem;
  }

  .fly-card {
    width: 78vw;
    margin-left: -39vw;
    margin-top: calc(78vw * -10 / 32);
  }

  .ui-top-left { top: 24px; left: 24px; }
  .ui-bottom-left { bottom: 24px; left: 24px; max-width: 240px; font-size: 0.75rem; }
  .ui-bottom-right { bottom: 24px; right: 24px; }
  .ui-bottom-center { bottom: 24px; }

  .showcase-final-grid {
    grid-template-columns: repeat(2, 1fr);
    grid-template-rows: auto;
    gap: 16px;
  }

  @media (max-width: 680px) {
    .showcase-final-grid {
      grid-template-columns: 1fr;
    }
  }

  .grid-column {
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 8px;
    height: 180px;
  }

  .grid-column-content {
    bottom: 50%;
    left: 20px;
    right: auto;
    transform: translateY(50%);
    flex-direction: row;
  }

  .grid-column-title {
    writing-mode: horizontal-tb;
    transform: none;
  }
}

/* PREFERS REDUCED MOTION */
@media (prefers-reduced-motion: reduce) {
  #parts-showcase-pin {
    height: auto;
    padding: 80px 20px;
    perspective: none;
  }

  .showcase-bg-word,
  .showcase-subheading,
  .showcase-progress-track,
  .showcase-cards-container,
  .ui-bottom-center {
    display: none !important;
  }

  .showcase-final-grid {
    position: relative;
    opacity: 1 !important;
    pointer-events: auto !important;
    grid-template-columns: repeat(3, 1fr);
    height: 70vh;
    gap: 16px;
    background: transparent;
  }

  .grid-column {
    clip-path: none !important;
    border: 1px solid rgba(0, 0, 0, 0.1);
    border-radius: 8px;
  }

  .grid-column-title,
  .grid-column-arrow {
    opacity: 1 !important;
  }
}
