/* ==========================================================================
   Motion Malibu — Accessibility layer
   Skip links · focus · motion · optional visitor controls
   ========================================================================== */

/* —— Screen-reader only —— */
.mm-sr-only,
.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;
}

/* —— Skip link (keyboard only) —— */
.mm-skip-link {
  position: absolute;
  left: -10000px;
  top: auto;
  width: 1px;
  height: 1px;
  overflow: hidden;
  z-index: 100000;
  padding: 0.7rem 1.1rem;
  border-radius: 0.55rem;
  background: #f5f0ff;
  color: #12081f;
  font-weight: 700;
  font-size: 0.95rem;
  text-decoration: none;
  border: 2px solid #a855f7;
  box-shadow: 0 8px 28px rgba(0, 0, 0, 0.45);
}

.mm-skip-link:focus,
.mm-skip-link:focus-visible {
  position: fixed;
  left: 0.75rem;
  top: 0.75rem;
  width: auto;
  height: auto;
  overflow: visible;
  outline: 3px solid #fff;
  outline-offset: 2px;
}

/* —— Default keyboard focus (global) —— */
:focus {
  outline: none;
}

:focus-visible {
  outline: 2px solid #c084fc;
  outline-offset: 3px;
}

a:focus-visible,
button:focus-visible,
.btn:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible,
summary:focus-visible,
[tabindex]:focus-visible {
  outline: 2px solid #c084fc;
  outline-offset: 3px;
}

/* —— Strong focus mode —— */
html.mm-a11y-strong-focus :focus-visible {
  outline: 3px solid #fde68a !important;
  outline-offset: 4px !important;
  box-shadow: 0 0 0 4px rgba(168, 85, 247, 0.45) !important;
}

/* —— Text size steps —— */
html.mm-a11y-text-lg {
  font-size: 112.5%;
}
html.mm-a11y-text-xl {
  font-size: 125%;
}
html.mm-a11y-text-xxl {
  font-size: 137.5%;
}

/* —— High contrast —— */
html.mm-a11y-contrast {
  filter: contrast(1.12);
}
html.mm-a11y-contrast body {
  background: #000 !important;
  color: #fff !important;
}
html.mm-a11y-contrast a {
  color: #e9d5ff !important;
  text-decoration: underline;
}
html.mm-a11y-contrast .btn-primary {
  background: #fff !important;
  color: #000 !important;
  border-color: #fff !important;
}
html.mm-a11y-contrast .nav,
html.mm-a11y-contrast .card,
html.mm-a11y-contrast .site-card,
html.mm-a11y-contrast footer {
  border-color: rgba(255, 255, 255, 0.35) !important;
}

/* —— Underline links —— */
html.mm-a11y-underline-links a {
  text-decoration: underline !important;
  text-underline-offset: 0.18em;
}

/* —— Readable font (Lexend) —— */
html.mm-a11y-readable-font body,
html.mm-a11y-readable-font button,
html.mm-a11y-readable-font input,
html.mm-a11y-readable-font select,
html.mm-a11y-readable-font textarea {
  font-family: "Lexend", system-ui, -apple-system, sans-serif !important;
  letter-spacing: 0.01em;
}

/* —— Text spacing —— */
html.mm-a11y-text-spacing body {
  line-height: 1.75 !important;
  letter-spacing: 0.04em !important;
  word-spacing: 0.08em !important;
}
html.mm-a11y-text-spacing p,
html.mm-a11y-text-spacing li {
  margin-bottom: 0.85em;
}

/* —— Reduce motion (user toggle + system) —— */
html.mm-a11y-reduce-motion *,
html.mm-a11y-reduce-motion *::before,
html.mm-a11y-reduce-motion *::after,
html.mm-a11y-system-reduce-motion *,
html.mm-a11y-system-reduce-motion *::before,
html.mm-a11y-system-reduce-motion *::after {
  animation-duration: 0.01ms !important;
  animation-iteration-count: 1 !important;
  transition-duration: 0.01ms !important;
  scroll-behavior: auto !important;
}
html.mm-a11y-reduce-motion [data-reveal],
html.mm-a11y-system-reduce-motion [data-reveal] {
  opacity: 1 !important;
  transform: none !important;
}
html.mm-a11y-reduce-motion .bg-glow,
html.mm-a11y-system-reduce-motion .bg-glow {
  animation: none !important;
}

/* —— Reading mode —— */
html.mm-a11y-reading-mode .bg-glow,
html.mm-a11y-reading-mode .home-hero-bg,
html.mm-a11y-reading-mode .home-hero-visual,
html.mm-a11y-reading-mode .ticker,
html.mm-a11y-reading-mode .hero-mosaic {
  display: none !important;
}
html.mm-a11y-reading-mode body {
  max-width: 48rem;
  margin-left: auto;
  margin-right: auto;
}
html.mm-a11y-reading-mode .wrap,
html.mm-a11y-reading-mode main {
  max-width: 42rem;
}

