/* Motion for the REFON website and workspaces. */
:root {
  --refon-motion-quick: 140ms;
  --refon-motion-view: 240ms;
  --refon-motion-panel: 320ms;
  --refon-motion-ease: cubic-bezier(.22, .75, .25, 1);
}

@keyframes refon-enter {
  from { opacity: .25; transform: translateY(7px); }
}
@keyframes refon-panel-enter {
  from { opacity: .4; transform: translateY(14px); }
}
@keyframes refon-drawer-enter {
  from { opacity: .5; transform: translateX(18px); }
}
@keyframes refon-fade {
  from { opacity: .55; }
}

/* Entry and navigation. Data refreshes keep the current view in place. */
.folio-intro, .panel-wrap > .panel, #account-form:not([hidden]),
#projects:not(.hidden), #main:not(.hidden) > .card:first-child {
  animation: refon-enter var(--refon-motion-panel) var(--refon-motion-ease);
}
.admin-main > .panel:not([hidden]), main > :is(#overview, #library):not([hidden]),
[data-refon-motion="view"] {
  animation: refon-enter var(--refon-motion-view) var(--refon-motion-ease);
}
.folio-project, .folio-film a, .service-choice, .material-list button,
.admin-side nav :is(button, a), .queue-filters button, .btn, .nav-btn,
#dock button, #modules button {
  transition: background-color var(--refon-motion-quick) ease,
              border-color var(--refon-motion-quick) ease,
              color var(--refon-motion-quick) ease,
              opacity var(--refon-motion-quick) ease;
}
.folio-project:hover { transform: none; }
.folio-film a { transition-property: opacity, filter; }
.material-list button.active, .material-list button:hover { padding-left: 0; }

/* Dialogs and detail panels. The overlay owns visibility and focus. */
.modal-root { transition: opacity var(--refon-motion-quick) ease, visibility var(--refon-motion-quick) ease; }
.modal-root.open .enquiry-panel, .project-detail-root.open .project-detail-panel,
dialog[open] { animation: refon-panel-enter var(--refon-motion-panel) var(--refon-motion-ease); }
.drawer.open .drawer-inner { animation: refon-drawer-enter var(--refon-motion-panel) var(--refon-motion-ease); }
.project-detail-root.open .project-detail-backdrop {
  animation: refon-fade var(--refon-motion-view) ease;
}
.enquiry-panel .form-step.active, #projectDetailImage[data-refon-motion="image"],
#materialImage[data-refon-motion="image"] {
  animation: refon-fade var(--refon-motion-view) ease;
}
main details[open] > summary + :not(script) {
  animation: refon-fade var(--refon-motion-view) ease;
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation: none !important;
    scroll-behavior: auto !important;
    transition-duration: 0s !important;
    transition-delay: 0s !important;
  }
}
