@layer motion {
  :root { --motion-ease: cubic-bezier(.22, 1, .36, 1); }

  .header { transition: box-shadow .3s ease, background .3s ease; }
  .header.has-scrolled { background: rgba(247,247,242,.98); box-shadow: 0 8px 24px #252d2c08; }
  .header::after { content: ""; position: absolute; bottom: -1px; left: 0; width: 100%; height: 2px; background: var(--orange); transform: scaleX(var(--page-progress, 0)); transform-origin: left; pointer-events: none; }

  .hero-photo { animation: scene-in 1.2s var(--motion-ease) both; }
  .hero-photo img { transform: translate3d(0, var(--hero-drift, 0px), 0) scale(1.12); }
  .hero-enter { animation-duration: 1s; animation-timing-function: var(--motion-ease); }
  .hero-enter:nth-child(2) { animation-delay: .14s; }
  .hero-enter:nth-child(3) { animation-delay: .26s; }
  .hero-enter:nth-child(4) { animation-delay: .36s; }
  .hero-enter:nth-child(5) { animation-delay: .46s; }
  .photo-caption, .scroll-cue { animation: scene-in .8s .55s var(--motion-ease) both; }
  .scroll-cue .icon { animation: scroll-nudge 1.4s 1.1s ease-in-out 2; }

  .reveal { transition: opacity .8s var(--motion-ease), transform .8s var(--motion-ease); transition-delay: var(--reveal-delay, 0ms); }
  .reveal.is-waiting { transform: translateY(30px); }
  .service-photo img { transition: transform 1.05s var(--motion-ease); }
  .service.is-waiting .service-photo img { transform: scale(1.1); }
  .about-image { overflow: hidden; }
  .about-image > img { transition: transform 1.2s var(--motion-ease); }
  .about-image.is-waiting > img { transform: scale(1.06); }
  .process-line i { position: relative; overflow: hidden; }
  .process-line i::after { content: ""; position: absolute; inset: 0; background: var(--orange); transform-origin: left; }
  .process-line.is-visible i::after { animation: line-in .85s .15s var(--motion-ease) both; }
  .process-line.is-visible i:last-of-type::after { animation-delay: .4s; }

  .container-illustration { transition: transform .55s var(--motion-ease), filter .55s var(--motion-ease); }
  .product-action .icon { transition: transform .3s var(--motion-ease); }
  .product-action:hover .icon, .product-action:focus-visible .icon { transform: translate(3px, -3px); }
  .button:active { transform: translateY(0) scale(.98); }
  .text-link { transition: color .2s ease, border-color .2s ease; }
  .text-link:hover { color: var(--orange-dark); }
  .mobile-nav:not([hidden]) > * { animation: menu-in .4s var(--motion-ease) both; animation-delay: var(--nav-delay, 0ms); }
  .menu-toggle .icon { animation: icon-in .25s var(--motion-ease); }
  .waste-item summary { transition: color .2s ease; }
  .waste-item[open] summary { color: var(--orange-dark); }
  .waste-item summary .icon { transition: transform .35s var(--motion-ease); }

  dialog[open] { animation: modal-in .38s var(--motion-ease) both; }
  dialog[open]::backdrop { animation: backdrop-in .3s ease both; }
  dialog.is-closing { pointer-events: none; }
  .step.current span { animation: selected-in .3s var(--motion-ease); }
  .choice[aria-pressed=true]::after { animation: selected-in .3s var(--motion-ease); }
  .choice { transition: border-color .2s ease, background .2s ease, box-shadow .2s ease; }
  .review-success { animation: menu-in .4s var(--motion-ease) both; }
  .toast:not([hidden]) { animation: toast-in .3s var(--motion-ease) both; }

  @media (hover: hover) and (pointer: fine) {
    .container-product:hover .container-illustration { transform: translateY(-7px) scale(1.035) rotate(-.7deg); filter: drop-shadow(0 8px 5px #252d2c12); }
    .size-choice:hover .container-illustration { transform: translateY(-3px) scale(1.04); }
    .choice:hover { box-shadow: 0 4px 12px #252d2c07; }
  }
  @media (max-width: 740px) {
    .hero-photo img { transform: none; }
    .reveal.is-waiting { transform: translateY(20px); }
    .reveal { transition-duration: .6s; }
    .container-product:hover .container-illustration { transform: none; }
  }
  @media (prefers-reduced-motion: reduce) {
    .hero-photo img, .reveal, .reveal.is-waiting, .service-photo img, .about-image > img,
    .container-product:hover .container-illustration, .size-choice:hover .container-illustration,
    .button:hover, .button:active { transform: none; }
    .header::after { display: none; }
    .reveal.is-waiting { opacity: 1; }
    .container-illustration { filter: none; }
  }

  @keyframes scene-in { from { opacity: 0; } to { opacity: 1; } }
  @keyframes scroll-nudge { 0%, 100% { transform: rotate(90deg) translateX(0); } 50% { transform: rotate(90deg) translateX(5px); } }
  @keyframes line-in { from { transform: scaleX(0); } to { transform: scaleX(1); } }
  @keyframes menu-in { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: translateY(0); } }
  @keyframes icon-in { from { opacity: .3; transform: rotate(-25deg) scale(.8); } to { opacity: 1; transform: rotate(0) scale(1); } }
  @keyframes modal-in { from { opacity: 0; transform: translateY(25px) scale(.985); } to { opacity: 1; transform: translateY(0) scale(1); } }
  @keyframes backdrop-in { from { opacity: 0; } to { opacity: 1; } }
  @keyframes selected-in { from { opacity: .4; transform: scale(.65); } to { opacity: 1; transform: scale(1); } }
  @keyframes toast-in { from { opacity: 0; transform: translate(-50%, 12px); } to { opacity: 1; transform: translate(-50%, 0); } }
}
