/*********************
Homepage motion (loaded on the front page only). Behaviour: assets/js/home-motion.js
One language throughout: slow ease-out, small distances.
- Hero: video settles from a slight zoom, title "focuses" in (blur + letter-spacing tighten),
  then the search form, header and scroll hint follow.
- On scroll: section titles repeat the same focus pull; text/cards fade up; photos open like a curtain.
Nothing animates for visitors who prefer reduced motion, and content is never hidden without JS.
*********************/
@media (prefers-reduced-motion: no-preference) {
  :root {
    --rb-ease: cubic-bezier(0.16, 1, 0.3, 1);
  }

  /* ---------- hero entrance (CSS only) ---------- */
  .hero .video--wrapper video {
    animation: rb-settle 2.8s var(--rb-ease) both;
  }

  .hero .hero-title {
    animation: rb-focus 1.6s var(--rb-ease) 0.25s both;
  }

  .hero .search-header > :not(.hero-title) {
    animation: rb-rise 1.1s var(--rb-ease) 0.75s both;
  }

  header .header--content {
    animation: rb-drop 1s var(--rb-ease) 0.95s both;
  }

  .hero .scrollTo {
    animation: rb-rise 1s var(--rb-ease) 1.4s both;
  }

  @keyframes rb-settle {
    from {
      transform: scale(1.12);
    }
  }

  @keyframes rb-focus {
    from {
      opacity: 0;
      letter-spacing: 0.24em;
      filter: blur(10px);
      transform: translateY(14px);
    }
  }

  @keyframes rb-rise {
    from {
      opacity: 0;
      transform: translateY(24px);
    }
  }

  @keyframes rb-drop {
    from {
      opacity: 0;
      transform: translateY(-12px);
    }
  }

  /* ---------- scroll reveals (html.rb-motion is added by home-motion.js) ---------- */
  /* transitions live on the base rule; the hidden look applies only until .is-revealed is added */
  .rb-motion [data-reveal="up"] {
    transition: opacity 0.9s ease var(--rd, 0ms), transform 1.1s var(--rb-ease) var(--rd, 0ms);
  }

  .rb-motion [data-reveal="up"]:not(.is-revealed) {
    opacity: 0;
    transform: translateY(28px);
  }

  /* section titles: the hero's focus pull, repeated */
  .rb-motion [data-reveal="title"] {
    transition: opacity 1s ease var(--rd, 0ms), letter-spacing 1.4s var(--rb-ease) var(--rd, 0ms), filter 1s ease var(--rd, 0ms);
  }

  .rb-motion [data-reveal="title"]:not(.is-revealed) {
    opacity: 0;
    letter-spacing: 0.2em;
    filter: blur(6px);
  }

  /* photos: curtain opens from the bottom while the image settles */
  .rb-motion [data-reveal="curtain"] {
    transition: clip-path 1.2s var(--rb-ease) var(--rd, 0ms);
  }

  .rb-motion [data-reveal="curtain"] > * {
    transition: transform 1.6s var(--rb-ease) var(--rd, 0ms);
  }

  .rb-motion [data-reveal="curtain"]:not(.is-revealed) {
    clip-path: inset(100% 0 0 0);
  }

  .rb-motion [data-reveal="curtain"]:not(.is-revealed) > * {
    transform: scale(1.12);
  }

  .rb-motion [data-reveal="fade"] {
    transition: opacity 1.2s ease var(--rd, 0ms);
  }

  .rb-motion [data-reveal="fade"]:not(.is-revealed) {
    opacity: 0;
  }
}

@media print {
  .rb-motion [data-reveal] {
    opacity: 1 !important;
    transform: none !important;
    filter: none !important;
    clip-path: none !important;
  }
}
