/* MASSIMOBILITY / CINEMATIC INTERACTIONS — PREVIEW 1
   Progressive UI motion only. Nothing here modifies educational copy, navigation
   routing, quiz answers, anatomy coordinates, or flashcard state. */
:root{
  --cinema-ease: cubic-bezier(.2,.8,.2,1);
  --cinema-enter: cubic-bezier(.16,1,.3,1);
  --cinema-accent: #45bdea;
}

/* Cross-document navigation: native progressive enhancement, no click delays or JS interception. */
@view-transition { navigation: auto; }
@keyframes cinema-page-out { to { opacity:0; transform:translateY(-5px); } }
@keyframes cinema-page-in  { from { opacity:0; transform:translateY(12px); } to { opacity:1; transform:none; } }
@media (prefers-reduced-motion: no-preference){
  ::view-transition-old(root){animation:170ms ease both cinema-page-out}
  ::view-transition-new(root){animation:410ms var(--cinema-enter) both cinema-page-in}
}

/* Tactile interactions: quiet precision instead of attention-seeking glows. */
:where(.button,.nav-cta,.signature-path,.source-card,.condition-card,.pt-card,
       .fc-control,.fc-toolbar-button,.fc-reviewed-button,.fc-region,
       .movement-mode-button,.movement-region-button,.atlas-system-tab,
       .atlas-viewbar button,.atlas-key-button,.atlas-primary,
       .atlas-zoom-controls button,.take-quiz,.quiz-next,.quiz-restart,
       .quiz-modal-close,.close-modal,.filter,.open-guide,.signature-menu-toggle){
  -webkit-tap-highlight-color:transparent;
}
:where(.button,.nav-cta,.fc-control,.fc-toolbar-button,.fc-reviewed-button,
       .movement-mode-button,.movement-region-button,.atlas-system-tab,
       .atlas-viewbar button,.atlas-key-button,.atlas-primary,
       .atlas-zoom-controls button,.filter,.take-quiz,.quiz-next,
       .quiz-restart,.close-modal,.quiz-modal-close,.open-guide){
  transition-property:color,background-color,border-color,box-shadow,transform;
  transition-duration:200ms,200ms,200ms,260ms,240ms;
  transition-timing-function:ease,ease,ease,var(--cinema-ease),var(--cinema-ease);
}
@media(hover:hover) and (pointer:fine){
 :where(.atlas-system-tab,.atlas-key-button,.movement-region-button,.movement-mode-button,
       .fc-region,.fc-control:not(:disabled),.fc-toolbar-button,.fc-reviewed-button,
       .atlas-primary,.atlas-zoom-controls button,.quiz-next,.take-quiz,.filter):hover{
   transform:translateY(-2px);
 }
 :where(.signature-path,.condition-card,.source-card,.pt-card):hover{transform:translateY(-3px)}
 .signature-path:hover{box-shadow:0 18px 48px rgba(7,33,52,.15)}
 .signature-path:hover .signature-arrow{transform:translate(2px,-2px)}
}
:where(.button,.nav-cta,.fc-control,.fc-toolbar-button,.fc-reviewed-button,
       .movement-mode-button,.movement-region-button,.atlas-system-tab,.atlas-viewbar button,
       .atlas-key-button,.atlas-primary,.atlas-zoom-controls button,.take-quiz,.quiz-next,
       .quiz-restart,.close-modal,.quiz-modal-close,.filter,.open-guide,
       .signature-menu-toggle):not(:disabled):active{transform:translateY(0) scale(.975)}
:where(.button,.nav-cta,.signature-path,.fc-control,.atlas-primary,.movement-region-button):focus-visible{
  outline:3px solid var(--cinema-accent);
  outline-offset:3px;
}

/* Navigation menus unfold with a small physical displacement. */
@media(prefers-reduced-motion:no-preference){
 .nav-dropdown.open .nav-dropdown-menu{animation:cinema-menu-enter 235ms var(--cinema-enter) both}
 .nav-subdropdown.open .nav-subdropdown-menu{animation:cinema-menu-enter 235ms var(--cinema-enter) both}
 @keyframes cinema-menu-enter{from{opacity:0;transform:translateY(-7px)}to{opacity:1;transform:translateY(0)}}
 @media(max-width:980px){
  .signature-nav-ready .site-header.signature-menu-open .nav{animation:cinema-menu-enter 320ms var(--cinema-enter) both}
  .signature-nav-ready .site-header .nav-dropdown.open .nav-dropdown-menu{animation:cinema-mobile-submenu 230ms var(--cinema-enter) both}
  @keyframes cinema-mobile-submenu{from{opacity:0;transform:translateY(-5px)}to{opacity:1;transform:none}}
 }
}

