/* The memory stage: the agent at the centre, its cards, its auras.
 *
 * Shared by the landing page and the dashboard so the two cannot drift. The
 * landing drives it from a synthetic event table; the dashboard drives it from
 * the user's own memory events. Only the data differs — the picture is one
 * implementation.
 */
.stage{display:grid;gap:14px;grid-template-columns:1fr}
  .stage-switches{display:grid;grid-template-columns:repeat(5,1fr);gap:0;
    border-top:1px solid var(--line)}
  @media (max-width:860px){
    .stage-switches{grid-template-columns:1fr 1fr}
  }

  .stagebox{position:relative;overflow:hidden;min-height:430px;
    background:
      radial-gradient(90% 70% at 50% 42%,rgba(153,13,250,.13),transparent 68%),
      linear-gradient(180deg,var(--panel2),var(--panel));
    border:1px solid var(--line);border-radius:14px}

  /* a faint lattice: the room, not a stage set */
  .s-lattice{position:absolute;inset:0;opacity:.5;
    background-image:
      linear-gradient(rgba(120,86,180,.10) 1px,transparent 1px),
      linear-gradient(90deg,rgba(120,86,180,.10) 1px,transparent 1px);
    background-size:36px 36px;
    mask-image:radial-gradient(75% 70% at 50% 45%,#000 30%,transparent 100%);
    -webkit-mask-image:radial-gradient(75% 70% at 50% 45%,#000 30%,transparent 100%)}

  /* the core */
  /* the canvas draws only the trails from card to agent */
  .s-canvas{position:absolute;inset:0;width:100%;height:100%;display:block}

  /* ---- the agent ------------------------------------------------- */
  .s-core{position:absolute;left:50%;top:47%;width:236px;height:236px;
    transform:translate(-50%,-50%);pointer-events:none}
  /* the asset carries its own margin — the mascot fills about 68% of its 1254
     canvas — so the box is larger than the character looks */
  .s-core img{width:100%;height:100%;object-fit:contain;display:block;
    filter:drop-shadow(0 0 26px rgba(153,13,250,.45))}
  .s-core{animation:float 5.2s ease-in-out infinite}
  @keyframes float{0%,100%{transform:translate(-50%,-50%) translateY(0)}
                   50%{transform:translate(-50%,-50%) translateY(-7px)}}

  /* ---- memory cards ---------------------------------------------- */
  /* Cards are the content: each is one thing the agent did with a memory —
     stored it, merged it, linked it, or threw it away — and it carries the
     time it happened. Saved cards converge into the agent and vanish;
     forgotten ones drift out and fade. That is the whole product, running. */
  .s-status{position:absolute;right:14px;top:11px;display:flex;align-items:center;gap:5px;
    font-family:var(--mono);font-size:9.5px;letter-spacing:.07em;color:#7d6f9c;
    text-transform:uppercase;white-space:nowrap}
  .s-status i{width:6px;height:6px;border-radius:50%;background:var(--good);
    box-shadow:0 0 8px var(--good);animation:blip 1.8s ease-in-out infinite}
  .s-status b{color:var(--good);font-weight:500}
  @keyframes blip{0%,100%{opacity:.45}50%{opacity:1}}
  @media (prefers-reduced-motion:reduce){ .s-status i{animation:none} }

  .mem{position:absolute;left:0;top:0;display:flex;align-items:center;gap:6px;
    padding:5px 9px;border-radius:8px;white-space:nowrap;
    background:rgba(16,9,30,.74);
    border:1px solid rgba(153,13,250,.42);
    font-family:var(--mono);font-size:10.5px;letter-spacing:.01em;color:#efe6ff;
    box-shadow:0 0 16px rgba(153,13,250,.14),inset 0 0 16px rgba(153,13,250,.05);
    will-change:transform,opacity;pointer-events:none}
  .mem .ic{font-size:10px;line-height:1;color:#c9a6ff}
  .mem .ts{color:#a294c4;font-size:8.5px;margin-left:2px}
  .mem[data-m="saved"] .ic{color:#8fe3b8}
  .mem[data-m="forget"]{border-color:rgba(226,100,122,.42)}
  .mem[data-m="forget"] .ic{color:#e2647a}

  /* depth: cards further back are smaller and dimmer. A flat cloud of equal
     cards reads as a screenshot; a few depths read as a place. */
  .mem[data-z="0"]{opacity:.50;filter:blur(.4px)}
  .mem[data-z="0"] .ic,.mem[data-z="0"] .ts{opacity:.75}

  .s-count{position:absolute;left:50%;bottom:12px;transform:translateX(-50%);
    display:flex;gap:18px;font-family:var(--mono);font-size:10.5px;
    letter-spacing:.06em;color:#6f6190;white-space:nowrap;text-transform:uppercase}
  /* The same three numbers, addressed by class so several stages can share a
     page. The single big stage still uses ids (#sLive, #cStored, #cForgot). */
  .s-live, .s-stored{color:#c9a6ff;font-weight:600;font-variant-numeric:tabular-nums}
  .s-forgot{color:#e2647a;font-weight:600;font-variant-numeric:tabular-nums}
  .s-count b{color:#c9a6ff;font-weight:600;font-variant-numeric:tabular-nums}
  .s-count .f b{color:#e2647a}

  .stage-note{position:absolute;left:13px;top:11px;font-family:var(--mono);
    font-size:10px;letter-spacing:.06em;color:#5f527c;text-transform:uppercase}

  /* Must come AFTER the base rules. Declared earlier, the base .s-core rule won
     on source order and the phone rendered the desktop 176px head. */
  @media (max-width:860px){
    .stagebox{min-height:430px}
    .s-core{width:100px;height:100px}
    /* 342px wide, minus an 88px head, leaves ~127px per side. The card has to
       fit in that or it gets cropped by the frame edge. */
    .mem{font-size:8.5px;padding:3px 6px;gap:4px}
    .mem .ic{font-size:9px}
    .mem .ts{display:none}
    .s-status{font-size:8.5px}
    .s-count{font-size:9.5px;gap:12px}
  }
