/**
 * Menu Idle Show — the rooms of the case, behind the paper.
 * ------------------------------------------------------------
 * Lives under the menu file and only wakes when the player has gone
 * quiet. What it shows are the game's own scene fields — the same
 * lit rooms the papers are read against — crossfading two layers at
 * a time. A light scrim keeps the paper sitting on something quiet.
 *
 * House rules: opacity + transform only in keyframes; the fields are
 * never transitioned (a multi-gradient stack cannot interpolate).
 */

.menu-idle {
  position: absolute;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
  z-index: 0;              /* under .menu-container, over #menuSection's ground */
  opacity: 0;
  transition: opacity 2.2s ease;
}

/* Awake. Going back to sleep is quicker than waking, so the player's
   return feels answered rather than ignored. */
.menu-idle.is-showing {
  opacity: 1;
}
.menu-idle:not(.is-showing) {
  transition: opacity 0.9s ease;
}

/* ---------- The rooms ---------- */
.mi-layer {
  position: absolute;
  inset: -6%;                        /* room for the drift to move into */
  opacity: 0;
  transition: opacity 2.6s ease;
  will-change: opacity, transform;
  backface-visibility: hidden;
}
.mi-layer.is-on {
  opacity: 1;
}

/* The scene fields arrive already lit and already noir — they are the
   game's own backgrounds, so they need no grading. The photographic
   fallback stills do: bled down and pushed to sepia so they belong to
   the same house. */
.mi-layer.is-still {
  filter: grayscale(0.35) sepia(0.24) contrast(1.1) brightness(0.62);
}

/* ---------- The drift ---------- */
/* Slow, wide, and never the same way twice in a row — a memory
   moving, not a slideshow panning. Transform only. */
.mi-drift-a {
  animation: miDriftA 22s linear forwards;
}
.mi-drift-b {
  animation: miDriftB 22s linear forwards;
}
@keyframes miDriftA {
  from { transform: scale(1.04) translate3d(-1.2%,  0.6%, 0); }
  to   { transform: scale(1.12) translate3d( 1.2%, -0.8%, 0); }
}
@keyframes miDriftB {
  from { transform: scale(1.12) translate3d( 1.0%, -0.6%, 0); }
  to   { transform: scale(1.04) translate3d(-1.0%,  0.9%, 0); }
}

/* ---------- The scrim ---------- */
/* The menu file is opaque and owns the middle, so the only place a
   room can be SEEN is the margins — keep them light. The far edges
   go down to hold the frame. */
.mi-scrim {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse 80% 70% at 50% 50%,
      rgba(58, 50, 56, 0.06) 0%,
      rgba(58, 50, 56, 0.26) 62%,
      rgba(26, 22, 25, 0.66) 100%),
    linear-gradient(180deg,
      rgba(26, 22, 25, 0.26) 0%,
      rgba(26, 22, 25, 0.00) 42%,
      rgba(26, 22, 25, 0.36) 100%);
}

/* ---------- Reduced motion ---------- */
/* Keep the memory, lose the drift. */
@media (prefers-reduced-motion: reduce) {
  .mi-drift-a,
  .mi-drift-b {
    animation: none;
    transform: scale(1.06);
  }
}
