/* R27 perceptibility correction. Issues20–22: reuse the existing sigil, 18-mote field and two light planes.
   The old body-negative layer was obscured by the opaque content lane, while
   its edge-biased particles mostly lived beneath the sidebar/offscreen.
   Make the workspace their local stacking context; text and controls stay above. */
@layer ar-color-preferences {
 @media screen and (forced-colors:none) and (prefers-contrast:no-preference) {
  html[data-ar-theme="standard"] body:not(.ar-simple):not(.ar-cyber):not([data-reading-contrast="high"]) #workspace {isolation:isolate!important;}
  /* Full-width decoration is still below the actual navigation/sidebar surfaces.
     These stacking contexts prevent the backdrop bleeding across the black header. */
  html[data-ar-theme="standard"] body:not(.ar-simple):not(.ar-cyber) #ar-site-header {position:relative;isolation:isolate!important;z-index:1!important;}
  html[data-ar-theme="standard"] body:not(.ar-simple):not(.ar-cyber) #sidebar {isolation:isolate!important;z-index:1!important;}
  html[data-ar-theme="standard"]:not([data-reading-contrast="high"]) body:not(.ar-simple):not(.ar-cyber):not([data-reading-contrast="high"]) #ar-embed-scroll > .app-shell > main#workspace > .workspace-panel {
   background:#070707!important;
   /* Section backing includes its padding, gaps and footer copy. Decoration is
      below this fully opaque surface, and remains visible in real outer gutters. */
  }
  html[data-ar-theme="standard"] body:not(.ar-simple):not(.ar-cyber) #workspace > #ar-explorer-ambient[data-ar-dust-base-r15="natural"] {
   position:fixed!important;inset:auto!important;
   left:var(--ar-content-left-r26,0px)!important;top:var(--ar-content-top-r26,0px)!important;
   width:var(--ar-content-width-r26,0px)!important;height:var(--ar-content-height-r26,0px)!important;
   z-index:-2!important;pointer-events:none!important;overflow:hidden!important;isolation:isolate;
   opacity:1!important;background:none!important;filter:none!important;
  }
  html[data-ar-theme="standard"] body[data-ar-atmosphere-r25="true"] #workspace > #ar-explorer-ambient[data-ar-dust-base-r15="natural"][data-ar-dust-running-r15="true"] {display:block!important;}
  html[data-ar-theme="standard"] body[data-ar-atmosphere-r25="true"] #workspace > #ar-explorer-ambient[data-ar-dust-base-r15="natural"] > .ar-dust-mote-r15 {
   left:var(--ar-dust-content-x-r26,var(--dust-x))!important;top:var(--ar-dust-content-y-r27,var(--dust-y))!important;
   width:calc(var(--dust-size) + 2.4px)!important;height:calc(var(--dust-size) + 2.4px)!important;
   background:radial-gradient(circle,color-mix(in srgb,var(--ar-colors-accent,#d0ad70),#fff7d6 34%) 0 38%,var(--ar-colors-accent,#d0ad70) 52%,transparent 78%)!important;
   box-shadow:0 0 7px 1px color-mix(in srgb,var(--ar-colors-accent,#d0ad70),transparent 64%)!important;filter:none!important;
   animation:ar-content-dust-r29 var(--ar-dust-time-r27,31s) linear var(--ar-dust-delay-r29,var(--dust-delay)) infinite!important;
  }
  html[data-ar-theme="standard"] body[data-ar-atmosphere-r25="true"] #workspace > #ar-explorer-ambient[data-ar-dust-running-r15="true"]::before,
  html[data-ar-theme="standard"] body[data-ar-atmosphere-r25="true"] #workspace > #ar-explorer-ambient[data-ar-dust-running-r15="true"]::after {
   content:""!important;display:block!important;position:absolute;pointer-events:none;
   /* R28: an oversized, edge-free paint plane. Only its two light pseudos
      change; motes, opaque shelves and the direct Home AR remain untouched.
      Explicit ellipse radii fade completely before any visible box boundary. */
   width:140%!important;height:100%!important;border:0;border-radius:0;filter:none!important;mix-blend-mode:normal;
   background:radial-gradient(ellipse 40% 42% at 32% 56%,color-mix(in srgb,var(--ar-colors-accent,#d0ad70),transparent 86%) 0%,color-mix(in srgb,var(--ar-colors-accent,#d0ad70),transparent 89%) 18%,color-mix(in srgb,var(--ar-colors-accent,#d0ad70),transparent 93%) 38%,color-mix(in srgb,var(--ar-colors-accent,#d0ad70),transparent 97%) 62%,color-mix(in srgb,var(--ar-colors-accent,#d0ad70),transparent 99.4%) 82%,transparent 100%)!important;
   opacity:.35;animation:ar-content-light-r28 47s ease-in-out -13s infinite alternate!important;
  }
  html[data-ar-theme="standard"] body #workspace > #ar-explorer-ambient::before {left:-20%!important;top:12vh!important;right:auto!important;bottom:auto!important;}
  html[data-ar-theme="standard"] body[data-ar-atmosphere-r25="true"] #workspace > #ar-explorer-ambient[data-ar-dust-running-r15="true"]::after {
   left:-20%!important;top:18vh!important;right:auto!important;bottom:auto!important;
   background:radial-gradient(ellipse 40% 42% at 68% 56%,color-mix(in srgb,var(--ar-colors-accent,#d0ad70),transparent 88%) 0%,color-mix(in srgb,var(--ar-colors-accent,#d0ad70),transparent 91%) 18%,color-mix(in srgb,var(--ar-colors-accent,#d0ad70),transparent 94%) 38%,color-mix(in srgb,var(--ar-colors-accent,#d0ad70),transparent 97.5%) 62%,color-mix(in srgb,var(--ar-colors-accent,#d0ad70),transparent 99.5%) 82%,transparent 100%)!important;
   animation-duration:61s!important;animation-delay:-31s!important;animation-direction:alternate-reverse!important;
  }
 }
 /* State owner covers reduced motion, visibility, save-data,
    low-memory, focus, dialogs, full-screen modes and the user's effects switch. */
 html body[data-ar-atmosphere-r25="false"] #workspace > #ar-explorer-ambient {display:none!important;}
 html body[data-ar-atmosphere-r25="false"] #workspace > #ar-explorer-ambient *,
 html body[data-ar-atmosphere-r25="false"] #workspace > #ar-explorer-ambient::before,
 html body[data-ar-atmosphere-r25="false"] #workspace > #ar-explorer-ambient::after {animation:none!important;}
}
@media screen and (forced-colors:none) and (prefers-contrast:no-preference) {
 html[data-ar-theme="standard"]:not([data-reading-contrast="high"]) body:not(.ar-simple):not(.ar-cyber):not(.focus-mode):not([data-reading-sprites="off"]):not([data-reading-contrast="high"]) #workspace > #ar-explorer-engraved-sigil[data-ar-sigil-fit-r25="true"] {
  display:block!important;position:fixed!important;left:var(--ar-sigil-center-x-r25)!important;top:var(--ar-sigil-center-y-r25)!important;
  width:var(--ar-sigil-size-r25)!important;max-width:calc(100vw - 32px)!important;
  transform:translate(-50%,-50%)!important;z-index:-1!important;opacity:.075!important;mix-blend-mode:normal!important;
  pointer-events:none!important;visibility:visible!important;
 }
 html[data-ar-theme="standard"] body #workspace > #ar-explorer-engraved-sigil svg {display:none!important;filter:none!important;mask:none!important;-webkit-mask:none!important;}
 /* The exact 900px Home bitmap uses one direct image paint, with no 2048-unit
    SVG wrapper, mask, tint or blur. It is above the light wash and below panels. */
 html[data-ar-theme="standard"] body #workspace > #ar-explorer-engraved-sigil > img.ar-home-gold-sigil {display:block!important;width:100%!important;height:100%!important;object-fit:contain;image-rendering:auto;filter:none!important;mask:none!important;-webkit-mask:none!important;}
 /* Preserve the exact Home bitmap's internal metal detail; Default alone stops
    the old flat passing-light silhouette. Cyber retains its original art. */
 html[data-ar-theme="standard"] body #workspace > #ar-explorer-engraved-sigil .ar-home-gold-sigil {filter:none!important;}
 html[data-ar-theme="standard"] body #workspace > #ar-explorer-engraved-sigil .ar-sigil-light-r24 {display:none!important;}
}
/* Each mote owns its own curved drift, speed and initial phase. The ends are
   invisible, so the bounded repeating paths never jump visibly at their seams. */
@keyframes ar-content-dust-r29 {
 0% {transform:translate3d(0,0,0);opacity:0;animation-timing-function:ease-in-out}
 16% {opacity:0.756}
 36% {transform:translate3d(var(--ar-dust-x1-r29),var(--ar-dust-y1-r29),0);animation-timing-function:ease-in-out}
 48% {opacity:.9}
 72% {transform:translate3d(var(--ar-dust-x2-r29),var(--ar-dust-y2-r29),0);animation-timing-function:ease-in-out}
 82% {opacity:0.793}
 100% {transform:translate3d(var(--ar-dust-dx-r27),var(--ar-dust-dy-r27),0);opacity:0}
}
/* Light begins well below the top runner, with a long transparent falloff.
   Small, slow drift avoids a sweeping bright wash or a travelling box edge. */
@keyframes ar-content-light-r28 {
 from {transform:translate3d(-2%,0,0);opacity:.28}
 to {transform:translate3d(2%,3%,0);opacity:.42}
}
@media(max-width:900px){
 @layer ar-color-preferences {html body #workspace > #ar-explorer-ambient > .ar-dust-mote-r15:nth-child(n+11){display:none!important;}}
}
@media(prefers-reduced-motion:reduce),(prefers-contrast:more),(forced-colors:active),print {
 @layer ar-color-preferences {
  html body #workspace > #ar-explorer-ambient {display:none!important;}
  html body #workspace > #ar-explorer-ambient *,html body #workspace > #ar-explorer-ambient::before,html body #workspace > #ar-explorer-ambient::after {animation:none!important;}
 }
}
/* All Default scrollbar surfaces use the same accessible accent and dark track,
   including the root scrollbar whose custom properties cannot inherit from body.
   No widths, overflow, scrolling, thumb hit targets or pointer behavior change. */
@layer ar-color-preferences {
 @media screen and (forced-colors:none) {
  html[data-ar-theme="standard"]:not([data-ar-explorer-startup="pending"]),
  html[data-ar-theme="standard"]:not([data-ar-explorer-startup="pending"]) * {
   scrollbar-color:var(--ar-scroll-thumb-r26,#b99a69) var(--ar-scroll-track-r26,#0b0907)!important;
  }
  html[data-ar-theme="standard"]:not([data-ar-explorer-startup="pending"])::-webkit-scrollbar-track,
  html[data-ar-theme="standard"]:not([data-ar-explorer-startup="pending"]) *::-webkit-scrollbar-track {background:var(--ar-scroll-track-r26,#0b0907)!important;}
  html[data-ar-theme="standard"]:not([data-ar-explorer-startup="pending"])::-webkit-scrollbar-thumb,
  html[data-ar-theme="standard"]:not([data-ar-explorer-startup="pending"]) *::-webkit-scrollbar-thumb {background:var(--ar-scroll-thumb-r26,#b99a69)!important;border-color:var(--ar-scroll-track-r26,#0b0907)!important;}
 }
 @media(forced-colors:active),(prefers-contrast:more) {
  html[data-ar-theme="standard"],html[data-ar-theme="standard"] * {scrollbar-color:auto!important;}
 }
 html[data-ar-theme="standard"][data-reading-contrast="high"],html[data-ar-theme="standard"][data-reading-contrast="high"] *,
 html[data-ar-theme="standard"] body[data-reading-contrast="high"],html[data-ar-theme="standard"] body[data-reading-contrast="high"] * {scrollbar-color:CanvasText Canvas!important;}
}

@layer ar-color-preferences {
 html[data-ar-theme="standard"] body:not(.ar-simple):not(.ar-cyber) #workspace > #ar-explorer-engraved-sigil svg,
 html[data-ar-theme="standard"] body:not(.ar-simple):not(.ar-cyber) #workspace > #ar-explorer-engraved-sigil .ar-home-gold-sigil {filter:none!important;}
}

/* Transparency preference changes the visual treatment, never motion permission.
   Reading surfaces remain opaque. Crisp solid mote cores remain animated unless
   the separate reduced-motion/effects/contrast gate disables the atmosphere. */
@media(prefers-reduced-transparency:reduce) {
 @layer ar-color-preferences {
  html[data-ar-theme="standard"] body[data-ar-atmosphere-r25="true"] #workspace > #ar-explorer-ambient > .ar-dust-mote-r15 {
   background:var(--ar-colors-accent,#d0ad70)!important;box-shadow:none!important;
  }
 }
}
