/*============================================================
ACCESSIBILITY — A11Y UTILITIES & SKIP-LINK
============================================================*/

/*------------------------------------------------------------
Skip to Content Link (.skip-link)
------------------------------------------------------------*/
.skip-link {
  position: absolute;
  top: -4rem;                            /* off-screen */
  left: 50%;
  transform: translateX(-50%) translateY(-0.625rem);
  background-color: var(--clr-indigo-500);
  color: var(--clr-white);
  padding: 0.6rem 1.2rem;
  font-weight: 600;
  border-radius: var(--radius-sm);
  opacity: 0;
  box-shadow: 0 4px 16px rgba(79, 70, 229, 0.30);
  backdrop-filter: blur(6px);
  z-index: var(--z-modal);
  pointer-events: none;
  transition:
    top         0.35s var(--ease-default),
    opacity     0.35s var(--ease-default),
    transform   0.35s var(--ease-default),
    box-shadow  0.35s ease,
    backdrop-filter 0.35s ease;
}

/* Visible on keyboard focus */
.skip-link:focus-visible {
  top: 1.5rem;
  opacity: 1;
  transform: translateX(-50%) translateY(0);
  pointer-events: auto;
  box-shadow:
    0 8px 24px rgba(79, 70, 229, 0.50),
    0 0 0 3px rgba(255, 255, 255, 0.30);
  outline: none;
  animation: focusPulse 1.5s infinite alternate ease-in-out;
}

/* Pressed state */
.skip-link:active {
  transform: translateX(-50%) scale(0.98);
  box-shadow:
    0 6px 20px rgba(79, 70, 229, 0.40),
    inset 0 0 2px rgba(0, 0, 0, 0.10);
}

/* Leading arrow icon */
.skip-link::before {
  content: "↳";
  display: inline-block;
  margin-right: 0.4rem;
  transform: rotate(90deg);
  transition: transform 0.3s ease-out;
}

.skip-link:focus-visible::before {
  transform: rotate(0deg);
}

/* Hover feedback */
.skip-link:hover {
  background-color: var(--clr-indigo-600);
  box-shadow:
    0 6px 20px rgba(79, 70, 229, 0.40),
    0 0 0 3px rgba(255, 255, 255, 0.30);
  cursor: pointer;
}

/*------------------------------------------------------------
Focus Pulse Animation
------------------------------------------------------------*/
@keyframes focusPulse {
  0%   { box-shadow: 0 0 0 0   rgba(79, 70, 229, 0.40); }
  100% { box-shadow: 0 0 0 10px rgba(79, 70, 229, 0);    }
}

/*------------------------------------------------------------
Glass Removal Utility (.no-glass)
------------------------------------------------------------*/
.no-glass {
  background-color: transparent !important;
  backdrop-filter: none !important;
}

/*------------------------------------------------------------
High-contrast Focus Ring
------------------------------------------------------------*/
a:focus-visible,
button:focus-visible,
input:focus-visible,
textarea:focus-visible,
select:focus-visible {
  outline: var(--focus-outline);
  outline-offset: var(--focus-offset);
}

/*------------------------------------------------------------
Motion-safe Overrides
------------------------------------------------------------*/
@media (prefers-reduced-motion: reduce) {
  .skip-link,
  .skip-link::before {
    transition: none !important;
    animation: none !important;
  }
}
