/* ==========================================================================
   Accessibility Styles — WCAG 2.1 AA
   ========================================================================== */

/* ---------- Skip Link ---------- */
.skip-link {
  position: absolute;
  top: -100%;
  left: var(--win95-spacing-md);
  background-color: var(--win95-title-active);
  color: var(--win95-text-light);
  padding: var(--win95-spacing-sm) var(--win95-spacing-lg);
  z-index: 2000;
  font-weight: 700;
  text-decoration: underline;
}

.skip-link:focus {
  top: var(--win95-spacing-md);
}

/* ---------- Screen Reader Only ---------- */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* ---------- Focus Indicators ---------- */
/* Default: dark dotted outline on surface backgrounds */
:focus-visible {
  outline: 2px dotted var(--win95-text);
  outline-offset: 2px;
}

/* On teal desktop: white dotted outline */
.desktop-icons :focus-visible {
  outline: 2px dotted var(--win95-text-light);
  outline-offset: 2px;
}

/* Title bar controls: thin dotted inside */
.win95-title-btn:focus-visible {
  outline: 1px dotted var(--win95-text);
  outline-offset: -3px;
}

/* Buttons: dotted outline inside */
.win95-btn:focus-visible {
  outline: 1px dotted var(--win95-text);
  outline-offset: -4px;
}

/* Start menu items */
.win95-start-menu__item:focus-visible {
  outline: 1px dotted var(--win95-text-light);
  outline-offset: -1px;
}

/* ---------- Reduced Motion ---------- */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

/* ---------- High Contrast Mode (Windows) ---------- */
@media (forced-colors: active) {
  .win95-window,
  .win95-btn,
  .win95-title-btn,
  .win95-start-btn,
  .win95-taskbar {
    border: 1px solid ButtonText;
    box-shadow: none;
  }

  .win95-sunken,
  .win95-raised {
    box-shadow: none;
    border: 1px solid ButtonText;
  }
}
