/* Shared touch-device rendering and accessibility improvements. */
img { max-width: 100%; }
.image-slot img { height: auto; }

@media (max-width: 767px), (pointer: coarse) {
  /* Avoid repainting full-screen SVG noise and layers of blurred cards. */
  .noise-layer { display: none; }
  #mobileMenu, .project-card, .blog-card, .edu-card, .stats-container,
  .panel, .secret-modal-backdrop, .scroll-top-bar {
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
  }
  #mobileMenu { background: rgba(9, 9, 11, 0.98); }
  .project-card, .blog-card, .edu-card { background-color: #09090B; }
  .star-layer { animation: none; }
  .star-layer::after, .star-layer-large { display: none; }
  .star-layer-small {
    --star-shadows: 4vw 8vh #fff, 23vw 19vh #fff, 68vw 6vh #fff,
      91vw 25vh #fff, 42vw 31vh #fff, 13vw 44vh #fff, 77vw 49vh #fff,
      32vw 62vh #fff, 59vw 73vh #fff, 89vw 88vh #fff, 8vw 93vh #fff,
      49vw 96vh #fff, 83vw 66vh #fff, 17vw 78vh #fff, 55vw 14vh #fff;
  }
  .star-layer-medium {
    --star-shadows: 34vw 9vh #fff, 81vw 34vh #fff, 7vw 58vh #fff,
      63vw 85vh #fff, 95vw 71vh #fff;
  }
  .profile-frame { animation: none; will-change: auto; }
  .underline-svg path { animation: none; stroke-dashoffset: 0; }
  .dynamic-text { transition: none; }
  .tagline { font-size: clamp(1rem, 5vw, 1.25rem); }
  .hero-image { max-width: 100%; }
  .hosting-badge { flex-wrap: wrap; justify-content: center; text-align: center; }
  .tl-item.active-now .tl-dot { animation: none; }
  #menuToggle, .filter-btn, .sw-toggle-btn, .read-link { min-height: 44px; }
  #menuToggle { min-width: 44px; }
  button, a { touch-action: manipulation; }
  .sw-card, .project-card, .blog-card, .edu-card, .filter-btn {
    transition-property: opacity, transform, background-color, border-color, color;
  }
}

.motion-paused, .motion-paused::before, .motion-paused::after,
.motion-paused *, .motion-paused *::before, .motion-paused *::after,
.page-paused *, .page-paused *::before, .page-paused *::after {
  animation-play-state: paused !important;
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto !important; }
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    transition-delay: 0ms !important;
  }
  .underline-svg path { stroke-dashoffset: 0; }
}
