/* iloilee.xyz — Shared Modern 3D & Motion Engine (GPU-Accelerated) */
:root {
  --fx-accent: #38BDF8;
}

/* Top Scroll Progress Indicator */
.fx-scroll-progress {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 2px;
  z-index: 90;
  pointer-events: none;
  transform-origin: 0 50%;
  transform: scaleX(0);
  background: linear-gradient(90deg, var(--fx-accent), rgba(255, 255, 255, 0.85));
  box-shadow: 0 0 10px var(--fx-accent);
  will-change: transform;
}

/* Ambient Full-Viewport 3D Depth Canvas */
.fx-bg-canvas {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
  pointer-events: none;
}

/* Keep page content cleanly above ambient canvas without breaking sticky/fixed */
body[data-fx-canvas] > header:not(.sticky):not(.fixed),
body[data-fx-canvas] > main:not(.sticky):not(.fixed),
body[data-fx-canvas] > footer:not(.sticky):not(.fixed),
body[data-fx-canvas] > section:not(.sticky):not(.fixed),
body[data-fx-canvas] > div:not(.sticky):not(.fixed):not(.fx-lightbox):not(.fx-scroll-progress) {
  position: relative;
  z-index: 1;
}

/* Progressive Scroll Reveal Choreography */
.fx-ready [data-reveal] {
  opacity: 0;
  transform: translate3d(0, 26px, 0) scale(0.985);
  transition:
    opacity 0.72s cubic-bezier(0.22, 1, 0.36, 1) var(--fx-delay, 0ms),
    transform 0.78s cubic-bezier(0.22, 1, 0.36, 1) var(--fx-delay, 0ms);
  will-change: opacity, transform;
}

.fx-ready [data-reveal].fx-in {
  opacity: 1;
  transform: translate3d(0, 0, 0) scale(1);
}

/* 3D Perspective Tilt Containers & Layered Z-Depth */
[data-tilt] {
  transform-style: preserve-3d;
  will-change: transform;
}

.fx-z-sm {
  transform: translateZ(18px);
}

.fx-z-md {
  transform: translateZ(34px);
}

.fx-z-lg {
  transform: translateZ(52px);
}

/* Specular Glare Layer inside 3D Cards */
.fx-glare {
  position: absolute;
  inset: 0;
  border-radius: inherit;
  pointer-events: none;
  z-index: 25;
  opacity: var(--go, 0);
  transition: opacity 0.3s ease;
  background: radial-gradient(
    320px circle at var(--gx, 50%) var(--gy, 50%),
    rgba(255, 255, 255, 0.14),
    rgba(255, 255, 255, 0.03) 42%,
    transparent 70%
  );
  mix-blend-mode: screen;
}

/* Pure CSS Floating for elements without JS tilt */
@keyframes fxFloat3d {
  0%, 100% {
    transform: translate3d(0, 0px, 0);
  }
  50% {
    transform: translate3d(0, -10px, 0);
  }
}

[data-float]:not([data-tilt]) {
  animation: fxFloat3d 5.5s ease-in-out infinite;
  will-change: transform;
}

/* Magnetic CTA Buttons */
[data-magnetic] {
  transition: transform 0.25s cubic-bezier(0.22, 1, 0.36, 1), opacity 0.2s ease, background-color 0.2s ease, border-color 0.2s ease;
  will-change: transform;
}

/* Subtle 3D Slide Enter Transition (Carousel / Tabs) */
@keyframes fxSlideIn {
  from {
    opacity: 0;
    transform: translate3d(0, 12px, 0) scale(0.99);
  }
  to {
    opacity: 1;
    transform: translate3d(0, 0, 0) scale(1);
  }
}

.fx-slide-enter {
  animation: fxSlideIn 0.38s cubic-bezier(0.22, 1, 0.36, 1) both;
}

/* Respect Reduced Motion */
@media (prefers-reduced-motion: reduce) {
  .fx-ready [data-reveal] {
    opacity: 1 !important;
    transform: none !important;
    transition: none !important;
  }
  [data-float],
  [data-tilt],
  [data-magnetic],
  .fx-slide-enter {
    animation: none !important;
    transform: none !important;
    transition: none !important;
  }
  .fx-bg-canvas,
  .fx-glare {
    display: none !important;
  }
}