/* Dialog entrances: no giant scaling, no attention-stealing bounce. */
@keyframes cinema-backdrop-enter{from{opacity:0}to{opacity:1}}
@keyframes cinema-dialog-enter{from{opacity:0;transform:translateY(16px) scale(.985)}to{opacity:1;transform:none}}
@media(prefers-reduced-motion:no-preference){
 .quiz-modal-overlay:not([hidden]),.anatomy-modal.open{animation:cinema-backdrop-enter 230ms ease both}
 .quiz-modal-overlay:not([hidden]) .quiz-modal-card,
 .anatomy-modal.open .anatomy-dialog{animation:cinema-dialog-enter 390ms var(--cinema-enter) both}
 /* Existing anatomy close-up image uses an overly dramatic 65% start scale. */
 .anatomy-modal.open .zoom-visual :where(svg,.anatomy-photo){animation:cinema-closeup-enter 440ms var(--cinema-enter) both}
 @keyframes cinema-closeup-enter{from{opacity:.3;transform:scale(.965)}to{opacity:1;transform:none}}
}

/* A selected mode gets a clearly visible, stable destination. */
.atlas-system-tab[aria-pressed="true"],.movement-mode-button.is-active,.fc-region.is-active{
  box-shadow:inset 0 1px rgba(255,255,255,.12),0 10px 23px rgba(3,34,55,.13);
}
.atlas-viewbar button[aria-pressed="true"]{box-shadow:0 3px 13px rgba(5,40,62,.13)}
.atlas-key-button[aria-pressed="true"]{box-shadow:inset 3px 0 0 #39aec9}

/* Scene change within the atlas: only the artwork fades, never the pan/zoom container.
   Pins and coordinates stay exactly where the original controller puts them. */
@media(prefers-reduced-motion:no-preference){
 #atlas-image.cinema-image-enter{animation:cinema-anatomy-enter 420ms var(--cinema-enter) both}
 @keyframes cinema-anatomy-enter{from{opacity:.18;filter:blur(3px)}to{opacity:1;filter:none}}
 .atlas-details-card.cinema-details-enter :where(.atlas-details-top,.atlas-summary,
       .atlas-structure-list,.atlas-structure-note,.atlas-detail-actions){
   animation:cinema-content-enter 320ms var(--cinema-enter) both;
 }
}

/* Rendered region and mode changes in Movement Library: fresh content glides in.
   No extra rerender and no delay to selecting a region. */
@keyframes cinema-content-enter{from{opacity:.26;transform:translateY(8px)}to{opacity:1;transform:none}}
@media(prefers-reduced-motion:no-preference){
 #movement-feature > *{animation:cinema-content-enter 340ms var(--cinema-enter) both}
 #movement-feature > *:nth-child(2){animation-delay:35ms}
 #movement-feature > *:nth-child(3){animation-delay:65ms}
 #movement-feature:focus-within{scroll-margin-top:100px}
}

/* Study cards retain the original 3D flip. Deck navigation has its own softer swap. */
@media(prefers-reduced-motion:no-preference){
 #fc-card.cinema-card-next{animation:cinema-card-next 300ms var(--cinema-enter) both}
 #fc-card.cinema-card-prev{animation:cinema-card-prev 300ms var(--cinema-enter) both}
 @keyframes cinema-card-next{from{opacity:.36;transform:translateX(11px) scale(.993)}to{opacity:1;transform:none}}
 @keyframes cinema-card-prev{from{opacity:.36;transform:translateX(-11px) scale(.993)}to{opacity:1;transform:none}}
 .fc-progress-bar{transition:width 350ms var(--cinema-ease)}
 .quiz-questions > .quiz-q{animation:cinema-content-enter 300ms var(--cinema-enter) both}
 .quiz-questions > .quiz-q:nth-child(2){animation-delay:50ms}
 .quiz-questions > .quiz-q:nth-child(3){animation-delay:80ms}
 .condition-card:not(.hidden){animation:cinema-content-enter 350ms var(--cinema-enter) both}
}

/* The card's existing 3D flip remains readable during user-initiated study changes. */
.fc-card:focus-visible{outline:3px solid #27b4df;outline-offset:4px}

/* Keyboard, touch, and motion-sensitive visitors never need animation to use a feature. */
@media(prefers-reduced-motion:reduce){
 ::view-transition-old(root),::view-transition-new(root){animation:none!important}
 #atlas-image,#fc-card,#movement-feature>*,.quiz-modal-card,.anatomy-dialog,
 .condition-card,.quiz-questions>.quiz-q{animation:none!important}
}