/* —— Big cursor —— */
html.mm-a11y-big-cursor,
html.mm-a11y-big-cursor * {
  cursor: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='32' height='32' viewBox='0 0 32 32'%3E%3Cpath fill='%23fff' stroke='%23000' stroke-width='2' d='M4 4 L4 26 L11 20 L16 30 L20 28 L15 18 L24 18 Z'/%3E%3C/svg%3E")
      2 2,
    auto !important;
}

/* —— Toolbar (peek tab → panel) —— */
.mm-a11y-root {
  position: fixed;
  z-index: 99990;
  left: 0;
  bottom: 1.1rem;
  font-family: system-ui, -apple-system, sans-serif;
  font-size: 14px;
  line-height: 1.35;
}

.mm-a11y-tab {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  border: 1px solid rgba(192, 132, 252, 0.55);
  border-left: none;
  border-radius: 0 999px 999px 0;
  background: rgba(12, 8, 20, 0.92);
  color: #f5f0ff;
  padding: 0.55rem 0.85rem 0.55rem 0.65rem;
  box-shadow: 0 8px 28px rgba(0, 0, 0, 0.4);
  cursor: pointer;
  font-weight: 650;
  backdrop-filter: blur(10px);
}
.mm-a11y-tab:hover {
  border-color: #c084fc;
  background: rgba(24, 12, 40, 0.95);
}
.mm-a11y-tab[aria-expanded="true"] {
  display: none;
}

.mm-a11y-panel {
  display: none;
  width: min(20.5rem, calc(100vw - 1.25rem));
  margin-left: 0.5rem;
  padding: 0.85rem 0.9rem 1rem;
  border-radius: 1rem;
  border: 1px solid rgba(192, 132, 252, 0.4);
  background: rgba(10, 8, 16, 0.96);
  color: #f3e8ff;
  box-shadow: 0 16px 48px rgba(0, 0, 0, 0.55);
  backdrop-filter: blur(14px);
}
.mm-a11y-root.is-open .mm-a11y-panel {
  display: block;
}

.mm-a11y-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.5rem;
  margin-bottom: 0.65rem;
}
.mm-a11y-title {
  margin: 0;
  font-size: 0.95rem;
  font-weight: 700;
  letter-spacing: 0.02em;
}
.mm-a11y-sub {
  margin: 0.2rem 0 0;
  color: rgba(237, 233, 254, 0.72);
  font-size: 0.78rem;
}
.mm-a11y-close {
  border: 0;
  background: transparent;
  color: #e9d5ff;
  font-size: 1.25rem;
  line-height: 1;
  cursor: pointer;
  padding: 0.15rem 0.35rem;
  border-radius: 0.35rem;
}
.mm-a11y-close:hover {
  background: rgba(255, 255, 255, 0.08);
}

.mm-a11y-group {
  margin: 0.7rem 0 0.35rem;
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: rgba(216, 180, 254, 0.75);
  font-weight: 700;
}

.mm-a11y-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  margin-top: 0.35rem;
}

.mm-a11y-btn {
  appearance: none;
  border: 1px solid rgba(192, 132, 252, 0.35);
  background: rgba(255, 255, 255, 0.04);
  color: #f5f0ff;
  border-radius: 999px;
  padding: 0.38rem 0.65rem;
  font-size: 0.78rem;
  font-weight: 600;
  cursor: pointer;
}
.mm-a11y-btn:hover {
  border-color: rgba(192, 132, 252, 0.7);
  background: rgba(168, 85, 247, 0.18);
}
.mm-a11y-btn[aria-pressed="true"] {
  background: rgba(168, 85, 247, 0.35);
  border-color: #c084fc;
  color: #fff;
}

.mm-a11y-status {
  margin: 0.75rem 0 0;
  min-height: 1.1em;
  font-size: 0.75rem;
  color: rgba(233, 213, 255, 0.8);
}

.mm-a11y-foot {
  margin-top: 0.75rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  align-items: center;
}
.mm-a11y-foot a {
  color: #e9d5ff;
  font-size: 0.78rem;
  font-weight: 600;
}

/* Page-specific a11y content */
.mm-a11y-page .a11y-grid {
  display: grid;
  gap: 1rem;
  grid-template-columns: repeat(auto-fit, minmax(15rem, 1fr));
  margin: 1.25rem 0 2rem;
}
.mm-a11y-page .a11y-card {
  border: 1px solid rgba(168, 85, 247, 0.25);
  border-radius: 1rem;
  padding: 1rem 1.1rem;
  background: rgba(255, 255, 255, 0.03);
}
.mm-a11y-page .a11y-card h2 {
  margin: 0 0 0.4rem;
  font-size: 1.05rem;
}
.mm-a11y-page .a11y-card p {
  margin: 0;
  color: var(--muted, #a8a3b5);
  font-size: 0.95rem;
}

@media (max-width: 520px) {
  .mm-a11y-root {
    bottom: 0.65rem;
  }
  .mm-a11y-panel {
    width: calc(100vw - 1rem);
  }
}
