/*
  Общие состояния интерактивных контролов: press-feedback и ховер
  контролов футера.
*/
:root {
  --color-action-hover: #ff0cc2;
  --color-action-hover-text: #ffffff;
  --color-action-active: #ff0cc2;
  --color-action-active-text: #ffffff;
  --button-hover-duration: 0.5s;
  --button-hover-ease: cubic-bezier(0.22, 0.61, 0.36, 1);
  --button-hover-blur: 10px;
  --button-press-scale: 0.96;
  --button-press-duration: 0.12s;
}

/*
  Короткий press-feedback для всех нативных интерактивных элементов.
  Используем отдельное свойство scale, чтобы не перезаписывать transform
  у плавающих контролов и элементов с собственными анимациями.
*/
:where(
  a[href],
  button,
  summary,
  input[type="button"],
  input[type="submit"],
  input[type="reset"],
  [role="button"],
  [role="link"]
) {
  scale: 1;
  transition-property: scale;
  transition-duration: var(--button-press-duration);
  transition-timing-function: ease-out;
}

:where(
  a[href],
  button,
  summary,
  input[type="button"],
  input[type="submit"],
  input[type="reset"],
  [role="button"],
  [role="link"]
):active:not(:disabled, [aria-disabled="true"]) {
  scale: var(--button-press-scale);
  transition-duration: 0.06s;
}

/*
  Контролы футера/меню: ховер — лёгкое снижение opacity, как у .btn
  (--btn-hover-opacity из buttons.5fa719b1d0c0.css), без заливок и свечения.
*/
:is(
  .site-footer__telegram,
  .site-footer__link,
  .site-footer__menu-btn,
  .site-footer__top-btn,
  .footer-menu-panel__link
) {
  transition:
    scale var(--button-press-duration) ease-out,
    opacity var(--btn-hover-duration, 0.15s) ease;
}

@media (hover: hover) and (pointer: fine) {
  :is(
    .site-footer__telegram,
    .site-footer__link,
    .site-footer__menu-btn,
    .site-footer__top-btn,
    .footer-menu-panel__link
  ):hover {
    opacity: var(--btn-hover-opacity, 0.72);
  }
}

:is(
  .site-footer__telegram,
  .site-footer__link,
  .site-footer__menu-btn,
  .site-footer__top-btn,
  .footer-menu-panel__link
):focus-visible {
  outline: 2px solid currentColor;
  outline-offset: 3px;
}

@media (prefers-reduced-motion: reduce) {
  :where(
    a[href],
    button,
    summary,
    input[type="button"],
    input[type="submit"],
    input[type="reset"],
    [role="button"],
    [role="link"]
  ),
  :is(
    .site-footer__telegram,
    .site-footer__link,
    .site-footer__menu-btn,
    .site-footer__top-btn,
    .footer-menu-panel__link
  ) {
    transition-duration: 0.01ms;
  }
}

/* Image tiles never shrink on touch: :active fires as a scroll begins, so a
   press-scale on a photo/card reads as a glitch. Real buttons keep the press. */
@media (hover: none), (pointer: coarse) {
  :is(a[href], [role="button"]):has(:is(img, picture, video, canvas)):not(.btn):active,
  .case-lightbox-openable:active,
  .works-grid__item:active,
  .work-gallery__work:active,
  .project-card:active {
    scale: 1;
    transform: none;
  }
}
