/* LOCUST presence layer (see locust-presence.js). Every terminal override is scoped to
   html[data-presence="live"], set only while the WebGL creature is actually running, so the plain
   terminal is unchanged when the layer is absent, loading, or has failed. */

.lp-root { position: fixed; inset: 0; z-index: 0; pointer-events: none; overflow: hidden; contain: strict; background: #0b0c0d; }
.lp-root[hidden], .lp-overlay[hidden] { display: none; }
.lp-canvas { display: block; width: 100%; height: 100%; }
.lp-overlay { position: fixed; inset: 0; z-index: 1; width: 100%; height: 100%; pointer-events: none; }

/* The terminal becomes a window onto it: panels turn translucent, text keeps a dark halo so it
   stays readable over the glyphs (the creature is also dimmed behind text in the shader). */
html[data-presence="live"] .screen-header { background: rgba(23, 17, 17, .86); }
html[data-presence="live"] .hud { background: rgba(16, 14, 13, .8); }
html[data-presence="live"] .response { background: linear-gradient(rgba(12, 11, 11, .7), rgba(12, 11, 11, .9) 42%); }
html[data-presence="live"] .choice { background: rgba(23, 22, 21, .84); }
html[data-presence="live"] .choice:hover,
html[data-presence="live"] .choice:focus-visible,
html[data-presence="live"] .choice[data-selected] { background: var(--text); }
html[data-presence="live"] .message p,
html[data-presence="live"] .speaker,
html[data-presence="live"] .turn-heading,
html[data-presence="live"] .response-prompt,
html[data-presence="live"] .ascii-figure,
html[data-presence="live"] .mount-lead,
html[data-presence="live"] .choice:not(:hover):not(:focus-visible):not([data-selected]) {
  text-shadow: 0 0 2px #000, 0 0 6px #000, 0 0 12px rgba(0, 0, 0, .85);
}
/* Before insertion (MOUNT) the drive's one reply is what it wants: the border breathes in its amber. */
html[data-presence="live"] #station[data-stage="dormant"] .choice[data-choice="insert_drive"] {
  border-left-color: var(--locust); box-shadow: inset 0 0 0 1px rgba(226, 189, 102, .32); animation: lp-want 3.4s ease-in-out infinite;
}
html[data-presence="live"] body.reduce-motion #station[data-stage="dormant"] .choice[data-choice="insert_drive"] { animation: none; }
html[data-presence="live"] #station[data-stage="dormant"] .stream { padding-top: 18px; }
/* the full-screen presence replaces the small figure-box creature (its text frame stays for AT) */
html[data-presence="live"] .creature-view { display: none; }

/* text rotting into the creature's glyphs: same monospace advance, never reflows */
.lp-bleed { font: inherit; }
.lp-vis { font: inherit; }
.lp-sr { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip-path: inset(50%); white-space: nowrap; border: 0; }
.lp-g { font-style: normal; color: #b98a34; text-shadow: 0 0 6px rgba(255, 176, 0, .35), 0 0 2px #000; }
.lp-g.lp-eye { color: #ffc400; text-shadow: 0 0 8px rgba(255, 196, 0, .6); }
.choice[data-selected] .lp-g, .choice:hover .lp-g { color: #6b4a12; text-shadow: none; }

/* Seen from across a room on a small CRT (LocustExperience.setViewing('room')): the text layer steps back
   so the creature carries the screen; up close ('close', the default) nothing changes. */
html[data-presence="live"] #station { transition: opacity .5s ease; }
html[data-presence="live"][data-viewing="room"] #station { opacity: .4; }
/* The single-eye beat (LocustPresence.face('eye')): the text steps back for a few seconds so the eye owns the
   glass; it stays in the document for assistive technology and comes back when the eye withdraws. */
html[data-presence="live"][data-face="eye"] #station { opacity: .16; transition: opacity .45s ease; }

@media (prefers-reduced-motion: reduce) {
  .lp-overlay { opacity: .85; }
}

/* Dual layout: the creature on its own screen (#locustScreen), not behind the terminal text. */
.lp-root.lp-pane { position: absolute; inset: 0; z-index: 0; }
