:root {
  --font-size-multiplier: 1;
  --high-contrast: 0; /* 0 or 1 */
  --link-highlight: 0; /* 0 or 1 */
  --reduce-motion: 0; /* 0 or 1 */
}

.a11y-settings-btn {
  position: fixed;
  right: 16px;
  bottom: 16px;
  background: #588157;
  color: #fff;
  border: none;
  width: 56px;
  height: 56px;
  padding: 0;
  border-radius: 50%;
  cursor: pointer;
  z-index: 1000;
  font-size: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 24px rgba(37, 99, 235, 0.18);
  transition: box-shadow 0.2s;
}

.a11y-settings-panel {
  position: fixed;
  right: 2px;
  bottom: 2px;
  left: auto;
  top: auto;
  transform: none;
  margin: 0;
  background: #fff !important;
  border: 2px solid rgba(0, 0, 0, 0.1);
  border-radius: 16px;
  padding: 48px 16px 16px 16px;
  z-index: 1001;
  display: none;
  max-width: 480px;
  width: calc(100% - 4px);
  font-size: 16px !important;
  color: #222 !important;
}

.a11y-settings-panel.show {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.a11y-settings-panel h3 {
  margin-top: 0;
}

.a11y-settings-panel label {
  display: block;
  margin: 0;
}

.a11y-settings-panel button {
  margin: 0;
  padding: 0;
}

.a11y-settings-panel button.close-btn {
  position: absolute;
  top: 10px;
  right: 10px;
  background: none;
  border: none;
  cursor: pointer;
  border-radius: 100px;
  padding: 2px;
  background-color: rgba(0, 0, 0, 0.1);
  transition: background-color 0.2s ease-in-out;
}

.a11y-settings-panel button.close-btn:hover {
  background-color: rgba(0, 0, 0, 0.2);
}

.a11y-settings-panel .action-wrapper {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px 0;
  text-align: center;
  background-color: rgba(0, 0, 0, 0.025);
  border: 1px solid rgba(0, 0, 0, 0.05);
  padding: 12px;
  border-radius: 8px;
}

.a11y-settings-panel .action-title {
  font-weight: 600;
}

.a11y-settings-panel .action-button {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: none;
  background-color: #588157;
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background-color 0.2s ease-in-out;

  svg {
    fill: currentColor;
  }
}

.a11y-options-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}

.a11y-option-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  font-size: 16px;
  font-weight: 600;
  color: #222;
  background-color: rgba(0, 0, 0, 0.025);
  border: 2px solid rgba(0, 0, 0, 0.05);
  border-radius: 8px;
  aspect-ratio: 4 / 3;
  padding: 8px;
  box-shadow: none;
  cursor: pointer;
  transition:
    color 0.2s ease-in-out,
    border-color 0.2s ease-in-out;
  position: relative;
}

.a11y-option-btn[aria-pressed="true"] {
  border-color: #588157;
  color: #588157;
}

body.high-contrast {
  --bg-color: #000;
  --secondary-color: #fff;
  --primary-color: #fff;
  --accent-color-1: #fff;
  --accent-color-2: #fff;
  background-color: var(--bg-color);
  color: var(--secondary-color);

  img {
    mix-blend-mode: unset !important;
  }
}

body.link-highlight a {
  background-color: yellow !important;
  color: black !important;
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

body.reduce-motion *,
body.reduce-motion *::before,
body.reduce-motion *::after {
  animation-duration: 0.01ms !important;
  animation-iteration-count: 1 !important;
  transition-duration: 0.01ms !important;
}
