/* Shared motion for the public website. Every element is readable before JS runs. */
@media screen and (prefers-reduced-motion: no-preference) {
  body[data-public-layout] {
    --wd-motion-ease: cubic-bezier(.2,.8,.24,1);
    --wd-motion-rise: 32px;
  }

  /* The first screen starts at first paint and does not wait for the scroll observer. */
  body[data-public-layout] :is(main, #main, #main-content) h1 {
    animation: wd-title-in 760ms var(--wd-motion-ease) backwards;
  }
  body[data-homepage-v2] .studio-signature {
    animation: wd-copy-in 520ms var(--wd-motion-ease) backwards;
  }
  body[data-homepage-v2] .studio-lead {
    animation: wd-copy-in 650ms var(--wd-motion-ease) 95ms backwards;
  }
  body[data-homepage-v2] .studio-intro .studio-actions {
    animation: wd-copy-in 620ms var(--wd-motion-ease) 170ms backwards;
  }
  body[data-homepage-v2] .studio-portrait {
    animation: wd-portrait-in 930ms var(--wd-motion-ease) backwards;
  }
  body[data-homepage-v2] .studio-portrait > img {
    animation: wd-photo-in 1050ms var(--wd-motion-ease) backwards;
  }

  body[data-public-layout].motion-ready main [data-reveal] {
    transition: opacity 600ms var(--wd-motion-ease), translate 710ms var(--wd-motion-ease);
    transition-delay: var(--wd-reveal-delay, 0ms);
  }
  body[data-public-layout].motion-ready main [data-reveal].reveal-pending {
    opacity: .12;
    translate: 0 var(--wd-motion-rise);
    transform: none;
  }
  body[data-public-layout].motion-ready main [data-reveal].is-visible {
    opacity: 1;
    translate: none;
  }
  body[data-public-layout] [data-closing-faq] details[open] > p {
    animation: wd-copy-in 300ms var(--wd-motion-ease);
  }
  body[data-public-layout] :is(.studio-button, .nav-cta, .wd-endcard-action a, .footer-contact-call):active {
    scale: .97;
  }
  @media (hover: hover) and (pointer: fine) {
    body[data-public-layout] :is(.studio-project-image > img, .case-example-image > img, .wd-card-cover img) {
      transition: scale 440ms var(--wd-motion-ease);
    }
    body[data-public-layout] :is(.studio-project, .case-card, .wd-article-card):is(:hover, :focus-within) :is(.studio-project-image > img, .case-example-image > img, .wd-card-cover img) {
      scale: 1.045;
    }
  }
  @media (max-width: 700px) {
    body[data-public-layout] { --wd-motion-rise: 20px; }
    body[data-public-layout].motion-ready main [data-reveal] { transition-delay: 0ms; }
  }
  body[data-public-layout].motion-ready main [data-reveal]:focus-within {
    transition: none;
  }
}

@keyframes wd-title-in {
  from { opacity: .45; translate: 0 var(--wd-motion-rise); }
  to { opacity: 1; translate: none; }
}
@keyframes wd-copy-in {
  from { opacity: .22; translate: 0 14px; }
  to { opacity: 1; translate: none; }
}
@keyframes wd-portrait-in {
  from { clip-path: polygon(0 0, 100% 0, 100% 84%, 8% 84%, 0 74%); }
  to { clip-path: polygon(0 0, 100% 0, 100% 100%, 8% 100%, 0 90%); }
}
@keyframes wd-photo-in {
  from { scale: 1.065; }
  to { scale: 1; }
}

@media print {
  body[data-public-layout] main [data-reveal] {
    opacity: 1 !important;
    translate: none !important;
    transform: none !important;
  }
}
