/* A quiet, shared motion language. Artwork keeps its full frame. */
:root {
  --motion-ease: cubic-bezier(.22, 1, .36, 1);
  --motion-fast: 180ms;
  --motion-image: 420ms;
}

:is(.button, .hd-action, .sc-action, .evidence-action, .menu-toggle, .lightbox button) {
  transition: translate var(--motion-fast) var(--motion-ease),
    background-color var(--motion-fast), color var(--motion-fast),
    border-color var(--motion-fast), box-shadow var(--motion-fast);
}
.project-card {
  transition: translate 320ms var(--motion-ease);
}
.project-card :is(.artwork, .editorial-panel) {
  transition: box-shadow var(--motion-image) var(--motion-ease);
}
.project-card :is(.artwork img, .editorial-name) {
  transition: scale var(--motion-image) var(--motion-ease),
    translate var(--motion-image) var(--motion-ease);
}
:is(.zoomable, .sc-image-link, .feature-art .phone, .hd-device) {
  transition: translate var(--motion-image) var(--motion-ease),
    scale var(--motion-image) var(--motion-ease),
    box-shadow var(--motion-image) var(--motion-ease);
}
:is(.text-link, .nav-links a, .case-nav a, .chapters a, .hd-toc a, .sc-toc a, .resume-toc a, .evidence-toc a) {
  text-decoration-line: underline;
  text-decoration-color: transparent;
  text-underline-offset: 6px;
  text-decoration-thickness: 1px;
  transition: text-decoration-color var(--motion-fast), color var(--motion-fast);
}
:is(.text-link, .nav-links a, .case-nav a, .chapters a, .hd-toc a, .sc-toc a, .resume-toc a, .evidence-toc a):focus-visible,
.project-card:focus-visible .text-link {
  text-decoration-color: currentColor;
}
.zoomable:focus-visible {
  outline: 3px solid #2373ce;
  outline-offset: 6px;
}
.project-card:focus-visible { translate: 0 -4px; }
.project-card:focus-visible :is(.artwork, .editorial-panel) {
  box-shadow: 0 16px 32px -20px #25282355;
}
.project-card:focus-visible .artwork img { scale: 1.02; }
.project-card:focus-visible .editorial-name { translate: 4px 0; }
:is(.zoomable, .sc-image-link):focus-visible { translate: 0 -4px; }
:is(.button, .hd-action, .sc-action, .evidence-action, .menu-toggle):focus-visible { translate: 0 -2px; }

@media (hover: hover) and (pointer: fine) {
  :is(.button, .hd-action, .sc-action, .evidence-action, .menu-toggle):hover { translate: 0 -2px; }
  .project-card:hover { translate: 0 -4px; }
  .project-card:hover :is(.artwork, .editorial-panel) {
    box-shadow: 0 16px 32px -20px #25282355;
  }
  .project-card:hover .artwork img { scale: 1.02; }
  .project-card:hover .editorial-name { translate: 4px 0; }
  :is(.zoomable, .sc-image-link):hover { translate: 0 -4px; }
  .artwork-card .zoomable:hover { scale: 1.006; }
  .feature-art:hover .phone { translate: 0 -4px; }
  .feature-art:hover .phone.front { translate: 0 -10px; }
  .hd-device:hover { translate: 0 -6px; }
  :is(.text-link, .nav-links a, .case-nav a, .chapters a, .hd-toc a, .sc-toc a, .resume-toc a, .evidence-toc a):hover,
  .project-card:hover .text-link { text-decoration-color: currentColor; }
}

/* Replace the older unrestricted hover transform; touch has no sticky lift. */
.sc-image-link:hover { transform: none; }
@media (hover: none), (pointer: coarse) {
  .sc-image-link:hover { box-shadow: 0 18px 35px -16px #2a1b1955; }
  .artwork-card img:hover { box-shadow: 0 8px 26px #30231712; }
}
:is(.button, .hd-action, .sc-action, .evidence-action, .menu-toggle, .lightbox button):active {
  translate: 0 0;
}
.lightbox[open] { animation: artwork-open 180ms var(--motion-ease); }
.lightbox[open]::backdrop { animation: backdrop-open 180ms ease-out; }
@keyframes artwork-open {
  from { opacity: .75; translate: 0 6px; }
  to { opacity: 1; translate: 0 0; }
}
@keyframes backdrop-open { from { opacity: 0; } to { opacity: 1; } }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation: none !important; transition: none !important; }
  :is(.project-card, .artwork img, .editorial-name, .zoomable, .sc-image-link,
      .feature-art .phone, .hd-device, .button, .hd-action, .sc-action, .evidence-action, .menu-toggle) {
    translate: none !important;
    scale: none !important;
  }
}
@media print {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}

/* New proof-led cards keep the same quiet, input-aware motion. */
:is(.lead-art,.hero-product-preview,.brand-card-art,.decision-image){transition:box-shadow var(--motion-image) var(--motion-ease)}
:is(.lead-art img,.hero-product-preview img,.brand-card-art img,.decision-image img){transition:scale var(--motion-image) var(--motion-ease)}
@media(hover:hover) and (pointer:fine){:is(.lead-art,.hero-product-preview,.brand-card,.decision-image):hover img{scale:1.015}}
:is(.lead-art,.hero-product-preview,.brand-card,.decision-image):focus-visible img{scale:1.015}
@media(prefers-reduced-motion:reduce){:is(.lead-art,.hero-product-preview,.brand-card,.decision-image) img{scale:none!important}.evidence-action{translate:none!important}}
