/* Touch scrolling changes the visual viewport as browser controls appear and hide.
   Keep decorative hero height tied to the stable, small viewport instead. */
@media (pointer: coarse), (hover: none) {
  .hero { min-height: var(--ef-stable-viewport-height, 100vh) !important; }
  .page-hero { min-height: calc(var(--ef-stable-viewport-height, 100vh) * .52) !important; }
  .about-page .page-hero { min-height: 0 !important; }
  @media (max-width: 980px) {
    .hero { min-height: calc(var(--ef-stable-viewport-height, 100vh) * .86) !important; }
  }
  @supports (height: 100svh) {
    .hero { min-height: 100svh !important; }
    .page-hero { min-height: 52svh !important; }
    .about-page .page-hero { min-height: 0 !important; }
    @media (max-width: 980px) { .hero { min-height: 86svh !important; } }
  }
}

/* A tap can leave :hover latched on a phone. Suppress only decorative movement;
   active selections, modal positioning, scrolling, and controls retain their behavior. */
@media (pointer: coarse), (hover: none), (prefers-reduced-motion: reduce) {
  :is(.btn-cta, .btn-secondary, .ghost-btn, .edit-btn, .danger-btn, .btn-signin,
    .theme-toggle, .course-card, .feature-card, .resource-tile, .dashboard-hero-card,
    .test-card, .card[href], .modal-x, .homework-tab, .event-chip, .homework-command,
    .league-rank-row, .pretty-file):hover,
  .course-card:hover .course-card-glow,
  :is(.privacy-game-options, .privacy-choice-grid, .league-privacy-control, .league-subject-tabs) button {
    transform: none !important;
  }
  :is(.btn-cta, .btn-secondary, .ghost-btn, .edit-btn, .danger-btn, .btn-signin,
    .theme-toggle, .card, .resource-tile, .list-row, .bundle-choice-card, .course-card-glow,
    .modal-x, .homework-tab, .event-chip, .homework-command, .league-rank-row, .pretty-file,
    .privacy-game-options button, .privacy-choice-grid button, .league-privacy-control button,
    .league-subject-tabs button) {
    transition-property: color, background-color, border-color, opacity !important;
  }
  .league-podium-slot, .league-gap-track span, .league-rank-score i, .course-progress-fill {
    animation: none !important;
  }
}

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