.atitude-a11y-launch,
.atitude-a11y-playback button,
.atitude-a11y-dialog {
  --a11y-bg: #fff;
  --a11y-fg: #17171b;
  --a11y-line: #71717a;
  --a11y-accent: #a71928;
  color: var(--a11y-fg);
  background: var(--a11y-bg);
  border: 1px solid var(--a11y-line);
  font: 1rem/1.5 system-ui, sans-serif;
  box-sizing: border-box;
}

html[data-theme="dark"] :is(.atitude-a11y-launch, .atitude-a11y-playback button, .atitude-a11y-dialog),
html[data-a11y-contraste] :is(.atitude-a11y-launch, .atitude-a11y-playback button, .atitude-a11y-dialog) {
  --a11y-bg: #17171b;
  --a11y-fg: #fff;
  --a11y-line: #aaaab4;
  --a11y-accent: #ffb2ba;
}

html[data-a11y-contraste] :is(.atitude-a11y-launch, .atitude-a11y-playback button, .atitude-a11y-dialog) {
  --a11y-bg: #000;
  --a11y-accent: #ffe164;
}

.atitude-a11y-tools {
  position: fixed;
  z-index: 25;
  inset-inline-start: 1rem;
  inset-block-end: calc(1rem + env(safe-area-inset-bottom));
  max-width: calc(100% - 2rem);
}

.atitude-a11y-tools,
.atitude-a11y-playback:not([hidden]) {
  display: flex;
  flex-wrap: wrap;
  gap: .4rem;
}

.atitude-a11y-launch,
.atitude-a11y-playback button {
  display: inline-flex;
  align-items: center;
  gap: .45rem;
  min-height: 44px;
  padding: .45rem .75rem;
  border-radius: .5rem;
  box-shadow: 0 3px 15px #0004;
  font-weight: 700;
  cursor: pointer;
}

@media (max-width: 650px) {
  body:has(.mobile-bottom-cta) .atitude-a11y-tools {
    inset-block-end: calc(4.5rem + env(safe-area-inset-bottom));
  }
}

.atitude-a11y-launch svg {
  width: 1.25em;
  height: 1.25em;
  flex: none;
}

.atitude-a11y-dialog {
  width: min(28rem, calc(100% - 1.5rem));
  max-height: calc(100% - 1.5rem);
  margin: auto;
  padding: clamp(.875rem, 4vw, 1.5rem);
  border-radius: .75rem;
  overflow: auto;
  overscroll-behavior: contain;
}

