/* Safe visual effects (no layout shifts) */
:root {
  --fx-overlay-opacity: 0.08;
}

/* Subtle page overlay (shapes) */
body.fx-enhanced::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background:
    radial-gradient(12px 12px at 16px 16px, rgba(255,255,255,0.06), transparent 60%),
    repeating-linear-gradient(90deg, rgba(255,255,255,0.04) 0, rgba(255,255,255,0.04) 1px, transparent 1px, transparent 80px),
    repeating-linear-gradient(0deg, rgba(255,255,255,0.04) 0, rgba(255,255,255,0.04) 1px, transparent 1px, transparent 80px);
  mix-blend-mode: lighten;
  opacity: var(--fx-overlay-opacity);
  z-index: 1;
}

/* Fade-in on scroll */
.fx-pre {
  opacity: 0;
  transform: translateY(12px);
}
.fx-in {
  opacity: 1;
  transform: none;
  transition: opacity .6s ease, transform .6s ease;
}

/* Hover polish without moving layout */
.fx-hover-soft {
  transition: filter .2s ease, box-shadow .2s ease;
}
.fx-hover-soft:hover {
  filter: brightness(1.05);
  box-shadow: 0 12px 28px rgba(0,0,0,0.20);
}

/* Optional mild gradient motion for elements already having gradient backgrounds */
@media (prefers-reduced-motion: no-preference) {
  .fx-gradient-move {
    background-size: 200% 200% !important;
    animation: fxGradient 8s ease infinite;
  }
  @keyframes fxGradient {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
  }
}

/* Case Study: smooth transitions for all images (always color) */
.case-img img.is-result {
  filter: none;
  transition: filter .6s ease, transform .6s ease, box-shadow .6s ease;
}
.case-img img.is-result.is-active {
  filter: none;
}

/* Optional subtle emphasis */
.case-img.is-active {
  box-shadow: 0 0 0 1px rgba(255,255,255,0.08) inset, 0 10px 24px rgba(0,0,0,0.35);
}

@media (prefers-reduced-motion: reduce) {
  .case-img img.is-result { transition: none; }
}

/* Lightbox styles */
.lightbox-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.85);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 9999;
}
.lightbox-backdrop.is-open { display: flex; }
.lightbox-content {
  position: relative;
  max-width: 92vw;
  max-height: 92vh;
  display: flex;
  align-items: center;
  justify-content: center;
}
.lightbox-image {
  display: block;
  max-width: 100%;
  max-height: 92vh;
  object-fit: contain;
}
.lightbox-close {
  position: absolute;
  top: -36px;
  right: -12px;
  background: rgba(0,0,0,0.65);
  color: #fff;
  border: 1px solid rgba(255,255,255,0.25);
  padding: 6px 10px;
  cursor: pointer;
}
.lightbox-close:hover { opacity: .85; }

.lightbox-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background: rgba(0,0,0,0.55);
  color: #fff;
  border: 1px solid rgba(255,255,255,0.25);
  padding: 10px 14px;
  cursor: pointer;
  font-size: 28px;
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background .2s ease;
}
.lightbox-nav:hover { background: rgba(0,0,0,0.75); }
.lightbox-prev { left: 16px; }
.lightbox-next { right: 16px; }

@media (max-width: 640px) {
  .lightbox-prev { left: 8px; }
  .lightbox-next { right: 8px; }
  .lightbox-nav { padding: 8px 10px; font-size: 22px; background: rgba(0,0,0,0.7); }
}
