/* ═══════════════════════════════════════════════
   EVENTRO — animations
   Transform / opacity only. Tune freely; nothing
   here affects layout. Stagger uses --i (index).
   ═══════════════════════════════════════════════ */

:root {
  --ease-out: cubic-bezier(.2, .65, .3, 1);
  --ease-spring: cubic-bezier(.34, 1.4, .64, 1);
  --stagger: 70ms;
  --reveal-dur: .8s;
}

/* ── Reveal on scroll (staggered via --i) ───── */
.reveal {
  opacity: 0;
  transform: translateY(28px);
  transition:
    opacity var(--reveal-dur) var(--ease-out),
    transform var(--reveal-dur) var(--ease-out);
  transition-delay: calc(var(--i, 0) * var(--stagger));
}
.reveal.is-visible { opacity: 1; transform: none; }
/* once visible, hover transitions should not inherit the stagger delay */
.reveal.is-visible { transition-delay: 0s; }

/* ── Split-word heading rise ────────────────── */
.is-split { opacity: 1; transform: none; }
.is-split .word { display: inline-block; overflow: hidden; vertical-align: bottom; padding-bottom: .08em; margin-bottom: -.08em; }
.is-split .word > span {
  display: inline-block;
  transform: translateY(110%) rotate(2deg);
  transform-origin: left bottom;
  opacity: 0;
  will-change: transform, opacity;
}
.is-split.is-visible .word > span {
  animation: wordRise .9s var(--ease-out) forwards;
  animation-delay: calc(var(--w, 0) * 55ms);
}
@keyframes wordRise {
  to { transform: none; opacity: 1; }
}

/* ── Hero ───────────────────────────────────── */
.hero__slide img {
  transform: scale(1.02);
  transform-origin: 50% 50%;
}
.hero__slide.is-active img { animation: kenBurns 11s linear forwards; }
.hero__slide:nth-child(2n).is-active img { transform-origin: 30% 60%; }
.hero__slide:nth-child(3n).is-active img { transform-origin: 70% 40%; }
@keyframes kenBurns {
  from { transform: scale(1.02); }
  to { transform: scale(1.14); }
}

.grad--anim {
  background-size: 220% 100%;
  animation: gradShift 6s ease-in-out infinite alternate;
}
@keyframes gradShift {
  from { background-position: 0% 50%; }
  to { background-position: 100% 50%; }
}

.hero__scroll span { animation: scrollHint 1.8s infinite ease-in-out; }
@keyframes scrollHint {
  0% { transform: translateY(0); opacity: 1; }
  70% { transform: translateY(14px); opacity: 0; }
  100% { transform: translateY(0); opacity: 0; }
}

.about__badge { animation: floaty 5s ease-in-out infinite; }
@keyframes floaty { 50% { transform: translateY(-10px); } }

/* ── Marquees ───────────────────────────────── */
.marquee__track { animation: marquee 40s linear infinite; }
.clients__track { animation: marquee 60s linear infinite; }
.clients__track.is-js { animation: none; will-change: transform; }
.marquee:hover .marquee__track { animation-play-state: paused; }
@keyframes marquee { to { transform: translateX(-50%); } }

/* ── Cards: glass panels, spotlight, tilt, depth ──
   .svc / .ev keep overflow: visible + transform-style: preserve-3d so the
   icon / title sit on real translateZ layers; JS (animations.js) feeds
   --mx/--my (spotlight, px) and --tx/--ty (tilt, -1..1) on fine pointers. */
.svc, .ev {
  --mx: 50%;
  --my: 40%;
  --tx: 0;
  --ty: 0;
}
.svc, .game, .step, .ev {
  transition:
    transform .5s var(--ease-out),
    box-shadow .5s var(--ease-out),
    border-color .5s var(--ease-out),
    opacity var(--reveal-dur) var(--ease-out);
}

/* scroll reveal: rise + rotateX settling flat (staggered via --i) */
.svc.reveal, .ev.reveal {
  transform: perspective(900px) translateY(36px) rotateX(9deg);
  transform-origin: 50% 100%;
}
.svc.reveal.is-visible, .ev.reveal.is-visible { transform: none; }