.atitude-a11y-dialog::backdrop { background: #000a; }

.atitude-a11y-dialog h2 {
  margin: 0 0 .65rem;
  font: 750 1.35rem/1.2 system-ui, sans-serif;
}

.atitude-a11y-dialog fieldset { border: 0; margin: .75rem 0; padding: 0; }
.atitude-a11y-dialog legend { font-weight: 700; padding: 0; }

.atitude-a11y-dialog label {
  display: flex;
  align-items: center;
  gap: .65rem;
  min-height: 44px;
  border-bottom: 1px solid var(--a11y-line);
  cursor: pointer;
}

.atitude-a11y-dialog input {
  flex: none;
  width: 1.15em;
  height: 1.15em;
  margin: 0;
  accent-color: var(--a11y-accent);
}

.atitude-a11y-dialog button {
  min-height: 44px;
  padding: .4rem .7rem;
  color: inherit;
  background: transparent;
  border: 1px solid var(--a11y-line);
  border-radius: .35rem;
  font: inherit;
  font-weight: 650;
  cursor: pointer;
}

.atitude-a11y-dialog button:disabled { cursor: default; }
.atitude-a11y-dialog p { margin: .5rem 0; }
.atitude-a11y-actions { display: flex; flex-wrap: wrap; gap: .5rem; margin-top: 1rem; }

body :is(a, button, input, select, textarea, [tabindex]):focus-visible {
  outline: 3px solid #fff;
  outline-offset: 2px;
  box-shadow: 0 0 0 2px #151518, 0 0 0 6px #151518;
}

.atitude-a11y-skip {
  position: fixed;
  inset: .5rem auto auto .5rem;
  z-index: 1000;
  padding: .65rem;
  background: #fff;
  color: #17171b;
}

.atitude-a11y-skip:not(:focus) { translate: 0 calc(-100% - 1rem); }

html[data-a11y-texto] main :is(p, li, label, input, select, textarea, .form-feedback) {
  font-size: 1.25rem !important;
  overflow-wrap: anywhere;
}

html[data-a11y-texto] main p.case-hero__lead {
  font-size: clamp(1.25rem, 2.4vw, 1.7rem) !important;
}

html[data-a11y-espacamento] main :is(p, li, label, input, select, textarea) {
  line-height: 1.8 !important;
  letter-spacing: .035em !important;
  word-spacing: .09em !important;
}

html[data-a11y-links] body > :is(header, main, footer) a {
  text-decoration: underline !important;
  text-underline-offset: .18em;
}

/* Mantém contraste de leitura também nos temas padrão do site. */
html[data-theme] :is(.eyebrow-dark, .case-summary-section) .section-index,
html[data-theme] .step > span,
html[data-theme="light"] .contact-intro .section-index {
  color: #a71928;
}

html[data-theme] .work .section-index,
html[data-theme="dark"] .contact-intro .section-index {
  color: #ff858f;
}

html[data-theme] :is(.service-number, .service-tag, .form-title span, .form-title strong,
  .form-field .optional, .form-notice, .case-fact small, .policy-page .updated, .policy-page footer),
html[data-theme="light"] .case-video-copy .case-note,
html[data-theme="light"] .contact-quick span {
  color: #5e6067;
}

html[data-theme] :is(.button-red, .submit-button, .mobile-bottom-cta, .case-next-section) {
  background-color: #bf1829;
}

html[data-theme] :is(.button-red, .submit-button, .mobile-bottom-cta):hover {
  background-color: #a71928;
}

html[data-theme] .manifesto { background-color: #cc1e2c; }
html[data-theme] .manifesto .eyebrow { color: #fff; }

.policy-page main a { overflow-wrap: anywhere; }

html[data-a11y-contraste] body {
  color: #fff;
  background: #000;
}

html[data-a11y-contraste] body > :is(header, main, footer, dialog:not(.atitude-a11y-dialog)),
html[data-a11y-contraste] body > :is(header, main, footer, dialog:not(.atitude-a11y-dialog))
  :where(section, article, nav, footer, p, h1, h2, h3, .project-info, .portfolio-feature__content, .archive-tile > div,
    .step, .form-panel, .form-title, .case-fact, .contact, .footer-top, .footer-bottom) {
  color: #fff !important;
  background: #000 !important;
}

html[data-a11y-contraste] body > :is(header, main, footer, dialog:not(.atitude-a11y-dialog))
  :where(span, strong, small, em, b, legend, label, li, figcaption) {
  color: inherit !important;
}

html[data-a11y-contraste] body > :is(header, main, footer, dialog:not(.atitude-a11y-dialog))
  :is(a, button:not(.case-photo), input, select, textarea) {
  color: #ffe164 !important;
  background: #000 !important;
  border-color: currentColor !important;
}

html[data-a11y-contraste] body > :is(header, main, footer) a {
  text-decoration: underline !important;
  text-underline-offset: .18em;
}

html[data-a11y-contraste] :is(input, textarea)::placeholder { color: #fff; opacity: 1; }
html[data-a11y-contraste] :is(button, input, select, textarea) { accent-color: #ffe164; }
html[data-a11y-contraste] :is(.hero-image, .hero-shade, .case-hero__tint) { display: none; }
html[data-a11y-contraste] .case-hero__visual { opacity: .25; }
html[data-a11y-contraste] .mobile-bottom-cta {
  color: #ffe164 !important;
  background: #000 !important;
  border-top: 1px solid currentColor;
  text-decoration: underline;
}

html[data-a11y-movimento] { scroll-behavior: auto !important; }

html[data-a11y-movimento] body > :is(header, main, footer, dialog) *,
html[data-a11y-movimento] body > :is(header, main, footer, dialog) *::before,
html[data-a11y-movimento] body > :is(header, main, footer, dialog) *::after {
  animation: none !important;
  transition: none !important;
}

@media (max-width: 650px) {
  .case-summary-grid, .case-video-layout { grid-template-columns: minmax(0, 1fr); }
  .case-video-copy h2 { font-size: clamp(2.35rem, 12vw, 3.5rem); }
  .case-next-layout h2 { font-size: clamp(2rem, 11.5vw, 3rem); }

  .case-video-copy h2, .case-next-layout h2 { overflow-wrap: anywhere; }
}

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

@media (forced-colors: active) {
  body :is(a, button, input, select, textarea, [tabindex]):focus-visible {
    outline-color: Highlight;
  }
}

[vw][hidden] { display: none !important; }
