/* Shared motion vocabulary. No layout animation, page-wide fade or delayed exit. */
:root {
  --motion-quick: 140ms;
  --motion-enter: 180ms;
  --motion-ease: cubic-bezier(.2,.7,.2,1);
}

/* Keep focus immediate; the colour transition supports pointer and keyboard use. */
body :is(.studio-button, .portal-action, .workspace-support-action,
  .document-preview-toolbar button, .portal-share-actions button, .privacy-return) {
  transition: background-color var(--motion-quick) ease,
    border-color var(--motion-quick) ease, color var(--motion-quick) ease;
}
body :is(.studio-sidebar nav button, .client-sidebar .portal-tabs button,
  .portal-menu a, .portal-menu button, .workflow-nav label) {
  transition: background-color var(--motion-quick) ease, color var(--motion-quick) ease;
}
body :is(.studio-button, .portal-action, .workspace-support-action,
  .portal-share-actions button):enabled:active { opacity: .78; }
body :is(.studio-button, .portal-action, .workspace-support-action,
  .portal-share-actions button):disabled { transform: none; }

/* The team viewer inherited the form entrance, including its retained transform.
   Keep every review surface stationary, even before a PDF has finished loading. */
body .portal-overlay[open]:is(.has-document-review, .has-team-document,
  .portal-conversation, .portal-project-form) .portal-overlay-content { animation: none; }

/* Full-screen review canvases must not move underneath annotation coordinates. */
@media (prefers-reduced-motion: no-preference) {
  body .portal-menu:not([hidden]),
  html[data-theme] .site-header .site-nav.is-open,
  body .header-login:not([hidden]) { animation: interface-menu-in var(--motion-enter) var(--motion-ease); }

  body .portal-overlay[open]:not(.has-document-review):not(.has-team-document):not(.portal-conversation):not(.portal-project-form) .portal-overlay-content {
    animation: interface-content-in var(--motion-enter) var(--motion-ease);
  }
  body :is(.portal-share, .privacy-detail, .team-file-history)[open] > :not(summary) {
    animation: interface-content-in var(--motion-enter) var(--motion-ease);
  }
  body :is(.studio-status, .portal-message-status, [data-login-status]):not(:empty):not(.tcs-loading) {
    animation: interface-feedback-in var(--motion-quick) ease-out;
  }
  body .enquiry-booking { animation: interface-section-in 220ms var(--motion-ease); }
  /* Avoid two nested entrances when a tab and its questions appear together. */
  body .explorer-panel { animation: interface-content-in var(--motion-enter) var(--motion-ease); }
  body .explorer-panel .explorer-flow-question:not([hidden]):not(.is-locked) { animation: none; }
}
@keyframes interface-menu-in {
  from { opacity: .65; transform: translateY(-4px); }
  to { opacity: 1; transform: translateY(0); }
}
@keyframes interface-content-in { from { opacity: .78; } to { opacity: 1; } }
@keyframes interface-feedback-in { from { opacity: .6; } to { opacity: 1; } }
@keyframes interface-section-in {
  from { opacity: .78; transform: translateY(4px); }
  to { opacity: 1; transform: none; }
}

/* Cover older component rules too, including native smooth anchor scrolling.
   The logo's own controller already observes this preference independently. */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto !important; }
  body *, body *::before, body *::after {
    animation: none !important;
    transition: none !important;
    scroll-behavior: auto !important;
  }
}
