:root {
  --accessibility-font-scale: 1;
  --accessibility-reading-y: 50vh;
  --accessibility-cursor-x: 50vw;
  --accessibility-cursor-y: 50vh;
}

body {
  font-size: calc(100% * var(--accessibility-font-scale));
}

.accessibility-toggle {
  position: fixed;
  left: 16px;
  top: 90%;
  z-index: 6200;
  width: 52px;
  height: 52px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid rgba(255, 255, 255, 0.35);
  border-radius: 999px;
  background: #004A6A;
  color: #ffffff;
  box-shadow: 0 16px 36px rgba(0, 74, 106, 0.24);
  transform: translateY(-50%);
}

.accessibility-toggle:hover,
.accessibility-toggle:focus-visible {
  background: #0092BF;
  color: #ffffff;
}

.accessibility-toggle:focus-visible {
  outline: 3px solid #ffffff;
  outline-offset: 3px;
  box-shadow: 0 0 0 7px rgba(0, 146, 191, 0.48), 0 16px 36px rgba(0, 74, 106, 0.24);
}

.accessibility-toggle i {
  font-size: 1.35rem;
}

.accessibility-panel {
  position: fixed;
  inset: 50% auto auto 0;
  z-index: 6300;
  width: min(380px, calc(100vw - 24px));
  max-height: min(680px, calc(100dvh - 40px));
  display: grid;
  grid-template-rows: auto 1fr;
  overflow: hidden;
  border: 1px solid rgba(0, 74, 106, 0.1);
  border-left: 0;
  border-radius: 0 18px 18px 0;
  background: #f7fafb;
  color: #263238;
  box-shadow: 18px 24px 55px rgba(0, 74, 106, 0.2);
  transform: translate(-105%, -50%);
  transition: transform 180ms ease, visibility 180ms ease;
  visibility: hidden;
}

.accessibility-panel.is-open {
  transform: translate(0, -50%);
  visibility: visible;
}

.accessibility-panel__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 58px;
  padding: 14px 16px;
  background: linear-gradient(135deg, #004A6A 0%, #145C5D 100%);
  color: #ffffff;
}

.accessibility-panel__header h2 {
  margin: 0;
  color: #ffffff;
  font-size: 1.04rem;
  font-weight: 800;
}

.accessibility-close {
  width: 38px;
  height: 38px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 0;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.12);
  color: #ffffff;
}

.accessibility-close:hover,
.accessibility-close:focus-visible {
  background: rgba(255, 255, 255, 0.22);
}

.accessibility-panel__body {
  display: grid;
  gap: 12px;
  padding: 14px;
  overflow-y: auto;
  background: #f7fafb;
}

.accessibility-panel__group {
  display: grid;
  gap: 8px;
}

