/* A shared, quiet backdrop. Content and product artwork keep their own surfaces. */
body.site-wallpaper {
  --site-wallpaper-image: url('/assets/backgrounds/mir-world-wallpaper-20261010.webp');
  --site-wallpaper-opacity: .14;
  --site-wallpaper-base: #f4f7fb;
  --site-wallpaper-sidebar: rgba(244, 247, 251, .97);
  isolation: isolate;
}

html[data-theme="dark"] body.site-wallpaper {
  --site-wallpaper-opacity: .12;
  --site-wallpaper-base: #101c2e;
  --site-wallpaper-sidebar: rgba(16, 28, 46, .97);
}

html[data-theme="dark"] body.site-wallpaper.home-page {
  --site-wallpaper-base: #161b1e;
}

html[data-theme] body.site-wallpaper {
  background: var(--site-wallpaper-base);
}

body.site-wallpaper::before {
  position: fixed;
  z-index: 0;
  inset: 0;
  content: '';
  pointer-events: none;
  background-image: var(--site-wallpaper-image);
  background-position: center center;
  background-size: cover;
  background-repeat: no-repeat;
  opacity: var(--site-wallpaper-opacity);
}

/* Explicit roots keep fixed navigation, dialogs and image previews intact. */
body.site-wallpaper > :is(#app, #anticheat-app, #download-app, #account-app, #center-app, .legal-shell) {
  position: relative;
  z-index: 1;
}

/* Only page backgrounds are opened up; cards, controls and manual pages stay readable. */
html[data-theme] body.site-wallpaper :is(
  .portal-page, .case-page, .release-detail-page, .download-page, .ac-page,
  .account-page, .account-main, .center-page, .center-main,
  .manual-app, .manual-sidebar,
  .protection-showcase, .portal-process, .security-deploy, .protection-flow,
  .case-gallery, .protection-submit-section,
  .portal-cta, .portal-footer, .download-footer
) {
  background: transparent;
}

/* One continuous image through all homepage sections below the existing hero. */
html[data-theme] body.site-wallpaper.home-page :is(
  .notice, .home-news-section, .home-banner-section,
  .ai-band, .security-band, .advantage-section, .cooperation-section,
  .home-protection-section, .protection, .tutorials, .contact, .footer
) {
  background: transparent;
}

@media (max-width: 700px) {
  body.site-wallpaper {
    --site-wallpaper-image: url('/assets/backgrounds/mir-world-wallpaper-mobile-20261010.webp');
    --site-wallpaper-opacity: .12;
  }

  html[data-theme="dark"] body.site-wallpaper {
    --site-wallpaper-opacity: .1;
  }
}

/* The mobile manual directory overlays the article, so it needs a solid reading surface. */
@media (max-width: 760px) {
  html[data-theme] body.site-wallpaper .manual-sidebar {
    background: var(--site-wallpaper-sidebar);
  }
}

/* Fullscreen image viewers must cover appearance controls outside the app root. */
body.site-wallpaper:has(.case-lightbox, .cooperation-lightbox, .cooperation-dialog[open]) > .site-theme-switcher {
  display: none;
}

@media print {
  body.site-wallpaper::before { display: none; }
  html[data-theme] body.site-wallpaper { background: #fff; }
}
