/* Shared motion: brief feedback, visible content, and no movement during reading. */
:root {
  --motion-out: cubic-bezier(.22, .72, .25, 1);
  --motion-fast: 180ms;
  --motion-panel: 280ms;
}
.reading-progress { position: fixed; inset: 0 0 auto; height: 2px; z-index: 20; pointer-events: none; }
.reading-progress span { display: block; height: 100%; background: var(--accent); transform: scaleX(0); transform-origin: left; }
@keyframes panel-enter { from { opacity: .6; transform: translateY(5px); } to { opacity: 1; transform: none; } }
@keyframes dialog-enter { from { opacity: .5; transform: translateY(8px) scale(.99); } to { opacity: 1; transform: none; } }
@keyframes settle-up { from { transform: translateY(10px); } to { transform: none; } }
@keyframes icon-enter { from { opacity: .3; transform: rotate(-20deg) scale(.85); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: no-preference) {
  html { scroll-behavior: smooth; }
  .button, .icon-button, .work-card, .comparison-tabs button, .report-contents a,
  .filter-button, .related-projects a, .about-index a {
    transition: background-color var(--motion-fast), color var(--motion-fast),
      border-color var(--motion-fast), transform var(--motion-panel) var(--motion-out),
      box-shadow var(--motion-panel);
  }
  .hero-copy h1, .page-heading h1, .hero-figure { animation: settle-up .5s var(--motion-out); }
  .comparison-panel:not([hidden]) { animation: panel-enter var(--motion-panel) var(--motion-out); }
  dialog[open] { animation: dialog-enter 220ms var(--motion-out); }
  .theme-icon:not([hidden]) { animation: icon-enter 200ms var(--motion-out); }
  .site-header { transition: background-color 180ms, box-shadow 180ms; }
  .nav a { position: relative; }
  .nav a::after {
    content: ""; position: absolute; inset: auto 0 -.35rem; height: 2px;
    background: var(--accent); transform: scaleX(0); transform-origin: left;
    transition: transform var(--motion-fast);
  }
  .nav a[aria-current]::after, .nav a:focus-visible::after { transform: scaleX(1); }
  .text-link span, .row-arrow, .figure-action { transition: transform var(--motion-fast) var(--motion-out); }
  .button:active, .icon-button:active { transform: scale(.97); }
  @media (hover: hover) and (pointer: fine) {
    .work-card:is(:hover, :focus-visible) { transform: translateY(-3px); border-color: var(--accent); box-shadow: 0 12px 26px -20px #102e3455; }
    .button:hover { transform: translateY(-1px); }
    .nav a:hover::after { transform: scaleX(1); }
    a:hover .row-arrow, a:hover .figure-action, .text-link:hover span { transform: translate(2px, -2px); }
    .related-projects a:hover { transform: translateY(-2px); border-color: var(--accent); }
  }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto !important; }
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