/* cursor spotlight (::after) — radial glow following --mx/--my */
.svc::after, .ev::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background:
    radial-gradient(280px circle at var(--mx) var(--my), rgba(232, 200, 255, .17), rgba(168, 85, 247, .07) 40%, transparent 70%);
  opacity: 0;
  transition: opacity .45s var(--ease-out);
  pointer-events: none;
  z-index: 1;
}
.svc:hover::after, .ev:hover::after, .ev:focus-visible::after { opacity: 1; }

/* card edge: plain 1px border that brightens on hover (no masks: they break inside 3D contexts in some browsers) */
.ev::before, .svc::before { content: none; }
.ev:hover, .ev:focus-visible, .svc:hover, .svc:focus-within { border-color: rgba(214, 160, 255, .75); }

@media (hover: hover) {
  .svc:hover, .game:hover, .step:hover, .ev:hover {
    transform: translateY(-8px);
    border-color: rgba(190, 140, 255, .5);
    box-shadow:
      inset 0 1px 0 rgba(255, 255, 255, .12),
      inset 0 -1px 0 rgba(0, 0, 0, .25),
      0 2px 4px rgba(0, 0, 0, .35),
      0 34px 70px -26px rgba(0, 0, 0, .9),
      0 0 46px -4px rgba(168, 85, 247, .35);
  }
  .game:hover, .step:hover { box-shadow: var(--glow); }
  /* pointer tilt: perspective 900px, max ±6° (JS sets --tx/--ty, adds .is-tilt) */
  .svc.is-tilt, .ev.is-tilt, .svc.reveal.is-visible.is-tilt, .ev.reveal.is-visible.is-tilt {
    transform:
      translateY(-8px)
      perspective(900px)
      rotateX(calc(var(--ty) * -6deg))
      rotateY(calc(var(--tx) * 6deg));
    transition-duration: .2s, .5s, .5s, var(--reveal-dur);
    transition-timing-function: ease-out, var(--ease-out), var(--ease-out), var(--ease-out);
  }
  /* depth layers drift slightly against the tilt so the 3D reads clearly */
  .svc.is-tilt .svc__icon { transform: translate3d(calc(var(--tx) * 5px), calc(var(--ty) * 5px), var(--z)); }
  .svc.is-tilt h3 { transform: translate3d(calc(var(--tx) * 3px), calc(var(--ty) * 3px), 22px); }
  .ev.is-tilt .ev__title { transform: translate3d(calc(var(--tx) * 4px), calc(var(--ty) * 4px), 26px); }
  .ev.is-tilt .ev__chips { transform: translate3d(calc(var(--tx) * 2px), calc(var(--ty) * 2px), 14px); }
  .svc.is-tilt .svc__media img, .ev.is-tilt .ev__media img {
    transform: scale(1.08) translate(calc(var(--tx) * -4px), calc(var(--ty) * -4px));
  }
}
.ev:focus-visible {
  transform: translateY(-4px);
  border-color: var(--brand-soft);
  box-shadow: 0 0 0 3px rgba(181, 124, 232, .35), var(--glow);
}

/* photo: slow zoom + brightness lift */
.svc__media img, .ev__media img, .about__img img, .game img {
  transition: transform 1.3s var(--ease-out), filter .8s var(--ease-out);
  will-change: transform;
}
.svc:hover .svc__media img, .ev:hover .ev__media img, .ev:focus-visible .ev__media img {
  transform: scale(1.08);
  filter: brightness(1.1) saturate(1.06);
}
.about__img:hover img { transform: scale(1.04); }
.game:hover img { transform: scale(1.05); }

/* holographic sheen: sweeps across the photo once per hover */
.svc__media::before, .ev__media::before {
  content: "";
  position: absolute;
  inset: -30% -60%;
  background:
    linear-gradient(105deg,
      transparent 38%,
      rgba(255, 255, 255, .06) 44%,
      rgba(216, 180, 254, .22) 48%,
      rgba(255, 255, 255, .28) 50%,
      rgba(103, 232, 249, .16) 52%,
      rgba(217, 70, 239, .14) 56%,
      transparent 62%);
  transform: translateX(-60%) skewX(-12deg);
  opacity: 0;
  pointer-events: none;
  z-index: 1;
  mix-blend-mode: screen;
}
.svc:hover .svc__media::before, .ev:hover .ev__media::before, .ev:focus-visible .ev__media::before {
  animation: sheen 1.25s var(--ease-out) .05s forwards;
}
@keyframes sheen {
  0% { transform: translateX(-60%) skewX(-12deg); opacity: 0; }
  12% { opacity: 1; }
  80% { opacity: 1; }
  100% { transform: translateX(60%) skewX(-12deg); opacity: 0; }
}

