/**
 * Accessibility layer: focus, motion, landmarks.
 */

/* Always show keyboard focus, even when custom cursor is on */
:focus {
  outline: none;
}

:focus-visible {
  outline: 2px solid var(--mf-accent);
  outline-offset: 3px;
}

.btn:focus-visible,
.site-cta:focus-visible,
.nav-toggle:focus-visible,
.asset-card__copy:focus-visible,
.showcase-card:focus-visible,
.field__input:focus-visible,
.library-select:focus-visible,
.search-form input:focus-visible,
.search-form button:focus-visible {
  outline: 2px solid var(--mf-accent);
  outline-offset: 3px;
}

/* Custom cursor must not hide system cursor for keyboard-only users */
html.mf-cursor-on {
  cursor: none;
}

html.mf-cursor-on *:not(:focus-visible) {
  cursor: none;
}

html.mf-cursor-on *:focus-visible,
html.mf-cursor-on *:focus-visible * {
  cursor: auto !important;
}

@media (hover: none), (pointer: coarse) {
  html.mf-cursor-on,
  html.mf-cursor-on * {
    cursor: auto !important;
  }

  .mf-cursor {
    display: none !important;
  }
}

/* Stronger text contrast for secondary copy */
.mf-lede,
.mf-body,
.asset-card__meta,
.site-nav__list,
.site-search-link,
.site-footer__brand p,
.showcase-note,
.home-step p,
.home-tool p,
.home-cat p {
  color: #b3b3b3;
}

.mf-label,
.site-footer__col h2,
.library-filters__count,
.hero__note,
.asset-header__hint {
  color: #9a9a9a;
}

.hero__brand.mf-label,
.hero .hero__brand {
  color: #f4f4f4;
}

/* Mobile drawer as dialog semantics */
.mobile-nav:not([hidden]) {
  display: block;
}

html.mf-nav-open .mobile-nav {
  position: relative;
  z-index: 45;
}

html.mf-nav-open .site-header {
  z-index: 50;
}

/* Ensure interactive targets meet ~44px where missing */
.site-search-link,
.site-nav__list a {
  min-height: 44px;
  display: inline-flex;
  align-items: center;
}

.site-footer__list a {
  min-height: 40px;
  display: inline-flex;
  align-items: center;
}

/* Reduced motion: no smooth scroll, no reveal hide, no ambient motion */
@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  [data-reveal],
  [data-reveal].is-revealed,
  .hero[data-hero]:not(.is-ready) .hero__line-inner,
  .hero[data-hero]:not(.is-ready) [data-hero-item],
  .hero.is-ready .hero__line-inner,
  .hero.is-ready [data-hero-item] {
    opacity: 1 !important;
    transform: none !important;
    transition: none !important;
  }

  [data-ambient]::before,
  .asset-preview__orbits span,
  .viz-bg {
    animation: none !important;
    transition: none !important;
  }

  .section {
    content-visibility: visible;
  }
}

/* High contrast preference */
@media (prefers-contrast: more) {
  :root {
    --mf-border: rgba(255, 255, 255, 0.35);
    --mf-border-strong: rgba(255, 255, 255, 0.55);
    --mf-muted: #d0d0d0;
    --mf-faint: #c0c0c0;
  }

  .btn--ghost,
  .site-cta,
  .asset-card__media,
  .showcase-stage,
  .home-pricing__panel {
    border-width: 2px;
  }
}
