/* Continuous perimeter strokes travel between corners with eased acceleration. */
.hud-action {
  --line-inset: 8px;
  --line-length: 8px;
  --line-color: currentColor;
  --hover-color: var(--orange);
  transition: color 180ms ease;
}

.hud-lines {
  position: absolute;
  inset: var(--line-inset);
  width: calc(100% - 2 * var(--line-inset));
  height: calc(100% - 2 * var(--line-inset));
  z-index: 1;
  pointer-events: none;
  fill: none;
  stroke: var(--line-color);
  stroke-width: 1px;
  stroke-dashoffset: var(--line-start, 8);
  transition: stroke-dashoffset 620ms cubic-bezier(.65, 0, .35, 1), stroke 180ms ease;
}

.gallery-photo {
  --line-inset: 0px;
  --line-color: var(--hud-rest);
}

.menu-toggle {
  --line-inset: 5px;
}

.video-screen {
  --line-inset: 0px;
}

.lightbox-controls .hud-action {
  position: relative;
}

.media-close {
  --line-length: 8px;
}

/* Filled CTAs keep their orange fill; only ink and line position respond. */
.button-accent, .about-button:not(.about-button-light), .stream {
  --hover-color: #000;
}

.hud-action:is(:focus-visible, :active) {
  color: var(--hover-color);
}

.hud-action:is(:focus-visible, :active) > .hud-lines {
  stroke: var(--hover-color);
  stroke-dashoffset: var(--line-end);
}

@media (hover: hover) {
  .hud-action:hover {
    color: var(--hover-color);
  }
  .hud-action:hover > .hud-lines {
    stroke: var(--hover-color);
    stroke-dashoffset: var(--line-end);
  }
}

/* Plain links use the same travelling-line language without a button surface. */
.text-link, .site-footer a:not(:has(img)) {
  text-decoration: none;
  background-image: linear-gradient(currentColor, currentColor);
  background-size: 100% 1px;
  background-repeat: no-repeat;
  background-position: 0% calc(100% - 6px);
  transition: color 180ms ease, background-size 420ms ease, background-position 420ms ease;
}

:is(.text-link, .site-footer a):is(:hover, :focus-visible) {
  color: var(--orange);
  background-size: 24px 1px;
  background-position: 100% calc(100% - 6px);
}

.site-credit {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px;
}

.site-footer .site-credit a {
  background-image: none;
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  text-decoration: underline;
  text-underline-offset: 4px;
}

@media (prefers-reduced-motion: reduce) {
  .hud-action, .hud-lines, .text-link, .site-footer a {
    transition: none;
  }
}
