/* AIM Gallery Showcase — Frontend Gallery Styles */
/* Google Fonts */
@import url('https://fonts.googleapis.com/css2?family=Orbitron:wght@700&family=Space+Grotesk:wght@400;700&display=swap');

/* =====================
   CodePen base — class names renamed only; no values altered
   ===================== */
.aim-gallery-wrap *, .aim-gallery-wrap *::before, .aim-gallery-wrap *::after { box-sizing: border-box; }
:root{
  --index: calc(1vw + 1vh);
  --transition: cubic-bezier(.1,.7,0,1);
  --gap-base:.2rem;
  --shift: 0px;
}

.aim-gallery-wrap{
  min-height:100vh;box-sizing:content-box;display:flex;align-items:center;justify-content:center;overflow:visible;
  background:#141414;
}

.aim-gallery-items{
  display:flex;
  gap: var(--gap, var(--gap-base));
  perspective: calc(var(--index) * 35);
  perspective-origin: 50% 50%;
  transform: translateX(var(--shift));
  transform-style: preserve-3d;
  will-change: transform;
  overflow: visible;
  transition: transform .6s var(--transition);
  padding-inline:48px;
  margin-inline:-48px;
}
.aim-gallery-items.hovering{ --gap: calc(var(--gap-base) / 2); }

.aim-gallery-item{
  position:relative;
  width: calc(var(--index) * 3);
  height: calc(var(--index) * 18);
  background:#222 center/cover no-repeat;
  cursor:pointer;
  transition: transform 1.25s var(--transition), width .5s var(--transition);
  transform-style: preserve-3d;
  backface-visibility:hidden;
  will-change: transform, width;
  outline:none;
  border-radius:100px;
  flex:0 0 auto;
  user-select:none;
}

/* Hover fan states — preserve all transform values exactly */
.aim-gallery-item.is-hover-main{ transform: translateZ(calc(var(--index) * 10)); z-index:10; }
.aim-gallery-item.is-right-1   { transform: translateZ(calc(var(--index) * 8.5))  rotateY(35deg);  z-index:9; }
.aim-gallery-item.is-right-2   { transform: translateZ(calc(var(--index) * 5.6))  rotateY(40deg);  z-index:8; }
.aim-gallery-item.is-right-3   { transform: translateZ(calc(var(--index) * 2.5))  rotateY(30deg);  z-index:7; }
.aim-gallery-item.is-right-4   { transform: translateZ(calc(var(--index) * 0.6))  rotateY(15deg);  z-index:6; }
.aim-gallery-item.is-left-1    { transform: translateZ(calc(var(--index) * 8.5))  rotateY(-35deg); z-index:9; }
.aim-gallery-item.is-left-2    { transform: translateZ(calc(var(--index) * 5.6))  rotateY(-40deg); z-index:8; }
.aim-gallery-item.is-left-3    { transform: translateZ(calc(var(--index) * 2.5))  rotateY(-30deg); z-index:7; }
.aim-gallery-item.is-left-4    { transform: translateZ(calc(var(--index) * 0.6))  rotateY(-15deg); z-index:6; }

/* Open state */
.aim-gallery-items.is-open .aim-gallery-item{
  transition: transform .8s var(--transition), width .6s var(--transition);
}
.aim-gallery-item.is-open{
  width: 20vw;
  z-index:100;
  transform: translateZ(calc(var(--index) * 10));
}

html, body, .aim-gallery-wrap, .aim-gallery-items { overflow: visible !important; }

/* =====================
   Product overlay — full-card <a> element, hidden by default, revealed on .is-open
   ===================== */
.aim-gallery-overlay {
  position: absolute;
  inset: 0;
  border-radius: 100px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-end;
  padding-bottom: 2rem;
  background: linear-gradient(to top, rgba(0,0,0,0.85) 0%, rgba(0,0,0,0) 50%);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.4s ease;
}

.aim-gallery-item.is-open .aim-gallery-overlay {
  opacity: 1;
  pointer-events: auto;
}

.aim-gallery-label {
  font-family: 'Orbitron', sans-serif;
  font-size: clamp(0.55rem, 0.8vw, 0.9rem);
  font-weight: 700;
  letter-spacing: 0.12em;
  color: #6d6d6d; /* Machine Dust */
  text-transform: uppercase;
  text-align: center;
  padding: 0 0.5rem;
  margin-bottom: 0.6rem;
  line-height: 1.3;
}

.aim-gallery-cta {
  display: inline-block;
  font-family: 'Space Grotesk', sans-serif;
  font-size: clamp(0.5rem, 0.7vw, 0.75rem);
  font-weight: 700;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: #141414;
  background-color: #00DEFF; /* Glitch Blue */
  border: none;
  border-radius: 100px;
  padding: 0.4em 0.9em;
  text-decoration: none !important;
  cursor: pointer;
  transition: background-color 0.2s ease, color 0.2s ease;
  white-space: nowrap;
}

.aim-gallery-cta:hover,
.aim-gallery-cta:focus {
  background-color: #39FF14; /* Toxic Signal Green */
  color: #141414;
  outline: none;
  text-decoration: none !important;
}

/* Image element — sits behind overlay, covers the full card */
.aim-gallery-image {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  border-radius: inherit;
  display: block;
  pointer-events: none;
  user-select: none;
}

/* =====================
   MOBILE FALLBACK
   Below 768px: disable 3D, stack cards top-to-bottom, page scrolls naturally
   ===================== */
@media (max-width: 767px) {
  .aim-gallery-wrap {
    height: auto;
    min-height: 0;
    padding: 2rem 0;
  }

  .aim-gallery-items {
    flex-direction: column;
    align-items: center;
    width: 100%;
    overflow: visible !important;
    gap: 1rem;
    padding: 1rem 1.5rem;
    margin-inline: 0;
    perspective: none;
    transform: none !important;
    transition: none;
  }

  .aim-gallery-items.hovering {
    --gap: 1rem;
  }

  .aim-gallery-item {
    width: 85vw;
    height: 55vw;
    border-radius: 16px;
    flex: 0 0 auto;
    overflow: hidden;
    transform: none !important;
    transform-style: flat !important;
    backface-visibility: visible !important;
    transition: height 0.3s ease;
  }

  .aim-gallery-item.is-open {
    width: 85vw !important;
    height: 70vw;
    transform: none !important;
  }

  .aim-gallery-overlay {
    border-radius: 16px;
  }

  .aim-gallery-label {
    font-size: 0.65rem;
  }

  .aim-gallery-cta {
    font-size: 0.6rem;
    padding: 0.35em 0.75em;
  }
}
