/* Brief entrances and responsive feedback, with no continuous background motion. */
@keyframes rise-in {
  from { opacity: 0; translate: 0 24px; }
  to { opacity: 1; translate: 0 0; }
}

@keyframes hero-settle {
  from { transform: scale(1.08); }
  to { transform: scale(1); }
}

@keyframes menu-in {
  from { opacity: 0; translate: 0 -8px; }
  to { opacity: 1; translate: 0 0; }
}

@keyframes answer-in {
  from { opacity: 0; translate: 0 -5px; }
  to { opacity: 1; translate: 0 0; }
}

@media (prefers-reduced-motion: no-preference) {
  .hero-copy > * {
    animation: rise-in 850ms cubic-bezier(.2,.65,.25,1) both;
  }
  .hero-copy > :nth-child(2) { animation-delay: 80ms; }
  .hero-copy > :nth-child(3) { animation-delay: 170ms; }
  .hero-copy > :nth-child(4) { animation-delay: 240ms; }
  .hero-copy > :nth-child(5) { animation-delay: 310ms; }
  .hero-copy > :nth-child(6) { animation-delay: 390ms; }
  .hero-visual { animation: rise-in 1100ms 120ms cubic-bezier(.2,.65,.25,1) both; }
  .hero-art { animation: hero-settle 4400ms cubic-bezier(.15,.5,.3,1) both; }
  .art-caption { animation: rise-in 850ms 450ms cubic-bezier(.2,.65,.25,1) both; }

  .reveal-in {
    animation: rise-in 750ms var(--reveal-delay, 0ms) cubic-bezier(.2,.65,.25,1) both;
  }
  .work-card:nth-child(2), .principles > :nth-child(2),
  .involve-grid article:nth-child(2), .lab-stats > :nth-child(2),
  .project-card:nth-child(even) { --reveal-delay: 90ms; }
  .work-card:nth-child(3), .principles > :nth-child(3),
  .involve-grid article:nth-child(3), .lab-stats > :nth-child(3) { --reveal-delay: 180ms; }
  .lab-stats > :nth-child(4) { --reveal-delay: 270ms; }

  .button > span, .text-link > span, .project-category > span:last-child,
  .preview-bottom > span, .project-symbol, .work-icon {
    transition: transform 280ms cubic-bezier(.2,.65,.25,1);
  }
  .button:is(:hover, :focus-visible) > span,
  .project-card:is(:hover, :focus-visible) .project-category > span:last-child {
    transform: translate(3px, -3px);
  }
  .text-link:is(:hover, :focus-visible) > span,
  .preview-bottom:is(:hover, :focus-visible) > span { transform: translateX(4px); }
  .project-card:is(:hover, :focus-visible) .project-symbol { transform: translateY(-3px) rotate(-4deg); }
  .work-card:is(:hover, :focus-within) .work-icon { transform: translateY(-3px); }
  .work-card { transition: box-shadow 280ms, border-color 280ms; }
  .work-card:is(:hover, :focus-within) { box-shadow: 0 12px 30px #153c3210; border-color: #a9bea3; }
  details[open] > p { animation: answer-in 280ms ease-out; }
  dialog[open] { animation: rise-in 240ms ease-out; }
  .header-inner nav.open { animation: menu-in 220ms ease-out; }

  /* Keyboard focus never waits for an entrance to finish. */
  .reveal-in:focus-within, .hero-copy > :focus-within { animation: none; }
}

@media (max-width: 760px) {
  .reveal-in { --reveal-delay: 0ms; animation-delay: 0ms; }
}

@media (prefers-reduced-motion: reduce) {
  .hero-copy > *, .hero-visual, .hero-art, .art-caption, .reveal-in {
    animation: none !important;
    opacity: 1;
    translate: none;
  }
}

@media print {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
