/* Motion layer only: all layout, content, type and color remain in styles.css. */
@media (prefers-reduced-motion: no-preference) {
  @keyframes rise-in {
    from { opacity: 0; transform: translateY(22px); }
    to { opacity: 1; transform: translateY(0); }
  }
  @keyframes menu-link-in {
    from { opacity: 0; transform: translateY(7px); }
    to { opacity: 1; transform: translateY(0); }
  }
  @keyframes atmosphere-drift {
    from { background-position: 0 0, 0 0; }
    to { background-position: 0 0, 14px 0; }
  }

  .hero-meta { animation: rise-in .72s .12s both cubic-bezier(.2,.65,.25,1); }
  .hero-kicker { animation: rise-in .72s .16s both cubic-bezier(.2,.65,.25,1); }
  .hero h1 > span:first-child { animation: rise-in .9s .24s both cubic-bezier(.2,.65,.25,1); }
  .hero-name-last { animation: rise-in .9s .38s both cubic-bezier(.2,.65,.25,1); }
  .hero-description { animation: rise-in .75s .54s both cubic-bezier(.2,.65,.25,1); }
  .hero-link { animation: rise-in .7s .66s both cubic-bezier(.2,.65,.25,1); }
  .hero-index { animation: rise-in .65s .48s both cubic-bezier(.2,.65,.25,1); }
  .hero::before {
    transform: translate3d(var(--hero-shift-x, 0px), var(--hero-shift-y, 0px), 0);
    will-change: transform, background-position;
    animation: atmosphere-drift 24s ease-in-out infinite alternate;
  }

  .reveal { transition: opacity .82s cubic-bezier(.2,.65,.25,1), transform .82s cubic-bezier(.2,.65,.25,1); }
  .process-row:nth-child(2) { transition-delay: .04s; }
  .process-row:nth-child(3) { transition-delay: .08s; }
  .process-row:nth-child(4) { transition-delay: .12s; }
  .process-row:nth-child(5) { transition-delay: .16s; }

  .menu-panel {
    visibility: hidden;
    opacity: 0;
    transform: translateY(-9px);
    transition: opacity .22s ease, transform .28s cubic-bezier(.2,.65,.25,1), visibility .22s;
  }
  .menu-panel.is-open { visibility: visible; opacity: 1; transform: translateY(0); }
  .menu-panel.is-open > a { animation: menu-link-in .32s both cubic-bezier(.2,.65,.25,1); }
  .menu-panel.is-open > a:nth-of-type(1) { animation-delay: .035s; }
  .menu-panel.is-open > a:nth-of-type(2) { animation-delay: .075s; }
  .menu-panel.is-open > a:nth-of-type(3) { animation-delay: .115s; }
  .menu-panel > a b { display: inline-block; transition: transform .2s ease; }
  .menu-panel > a:hover b, .menu-panel > a:focus-visible b { transform: translate(3px, 3px); }
  .menu-toggle { transition: color .2s ease, transform .2s ease; }
  .menu-toggle:hover { color: #d5d5d0; }
  .menu-toggle:active { transform: scale(.97); }

  .text-link span, .back-to-top span, .contact-methods a span { display: inline-block; transition: transform .22s ease; }
  .text-link:hover span { transform: translateY(3px); }
  .back-to-top:hover span, .back-to-top:focus-visible span { transform: translateY(-3px); }
  .contact-methods a:hover span, .contact-methods a:focus-visible span { transform: translate(2px, -2px); }
  .header-contact, .menu-panel > a, .back-to-top, .contact-methods a { transition-duration: .22s; }

  .project-placeholder { transition: transform .42s cubic-bezier(.2,.65,.25,1); }
  .project-placeholder:hover { transform: translateY(-5px); }
  .project-visual { transition: background-color .35s ease, transform .45s cubic-bezier(.2,.65,.25,1); }
  .project-visual img, .project-visual picture { display: block; width: 100%; height: 100%; object-fit: cover; transition: transform .75s cubic-bezier(.2,.65,.25,1), opacity .45s ease; }
  .project-placeholder:hover .project-visual img { transform: scale(1.055); }
  .project-caption span:first-child { transition: letter-spacing .25s ease, color .25s ease; }
  .project-placeholder:hover .project-caption span:first-child { letter-spacing: .13em; color: var(--ink); }
  .process-row h3 { transition: transform .24s ease; }
  .process-row:hover h3 { transform: translateX(3px); }
}

@media (prefers-reduced-motion: no-preference) and (max-width: 760px) {
  .hero-kicker, .hero h1 > span, .hero-description, .hero-link, .hero-meta, .hero-index { animation-duration: .62s; }
  .reveal { transition-duration: .62s; }
  .project-visual img, .project-visual picture { transition-duration: .5s; }
}

@media (hover: none) and (prefers-reduced-motion: no-preference) {
  .project-placeholder:active { transform: scale(.99); }
  .project-placeholder:active .project-visual img { transform: scale(1.035); }
  .menu-panel > a:active { background: #efefeb; }
  .menu-toggle:active { transform: scale(.95); }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto !important; }
  .menu-panel, .menu-panel > a, .project-placeholder, .project-visual, .project-visual img, .project-visual picture,
  .project-caption span:first-child, .menu-toggle, .menu-panel > a b, .text-link span, .back-to-top span,
  .contact-methods a span, .process-row h3 { animation: none !important; transition: none !important; }
}


@media (prefers-reduced-motion: no-preference) {
  .case-image-mark { transition: transform .6s cubic-bezier(.2,.65,.25,1); }
  .case-image-mark--round { transition: transform .6s cubic-bezier(.2,.65,.25,1); }
  .case-image-frame img { transition: transform .75s cubic-bezier(.2,.65,.25,1), opacity .45s ease; }
  .case-figure:hover .case-image-frame img { transform: scale(1.045); }
  .case-figure:hover .case-image-mark:not(.case-image-mark--round) { transform: rotate(51deg) scale(1.035); }
  .case-figure:hover .case-image-mark--round { transform: scale(1.035); }
}

@media (hover: none) and (prefers-reduced-motion: no-preference) {
  .case-figure:active .case-image-frame img { transform: scale(1.025); }
  .case-figure:active .case-image-mark { transform: scale(1.025); }
}

@media (prefers-reduced-motion: reduce) {
  .case-image-mark, .case-image-frame img { animation: none !important; transition: none !important; }
}