/* Click-to-Zoom Image Lightbox */
[data-lightbox] {
  cursor: zoom-in;
}

body > .fx-lightbox {
  position: fixed !important;
  inset: 0 !important;
  z-index: 9999 !important;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: rgba(3, 6, 14, 0.9);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 0.24s ease, visibility 0.24s ease;
}

body > .fx-lightbox.fx-open {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}

.fx-lightbox-inner {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  max-width: min(92vw, 1320px);
  max-height: 92vh;
  gap: 12px;
  transform: scale(0.94) translateY(8px);
  transition: transform 0.28s cubic-bezier(0.22, 1, 0.36, 1);
}

body > .fx-lightbox.fx-open .fx-lightbox-inner {
  transform: scale(1) translateY(0);
}

.fx-lightbox-stage {
  position: relative;
  max-width: 100%;
  max-height: 78vh;
  overflow: auto;
  border-radius: 14px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  box-shadow: 0 28px 80px rgba(0, 0, 0, 0.78), 0 0 0 1px rgba(255, 255, 255, 0.06);
  background: #05070e;
}

.fx-lightbox-img {
  display: block;
  max-width: min(88vw, 1260px);
  max-height: 76vh;
  width: auto;
  height: auto;
  object-fit: contain;
  cursor: zoom-in;
  transform-origin: top left;
  transition: transform 0.25s cubic-bezier(0.22, 1, 0.36, 1);
}

.fx-lightbox-img.fx-zoomed {
  max-width: none;
  max-height: none;
  width: 180%;
  cursor: zoom-out;
}

.fx-lightbox-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 10px;
  max-width: 820px;
  text-align: center;
}

.fx-lightbox-counter {
  padding: 2px 10px;
  border-radius: 9999px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  background: rgba(255, 255, 255, 0.08);
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 0.75rem;
  color: var(--fx-accent);
}

.fx-lightbox-caption {
  margin: 0;
  font-size: 0.875rem;
  line-height: 1.5;
  color: #e4e4e7;
}

.fx-lightbox-hint {
  font-size: 0.75rem;
  color: #a1a1aa;
}

.fx-lightbox-close,
.fx-lightbox-nav {
  position: absolute;
  width: 40px;
  height: 40px;
  border-radius: 9999px;
  border: 1px solid rgba(255, 255, 255, 0.22);
  background: rgba(15, 23, 42, 0.92);
  color: #ffffff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 3;
  transition: background-color 0.18s ease, transform 0.18s ease, border-color 0.18s ease;
}

.fx-lightbox-close {
  top: -16px;
  right: -16px;
}

.fx-lightbox-nav {
  top: 50%;
  transform: translateY(-50%);
}

.fx-lightbox-prev {
  left: -20px;
}

.fx-lightbox-next {
  right: -20px;
}

.fx-lightbox-close:hover {
  background: var(--fx-accent);
  color: #05070e;
  border-color: var(--fx-accent);
  transform: scale(1.08);
}

.fx-lightbox-nav:hover {
  background: var(--fx-accent);
  color: #05070e;
  border-color: var(--fx-accent);
  transform: translateY(-50%) scale(1.08);
}

@media (max-width: 640px) {
  .fx-lightbox-prev {
    left: 6px;
  }
  .fx-lightbox-next {
    right: 6px;
  }
  .fx-lightbox-close {
    top: 6px;
    right: 6px;
  }
}

/* Interactive Multi-Screenshot Project Switcher */
.fx-thumb-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(255, 255, 255, 0.03);
  padding: 5px 10px 5px 5px;
  font-size: 11px;
  color: #a1a1aa;
  cursor: pointer;
  transition: border-color 0.2s ease, background-color 0.2s ease, color 0.2s ease, transform 0.2s ease;
}

.fx-thumb-btn:hover {
  border-color: rgba(255, 255, 255, 0.3);
  color: #f4f4f5;
  transform: translateY(-1px);
}

.fx-thumb-btn.fx-thumb-active {
  border-color: var(--fx-accent);
  background: rgba(255, 255, 255, 0.08);
  color: #ffffff;
  box-shadow: 0 0 16px -4px var(--fx-accent);
}

.fx-thumb-img {
  width: 44px;
  height: 26px;
  object-fit: cover;
  object-position: top;
  border-radius: 6px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  flex-shrink: 0;
}
