/* Mobile/tablet refinements; keep each concept self-contained. */
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body.responsive-menu-open { overflow: hidden; }
:where(main, footer) :where(a, button, input, select, textarea):focus-visible { outline: 2px solid currentColor; outline-offset: 4px; }
main [id] { scroll-margin-top: 100px; }
@media (max-width: 1024px) {
  input:not([type="checkbox"]):not([type="radio"]), select, textarea { min-width: 0; max-width: 100%; font-size: 16px; }
  button, .button, .btn, input:not([type="checkbox"]):not([type="radio"]), select { min-height: 44px; }
  nav a { min-height: 44px; }
  .menu-toggle, .nav-toggle, .nav__toggle { min-width: 44px; }
  .mobile-menu, .project-view { height: 100dvh; overflow-y: auto; overscroll-behavior: contain; }
  .mobile-menu { justify-content: flex-start; gap: 24px; padding-bottom: max(32px, env(safe-area-inset-bottom)); }
  .mobile-menu > * { flex-shrink: 0; }
  .mobile-menu nav a { line-height: 1.15; }
  dialog { max-width: calc(100vw - 24px); max-height: calc(100dvh - 24px); overflow-y: auto; overscroll-behavior: contain; }
}
@media (hover: none) and (pointer: coarse) {
  a, button, input, select, textarea { touch-action: manipulation; }
  .cursor, .custom-cursor { display: none !important; }
}
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

@media (max-width: 1180px) {
  .mobile-menu { height: 100dvh; overflow-y: auto; overscroll-behavior: contain; }
  .mobile-menu img { display: none; }
  .mobile-menu nav a { padding-block: 14px; font-size: clamp(30px, 6vw, 58px); }
}
@media (max-width: 820px) {
  .archive .section-heading h2, .scrap-title h2, .closing-copy h2 { white-space: normal; overflow-wrap: anywhere; }
  .game-overlay { overflow-y: auto; max-height: 100%; }
  .modal-copy { min-width: 0; }
}
@media (pointer: coarse) {
  .touch-controls { display: none; }
  .game-frame.game-running .touch-controls { display: flex; }
  .touch-controls button { touch-action: none; user-select: none; -webkit-user-select: none; min-width: 54px; min-height: 48px; }
}
