/* =========================================================
   Effects: reveal, spotlight, tilt, floating UI, lightbox
   ========================================================= */

/* ---------- Scroll reveal ---------- */
.js [data-reveal] {
  opacity: 0;
  transform: translateY(28px);
  transition:
    opacity 0.8s var(--ease),
    transform 0.8s var(--ease);
  transition-delay: var(--d, 0s);
  will-change: opacity, transform;
}
.js [data-reveal="zoom"] {
  transform: scale(0.96);
}
.js [data-reveal="right"] {
  transform: translateX(34px);
}
.js [data-reveal="left"] {
  transform: translateX(-34px);
}
.js [data-reveal].is-visible {
  opacity: 1;
  transform: none;
}

/* ---------- Cursor spotlight ---------- */
.spotlight {
  position: relative;
}
.spotlight::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 0;
  border-radius: inherit;
  background: radial-gradient(
    420px circle at var(--mx, 50%) var(--my, 50%),
    rgba(217, 84, 43, 0.1),
    transparent 62%
  );
  opacity: 0;
  transition: opacity 0.35s;
  pointer-events: none;
}
.spotlight:hover::before {
  opacity: 1;
}

/* ---------- 3D tilt ---------- */
.tilt {
  transform-style: preserve-3d;
  will-change: transform;
}

/* ---------- Back to top ---------- */
.to-top {
  position: fixed;
  right: 24px;
  bottom: 24px;
  z-index: 900;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: var(--ink);
  color: var(--cream);
  border: 1px solid rgba(255, 255, 255, 0.14);
  box-shadow: 0 16px 34px -14px rgba(25, 21, 18, 0.55);
  opacity: 0;
  transform: translateY(12px);
  pointer-events: none;
  transition: opacity 0.35s, transform 0.35s var(--ease), background 0.25s;
}
.to-top .icon {
  width: 18px;
  height: 18px;
}
.to-top.is-visible {
  opacity: 1;
  transform: none;
  pointer-events: auto;
}
.to-top:hover {
  background: var(--accent);
}

/* ---------- Toast ---------- */
.toast {
  position: fixed;
  left: 50%;
  bottom: 28px;
  z-index: 3000;
  padding: 12px 18px;
  border-radius: 999px;
  background: var(--ink);
  color: var(--cream);
  border: 1px solid rgba(255, 255, 255, 0.12);
  box-shadow: 0 18px 40px -16px rgba(0, 0, 0, 0.5);
  font-size: 12.5px;
  font-weight: 700;
  opacity: 0;
  transform: translate(-50%, 18px);
  pointer-events: none;
  transition: opacity 0.3s, transform 0.3s var(--ease);
  max-width: calc(100vw - 32px);
  text-align: center;
}
.toast.is-visible {
  opacity: 1;
  transform: translate(-50%, 0);
}

/* ---------- Lightbox ---------- */
.lightbox {
  border: 0;
  padding: 0;
  background: transparent;
  max-width: 94vw;
  max-height: 92vh;
  overflow: visible;
}
.lightbox[open] {
  animation: lightboxIn 0.35s var(--ease);
}
.lightbox::backdrop {
  background: rgba(12, 10, 8, 0.84);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
  animation: backdropIn 0.35s ease;
}
.lightbox__figure {
  margin: 0;
}
.lightbox__figure img {
  display: block;
  max-width: 94vw;
  max-height: 82vh;
  margin-inline: auto;
  border-radius: 18px;
  box-shadow: 0 40px 90px -20px rgba(0, 0, 0, 0.75);
}
.lightbox__figure figcaption {
  margin-top: 14px;
  text-align: center;
  font-size: 12.5px;
  font-weight: 600;
  color: rgba(246, 241, 232, 0.7);
}
.lightbox__close {
  position: absolute;
  top: -50px;
  right: 0;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.2);
  color: var(--cream);
  transition: background 0.25s, border-color 0.25s, transform 0.25s;
}
.lightbox__close .icon {
  width: 17px;
  height: 17px;
}
.lightbox__close:hover {
  background: var(--accent);
  border-color: var(--accent);
  transform: rotate(90deg);
}

/* ---------- Keyframes ---------- */
@keyframes lightboxIn {
  from {
    opacity: 0;
    transform: scale(0.96) translateY(10px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}
@keyframes backdropIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

/* ---------- Reduced motion ---------- */
@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
  .js [data-reveal] {
    opacity: 1 !important;
    transform: none !important;
  }
  .marquee__track,
  .float-chip__inner,
  .demo__phone-badge {
    animation: none !important;
  }
  .orbit {
    animation: none !important;
  }
}
