/* ==========================================================================
   Orian Design — accessibility widget + accessibility state overrides.
   Standalone: only depends on --gold / --bg-* / --ink-* when they exist,
   with hard fallbacks so the widget also works on the legal pages.
   ========================================================================== */

.a11y-btn,
.a11y-panel { font-family: 'Heebo', system-ui, sans-serif; }

/* ---------- Floating button ---------- */
.a11y-btn {
  position: fixed;
  inset-inline-start: 18px;
  bottom: 18px;
  z-index: 9950;
  width: 54px;
  height: 54px;
  padding: 0;
  border: 1px solid rgba(245, 197, 99, 0.45);
  border-radius: 50%;
  background: #0a0a0c;
  color: #f5c563;
  display: grid;
  place-items: center;
  cursor: pointer;
  box-shadow: 0 14px 34px -12px rgba(0, 0, 0, 0.9), 0 0 0 0 rgba(245, 197, 99, 0.35);
  transition: transform .3s ease, box-shadow .3s ease, background .3s ease;
}
.a11y-btn:hover {
  transform: scale(1.07);
  background: #111114;
  box-shadow: 0 14px 34px -12px rgba(0, 0, 0, 0.9), 0 0 0 6px rgba(245, 197, 99, 0.12);
}
.a11y-btn:focus-visible { outline: 2px solid #f5c563; outline-offset: 3px; }

/* ---------- Panel ---------- */
.a11y-panel {
  position: fixed;
  inset-inline-start: 18px;
  bottom: 84px;
  z-index: 9951;
  width: 306px;
  max-width: calc(100vw - 36px);
  padding: 20px;
  background: #0a0a0c;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 20px;
  box-shadow: 0 34px 80px -34px rgba(0, 0, 0, 1);
  opacity: 0;
  visibility: hidden;
  transform: translateY(10px) scale(.97);
  transform-origin: bottom right; /* the button sits inline-start, i.e. right in RTL */
  transition: opacity .28s ease, transform .28s ease, visibility .28s ease;
}
.a11y-panel.is-open { opacity: 1; visibility: visible; transform: none; }

.a11y-title {
  margin: 0 0 14px;
  font-size: 18px;
  font-weight: 800;
  color: #ffffff;
  letter-spacing: -0.01em;
}
.a11y-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 9px 0;
  font-size: 14.5px;
  font-weight: 500;
  color: #d4d4d8;
}
.a11y-seg {
  display: inline-flex;
  padding: 3px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 11px;
}
.a11y-chip {
  padding: 6px 12px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  font-family: inherit;
  font-size: 13px;
  font-weight: 600;
  color: #8a8a92;
  cursor: pointer;
  transition: background .2s ease, color .2s ease;
}
.a11y-chip:hover { color: #ffffff; }
.a11y-chip[aria-pressed="true"] { background: #f5c563; color: #000000; }
.a11y-chip:focus-visible { outline: 2px solid #f5c563; outline-offset: 2px; }

.a11y-reset {
  width: 100%;
  margin-top: 14px;
  padding: 11px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 11px;
  background: rgba(255, 255, 255, 0.04);
  font-family: inherit;
  font-size: 14px;
  font-weight: 600;
  color: #ffffff;
  cursor: pointer;
  transition: background .2s ease;
}
.a11y-reset:hover { background: rgba(255, 255, 255, 0.09); }

.a11y-statement {
  display: block;
  margin-top: 10px;
  text-align: center;
  font-size: 13px;
  color: #8a8a92;
  text-decoration: underline;
  text-underline-offset: 3px;
}
.a11y-statement:hover { color: #f5c563; }

/* ---------- Skip link ---------- */
.skip-link {
  position: fixed;
  inset-inline-start: 50%;
  top: -80px;
  z-index: 9999;
  transform: translateX(50%);
  padding: 12px 22px;
  border-radius: 0 0 12px 12px;
  background: #f5c563;
  color: #000;
  font-weight: 700;
  text-decoration: none;
  transition: top .2s ease;
}
.skip-link:focus { top: 0; }

/* ==========================================================================
   Accessibility state overrides
   ========================================================================== */

/* Larger text — scales each top-level block, but never the widget itself. */
[data-text="large"] body > *:not(.a11y-btn):not(.a11y-panel):not(.skip-link) { zoom: 1.12; }

/* High contrast — lift the muted inks so body copy passes AA comfortably.
   `html[...]` (not `[...]`) so these tokens outrank the page's own `:root`
   block, which has equal specificity but comes later in the document. */
html[data-contrast="high"] {
  --ink-2: #ffffff;
  --ink-3: #e2e2e6;
  --ink-4: #b9b9c2;
  --ink-5: rgba(255, 255, 255, .35);
  --line: rgba(255, 255, 255, .2);
}
html[data-contrast="high"] body { background: #000000; }
html[data-contrast="high"] #starfield { opacity: .35; }

/* Emphasise links */
[data-links="on"] a:not(.a11y-statement) {
  text-decoration: underline !important;
  text-underline-offset: 3px;
  text-decoration-thickness: 2px;
}

/* Stop motion */
[data-motion="off"] { scroll-behavior: auto !important; }
[data-motion="off"] *,
[data-motion="off"] *::before,
[data-motion="off"] *::after {
  animation: none !important;
  transition: none !important;
}
[data-motion="off"] [class*="reveal"] {
  opacity: 1 !important;
  transform: none !important;
}

@media (max-width: 480px) {
  .a11y-btn { width: 48px; height: 48px; inset-inline-start: 14px; bottom: 14px; }
  .a11y-panel { inset-inline-start: 14px; bottom: 74px; }
}
