@media (prefers-reduced-motion: no-preference) {
  :root {
    --motion-ease: cubic-bezier(.22, 1, .36, 1);
    --motion-fast: 180ms;
  }

  .hero-content { animation: none; }
  .hero-kicker, .hero h1, .hero-note, .topic-intro h1 {
    animation: motion-in 580ms var(--motion-ease) backwards;
  }
  .hero h1 { animation-delay: 65ms; }
  .hero-note { animation-delay: 140ms; }
  .hero-doodle { animation: motion-doodle 1050ms var(--motion-ease) 100ms backwards; }

  .content-appeared:not(.reveal) {
    animation: motion-in 520ms var(--motion-ease) backwards;
  }
  .theme-grid > .content-appeared:nth-child(even):not(.reveal) { animation-delay: 55ms; }

  #videoDialog[open], .search-dialog[open] {
    animation: motion-dialog 230ms var(--motion-ease) backwards;
  }

  .theme-card, .portfolio-writing-card {
    transition: translate var(--motion-fast) var(--motion-ease), box-shadow var(--motion-fast), border-color var(--motion-fast);
  }
  .soft-button, .search-button, .icon-button {
    transition: background var(--motion-fast), border-color var(--motion-fast), scale var(--motion-fast);
  }
  .soft-button:active, .search-button:active, .icon-button:active { scale: .96; }

  @media (hover: hover) and (pointer: fine) {
    .theme-card:hover, .portfolio-writing-card:focus-within {
      translate: 0 -3px;
      box-shadow: 0 7px 18px #50376119;
    }
    .card-action .icon, .video-image img {
      transition: translate var(--motion-fast) var(--motion-ease), scale 360ms var(--motion-ease);
    }
    .theme-card:hover .card-action .icon { translate: 3px 0; }
    .video-image:hover img { scale: 1.045; }
  }

  @keyframes motion-in {
    from { opacity: .62; transform: translateY(12px); }
    to { opacity: 1; transform: translateY(0); }
  }

  @keyframes motion-doodle {
    from { opacity: 0; transform: translateY(12px) rotate(-9deg); }
    62% { opacity: .8; transform: translateY(-4px) rotate(14deg); }
    to { opacity: .8; transform: translateY(0) rotate(9deg); }
  }

  @keyframes motion-dialog {
    from { opacity: .2; transform: translateY(8px) scale(.98); }
    to { opacity: 1; transform: translateY(0) scale(1); }
  }
}