/* icon tile: gentle float, glow ring on hover */
.svc__icon {
  animation: iconFloat 3s ease-in-out infinite;
  animation-delay: calc(var(--i, 0) * -.4s);
  transition: box-shadow .45s var(--ease-out), transform .3s var(--ease-out);
}
@keyframes iconFloat {
  0%, 100% { translate: 0 0; }
  50% { translate: 0 -4px; }
}
.svc__icon::after {
  content: "";
  position: absolute;
  inset: -3px;
  border-radius: 17px;
  border: 1.5px solid rgba(232, 200, 255, .9);
  opacity: 0;
  pointer-events: none;
}
.svc:hover .svc__icon {
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, .4),
    0 10px 24px -8px rgba(0, 0, 0, .7),
    0 0 0 4px rgba(168, 85, 247, .22),
    0 0 28px rgba(192, 72, 240, .75);
}
.svc:hover .svc__icon::after { animation: ringPing 1s var(--ease-out) forwards; }
@keyframes ringPing {
  0% { opacity: .9; transform: scale(.9); }
  100% { opacity: 0; transform: scale(1.5); }
}

/* "New" badge: soft pulse */
.svc__new {
  box-shadow: 0 0 18px rgba(217, 70, 239, .55);
  animation: badgePulse 2.6s ease-in-out infinite;
}
@keyframes badgePulse {
  0%, 100% { transform: scale(1); opacity: 1; }
  50% { transform: scale(1.07); opacity: .86; }
}

/* service count line (added by markup layer) */
.svc__count { transition: transform .3s var(--ease-out); }
.svc:hover .svc__count { transform: translate3d(2px, 0, 14px); }

/* project card details */
.ev__title::after { transition: transform .55s var(--ease-out); }
.ev:hover .ev__title::after, .ev:focus-visible .ev__title::after { transform: scaleX(1); }

.ev__chips .chip { transition: box-shadow .4s var(--ease-out), border-color .4s, color .4s; }
.ev:hover .chip, .ev:focus-visible .chip {
  border-color: rgba(216, 180, 254, .6);
  color: #e9d5ff;
  box-shadow: 0 0 14px -2px rgba(168, 85, 247, .55), inset 0 0 10px rgba(168, 85, 247, .14);
}

.ev__count { transition: border-color .35s, color .35s, box-shadow .35s; }
.ev__count::before { transition: opacity .35s var(--ease-out); }
.ev:hover .ev__count, .ev:focus-visible .ev__count {
  border-color: transparent;
  color: #fff;
  box-shadow: 0 6px 18px -6px rgba(168, 85, 247, .8);
}
.ev:hover .ev__count::before, .ev:focus-visible .ev__count::before { opacity: 1; }

