/* REMNA ambient archive. Decorations stay behind content; no animated filters. */
body[data-atmosphere] {
  --room-top: #77c6e9;
  --room-middle: #72c0e4;
  --room-bottom: #68b2d6;
  --room-shade: rgba(34, 88, 127, .09);
  --haze-opacity: .5;
  --dust-opacity: .25;
  --screen-opacity: .55;
  --drift-time: 100s;
}
body[data-atmosphere]::before {
  background:
    radial-gradient(ellipse at 14% 20%, rgba(202, 229, 239, .10), transparent 62%),
    radial-gradient(ellipse at 88% 76%, var(--room-shade), transparent 67%),
    linear-gradient(158deg, var(--room-top), var(--room-middle) 47%, var(--room-bottom));
}
.remna-ambient {
  position: fixed;
  inset: 0;
  z-index: -9999;
  overflow: hidden;
  pointer-events: none;
  user-select: none;
  contain: strict;
}
.room-haze {
  position: absolute;
  inset: -8%;
  opacity: var(--haze-opacity);
  background:
    radial-gradient(ellipse at 19% 37%, rgba(225, 240, 248, .20), transparent 58%),
    radial-gradient(ellipse at 79% 68%, rgba(32, 101, 141, .09), transparent 58%);
  animation: room-haze-drift 118s ease-in-out -31s infinite alternate;
}
.room-haze-echo {
  background: radial-gradient(ellipse at 80% 20%, rgba(219, 240, 246, .14), transparent 61%);
  opacity: calc(var(--haze-opacity) * .65);
  animation-duration: 157s;
  animation-delay: -88s;
  animation-direction: alternate-reverse;
}
.room-specks {
  position: absolute;
  inset: 0;
  opacity: var(--dust-opacity);
  animation: room-speck-drift var(--drift-time) ease-in-out -23s infinite alternate;
}
.room-specks i {
  position: absolute;
  width: 2px;
  height: 2px;
  border-radius: 50%;
  background: #e2f2f4;
}
.room-specks i:nth-child(3n) { width: 1px; height: 1px; background: #164d6b; }
.room-specks i:nth-child(4n) { border-radius: 0; }
.room-specks i:nth-child(1) { left: 5%; top: 16%; }
.room-specks i:nth-child(2) { left: 18%; top: 69%; }
.room-specks i:nth-child(3) { left: 30%; top: 42%; }
.room-specks i:nth-child(4) { left: 41%; top: 10%; }
.room-specks i:nth-child(5) { left: 56%; top: 80%; }
.room-specks i:nth-child(6) { left: 68%; top: 31%; }
.room-specks i:nth-child(7) { left: 81%; top: 62%; }
.room-specks i:nth-child(8) { left: 94%; top: 22%; }
.room-specks i:nth-child(9) { left: 9%; top: 90%; }
.room-specks i:nth-child(10) { left: 91%; top: 87%; }
.room-specks i:nth-child(11) { left: 52%; top: 52%; }
.room-specks i:nth-child(12) { left: 73%; top: 92%; }
.remna-ambient::after {
  content: "";
  position: absolute;
  inset: 0;
  background: repeating-linear-gradient(0deg, rgba(14, 51, 77, .034) 0 1px, transparent 1px 4px);
  opacity: var(--screen-opacity);
}
@keyframes room-haze-drift {
  from { transform: translate3d(-1.5%, -.5%, 0) scale(1); }
  to { transform: translate3d(2%, 1.4%, 0) scale(1.025); }
}
@keyframes room-speck-drift {
  from { transform: translate3d(0, 9px, 0); }
  to { transform: translate3d(9px, -15px, 0); }
}
@keyframes room-signal-breathe {
  0%, 100% { opacity: .14; }
  50% { opacity: .26; }
}
/* Home has the full, restrained stack. Inner rooms vary only in atmosphere. */
body[data-atmosphere="home"] { --haze-opacity: .64; --dust-opacity: .3; }
body[data-atmosphere="memory"] {
  --room-top: #79c3e3;
  --room-middle: #76bfdf;
  --room-bottom: #6eb3d1;
  --haze-opacity: .66;
  --dust-opacity: .17;
  --drift-time: 135s;
}
body[data-atmosphere="memory"] .room-haze { animation-duration: 150s; }
body[data-atmosphere="memory"] .room-specks i:nth-child(n+9) { display: none; }
body[data-atmosphere="signal"] {
  --room-top: #73c1e5;
  --room-middle: #6cb9df;
  --room-bottom: #65accf;
  --room-shade: rgba(23, 64, 111, .14);
  --haze-opacity: .34;
  --screen-opacity: .65;
}
body[data-atmosphere="signal"] .room-specks {
  animation: room-speck-drift 115s ease-in-out -23s infinite alternate,
    room-signal-breathe 54s ease-in-out -18s infinite;
}
body[data-atmosphere="signal"] .room-specks i { border-radius: 0; }
body[data-atmosphere="quiet"] {
  --room-top: #77bddc;
  --room-middle: #71b5d5;
  --room-bottom: #69a8c8;
  --haze-opacity: .3;
  --dust-opacity: .14;
  --screen-opacity: .72;
  --drift-time: 160s;
}
body[data-atmosphere="quiet"] .room-haze { animation-duration: 180s; }
body[data-atmosphere="quiet"] .room-haze-echo,
body[data-atmosphere="quiet"] .room-specks i:nth-child(n+5) { display: none; }
.remna-ambient[data-paused] .room-haze,
.remna-ambient[data-paused] .room-specks { animation-play-state: paused; }
/* Small links outside the opaque reading panels use the existing dark blue. */
body[data-atmosphere] .archive-nav a,
body[data-atmosphere] .remna-footer-copy { color: #00243b; text-shadow: none; }
@media (max-width: 700px) {
  .room-haze-echo { display: none; }
  .room-specks i:nth-child(n+7) { display: none; }
  .room-haze { inset: -4%; }
  .remna-ambient::after { opacity: .35; }
}
@media (prefers-reduced-motion: reduce) {
  .remna-ambient .room-haze, .remna-ambient .room-specks {
    animation: none !important;
    transform: none !important;
  }
  .room-haze-echo { display: none; }
}
@media (forced-colors: active), print {
  .remna-ambient { display: none; }
  body[data-atmosphere]::before { background: none; }
}
