/* Progressive enhancement: content stays readable without the motion script. */
:where(.page-hero h1, .projects-intro h1, .projects-section-heading h2,
  .section-heading h2, .intro-copy h2, .content-section > .container > h2,
  .page-cta > .container > h2)::before {
  display: block;
  width: 38px;
  height: 3px;
  margin-bottom: 16px;
  border-radius: 999px;
  background: var(--yellow, #ffc400);
  content: "";
  transform-origin: left center;
}

.htc-motion-legacy-visible.reveal {
  opacity: 1;
  transform: none;
  transition: none;
}

.htc-motion-photo {
  clip-path: inset(0);
  transition: transform 250ms cubic-bezier(.22, .7, .3, 1), opacity 200ms ease;
}
.htc-motion-photo.htc-motion-pending { clip-path: inset(100% 0 0 0); }
.htc-motion-photo.htc-motion-active {
  animation: htc-motion-photo-reveal var(--htc-motion-duration, 500ms)
    cubic-bezier(.22, .7, .3, 1) var(--htc-motion-delay, 0ms) both;
}
.htc-motion-rise.htc-motion-pending { opacity: 0; transform: translateY(10px); }
.htc-motion-rise.htc-motion-active {
  animation: htc-motion-rise var(--htc-motion-duration, 400ms)
    cubic-bezier(.22, .7, .3, 1) var(--htc-motion-delay, 0ms) both;
}
.htc-motion-heading.htc-motion-pending::before { transform: scaleX(0); }
.htc-motion-heading.htc-motion-active::before {
  animation: htc-motion-line 350ms cubic-bezier(.22, .7, .3, 1)
    var(--htc-motion-delay, 0ms) both;
}

.portfolio-project.htc-motion-project > a { overflow: hidden; border-radius: var(--radius, 24px); }
.htc-motion-project > a:hover,
.htc-motion-project > a:focus-visible { scale: 1; }
.htc-motion-project :is(h2, h3, h4) {
  transition: color 160ms ease, transform 160ms ease;
}
.htc-motion-project:focus-within img.htc-motion-photo { transform: scale(1.025); }
.htc-motion-project:focus-within :is(h2, h3, h4) {
  color: var(--yellow, #ffc400);
  transform: translateY(-2px);
}
.gallery-item.htc-motion-project:focus-within figcaption { opacity: 1; transform: none; }

.htc-motion-button,
.htc-motion-link {
  transition: transform 100ms ease, scale 100ms ease, box-shadow 160ms ease,
    background-color 160ms ease, border-color 160ms ease, color 160ms ease;
}
.htc-motion-button:is(:hover, :focus-visible),
.htc-motion-link:is(:hover, :focus-visible) { scale: 1; transform: none; }
.htc-motion-button:active,
.htc-motion-link:active { scale: .98; transform: none; }
.htc-motion-button:disabled { scale: 1; transform: none; }
.htc-motion-arrow {
  display: inline-block;
  flex: 0 0 auto;
  line-height: 1;
  transition: transform 160ms ease;
}
.htc-motion-button:focus-visible .htc-motion-arrow,
.htc-motion-link:focus-visible .htc-motion-arrow,
.htc-motion-project:focus-within .htc-motion-arrow { transform: translateX(5px); }

@media (hover: hover) and (pointer: fine) {
  .htc-motion-project:hover img.htc-motion-photo,
  .artist-card.htc-motion-artist:hover img { transform: scale(1.025); }
  .htc-motion-project:hover :is(h2, h3, h4) {
    color: var(--yellow, #ffc400);
    transform: translateY(-2px);
  }
  .htc-motion-button:hover .htc-motion-arrow,
  .htc-motion-link:hover .htc-motion-arrow,
  .htc-motion-project:hover .htc-motion-arrow { transform: translateX(5px); }
}

@media (hover: none), (pointer: coarse) {
  .gallery-item.htc-motion-project figcaption { opacity: 1; transform: none; }
}

@keyframes htc-motion-photo-reveal {
  from { clip-path: inset(100% 0 0 0); }
  to { clip-path: inset(0); }
}
@keyframes htc-motion-rise {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}
@keyframes htc-motion-line {
  from { transform: scaleX(0); }
  to { transform: scaleX(1); }
}

@media (prefers-reduced-motion: reduce) {
  .htc-motion-photo,
  .htc-motion-rise,
  .htc-motion-heading,
  .htc-motion-heading::before,
  .htc-motion-arrow,
  .htc-motion-button,
  .htc-motion-link {
    animation: none !important;
    transition: none !important;
  }
  .htc-motion-photo.htc-motion-pending { clip-path: inset(0); }
  .htc-motion-rise.htc-motion-pending { opacity: 1; transform: none; }
  .htc-motion-heading.htc-motion-pending::before { transform: none; }
  .htc-motion-project img.htc-motion-photo,
  .project-card img,
  .portfolio-project img,
  .gallery-item img,
  .artist-card img,
  .htc-motion-project :is(h2, h3, h4),
  .htc-motion-arrow,
  .htc-motion-button,
  .htc-motion-link { transform: none !important; scale: 1 !important; }
}
