/* Controls shrink slightly while pressed, which is what touch has instead of hover. */
@media (prefers-reduced-motion: no-preference) {
  .theme-toggle { transition: background 150ms ease, scale 200ms cubic-bezier(.34, 1.56, .64, 1); }
  .theme-toggle:active { scale: .88; }

  .interactions-counter { transition: scale 200ms cubic-bezier(.34, 1.56, .64, 1); }
  .interactions button:active { scale: .95; }

  /* The icon rather than the link, so the tap area keeps its size. */
  #container .cursor-tilt-card .social-link > div {
    transition: scale 200ms cubic-bezier(.34, 1.56, .64, 1);
  }
  #container .cursor-tilt-card .social-link:active > div { scale: .85; }
  #container .cursor-tilt-card .card-website { transition: scale 200ms cubic-bezier(.34, 1.56, .64, 1), opacity 300ms cubic-bezier(.215, .61, .355, 1); }
  #container .cursor-tilt-card .card-website:active { scale: .95; }

  .profile-stack { transition: scale 200ms cubic-bezier(.34, 1.56, .64, 1); }
  .profile-stack:has(.stack-control:active) { scale: .95; }

  #container .back-tabs button { transition: color 140ms ease, scale 200ms cubic-bezier(.34, 1.56, .64, 1); }
  #container .back-tabs button:active { scale: .92; }
  .card-projects .back-email { transition: color 150ms ease, scale 200ms cubic-bezier(.34, 1.56, .64, 1); }
  .card-projects .back-email:active { scale: .97; }
  .card-projects .back-avatar:active { scale: .9; }

  /* The front of the card itself, unless something on it is pressed. */
  @media (hover: none) {
    .cursor-tilt-card { transition: transform 700ms cubic-bezier(0.22, 0.75, 0.18, 1), scale 200ms ease-out; }
    .cursor-tilt-card:not(.is-flipped):active:not(:has(:is(a, button, [role="link"], [role="button"], .headline-hover):active)) { scale: .985; }
  }
}

/* Grown by a first tap on touch screens, see js/social-confirm.js. Leans the way
   the icon does on hover; the link itself stays, so both places can be tapped. */
#container .cursor-tilt-card .social-link {
  touch-action: none;
  -webkit-touch-callout: none;
}
#container .cursor-tilt-card .social-link > div {
  transition: translate 320ms cubic-bezier(.34, 1.56, .64, 1), rotate 320ms cubic-bezier(.34, 1.56, .64, 1), scale 320ms cubic-bezier(.34, 1.56, .64, 1);
}
#container .cursor-tilt-card .social-link.is-grown { z-index: 5; }
#container .cursor-tilt-card .social-link.is-grown > div {
  translate: -8px -40px;
  rotate: -12deg;
  scale: 3;
}
/* The second icon, X, leans right. */
#container .cursor-tilt-card .social-x.is-grown > div {
  translate: 8px -40px;
  rotate: 12deg;
}
#container .cursor-tilt-card .social-link.is-grown:active > div { scale: 2.8; }
@media (prefers-reduced-motion: reduce) {
  #container .cursor-tilt-card .social-link > div { transition: none; }
}
