/* Lunisc interaction feedback — calm, deliberate, CSS-only.
 * No scroll reveals, page-wide entrances, layout-changing or bouncing effects.
 * All movements are optional and limited to pointer-capable devices.
 */
:root {
  --lunisc-motion-color: 300ms;
  --lunisc-motion-surface: 400ms;
  --lunisc-motion-ease: cubic-bezier(.22, .61, .36, 1);
}

/* Keyboard, hover and press states; no button movement. */
:is(.btn, .small-btn, .icon-btn, .lunisc-filter-toggle,
  .lunisc-faq-search-btn, .lunisc-faq-clear-btn, .lunisc-support-send,
  .rf-button, .lunisc-transport-button, .registration-fees-tab) {
  transition: background-color var(--lunisc-motion-color) ease,
    border-color var(--lunisc-motion-color) ease,
    color var(--lunisc-motion-color) ease,
    box-shadow var(--lunisc-motion-surface) var(--lunisc-motion-ease);
}
:is(.tab, .fac-tabs a, .major-tabs a, .studybags-view-tabs a,
  .projects-view-tabs a, .researches-view-tabs a, .notifications-tabs a,
  .main-nav>a, .nav-more>button, .more-menu a) {
  transition: background-color var(--lunisc-motion-color) ease,
    border-color var(--lunisc-motion-color) ease,
    color var(--lunisc-motion-color) ease,
    box-shadow var(--lunisc-motion-color) ease;
}

/* Gentle color/shadow feedback rather than 'floating' result rows. */
:is(.facinst-card, .fac-card, .majors-row, .major-card,
  .studybag-row, .project-row, .research-row,
  .lunisc-news-card-link, .lunisc-circulars-item,
  .academic-student-card, .lunisc-dorms-option,
  .home-refresh .shortcut, .home-refresh .home-update-card,
  .resource, .work, .lunisc-faq-item,
  .facinst-resource, .facinst-major-row) {
  transition: border-color var(--lunisc-motion-surface) ease,
    background-color var(--lunisc-motion-surface) ease,
    box-shadow var(--lunisc-motion-surface) var(--lunisc-motion-ease);
}

:is(.form-control, .search-box input, .search-mini, .results-search input,
  .facinst-search-field input, .majors-search-field input,
  .studybags-filter input, .studybags-filter select,
  .projects-filter input, .projects-filter select,
  .researches-filter input, .researches-filter select,
  .studybag-editor input, .studybag-editor textarea, .studybag-editor select,
  .project-editor input, .project-editor textarea, .project-editor select,
  .research-editor input, .research-editor textarea, .research-editor select,
  .lunisc-faq-search-field input, .lunisc-faq-select-field select,
  .lunisc-support-form input, .lunisc-support-form textarea,
  .lunisc-support-form select) {
  transition: border-color var(--lunisc-motion-color) ease,
    box-shadow var(--lunisc-motion-surface) ease,
    background-color var(--lunisc-motion-color) ease;
}
:is(.form-control, .results-search input,
  .facinst-search-field input, .majors-search-field input,
  .studybags-filter input, .studybags-filter select,
  .projects-filter input, .projects-filter select,
  .researches-filter input, .researches-filter select,
  .studybag-editor input, .studybag-editor textarea, .studybag-editor select,
  .project-editor input, .project-editor textarea, .project-editor select,
  .research-editor input, .research-editor textarea, .research-editor select,
  .lunisc-faq-search-field input, .lunisc-faq-select-field select,
  .lunisc-support-form input, .lunisc-support-form textarea,
  .lunisc-support-form select):focus-visible {
  border-color: #83a9d5;
  box-shadow: 0 0 0 3px rgba(45,96,161,.09);
}

/* Older component styles sometimes move on hover; keep them still instead. */
:is(.home-refresh .shortcut, .facinst-card, .lunisc-news-card-link,
  .lunisc-circulars-item, .academic-student-card, .lunisc-cover-card):hover,
.home-refresh .shortcut:focus-visible {
  transform: none;
}

@media (hover: hover) and (pointer: fine) and (prefers-reduced-motion: no-preference) {
  /* Override older instant lifts: rest-state positions do not shift. */
  :is(.facinst-card, .fac-card, .majors-row, .major-card,
    .studybag-row, .project-row, .research-row,
    .lunisc-news-card-link, .lunisc-circulars-item,
    .academic-student-card, .lunisc-dorms-option,
    .home-refresh .shortcut):hover,
  .home-refresh .shortcut:focus-visible { transform: none; }

  :is(.facinst-card, .fac-card, .major-card,
    .lunisc-news-card-link, .academic-student-card,
    .lunisc-dorms-option, .home-refresh .shortcut):hover {
    box-shadow: 0 5px 15px rgba(27, 58, 94, .055);
  }
  :is(.btn, .small-btn, .icon-btn, .lunisc-filter-toggle,
    .lunisc-faq-search-btn, .lunisc-faq-clear-btn, .lunisc-support-send,
    .rf-button, .lunisc-transport-button):not(:disabled):not([aria-disabled="true"]):hover {
    box-shadow: 0 3px 10px rgba(27, 58, 94, .055);
    transform: none;
  }
  /* Only photos that already use interactive hover, never full-page zoom. */
  :is(.lunisc-news-cover, .project-image-tile, .facinst-album-item) img {
    transition: transform 450ms var(--lunisc-motion-ease);
  }
  :is(.lunisc-news-card-link:hover .lunisc-news-cover,
    .project-image-tile:hover, .facinst-album-item:hover) img {
    transform: scale(1.012);
  }
}

/* Touch devices should never keep a lifted element after tapping. */
@media (hover: none) {
  .home-refresh .shortcut:hover, .home-refresh .shortcut:focus-visible,
  .facinst-card:hover, .lunisc-news-card-link:hover {
    transform: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  :is(.btn, .small-btn, .icon-btn, .lunisc-filter-toggle,
    .lunisc-faq-search-btn, .lunisc-faq-clear-btn, .lunisc-support-send,
    .rf-button, .lunisc-transport-button, .registration-fees-tab,
    .tab, .fac-tabs a, .major-tabs a, .studybags-view-tabs a,
    .projects-view-tabs a, .researches-view-tabs a,
    .notifications-tabs a, .main-nav>a, .nav-more>button, .more-menu a,
    .facinst-card, .fac-card, .majors-row, .major-card,
    .studybag-row, .project-row, .research-row,
    .lunisc-news-card-link, .lunisc-circulars-item,
    .academic-student-card, .lunisc-dorms-option,
    .home-refresh .shortcut, .home-refresh .home-update-card,
    .resource, .work, .lunisc-faq-item, .facinst-resource,
    .facinst-major-row, .form-control) { transition: none !important; }
  .home-refresh .shortcut:hover, .home-refresh .shortcut:focus-visible,
  .facinst-card:hover, .lunisc-news-card-link:hover,
  .btn:hover, .btn:active, .small-btn:hover, .small-btn:active {
    transform: none !important;
  }
  :is(.lunisc-news-cover, .project-image-tile, .facinst-album-item) img {
    transition: none !important;
  }
  :is(.lunisc-news-card-link:hover .lunisc-news-cover,
    .project-image-tile:hover, .facinst-album-item:hover) img {
    transform: none !important;
  }
}
