/* The theme owns the layout. Only motion is enhanced here. */
body.mas-studio-motion {
  --mas-studio-ease: cubic-bezier(.22,1,.36,1);
}

/* Keep content readable even if the animation script cannot run. */
body.mas-studio-motion.mas-motion-ready .mas-reveal {
  opacity: 1;
  transform: none;
  filter: none;
  transition: none;
}

body.mas-studio-motion .mas-scroll-progress {
  background: var(--mas-forest, #123b31);
}

body.mas-studio-motion :is(.mas-text-link, .mas-project-detail, .mas-callout > a, .mas-portfolio-view-link) {
  border-bottom-color: transparent;
  background-image: linear-gradient(currentColor, currentColor);
  background-repeat: no-repeat;
  background-position: left bottom;
  background-size: 32% 1px;
  transition: background-size .4s var(--mas-studio-ease), color .2s ease;
}

body.mas-studio-motion :is(.mas-text-link, .mas-project-detail, .mas-callout > a, .mas-portfolio-view-link):focus-visible {
  background-size: 100% 1px;
  outline: 2px solid currentColor;
  outline-offset: 5px;
}

body.mas-studio-motion .mas-button::before { display: none; }
body.mas-studio-motion .mas-filter {
  transition: color .2s ease, background-color .2s ease, transform .25s var(--mas-studio-ease);
}
body.mas-studio-motion :is(.mas-filter, .mas-button):focus-visible {
  outline: 2px solid currentColor;
  outline-offset: 4px;
}

body.mas-studio-motion .mas-nav {
  transition: clip-path .6s var(--mas-studio-ease), visibility 0s linear .6s;
}
body.mas-studio-motion .mas-nav.is-open { transition-delay: 0s; }
body.mas-studio-motion .mas-nav li > a {
  transition: color .2s ease, transform .52s var(--mas-studio-ease), opacity .35s ease;
}
body.mas-studio-motion .mas-nav.is-open li:nth-child(1) > a { transition-delay: .08s; }
body.mas-studio-motion .mas-nav.is-open li:nth-child(2) > a { transition-delay: .12s; }
body.mas-studio-motion .mas-nav.is-open li:nth-child(3) > a { transition-delay: .16s; }
body.mas-studio-motion .mas-nav.is-open li:nth-child(4) > a { transition-delay: .20s; }
body.mas-studio-motion .mas-nav.is-open li:nth-child(5) > a { transition-delay: .24s; }
body.mas-studio-motion .mas-nav.is-open li:nth-child(6) > a { transition-delay: .28s; }
body.mas-studio-motion .mas-nav.is-open li:nth-child(n+7) > a { transition-delay: .32s; }
body.mas-studio-motion .mas-nav li > a:focus-visible {
  outline: 2px solid currentColor;
  outline-offset: -4px;
}

@media (prefers-reduced-motion: no-preference) {
  body.mas-studio-motion .mas-hero-copy > * {
    animation-name: masStudioHeroCopy;
    animation-duration: .95s;
    animation-timing-function: var(--mas-studio-ease);
  }
  body.mas-studio-motion .mas-hero-copy > :nth-child(1) { animation-delay: .12s; }
  body.mas-studio-motion .mas-hero-copy > :nth-child(2) { animation-delay: .27s; }
  body.mas-studio-motion .mas-hero-copy > :nth-child(3) { animation-delay: .42s; }
  body.mas-studio-motion .mas-hero-copy > :nth-child(4) { animation-delay: .57s; }
  body.mas-studio-motion .mas-cinematic-rail > div { animation-duration: 44s; }
  body.mas-studio-motion .mas-lightbox img {
    transition: opacity .2s ease, transform .4s var(--mas-studio-ease);
  }
  body.mas-studio-motion .mas-lightbox.is-loading img { transform: scale(.99); }
}

@media (hover: hover) and (pointer: fine) and (prefers-reduced-motion: no-preference) {
  body.mas-studio-motion :is(.mas-text-link, .mas-project-detail, .mas-callout > a, .mas-portfolio-view-link):hover {
    background-size: 100% 1px;
  }
  body.mas-studio-motion .mas-feature-media img,
  body.mas-studio-motion .mas-project-visual img {
    transition: transform .9s var(--mas-studio-ease);
  }
  body.mas-studio-motion .mas-feature-card:hover img {
    transform: scale(1.05);
    filter: none;
  }
  body.mas-studio-motion .mas-project-visual:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 28px rgba(18,59,49,.09);
  }
  body.mas-studio-motion .mas-project-visual:hover img { transform: scale(1.05); }
  body.mas-studio-motion .mas-fraternite-image .mas-project-visual:hover img { transform: none; }
  body.mas-studio-motion .mas-filter:hover { transform: translateY(-1px); }
}

@media (hover: none), (pointer: coarse), (max-width: 900px) {
  body.mas-studio-motion .mas-hero-image,
  body.mas-studio-motion .mas-band-image img { transform: none; animation: none; will-change: auto; }
  body.mas-studio-motion .mas-feature-card:hover img,
  body.mas-studio-motion .mas-project-visual:hover img { transform: none; filter: none; }
  body.mas-studio-motion .mas-project-visual:hover,
  body.mas-studio-motion .mas-button:hover { transform: none; box-shadow: none; }
  body.mas-studio-motion .mas-project-open { opacity: 1; transform: none; }
}

@keyframes masStudioHeroCopy {
  from { opacity: 0; transform: translate3d(0,44px,0); }
  to { opacity: 1; transform: none; }
}
@keyframes masStudioHeroCopyCompact {
  from { opacity: 0; transform: translate3d(0,26px,0); }
  to { opacity: 1; transform: none; }
}
@media (max-width: 900px) and (prefers-reduced-motion: no-preference), (pointer: coarse) and (prefers-reduced-motion: no-preference) {
  body.mas-studio-motion .mas-hero-copy > * {
    animation-name: masStudioHeroCopyCompact;
    animation-duration: .68s;
  }
}

@media (prefers-reduced-motion: reduce) {
  html:has(body.mas-studio-motion) { scroll-behavior: auto; }
  body.mas-studio-motion *, body.mas-studio-motion *::before, body.mas-studio-motion *::after {
    animation-duration: .01ms !important;
    animation-delay: 0s !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0s !important;
    transition-delay: 0s !important;
  }
  body.mas-studio-motion .mas-nav,
  body.mas-studio-motion .mas-nav li > a { transition: none; }
  body.mas-studio-motion .mas-project-visual:hover,
  body.mas-studio-motion .mas-project-visual:hover img,
  body.mas-studio-motion .mas-feature-card:hover img,
  body.mas-studio-motion .mas-button:hover { transform: none; filter: none; box-shadow: none; }
}

@media print {
  body.mas-studio-motion .mas-reveal { opacity: 1; transform: none; filter: none; }
}
