/* Shared accessibility layer for every published page (home, about, case
   studies). Linked from each page's <head>; behaviour lives in a11y.js. */

/* Skip link: first Tab stop on every page, hidden until focused (WCAG 2.4.1) */
.skip-link {
  position: fixed; left: 16px; top: 16px; z-index: 10002;
  background: #111; color: #fff;
  padding: 12px 18px; border-radius: 6px;
  font: 500 14px/1 'Inter', sans-serif; text-decoration: none;
  transform: translateY(-200%);
  transition: transform .15s ease;
}
.skip-link:focus { transform: none; }

/* Visible keyboard focus everywhere (WCAG 2.4.7 / 2.4.11). Mouse clicks
   don't show it thanks to :focus-visible. */
:focus-visible {
  outline: 3px solid #8900FA;
  outline-offset: 3px;
  border-radius: 2px;
}
/* The skip target gets focus programmatically; no ring needed there. */
main:focus { outline: none; }

/* Cards whose real control is a button inside them: ring the whole card. */
.card:has(.card-btn:focus-visible) { outline: 3px solid #8900FA; outline-offset: 6px; }
.card-btn {
  font: inherit; color: inherit; letter-spacing: inherit; line-height: inherit;
  background: none; border: 0; padding: 0; margin: 0;
  text-align: inherit; cursor: pointer;
}
.card-btn:focus-visible { outline: none; }

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

/* Pause/play control for autoplaying video (WCAG 2.2.2). Shows on hover,
   always visible while focused, while paused, and on touch screens. */
.media-toggle {
  position: absolute; right: 14px; bottom: 14px; z-index: 6;
  width: 44px; height: 44px; border-radius: 50%;
  border: 1px solid rgba(255,255,255,.55);
  background: rgba(17,17,17,.62); color: #fff;
  display: grid; place-items: center;
  cursor: pointer; opacity: 0; transition: opacity .2s ease;
}
.media-toggle svg { width: 16px; height: 16px; fill: currentColor; }
:hover > .media-toggle,
.media-toggle:focus-visible,
.media-toggle[aria-pressed="true"] { opacity: 1; }
@media (hover: none) { .media-toggle { opacity: 1; } }

@media (prefers-reduced-motion: reduce) {
  .blink-cursor, .bub .caret { animation: none !important; }
  html { scroll-behavior: auto !important; }
}
