/* UNIKE motion. Calm, eased, small distances.
   Everything here is opt-in via data attributes and only applies when JS has added .ui-js,
   so content is never hidden if the script fails. Reduced motion disables it all. */

@media (prefers-reduced-motion: no-preference) {

  /* Fade-up (default) and directional reveals */
  .ui-js [data-reveal] {
    opacity: 0;
    transform: translate3d(0, var(--ui-reveal-distance), 0);
    transition:
      opacity var(--ui-dur-slow) var(--ui-ease-out),
      transform var(--ui-dur-slow) var(--ui-ease-out);
    transition-delay: calc(var(--i, 0) * var(--ui-stagger));
  }
  .ui-js [data-reveal="left"] { transform: translate3d(calc(-2 * var(--ui-reveal-distance)), 0, 0); }
  .ui-js [data-reveal="right"] { transform: translate3d(calc(2 * var(--ui-reveal-distance)), 0, 0); }
  .ui-js [data-reveal].is-in { opacity: 1; transform: none; }

  /* Media: the frame opens from a slightly inset rectangle while the photo settles from a gentle zoom */
  .ui-js [data-reveal="media"] {
    opacity: 1;
    transform: none;
    clip-path: inset(6% 4% round var(--ui-radius));
    transition: clip-path 1400ms var(--ui-ease-out);
    transition-delay: calc(var(--i, 0) * var(--ui-stagger));
  }
  .ui-js [data-reveal="media"] > img {
    --ui-s-reveal: 1.14;
    transition: scale 1800ms var(--ui-ease-out);
    transition-delay: inherit;
  }
  .ui-js [data-reveal="media"].is-in { clip-path: inset(0); }
  .ui-js [data-reveal="media"].is-in > img { --ui-s-reveal: 1; }
  .ui-js [data-reveal="media"].is-in.ui-media--zoom > img { transition: scale 1.6s var(--ui-ease-out) 0s; }
  /* Overlay text waits for the photo */
  .ui-js [data-reveal="media"] .ui-media__content > * {
    opacity: 0;
    transform: translate3d(0, 12px, 0);
    transition: opacity var(--ui-dur-slow) var(--ui-ease-out), transform var(--ui-dur-slow) var(--ui-ease-out);
  }
  .ui-js [data-reveal="media"].is-in .ui-media__content > * {
    opacity: 1;
    transform: none;
    transition-delay: calc(500ms + var(--j, 0) * 120ms);
  }

  /* Hero: slow settle of the photo, headline lines rise out of a soft blur */
  .ui-js .ui-hero__img { animation: ui-hero-settle var(--ui-dur-hero) var(--ui-ease-out) both; }
  .ui-js .ui-hero [data-line] {
    animation: ui-line-in 1400ms var(--ui-ease-out) both;
    animation-delay: calc(300ms + var(--i, 0) * 140ms);
  }
  .ui-js .ui-hero__cue { animation: ui-cue 2.4s var(--ui-ease-in-out) 1.2s 2 both; }

  /* Parallax: JS writes --ui-py (px) on [data-parallax]; the photo is oversized so edges never show */
  [data-parallax] > img { --ui-s-parallax: 1.12; translate: 0 var(--ui-py, 0); will-change: translate; }
}

/* Hero lines are always blocks (also without JS / with reduced motion).
   Their stagger index comes from data-line="n", since Oxygen drops inline styles. */
.ui-hero [data-line] { display: block; }
.ui-hero [data-line="1"] { --i: 1; }
.ui-hero [data-line="2"] { --i: 2; }

@keyframes ui-hero-settle {
  from { transform: scale(1.08); }
  to { transform: scale(1); }
}
@keyframes ui-line-in {
  from { opacity: 0; transform: translate3d(0, 0.4em, 0); filter: blur(8px); }
  to { opacity: 1; transform: none; filter: blur(0); }
}
@keyframes ui-cue {
  0%, 100% { opacity: 0.4; transform: translateY(0); }
  50% { opacity: 1; transform: translateY(8px); }
}
