/* /css/accessibility.css */

:root {
  --a11y-accent: #0b63ff;
  --a11y-accent-dark: #0542ad;
  --a11y-panel-bg: rgba(255, 255, 255, 0.94);
  --a11y-panel-border: rgba(148, 163, 184, 0.24);
  --a11y-panel-shadow: 0 28px 60px rgba(15, 23, 42, 0.22);
}

.skip-link {
  position: fixed;
  top: 1rem;
  inset-inline-start: 1rem;
  z-index: 200;
  padding: 0.8rem 1.1rem;
  border-radius: 999px;
  background: #111827;
  color: #ffffff;
  font-weight: 700;
  box-shadow: 0 12px 24px rgba(15, 23, 42, 0.18);
  transform: translateY(-180%);
  transition: transform 180ms ease;
}

.skip-link:focus-visible {
  transform: translateY(0);
}

.a11y-fab {
  position: fixed;
  inset-inline-end: clamp(1rem, 2vw + 0.8rem, 1.75rem);
  inset-block-end: clamp(1rem, 2vw + 0.8rem, 1.75rem);
  width: 4.75rem;
  height: 4.75rem;
  border: none;
  border-radius: 50%;
  background: linear-gradient(145deg, #08388f, #0b63ff 60%, #2b7bff);
  box-shadow: 0 20px 40px rgba(11, 99, 255, 0.35);
  display: grid;
  place-items: center;
  cursor: pointer;
  z-index: 80;
  isolation: isolate;
  transition:
    transform 180ms ease,
    box-shadow 180ms ease,
    filter 180ms ease;
}

.a11y-fab:hover {
  transform: translateY(-2px) scale(1.01);
  box-shadow: 0 24px 48px rgba(11, 99, 255, 0.42);
}

.a11y-fab__pulse {
  position: absolute;
  inset: -0.45rem;
  border-radius: inherit;
  background: radial-gradient(circle, rgba(147, 197, 253, 0.36), transparent 68%);
  animation: a11y-pulse 2.4s ease-out infinite;
  z-index: -1;
}

.a11y-fab__icon-wrap {
  width: 3.2rem;
  height: 3.2rem;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.96);
  display: grid;
  place-items: center;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.9),
    0 10px 24px rgba(2, 6, 23, 0.15);
}

.a11y-fab__icon {
  width: 2.15rem;
  height: 2.15rem;
  object-fit: contain;
}

.a11y-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.42);
  backdrop-filter: blur(3px);
  opacity: 0;
  pointer-events: none;
  z-index: 68;
  transition: opacity 200ms ease;
}

.a11y-backdrop.is-visible {
  opacity: 1;
  pointer-events: auto;
}

.a11y-panel {
  position: fixed;
  inset-inline-end: clamp(1rem, 2vw + 0.8rem, 1.75rem);
  inset-block-end: calc(clamp(1rem, 2vw + 0.8rem, 1.75rem) + 5.6rem);
  width: min(24rem, calc(100vw - 2rem));
  max-height: min(80vh, 42rem);
  padding: 1.25rem;
  border-radius: 1.5rem;
  border: 1px solid var(--a11y-panel-border);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(248, 250, 252, 0.96)),
    var(--a11y-panel-bg);
  box-shadow: var(--a11y-panel-shadow);
  backdrop-filter: blur(18px);
  overflow: auto;
  opacity: 0;
  pointer-events: none;
  transform: translateY(1rem) scale(0.98);
  transition:
    opacity 220ms ease,
    transform 220ms ease;
  z-index: 70;
}

.a11y-panel.is-open {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0) scale(1);
}

.a11y-panel__header,
.a11y-panel__status-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.85rem;
}

.a11y-panel__eyebrow {
  margin: 0;
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--a11y-accent-dark);
}

.a11y-panel__close,
.a11y-panel__reset {
  border: none;
  background: rgba(11, 99, 255, 0.1);
  color: var(--a11y-accent-dark);
  font: inherit;
  font-weight: 700;
  cursor: pointer;
  transition:
    background-color 180ms ease,
    transform 180ms ease;
}

.a11y-panel__close {
  width: 2.35rem;
  height: 2.35rem;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-size: 1rem;
  flex-shrink: 0;
}

