.link {
  --link-underline-thickness: 3px;
  color: var(--color-charcoal-deep);
  font-size: var(--font-size-link);
  text-decoration: none;
}

.link--underline-thin {
  --link-underline-thickness: 1px;
}

.link--underline-offset-large {
  text-underline-offset: 0.5rem;
}

.link--underline-from-left {
  position: relative;
  display: inline-flex;
}

.link--underline-from-left::after {
  position: absolute;
  right: 0;
  bottom: -0.5rem;
  left: 0;
  height: var(--link-underline-thickness);
  background-color: currentColor;
  content: "";
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 180ms ease;
}

.link--hover-slide-right {
  transition: transform 180ms ease;
}

.link--hover-slide-right:focus-visible {
  transform: translateX(3px);
}

.link--paper {
  color: var(--color-paper-warm);
}

.link--hover-forest:hover,
.link--hover-forest:focus-visible {
  color: var(--color-forest-green);
}

.link--hover-paper:hover,
.link--hover-paper:focus-visible {
  color: var(--color-paper-warm);
}

.link--hover-lift {
  transition: transform 180ms ease;
}

.link--hover-lift:focus-visible {
  transform: translateY(-2px);
}

.link:focus-visible {
  outline: 2px solid currentColor;
  outline-offset: 3px;
}

.link--underlined {
  position: relative;
  display: flex;
  align-items: center;
  line-height: 1.25;
  text-decoration: none;
  white-space: nowrap;
}

.link--underlined:not(.link--button)::after {
  position: absolute;
  right: 0;
  bottom: -0.25rem;
  left: 0;
  height: 3px;
  background-color: currentColor;
  content: "";
  transform: scaleX(0);
  transform-origin: center;
  transition: transform 180ms ease;
}

.link--underline-at-navbar-edge:not(.link--button)::after {
  bottom: -2.5rem;
}

.link--underlined:not(.link--button):focus-visible::after {
  transform: scaleX(1);
}

/* Corresponde ao token --breakpoint-wide: 64em em tokens.css. */
@media (max-width: 64em) {
  .link--underlined {
    font-size: 1.2rem;
  }

  .link--underline-at-navbar-edge:not(.link--button)::after {
    bottom: -0.25rem;
  }
}

.link--button {
  padding: 0.875rem 1.25rem;
  border: 1px solid var(--color-charcoal-deep);
  border-radius: 0.375rem;
  background-color: var(--color-charcoal-deep);
  color: var(--color-paper-warm);
  font-size: var(--font-size-button);
  text-align: center;
  transition: background-color 300ms ease-in-out, color 300ms ease-in-out;
}

.link--button:focus-visible {
  background-color: var(--color-paper-warm);
  color: var(--color-charcoal-deep);
  outline-color: var(--color-charcoal-deep);
}

.link--button:active {
  background-color: var(--color-charcoal-deep);
  color: var(--color-paper-warm);
}

.link--button-inverted {
  background-color: var(--color-paper-warm);
  color: var(--color-charcoal-deep);
}

.link--button-inverted:active {
  background-color: var(--color-paper-warm);
  color: var(--color-charcoal-deep);
}

.link--button-forest:focus-visible:not(:active) {
  background-color: var(--color-forest-green);
  color: var(--color-paper-warm);
}

.link--button-slate:focus-visible:not(:active) {
  background-color: var(--color-slate-blue);
  color: var(--color-paper-warm);
}

.link--button-inverted-themed {
  border-color: var(--theme-foreground);
  background-color: var(--theme-foreground);
  color: var(--theme-background);
}

.link--button-inverted-themed:focus-visible:not(:active) {
  background-color: var(--theme-background);
  color: var(--theme-foreground);
}

.link--button-inverted-themed:active {
  background-color: var(--theme-foreground);
  color: var(--theme-background);
}

.link--button-inverted-themed:focus-visible {
  outline-color: var(--theme-foreground);
}

.link--button-semibold-hover:focus-visible {
  font-weight: 600;
}

@media (hover: hover) {
  .link--hover-forest:hover {
    color: var(--color-forest-green);
  }

  .link--hover-lift:hover {
    transform: translateY(-2px);
  }

  .link--hover-slide-right:hover {
    transform: translateX(3px);
  }

  .link:not(.link--underlined):not(.link--button):not(.link--underline-from-left):hover {
    text-decoration: underline;
    text-decoration-thickness: var(--link-underline-thickness);
  }

  .link--underlined:not(.link--button):hover::after {
    transform: scaleX(1);
  }

  .link--underline-from-left:hover::after {
    transform: scaleX(1);
  }

  .link--button:hover {
    background-color: var(--color-paper-warm);
    color: var(--color-charcoal-deep);
  }

  .link--button-forest:hover:not(:active) {
    background-color: var(--color-forest-green);
    color: var(--color-paper-warm);
  }

  .link--button-slate:hover:not(:active) {
    background-color: var(--color-slate-blue);
    color: var(--color-paper-warm);
  }

  .link--button-inverted-themed:hover:not(:active) {
    background-color: var(--theme-background);
    color: var(--theme-foreground);
  }

  .link--button-semibold-hover:hover {
    font-weight: 600;
  }
}

@media (hover: none) {
  .link--button-forest:active {
    background-color: var(--color-forest-green);
    color: var(--color-paper-warm);
  }
}

/* Corresponde ao token --breakpoint-compact: 40em em tokens.css. */
@media (max-width: 40em) {
  .link--button-compact {
    padding: 0.875rem 0.625rem;
    font-size: 1rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  .link--underlined::after,
  .link--underline-from-left::after,
  .link--button,
  .link--hover-lift,
  .link--hover-slide-right {
    transition: none;
  }

  .link--hover-lift:hover,
  .link--hover-lift:focus-visible,
  .link--hover-slide-right:hover,
  .link--hover-slide-right:focus-visible {
    transform: none;
  }
}