.accessibility-panel__group-title {
  margin: 0;
  color: #60717d;
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.accessibility-panel__grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.accessibility-panel__button {
  width: 100%;
  min-height: 44px;
  display: grid;
  grid-template-columns: 22px minmax(0, 1fr);
  align-items: center;
  gap: 8px;
  padding: 9px 10px;
  border: 1px solid #dce7eb;
  border-radius: 10px;
  background: #ffffff;
  color: #263238;
  text-align: left;
  box-shadow: 0 8px 18px rgba(0, 74, 106, 0.05);
}

.accessibility-panel__button span {
  min-width: 0;
  font-size: 0.82rem;
  font-weight: 700;
  line-height: 1.18;
}

.accessibility-panel__button i {
  color: #004A6A;
  font-size: 0.93rem;
  text-align: center;
}

.accessibility-panel__button:hover,
.accessibility-panel__button:focus-visible {
  border-color: #b8d2dc;
  background: #fafdff;
  color: #004A6A;
  box-shadow: 0 10px 24px rgba(0, 74, 106, 0.09);
}

.accessibility-panel__button:focus-visible,
.accessibility-close:focus-visible {
  outline: 3px solid rgba(0, 146, 191, 0.34);
  outline-offset: 2px;
  box-shadow: inset 0 0 0 2px #ffffff;
}

.accessibility-panel__button[aria-pressed="true"] {
  border-color: #0092BF;
  background: #e8f5f9;
  color: #004A6A;
  font-weight: 800;
}

.accessibility-panel__button[aria-pressed="true"] i {
  color: #0092BF;
}

.accessibility-panel__note {
  margin: 0;
  color: #60717d;
  font-size: 0.8rem;
  line-height: 1.35;
}

.accessibility-panel__reset {
  min-height: 48px;
  grid-template-columns: 24px 1fr;
  justify-content: center;
  border-color: #ff9dad;
  background: #fff3f5;
  color: #a9153d;
  box-shadow: none;
}

.accessibility-panel__reset span {
  font-size: 0.88rem;
  font-weight: 800;
}

.accessibility-panel__reset i,
.accessibility-panel__reset[aria-pressed="true"] i {
  color: #a9153d;
}

.accessibility-panel__reset:hover,
.accessibility-panel__reset:focus-visible {
  border-color: #f5657f;
  background: #ffe8ed;
  color: #8f1236;
}

html.accessibility-grayscale {
  filter: grayscale(1);
}

html.accessibility-reduce-saturation {
  filter: saturate(0.62);
}

html.accessibility-grayscale.accessibility-reduce-saturation {
  filter: grayscale(1) saturate(0.62);
}

html.accessibility-high-contrast body {
  background: #050f14 !important;
  color: #ffffff !important;
}

html.accessibility-high-contrast :where(section, article, aside, header, footer, nav, div, main) {
  border-color: rgba(255, 255, 255, 0.45) !important;
}

html.accessibility-high-contrast :where(.card, .site-header, .site-footer, .sidebar-box, .faq-cta, .contact-item, .reference-card) {
  background: #071820 !important;
  color: #ffffff !important;
}

html.accessibility-high-contrast :where(a, button:not(.accessibility-toggle):not(.accessibility-close):not(.accessibility-panel__button)) {
  color: #ffffff;
}

html.accessibility-high-contrast a {
  text-decoration: underline;
  text-decoration-thickness: 0.12em;
}

html.accessibility-low-contrast body {
  background: #f6f9fb;
  color: #344858;
}

html.accessibility-low-contrast :where(.card, .site-header, .site-footer, .sidebar-box, .contact-item) {
  box-shadow: none !important;
}

html.accessibility-light-background body,
html.accessibility-light-background :where(section, main) {
  background: #fffdf7 !important;
  color: #17212b !important;
}

html.accessibility-reduce-motion *,
html.accessibility-reduce-motion *::before,
html.accessibility-reduce-motion *::after {
  scroll-behavior: auto !important;
  animation-duration: 0.001ms !important;
  animation-iteration-count: 1 !important;
  transition-duration: 0.001ms !important;
}

html.accessibility-reduce-motion :where(
  .card__media img,
  .service-card .card__media img,
  .blog-card .card__media img,
  .blog-list .card__media img,
  .blog-preview .card__media img,
  .gallery-item img,
  .video-card__frame img
) {
  transform: none !important;
  filter: none !important;
  transition: none !important;
}

html.accessibility-reduce-motion :where(
  .card:hover .card__media img,
  .card:focus-within .card__media img,
  .service-card:hover .card__media img,
  .service-card:focus-within .card__media img,
  .blog-card:hover .card__media img,
  .blog-card:focus-within .card__media img,
  .blog-list .card:hover .card__media img,
  .blog-list .card:focus-within .card__media img,
  .blog-preview .card:hover .card__media img,
  .blog-preview .card:focus-within .card__media img,
  .gallery-item:hover img,
  .gallery-item:focus-within img,
  .video-card:hover .video-card__frame img,
  .video-card:focus-within .video-card__frame img
) {
  transform: none !important;
  filter: none !important;
}

html.accessibility-hide-images img {
  visibility: hidden !important;
}

html.accessibility-hide-images :where(.card__media, .hero__slide, .video-card__frame) {
  background: #e8f1f6 !important;
}

html.accessibility-dyslexia-font body {
  font-family: "Atkinson Hyperlegible", "Noto Sans", "Segoe UI", Roboto, Arial, sans-serif !important;
}

html.accessibility-line-height body {
  line-height: 1.9;
}

html:is(
  .accessibility-align-left,
  .accessibility-align-center,
  .accessibility-align-right,
  .accessibility-align-justify
) :where(
  h1,
  h2,
  h3,
  h4,
  h5,
  h6,
  p,
  li,
  label,
  figcaption,
  blockquote,
  .section-head,
  .section-head.center,
  .hero__box,
  .hero__actions,
  .card,
  .card__body,
  .testimonial-card,
  .footer-main,
  .footer-bottom,
  .contact-item,
  .sidebar-box,
  .faq-cta,
  .breadcrumb
) {
  text-align: left !important;
}

html.accessibility-align-center :where(
  h1,
  h2,
  h3,
  h4,
  h5,
  h6,
  p,
  li,
  label,
  figcaption,
  blockquote,
  .section-head,
  .section-head.center,
  .hero__box,
  .hero__actions,
  .card,
  .card__body,
  .testimonial-card,
  .footer-main,
  .footer-bottom,
  .contact-item,
  .sidebar-box,
  .faq-cta,
  .breadcrumb
) {
  text-align: center !important;
}

html.accessibility-align-right :where(
  h1,
  h2,
  h3,
  h4,
  h5,
  h6,
  p,
  li,
  label,
  figcaption,
  blockquote,
  .section-head,
  .section-head.center,
  .hero__box,
  .hero__actions,
  .card,
  .card__body,
  .testimonial-card,
  .footer-main,
  .footer-bottom,
  .contact-item,
  .sidebar-box,
  .faq-cta,
  .breadcrumb
) {
  text-align: right !important;
}

html.accessibility-align-justify :where(
  p,
  li,
  figcaption,
  blockquote,
  .card__body,
  .testimonial-card,
  .contact-item,
  .sidebar-box,
  .faq-cta,
  .breadcrumb
) {
  text-align: justify !important;
}

html.accessibility-align-left :where(.section-head.center, .testimonial-actions, .testimonial-links, .footer-bottom) {
  justify-content: flex-start !important;
  align-items: flex-start !important;
}

html.accessibility-align-center :where(.section-head, .section-head.center, .testimonial-actions, .testimonial-links, .footer-bottom) {
  justify-content: center !important;
  align-items: center !important;
}

html.accessibility-align-right :where(.section-head, .section-head.center, .testimonial-actions, .testimonial-links, .footer-bottom) {
  justify-content: flex-end !important;
  align-items: flex-end !important;
}

html.accessibility-align-justify :where(.section-head.center, .testimonial-actions, .testimonial-links, .footer-bottom) {
  justify-content: stretch !important;
  align-items: stretch !important;
}

html.accessibility-text-spacing body {
  letter-spacing: 0.08em;
  word-spacing: 0.16em;
}

html.accessibility-text-spacing p {
  margin-bottom: 1.35em;
}

html.accessibility-reading-mask body::before,
html.accessibility-reading-guide body::after {
  content: "";
  position: fixed;
  left: 0;
  width: 100vw;
  pointer-events: none;
}

html.accessibility-reading-mask body::before {
  top: 0;
  z-index: 6100;
  height: 100vh;
  background:
    linear-gradient(
      to bottom,
      rgba(5, 15, 20, 0.58) 0,
      rgba(5, 15, 20, 0.58) max(0px, calc(var(--accessibility-reading-y) - 72px)),
      transparent max(0px, calc(var(--accessibility-reading-y) - 72px)),
      transparent calc(var(--accessibility-reading-y) + 72px),
      rgba(5, 15, 20, 0.58) calc(var(--accessibility-reading-y) + 72px),
      rgba(5, 15, 20, 0.58) 100%
    );
}

html.accessibility-reading-guide body::after {
  top: calc(var(--accessibility-reading-y) - 2px);
  z-index: 6110;
  height: 4px;
  background: #ffcf33;
  box-shadow: 0 0 0 1px rgba(5, 15, 20, 0.28), 0 0 18px rgba(255, 207, 51, 0.52);
}

html.accessibility-cursor-highlight::after {
  content: "";
  position: fixed;
  left: calc(var(--accessibility-cursor-x) - 22px);
  top: calc(var(--accessibility-cursor-y) - 22px);
  z-index: 6120;
  width: 44px;
  height: 44px;
  border: 3px solid #ffcf33;
  border-radius: 999px;
  background: rgba(255, 207, 51, 0.16);
  box-shadow: 0 0 0 2px rgba(5, 15, 20, 0.32), 0 0 22px rgba(255, 207, 51, 0.55);
  pointer-events: none;
  transform: translateZ(0);
}

html.accessibility-highlight-links a {
  padding-inline: 0.12em;
  border-radius: 4px;
  background: rgba(0, 146, 191, 0.14);
  color: #004A6A;
  text-decoration: underline !important;
  text-decoration-thickness: 0.12em;
  text-underline-offset: 0.18em;
}

html.accessibility-high-contrast.accessibility-highlight-links a {
  background: #ffffff;
  color: #050f14;
}

@media (max-width: 760px) {
  .accessibility-toggle {
    top: auto;
    bottom: 18px;
    left: 14px;
    transform: none;
  }

  .accessibility-panel {
    inset: auto auto 16px 0;
    width: min(360px, calc(100vw - 16px));
    max-height: calc(100dvh - 32px);
    border-radius: 0 12px 12px 0;
    transform: translateX(-105%);
  }

  .accessibility-panel.is-open {
    transform: translateX(0);
  }

  .accessibility-panel__body {
    padding: 12px;
  }

  .accessibility-panel__button span {
    font-size: 0.8rem;
  }

  .accessibility-panel__button[data-accessibility-action="readingGuide"],
  .accessibility-panel__button[data-accessibility-action="readingMask"] {
    display: none;
  }

  html.accessibility-reading-mask body::before,
  html.accessibility-reading-guide body::after {
    content: none;
  }
}