.a11y-panel__close:hover,
.a11y-panel__reset:hover {
  background: rgba(11, 99, 255, 0.16);
  transform: translateY(-1px);
}

.a11y-panel__title {
  margin: 1rem 0 0.55rem;
  font-size: clamp(1.45rem, 3vw, 1.75rem);
  line-height: 1.15;
}

.a11y-panel__description {
  margin: 0;
  color: #475569;
  line-height: 1.65;
}

.a11y-panel__status-row {
  margin-top: 1rem;
}

.a11y-panel__status {
  display: inline-flex;
  align-items: center;
  min-height: 2.3rem;
  padding: 0.45rem 0.8rem;
  border-radius: 999px;
  background: rgba(15, 23, 42, 0.06);
  color: #0f172a;
  font-size: 0.9rem;
  font-weight: 600;
}

.a11y-panel__reset {
  padding: 0.6rem 0.95rem;
  border-radius: 999px;
}

.a11y-options {
  display: grid;
  gap: 0.8rem;
  margin-top: 1.1rem;
}

.a11y-option {
  width: 100%;
  padding: 1rem;
  border: 1px solid rgba(148, 163, 184, 0.28);
  border-radius: 1.1rem;
  background: rgba(255, 255, 255, 0.88);
  box-shadow: 0 12px 28px rgba(15, 23, 42, 0.06);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.95rem;
  text-align: start;
  cursor: pointer;
  transition:
    transform 180ms ease,
    border-color 180ms ease,
    background-color 180ms ease,
    box-shadow 180ms ease;
}

.a11y-option:hover {
  transform: translateY(-2px);
  border-color: rgba(11, 99, 255, 0.35);
  box-shadow: 0 18px 32px rgba(15, 23, 42, 0.08);
}

.a11y-option.is-active {
  border-color: rgba(11, 99, 255, 0.42);
  background:
    linear-gradient(180deg, rgba(239, 246, 255, 0.92), rgba(255, 255, 255, 0.96));
}

.a11y-option__copy {
  display: flex;
  flex-direction: column;
  gap: 0.22rem;
}

.a11y-option__title {
  font-size: 1rem;
  font-weight: 700;
  color: #0f172a;
}

.a11y-option__description {
  color: #475569;
  font-size: 0.92rem;
  line-height: 1.55;
}

.a11y-option__switch {
  position: relative;
  flex-shrink: 0;
  width: 3rem;
  height: 1.8rem;
  border-radius: 999px;
  background: rgba(148, 163, 184, 0.55);
  transition: background-color 180ms ease;
}

.a11y-option__switch::before {
  content: "";
  position: absolute;
  top: 0.2rem;
  inset-inline-start: 0.22rem;
  width: 1.4rem;
  height: 1.4rem;
  border-radius: 50%;
  background: #ffffff;
  box-shadow: 0 6px 12px rgba(15, 23, 42, 0.18);
  transition: transform 180ms ease;
}

.a11y-option.is-active .a11y-option__switch {
  background: linear-gradient(145deg, var(--a11y-accent-dark), var(--a11y-accent));
}

.a11y-option.is-active .a11y-option__switch::before {
  transform: translateX(1.18rem);
}

[dir="rtl"] .a11y-option.is-active .a11y-option__switch::before {
  transform: translateX(-1.18rem);
}

.a11y-support {
  margin-top: 1.25rem;
  padding-top: 1.15rem;
  border-top: 1px solid rgba(148, 163, 184, 0.24);
}

.a11y-support__title {
  margin: 0 0 0.7rem;
  font-size: 1rem;
}

.a11y-support__list {
  display: grid;
  gap: 0.7rem;
}

.a11y-support__item {
  position: relative;
  padding-inline-start: 1.35rem;
  color: #334155;
}

.a11y-support__item::before {
  content: "";
  position: absolute;
  inset-inline-start: 0;
  top: 0.48rem;
  width: 0.55rem;
  height: 0.55rem;
  border-radius: 50%;
  background: linear-gradient(145deg, var(--a11y-accent-dark), var(--a11y-accent));
  box-shadow: 0 0 0 0.22rem rgba(11, 99, 255, 0.12);
}

html.a11y-large-text {
  font-size: 112.5%;
}

html.a11y-underlined-links a {
  text-decoration: underline;
  text-decoration-thickness: 0.12em;
  text-underline-offset: 0.18em;
}

