/* ============================================================
   Accessibility widget — minimal in-house tool
   Floating button bottom-LEFT (away from the kinetic FAB on right).
   Opens a panel with: font-size +/-/reset, high-contrast toggle,
   underline-links toggle, link to full statement.
   Persists choices via localStorage so the user's settings stick.
   ============================================================ */

.a11y-fab {
  position: fixed;
  bottom: clamp(82px, 12vh, 120px);
  inset-inline-start: clamp(14px, 2vw, 22px);
  z-index: 520;
  width: 44px; height: 44px;
  background: var(--ink, #0A0A0A);
  color: var(--bone, #F9F9F9);
  border: 1px solid var(--ink, #0A0A0A);
  border-radius: 50%;
  display: grid; place-items: center;
  cursor: pointer;
  box-shadow: 0 6px 18px rgba(0,0,0,0.22);
  font-family: 'Heebo', sans-serif;
  font-weight: 700;
  font-size: 16px;
  letter-spacing: 0;
  transition: transform 0.25s cubic-bezier(0.16, 1, 0.3, 1), background 0.25s linear;
}
.a11y-fab:hover { transform: scale(1.06); background: #BD5532; border-color: #BD5532; }
.a11y-fab:focus-visible { outline: 2px solid #BD5532; outline-offset: 4px; }

.a11y-panel {
  position: fixed;
  bottom: clamp(132px, 18vh, 178px);
  inset-inline-start: clamp(14px, 2vw, 22px);
  z-index: 521;
  width: clamp(260px, 28vw, 320px);
  background: var(--bone, #F9F9F9);
  color: var(--ink, #0A0A0A);
  border: 1px solid var(--ink, #0A0A0A);
  padding: 18px;
  font-family: 'Heebo', sans-serif;
  box-shadow: 0 12px 32px rgba(0,0,0,0.22);
  display: none;
}
.a11y-panel.is-open { display: block; }
.a11y-panel h3 {
  font-family: 'Space Grotesk', sans-serif;
  font-weight: 700;
  font-size: 13px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--ink, #0A0A0A);
  margin: 0 0 12px;
  padding-bottom: 8px;
  border-bottom: 1px solid rgba(0,0,0,0.12);
}
.a11y-panel .a11y-row {
  display: flex; align-items: center; justify-content: space-between;
  gap: 10px;
  padding: 8px 0;
  font-size: 13px;
  color: var(--ink, #0A0A0A);
}
.a11y-panel .a11y-row + .a11y-row { border-top: 1px solid rgba(0,0,0,0.06); }
.a11y-panel .a11y-row label,
.a11y-panel .a11y-row span:first-child {
  font-weight: 500;
  flex: 1;
}
.a11y-panel .a11y-controls { display: flex; gap: 4px; }
.a11y-panel button {
  font-family: 'JetBrains Mono', monospace;
  font-size: 12px;
  font-weight: 500;
  padding: 6px 10px;
  background: transparent;
  border: 1px solid rgba(0,0,0,0.2);
  color: var(--ink, #0A0A0A);
  cursor: pointer;
  transition: background 0.2s, border-color 0.2s, color 0.2s;
}
.a11y-panel button:hover { background: rgba(0,0,0,0.06); }
.a11y-panel button.is-active {
  background: var(--ink, #0A0A0A);
  color: var(--bone, #F9F9F9);
  border-color: var(--ink, #0A0A0A);
}
.a11y-panel .a11y-link {
  display: block;
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid rgba(0,0,0,0.12);
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px;
  letter-spacing: 0.06em;
  color: #BD5532;
  text-decoration: none;
  border-bottom: 1px solid #BD5532;
  padding-bottom: 4px;
  width: max-content;
}
.a11y-panel .a11y-link:hover { color: #9A4429; }
.a11y-panel .a11y-close {
  background: transparent;
  border: 0;
  color: var(--ink, #0A0A0A);
  font-size: 18px;
  cursor: pointer;
  padding: 0;
  line-height: 1;
  position: absolute;
  top: 14px;
  inset-inline-end: 14px;
  width: 24px; height: 24px;
}

/* ===== Body-level accessibility classes ===== */

/* Font scale — driven by --a11y-scale */
html { --a11y-scale: 1; }
html { font-size: calc(16px * var(--a11y-scale)); }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
}

/* High contrast — boost text + remove subtle decoration */
body.a11y-contrast {
  --bone: #FFFFFF;
  --ink: #000000;
  --ink-2: #000000;
  --ink-3: #1a1a1a;
  --whisper: #4a4a4a;
  --whisper-d: #4a4a4a;
  --whisper-on-dark: #d0d0d0;
  --rule-l: rgba(0,0,0,0.45);
  --rule-d: rgba(255,255,255,0.45);
  --terracotta: #B33000;
}
body.a11y-contrast img { filter: contrast(1.1); }

/* Link underline emphasis */
body.a11y-underline a:not(.skip-link):not([class*="btn"]):not([class*="cta"]):not([class*="enter"]) {
  text-decoration: underline !important;
  text-underline-offset: 3px;
}

@media (max-width: 720px) {
  .a11y-fab { width: 40px; height: 40px; font-size: 14px; }
  .a11y-panel { width: calc(100vw - 28px); inset-inline-start: 14px; }
}
