@media (prefers-reduced-motion: no-preference) {
  @view-transition {
    navigation: auto;
  }

  ::view-transition-old(root),
  ::view-transition-new(root) {
    animation-duration: 160ms;
    animation-timing-function: ease-out;
  }

  .hero-copy,
  .auth-art > div,
  .page-head {
    animation: chill-title-in 350ms cubic-bezier(.22, .75, .25, 1) both;
  }

  :where(.button, button, summary):not(.password-toggle) {
    position: relative;
  }

  :is(.button, button, summary) {
    transition: box-shadow 180ms ease-out, background-color 160ms, border-color 160ms, color 160ms;
  }

  .button { overflow: hidden; }

  :is(.button, button, summary):active:not(:disabled, [aria-disabled="true"], .loading) {
    box-shadow: inset 0 3px 9px #08081066, inset 0 0 0 1px #ffffff6b;
    transition-duration: 65ms;
  }

  :is(.button, button, summary) > .icon {
    transition: scale 220ms cubic-bezier(.2, 1.55, .45, 1), transform 170ms ease-out;
  }

  :is(.button, button, summary):active:not(:disabled, [aria-disabled="true"], .loading) > .icon {
    scale: .84;
    transition-duration: 65ms;
  }

  .button.primary::before {
    content: "";
    position: absolute;
    inset: 0;
    pointer-events: none;
    background: linear-gradient(112deg, transparent 37%, #fff1 47%, #fff4 50%, #fff1 53%, transparent 64%);
    transform: translateX(-110%);
  }

  .button.primary:focus-visible::before {
    animation: chill-button-glint 460ms ease-out;
  }

  .button-tracer {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    fill: none;
    stroke: currentColor;
    pointer-events: none;
    border-radius: inherit;
    overflow: hidden;
  }

  .button-tracer > ellipse {
    fill: currentColor;
    stroke: currentColor;
    stroke-width: 2px;
    vector-effect: non-scaling-stroke;
    fill-opacity: .22;
    stroke-opacity: .65;
    transform-box: fill-box;
    transform-origin: center;
    animation: chill-button-wave 480ms cubic-bezier(.12, .68, .28, 1) both;
  }

  .button-tracer > path {
    vector-effect: non-scaling-stroke;
    stroke-width: 1.6px;
    stroke-linecap: round;
    stroke-dasharray: 19 31;
    animation: chill-button-trace 420ms cubic-bezier(.2, .72, .28, 1) both;
  }

  @media (hover: hover) and (pointer: fine) {
    .button:hover:not(:active, :disabled, [aria-disabled="true"], .loading) {
      box-shadow: inset 0 0 0 1px #ffffff22, 0 2px 6px #07080c55;
    }

    .button.primary:hover:not(:disabled, [aria-disabled="true"], .loading)::before {
      animation: chill-button-glint 460ms ease-out;
    }

    .admin-side a > .icon {
      transition: transform 170ms ease-out;
    }

    .hero-actions .primary:hover > .icon,
    .event-actions .primary:hover > .icon,
    .admin-side a:hover > .icon {
      transform: translateX(2px);
    }

    .public-nav a:not([aria-current])::after {
      content: "";
      position: absolute;
      height: 2px;
      inset-inline: 0;
      bottom: 13px;
      background: var(--red);
      transform: scaleX(0);
      transform-origin: left;
      transition: transform 180ms ease-out;
    }

    .public-nav a:not([aria-current]):is(:hover, :focus-visible)::after {
      transform: scaleX(1);
    }

    @media (max-width: 900px) {
      .public-nav a:not([aria-current])::after { bottom: 1px; }
    }
  }
}

@keyframes chill-title-in {
  from { opacity: .78; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes chill-button-glint {
  to { transform: translateX(110%); }
}

@keyframes chill-button-trace {
  0% { stroke-dashoffset: 45; opacity: .8; }
  50% { opacity: 1; }
  100% { stroke-dashoffset: -18; opacity: 0; }
}

@keyframes chill-button-wave {
  0% { transform: scale(.07); opacity: .9; }
  38% { opacity: .72; }
  100% { transform: scale(1); opacity: 0; }
}

@media (prefers-reduced-motion: reduce) {
  .button { transition: none; }
  .button.loading::after { animation: none; }
  .button-tracer { display: none; }
}
