/* Lunisc — lightweight app motion (2026-10-23).
   No JavaScript, dependencies, scroll observers, or layout-changing animation.
   The page remains readable even when CSS animations are unsupported. */

:root {
  --lunisc-app-ease: cubic-bezier(.22, 1, .36, 1);
  --lunisc-app-fast: 155ms;
  --lunisc-app-normal: 240ms;
}

@media (prefers-reduced-motion: no-preference) {
  /* A small entrance for ordinary pages; the registration wizard already
     has its own dedicated stage animation in auth-polish.css. */
  @keyframes lunisc-app-page-enter {
    from { opacity: .87; }
    to { opacity: 1; }
  }
  @keyframes lunisc-app-content-enter {
    from { opacity: .82; transform: translate3d(0, 7px, 0); }
    to { opacity: 1; transform: translate3d(0, 0, 0); }
  }
  @keyframes lunisc-app-popover-enter {
    from { opacity: .55; transform: translate3d(0, -5px, 0); }
    to { opacity: 1; transform: translate3d(0, 0, 0); }
  }

  body > main:not(.registration-page) {
    animation: lunisc-app-page-enter 210ms ease-out both;
  }
  body > main:not(.registration-page) :is(
    .page-title, .facinst-hero, .home-hero, .lunisc-legal-hero,
    .projects-title-row, .researches-title-row
  ) {
    animation: lunisc-app-content-enter 310ms var(--lunisc-app-ease) both;
  }
  .home-refresh .home-highlights {
    animation: lunisc-app-content-enter 340ms var(--lunisc-app-ease) 50ms both;
  }
  .home-refresh > .container > .section:nth-of-type(3) > .section-head {
    animation: lunisc-app-content-enter 340ms var(--lunisc-app-ease) 85ms both;
  }

  /* Menus feel responsive, but never trap content behind a delayed display. */
  .more-menu:not([hidden]),
  .header-notification-panel:not([hidden]) {
    animation: lunisc-app-popover-enter 170ms var(--lunisc-app-ease) both;
  }
  :is(.facinst-tab-panel, .major-tab-panel):not([hidden]) {
    animation: lunisc-app-page-enter 200ms ease-out both;
  }

  /* Taps are restrained: feedback without bouncing or expanding layouts. */
  :is(.btn, .small-btn, .icon-btn, .auth-link, .sheet-item,
      .registration-fees-tab, .lunisc-transport-button,
      .lunisc-support-send, .rf-button,
      .profile-menu-trigger, .profile-menu a, .profile-menu button,
      .mobile-nav a, .mobile-nav button) {
    transition: color var(--lunisc-app-fast) ease,
      background-color var(--lunisc-app-fast) ease,
      border-color var(--lunisc-app-fast) ease,
      box-shadow var(--lunisc-app-fast) ease,
      transform var(--lunisc-app-fast) var(--lunisc-app-ease);
  }
  :is(.btn, .small-btn, .icon-btn, .auth-link, .sheet-item,
      .lunisc-transport-button, .rf-button):not(:disabled):active {
    transform: translate3d(0, 1px, 0);
  }
  .mobile-nav :is(a, button):active svg {
    transform: scale(.93);
  }
  .mobile-nav :is(a, button) svg {
    transition: transform var(--lunisc-app-fast) var(--lunisc-app-ease),
      color var(--lunisc-app-fast) ease;
  }
  .mobile-nav :is(a, button).active svg {
    transform: translate3d(0, -1px, 0);
  }
  /* A calm active indicator, shared by EN and AR. */
  .mobile-nav :is(a, button) { position: relative; }
  .mobile-nav :is(a, button).active::before {
    content: '';
    position: absolute;
    top: -5px;
    inset-inline: calc(50% - 9px);
    height: 2px;
    border-radius: 99px;
    background: var(--blue);
  }

  @media (hover: hover) and (pointer: fine) {
    main :is(.facinst-card, .major-card, .academic-student-card,
      .lunisc-news-card-link, .lunisc-circulars-item,
      .lunisc-dorms-option, .shortcut):hover {
      transform: translate3d(0, -1px, 0);
      box-shadow: 0 6px 18px rgba(33, 75, 125, .075);
    }
    main :is(.studybag-row, .project-row, .research-row, .home-update-card):hover {
      box-shadow: 0 4px 16px rgba(33, 75, 125, .055);
    }
  }

  /* The mobile More sheet uses opacity + translate instead of appearing
     instantly. Closing remains animated because display stays flex. */
  .sheet {
    display: flex;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity 190ms ease, visibility 0s linear 190ms;
  }
  .sheet.open {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
    transition: opacity 190ms ease, visibility 0s;
  }
  .sheet-panel {
    transform: translate3d(0, 14px, 0);
    transition: transform var(--lunisc-app-normal) var(--lunisc-app-ease);
  }
  .sheet.open .sheet-panel { transform: translate3d(0, 0, 0); }
}

@media (prefers-reduced-motion: reduce) {
  /* Override animations introduced here. Existing interactions remain instant. */
  body > main:not(.registration-page),
  body > main :is(.page-title, .facinst-hero, .home-hero,
    .lunisc-legal-hero, .projects-title-row, .researches-title-row),
  .home-refresh .home-highlights,
  .home-refresh > .container > .section:nth-of-type(3) > .section-head,
  .more-menu:not([hidden]), .header-notification-panel:not([hidden]),
  :is(.facinst-tab-panel, .major-tab-panel):not([hidden]) {
    animation: none !important;
  }
  .mobile-nav :is(a, button) svg { transition: none !important; }
}
