/* ===================================
   ANIMATIONS - Keyframes & Effects (Optimized)
   =================================== */

/* OPTIMIZED: Reduced noise effect opacity and simplified animation */
body::before {
  content: "";
  position: fixed;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background: transparent url("http://assets.iceable.com/img/noise-transparent.png") repeat 0 0;
  background-size: 300px 300px;
  animation: noise-animation 0.5s steps(3) infinite;
  opacity: 0.5;
  will-change: transform;
  z-index: 100;
  pointer-events: none;
}

/* OPTIMIZED: Simplified keyframes for better performance */
@keyframes noise-animation {
  0% { transform: translate(0, 0); }
  33% { transform: translate(-2%, -2%); }
  66% { transform: translate(2%, -2%); }
  100% { transform: translate(0, 2%); }
}

/* Fade In Animation */
@keyframes fadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

/* Slide Up Animation */
@keyframes slideUp {
  from {
    transform: translateY(30px);
    opacity: 0;
  }
  to {
    transform: translateY(0);
    opacity: 1;
  }
}

/* Project Title Animation Classes */
.project-title {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 100%;
  text-align: center;
  pointer-events: none;
  z-index: 10002;
}

.project-title p {
  position: relative;
  height: 42px;
  color: var(--color-text);
  clip-path: polygon(0 0, 100% 0, 100% 100%, 0% 100%);
  overflow: hidden;
}

.project-title p .word {
  position: relative;
  display: inline-block;
  font-family: var(--font-primary);
  font-size: 36px;
  letter-spacing: -0.03em;
  text-transform: uppercase;
  transform: translateY(0%);
  will-change: transform;
}

.item-name .word,
.item-number .char {
  position: relative;
  display: inline-block;
  will-change: transform;
}

/* Expanded Item */
.expanded-item {
  position: fixed;
  z-index: 10000;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background-color: var(--color-bg);
  overflow: hidden;
  cursor: pointer;
  border-radius: var(--border-radius, 0px);
}

.expanded-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  pointer-events: none;
}

/* Caption Clone */
.caption-clone {
  position: fixed;
  z-index: 10002;
}

.caption-clone .item-name,
.caption-clone .item-number {
  overflow: hidden;
}

/* OPTIMIZED: Reduce motion for low-end devices */
@media (prefers-reduced-motion: reduce) {
  body::before {
    animation: none;
    opacity: 0.3;
  }
  
  * {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}