/* Website motion. Progressive enhancement only: without support, or with reduced motion, the page is simply static. */

/* Hover and press */
.btn {
  transition: transform 0.15s var(--ease-out), box-shadow 0.15s ease, background-color 0.15s ease;
}
.btn:active {
  transform: translateY(0) scale(0.985);
}
.btn .ff-icon {
  transition: transform 0.18s var(--ease-out);
}
.btn:hover .ff-icon.dir {
  transform: translateX(4px);
}
[dir='rtl'] .btn:hover .ff-icon.dir {
  transform: scaleX(-1) translateX(4px);
}
a.doc .thumbwrap svg {
  transition: transform 0.22s var(--ease-out);
}
a.doc:hover .thumbwrap svg {
  transform: scale(1.07) rotate(-2deg);
}
a.doc .go {
  transition: transform 0.18s var(--ease-out), color 0.15s ease;
}
a.doc:hover .go {
  color: var(--accent);
  transform: translateX(3px);
}
[dir='rtl'] a.doc:hover .go {
  transform: scaleX(-1) translateX(3px);
}
nav.main a {
  background: linear-gradient(var(--accent), var(--accent)) center bottom / 0% 2px no-repeat;
  transition: background-size 0.2s var(--ease-out), color 0.15s ease;
  border-bottom-color: transparent;
}
nav.main a:hover {
  background-size: 100% 2px;
}
nav.main a[aria-current='page'] {
  background-size: 100% 2px;
  border-bottom-color: transparent;
}
.langmenu summary {
  transition: border-color 0.15s ease, background-color 0.15s ease;
}
.langmenu summary:hover {
  border-color: var(--ink-3);
}

/* Language menu opens with a short rise */
.langmenu ul {
  transition: opacity 0.16s ease, transform 0.18s var(--ease-out);
}
@starting-style {
  .langmenu[open] ul {
    opacity: 0;
    transform: translateY(-6px);
  }
}

/* FAQ answers open smoothly where the browser can animate to auto height */
@supports (interpolate-size: allow-keywords) {
  details.faq {
    interpolate-size: allow-keywords;
  }
  details.faq::details-content {
    block-size: 0;
    overflow: clip;
    transition: block-size 0.28s var(--ease-out), content-visibility 0.28s allow-discrete;
  }
  details.faq[open]::details-content {
    block-size: auto;
  }
}
details.faq summary::after {
  transition: transform 0.2s var(--ease-out);
}
details.faq[open] summary::after {
  transform: rotate(180deg);
}

@media (prefers-reduced-motion: no-preference) {
  /* Pages cross-fade into each other, the header stays put */
  @view-transition {
    navigation: auto;
  }
  header.site {
    view-transition-name: site-header;
  }
  ::view-transition-old(root),
  ::view-transition-new(root) {
    animation-duration: 0.2s;
    animation-timing-function: var(--ease-out);
  }

  /* Hero: the framed print drifts in after the words */
  @keyframes drift {
    from {
      opacity: 0;
      transform: translateY(26px) rotate(-5deg);
    }
  }
  .art-frame {
    animation: drift 0.9s 0.2s var(--ease-out) backwards;
  }
  .art-sheet {
    animation: drift-sheet 0.9s 0.4s var(--ease-out) backwards;
  }
  @keyframes drift-sheet {
    from {
      opacity: 0;
      transform: translateY(26px) rotate(14deg);
    }
  }
}

/* Sections reveal as they scroll into view (scroll-driven animations; ignored elsewhere) */
@supports (animation-timeline: view()) {
  @media (prefers-reduced-motion: no-preference) {
    @keyframes reveal {
      from {
        opacity: 0;
        transform: translateY(24px);
      }
      to {
        opacity: 1;
        transform: none;
      }
    }
    .pillar,
    ol.steps4 li,
    a.doc,
    .source,
    .reasons li,
    .datasheet,
    .band .wrap > * {
      animation: reveal linear backwards;
      animation-timeline: view();
      animation-range: entry 0% entry 42%;
    }
    @keyframes header-shadow {
      to {
        box-shadow: 0 10px 28px -18px rgba(15, 33, 56, 0.5);
      }
    }
    header.site {
      animation: header-shadow linear both;
      animation-timeline: scroll(root block);
      animation-range: 0 90px;
    }
  }
}