html.a11y-underlined-links .btn,
html.a11y-underlined-links .nav__logo-link,
html.a11y-underlined-links .skip-link {
  text-decoration: none;
}

html.a11y-readable-font body,
html.a11y-readable-font .hero__text,
html.a11y-readable-font .hero__actions .btn,
html.a11y-readable-font .language-selector__button,
html.a11y-readable-font .language-selector__option,
html.a11y-readable-font .a11y-panel {
  font-family: "Segoe UI", Arial, sans-serif !important;
}

html.a11y-readable-font p,
html.a11y-readable-font li,
html.a11y-readable-font .feature-card__text,
html.a11y-readable-font .section__subtitle,
html.a11y-readable-font .a11y-panel__description,
html.a11y-readable-font .a11y-option__description {
  line-height: 1.8;
}

html.a11y-high-contrast body {
  background: #ffffff;
  color: #020617;
}

html.a11y-high-contrast .site-header,
html.a11y-high-contrast .feature-card,
html.a11y-high-contrast .contact-cta,
html.a11y-high-contrast .language-selector__button,
html.a11y-high-contrast .language-selector__dropdown,
html.a11y-high-contrast .a11y-panel,
html.a11y-high-contrast .a11y-option {
  background: #ffffff;
  border-color: rgba(15, 23, 42, 0.18);
  box-shadow: 0 18px 40px rgba(2, 6, 23, 0.14);
}

html.a11y-high-contrast .section--alt {
  background: #dbe7ff;
}

html.a11y-high-contrast .hero__overlay {
  background:
    linear-gradient(90deg, rgba(2, 6, 23, 0.96) 0%, rgba(2, 6, 23, 0.84) 38%, rgba(2, 6, 23, 0.34) 72%, rgba(2, 6, 23, 0.08) 100%),
    linear-gradient(180deg, rgba(2, 6, 23, 0.16) 0%, rgba(2, 6, 23, 0.4) 100%);
}

html.a11y-high-contrast .section__subtitle,
html.a11y-high-contrast .feature-card__text,
html.a11y-high-contrast .about__text,
html.a11y-high-contrast .contact-cta__text,
html.a11y-high-contrast .site-footer__tagline,
html.a11y-high-contrast .a11y-option__description,
html.a11y-high-contrast .a11y-panel__description,
html.a11y-high-contrast .a11y-support__item {
  color: #1e293b;
}

html.a11y-high-contrast .btn--ghost {
  background: #ffffff;
  color: #020617;
  border-color: #020617;
}

html.a11y-high-contrast :focus-visible {
  outline-width: 3px;
}

html.a11y-reduced-motion {
  scroll-behavior: auto;
}

html.a11y-reduced-motion .a11y-fab__pulse {
  animation: none;
  opacity: 0.32;
}

html.a11y-reduced-motion .js-reveal {
  opacity: 1;
  transform: none;
}

html.a11y-reduced-motion *,
html.a11y-reduced-motion *::before,
html.a11y-reduced-motion *::after {
  animation: none !important;
  transition: none !important;
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  .a11y-fab__pulse {
    animation: none;
  }
}

@media (max-width: 768px) {
  body.a11y-panel-open {
    overflow: hidden;
  }

  .a11y-fab {
    width: 4.35rem;
    height: 4.35rem;
  }

  .a11y-fab__icon-wrap {
    width: 2.95rem;
    height: 2.95rem;
  }

  .a11y-panel {
    inset-inline: 0.75rem;
    inset-block-end: 0.85rem;
    width: auto;
    max-height: min(82vh, 40rem);
    border-radius: 1.3rem;
  }
}

@media (max-width: 520px) {
  .a11y-panel {
    padding: 1rem;
  }

  .a11y-panel__status-row {
    flex-direction: column;
    align-items: stretch;
  }

  .a11y-panel__reset {
    width: 100%;
  }

  .a11y-option {
    padding: 0.95rem;
  }
}

@keyframes a11y-pulse {
  0% {
    transform: scale(0.88);
    opacity: 0.72;
  }

  70% {
    transform: scale(1.06);
    opacity: 0;
  }

  100% {
    transform: scale(1.08);
    opacity: 0;
  }
}
