/* Phase 8 — shared accessibility and motion preferences. */
:root {
  --kai-focus-ring: #0ea5e9;
  --kai-focus-shadow: rgba(14, 165, 233, .28);
}

.kai-skip-link {
  position: fixed;
  top: .65rem;
  left: .65rem;
  z-index: 10000;
  max-width: calc(100vw - 1.3rem);
  padding: .7rem 1rem;
  border: 2px solid #fff;
  border-radius: .8rem;
  background: #0369a1;
  color: #fff;
  font-size: .8rem;
  font-weight: 900;
  line-height: 1.2;
  box-shadow: 0 8px 24px rgba(2, 6, 23, .35);
  transform: translateY(calc(-100% - 1.5rem));
  transition: transform .16s ease;
}

.kai-skip-link:focus-visible { transform: translateY(0); outline: 0; }

.kai-visually-hidden {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  margin: -1px !important;
  overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important;
  white-space: nowrap !important;
  border: 0 !important;
}

:where(button, [role="button"], a[href], input, select, textarea, [tabindex]):focus-visible {
  outline: 3px solid var(--kai-focus-ring) !important;
  outline-offset: 2px !important;
  box-shadow: 0 0 0 5px var(--kai-focus-shadow) !important;
}

:where(button, input, select, textarea)[aria-busy="true"] { cursor: progress !important; }

@media (forced-colors: active) {
  .kai-skip-link { border-color: ButtonText; background: ButtonFace; color: ButtonText; }
  :where(button, [role="button"], a[href], input, select, textarea, [tabindex]):focus-visible {
    outline: 3px solid Highlight !important;
    box-shadow: none !important;
  }
}

@media (prefers-reduced-motion: reduce) {
  html:focus-within { scroll-behavior: auto !important; }
  *, *::before, *::after {
    scroll-behavior: auto !important;
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .01ms !important;
    transition-delay: 0ms !important;
  }
}
