/* Heyming OS — base styles: skip link, desktop focus, OS-wide animation utilities.
 *
 * All colors and motion durations come from /brand.css tokens. Update those
 * in one place to repaint the OS chrome. The focus pattern matches the
 * site-wide dual-ring system documented in BRAND.md.
 */

/* Skip link — keyboard users jump past chrome to the desktop surface. */
.os-skip-link {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.os-skip-link:focus {
  position: fixed;
  left: 12px;
  top: 12px;
  z-index: 5000;
  width: auto;
  height: auto;
  margin: 0;
  padding: 10px 14px;
  overflow: visible;
  clip: auto;
  white-space: nowrap;
  border-radius: var(--radius);
  border: 1px solid var(--hairline-accent);
  background: var(--surface-2);
  color: var(--text-1);
  font-family: var(--font-ui);
  font-size: var(--text-caption);
  text-decoration: none;
  box-shadow: 0 8px 24px color-mix(in srgb, var(--pure-black) 50%, transparent);
}

.os-skip-link:focus-visible {
  outline: 2px solid var(--focus-ring-inner);
  outline-offset: 2px;
  box-shadow: 0 0 0 4px var(--focus-ring-outer),
    0 8px 24px color-mix(in srgb, var(--pure-black) 50%, transparent);
}

#os-desktop:focus {
  outline: none;
}

#os-desktop:focus-visible {
  outline: 2px solid var(--focus-ring-inner);
  outline-offset: -2px;
  box-shadow: inset 0 0 0 4px var(--focus-ring-outer);
}

/* Animation Classes */
.os-fade-in {
  animation: fadeIn var(--motion-modal);
}

.os-fade-out {
  animation: fadeOut var(--motion-modal);
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: scale(0.96);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

@keyframes fadeOut {
  from {
    opacity: 1;
    transform: scale(1);
  }
  to {
    opacity: 0;
    transform: scale(0.96);
  }
}

/* Loading Animation */
.loading-spinner {
  border: 3px solid var(--hairline);
  border-top: 3px solid var(--accent-primary);
  border-radius: 50%;
  width: 24px;
  height: 24px;
  animation: spin 1s linear infinite;
  display: inline-block;
}

@keyframes spin {
  0% {
    transform: rotate(0deg);
  }
  100% {
    transform: rotate(360deg);
  }
}
