/* =====================================================================
   Motion — minimal, slow, quiet.
   Active only when <html class="js-motion"> (set in the <head>, never
   when the visitor prefers reduced motion). Without it every element
   renders instantly, exactly as before.
   Uses the individual `translate` / `rotate` properties wherever the
   theme already positions an element with `transform`.
   ===================================================================== */
:root {
  --motion-ease: cubic-bezier(0.22, 1, 0.36, 1);
  --motion-reveal: 1s;
}

@keyframes motion-fade {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes motion-drop {
  from { opacity: 0; translate: 0 -18px; }
  to { opacity: 1; translate: 0 0; }
}

@keyframes motion-lift {
  from { opacity: 0; translate: 0 24px; }
  to { opacity: 1; translate: 0 0; }
}

@keyframes motion-float {
  0%, 100% { translate: 0 0; }
  50% { translate: 0 7px; }
}

/* ---- page load: header drops in, the film fades up, search rises ---- */
/* only the bar's contents move: a transform on the bar itself would trap
   the fixed menu panel inside it */
html.js-motion header .header {
  animation: motion-fade 1s ease-out 0.05s both;
}

html.js-motion header .header--menu__title,
html.js-motion header .header--logo,
html.js-motion header .header--btn {
  animation: motion-drop 1.1s var(--motion-ease) 0.25s both;
}

html.js-motion .hero {
  background-color: var(--bg-footer);
}

html.js-motion .hero video,
html.js-motion .hero .hero--poster {
  animation: motion-fade 2.2s ease-out both;
}

html.js-motion .hero .search-header {
  animation: motion-lift 1.2s var(--motion-ease) 0.7s both;
}

html.js-motion .hero .scrollTo {
  animation:
    motion-fade 1s ease-out 1.3s both,
    motion-float 2.8s ease-in-out 2.4s infinite;
}

/* ---- scroll reveal: a soft rise, staggered inside each group ---- */
html.js-motion .reveal {
  opacity: 0;
  translate: 0 28px;
  transition:
    opacity var(--motion-reveal) var(--motion-ease),
    translate var(--motion-reveal) var(--motion-ease);
  transition-delay: var(--reveal-delay, 0s);
}

html.js-motion .reveal.is-visible {
  opacity: 1;
  translate: 0 0;
}

/* ---- headings: each line rises out of a mask ---- */
html.js-motion .reveal-mask .mask-line {
  display: block;
  overflow: hidden;
  padding-block-end: 0.14em;
  margin-block-end: -0.14em;
}

html.js-motion .reveal-mask .mask-inner {
  display: block;
  transform: translateY(110%);
  transition: transform 1.3s var(--motion-ease);
  transition-delay: var(--reveal-delay, 0s);
}

html.js-motion .reveal-mask.is-visible .mask-inner {
  transform: none;
}

/* ---- images: a curtain lifts from the bottom edge ---- */
html.js-motion .reveal-curtain img {
  clip-path: inset(100% 0 0 0);
  transition: clip-path 1.5s var(--motion-ease);
  transition-delay: var(--reveal-delay, 0s);
}

html.js-motion .reveal-curtain.is-visible img {
  clip-path: inset(0 0 0 0);
}

/* the three "Work with" photos open one after another */
html.js-motion .workUs--img.reveal-curtain .workUs-img-2 { transition-delay: 0.25s; }
html.js-motion .workUs--img.reveal-curtain .workUs-img-3 { transition-delay: 0.5s; }

/* ---- results: the mark turns into place, and turns on hover ---- */
html.js-motion .results ul li > img {
  transition: rotate 1.6s var(--motion-ease), opacity 1s ease;
}

html.js-motion .results ul li.reveal > img {
  rotate: -60deg;
  opacity: 0;
}

html.js-motion .results ul li.reveal.is-visible > img {
  rotate: 0deg;
  opacity: 1;
  transition-delay: calc(var(--reveal-delay, 0s) + 0.2s);
}

html.js-motion .results ul li.reveal.is-visible:hover > img {
  rotate: 45deg;
  transition-delay: 0s;
}

/* ---- hairline above the footer credits draws left to right ---- */
html.js-motion .reveal-line {
  position: relative;
  border-top-color: transparent !important;
}

html.js-motion .reveal-line::before {
  content: "";
  position: absolute;
  top: -1px;
  left: 0;
  right: 0;
  height: 1px;
  background: #61615f;
  transform: scaleX(0);
  transform-origin: left center;
  transition: transform 1.8s var(--motion-ease);
}

html.js-motion .reveal-line.is-visible::before {
  transform: scaleX(1);
}

/* parallax layers move on the compositor */
html.js-motion .workUs--img img,
html.js-motion .about--img img {
  will-change: translate;
}

/* ---- hover details ---- */
.btn--icon > img {
  transition: translate 0.5s var(--motion-ease);
}

.btn--icon:hover > img {
  translate: 4px 0;
}

.neighborhoods--content ul li a img {
  transition: scale 1.2s var(--motion-ease);
}

.neighborhoods--content ul li a:hover img {
  scale: 1.02;
}

@media (prefers-reduced-motion: reduce) {
  html.js-motion *,
  html.js-motion *::before {
    animation: none !important;
    transition: none !important;
  }
  html.js-motion .reveal,
  html.js-motion .reveal-mask .mask-inner,
  html.js-motion .reveal-curtain img {
    opacity: 1;
    translate: 0 0;
    transform: none;
    clip-path: none;
  }
}
