/* Warm forest lights, with no geometric constellation overlay. */
.atmosphere {
  position: fixed;
  inset: 0 0 0 var(--sidebar);
  z-index: 2;
  overflow: hidden;
  pointer-events: none;
  user-select: none;
  opacity: .72;
  visibility: visible;
  contain: strict;
  transition: opacity .55s ease, visibility 0s;
  --firefly-mint: 201 225 171;
  --firefly-amber: 240 215 150;
}
.firefly-field {
  position: absolute;
  inset: -30px;
  transform: translate3d(var(--glow-x, 0px), var(--glow-y, 0px), 0);
  transition: transform 1.4s ease-out;
}
.firefly {
  position: absolute;
  left: var(--x);
  top: var(--y);
  width: var(--size);
  height: var(--size);
  --light: var(--firefly-mint);
  animation: firefly-drift var(--drift) ease-in-out var(--drift-delay) infinite alternate;
}
.firefly--amber { --light: var(--firefly-amber); }
.firefly-light {
  display: block;
  width: 100%;
  height: 100%;
  border-radius: 50%;
  background: radial-gradient(circle,
    rgb(var(--firefly-core, var(--light)) / .95) 0%,
    rgb(var(--firefly-core, var(--light)) / .8) 3%,
    rgb(var(--light) / .34) 10%,
    rgb(var(--light) / .12) 26%,
    rgb(var(--light) / .04) 43%,
    transparent 68%);
  animation: firefly-pulse var(--pulse) ease-in-out var(--pulse-delay) infinite;
}
@keyframes firefly-drift {
  0% { transform: translate3d(0, 0, 0); }
  36% { transform: translate3d(var(--dx), calc(var(--dy) * .35), 0); }
  72% { transform: translate3d(calc(var(--dx) * -.35), var(--dy), 0); }
  100% { transform: translate3d(calc(var(--dx) * .55), calc(var(--dy) * -.2), 0); }
}
@keyframes firefly-pulse {
  0%, 100% { opacity: .12; transform: scale(.85); }
  28% { opacity: .35; }
  54% { opacity: .9; transform: scale(1.08); }
  78% { opacity: .25; }
}
[data-background=off] .atmosphere {
  opacity: 0;
  visibility: hidden;
  transition: opacity .45s ease, visibility 0s .45s;
}
[data-background=off] .firefly,
[data-background=off] .firefly-light,
[data-effects-motion=paused] .firefly,
[data-effects-motion=paused] .firefly-light { animation-play-state: paused; }
[data-effects-motion=static] .firefly,
[data-effects-motion=static] .firefly-light { animation: none; }
[data-effects-motion=static] .firefly-light { opacity: .28; }
[data-theme=light] .atmosphere {
  opacity: .58;
  --firefly-core: 255 253 227;
  --firefly-mint: 224 212 154;
  --firefly-amber: 236 206 132;
}
[data-theme=light][data-background=off] .atmosphere { opacity: 0; }
body[data-story] .atmosphere { filter: opacity(.72); }
.background-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  min-height: 38px;
  padding: 7px 12px;
  border: 1px solid var(--line);
  border-radius: 4px;
  color: var(--accent);
  font-size: 11px;
  white-space: nowrap;
}
.background-toggle .icon { width: 18px; height: 18px; }
.background-toggle:hover { background: var(--soft); border-color: var(--accent); }
[data-background-toggle][aria-pressed=false] { color: var(--muted); }
.background-menu-toggle { display: none; }
.no-js .background-toggle,
.no-js .background-menu-toggle,
.no-js .background-setting,
.no-js .atmosphere { display: none; }
@media (max-width: 1100px) {
  .topbar-title { min-width: 0; overflow: hidden; text-overflow: ellipsis; }
  .topbar-tools { flex-shrink: 0; gap: 8px; }
  .background-toggle { width: 38px; height: 38px; min-height: 38px; padding: 0; flex-shrink: 0; }
  .background-toggle [data-background-label] { display: none; }
}
@media (max-width: 800px) {
  .atmosphere { inset-inline-start: 0; opacity: .62; }
  .topbar-title { min-width: 0; overflow: hidden; text-overflow: ellipsis; }
  .background-toggle { width: 38px; height: 38px; min-height: 38px; padding: 0; flex-shrink: 0; }
  .background-toggle [data-background-label] { display: none; }
  .background-menu-toggle { display: flex; width: 100%; text-align: left; }
  .global-search:focus-within { right: 88px; }
  .topbar-tools { gap: 6px; }
}
@media (prefers-reduced-motion: reduce) {
  .firefly, .firefly-light { animation: none; }
  .firefly-light { opacity: .28; }
  .firefly-field { transform: none; transition: none; }
  .atmosphere { transition: none; }
}
