/* Streymalvi website: motion.
   Everything here is progressive: without JS (.no-js) content is fully visible,
   and prefers-reduced-motion removes movement while keeping fades minimal. */

/* ---------- Reveal on scroll ---------- */
.js .reveal {
  opacity: 0;
  transform: translate3d(0, 28px, 0);
  transition:
    opacity .9s var(--ease-out) calc(var(--d, 0) * 90ms),
    transform 1.1s var(--ease-out) calc(var(--d, 0) * 90ms);
  will-change: opacity, transform;
}
.js .is-in .reveal, .js .reveal.is-in { opacity: 1; transform: none; will-change: auto; }

/* Opening: headline lines rise with a soft clip */
.js .opening .reveal { transform: translate3d(0, 36px, 0); transition-duration: 1.2s, 1.4s; transition-delay: calc(250ms + var(--d, 0) * 140ms); }
.js .opening.is-in .reveal { opacity: 1; transform: none; }

/* ---------- Footage activation ---------- */
.js .stage-video { opacity: 0; transition: opacity 1.1s var(--ease-out); }
.js .stage-video.is-playing { opacity: 1; }
.js .stage-poster { transition: transform 1.6s var(--ease-out), filter 1.2s; }
.js .feature:not(.is-active) .stage-poster { filter: saturate(0.75) brightness(0.85); }
.js .feature .stage { transform: scale(var(--stage-scale, 1.06)) translate3d(0, var(--parallax, 0px), 0); transition: transform .2s linear; will-change: transform; }

/* Scrim breathes slightly darker while a section is off-centre */
.js .feature .scrim { transition: opacity .8s var(--ease-out); opacity: .92; }
.js .feature.is-active .scrim { opacity: 1; }

/* Feature copy panel slides from its side */
.js .feature .feature-copy { transition: transform 1.2s var(--ease-out), opacity 1s var(--ease-out); transform: translate3d(-24px, 0, 0); opacity: .001; }
.js .feature-right .feature-copy { transform: translate3d(24px, 0, 0); }
.js .feature.is-in .feature-copy { transform: none; opacity: 1; }

/* Decorative chapter line along the left edge of each feature */
.feature::after {
  content: ""; position: absolute; z-index: 3; left: 0; top: 0; bottom: 0; width: 2px;
  background: var(--sm-gradient); transform-origin: top; transform: scaleY(var(--section-progress, 0));
  opacity: .7; pointer-events: none;
}
.feature-right::after { left: auto; right: 0; }
.no-js .feature::after { display: none; }

/* Scroll cue */
@keyframes cue { 0% { transform: translateY(0); opacity: 1; } 70% { transform: translateY(12px); opacity: 0; } 100% { transform: translateY(0); opacity: 0; } }
.scroll-cue span::after { animation: cue 2.2s var(--ease-io) infinite; }

/* Opening content fades as you leave the hero (value set by scroll-effects.js) */
.js .opening-content { opacity: var(--hero-fade, 1); transform: translate3d(0, calc((1 - var(--hero-fade, 1)) * -40px), 0); }

/* Details panel opening */
@keyframes panel-in { from { opacity: 0; transform: translateY(-6px); } to { opacity: 1; transform: none; } }
.more[open] .more-body { animation: panel-in .45s var(--ease-out); }

/* Image loading transition */
.js img.lazy-fade { opacity: 0; transition: opacity .6s var(--ease-out); }
.js img.lazy-fade.is-loaded { opacity: 1; }

/* Film overlay */
@keyframes film-in { from { opacity: 0; transform: scale(.97); } to { opacity: 1; transform: none; } }
@keyframes fade-in { from { opacity: 0; } to { opacity: 1; } }
.film[open] .film-frame { animation: film-in .5s var(--ease-out); }
.film[open]::backdrop { animation: fade-in .4s ease-out; }

/* Header brand */
.site-header .brand img { transition: transform .4s var(--ease-out); }
.site-header.is-compact .brand img { transform: scale(.88); }

/* ---------- Reduced motion ---------- */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto !important; }
  *, *::before, *::after { animation-duration: 1ms !important; animation-iteration-count: 1 !important; transition-duration: 1ms !important; transition-delay: 0s !important; }
  .js .reveal, .js .opening .reveal, .js .feature .feature-copy { opacity: 1 !important; transform: none !important; }
  .js .feature .stage { transform: none !important; }
  .js .opening-content { opacity: 1; transform: none; }
  .scroll-cue span::after { animation: none; }
  .feature::after { display: none; }
}
