/* ==========================================================================
   UP AL — Button component
   Primary CTA uses the chrome/metallic gradient — the brand's signature
   accent — so the call to action reads as part of the identity, not a
   generic UI color. Refined for a custom, considered feel: taller, a
   restrained rounded-rect radius rather than a stock pill, a layered
   shadow with a glossy top highlight, and a soft gloss sweep on hover.
   ========================================================================== */

.btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  overflow: hidden;
  white-space: nowrap;
  font-family: var(--font-base);
  font-weight: var(--fw-medium);
  font-size: var(--fs-button);
  line-height: 1;
  border-radius: var(--radius-button);
  cursor: pointer;
  transition:
    transform 420ms var(--ease-premium),
    box-shadow 420ms var(--ease-premium),
    background 420ms var(--ease-premium);
}

.btn:active {
  transform: translateY(1px) scale(0.99);
}

/* Primary — chrome fill */

.btn--primary {
  background: var(--gradient-chrome);
  color: var(--color-on-chrome);
  box-shadow: var(--shadow-button);
  padding: 1.05rem 2rem;
}

/* Gloss sweep — a thin diagonal band of light that travels across the
   button on hover, reinforcing the metallic material of the chrome fill. */

.btn--primary::after {
  content: "";
  position: absolute;
  inset-block: 0;
  inset-inline-start: -60%;
  width: 40%;
  background: linear-gradient(
    75deg,
    transparent 0%,
    rgba(255, 255, 255, 0.55) 50%,
    transparent 100%
  );
  transform: skewX(-18deg);
  opacity: 0;
  transition: transform 700ms var(--ease-premium), opacity 220ms var(--ease-premium);
  pointer-events: none;
}

.btn--primary:hover {
  background: var(--gradient-chrome-hover);
  box-shadow: var(--shadow-button-hover);
  transform: translateY(-3px);
}

.btn--primary:hover::after {
  opacity: 1;
  transform: translateX(260%) skewX(-18deg);
}

.btn--primary:active {
  transform: translateY(0) scale(0.99);
  box-shadow: var(--shadow-button);
}

/* Compact size — used in header */

.btn--compact {
  padding: 0.7rem 1.5rem;
  font-size: var(--fs-small);
}

/* Ghost — outline only, transparent fill. Used where a CTA needs to be
   present but shouldn't compete with the primary chrome conversion action
   (e.g. "View Project" in Portfolio) — quieter, glass-and-line rather than
   solid metal. */

.btn--ghost {
  background-color: transparent;
  color: var(--color-text-primary);
  border: 1px solid var(--color-border-strong);
  padding: 0.85rem 1.75rem;
}

.btn--ghost:hover,
.btn--ghost:focus-visible {
  border-color: var(--color-accent);
  color: var(--color-accent);
  background-color: var(--color-accent-soft);
  transform: translateY(-2px);
}

.btn--ghost:active {
  transform: translateY(0) scale(0.99);
}

@media (prefers-reduced-motion: reduce) {
  .btn--primary:hover {
    transform: none;
  }
  .btn--primary::after {
    display: none;
  }
}