.ev__cta { transition: transform .45s var(--ease-out), opacity .35s var(--ease-out), gap .3s var(--ease-out), color .3s; }
.ev__cta > span { transition: transform .35s var(--ease-spring); display: inline-block; }
@media (hover: hover) {
  /* hidden until hover/focus on pointer devices; always visible on touch */
  .ev__cta { opacity: 0; transform: translateX(-14px); }
  .ev:hover .ev__cta, .ev:focus-visible .ev__cta { opacity: 1; transform: none; color: #fff; }
  .ev:hover .ev__cta > span, .ev:focus-visible .ev__cta > span { transform: translateX(6px); }
}
.ev__media::after { transition: opacity .5s; }
.ev:hover .ev__media::after { opacity: .75; }

/* project filter show/hide */
.ev.is-out {
  opacity: 0;
  transform: scale(.92) translateY(10px);
  transition: opacity .25s ease, transform .25s ease;
  pointer-events: none;
}
.ev.is-in { animation: cardIn .5s var(--ease-out) both; animation-delay: calc(var(--i, 0) * 45ms); }
@keyframes cardIn {
  from { opacity: 0; transform: scale(.92) translateY(14px); }
  to { opacity: 1; transform: none; }
}

/* ── Buttons: shine sweep + magnetic ────────── */
.btn::after {
  content: "";
  position: absolute;
  top: 0; left: -80%;
  width: 50%; height: 100%;
  background: linear-gradient(100deg, transparent, rgba(255, 255, 255, .35), transparent);
  transform: skewX(-20deg);
  transition: left .6s var(--ease-out);
  pointer-events: none;
  z-index: -1;
}
.btn--light::after { background: linear-gradient(100deg, transparent, rgba(168, 85, 247, .3), transparent); }
.btn:hover::after { left: 130%; }
.btn > * { position: relative; z-index: 1; }
.btn.is-magnet { transition: transform .15s ease-out, box-shadow .25s ease; }

.filter { transition: transform .25s var(--ease-spring), color .25s, border-color .25s, background .25s, box-shadow .25s; }
.filter:active { transform: scale(.94); }

.games__btn:active, .lightbox__arrow:active, .case__close:active { transform: scale(.92); }

/* ── Case overlay & lightbox: fade + scale ──── */
.case {
  opacity: 0;
  transform: scale(.985);
  transition: opacity .32s var(--ease-out), transform .32s var(--ease-out);
}
.case.is-open { opacity: 1; transform: none; }
.case.is-closing { opacity: 0; transform: scale(.985); }

.case__hero-img img { transform: scale(1.06); transition: transform 1.6s var(--ease-out); }
.case.is-open .case__hero-img img { transform: scale(1); }
.case__hero-body > * { opacity: 0; transform: translateY(18px); transition: opacity .7s var(--ease-out), transform .7s var(--ease-out); }
.case.is-open .case__hero-body > * { opacity: 1; transform: none; }
.case.is-open .case__hero-body > :nth-child(1) { transition-delay: .15s; }
.case.is-open .case__hero-body > :nth-child(2) { transition-delay: .25s; }
.case.is-open .case__hero-body > :nth-child(3) { transition-delay: .35s; }

.case__shot img { transition: transform .8s var(--ease-out); }
.case__shot:hover img, .case__shot:focus-visible img { transform: scale(1.05); }
.case__nav-btn { transition: transform .3s var(--ease-out), border-color .25s, background .25s; }
.case__nav-btn:hover { transform: translateY(-3px); }

.lightbox {
  opacity: 0;
  transition: opacity .3s ease;
}
.lightbox.is-open { opacity: 1; }
.lightbox.is-closing { opacity: 0; }
.lightbox__stage { transform: scale(.94); transition: transform .35s var(--ease-out); }
.lightbox.is-open .lightbox__stage { transform: none; }
.lightbox__img { transition: opacity .35s ease, transform .35s var(--ease-out); }
.lightbox__img.is-slide-left { transform: translateX(-6%); }
.lightbox__img.is-slide-right { transform: translateX(6%); }
.lightbox__img.is-active { transform: none; }

/* nav mobile links slide in */
.nav__links .nav__link, .nav__links .nav__cta {
  transition: transform .5s var(--ease-out), opacity .5s var(--ease-out), color .2s, background .2s, box-shadow .25s;
}
@media (max-width: 1024px) {
  .nav__links .nav__link, .nav__links .nav__cta { transform: translateY(14px); opacity: 0; }
  .nav__links.is-open .nav__link, .nav__links.is-open .nav__cta {
    transform: none; opacity: 1;
    transition-delay: calc(.12s + var(--i, 0) * 50ms);
  }
}

/* ── Reduced motion: keep everything visible ── */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: .001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .001ms !important;
    transition-delay: 0s !important;
  }
  .reveal, .is-split .word > span { opacity: 1 !important; transform: none !important; }
  .hero__slide img { animation: none !important; transform: none !important; }
  .marquee__track, .clients__track { animation: none !important; }
  .hero__particles { display: none; }
  .case, .lightbox { opacity: 1; transform: none; }
  .case__hero-body > * { opacity: 1; transform: none; }
  .ev.is-out { opacity: 0; }
  .btn::after { display: none; }
  .svc, .ev, .svc.is-tilt, .ev.is-tilt { transform: none !important; }
  .svc__icon, .svc__new, .svc::before, .ev::before, .svc__media::before, .ev__media::before { animation: none !important; }
  .svc__icon::after { display: none; }
  .ev__cta { opacity: 1; transform: none; }
}
