/* ─── Accessibility menu ─────────────────────────────────── */

/* Anchored to the vertical middle of the left edge. The toggle and the
   panel are both centered on that line; opening slides the panel in from
   the left and pushes the toggle along with it. */
.a11y {
  --a11y-panel-w: 200px;
  position: fixed;
  top: 50%;
  left: 0;
  z-index: 50;
  direction: ltr;
}

.a11y,
.a11y * {
  box-sizing: border-box;
}

.a11y-toggle {
  position: absolute;
  left: 0;
  top: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  padding: 0;
  background: #fff;
  color: #000;
  border: none;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.35);
  cursor: pointer;
  transform: translate(0, -50%);
  transition: transform 0.75s cubic-bezier(0.16, 1, 0.3, 1);
}

.a11y.open .a11y-toggle {
  transform: translate(var(--a11y-panel-w), -50%);
}

.a11y-light .a11y-toggle {
  background: #000;
  color: #fff;
}

.a11y-toggle svg {
  width: 26px;
  height: 26px;
}

.a11y-panel {
  position: absolute;
  left: 0;
  top: 0;
  width: var(--a11y-panel-w);
  max-height: calc(100vh - 32px);
  overflow-y: auto;
  padding: 16px 16px 14px;
  background: #fff;
  color: #222;
  direction: rtl;
  text-align: right;
  font-family: 'Heebo', Arial, sans-serif;
  box-shadow: 0 6px 24px rgba(0, 0, 0, 0.35);
  opacity: 0;
  visibility: hidden;
  transform: translate(-100%, -50%);
  transition: transform 0.55s cubic-bezier(0.7, 0, 0.84, 0),
              opacity 0.45s ease,
              visibility 0s linear 0.55s;
}

.a11y.open .a11y-panel {
  opacity: 1;
  visibility: visible;
  transform: translate(0, -50%);
  transition: transform 0.75s cubic-bezier(0.16, 1, 0.3, 1),
              opacity 0.6s ease,
              visibility 0s;
}

html[lang="en"] .a11y-panel {
  direction: ltr;
  text-align: left;
}

/* Phones: anchor to the bottom-left corner so it doesn't cover the form.
   Toggle and panel grow upward from the bottom edge. */
@media (max-width: 600px) {
  .a11y {
    top: auto;
    bottom: 20px;
  }

  .a11y-toggle {
    top: auto;
    bottom: 0;
    transform: translate(0, 0);
  }

  .a11y.open .a11y-toggle {
    transform: translate(var(--a11y-panel-w), 0);
  }

  .a11y-panel {
    top: auto;
    bottom: 0;
    max-height: calc(100vh - 40px);
    transform: translate(-100%, 0);
  }

  .a11y.open .a11y-panel {
    transform: translate(0, 0);
  }
}

@media (prefers-reduced-motion: reduce) {
  .a11y-toggle,
  .a11y-panel,
  .a11y.open .a11y-panel {
    transition: none;
  }
}

.a11y-title {
  font-size: 18px;
  font-weight: 700;
  color: #222;
  margin-bottom: 8px;
}

.a11y-panel ul {
  list-style: none;
  margin: 0;
  padding: 0;
}

.a11y-panel li button {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  padding: 6px 4px;
  font-family: inherit;
  font-size: 15px;
  font-weight: 400;
  text-align: inherit;
  background: none;
  border: none;
  color: #222;
  cursor: pointer;
}

.a11y-panel li button span {
  text-decoration: underline;
  text-underline-offset: 4px;
  text-decoration-thickness: 1px;
}

.a11y-panel li button svg {
  flex: none;
  width: 18px;
  height: 18px;
}

.a11y-panel li button:hover {
  background: #f0f0f0;
}

.a11y-panel li button[aria-pressed="true"] {
  background: #e3e3e3;
  font-weight: 700;
}

.a11y-panel li button:disabled {
  opacity: 0.4;
  cursor: default;
}

.a11y-statement {
  display: block;
  margin-top: 8px;
  padding-top: 10px;
  border-top: 1px solid #ddd;
  font-size: 13px;
  color: #222;
  text-underline-offset: 4px;
}

.a11y a:focus-visible,
.a11y button:focus-visible {
  outline: 3px solid #1a5fd0;
  outline-offset: -3px;
}

/* ─── Effects ────────────────────────────────────────────── */

/* Text size */
main {
  zoom: var(--a11y-scale, 1);
}

/* Grayscale */
.a11y-grayscale main,
.a11y-grayscale .bg,
.a11y-grayscale .lyrics-layer,
.a11y-grayscale .lang-toggle {
  filter: grayscale(1);
}

/* Shared: remove decorative layers for the contrast schemes */
.a11y-contrast .bg,
.a11y-contrast .lyrics-layer,
.a11y-contrast .grain,
.a11y-negative .bg,
.a11y-negative .lyrics-layer,
.a11y-negative .grain,
.a11y-light .bg,
.a11y-light .lyrics-layer,
.a11y-light .grain {
  display: none;
}

.a11y-contrast .panel,
.a11y-negative .panel,
.a11y-light .panel {
  background: transparent;
  -webkit-backdrop-filter: none;
  backdrop-filter: none;
}

/* High contrast: white on black, yellow links */
.a11y-contrast body {
  background: #000;
}

.a11y-contrast body :not(.a11y *) {
  color: #fff !important;
  border-color: #fff !important;
}

.a11y-contrast body a:not(.a11y *) {
  color: #ffeb3b !important;
}

/* Negative contrast: yellow on black */
.a11y-negative body {
  background: #000;
}

.a11y-negative body :not(.a11y *) {
  color: #ffeb3b !important;
  border-color: #ffeb3b !important;
}

.a11y-negative body a:not(.a11y *) {
  color: #00e5ff !important;
}

/* Light background: black on white */
.a11y-light body {
  background: #fff;
}

.a11y-light body :not(.a11y *) {
  color: #000 !important;
  border-color: #000 !important;
}

.a11y-light body a:not(.a11y *) {
  color: #0033cc !important;
}

.a11y-light .signup button:hover {
  background: #000;
  color: #fff !important;
}

/* Underline links */
.a11y-links a:not(.a11y *) {
  text-decoration: underline !important;
  text-underline-offset: 4px;
  outline: 2px dashed currentColor;
  outline-offset: 3px;
}

/* Readable font */
.a11y-font body,
.a11y-font body * {
  font-family: Arial, Helvetica, sans-serif !important;
  letter-spacing: normal !important;
}

/* The name is a white PNG: invert it on the light background */
.a11y-light .name-full,
.a11y-light .name-letter,
.a11y-light .thanks-img {
  filter: invert(1);
}
